From: Amelie DELAUNAY <amelie.delaunay@st.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh@kernel.org>, Lee Jones <lee.jones@linaro.org>,
"Mark Rutland" <mark.rutland@arm.com>,
Russell King <linux@armlinux.org.uk>,
Alexandre TORGUE <alexandre.torgue@st.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/6] dt-bindings: mfd: Add ST Multi-Function eXpander driver
Date: Thu, 22 Feb 2018 15:15:20 +0000 [thread overview]
Message-ID: <7667aba8-2c96-a16b-45f8-5d69a9613c7c@st.com> (raw)
In-Reply-To: <CACRpkdYfHgjAu=By-4pbtpYrbBjRLGEKJhzXobnM6RFYYgjaRw@mail.gmail.com>
On 02/22/2018 02:22 PM, Linus Walleij wrote:
> On Mon, Feb 19, 2018 at 4:59 PM, Amelie DELAUNAY <amelie.delaunay@st.com> wrote:
>> On 02/19/2018 12:19 AM, Rob Herring wrote:
>>> On Thu, Feb 08, 2018 at 03:27:32PM +0100, Amelie Delaunay wrote:
>
>>>> +- interrupts = must be <0>
>>>> +- gpio-controller: marks the device node as a GPIO controller
>>>> +- #gpio-cells: should be <2>, the first cell is the GPIO offset on this GPIO
>>>> + controller, the second cell is the gpio flags in accordance with
>>>> + <dt-bindings/gpio/st-mfx-gpio.h>.
>>>
>>> Custom flags? Use standard flags.
>>>
>>> DT binding headers should be part of this patch.
>>>
>> Custom flags because MFX GPIOs have several types:
>> - Output open drain with internal pull-up resistor
>> - Output open drain without internal pull-up resistor
>> - Output push pull without internal pull resistor
>> - Input with internal pull-up resistor
>> - Input with internal pull-down resistor
>> - Input floating
>> - Input analog.
>> Standard flags don't have pull up or down information. That's why I am
>> using custom flags, they overloads standard flags.
>
> This is because pull up/down and tristate/high z (floating)
> also known as PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
> is controlled by the pin control subsystem, not GPIO.
>
> If your hardware does even more pin control (like multiplexing)
> then I suggest that you create a pin control driver back-end for
> this and put the resulting driver in drivers/pinctrl.
>
> Some recent additions of expanders in drivers/pinctrl makes
> for great inspiration for this work. See for example:
> drivers/pinctrl/pinctrl-sx150x.c
> drivers/pinctrl/pinctrl-mcp23s08.c
>
> These are both combined pin control and GPIO drivers that
> we moved from drivers/gpio because we concluded that they
> do more than just GPIO. The GPIO lines are matches to
> pins using the GPIO ranges from the call to
> gpiochip_add_pin_range() and using gpiochip_generic_config()
> as the gpiochip .set_config() callback.
>
> It has been discussed to expose subsets of pin config to
> GPIO. Indeed, we already handle open drain/source and
> debounce by simply calling into the pin control back-end
> or handling it directly in the GPIO driver using the standard
> pin config properties.
>
> I am reluctant about this, I think the split of responsibilities
> is pretty nice.
>
> I'd recommend looking at the sx150x pin control driver and
> check if you can maybe take this direction with the patch?
>
Thanks for highlighting these examples. I will have a look on these!
Regards,
Amelie
> Yours,
> Linus Walleij
>
next prev parent reply other threads:[~2018-02-22 15:15 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 14:27 [PATCH 0/6] Introduce STMicroelectronics MultiFunction eXpander Amelie Delaunay
2018-02-08 14:27 ` [PATCH 1/6] dt-bindings: mfd: Add ST Multi-Function eXpander driver Amelie Delaunay
2018-02-18 23:19 ` Rob Herring
2018-02-19 15:59 ` Amelie DELAUNAY
2018-02-22 0:06 ` Rob Herring
2018-02-22 13:22 ` Linus Walleij
2018-02-22 15:15 ` Amelie DELAUNAY [this message]
2018-02-22 13:11 ` Linus Walleij
2018-02-22 15:19 ` Amelie DELAUNAY
2018-02-08 14:27 ` [PATCH 2/6] mfd: Add ST Multi-Function eXpander core driver Amelie Delaunay
2018-02-12 12:06 ` Lee Jones
2018-02-12 14:15 ` Philippe Ombredanne
2018-02-19 16:00 ` Amelie DELAUNAY
2018-02-19 16:57 ` Amelie DELAUNAY
2018-02-22 13:44 ` Linus Walleij
2018-02-22 15:32 ` Amelie DELAUNAY
2018-02-08 14:27 ` [PATCH 3/6] gpio: Add GPIO support for the ST Multi-Function eXpander Amelie Delaunay
2018-02-14 15:30 ` Andy Shevchenko
2018-02-19 17:13 ` Amelie DELAUNAY
2018-02-22 13:47 ` Linus Walleij
2018-02-22 15:33 ` Amelie DELAUNAY
2018-02-08 14:27 ` [PATCH 4/6] ARM: dts: stm32: add MFX support on I2C1 on stm32746g-eval Amelie Delaunay
2018-02-22 13:54 ` Linus Walleij
2018-02-22 15:34 ` Amelie DELAUNAY
2018-02-08 14:27 ` [PATCH 5/6] ARM: dts: stm32: add joystick support " Amelie Delaunay
2018-02-22 13:52 ` Linus Walleij
2018-02-22 15:35 ` Amelie DELAUNAY
2018-02-08 14:27 ` [PATCH 6/6] ARM: configs: stm32: enable ST MFX and its GPIO expander feature Amelie Delaunay
2018-02-22 13:06 ` [PATCH 0/6] Introduce STMicroelectronics MultiFunction eXpander Linus Walleij
2018-02-22 15:13 ` Amelie DELAUNAY
2018-03-01 22:28 ` 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=7667aba8-2c96-a16b-45f8-5d69a9613c7c@st.com \
--to=amelie.delaunay@st.com \
--cc=alexandre.torgue@st.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=robh@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®