pinctrl: at91: Enable slewrate by default on SAM9X60
Subsystems (5)
PATCH 1/1 pinctrl: at91: Enable slewrate by default on SAM9X60
On SAM9X60, slewrate should be enabled on pins with a switching frequency below 50Mhz. Since most of our pins do not exceed this value, we enable slewrate by default. Pins with a switching value that exceeds 50Mhz will have to explicitly disable slewrate.
--- drivers/pinctrl/pinctrl-at91.c | 4 ++-- include/dt-bindings/pinctrl/at91.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/pinctrl-at91.c +2 -2
@@ -85,8 +85,8 @@ enum drive_strength_bit { DRIVE_STRENGTH_SHIFT)enum slewrate_bit { -SLEWRATE_BIT_DIS ,SLEWRATE_BIT_ENA , +SLEWRATE_BIT_DIS , };#define SLEWRATE_BIT_MSK (name) (SLEWRATE_BIT_##name << SLEWRATE_SHIFT)
@@ -669,7 +669,7 @@ static void at91_mux_sam9x60_set_slewrate(void __iomem *pio, unsigned pin, {unsigned int tmp; -if (setting <SLEWRATE_BIT_DIS || setting >SLEWRATE_BIT_ENA ) +if (setting <SLEWRATE_BIT_ENA || setting >SLEWRATE_BIT_DIS )return ; tmp =readl_relaxed (pio +SAM9X60_PIO_SLEWR );
include/dt-bindings/pinctrl/at91.h +2 -2
@@ -27,8 +27,8 @@#define AT91_PINCTRL_DRIVE_STRENGTH_MED (0x2 << 5)#define AT91_PINCTRL_DRIVE_STRENGTH_HI (0x3 << 5) -#define AT91_PINCTRL_SLEWRATE_DIS (0x0 << 9) -#define AT91_PINCTRL_SLEWRATE_ENA (0x1 << 9) +#define AT91_PINCTRL_SLEWRATE_ENA (0x0 << 9) +#define AT91_PINCTRL_SLEWRATE_DIS (0x1 << 9)#define AT91_PIOA 0#define AT91_PIOB 1
Signature · 1 line
2.20.1
Rob Herring
maintainerQuoted 40 lines · Codrin Ciubotariu
On SAM9X60, slewrate should be enabled on pins with a switching frequency below 50Mhz. Since most of our pins do not exceed this value, we enable slewrate by default. Pins with a switching value that exceeds 50Mhz will have to explicitly disable slewrate.
Suggested-by Ludovic Desroches <[email protected]>Signed-off-by Codrin Ciubotariu <[email protected]>--- drivers/pinctrl/pinctrl-at91.c | 4 ++-- include/dt-bindings/pinctrl/at91.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-at91.c +2
-2@@ -85,8 +85,8 @@ enum drive_strength_bit { DRIVE_STRENGTH_SHIFT)enum slewrate_bit { -SLEWRATE_BIT_DIS ,SLEWRATE_BIT_ENA , +SLEWRATE_BIT_DIS , };#define SLEWRATE_BIT_MSK (name) (SLEWRATE_BIT_##name << SLEWRATE_SHIFT)@@ -669,7 +669,7 @@ static void at91_mux_sam9x60_set_slewrate(void __iomem *pio, unsigned pin, {unsigned int tmp; -if (setting <SLEWRATE_BIT_DIS || setting >SLEWRATE_BIT_ENA ) +if (setting <SLEWRATE_BIT_ENA || setting >SLEWRATE_BIT_DIS )return ; tmp =readl_relaxed (pio +SAM9X60_PIO_SLEWR );include/dt-bindings/pinctrl/at91.h +0
-0
include/dt-bindings/pinctrl/at91.h line 31
Quoted 7 lines
include/dt-bindings/pinctrl/at91.h +2
-2@@ -27,8 +27,8 @@#define AT91_PINCTRL_DRIVE_STRENGTH_MED (0x2 << 5)#define AT91_PINCTRL_DRIVE_STRENGTH_HI (0x3 << 5) -#define AT91_PINCTRL_SLEWRATE_DIS (0x0 << 9) -#define AT91_PINCTRL_SLEWRATE_ENA (0x1 << 9) +#define AT91_PINCTRL_SLEWRATE_ENA (0x0 << 9) +#define AT91_PINCTRL_SLEWRATE_DIS (0x1 << 9)
This is an ABI. You can't just change the definition.
Rob
Ludovic Desroches
maintainerQuoted 44 lines · Rob Herring
Quoted 43 lines · Codrin Ciubotariu
On SAM9X60, slewrate should be enabled on pins with a switching frequency below 50Mhz. Since most of our pins do not exceed this value, we enable slewrate by default. Pins with a switching value that exceeds 50Mhz will have to explicitly disable slewrate.
Suggested-by Ludovic Desroches <[email protected]>Signed-off-by Codrin Ciubotariu <[email protected]>--- drivers/pinctrl/pinctrl-at91.c | 4 ++-- include/dt-bindings/pinctrl/at91.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-at91.c +2
-2@@ -85,8 +85,8 @@ enum drive_strength_bit { DRIVE_STRENGTH_SHIFT)enum slewrate_bit { -SLEWRATE_BIT_DIS ,SLEWRATE_BIT_ENA , +SLEWRATE_BIT_DIS , };#define SLEWRATE_BIT_MSK (name) (SLEWRATE_BIT_##name << SLEWRATE_SHIFT)@@ -669,7 +669,7 @@ static void at91_mux_sam9x60_set_slewrate(void __iomem *pio, unsigned pin, {unsigned int tmp; -if (setting <SLEWRATE_BIT_DIS || setting >SLEWRATE_BIT_ENA ) +if (setting <SLEWRATE_BIT_ENA || setting >SLEWRATE_BIT_DIS )return ; tmp =readl_relaxed (pio +SAM9X60_PIO_SLEWR );include/dt-bindings/pinctrl/at91.h +0
-0@@ -27,8 +27,8 @@#define AT91_PINCTRL_DRIVE_STRENGTH_MED (0x2 << 5)#define AT91_PINCTRL_DRIVE_STRENGTH_HI (0x3 << 5)
Quoted 6 lines
include/dt-bindings/pinctrl/at91.h line 31
Quoted 4 lines
include/dt-bindings/pinctrl/at91.h +2
-2-#define AT91_PINCTRL_SLEWRATE_DIS (0x0 << 9) -#define AT91_PINCTRL_SLEWRATE_ENA (0x1 << 9) +#define AT91_PINCTRL_SLEWRATE_ENA (0x0 << 9) +#define AT91_PINCTRL_SLEWRATE_DIS (0x1 << 9)This is an ABI. You can't just change the definition.
There is no DT using these definitions. They have been introduced for our new SoC but its DT is not submitted yet. I assume it's not too late to do this change as nothing will be broken.
Regards
Ludovic
Quoted 2 lines
Rob
Rob Herring
maintainerQuoted 53 lines · Ludovic Desroches
Quoted 44 lines · Rob Herring
Quoted 43 lines · Codrin Ciubotariu
On SAM9X60, slewrate should be enabled on pins with a switching frequency below 50Mhz. Since most of our pins do not exceed this value, we enable slewrate by default. Pins with a switching value that exceeds 50Mhz will have to explicitly disable slewrate.
Suggested-by Ludovic Desroches <[email protected]>Signed-off-by Codrin Ciubotariu <[email protected]>--- drivers/pinctrl/pinctrl-at91.c | 4 ++-- include/dt-bindings/pinctrl/at91.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/pinctrl/pinctrl-at91.c +2
-2@@ -85,8 +85,8 @@ enum drive_strength_bit { DRIVE_STRENGTH_SHIFT)enum slewrate_bit { -SLEWRATE_BIT_DIS ,SLEWRATE_BIT_ENA , +SLEWRATE_BIT_DIS , };#define SLEWRATE_BIT_MSK (name) (SLEWRATE_BIT_##name << SLEWRATE_SHIFT)@@ -669,7 +669,7 @@ static void at91_mux_sam9x60_set_slewrate(void __iomem *pio, unsigned pin, {unsigned int tmp; -if (setting <SLEWRATE_BIT_DIS || setting >SLEWRATE_BIT_ENA ) +if (setting <SLEWRATE_BIT_ENA || setting >SLEWRATE_BIT_DIS )return ; tmp =readl_relaxed (pio +SAM9X60_PIO_SLEWR );include/dt-bindings/pinctrl/at91.h +0
-0@@ -27,8 +27,8 @@#define AT91_PINCTRL_DRIVE_STRENGTH_MED (0x2 << 5)#define AT91_PINCTRL_DRIVE_STRENGTH_HI (0x3 << 5)Quoted 6 lines
include/dt-bindings/pinctrl/at91.h line 31
Quoted 4 lines
include/dt-bindings/pinctrl/at91.h +2
-2-#define AT91_PINCTRL_SLEWRATE_DIS (0x0 << 9) -#define AT91_PINCTRL_SLEWRATE_ENA (0x1 << 9) +#define AT91_PINCTRL_SLEWRATE_ENA (0x0 << 9) +#define AT91_PINCTRL_SLEWRATE_DIS (0x1 << 9)This is an ABI. You can't just change the definition.
Quoted 3 lines
There is no DT using these definitions. They have been introduced for our new SoC but its DT is not submitted yet. I assume it's not too late to do this change as nothing will be broken.
Okay, then state this in the commit message.
Rob