xxxxx@gmail.com wrote:
I’m founding solution to make a HID over I2C touch panel work on Win7. IMHO I2Cs is just a subset of PCIs (correct me if i’m wrong plz). The first step I want to do is make a hello world driver based on pcidrv sample. But I don’t know what hardware id to use. I think it should be PCI\VEN_8086&DEV_9C62 because in Intel documentation I see that device id for I2C is 9C62.
You have some dangerous misunderstandings here that need to be cleared
up before you can think about driver work.
I2C is nothing like PCI. I2C is an extremely simple 2-wire serial bus
to allow chips to talk to each other. (Indeed, the name stands for
“Inter-Integrated Circuit bus”).
I2C is not plug-and-play. I2C devices cannot identify themselves. Each
I2C device has a hardcoded 7-bit address, but you have to KNOW that
address to talk to the device. You have to KNOW that there is an EEPROM
at address A0, or a camera sensor at address 38, or an audio chip at
address 60. You can’t find that out. You can find out if something
responds at address XX, but even knowing that you can’t tell what it is.
I2C has traditionally not been relevant to PC motherboards, because
there’s no way to connect it to a processor. Embedded processors almost
always have direct I2C ports, but x86 chips do not. Your graphics card
gets the EDID information from your monitor via I2C, but that’s handled
entirely by the graphics chip, driven by the graphics driver, not by a
general purpose I2C driver.
Your 8086/9C62 device is really a fake device. The Intel “8 series
chipset”, which is what you have, does have a couple of I2C controllers,
but they aren’t addressed like normal PCI devices. You have to go
through the PCI chipset registers. That’s why your panel is attached to
an ACPI device. The ACPI driver, in this case, knows how to use the
SMBus within the chipset to do I2C reads and writes.
So, to do what you want to do, you’d have to recreate that ACPI driver.
On other direction Win7 won’t support I2C, Win8 support I2C but I wondering what is the level of “support” here? Of course Win7 don’t have SPB and HID over I2C but the “lower mechanism” should be still available. I mean when a device connected to system through I2C bus, it should be available for the OS?
No. There is no way to make an I2C device “available for OS”. You can
have a driver that happens to communicate via I2C, but you’ll have to
figure out how to get it loaded (for example, through ACPI), and you’ll
have to figure out how to reach the I2C controller. That requires
in-depth knowledge of the PCI chipset on your motherboard.
I’m totaly a newbie for driver programming, especially at this level.
This is not really a task for a newbie. You will be dealing at a very
low-level here, talking directly to hardware registers, not talking to a
nice memory-mapped abstraction provided by PCI.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.