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>
This commit is contained in:

committed by
Linus Walleij

parent
7ce7d89f48
commit
58957d2edf
@@ -366,7 +366,7 @@ static const struct pinctrl_ops nsp_pctrl_ops = {
|
||||
.dt_free_map = pinctrl_utils_free_map,
|
||||
};
|
||||
|
||||
static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u16 slew)
|
||||
static int nsp_gpio_set_slew(struct nsp_gpio *chip, unsigned gpio, u32 slew)
|
||||
{
|
||||
if (slew)
|
||||
nsp_set_bit(chip, IO_CTRL, NSP_GPIO_SLEW_RATE_EN, gpio, true);
|
||||
@@ -403,7 +403,7 @@ static void nsp_gpio_get_pull(struct nsp_gpio *chip, unsigned gpio,
|
||||
}
|
||||
|
||||
static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio,
|
||||
u16 strength)
|
||||
u32 strength)
|
||||
{
|
||||
u32 offset, shift, i;
|
||||
u32 val;
|
||||
@@ -522,7 +522,7 @@ static int nsp_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
{
|
||||
struct nsp_gpio *chip = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param;
|
||||
u16 arg;
|
||||
u32 arg;
|
||||
unsigned int i, gpio;
|
||||
int ret = -ENOTSUPP;
|
||||
|
||||
|
Reference in New Issue
Block a user