Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1564954 > unrolled thread
| Started by | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| First post | 2017-01-23 13:40 +0100 |
| Last post | 2017-01-26 15:30 +0100 |
| Articles | 12 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-23 13:40 +0100
[PATCH v2 2/3] pinctrl: Allow configuration of pins from gpiolib based drivers Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-23 13:40 +0100
Re: [PATCH v2 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-01-23 15:30 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Johan Hovold <johan@kernel.org> - 2017-01-23 18:20 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-24 12:20 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Linus Walleij <linus.walleij@linaro.org> - 2017-01-24 14:00 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-24 14:10 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Johan Hovold <johan@kernel.org> - 2017-01-24 14:50 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-24 15:30 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-01-25 11:20 +0100
Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips Linus Walleij <linus.walleij@linaro.org> - 2017-01-26 15:40 +0100
Re: [PATCH v2 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig Linus Walleij <linus.walleij@linaro.org> - 2017-01-26 15:30 +0100
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-23 13:40 +0100 |
| Subject | [PATCH v2 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig |
| Message-ID | <t2M4F-6rG-3@gated-at.bofh.it> |
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 functions gpiochip_generic_config() and
pinctrl_gpio_set_config().
I've tested this on Intel Gemini Lake SoC. Non-Intel drivers are compile
tested only because I do not have the hardware.
Changes from v1:
* Change pinconf_to_config_argument() to cast the result to u32 instead
of enum pin_config_param (which was probably due to copy-paste).
* Re-format PCONFDUMP() macro.
* Add gpiochip_generic_config() so that GPIO drivers can just assign
that to their struct gpio_chip if they would just pass the
.set_config() directly to their backing pinctrl driver.
* Rename gpio_set_drive_mode() to gpio_set_drive_single_ended().
* Correct _gpiod_direction_output_raw() to jump to set_output_value()
when gpio_set_drive_single_ended() succeeds.
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 | 56 +++++++++++++++---------
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 | 29 ++++++++++++
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 | 37 ++++------------
include/linux/pinctrl/consumer.h | 6 +++
include/linux/pinctrl/pinconf-generic.h | 52 +++++++++++-----------
47 files changed, 392 insertions(+), 257 deletions(-)
--
2.11.0
[toc] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-23 13:40 +0100 |
| Subject | [PATCH v2 2/3] pinctrl: Allow configuration of pins from gpiolib based drivers |
| Message-ID | <t2M4G-6rG-31@gated-at.bofh.it> |
| In reply to | #1564954 |
When a GPIO driver is backed by a pinctrl driver the GPIO driver
sometimes needs to call the pinctrl driver to configure certain things,
like whether the pin is used as input or output. In addition to this
there are other configurations applicable to GPIOs such as setting
debounce time of the GPIO.
To support this we introduce a new function pinctrl_gpio_set_config()
that can be used by gpiolib based driver to pass configuration requests
to the backing pinctrl driver.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/pinctrl/core.c | 29 +++++++++++++++++++++++++++++
drivers/pinctrl/pinconf.c | 12 ++++++++++++
drivers/pinctrl/pinconf.h | 9 +++++++++
include/linux/pinctrl/consumer.h | 6 ++++++
4 files changed, 56 insertions(+)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index fb38e208f32d..597d4641e348 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -688,6 +688,35 @@ int pinctrl_gpio_direction_output(unsigned gpio)
}
EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_output);
+/**
+ * pinctrl_gpio_set_config() - Apply config to given GPIO pin
+ * @gpio: the GPIO pin number from the GPIO subsystem number space
+ * @config: the configuration to apply to the GPIO
+ *
+ * This function should *ONLY* be used from gpiolib-based GPIO drivers, if
+ * they need to call the underlying pin controller to change GPIO config
+ * (for example set debounce time).
+ */
+int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
+{
+ unsigned long configs[] = { config };
+ struct pinctrl_gpio_range *range;
+ struct pinctrl_dev *pctldev;
+ int ret, pin;
+
+ ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
+ if (ret)
+ return ret;
+
+ mutex_lock(&pctldev->mutex);
+ pin = gpio_to_pin(range, gpio);
+ ret = pinconf_set_config(pctldev, pin, configs, ARRAY_SIZE(configs));
+ mutex_unlock(&pctldev->mutex);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config);
+
static struct pinctrl_state *find_state(struct pinctrl *p,
const char *name)
{
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 799048f3c8d4..c1c1ccc58267 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -200,6 +200,18 @@ int pinconf_apply_setting(struct pinctrl_setting const *setting)
return 0;
}
+int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
+ unsigned long *configs, size_t nconfigs)
+{
+ const struct pinconf_ops *ops;
+
+ ops = pctldev->desc->confops;
+ if (!ops)
+ return -ENOTSUPP;
+
+ return ops->pin_config_set(pctldev, pin, configs, nconfigs);
+}
+
#ifdef CONFIG_DEBUG_FS
static void pinconf_show_config(struct seq_file *s, struct pinctrl_dev *pctldev,
diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h
index 55c75780b3b2..bf8aff9abf32 100644
--- a/drivers/pinctrl/pinconf.h
+++ b/drivers/pinctrl/pinconf.h
@@ -20,6 +20,9 @@ int pinconf_map_to_setting(struct pinctrl_map const *map,
void pinconf_free_setting(struct pinctrl_setting const *setting);
int pinconf_apply_setting(struct pinctrl_setting const *setting);
+int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
+ unsigned long *configs, size_t nconfigs);
+
/*
* You will only be interested in these if you're using PINCONF
* so don't supply any stubs for these.
@@ -56,6 +59,12 @@ static inline int pinconf_apply_setting(struct pinctrl_setting const *setting)
return 0;
}
+static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
+ unsigned long *configs, size_t nconfigs)
+{
+ return -ENOTSUPP;
+}
+
#endif
#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index d7e5d608faa7..a0f2aba72fa9 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -29,6 +29,7 @@ extern int pinctrl_request_gpio(unsigned gpio);
extern void pinctrl_free_gpio(unsigned gpio);
extern int pinctrl_gpio_direction_input(unsigned gpio);
extern int pinctrl_gpio_direction_output(unsigned gpio);
+extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config);
extern struct pinctrl * __must_check pinctrl_get(struct device *dev);
extern void pinctrl_put(struct pinctrl *p);
@@ -80,6 +81,11 @@ static inline int pinctrl_gpio_direction_output(unsigned gpio)
return 0;
}
+static inline int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
+{
+ return 0;
+}
+
static inline struct pinctrl * __must_check pinctrl_get(struct device *dev)
{
return NULL;
--
2.11.0
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2017-01-23 15:30 +0100 |
| Subject | Re: [PATCH v2 0/3] pinctrl / gpio: Allow GPIO chips to use generic pinconfig |
| Message-ID | <t2NN8-7xX-11@gated-at.bofh.it> |
| In reply to | #1564954 |
On Mon, 2017-01-23 at 15:34 +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 functions gpiochip_generic_config() and > pinctrl_gpio_set_config(). > > I've tested this on Intel Gemini Lake SoC. Non-Intel drivers are > compile > tested only because I do not have the hardware. > Looks pretty nice to me! FWIW: Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Changes from v1: > > * Change pinconf_to_config_argument() to cast the result to u32 > instead > of enum pin_config_param (which was probably due to copy-paste). > > * Re-format PCONFDUMP() macro. > > * Add gpiochip_generic_config() so that GPIO drivers can just assign > that to their struct gpio_chip if they would just pass the > .set_config() directly to their backing pinctrl driver. > > * Rename gpio_set_drive_mode() to gpio_set_drive_single_ended(). > > * Correct _gpiod_direction_output_raw() to jump to > set_output_value() > when gpio_set_drive_single_ended() succeeds. > > 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 | 56 > +++++++++++++++--------- > 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 | 29 ++++++++++++ > 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 | 37 ++++----------- > - > include/linux/pinctrl/consumer.h | 6 +++ > include/linux/pinctrl/pinconf-generic.h | 52 +++++++++++-- > --------- > 47 files changed, 392 insertions(+), 257 deletions(-) > -- Andy Shevchenko <andriy.shevchenko@linux.intel.com> Intel Finland Oy
[toc] | [prev] | [next] | [standalone]
| From | Johan Hovold <johan@kernel.org> |
|---|---|
| Date | 2017-01-23 18:20 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t2QrF-Nm-39@gated-at.bofh.it> |
| In reply to | #1564954 |
On Mon, Jan 23, 2017 at 03:34:34PM +0300, Mika Westerberg wrote: > Currently we already have two pin configuration related callbacks > available for GPIO chips .set_single_ended() and .set_debounce(). In > future we expect to have even more, which does not scale well if we need > to add yet another callback to the GPIO chip structure for each possible > configuration parameter. > > Better solution is to reuse what we already have available in the > generic pinconf. > > To support this, we introduce a new .set_config() callback for GPIO > chips. The callback takes a single packed pin configuration value as > parameter. This can then be extended easily beyond what is currently > supported by just adding new types to the generic pinconf enum. > > If the GPIO driver is backed up by a pinctrl driver the GPIO driver can > just assign gpiochip_generic_config() (introduced in this patch) to > .set_config and that will take care configuration requests are directed > to the pinctrl driver. > > We then convert the existing drivers over .set_config() and finally > remove the .set_single_ended() and .set_debounce() callbacks. > > Suggested-by: Linus Walleij <linus.walleij@linaro.org> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> > --- > 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 | 56 +++++++++++++++++---------- > drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 ++++++- > drivers/pinctrl/pinctrl-amd.c | 14 ++++++- > drivers/pinctrl/pinctrl-sx150x.c | 55 +++++++------------------- > drivers/staging/greybus/gpio.c | 15 ++++--- > drivers/usb/serial/cp210x.c | 13 ++++--- For greybus and USB serial: Acked-by: Johan Hovold <johan@kernel.org> Note however that this patch fails to apply to linux-next (conflicts in pinctrl as well as staging). Thanks, Johan
[toc] | [prev] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-24 12:20 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t37iN-3Bi-1@gated-at.bofh.it> |
| In reply to | #1565165 |
On Mon, Jan 23, 2017 at 06:11:07PM +0100, Johan Hovold wrote: > On Mon, Jan 23, 2017 at 03:34:34PM +0300, Mika Westerberg wrote: > > Currently we already have two pin configuration related callbacks > > available for GPIO chips .set_single_ended() and .set_debounce(). In > > future we expect to have even more, which does not scale well if we need > > to add yet another callback to the GPIO chip structure for each possible > > configuration parameter. > > > > Better solution is to reuse what we already have available in the > > generic pinconf. > > > > To support this, we introduce a new .set_config() callback for GPIO > > chips. The callback takes a single packed pin configuration value as > > parameter. This can then be extended easily beyond what is currently > > supported by just adding new types to the generic pinconf enum. > > > > If the GPIO driver is backed up by a pinctrl driver the GPIO driver can > > just assign gpiochip_generic_config() (introduced in this patch) to > > .set_config and that will take care configuration requests are directed > > to the pinctrl driver. > > > > We then convert the existing drivers over .set_config() and finally > > remove the .set_single_ended() and .set_debounce() callbacks. > > > > Suggested-by: Linus Walleij <linus.walleij@linaro.org> > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> > > --- > > 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 | 56 +++++++++++++++++---------- > > drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 ++++++- > > drivers/pinctrl/pinctrl-amd.c | 14 ++++++- > > drivers/pinctrl/pinctrl-sx150x.c | 55 +++++++------------------- > > drivers/staging/greybus/gpio.c | 15 ++++--- > > drivers/usb/serial/cp210x.c | 13 ++++--- > > For greybus and USB serial: > > Acked-by: Johan Hovold <johan@kernel.org> Thanks! > Note however that this patch fails to apply to linux-next (conflicts in > pinctrl as well as staging). Indeed, it does. I did the series on top of v4.10-rc5 but looks like there are some changes in linux-next that I missed. I'll rebase the series on top of linux-next and resend.
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-01-24 14:00 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t38RA-4pJ-19@gated-at.bofh.it> |
| In reply to | #1565786 |
On Tue, Jan 24, 2017 at 12:11 PM, Mika Westerberg <mika.westerberg@linux.intel.com> wrote: > On Mon, Jan 23, 2017 at 06:11:07PM +0100, Johan Hovold wrote: >> On Mon, Jan 23, 2017 at 03:34:34PM +0300, Mika Westerberg wrote: >> > Currently we already have two pin configuration related callbacks >> > available for GPIO chips .set_single_ended() and .set_debounce(). In >> > future we expect to have even more, which does not scale well if we need >> > to add yet another callback to the GPIO chip structure for each possible >> > configuration parameter. >> > >> > Better solution is to reuse what we already have available in the >> > generic pinconf. >> > >> > To support this, we introduce a new .set_config() callback for GPIO >> > chips. The callback takes a single packed pin configuration value as >> > parameter. This can then be extended easily beyond what is currently >> > supported by just adding new types to the generic pinconf enum. >> > >> > If the GPIO driver is backed up by a pinctrl driver the GPIO driver can >> > just assign gpiochip_generic_config() (introduced in this patch) to >> > .set_config and that will take care configuration requests are directed >> > to the pinctrl driver. >> > >> > We then convert the existing drivers over .set_config() and finally >> > remove the .set_single_ended() and .set_debounce() callbacks. >> > >> > Suggested-by: Linus Walleij <linus.walleij@linaro.org> >> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> >> For greybus and USB serial: >> >> Acked-by: Johan Hovold <johan@kernel.org> > > Thanks! > >> Note however that this patch fails to apply to linux-next (conflicts in >> pinctrl as well as staging). > > Indeed, it does. I did the series on top of v4.10-rc5 but looks like > there are some changes in linux-next that I missed. > > I'll rebase the series on top of linux-next and resend. If the conflicts are just with the GPIO tree then the "devel" branch in the GPIO tree is what you should base it on. If there are conflicts with other trees including pinctrl it should probably be based on v4.10-rcN and end up in my face, in this case maybe I should just make an immutable branch in the GPIO tree and pull to both itself and pincontrol and resolve the conflicts if they are clashing. Yours, Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-24 14:10 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t391f-4Ik-1@gated-at.bofh.it> |
| In reply to | #1565835 |
On Tue, Jan 24, 2017 at 01:53:53PM +0100, Linus Walleij wrote:
> On Tue, Jan 24, 2017 at 12:11 PM, Mika Westerberg
> <mika.westerberg@linux.intel.com> wrote:
> > On Mon, Jan 23, 2017 at 06:11:07PM +0100, Johan Hovold wrote:
> >> On Mon, Jan 23, 2017 at 03:34:34PM +0300, Mika Westerberg wrote:
> >> > Currently we already have two pin configuration related callbacks
> >> > available for GPIO chips .set_single_ended() and .set_debounce(). In
> >> > future we expect to have even more, which does not scale well if we need
> >> > to add yet another callback to the GPIO chip structure for each possible
> >> > configuration parameter.
> >> >
> >> > Better solution is to reuse what we already have available in the
> >> > generic pinconf.
> >> >
> >> > To support this, we introduce a new .set_config() callback for GPIO
> >> > chips. The callback takes a single packed pin configuration value as
> >> > parameter. This can then be extended easily beyond what is currently
> >> > supported by just adding new types to the generic pinconf enum.
> >> >
> >> > If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
> >> > just assign gpiochip_generic_config() (introduced in this patch) to
> >> > .set_config and that will take care configuration requests are directed
> >> > to the pinctrl driver.
> >> >
> >> > We then convert the existing drivers over .set_config() and finally
> >> > remove the .set_single_ended() and .set_debounce() callbacks.
> >> >
> >> > Suggested-by: Linus Walleij <linus.walleij@linaro.org>
> >> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> >> For greybus and USB serial:
>
> >>
> >> Acked-by: Johan Hovold <johan@kernel.org>
> >
> > Thanks!
> >
> >> Note however that this patch fails to apply to linux-next (conflicts in
> >> pinctrl as well as staging).
> >
> > Indeed, it does. I did the series on top of v4.10-rc5 but looks like
> > there are some changes in linux-next that I missed.
> >
> > I'll rebase the series on top of linux-next and resend.
>
> If the conflicts are just with the GPIO tree then the "devel" branch
> in the GPIO tree is what you should base it on.
OK.
> If there are conflicts with other trees including pinctrl it should
> probably be based on v4.10-rcN and end up in my face, in this case
> maybe I should just make an immutable branch in the GPIO tree and
> pull to both itself and pincontrol and resolve the conflicts if they are
> clashing.
The only conflict I noticed when rebased the series on top of today's
linux-next was due to 7f2e9de736e7 ("staging: greybus: fix checkpatch
unsigned warnings").
[toc] | [prev] | [next] | [standalone]
| From | Johan Hovold <johan@kernel.org> |
|---|---|
| Date | 2017-01-24 14:50 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t39DX-4W7-1@gated-at.bofh.it> |
| In reply to | #1565838 |
On Tue, Jan 24, 2017 at 02:57:56PM +0200, Mika Westerberg wrote:
> On Tue, Jan 24, 2017 at 01:53:53PM +0100, Linus Walleij wrote:
> > On Tue, Jan 24, 2017 at 12:11 PM, Mika Westerberg
> > <mika.westerberg@linux.intel.com> wrote:
> > > On Mon, Jan 23, 2017 at 06:11:07PM +0100, Johan Hovold wrote:
> > >> On Mon, Jan 23, 2017 at 03:34:34PM +0300, Mika Westerberg wrote:
> > >> > Currently we already have two pin configuration related callbacks
> > >> > available for GPIO chips .set_single_ended() and .set_debounce(). In
> > >> > future we expect to have even more, which does not scale well if we need
> > >> > to add yet another callback to the GPIO chip structure for each possible
> > >> > configuration parameter.
> > >> >
> > >> > Better solution is to reuse what we already have available in the
> > >> > generic pinconf.
> > >> >
> > >> > To support this, we introduce a new .set_config() callback for GPIO
> > >> > chips. The callback takes a single packed pin configuration value as
> > >> > parameter. This can then be extended easily beyond what is currently
> > >> > supported by just adding new types to the generic pinconf enum.
> > >> >
> > >> > If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
> > >> > just assign gpiochip_generic_config() (introduced in this patch) to
> > >> > .set_config and that will take care configuration requests are directed
> > >> > to the pinctrl driver.
> > >> >
> > >> > We then convert the existing drivers over .set_config() and finally
> > >> > remove the .set_single_ended() and .set_debounce() callbacks.
> > >> >
> > >> > Suggested-by: Linus Walleij <linus.walleij@linaro.org>
> > >> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > >> For greybus and USB serial:
> >
> > >>
> > >> Acked-by: Johan Hovold <johan@kernel.org>
> > >
> > > Thanks!
> > >
> > >> Note however that this patch fails to apply to linux-next (conflicts in
> > >> pinctrl as well as staging).
> > >
> > > Indeed, it does. I did the series on top of v4.10-rc5 but looks like
> > > there are some changes in linux-next that I missed.
> > >
> > > I'll rebase the series on top of linux-next and resend.
> >
> > If the conflicts are just with the GPIO tree then the "devel" branch
> > in the GPIO tree is what you should base it on.
>
> OK.
>
> > If there are conflicts with other trees including pinctrl it should
> > probably be based on v4.10-rcN and end up in my face, in this case
> > maybe I should just make an immutable branch in the GPIO tree and
> > pull to both itself and pincontrol and resolve the conflicts if they are
> > clashing.
>
> The only conflict I noticed when rebased the series on top of today's
> linux-next was due to 7f2e9de736e7 ("staging: greybus: fix checkpatch
> unsigned warnings").
Good, that's the one I knew about. But I also got another conflict
against pinctrl when applying on top of f9dd6f6cc63c ("Add linux-next
specific files for 20170123"):
Applying: pinctrl / gpio: Introduce .set_config() callback for GPIO chips
error: patch failed: drivers/pinctrl/pinctrl-amd.c:756
error: drivers/pinctrl/pinctrl-amd.c: patch does not apply
error: patch failed: drivers/staging/greybus/gpio.c:474
error: drivers/staging/greybus/gpio.c: patch does not apply
Patch failed at 0001 pinctrl / gpio: Introduce .set_config() callback for GPIO chips
Johan
[toc] | [prev] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-24 15:30 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t3agG-5pf-25@gated-at.bofh.it> |
| In reply to | #1565852 |
On Tue, Jan 24, 2017 at 02:45:04PM +0100, Johan Hovold wrote:
> Good, that's the one I knew about. But I also got another conflict
> against pinctrl when applying on top of f9dd6f6cc63c ("Add linux-next
> specific files for 20170123"):
>
> Applying: pinctrl / gpio: Introduce .set_config() callback for GPIO chips
> error: patch failed: drivers/pinctrl/pinctrl-amd.c:756
> error: drivers/pinctrl/pinctrl-amd.c: patch does not apply
> error: patch failed: drivers/staging/greybus/gpio.c:474
> error: drivers/staging/greybus/gpio.c: patch does not apply
> Patch failed at 0001 pinctrl / gpio: Introduce .set_config() callback for GPIO chips
I tried today's linux-next 766074e7818 ("Add linux-next specific files
for 20170124") but only saw that GPIO conflict.
In any case I'm going to rebase my series on top of linux-gpio.git/devel
and submit it as v3.
[toc] | [prev] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-01-25 11:20 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t3sQh-sW-3@gated-at.bofh.it> |
| In reply to | #1565899 |
On Tue, Jan 24, 2017 at 04:22:20PM +0200, Mika Westerberg wrote:
> On Tue, Jan 24, 2017 at 02:45:04PM +0100, Johan Hovold wrote:
> > Good, that's the one I knew about. But I also got another conflict
> > against pinctrl when applying on top of f9dd6f6cc63c ("Add linux-next
> > specific files for 20170123"):
> >
> > Applying: pinctrl / gpio: Introduce .set_config() callback for GPIO chips
> > error: patch failed: drivers/pinctrl/pinctrl-amd.c:756
> > error: drivers/pinctrl/pinctrl-amd.c: patch does not apply
> > error: patch failed: drivers/staging/greybus/gpio.c:474
> > error: drivers/staging/greybus/gpio.c: patch does not apply
> > Patch failed at 0001 pinctrl / gpio: Introduce .set_config() callback for GPIO chips
>
> I tried today's linux-next 766074e7818 ("Add linux-next specific files
> for 20170124") but only saw that GPIO conflict.
>
> In any case I'm going to rebase my series on top of linux-gpio.git/devel
> and submit it as v3.
That said, it seems this v2 series applies cleanly to
linux-gpio.git/devel. There will be trivial conflict with the staging
tree because of 7f2e9de736e7 ("staging: greybus: fix checkpatch unsigned
warnings") but that's it.
LinusW, can you take the series as is or should I rebase it on top of
something else?
Thanks and sorry about the mess.
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-01-26 15:40 +0100 |
| Subject | Re: [PATCH v2 3/3] pinctrl / gpio: Introduce .set_config() callback for GPIO chips |
| Message-ID | <t3Tns-5I-15@gated-at.bofh.it> |
| In reply to | #1566444 |
On Wed, Jan 25, 2017 at 11:09 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Tue, Jan 24, 2017 at 04:22:20PM +0200, Mika Westerberg wrote:
>> On Tue, Jan 24, 2017 at 02:45:04PM +0100, Johan Hovold wrote:
>> > Good, that's the one I knew about. But I also got another conflict
>> > against pinctrl when applying on top of f9dd6f6cc63c ("Add linux-next
>> > specific files for 20170123"):
>> >
>> > Applying: pinctrl / gpio: Introduce .set_config() callback for GPIO chips
>> > error: patch failed: drivers/pinctrl/pinctrl-amd.c:756
>> > error: drivers/pinctrl/pinctrl-amd.c: patch does not apply
>> > error: patch failed: drivers/staging/greybus/gpio.c:474
>> > error: drivers/staging/greybus/gpio.c: patch does not apply
>> > Patch failed at 0001 pinctrl / gpio: Introduce .set_config() callback for GPIO chips
>>
>> I tried today's linux-next 766074e7818 ("Add linux-next specific files
>> for 20170124") but only saw that GPIO conflict.
>>
>> In any case I'm going to rebase my series on top of linux-gpio.git/devel
>> and submit it as v3.
>
> That said, it seems this v2 series applies cleanly to
> linux-gpio.git/devel. There will be trivial conflict with the staging
> tree because of 7f2e9de736e7 ("staging: greybus: fix checkpatch unsigned
> warnings") but that's it.
We'll see. If there are internal conflicts in GPIO and pin control
I will get it in my face and deal with it when trying to create for-next
branches.
The conflict with staging is business as usual in linux-next.
Yours,
Linus Walleij
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-01-26 15:30 +0100 |
| Message-ID | <t3TdM-8u9-19@gated-at.bofh.it> |
| In reply to | #1564954 |
On Mon, Jan 23, 2017 at 1:34 PM, Mika Westerberg <mika.westerberg@linux.intel.com> 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/ As you already know I'm a big fan of the series. I applied the two patches to an immutable branch in the pin control tree and pulled it into both pin control and GPIO devel branches. Thanks a lot for your efforts!! Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web