From: Darren Hart <dvhart@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Arnd Bergmann <arnd@arndb.de>
Cc: Alexandre Courbot <gnurou@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ortiz, Samuel" <samuel.ortiz@intel.com>
Subject: Re: [RFC PATCH] gpio: support for GPIO forwarding
Date: Wed, 14 Jan 2015 08:32:41 -0800 [thread overview]
Message-ID: <54B69A29.6060201@linux.intel.com> (raw)
In-Reply-To: <CACRpkdY-yFKsYbCrMpnViMFoQEugyGQivaV0M+GDzLrbDO7i6Q@mail.gmail.com>
Ugh, Samuel actually Cc'd this time...
On 1/14/15 4:58 AM, Linus Walleij wrote:
> On Thu, Dec 18, 2014 at 9:23 AM, Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
>
>> This makes it possible to assign GPIOs at runtime. The
>> motivation for it is because of need to forward GPIOs from
>> one device to an other. That feature may be useful for
>> example with some mfd devices, but initially it is needed
>> because on some Intel Braswell based ACPI platforms the GPIO
>> resources controlling signals of the USB PHY are given to
>> the controller device object for whatever reason, so the
>> driver of that controller needs be able to pass them to the
>> PHY device somehow.
>>
>> So basically this is meant to allow patching of bad (bad
>> from Linux kernels point of view) hardware descriptions
>> provided by system fw in the drivers.
>>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>> ---
>>
>> Hi,
>>
>> I'm sending this first as a RFC in case you guys have some better
>> idea how to solve our problem. I actually already have couple
>> platforms where the GPIO resources are given to the "wrong" device
>> objects now.
>>
>> Originally we were thinking about simply handling our problem with
>> hacks to the PHY drivers, basically also checking if the parent has
>> GPIOs. That would only work if the controller is always the parent,
>> which it's not, but even if it was, it would be too risky. The PHY
>> drivers don't know which controller they are attached to, so what is
>> to say that the GPIOs aren't really attached to the controller.
>>
>> So the safest way to handle our problem is to deal with it in quirks
>> in the controller drivers. Solving it by bouncing the GPIOs did not
>> feel ideal there doesn't seem to be any other way. The API is copied
>> from clkdev (clk_register_clkdev). In the end it's really only one
>> function for adding the lookups and one for removing them.
>>
>> The way it's implemented is by modifying the current style of handling
>> the lookups a little bit. The per device lookup table is basically
>> reverted back to the single linked-list format since it seems that
>> these lookups may have to be assigned from several sources.
>
> Oh ain't that great.
>
> So now we start patching around the kernel because the ACPI
> tables are erroneous for GPIOs. I'd like some feedback from
> Rafael &| Darren on this patch, i.e. if you two think this is a good
> way of accounting for bad GPIO descriptions in ACPI tables then
> ACK this patch.
>
> I guess the other option would be to fix up the ACPI DSDT
> itself to put resources right, correct? Is this not possible?
>
> Alexandre also need to ACK it before I dare do anything with
> it.
>
> Do we want to use the same mechanism for augmenting
> bad device trees too?
>
> What I like about it so far is the create/remove symmetry
> though.
>
> Yours,
> Linus Walleij
>
--
Darren Hart
Intel Open Source Technology Center
next prev parent reply other threads:[~2015-01-14 16:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 8:23 [RFC PATCH] gpio: support for GPIO forwarding Heikki Krogerus
2015-01-08 8:25 ` Heikki Krogerus
2015-01-15 9:21 ` Rafael J. Wysocki
2015-01-14 12:58 ` Linus Walleij
2015-01-14 16:32 ` Darren Hart
2015-01-15 9:28 ` Rafael J. Wysocki
2015-01-15 9:40 ` Heikki Krogerus
2015-01-14 16:32 ` Darren Hart [this message]
2015-01-19 5:59 ` Alexandre Courbot
2015-01-19 11:53 ` Heikki Krogerus
2015-01-20 12:16 ` Linus Walleij
2015-01-20 21:25 ` Rafael J. Wysocki
2015-01-22 2:57 ` Alexandre Courbot
2015-01-22 16:14 ` Rafael J. Wysocki
2015-01-23 11:21 ` Heikki Krogerus
2015-01-23 15:14 ` Rafael J. Wysocki
2015-01-26 13:06 ` Heikki Krogerus
2015-02-10 9:32 ` Alexandre Courbot
2015-02-10 15:10 ` Rafael J. Wysocki
2015-02-12 12:46 ` Heikki Krogerus
2015-02-24 20:34 ` David Cohen
2015-02-25 1:34 ` Alexandre Courbot
2015-02-25 18:25 ` David Cohen
2015-03-07 22:13 ` Linus Walleij
2015-01-22 8:17 ` Linus Walleij
2015-01-22 16:12 ` Rafael J. Wysocki
2015-01-30 14:48 ` Linus Walleij
2015-01-30 16:17 ` Rafael J. Wysocki
2015-02-04 9:51 ` Linus Walleij
2015-02-04 14:11 ` Heikki Krogerus
2015-02-10 9:44 ` Alexandre Courbot
2015-02-12 12:38 ` Heikki Krogerus
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=54B69A29.6060201@linux.intel.com \
--to=dvhart@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gnurou@gmail.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=samuel.ortiz@intel.com \
/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).