linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] pinctrl: add Intel BayTrail GPIO/pinctrl support
Date: Wed, 19 Jun 2013 13:28:37 +0300	[thread overview]
Message-ID: <51C187D5.7040101@linux.intel.com> (raw)
In-Reply-To: <CACRpkdb2M-TBHbZf=hQE_0ihc4L5amdoFw5QQg2OSFXaMrH8mA@mail.gmail.com>

On 06/18/2013 06:17 PM, Linus Walleij wrote:
> On Tue, Jun 18, 2013 at 1:33 PM, Mathias Nyman
> <mathias.nyman@linux.intel.com>  wrote:
>
>> Add support for gpio on Intel BayTrail platforms. BayTrail supports 3 banks
>> of gpios called SCORE, NCORE ans SUS with 102, 28 and 44 gpio pins.
>> Supports gpio interrupts and ACPI gpio events
>>
>> Pins may be muxed to alternate function instead of gpio by firmware.
>> This driver does not touch the pin muxing and expect firmare
>> to set pin muxing and pullup/down properties properly.
>>
>> Signed-off-by: Mathias Nyman<mathias.nyman@linux.intel.com>
>
> I have a feeling this driver will evolve quite a bit and eventually
> register a pure pinctrl interface as well (currently it's only using
> the ranges as some data container...)
>
> Anyway, it's a good starting point and obviously (I guess?)
> gets your hardware up an ticking, so let's take this as a
> starting point.
>
> So patch applied.
>

Thanks, much appreciated.
We'll see how it evolves.

> This thing only seems to use gpiolib-acpi.c for the basic
> device matching and IRQ handling backend, is that correct?

It only uses gpiolib-acpi.c for handling GPIO-signaled ACPI Events,
which are like SCI events on hardware reduced ACPI platforms.

Basically It's ACPI saying "I have a firmware method that needs to be 
run if a certain gpio is triggered, please do that for me"

So the acpi_gpiochip_request_interrupts() registers interrupt handlers 
which call ACPI firmware methods for those gpio interrupts.

Otherwise gpiolib-acpi.c is useful for other device drivers to translate 
ACPI gpio resource numbers to linux gpio numbers. In ACPI tables the 
gpio resource numbers are per controller and zero based.
>
> What I'm thinking of moving forward is that I have seen
> ACPI fragments with things like "PullUp" etc, which is pinctrl
> domain, so we may come to need some generic ACPI helpers
> inside drivers/pinctrl as well sooner or later.

Probably yes, I'm not an expert on ACPI (or pinctrl), but ACPI5 added 
the GpioInt and GpioIo resources for devices. GpioInt resource 
descriptor has the follwing arguments: GpioInt(EdgeLevel, ActiveLevel, 
Shared, PinConfig, DebounceTimeout, ResourceSource,
esourceSourceIndex, ResourceUsage, DescriptorName, VendorData) {PinList}

Where the PinConfig argument can be PullDefault, PullUp, PullDown, 
PullNone or some vendor specific value.

ResourceSource tells which gpio controller the pin belongs to.

Right now drivers only have helpers for translating the ACPI gpio pin 
number to linux gpio number.

-Mathias

  reply	other threads:[~2013-06-19 10:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 11:33 [PATCH v3 0/1] Pinctrl/gpio driver for Intel Baytrail platforms Mathias Nyman
2013-06-18 11:33 ` [PATCH v3 1/1] pinctrl: add Intel BayTrail GPIO/pinctrl support Mathias Nyman
2013-06-18 15:17   ` Linus Walleij
2013-06-19 10:28     ` Mathias Nyman [this message]
2014-04-11 22:54   ` Timur Tabi
2014-04-14  7:52     ` Mathias Nyman
2014-04-14 15:11       ` Timur Tabi
2014-04-15 10:01         ` Mathias Nyman
2014-04-17 16:47           ` Timur Tabi
2014-04-23 11:46             ` Mathias Nyman
2014-04-23 12:07               ` Timur Tabi
2014-04-23 13:59                 ` Westerberg, Mika
2014-04-23 15:14                   ` Timur Tabi
2014-04-23 22:20                     ` Linus Walleij
2014-04-23 22:54                       ` Timur Tabi
2014-04-24  6:27                       ` Westerberg, Mika
2014-04-24 11:20                         ` Timur Tabi
2014-04-24 11:38                           ` Westerberg, Mika
2014-04-24  6:35                     ` Westerberg, Mika
2014-04-24 11:18                       ` Timur Tabi
2014-04-24 11:58                         ` Westerberg, Mika
2014-04-24 13:29                           ` Linus Walleij
2014-04-24 15:25                           ` Timur Tabi
2014-04-25  7:41                             ` Westerberg, Mika
2014-04-25 10:36                               ` Linus Walleij
2014-04-25 16:13                               ` Timur Tabi
2014-04-25 16:21                                 ` Rafael J. Wysocki
2014-04-25 16:31                                   ` Timur Tabi
2014-05-02 22:31                                     ` Linus Walleij
2014-04-23 22:17     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C187D5.7040101@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).