mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, <patches@opensource.cirrus.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 9/9] gpio: madera: Support Cirrus Logic Madera class codecs
Date: Mon, 26 Feb 2018 17:19:34 +0000	[thread overview]
Message-ID: <8e61dc88-e66a-f853-0ae0-b293a6e3bfc9@opensource.cirrus.com> (raw)
In-Reply-To: <CAHp75VebWArW6p4HbvnBYEsBqg5WJkn3Afh+cBNKCDS_W71LBg@mail.gmail.com>

On 26/02/18 14:16, Andy Shevchenko wrote:
> On Mon, Feb 26, 2018 at 3:05 PM, Richard Fitzgerald
> <rf@opensource.cirrus.com> wrote:
>> This adds support for the GPIOs on Cirrus Logic Madera class codecs.
>> Any pins not used for special functions (see the pinctrl driver) can be
>> used as general single-bit input or output lines. The number of available
>> GPIOs varies between codecs.
>>
>> Note that this is part of a composite MFD for these codecs and can only
>> be used with the corresponding MFD and other child drivers on those
>> silicon. The GPIO block on these codecs does not exist indepedently of
>> the rest of the MFD.
> 
>> +struct madera_gpio {
>> +       struct madera *madera;
>> +       struct gpio_chip gpio_chip;
>> +};
> 
> Why do you need this? I suppose one embeds or refers to the other.
> 

The gpio_chip is storage for the struct gpio_chip that we're using.
It allow us to create dynamically constructed struct gpio_chip based
on the template in madera_gpio_chip. See the code in madera_gpio_probe.

There are slight differences between the codecs (currently what we
care about is that they have different numbers of gpios.) and as we
still want to support pdata we also might have to change .base at
runtime.

It's possible to have multiple codecs of different type in one system
so patching the static madera_gpio_chip is not viable, we would need
different content for each codec.

As almost all members are the same, what we do is use madera_gpio_chip
as a template and copy it into the gpio_chip member of
struct madera_gpio for this codec. That becomes the struct gpio_chip
that we're actually using for this instance of this codec.

      reply	other threads:[~2018-02-26 17:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 13:05 [PATCH v8 0/9] Add support for Cirrus Logic CS47L35/L85/L90/L91 codecs Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 1/9] mfd: madera: Add register definitions for Cirrus Logic Madera codecs Richard Fitzgerald
2018-02-26 13:46   ` Andy Shevchenko
2018-02-26 17:41     ` Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 2/9] mfd: madera: Add DT bindings " Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 3/9] mfd: madera: Add common support " Richard Fitzgerald
2018-02-26 13:58   ` Fabio Estevam
2018-02-26 15:36     ` Richard Fitzgerald
2018-02-26 14:11   ` Andy Shevchenko
2018-02-26 17:06     ` Richard Fitzgerald
2018-02-26 17:19       ` Andy Shevchenko
2018-02-26 17:37         ` Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 4/9] mfd: madera: Register map tables for Cirrus Logic CS47L35 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 5/9] mfd: madera: Register map tables for Cirrus Logic CS47L85 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 6/9] mfd: madera: Register map tables for Cirrus Logic CS47L90/91 Richard Fitzgerald
2018-02-26 13:05 ` [PATCH v8 7/9] pinctrl: madera: Add DT bindings for Cirrus Logic Madera codecs Richard Fitzgerald
2018-03-21  8:04   ` Linus Walleij
2018-02-26 13:05 ` [PATCH v8 8/9] pinctrl: madera: Add driver " Richard Fitzgerald
2018-03-21  8:07   ` Linus Walleij
2018-02-26 13:05 ` [PATCH v8 9/9] gpio: madera: Support Cirrus Logic Madera class codecs Richard Fitzgerald
2018-02-26 14:16   ` Andy Shevchenko
2018-02-26 17:19     ` Richard Fitzgerald [this message]

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=8e61dc88-e66a-f853-0ae0-b293a6e3bfc9@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=robh+dt@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

all inboxes | Powered by JetHome®