pinctrl: Widen the generic pinconf argument from 16 to 24 bits
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 23 Jan 2017 12:34:32 +0000 (15:34 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Jan 2017 14:22:32 +0000 (15:22 +0100)
commit58957d2edfa19e9b8f80385ba042495058e5e60e
treeac6041e8fe09315cba840d6e65fe1ca97effba14
parent7ce7d89f48834cefece7804d38fc5d85382edf77
pinctrl: Widen the generic pinconf argument from 16 to 24 bits

The current pinconf packed format allows only 16-bit argument limiting
the maximum value 65535. For most types this is enough. However,
debounce time can be in range of hundreths of milliseconds in case of
mechanical switches so we cannot represent the worst case using the
current format.

In order to support larger values change the packed format so that the
lower 8 bits are used as type which leaves 24 bits for the argument.
This allows representing values up to 16777215 and debounce times up to
16 seconds.

We also convert the existing users to use 32-bit integer when extracting
argument from the packed configuration value.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
18 files changed:
drivers/pinctrl/bcm/pinctrl-bcm281xx.c
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
drivers/pinctrl/bcm/pinctrl-ns2-mux.c
drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/meson/pinctrl-meson.c
drivers/pinctrl/pinctrl-da850-pupd.c
drivers/pinctrl/pinctrl-lpc18xx.c
drivers/pinctrl/pinctrl-max77620.c
drivers/pinctrl/pinctrl-palmas.c
drivers/pinctrl/pinctrl-rockchip.c
drivers/pinctrl/pinctrl-single.c
drivers/pinctrl/sirf/pinctrl-atlas7.c
drivers/pinctrl/sunxi/pinctrl-sunxi.c
drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
drivers/pinctrl/vt8500/pinctrl-wmt.c
drivers/rtc/rtc-omap.c
include/linux/pinctrl/pinconf-generic.h