I2C device access

I’ve got a laptop that I’ve disconnected the touchpad on and pulled out GND, VCC, SCL, & SDA. I can hook these up to an analyze and see them come alive when looking for the touchpad.

Now I’ve got a breadboard and an I2C device I’ve purchased. I’ve wired things up and now want to get a driver going to access this device on the breadboard.

I’ve started with the SpbTestTool sample (I’m trying to create an SPB Peripheral driver). I specify my new device name ACPI\MyDevice in the inf. I’ve also set that device name up in the .asl. I’ve done an asl.exe mydevice.asl then asl.exe /loadtable -v mydevice.aml. I reboot. I see that this new data is in fact in the ACPI service key in the registry. I next do a devcon update mydevice.inf ACPI\MyDevice and am greeted with an error in c:\windows\inf\setupup.dev.log that there is no matching device. I never see activity on the wire so I’m thinking this is more of an ACPI type problem.

So, what I’m trying to do is simply get this KMDF driver so that I can read/write my device. From reading this: https://www.osr.com/nt-insider/2016-issue1/intro-to-spb-devices-and-drivers/ (great article btw, thank you) and many other articles, I’m feeling that if my device isn’t showing up in ACPI, I’m not going to be able to install this driver using devcon this way as it’s going to try to match my defined device name with what’s in the DSDT ACPI table.

My question is based on my current understanding of this area so I could be asking the wrong question, but my question is whether or not I can add just this single device using the loadtable this way, or if I need to rebuild the entire DSDT, add my device, and reload the whole table?

Also, if I’m doing something else wrong in this arena, I would very much like to know what it is. Thanks in advance.

~cooper

(Glad you liked the article and found it useful!)

I suspect the issue is that you need to add the device to the DSDT itself, or via an SSDT.

Extract the existing SSDT using the ASL compiler, and edit this to add your device definition (make sure it’s referring to the right controller), and the. Reload the modified SSDT. The process is described a bit here:

https://docs.microsoft.com/en-us/windows-hardware/drivers/sensors/install-the-sensor-driver

Use the concepts fro. That article, but not the actual ASL they provide, right? You already knew that…

I recommend you modify the SSDT because it’s shorter and easier than the DSDT… but you can modify either.

THAT should get you going.

Post back… let us know how it goes.

Peter
OSR
@OSRDrivers

@OP: do you actually need to connect your device directly to i2c bus of a PC?

If not, there’s a much easier way. Get a USB to I2C adapter, instead of vandalizing a laptop :slight_smile:

– pa