Need help in ACPI driver for accessing touchscreen..

I’m new to ACPI functional drivers. I read the WDK about ACPI drivers.

The custom hardware we are making has the following hardware profile,

Windows OS —>LPC—>SMBus—>I2C—Touchscreen controller

Now, Should I have to write a ACPI driver ? In that case where do I get
the ACPI\xxxxx something similar to ASIM0000 given in WDM sample. All
that our hardware guy gave me is vendor=8086 device=8119 which is a PCI
device and vendor ID ? Can I use these as ACPI hardware ID ? How ?

Also, if i’m going to write an ACPI driver then can I use the
ACPI_OPREGION_ACCESS_AS_RAW as well as for region spaces -
ACPI_OPREGION_REGION_SPACE_PCI_CONFIG or
ACPI_OPREGION_REGION_SPACE_PCIBARTARGET ? (since the touchscreen
controller can be read and read only through the LPC ??? (thats how the
SMBus library in linux driver for the touch screen is doing…)


Regards
Esha

Your question is ambiguous, but that’s usually true for somebody starting on
a project.

Let’s start with the term “ACPI driver.” You could mean one of several
things:

  1. A driver which replaces the “ACPI driver” in Windows. I doubt that you
    mean this, but this is what the phrase you used directly implies.

  2. A driver which is enumerated because the ACPI BIOS contained a device
    object representing it, which in turn caused the ACPI driver in Windows to
    create a Windows Physical Device Object onto which your driver loads. This
    driver then has nothing more to do with ACPI, except that it can’t be found
    through other means. I doubt that this is what you mean because your
    hardware guy gave you some PCI IDs.

  3. A driver which implements an operation region space so that ACPI BIOS
    control methods can reference address spaces not otherwise supported by the
    in-box ACPI driver. I doubt that this is what you mean because it’s a
    relatively rare situation and an advanced topic.

  4. A driver that invokes BIOS control methods to interact with a device
    embedded on the motherboard. This driver may also register for
    notifications from the BIOS. I suspect that this is what you meant.

  5. A group of control methods and BIOS declarations in the form of “ACPI
    Source Language” (ASL) which implents some aspect of your device, delivered
    as BIOS code, not a Windows driver.

  6. A group of ACPI objects which implement WMI functionality, passed up to
    the OS by the in-box ACPI driver, so that an application can directly access
    your device through WMI.

Give us more to go on with respect to your problem and we can be more
helpful. (I just honestly don’t feel like typing a twenty-five-page
dissertation on all six of the above.)


Jake Oshins
(former ACPI guy)
Windows Kernel Team

This post implies no warranties and confers no rights.


“Eshanye.K.P” wrote in message news:xxxxx@ntdev…
> I’m new to ACPI functional drivers. I read the WDK about ACPI drivers.
>
> The custom hardware we are making has the following hardware profile,
>
> Windows OS —>LPC—>SMBus—>I2C—Touchscreen controller
>
> Now, Should I have to write a ACPI driver ? In that case where do I get
> the ACPI\xxxxx something similar to ASIM0000 given in WDM sample. All
> that our hardware guy gave me is vendor=8086 device=8119 which is a PCI
> device and vendor ID ? Can I use these as ACPI hardware ID ? How ?
>
> Also, if i’m going to write an ACPI driver then can I use the
> ACPI_OPREGION_ACCESS_AS_RAW as well as for region spaces -
> ACPI_OPREGION_REGION_SPACE_PCI_CONFIG or
> ACPI_OPREGION_REGION_SPACE_PCIBARTARGET ? (since the touchscreen
> controller can be read and read only through the LPC ??? (thats how the
> SMBus library in linux driver for the touch screen is doing…)
>
> –
> Regards
> Esha
>
>
>
>
>

Jake Oshins wrote:

Your question is ambiguous, but that’s usually true for somebody
starting on a project.

Let’s start with the term “ACPI driver.” You could mean one of several
things:

  1. A driver which replaces the “ACPI driver” in Windows. I doubt that
    you mean this, but this is what the phrase you used directly implies.

  2. A driver which is enumerated because the ACPI BIOS contained a device
    object representing it, which in turn caused the ACPI driver in Windows
    to create a Windows Physical Device Object onto which your driver
    loads. This driver then has nothing more to do with ACPI, except that
    it can’t be found through other means. I doubt that this is what you
    mean because your hardware guy gave you some PCI IDs.

As I’ve understand it, the device is connected to some I2C adapter
that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).

The BIOS does not know about this device and does not enumerate it.

So the question is, how to get this device enumerate and the driver
loaded, and how to send data over this I2C bus - using
same method as other ACPI enumerated devices that sit on I2C,
or by some other way.

Is this correct?

–pa

  1. A driver which implements an operation region space so that ACPI BIOS
    control methods can reference address spaces not otherwise supported by
    the in-box ACPI driver. I doubt that this is what you mean because it’s
    a relatively rare situation and an advanced topic.

  2. A driver that invokes BIOS control methods to interact with a device
    embedded on the motherboard. This driver may also register for
    notifications from the BIOS. I suspect that this is what you meant.

  3. A group of control methods and BIOS declarations in the form of “ACPI
    Source Language” (ASL) which implents some aspect of your device,
    delivered as BIOS code, not a Windows driver.

  4. A group of ACPI objects which implement WMI functionality, passed up
    to the OS by the in-box ACPI driver, so that an application can directly
    access your device through WMI.

Give us more to go on with respect to your problem and we can be more
helpful. (I just honestly don’t feel like typing a twenty-five-page
dissertation on all six of the above.)

I doubt it, actually. Since Windows doesn’t support I2C natively, the OP
would have to supply a driver for that bus itself. And then enumerating a
device below it would be his or her problem.

Enumerating the I2C controller itself is probably trivial, as the OP has a
PCI ID for it.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Team

This post implies no warranties and confers no rights.


As I’ve understand it, the device is connected to some I2C adapter
that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).

The BIOS does not know about this device and does not enumerate it.

So the question is, how to get this device enumerate and the driver
loaded, and how to send data over this I2C bus - using
same method as other ACPI enumerated devices that sit on I2C,
or by some other way.

Is this correct?

Jake Oshins wrote:

I doubt it, actually. Since Windows doesn’t support I2C natively, the
OP would have to supply a driver for that bus itself. And then
enumerating a device below it would be his or her problem.

Enumerating the I2C controller itself is probably trivial, as the OP
has a PCI ID for it.

Actually, I think my case is what exactly Pavel has explained -

As I’ve understand it, the device is connected to some I2C adapter
>that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).
>
>The BIOS does not know about this device and does not enumerate it.
>
>So the question is, how to get this device enumerate and the driver
>loaded, and how to send data over this I2C bus - using
>same method as other ACPI enumerated devices that sit on I2C,
>or by some other way.
>
>Is this correct?

To be more clear on this topic, the aim is to have touch screen support
to our device, so I have written a HID (based on vhid sample provided in
wdk) where the class driver is polling for touch report. Now i need to
read from the touch screen controller over I2C interface which sits
behind this Poulsbo SCH.

So I wrote a PCI driver with ven=8086 dev=8119 thinking that I would do
operations of I2C (this way I would send IOCTL from toucscreen HID to
this PCI driver to read the values). But then when I checked the PCI
configuration - tack->Parameters.StartDevice.AllocatedResources and
stack->Parameters.StartDevice.AllocatedResourcesTranslated are NULL
(during IRP_MN_START_DEVICE).

So when I posted my problem in a previous mail to ntdev, Doron asked a
question - “Is your touch screen actually enumerated by pci or some
other bus driver (like acpi.sys)?” (mail chain with subject : How to
debug or get the IRP_MN_START_DEVICE in the driver ?)

So, which made me investigate on ACPI… eventually i need to support
our devide for ACPI also but then currently i would be happy if its
functional.

When i wrote the PCI driver, in the inf file I had the Class=System and
PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add
new hardware’. Is there any suggestion on what type of driver i should
be writing to access the touchscreen ?

-Esha

Eshanye.K.P wrote:

When i wrote the PCI driver, in the inf file I had the Class=System and
PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add
new hardware’.

So now your driver is root enumerated, and not PCI.

– PA

So no bus is enumerating your device if you need to use the add new hw wiz. You should get that fixed with the hw guys :). But i think you have a bigger problem. A polled input device is a very very bad idea. It will consume lots of cpu, most likely directly effecting user responsiveness of the system, if on a laptop it will kill battery life, and might be slow enough that the user can see a lag between what they touch and when it is processed.

I strongly suggest you have your device be hw interrupt driven so there is no polling and is much friendlier to the system for all the reasons listed above.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Eshanye.K.P
Sent: Tuesday, January 13, 2009 3:33 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Need help in ACPI driver for accessing touchscreen…

Jake Oshins wrote:
> I doubt it, actually. Since Windows doesn’t support I2C natively, the
> OP would have to supply a driver for that bus itself. And then
> enumerating a device below it would be his or her problem.
>
> Enumerating the I2C controller itself is probably trivial, as the OP
> has a PCI ID for it.

Actually, I think my case is what exactly Pavel has explained -

>As I’ve understand it, the device is connected to some I2C adapter
>that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).
>
>The BIOS does not know about this device and does not enumerate it.
>
>So the question is, how to get this device enumerate and the driver
>loaded, and how to send data over this I2C bus - using
>same method as other ACPI enumerated devices that sit on I2C,
>or by some other way.
>
>Is this correct?

To be more clear on this topic, the aim is to have touch screen support
to our device, so I have written a HID (based on vhid sample provided in
wdk) where the class driver is polling for touch report. Now i need to
read from the touch screen controller over I2C interface which sits
behind this Poulsbo SCH.

So I wrote a PCI driver with ven=8086 dev=8119 thinking that I would do
operations of I2C (this way I would send IOCTL from toucscreen HID to
this PCI driver to read the values). But then when I checked the PCI
configuration - tack->Parameters.StartDevice.AllocatedResources and
stack->Parameters.StartDevice.AllocatedResourcesTranslated are NULL
(during IRP_MN_START_DEVICE).

So when I posted my problem in a previous mail to ntdev, Doron asked a
question - “Is your touch screen actually enumerated by pci or some
other bus driver (like acpi.sys)?” (mail chain with subject : How to
debug or get the IRP_MN_START_DEVICE in the driver ?)

So, which made me investigate on ACPI… eventually i need to support
our devide for ACPI also but then currently i would be happy if its
functional.

When i wrote the PCI driver, in the inf file I had the Class=System and
PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add
new hardware’. Is there any suggestion on what type of driver i should
be writing to access the touchscreen ?

-Esha


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron thinks that your biggest problem is that your input device is polled.
Doron is an old input guy, and I can see how he would think that.

I think that your biggest problem is that you’re trying to take control of
the I2C controller in an SCH. These are usually also in use by the BIOS.
If you have complete control over the BIOS in your system, then you can
ensure that the BIOS is not using it for anything. If you don’t, it’s
likely that you’ll discover that the BIOS will corrupt your attempts to use
the I2C bus in its System Management Mode code.

In any case, you can make your I2C driver enumerate the HID device. See the
WDF toaster bus sample for simple child device enumeration code. Root
enumeration isn’t a good answer here, as a root enumerated device will race
with the PCI-enumerated I2C driver when the system starts, plus you’ll have
some difficult interdependency problems through system power management,
driver upgrade lifecycle, etc.

Again, if the BIOS is using that I2C controller, the best solution usually
involves leaving it under control of the BIOS. Then modify the BIOS to pass
data to you through ACPI control methods. You can then write a driver which
invokes these ACPI control methods to retrieve your data.


Jake Oshins
(former ACPI guy who has the welts on his back from a project where he tried
to steal the I2C controller from a BIOS)
Windows Kernel Team

This post implies no warranties and confers no rights.


“Eshanye.K.P” wrote in message news:xxxxx@ntdev…
> Jake Oshins wrote:
>> I doubt it, actually. Since Windows doesn’t support I2C natively, the OP
>> would have to supply a driver for that bus itself. And then enumerating
>> a device below it would be his or her problem.
>>
>> Enumerating the I2C controller itself is probably trivial, as the OP has
>> a PCI ID for it.
>
> Actually, I think my case is what exactly Pavel has explained -
>
> >As I’ve understand it, the device is connected to some I2C adapter
> >that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).
> >
> >The BIOS does not know about this device and does not enumerate it.
> >
> >So the question is, how to get this device enumerate and the driver
> >loaded, and how to send data over this I2C bus - using
> >same method as other ACPI enumerated devices that sit on I2C,
> >or by some other way.
> >
> >Is this correct?
>
> To be more clear on this topic, the aim is to have touch screen support to
> our device, so I have written a HID (based on vhid sample provided in wdk)
> where the class driver is polling for touch report. Now i need to read
> from the touch screen controller over I2C interface which sits behind this
> Poulsbo SCH.
>
> So I wrote a PCI driver with ven=8086 dev=8119 thinking that I would do
> operations of I2C (this way I would send IOCTL from toucscreen HID to this
> PCI driver to read the values). But then when I checked the PCI
> configuration - tack->Parameters.StartDevice.AllocatedResources and
> stack->Parameters.StartDevice.AllocatedResourcesTranslated are NULL
> (during IRP_MN_START_DEVICE).
>
>
> So when I posted my problem in a previous mail to ntdev, Doron asked a
> question - “Is your touch screen actually enumerated by pci or some other
> bus driver (like acpi.sys)?” (mail chain with subject : How to debug or
> get the IRP_MN_START_DEVICE in the driver ?)
>
> So, which made me investigate on ACPI… eventually i need to support our
> devide for ACPI also but then currently i would be happy if its
> functional.
>
> When i wrote the PCI driver, in the inf file I had the Class=System and
> PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add new
> hardware’. Is there any suggestion on what type of driver i should be
> writing to access the touchscreen ?
>
> -Esha
>
>

It depends on the max allowed latency and how quickly the polling can be done. Think it a rectangular pulse series:

duty_cycle = time_spent_on_each_polling / (time_spent_on_each_polling+polling_period). One could remove the first term in the denominator depending on how the timer is scheduled.

time_spent_on_each_polling is determined by the design of hw and polling_period depends on the latency requirement. If duty_cycle works out very small, polling is ok. The total CPU cycles spent on polling is the integral of the rectangular pulse of the selected time interval.


Calvin Guan
Broadcom Corp.
Connecting Everything(r)

----- Original Message ----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, January 13, 2009 7:38:20 AM
Subject: RE: [ntdev] Need help in ACPI driver for accessing touchscreen…

So no bus is enumerating your device if you need to use the add new hw wiz. You should get that fixed with the hw guys :). But i think you have a bigger problem. A polled input device is a very very bad idea. It will consume lots of cpu, most likely directly effecting user responsiveness of the system, if on a laptop it will kill battery life, and might be slow enough that the user can see a lag between what they touch and when it is processed.

I strongly suggest you have your device be hw interrupt driven so there is no polling and is much friendlier to the system for all the reasons listed above.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: Eshanye.K.P
Sent: Tuesday, January 13, 2009 3:33 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Need help in ACPI driver for accessing touchscreen…

Jake Oshins wrote:
> I doubt it, actually. Since Windows doesn’t support I2C natively, the
> OP would have to supply a driver for that bus itself. And then
> enumerating a device below it would be his or her problem.
>
> Enumerating the I2C controller itself is probably trivial, as the OP
> has a PCI ID for it.

Actually, I think my case is what exactly Pavel has explained -

>As I’ve understand it, the device is connected to some I2C adapter
>that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).
>
>The BIOS does not know about this device and does not enumerate it.
>
>So the question is, how to get this device enumerate and the driver
>loaded, and how to send data over this I2C bus - using
>same method as other ACPI enumerated devices that sit on I2C,
>or by some other way.
>
>Is this correct?

To be more clear on this topic, the aim is to have touch screen support
to our device, so I have written a HID (based on vhid sample provided in
wdk) where the class driver is polling for touch report. Now i need to
read from the touch screen controller over I2C interface which sits
behind this Poulsbo SCH.

So I wrote a PCI driver with ven=8086 dev=8119 thinking that I would do
operations of I2C (this way I would send IOCTL from toucscreen HID to
this PCI driver to read the values). But then when I checked the PCI
configuration - tack->Parameters.StartDevice.AllocatedResources and
stack->Parameters.StartDevice.AllocatedResourcesTranslated are NULL
(during IRP_MN_START_DEVICE).

So when I posted my problem in a previous mail to ntdev, Doron asked a
question - “Is your touch screen actually enumerated by pci or some
other bus driver (like acpi.sys)?” (mail chain with subject : How to
debug or get the IRP_MN_START_DEVICE in the driver ?)

So, which made me investigate on ACPI… eventually i need to support
our devide for ACPI also but then currently i would be happy if its
functional.

When i wrote the PCI driver, in the inf file I had the Class=System and
PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add
new hardware’. Is there any suggestion on what type of driver i should
be writing to access the touchscreen ?

-Esha


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Now that you mention it, Jake, I was just wondering about (3); it’s
funny how life works sometimes. In any case, would you mind expanding
on it a little bit?

Thanks,

mm

Jake Oshins wrote:

Your question is ambiguous, but that’s usually true for somebody
starting on a project.

Let’s start with the term “ACPI driver.” You could mean one of several
things:

  1. A driver which replaces the “ACPI driver” in Windows. I doubt that
    you mean this, but this is what the phrase you used directly implies.

  2. A driver which is enumerated because the ACPI BIOS contained a device
    object representing it, which in turn caused the ACPI driver in Windows
    to create a Windows Physical Device Object onto which your driver
    loads. This driver then has nothing more to do with ACPI, except that
    it can’t be found through other means. I doubt that this is what you
    mean because your hardware guy gave you some PCI IDs.

  3. A driver which implements an operation region space so that ACPI BIOS
    control methods can reference address spaces not otherwise supported by
    the in-box ACPI driver. I doubt that this is what you mean because it’s
    a relatively rare situation and an advanced topic.

  4. A driver that invokes BIOS control methods to interact with a device
    embedded on the motherboard. This driver may also register for
    notifications from the BIOS. I suspect that this is what you meant.

  5. A group of control methods and BIOS declarations in the form of “ACPI
    Source Language” (ASL) which implents some aspect of your device,
    delivered as BIOS code, not a Windows driver.

  6. A group of ACPI objects which implement WMI functionality, passed up
    to the OS by the in-box ACPI driver, so that an application can directly
    access your device through WMI.

Give us more to go on with respect to your problem and we can be more
helpful. (I just honestly don’t feel like typing a twenty-five-page
dissertation on all six of the above.)

ACPI is largely made up of a language where the BIOS hands the OS a set of
objects and methods on those objects to accomplish basic motherboard
management tasks. This code is made up of an interpreted language, designed
for the task. (See chapters 16 and 17 of ACPI.)

This language, called AML, is made up of loads and stores from various
defined region spaces, which are themselves objects within the ACPI
namespace. You can, for instance, create an object which represents I/O
port 2012 and defines 7 bits within that register. Then you can read or
write those bits merely by referencing them as the target of a load or
store.

There are about seven predefined region spaces. ACPI 1.0 defined I/O,
memory, PCI Config, SMBus and “Embedded Controller.” The last was just
fictitious space exposed by the driver in Windows for the Embedded
Controller device that was also defined in ACPI, which itself was just a
conduit for passing data between the OS and the embedded processor that is
present in every laptop – it’s the part that operates even when the machine
is turned off.

You could, for instance, define a location in your BIOS that represented the
current state of charge of the battery. When the OS interpreted the method
for getting the battery data, it referenced that location in EC space, which
caused the EC driver to send a message to the EC asking for that byte in the
EC. Since your BIOS and your embedded controller firmware are delivered
from the same source, they can agree on what the various offsets in this
fictitious address space actually mean, and that’s opaque to the OS.

ACPI 2.0 added a couple more spaces, CMOS and a special space that
corresponds to whatever a specific PCI device’s BAR is currently pointing
to, allowing you to reference a PCI device in a relative fashion without
knowing what is currently written in a BAR.

ACPI 3.0, to my memory, didn’t add any spaces. ACPI 4.0 might add some, but
I’m no longer really involved.

In any case, you can provide your own address space, with a type code in a
vendor-defined range (above 0xC0 if I remember correctly.) Then your BIOS
can reference this space and it will end up in your provider driver asking
you what to do about reads and writes. This is useful if you’re trying to
glue ACPI into a system with a fairly sophisticated management controller,
as with a high-end server chassis.

In truth, though, not many people use this feature, as it only works when
your driver is present, and because triggering a System Management Interrupt
seems much more straightforward to most BIOS guys.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Team

This post implies no warranties and confers no rights.


“Martin O’Brien” wrote in message
news:xxxxx@ntdev…
> Now that you mention it, Jake, I was just wondering about (3); it’s funny
> how life works sometimes. In any case, would you mind expanding on it a
> little bit?
>
>
> Thanks,
>
> mm
>
> Jake Oshins wrote:
>> Your question is ambiguous, but that’s usually true for somebody starting
>> on a project.
>>
>> Let’s start with the term “ACPI driver.” You could mean one of several
>> things:
>>
>> 1) A driver which replaces the “ACPI driver” in Windows. I doubt that
>> you mean this, but this is what the phrase you used directly implies.
>>
>> 2) A driver which is enumerated because the ACPI BIOS contained a device
>> object representing it, which in turn caused the ACPI driver in Windows
>> to create a Windows Physical Device Object onto which your driver loads.
>> This driver then has nothing more to do with ACPI, except that it can’t
>> be found through other means. I doubt that this is what you mean because
>> your hardware guy gave you some PCI IDs.
>>
>> 3) A driver which implements an operation region space so that ACPI BIOS
>> control methods can reference address spaces not otherwise supported by
>> the in-box ACPI driver. I doubt that this is what you mean because it’s
>> a relatively rare situation and an advanced topic.
>>
>> 4) A driver that invokes BIOS control methods to interact with a device
>> embedded on the motherboard. This driver may also register for
>> notifications from the BIOS. I suspect that this is what you meant.
>>
>> 5) A group of control methods and BIOS declarations in the form of “ACPI
>> Source Language” (ASL) which implents some aspect of your device,
>> delivered as BIOS code, not a Windows driver.
>>
>> 6) A group of ACPI objects which implement WMI functionality, passed up
>> to the OS by the in-box ACPI driver, so that an application can directly
>> access your device through WMI.
>>
>> Give us more to go on with respect to your problem and we can be more
>> helpful. (I just honestly don’t feel like typing a twenty-five-page
>> dissertation on all six of the above.)
>>
>

> In truth, though, not many people use this feature, as it only works when

your driver is present, and because triggering a System Management Interrupt
seems much more straightforward to most BIOS guys.

Am I correct that this whole feature is intended to replace the SMM BIOS code of the EC firmware with the Windows driver?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

+1

and it gets even more interesting.

The latency may get too high, as the interrupts usually are
handled in their DPC - which can be delayed for tens of ms.

While the DPC waits in the queue, the irq is disabled,
so all new interrupts are lost until the DPC enables them.
This effectively makes interrupt-driven handling
to behave like polling with variable period ~ DPC latency.

Multicore CPUs are not helpful with legacy OS’s, these
tend to drop all interrupts and DPCs to one CPU.
So the driver could as well use something else that scales better:
work items, threads, timer DPC…

Back to the OP… I2C is rather slow, so
the interrupt latency really depends on their ISA or PCI interface.
A good controller greatly improves both performance & power saving - and
v.v.

Regards,
–PA

Calvin Guan wrote:

It depends on the max allowed latency and how quickly the polling can be done. Think it a rectangular pulse series:

duty_cycle = time_spent_on_each_polling / (time_spent_on_each_polling+polling_period). One could remove the first term in the denominator depending on how the timer is scheduled.

time_spent_on_each_polling is determined by the design of hw and polling_period depends on the latency requirement. If duty_cycle works out very small, polling is ok. The total CPU cycles spent on polling is the integral of the rectangular pulse of the selected time interval.


Calvin Guan
Broadcom Corp.
Connecting Everything(r)

----- Original Message ----
From: Doron Holan
> To: Windows System Software Devs Interest List
> Sent: Tuesday, January 13, 2009 7:38:20 AM
> Subject: RE: [ntdev] Need help in ACPI driver for accessing touchscreen…
>
> So no bus is enumerating your device if you need to use the add new hw wiz. You should get that fixed with the hw guys :). But i think you have a bigger problem. A polled input device is a very very bad idea. It will consume lots of cpu, most likely directly effecting user responsiveness of the system, if on a laptop it will kill battery life, and might be slow enough that the user can see a lag between what they touch and when it is processed.
>
> I strongly suggest you have your device be hw interrupt driven so there is no polling and is much friendlier to the system for all the reasons listed above.
>
> d
>
> Sent from my phone with no t9, all spilling mistakes are not intentional.
>
> -----Original Message-----
> From: Eshanye.K.P
> Sent: Tuesday, January 13, 2009 3:33 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Need help in ACPI driver for accessing touchscreen…
>
>
> Jake Oshins wrote:
>> I doubt it, actually. Since Windows doesn’t support I2C natively, the
>> OP would have to supply a driver for that bus itself. And then
>> enumerating a device below it would be his or her problem.
>>
>> Enumerating the I2C controller itself is probably trivial, as the OP
>> has a PCI ID for it.
>
> Actually, I think my case is what exactly Pavel has explained -
>
>> As I’ve understand it, the device is connected to some I2C adapter
>> that sits behind the LPC bridge of Poulsbo SCH (ven=8086 dev=8119).
>>
>> The BIOS does not know about this device and does not enumerate it.
>>
>> So the question is, how to get this device enumerate and the driver
>> loaded, and how to send data over this I2C bus - using
>> same method as other ACPI enumerated devices that sit on I2C,
>> or by some other way.
>>
>> Is this correct?
>
> To be more clear on this topic, the aim is to have touch screen support
> to our device, so I have written a HID (based on vhid sample provided in
> wdk) where the class driver is polling for touch report. Now i need to
> read from the touch screen controller over I2C interface which sits
> behind this Poulsbo SCH.
>
> So I wrote a PCI driver with ven=8086 dev=8119 thinking that I would do
> operations of I2C (this way I would send IOCTL from toucscreen HID to
> this PCI driver to read the values). But then when I checked the PCI
> configuration - tack->Parameters.StartDevice.AllocatedResources and
> stack->Parameters.StartDevice.AllocatedResourcesTranslated are NULL
> (during IRP_MN_START_DEVICE).
>
>
> So when I posted my problem in a previous mail to ntdev, Doron asked a
> question - “Is your touch screen actually enumerated by pci or some
> other bus driver (like acpi.sys)?” (mail chain with subject : How to
> debug or get the IRP_MN_START_DEVICE in the driver ?)
>
> So, which made me investigate on ACPI… eventually i need to support
> our devide for ACPI also but then currently i would be happy if its
> functional.
>
> When i wrote the PCI driver, in the inf file I had the Class=System and
> PCI\VEN_8086&DEV_8119 … also, i installed this driver through - ‘Add
> new hardware’. Is there any suggestion on what type of driver i should
> be writing to access the touchscreen ?
>
> -Esha
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
>

No. The SMM BIOS is different from EC firmware. The EC uses a low-power
embedded processor. The early implementations were all i8051’s, but I have
no idea what would be in use now. I suspect that it would be something in
the ARM family today.

The SMM BIOS runs on the main processor.

This feature of ACPI (custom operation region spaces) was intended to allow
a driver which speaks some protocol with an embedded chassis manager to
directly expose its function to the OS. Most BIOS guys, however, just put
that protocol in SMM rather than in a driver and trigger it by writing to an
I/O port which is configured in the chipset to deliver a System Management
Interrupt. This has the effect of suspending the OS for arbitrarily long
periods of time, but most BIOS guys don’t really see that as a problem.


Jake Oshins
Hyper-V I/O Architect
Windows Kernel Team

This post implies no warranties and confers no rights.


“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>> In truth, though, not many people use this feature, as it only works when
>> your driver is present, and because triggering a System Management
>> Interrupt
>> seems much more straightforward to most BIOS guys.
>
> Am I correct that this whole feature is intended to replace the SMM BIOS
> code of the EC firmware with the Windows driver?
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>