linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros
@ 2023-03-08  8:43 Nishanth Menon
  2023-03-08 12:21 ` Krzysztof Kozlowski
  2023-03-09 14:03 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Nishanth Menon @ 2023-03-08  8:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Linus Walleij
  Cc: linux-kernel, devicetree, linux-gpio, linux-arm-kernel,
	Tero Kristo, Vignesh Raghavendra, Nishanth Menon

Introduce the debounce select mux macros to allow folks to setup
debounce configuration for pins. Each configuration selected maps
to a specific timing register as documented in appropriate Technical
Reference Manual (example:[1]).

[1] AM625x TRM (section 6.1.2.2): https://www.ti.com/lit/pdf/spruiv7
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 include/dt-bindings/pinctrl/k3.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
index 6bb9df1a264d..469bd29651db 100644
--- a/include/dt-bindings/pinctrl/k3.h
+++ b/include/dt-bindings/pinctrl/k3.h
@@ -11,6 +11,7 @@
 #define PULLUDEN_SHIFT		(16)
 #define PULLTYPESEL_SHIFT	(17)
 #define RXACTIVE_SHIFT		(18)
+#define DEBOUNCE_SHIFT		(11)
 
 #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
 #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
@@ -29,6 +30,14 @@
 #define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
 #define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)
 
+#define PIN_DEBOUNCE_DISABLE	(0 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF1	(1 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF2	(2 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF3	(3 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF4	(4 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
+#define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
+
 #define AM62AX_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
 #define AM62AX_MCU_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros
  2023-03-08  8:43 [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros Nishanth Menon
@ 2023-03-08 12:21 ` Krzysztof Kozlowski
  2023-03-09 14:03 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-08 12:21 UTC (permalink / raw)
  To: Nishanth Menon, Krzysztof Kozlowski, Rob Herring, Linus Walleij
  Cc: linux-kernel, devicetree, linux-gpio, linux-arm-kernel,
	Tero Kristo, Vignesh Raghavendra

On 08/03/2023 09:43, Nishanth Menon wrote:
> Introduce the debounce select mux macros to allow folks to setup
> debounce configuration for pins. Each configuration selected maps
> to a specific timing register as documented in appropriate Technical
> Reference Manual (example:[1]).
> 
> [1] AM625x TRM (section 6.1.2.2): https://www.ti.com/lit/pdf/spruiv7
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
>  include/dt-bindings/pinctrl/k3.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

So these are register values? You should consider moving them out of
bindings, like we do for some other platforms.


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros
  2023-03-08  8:43 [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros Nishanth Menon
  2023-03-08 12:21 ` Krzysztof Kozlowski
@ 2023-03-09 14:03 ` Linus Walleij
  2023-03-10  0:43   ` Nishanth Menon
  1 sibling, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2023-03-09 14:03 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Krzysztof Kozlowski, Rob Herring, linux-kernel, devicetree,
	linux-gpio, linux-arm-kernel, Tero Kristo, Vignesh Raghavendra

On Wed, Mar 8, 2023 at 9:43 AM Nishanth Menon <nm@ti.com> wrote:

> Introduce the debounce select mux macros to allow folks to setup
> debounce configuration for pins. Each configuration selected maps
> to a specific timing register as documented in appropriate Technical
> Reference Manual (example:[1]).
>
> [1] AM625x TRM (section 6.1.2.2): https://www.ti.com/lit/pdf/spruiv7
> Signed-off-by: Nishanth Menon <nm@ti.com>

Patch applied.

Consider doing what Krzysztof recommends: move thes <dt-bindings/*.h>
down to the arch where you're using it and have them as .dtsi files instead
or something.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros
  2023-03-09 14:03 ` Linus Walleij
@ 2023-03-10  0:43   ` Nishanth Menon
  2023-03-10  9:32     ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2023-03-10  0:43 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Krzysztof Kozlowski, Rob Herring, linux-kernel, devicetree,
	linux-gpio, linux-arm-kernel, Tero Kristo, Vignesh Raghavendra

On 15:03-20230309, Linus Walleij wrote:
> On Wed, Mar 8, 2023 at 9:43 AM Nishanth Menon <nm@ti.com> wrote:
> 
> > Introduce the debounce select mux macros to allow folks to setup
> > debounce configuration for pins. Each configuration selected maps
> > to a specific timing register as documented in appropriate Technical
> > Reference Manual (example:[1]).
> >
> > [1] AM625x TRM (section 6.1.2.2): https://www.ti.com/lit/pdf/spruiv7
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> 
> Patch applied.
> 
> Consider doing what Krzysztof recommends: move thes <dt-bindings/*.h>
> down to the arch where you're using it and have them as .dtsi files instead
> or something.

Yep, that sounds like a better idea. If you are ok to drop this
patch, then lets do the cleanup first and move the pinctrl to something like
arch/arm64/boot/dts/ti/k3-pinctrl.h

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros
  2023-03-10  0:43   ` Nishanth Menon
@ 2023-03-10  9:32     ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2023-03-10  9:32 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Krzysztof Kozlowski, Rob Herring, linux-kernel, devicetree,
	linux-gpio, linux-arm-kernel, Tero Kristo, Vignesh Raghavendra

On Fri, Mar 10, 2023 at 1:43 AM Nishanth Menon <nm@ti.com> wrote:
> On 15:03-20230309, Linus Walleij wrote:
> > On Wed, Mar 8, 2023 at 9:43 AM Nishanth Menon <nm@ti.com> wrote:
> >
> > > Introduce the debounce select mux macros to allow folks to setup
> > > debounce configuration for pins. Each configuration selected maps
> > > to a specific timing register as documented in appropriate Technical
> > > Reference Manual (example:[1]).
> > >
> > > [1] AM625x TRM (section 6.1.2.2): https://www.ti.com/lit/pdf/spruiv7
> > > Signed-off-by: Nishanth Menon <nm@ti.com>
> >
> > Patch applied.
> >
> > Consider doing what Krzysztof recommends: move thes <dt-bindings/*.h>
> > down to the arch where you're using it and have them as .dtsi files instead
> > or something.
>
> Yep, that sounds like a better idea. If you are ok to drop this
> patch, then lets do the cleanup first and move the pinctrl to something like
> arch/arm64/boot/dts/ti/k3-pinctrl.h

OK let's proceed like that, I dropped it!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-10  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-08  8:43 [PATCH] dt-bindings: pinctrl: k3: Introduce debounce select mux macros Nishanth Menon
2023-03-08 12:21 ` Krzysztof Kozlowski
2023-03-09 14:03 ` Linus Walleij
2023-03-10  0:43   ` Nishanth Menon
2023-03-10  9:32     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).