linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Ricard <christophe.ricard@gmail.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: rjw@rjwysocki.net, Len Brown <lenb@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	andriy.shevchenko@linux.intel.com, linux-i2c@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	Christophe Ricard <christophe-h.ricard@st.com>
Subject: Re: [PATCH v3 0/2] ACPI: Add irq_type to gpio interrupt
Date: Sat, 5 Dec 2015 00:36:19 +0100	[thread overview]
Message-ID: <56622373.7020406@gmail.com> (raw)
In-Reply-To: <20151201130324.GE1593@lahna.fi.intel.com>

Hi Mika,


On 01/12/2015 14:03, Mika Westerberg wrote:
[...]
>>     Now for the same kind of i2c driver using acpi description, the GpioInt
>>     polarity/type is at the moment never kept in the irq property.
>>     It is possible to check that following about the same path...
>>     i2c_device_probe (drivers/i2c/i2c-core.c), retrieves irq property from
>>     acpi_dev_gpio_irq_get but does not save the irq_type.
>>     This would allow not to have to use an additional gpio field and all
>>     the configuration step to configure the gpio interrupt correctly in a
>>     device driver and taking a real benefit of the GpioInt acpi keyword
>>     compare to GpioIo keyword.
>>     Most the of the drivers based on acpi description retrieve gpio number
>>     to assign an interrupt and a fix polarity. I believe my patchset
>>     proposal would improve this and allow to
>>     be much closer with devicetree.
>>     Do you see any issue with this ?
> No, but I wonder if it would be better to do this in acpi_dev_gpio_irq_get()
> instead of acpi_find_gpio() which gets called everytime a GPIO is looked up?
I believe, setting the irq type requires triggering and polarity data 
stored into a struct acpi_resource_gpio.

acpi_dev_gpio_irq_get call acpi_get_gpiod_by_index which run acpi_find_gpio.

Actually acpi_dev_gpio_irq_get is called everytime an i2c device slave 
is probed, acpi_find_gpio will get called to "register" gpios.
If done correctly, i think this will be done only once...

The only improvement i may see would be to add an extra field in the 
acpi_gpio_info structure in drivers/gpio/gpiolib.h (for example int 
irq_type).
And call irq_set_irq_type in acpi_dev_gpio_irq_get if the gpio is an 
interrupt.

I guess the current proposal and this one are equivalent...

What do you think ?

Best Regards
Christophe

  reply	other threads:[~2015-12-04 23:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 22:47 [PATCH v3 0/2] ACPI: Add irq_type to gpio interrupt Christophe Ricard
2015-11-30 22:47 ` [PATCH v3 1/2] acpi: Rename acpi_gsi_get_irq_type to acpi_get_irq_type and export symbol Christophe Ricard
2015-11-30 22:47 ` [PATCH v3 2/2] ACPI / gpio: Add irq_type when a gpio is used as an interrupt Christophe Ricard
2015-12-10 17:00   ` Linus Walleij
2015-12-01  1:03 ` [PATCH v3 0/2] ACPI: Add irq_type to gpio interrupt Wolfram Sang
2015-12-01  7:03   ` Christophe Ricard
2015-12-01 11:21 ` Mika Westerberg
     [not found]   ` <CALD+uuxJw5tQ2XY99nHigXdNkcXGnng+r9NZ8H9TqUF9GbgW=A@mail.gmail.com>
2015-12-01 13:03     ` Mika Westerberg
2015-12-04 23:36       ` Christophe Ricard [this message]
2015-12-07 10:52         ` Mika Westerberg
2015-12-07 10:53           ` Christophe Henri RICARD

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=56622373.7020406@gmail.com \
    --to=christophe.ricard@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=christophe-h.ricard@st.com \
    --cc=gnurou@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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).