[meta-intel] gpio sus configuration as interrupt

Chew, Chiau Ee chiau.ee.chew at intel.com
Wed Mar 19 22:45:16 PDT 2014


Just in case you interpret wrongly. When I mentioned "Our GPIO driver do support input/output direction setting and interrupt" means the driver support direction setting and interrupt enabling.
If you were to use gpio as interrupt, the direction has to be IN.

Thanks,
Chiau Ee

From: Chew, Chiau Ee
Sent: Thursday, March 20, 2014 1:33 PM
To: 'Darren Hart'; VijayKumar N
Cc: Paul Eggleton; meta-intel at yoctoproject.org
Subject: RE: [meta-intel] gpio sus configuration as interrupt

When you "cat /sys/kernel/debug", you may see the following info:
GPIOs 82-125, platform/byt_gpio.2, byt_gpio.2,:
.
.
GPIOs 126-153, platform/byt_gpio.1, byt_gpio.1:
.
.
GPIOs 154-255, platform/byt_gpio.0, byt_gpio.0:


To interpret the above output:
byt_gpio.2- Sus core (SUS)
byt_gpio.1- North core (NCORE)
byt_gpio.0 - South core (SCORE)

For eg: Let's said you want to request for pin 2 in SUS core. Referring to the above output (byt_gpio.2 section), basically GPIOs82 is the pin0 of SUS core. Thus, if you want to request pin 2 of SUS core, your target pin number would be (82+2) = 84

Our GPIO driver do support input/output direction setting and interrupt.  Maybe you can take a look at drivers/mmc/host/sdhc-pci.c as reference on how to request gpio as irq in kernel driver code (refer to sdhci_pci_add_own_cd()).  And /Documentation/gpio.txt would be a good reference as well  as what Darren has mentioned.

Thanks,
Chiau Ee


From: Darren Hart [mailto:dvhart at linux.intel.com]
Sent: Thursday, March 20, 2014 12:13 PM
To: VijayKumar N
Cc: Paul Eggleton; Chew, Chiau Ee; meta-intel at yoctoproject.org<mailto:meta-intel at yoctoproject.org>
Subject: Re: [meta-intel] gpio sus configuration as interrupt

Gpiolib uses the Linux namespace for the GPIO lines, you just use those numbers, you do not differentiate based on register bank. See the output of /sys/kernel/debug/gpio for the ranges of each gpiochip (or bank in this case).

I personally have not done the gpios as interrupts so can't speak from experience there. The GPIO documentation does cover it though. Have you read through it?

--
Darren Hart
Yocto Project - Linux Kernel
Intel Open Source Technology Center

From: VijayKumar N <nvijaykumar.engineer at gmail.com<mailto:nvijaykumar.engineer at gmail.com>>
Date: Wednesday, March 19, 2014 at 20:35
To: Darren Hart <dvhart at linux.intel.com<mailto:dvhart at linux.intel.com>>
Cc: Paul Eggleton <paul.eggleton at linux.intel.com<mailto:paul.eggleton at linux.intel.com>>, "chiau.ee.chew" <chiau.ee.chew at intel.com<mailto:chiau.ee.chew at intel.com>>, <meta-intel at yoctoproject.org<mailto:meta-intel at yoctoproject.org>>
Subject: Re: [meta-intel] gpio sus configuration as interrupt

Thanks all for providing valuable information.
another query here,please provide your iputs:
Iam configuring GPIOs belonging to each of the register banks as direction input/ouput & also as interrupts from a different kernel driver.Iam using gpiolib APIs like gpio_request(),gpio_to_irq() to achive this.How do I differentiate configuring GPIOs related to each of the register bank ?Is it possible to configure GPIOs as input/output & also as interrupts?If yes,how?

Thanks & Regards,
Kumar

On Tue, Mar 18, 2014 at 11:09 PM, Darren Hart <dvhart at linux.intel.com<mailto:dvhart at linux.intel.com>> wrote:
On 3/18/14, 9:47, "Paul Eggleton" <paul.eggleton at linux.intel.com<mailto:paul.eggleton at linux.intel.com>> wrote:

>On Tuesday 18 March 2014 08:52:31 Darren Hart wrote:
>> On Intel there is an upcoming modification to the ACPI specification
>>that
>> will enable you to describe in ACPI via named method (_PRP) what you
>>can do
>> in Device Tree for the other architectures. In the meantime, board
>>files are
>> the most expedient option. For more detail on both the _PRP and board
>> files, see my "How not to write an x86 platform driver" presentation at
>>the
>> 2013 Embedded Linux Europe Conference:
>>
>>
>>http://events.linuxfoundation.org/sites/events/files/slides/x86-platform.
>>pdf
>>
>> And I think there is video..... but I can't seem to find it. Perhaps
>>your
>> google foo will prove superior ;-)
>
>http://www.youtube.com/watch?v=IZuNCN7wkqs
>
>(I watched it recently - great presentation BTW :)
Ah, great. Thank you Paul!

--
Darren Hart
Yocto Project - Linux Kernel
Intel Open Source Technology Center



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-intel/attachments/20140320/16fee7f6/attachment.html>


More information about the meta-intel mailing list