Re: [PATCH 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig

From: Andy Shevchenko
Date: Thu Jan 19 2017 - 07:18:46 EST


On Thu, 2017-01-19 at 12:48 +0300, Mika Westerberg wrote:
> This series makes it possible to configure pins from GPIO chip drivers
> by
> implementing a new callback .set_config(). This callback replaces the
> existing .set_single_ended() and .set_debounce() simply because adding
> new
> callbacks for each possible configuration type does not scale. So
> instead
> we re-use the existing generic pinconf types and the packed format.
>
> This is a follow up of discussion on:
>
> Â https://patchwork.ozlabs.org/patch/713289/
>
> While doing that, it was found out that the current packed format does
> not
> support all realistic debounce time values. The limit is ~64ms which
> does
> not cover mechanical switches connected to GPIOs that migh require
> values
> up to hundreths of milliseconds.
>
> To solve that we change the packed format so that the value takes 24
> bits
> instead of 16, and change the callers to use 32-bit integer instead.
>
> We also make it possible for GPIO chip driver to call pinctrl directly
> by
> providing a new function pinctrl_gpio_set_config() following
> pinctrl_gpio_direction_output() and friends.
>
> I've tested this on Intel Gemini Lake SoC. Non-Intel drivers are
> compile
> tested only because I do not have the hardware.
>

Some minor comments, and take my

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>


> Mika Westerberg (3):
> Â pinctrl: Widen the generic pinconf argument from 16 to 24 bits
> Â pinctrl: Allow configuration of pins from gpiolib based drivers
> Â pinctrl / gpio: Introduce .set_config() callback for GPIO chips
>
> ÂDocumentation/gpio/driver.txtÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ9 ++--
> Âdrivers/gpio/gpio-bcm-kona.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/gpio/gpio-dln2.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 12 ++++--
> Âdrivers/gpio/gpio-dwapb.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/gpio/gpio-ep93xx.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 11 +++--
> Âdrivers/gpio/gpio-f7188x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 19 ++++----
> Âdrivers/gpio/gpio-lp873x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++---
> Âdrivers/gpio/gpio-max77620.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 20 ++++-----
> Âdrivers/gpio/gpio-menz127.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 34 +++++++++++----
> Âdrivers/gpio/gpio-merrifield.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/gpio/gpio-omap.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/gpio/gpio-tc3589x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 15 +++----
> Âdrivers/gpio/gpio-tegra.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/gpio/gpio-tps65218.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++---
> Âdrivers/gpio/gpio-vx855.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 13 +++---
> Âdrivers/gpio/gpio-wcove.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 13 +++---
> Âdrivers/gpio/gpio-wm831x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 21 +++++----
> Âdrivers/gpio/gpio-wm8994.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 13 +++---
> Âdrivers/gpio/gpiolib.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 41 +++++++++----
> -----
> Âdrivers/pinctrl/bcm/pinctrl-bcm281xx.cÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ6 +--
> Âdrivers/pinctrl/bcm/pinctrl-iproc-gpio.cÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/bcm/pinctrl-ns2-mux.cÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ6 +--
> Âdrivers/pinctrl/bcm/pinctrl-nsp-gpio.cÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ6 +--
> Âdrivers/pinctrl/core.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 28 ++++++++++++
> Âdrivers/pinctrl/intel/pinctrl-cherryview.cÂÂÂÂÂÂÂ|ÂÂ4 +-
> Âdrivers/pinctrl/mediatek/pinctrl-mtk-common.cÂÂÂÂ| 14 +++++-
> Âdrivers/pinctrl/meson/pinctrl-meson.cÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 -
> Âdrivers/pinctrl/pinconf.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 12 ++++++
> Âdrivers/pinctrl/pinconf.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ9 ++++
> Âdrivers/pinctrl/pinctrl-amd.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++-
> Âdrivers/pinctrl/pinctrl-da850-pupd.cÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 -
> Âdrivers/pinctrl/pinctrl-lpc18xx.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 10 ++---
> Âdrivers/pinctrl/pinctrl-max77620.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/pinctrl-palmas.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/pinctrl-rockchip.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/pinctrl-single.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/pinctrl-sx150x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 55 ++++++++-------
> ---------
> Âdrivers/pinctrl/sirf/pinctrl-atlas7.cÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ3 +-
> Âdrivers/pinctrl/sunxi/pinctrl-sunxi.cÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/pinctrl/uniphier/pinctrl-uniphier-core.c |ÂÂ4 +-
> Âdrivers/pinctrl/vt8500/pinctrl-wmt.cÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/rtc/rtc-omap.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/staging/greybus/gpio.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 15 ++++---
> Âdrivers/usb/serial/cp210x.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 13 +++---
> Âinclude/linux/gpio/driver.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 35 +++------------
> Âinclude/linux/pinctrl/consumer.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ6 +++
> Âinclude/linux/pinctrl/pinconf-generic.hÂÂÂÂÂÂÂÂÂÂ| 51 +++++++++++--
> ---------
> Â47 files changed, 376 insertions(+), 254 deletions(-)
>

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy