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/sirf | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) | |
download | linux-58957d2edfa19e9b8f80385ba042495058e5e60e.tar.bz2 |
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/sirf')
-rw-r--r-- | drivers/pinctrl/sirf/pinctrl-atlas7.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 7f3041697813..82b8a429743d 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c @@ -5322,7 +5322,8 @@ static int atlas7_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin, unsigned long *configs, unsigned num_configs) { - u16 param, arg; + u16 param; + u32 arg; int idx, err; for (idx = 0; idx < num_configs; idx++) { |