none
how to read Interrupt pin state in driver RRS feed

  • Question

  • i am writing a SPI driver about fingerprint just now, i want to read the interrupt Line state, i can read&write a GPIO Line state throug IOCTL_GPIO_WRITE_PINS and IOCTL_GPIO_READ_PINS, but the WdfIoTargetFormatRequestForIoctl only support WDFIOTARGET not support WDFINTERRUPT, i can't find other API to read interrupt Line state, how can i do? follow the ACPI definsion about GPIO.

    Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
                {
                    Name (UBUF, ResourceTemplate ()
                    {
                        SpiSerialBusV2 (0x0000, PolarityLow, FourWireMode, 0x08,
                            ControllerInitiated, 0x000F4240, ClockPolarityLow,
                            ClockPhaseFirst, "\\_SB.PCI0.SPI0",
                            0x00, ResourceConsumer, , Exclusive,
                            )
                        GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionOutputOnly,
                            "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0000
                            }
                        GpioInt (Edge, ActiveHigh, Exclusive, PullNone, 0x0000,
                            "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer, ,
                            )
                            {   // Pin list
                                0x0000
                            }
                    })
                    CreateWordField (UBUF, 0x3B, RST0)
                    CreateWordField (UBUF, 0x63, INT0)
                    RST0 = GNUM (0x0202000F)
                    INT0 = GNUM (0x02030010)
                    Return (UBUF) /* \_SB_.PCI0.SPI0.FPRT._CRS.UBUF */

    Monday, February 13, 2017 8:10 AM

All replies

  • Tuesday, February 14, 2017 8:00 PM
  • As I understand it, the "pin number" namespace is global here.  What I mean by that is that is your DSDT says that pin 0000 is both an I/O line and an interrupt line.  That's probably not the case.  If you make the GpioInt table entry 0x0001, can you read it with the ioctl?

    If the interrupt has fired, your EvtInterruptIrq should be getting called.  Is it?


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Tuesday, February 14, 2017 11:09 PM
  • thank you very much, the I/O line and interrupt line both use pin 0000, but the OEM says the pin list set is not error, and i can control the I/O line through WdfIoTargetFormatRequestForIoctl to read/write, and the time when the interrupt has fired, the EVTInterruptlrq can be called.I don't find a appropriate WDF interface function to read interrupt line state, WdfIoTargetFormatRequestForIoctl can send IOCTL_GPIO_READ_PINS to read a line state, but the first parameter of WdfIoTargetFormatRequestForIoctl is WDFIOTARGET handle, not support WDFINTERRUPT handle.

    Wednesday, February 15, 2017 2:22 AM