pinctrl: at91-pio4: Fix slew rate disablement
PATCH 1/1 pinctrl: at91-pio4: Fix slew rate disablement
The slew rate was enabled by default for each configuration of the pin. In case the pin had more than one configuration, even if we set the slew rate as disabled in the device tree, the next pin configuration would set again the slew rate enabled by default, overwriting the slew rate disablement.
Instead of enabling the slew rate by default for each pin configuration, enable the slew rate by default just once per pin, regardless of the number of configurations. This way the slew rate disablement will also work for cases where pins have multiple configurations.
--- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/pinctrl-at91-pio4.c +4 -4
@@ -801,6 +801,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, conf =atmel_pin_config_read (pctldev, pin_id); +/* Keep slew rate enabled by default. */ +if (atmel_pioctrl->slew_rate_support) + conf |=ATMEL_PIO_SR_MASK ; +for (i =0 ; i < num_configs; i++) {unsigned int param =pinconf_to_config_param (configs[i]);unsigned int arg =pinconf_to_config_argument (configs[i]);
@@ -808,10 +812,6 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,dev_dbg (pctldev->dev,"%s: pin=%u, config=0x%lx\n" , __func__, pin_id, configs[i]); -/* Keep slew rate enabled by default. */ -if (atmel_pioctrl->slew_rate_support) - conf |=ATMEL_PIO_SR_MASK ; -switch (param) {case PIN_CONFIG_BIAS_DISABLE : conf &= (~ATMEL_PIO_PUEN_MASK );
Signature · 1 line
2.25.1
Quoted 10 lines · Tudor Ambarus
The slew rate was enabled by default for each configuration of the pin. In case the pin had more than one configuration, even if we set the slew rate as disabled in the device tree, the next pin configuration would set again the slew rate enabled by default, overwriting the slew rate disablement.
Instead of enabling the slew rate by default for each pin configuration, enable the slew rate by default just once per pin, regardless of the number of configurations. This way the slew rate disablement will also work for cases where pins have multiple configurations.
Quoted 2 lines
Fixes 440b144978ba ("pinctrl: at91-pio4: add support for slew-rate")Signed-off-by Tudor Ambarus <[email protected]>
Quoted 21 lines
--- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-at91-pio4.c +4
-0@@ -801,6 +801,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, conf =atmel_pin_config_read (pctldev, pin_id); +/* Keep slew rate enabled by default. */ +if (atmel_pioctrl->slew_rate_support) + conf |=ATMEL_PIO_SR_MASK ; +for (i =0 ; i < num_configs; i++) {unsigned int param =pinconf_to_config_param (configs[i]);unsigned int arg =pinconf_to_config_argument (configs[i]);
drivers/pinctrl/pinctrl-at91-pio4.c static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, · line 817
Quoted 10 lines
drivers/pinctrl/pinctrl-at91-pio4.c +0
-4@@ -808,10 +812,6 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,dev_dbg (pctldev->dev,"%s: pin=%u, config=0x%lx\n" , __func__, pin_id, configs[i]); -/* Keep slew rate enabled by default. */ -if (atmel_pioctrl->slew_rate_support) - conf |=ATMEL_PIO_SR_MASK ; -switch (param) {case PIN_CONFIG_BIAS_DISABLE : conf &= (~ATMEL_PIO_PUEN_MASK );
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 10 lines · Tudor Ambarus
The slew rate was enabled by default for each configuration of the pin. In case the pin had more than one configuration, even if we set the slew rate as disabled in the device tree, the next pin configuration would set again the slew rate enabled by default, overwriting the slew rate disablement.
Instead of enabling the slew rate by default for each pin configuration, enable the slew rate by default just once per pin, regardless of the number of configurations. This way the slew rate disablement will also work for cases where pins have multiple configurations.
Quoted 2 lines
Fixes 440b144978ba ("pinctrl: at91-pio4: add support for slew-rate")Signed-off-by Tudor Ambarus <[email protected]>
Thanks.
Quoted 33 lines
--- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-at91-pio4.c +4
-4@@ -801,6 +801,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, conf =atmel_pin_config_read (pctldev, pin_id); +/* Keep slew rate enabled by default. */ +if (atmel_pioctrl->slew_rate_support) + conf |=ATMEL_PIO_SR_MASK ; +for (i =0 ; i < num_configs; i++) {unsigned int param =pinconf_to_config_param (configs[i]);unsigned int arg =pinconf_to_config_argument (configs[i]);@@ -808,10 +812,6 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,dev_dbg (pctldev->dev,"%s: pin=%u, config=0x%lx\n" , __func__, pin_id, configs[i]); -/* Keep slew rate enabled by default. */ -if (atmel_pioctrl->slew_rate_support) - conf |=ATMEL_PIO_SR_MASK ; -switch (param) {case PIN_CONFIG_BIAS_DISABLE : conf &= (~ATMEL_PIO_PUEN_MASK );Signature · 1 line
2.25.1
Quoted 10 lines · Tudor Ambarus
The slew rate was enabled by default for each configuration of the pin. In case the pin had more than one configuration, even if we set the slew rate as disabled in the device tree, the next pin configuration would set again the slew rate enabled by default, overwriting the slew rate disablement.
Instead of enabling the slew rate by default for each pin configuration, enable the slew rate by default just once per pin, regardless of the number of configurations. This way the slew rate disablement will also work for cases where pins have multiple configurations.
Quoted 2 lines
Fixes 440b144978ba ("pinctrl: at91-pio4: add support for slew-rate")Signed-off-by Tudor Ambarus <[email protected]>
Patch applied!
Yours,
Linus Walleij