From: Tudor Ambarus <tudor.ambarus@microchip.com> To: <ludovic.desroches@microchip.com>, <linus.walleij@linaro.org>, <claudiu.beznea@microchip.com> Cc: <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <linux-arm-kernel@lists.infradead.org>, <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Tudor Ambarus <tudor.ambarus@microchip.com> Subject: [PATCH] pinctrl: at91-pio4: Fix slew rate disablement Date: Fri, 9 Apr 2021 11:25:22 +0300 [thread overview] Message-ID: <20210409082522.625168-1-tudor.ambarus@microchip.com> (raw) 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. Fixes: 440b144978ba ("pinctrl: at91-pio4: add support for slew-rate") Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> --- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index a5d328808e4c..4c01d8471ffa 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -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); -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Tudor Ambarus <tudor.ambarus@microchip.com> To: <ludovic.desroches@microchip.com>, <linus.walleij@linaro.org>, <claudiu.beznea@microchip.com> Cc: alexandre.belloni@bootlin.com, Tudor Ambarus <tudor.ambarus@microchip.com>, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] pinctrl: at91-pio4: Fix slew rate disablement Date: Fri, 9 Apr 2021 11:25:22 +0300 [thread overview] Message-ID: <20210409082522.625168-1-tudor.ambarus@microchip.com> (raw) 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. Fixes: 440b144978ba ("pinctrl: at91-pio4: add support for slew-rate") Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> --- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index a5d328808e4c..4c01d8471ffa 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -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); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-04-09 8:25 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-09 8:25 Tudor Ambarus [this message] 2021-04-09 8:25 ` [PATCH] pinctrl: at91-pio4: Fix slew rate disablement Tudor Ambarus 2021-04-09 9:59 ` Claudiu.Beznea 2021-04-09 9:59 ` Claudiu.Beznea 2021-04-09 12:11 ` Ludovic.Desroches 2021-04-09 12:11 ` Ludovic.Desroches 2021-04-10 0:08 ` Linus Walleij 2021-04-10 0:08 ` Linus Walleij
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210409082522.625168-1-tudor.ambarus@microchip.com \ --to=tudor.ambarus@microchip.com \ --cc=alexandre.belloni@bootlin.com \ --cc=claudiu.beznea@microchip.com \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=ludovic.desroches@microchip.com \ --cc=nicolas.ferre@microchip.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.