diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2017-01-23 15:34:32 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-26 15:22:32 +0100 |
commit | 58957d2edfa19e9b8f80385ba042495058e5e60e (patch) | |
tree | ac6041e8fe09315cba840d6e65fe1ca97effba14 /drivers/pinctrl/pinctrl-lpc18xx.c | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (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/pinctrl-lpc18xx.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-lpc18xx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-lpc18xx.c b/drivers/pinctrl/pinctrl-lpc18xx.c index e053f1fa5512..d090f37ca4a1 100644 --- a/drivers/pinctrl/pinctrl-lpc18xx.c +++ b/drivers/pinctrl/pinctrl-lpc18xx.c @@ -904,7 +904,7 @@ static int lpc18xx_pconf_get(struct pinctrl_dev *pctldev, unsigned pin, static int lpc18xx_pconf_set_usb1(struct pinctrl_dev *pctldev, enum pin_config_param param, - u16 param_val, u32 *reg) + u32 param_val, u32 *reg) { switch (param) { case PIN_CONFIG_LOW_POWER_MODE: @@ -932,7 +932,7 @@ static int lpc18xx_pconf_set_usb1(struct pinctrl_dev *pctldev, static int lpc18xx_pconf_set_i2c0(struct pinctrl_dev *pctldev, enum pin_config_param param, - u16 param_val, u32 *reg, + u32 param_val, u32 *reg, unsigned pin) { u8 shift; @@ -982,7 +982,7 @@ static int lpc18xx_pconf_set_i2c0(struct pinctrl_dev *pctldev, } static int lpc18xx_pconf_set_gpio_pin_int(struct pinctrl_dev *pctldev, - u16 param_val, unsigned pin) + u32 param_val, unsigned pin) { struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); u32 val, reg_val, reg_offset = LPC18XX_SCU_PINTSEL0; @@ -1008,7 +1008,7 @@ static int lpc18xx_pconf_set_gpio_pin_int(struct pinctrl_dev *pctldev, } static int lpc18xx_pconf_set_pin(struct pinctrl_dev *pctldev, unsigned param, - u16 param_val, u32 *reg, unsigned pin, + u32 param_val, u32 *reg, unsigned pin, struct lpc18xx_pin_caps *pin_cap) { switch (param) { @@ -1088,7 +1088,7 @@ static int lpc18xx_pconf_set(struct pinctrl_dev *pctldev, unsigned pin, struct lpc18xx_scu_data *scu = pinctrl_dev_get_drvdata(pctldev); struct lpc18xx_pin_caps *pin_cap; enum pin_config_param param; - u16 param_val; + u32 param_val; u32 reg; int ret; int i; |