summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sunxi
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2017-01-23 07:34:32 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-01-26 09:22:32 -0500
commit58957d2edfa19e9b8f80385ba042495058e5e60e (patch)
treeac6041e8fe09315cba840d6e65fe1ca97effba14 /drivers/pinctrl/sunxi
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
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>
Diffstat (limited to 'drivers/pinctrl/sunxi')
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 0eb51e33cb1b..28bfa5f413e4 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -540,7 +540,7 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
540 enum pin_config_param param; 540 enum pin_config_param param;
541 unsigned long flags; 541 unsigned long flags;
542 u32 offset, shift, mask, reg; 542 u32 offset, shift, mask, reg;
543 u16 arg, val; 543 u32 arg, val;
544 int ret; 544 int ret;
545 545
546 param = pinconf_to_config_param(configs[i]); 546 param = pinconf_to_config_param(configs[i]);