diff mbox series

[v2,1/4] dt-bindings: pinctrl: k3: Introduce pinmux definitions

Message ID 20181113060111.16374-2-vigneshr@ti.com (mailing list archive)
State New, archived
Headers show
Series AM654: Add pinmux support | expand

Commit Message

Vignesh Raghavendra Nov. 13, 2018, 6:01 a.m. UTC
The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
defining pinmux configs in human readable form, instead of raw-coded
hex values.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 MAINTAINERS                      |  1 +
 include/dt-bindings/pinctrl/k3.h | 35 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/k3.h

Comments

Linus Walleij Nov. 17, 2018, 12:27 p.m. UTC | #1
On Tue, Nov 13, 2018 at 7:00 AM Vignesh R <vigneshr@ti.com> wrote:

> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
> defining pinmux configs in human readable form, instead of raw-coded
> hex values.
>
> Signed-off-by: Vignesh R <vigneshr@ti.com>

I guess you want to merge this through ARM SoC along witg the other
patches so:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Rob Herring Nov. 17, 2018, 3:43 p.m. UTC | #2
On Tue, 13 Nov 2018 11:31:08 +0530, Vignesh R wrote:
> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
> defining pinmux configs in human readable form, instead of raw-coded
> hex values.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
>  MAINTAINERS                      |  1 +
>  include/dt-bindings/pinctrl/k3.h | 35 ++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 include/dt-bindings/pinctrl/k3.h
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Nishanth Menon Nov. 17, 2018, 4:05 p.m. UTC | #3
On 11:31-20181113, Vignesh R wrote:
> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
> defining pinmux configs in human readable form, instead of raw-coded
> hex values.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
>  MAINTAINERS                      |  1 +
>  include/dt-bindings/pinctrl/k3.h | 35 ++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 include/dt-bindings/pinctrl/k3.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fa45ff36fde9..1574ad6d7ead 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2204,6 +2204,7 @@ S:	Supported
>  F:	Documentation/devicetree/bindings/arm/ti/k3.txt
>  F:	arch/arm64/boot/dts/ti/Makefile
>  F:	arch/arm64/boot/dts/ti/k3-*
> +F:	include/dt-bindings/pinctrl/k3.h
>  
>  ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
>  M:	Santosh Shilimkar <ssantosh@kernel.org>
> diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
> new file mode 100644
> index 000000000000..463d845a9b36
> --- /dev/null
> +++ b/include/dt-bindings/pinctrl/k3.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * This header provides constants for pinctrl bindings for TI's K3 SoC
> + * family.
> + *
> + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
> + */
> +#ifndef _DT_BINDINGS_PINCTRL_TI_K3_H
> +#define _DT_BINDINGS_PINCTRL_TI_K3_H
> +
> +#define PULLUDEN_SHIFT		(16)
> +#define PULLTYPESEL_SHIFT	(17)
> +#define RXACTIVE_SHIFT		(18)
> +
> +#define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
> +#define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
> +
> +#define PULL_UP			(1 << PULLTYPESEL_SHIFT | PULL_ENABLE)
> +#define PULL_DOWN		(0 << PULLTYPESEL_SHIFT | PULL_ENABLE)
> +
> +#define INPUT_EN		(1 << RXACTIVE_SHIFT)
> +#define INPUT_DISABLE		(0 << RXACTIVE_SHIFT)
> +
> +/* Only these macros are expected be used directly in device tree files */
> +#define PIN_OUTPUT		(INPUT_DISABLE | PULL_DISABLE)
> +#define PIN_OUTPUT_PULLUP	(INPUT_DISABLE | PULL_UP)
> +#define PIN_OUTPUT_PULLDOWN	(INPUT_DISABLE | PULL_DOWN)
> +#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
> +#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
> +#define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)


Thanks for reducing the combinations down to the minimum needed. We can
worry about the DS and isolation bits when we have a real user for them.

Acked-by: Nishanth Menon <nm@ti.com>

Tero: v4.21-rc1 perhaps ?
Tony Lindgren Nov. 17, 2018, 4:08 p.m. UTC | #4
* Vignesh R <vigneshr@ti.com> [181113 06:00]:
> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
> defining pinmux configs in human readable form, instead of raw-coded
> hex values.

Looks good to me now too thanks:

Acked-by: Tony Lindgren <tony@atomide.com>
Tero Kristo Nov. 19, 2018, 7:19 a.m. UTC | #5
On 17/11/2018 18:05, Nishanth Menon wrote:
> On 11:31-20181113, Vignesh R wrote:
>> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
>> defining pinmux configs in human readable form, instead of raw-coded
>> hex values.
>>
>> Signed-off-by: Vignesh R <vigneshr@ti.com>
>> ---
>>   MAINTAINERS                      |  1 +
>>   include/dt-bindings/pinctrl/k3.h | 35 ++++++++++++++++++++++++++++++++
>>   2 files changed, 36 insertions(+)
>>   create mode 100644 include/dt-bindings/pinctrl/k3.h
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index fa45ff36fde9..1574ad6d7ead 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -2204,6 +2204,7 @@ S:	Supported
>>   F:	Documentation/devicetree/bindings/arm/ti/k3.txt
>>   F:	arch/arm64/boot/dts/ti/Makefile
>>   F:	arch/arm64/boot/dts/ti/k3-*
>> +F:	include/dt-bindings/pinctrl/k3.h
>>   
>>   ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
>>   M:	Santosh Shilimkar <ssantosh@kernel.org>
>> diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
>> new file mode 100644
>> index 000000000000..463d845a9b36
>> --- /dev/null
>> +++ b/include/dt-bindings/pinctrl/k3.h
>> @@ -0,0 +1,35 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +/*
>> + * This header provides constants for pinctrl bindings for TI's K3 SoC
>> + * family.
>> + *
>> + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
>> + */
>> +#ifndef _DT_BINDINGS_PINCTRL_TI_K3_H
>> +#define _DT_BINDINGS_PINCTRL_TI_K3_H
>> +
>> +#define PULLUDEN_SHIFT		(16)
>> +#define PULLTYPESEL_SHIFT	(17)
>> +#define RXACTIVE_SHIFT		(18)
>> +
>> +#define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
>> +#define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
>> +
>> +#define PULL_UP			(1 << PULLTYPESEL_SHIFT | PULL_ENABLE)
>> +#define PULL_DOWN		(0 << PULLTYPESEL_SHIFT | PULL_ENABLE)
>> +
>> +#define INPUT_EN		(1 << RXACTIVE_SHIFT)
>> +#define INPUT_DISABLE		(0 << RXACTIVE_SHIFT)
>> +
>> +/* Only these macros are expected be used directly in device tree files */
>> +#define PIN_OUTPUT		(INPUT_DISABLE | PULL_DISABLE)
>> +#define PIN_OUTPUT_PULLUP	(INPUT_DISABLE | PULL_UP)
>> +#define PIN_OUTPUT_PULLDOWN	(INPUT_DISABLE | PULL_DOWN)
>> +#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
>> +#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
>> +#define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)
> 
> 
> Thanks for reducing the combinations down to the minimum needed. We can
> worry about the DS and isolation bits when we have a real user for them.
> 
> Acked-by: Nishanth Menon <nm@ti.com>
> 
> Tero: v4.21-rc1 perhaps ?
> 

Yeah, looks fine, queueing up for 4.21.

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vignesh Raghavendra Nov. 20, 2018, 10:09 a.m. UTC | #6
On 19/11/18 12:49 PM, Tero Kristo wrote:
> On 17/11/2018 18:05, Nishanth Menon wrote:
>> On 11:31-20181113, Vignesh R wrote:
>>> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
>>
[...]
>>
>> Thanks for reducing the combinations down to the minimum needed. We can
>> worry about the DS and isolation bits when we have a real user for them.
>>
>> Acked-by: Nishanth Menon <nm@ti.com>
>>
>> Tero: v4.21-rc1 perhaps ?
>>
> 
> Yeah, looks fine, queueing up for 4.21.
> 

Thank you all for the review!

Tero,

Is there a branch with these patches that I can use as base for my next
set of DT patches?
Tero Kristo Nov. 20, 2018, 10:37 a.m. UTC | #7
On 20/11/2018 12:09, Vignesh R wrote:
> 
> 
> On 19/11/18 12:49 PM, Tero Kristo wrote:
>> On 17/11/2018 18:05, Nishanth Menon wrote:
>>> On 11:31-20181113, Vignesh R wrote:
>>>> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
>>>
> [...]
>>>
>>> Thanks for reducing the combinations down to the minimum needed. We can
>>> worry about the DS and isolation bits when we have a real user for them.
>>>
>>> Acked-by: Nishanth Menon <nm@ti.com>
>>>
>>> Tero: v4.21-rc1 perhaps ?
>>>
>>
>> Yeah, looks fine, queueing up for 4.21.
>>
> 
> Thank you all for the review!
> 
> Tero,
> 
> Is there a branch with these patches that I can use as base for my next
> set of DT patches?

Don't have a branch for these atm, but I can create one if you need it.

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vignesh Raghavendra Nov. 20, 2018, 10:44 a.m. UTC | #8
On 20/11/18 4:07 PM, Tero Kristo wrote:
> On 20/11/2018 12:09, Vignesh R wrote:
>> On 19/11/18 12:49 PM, Tero Kristo wrote:
>>> On 17/11/2018 18:05, Nishanth Menon wrote:
>>>> On 11:31-20181113, Vignesh R wrote:
>>>>> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
>>>>
>> [...]
>>>>
>>>> Thanks for reducing the combinations down to the minimum needed. We can
>>>> worry about the DS and isolation bits when we have a real user for
>>>> them.
>>>>
>>>> Acked-by: Nishanth Menon <nm@ti.com>
>>>>
>>>> Tero: v4.21-rc1 perhaps ?
>>>>
>>>
>>> Yeah, looks fine, queueing up for 4.21.
>>>
>>
>> Thank you all for the review!
>>
>> Tero,
>>
>> Is there a branch with these patches that I can use as base for my next
>> set of DT patches?
> 
> Don't have a branch for these atm, but I can create one if you need it.

Yes, that would be great. Thanks!
Tero Kristo Nov. 23, 2018, 10:21 a.m. UTC | #9
On 20/11/2018 12:44, Vignesh R wrote:
> On 20/11/18 4:07 PM, Tero Kristo wrote:
>> On 20/11/2018 12:09, Vignesh R wrote:
>>> On 19/11/18 12:49 PM, Tero Kristo wrote:
>>>> On 17/11/2018 18:05, Nishanth Menon wrote:
>>>>> On 11:31-20181113, Vignesh R wrote:
>>>>>> The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
>>>>>
>>> [...]
>>>>>
>>>>> Thanks for reducing the combinations down to the minimum needed. We can
>>>>> worry about the DS and isolation bits when we have a real user for
>>>>> them.
>>>>>
>>>>> Acked-by: Nishanth Menon <nm@ti.com>
>>>>>
>>>>> Tero: v4.21-rc1 perhaps ?
>>>>>
>>>>
>>>> Yeah, looks fine, queueing up for 4.21.
>>>>
>>>
>>> Thank you all for the review!
>>>
>>> Tero,
>>>
>>> Is there a branch with these patches that I can use as base for my next
>>> set of DT patches?
>>
>> Don't have a branch for these atm, but I can create one if you need it.
> 
> Yes, that would be great. Thanks!
> 

Pushed 4.20-rc1-am65x-queue into my public tree.

-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Nishanth Menon Nov. 23, 2018, 3:07 p.m. UTC | #10
On 12:21-20181123, Tero Kristo wrote:
> > > > Is there a branch with these patches that I can use as base for my next
> > > > set of DT patches?
> > > 
> > > Don't have a branch for these atm, but I can create one if you need it.
> > 
> > Yes, that would be great. Thanks!
> > 
> 
> Pushed 4.20-rc1-am65x-queue into my public tree.

I wonder if we can put up a next branch that is available in linux-next
tree? I think it might be a little more convenient for many folks..
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index fa45ff36fde9..1574ad6d7ead 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2204,6 +2204,7 @@  S:	Supported
 F:	Documentation/devicetree/bindings/arm/ti/k3.txt
 F:	arch/arm64/boot/dts/ti/Makefile
 F:	arch/arm64/boot/dts/ti/k3-*
+F:	include/dt-bindings/pinctrl/k3.h
 
 ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
 M:	Santosh Shilimkar <ssantosh@kernel.org>
diff --git a/include/dt-bindings/pinctrl/k3.h b/include/dt-bindings/pinctrl/k3.h
new file mode 100644
index 000000000000..463d845a9b36
--- /dev/null
+++ b/include/dt-bindings/pinctrl/k3.h
@@ -0,0 +1,35 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * This header provides constants for pinctrl bindings for TI's K3 SoC
+ * family.
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ */
+#ifndef _DT_BINDINGS_PINCTRL_TI_K3_H
+#define _DT_BINDINGS_PINCTRL_TI_K3_H
+
+#define PULLUDEN_SHIFT		(16)
+#define PULLTYPESEL_SHIFT	(17)
+#define RXACTIVE_SHIFT		(18)
+
+#define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
+#define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
+
+#define PULL_UP			(1 << PULLTYPESEL_SHIFT | PULL_ENABLE)
+#define PULL_DOWN		(0 << PULLTYPESEL_SHIFT | PULL_ENABLE)
+
+#define INPUT_EN		(1 << RXACTIVE_SHIFT)
+#define INPUT_DISABLE		(0 << RXACTIVE_SHIFT)
+
+/* Only these macros are expected be used directly in device tree files */
+#define PIN_OUTPUT		(INPUT_DISABLE | PULL_DISABLE)
+#define PIN_OUTPUT_PULLUP	(INPUT_DISABLE | PULL_UP)
+#define PIN_OUTPUT_PULLDOWN	(INPUT_DISABLE | PULL_DOWN)
+#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
+#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
+#define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)
+
+#define AM65X_IOPAD(pa, val, muxmode)		(((pa) & 0x1fff)) ((val) | (muxmode))
+#define AM65X_WKUP_IOPAD(pa, val, muxmode)	(((pa) & 0x1fff)) ((val) | (muxmode))
+
+#endif