All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs
@ 2017-05-31  1:21 Kevin Hilman
  2017-06-02  6:01 ` Sekhar Nori
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2017-05-31  1:21 UTC (permalink / raw)
  To: linux-arm-kernel

In order GPIOS from this controller to be used with the "gpio-hogs"
property, the tca6416 node has to properly labeled as a gpio-controller,
and use #gpio-cells.

With that, the SEL_A, SEL_B, SEL_C lines that are used to select VPIF
input can be configured using GPIO hogs.

As an example, example, the configuration below selects the analog video
input on the da850-evm UI board:

&tca6416 {
	 status = "okay";

	 sel_a {
		gpio-hog;
		gpios = <7 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "ADC_ENn";
	 };
	 sel_b {
		gpio-hog;
		gpios = <6 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "CAMERA_ENn";
	 };
	 sel_c {
		gpio-hog;
		gpios = <5 GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "VIDEO_IN_ENn";
	 };
};

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 arch/arm/boot/dts/da850-evm.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 8d244cd76c36..a423e8ebfb37 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -82,6 +82,8 @@
 			tca6416: gpio at 20 {
 				compatible = "ti,tca6416";
 				reg = <0x20>;
+				gpio-controller;
+				#gpio-cells = <2>;
 			};
 		};
 		wdt: wdt at 21000 {
-- 
2.9.3

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

* [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs
  2017-05-31  1:21 [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs Kevin Hilman
@ 2017-06-02  6:01 ` Sekhar Nori
  2017-06-02 20:27   ` Kevin Hilman
  0 siblings, 1 reply; 4+ messages in thread
From: Sekhar Nori @ 2017-06-02  6:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kevin,

On Wednesday 31 May 2017 06:51 AM, Kevin Hilman wrote:
> In order GPIOS from this controller to be used with the "gpio-hogs"
> property, the tca6416 node has to properly labeled as a gpio-controller,
> and use #gpio-cells.
> 
> With that, the SEL_A, SEL_B, SEL_C lines that are used to select VPIF
> input can be configured using GPIO hogs.
> 
> As an example, example, the configuration below selects the analog video
> input on the da850-evm UI board:
> 
> &tca6416 {
> 	 status = "okay";
> 
> 	 sel_a {
> 		gpio-hog;
> 		gpios = <7 GPIO_ACTIVE_HIGH>;
> 		output-high;
> 		line-name = "ADC_ENn";
> 	 };
> 	 sel_b {
> 		gpio-hog;
> 		gpios = <6 GPIO_ACTIVE_HIGH>;
> 		output-high;
> 		line-name = "CAMERA_ENn";
> 	 };
> 	 sel_c {
> 		gpio-hog;
> 		gpios = <5 GPIO_ACTIVE_HIGH>;
> 		output-low;
> 		line-name = "VIDEO_IN_ENn";
> 	 };
> };
> 
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>

This patch looks good to me. On the topic of using gpio hogs for this
sort of thing, in the past I felt using enable-gpios property is better.

My reasoning given to Bartosz is here:
https://patchwork.kernel.org/patch/9578031/

Thanks,
Sekhar

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

* [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs
  2017-06-02  6:01 ` Sekhar Nori
@ 2017-06-02 20:27   ` Kevin Hilman
  2017-06-06 10:22     ` Sekhar Nori
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2017-06-02 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 1, 2017 at 11:01 PM, Sekhar Nori <nsekhar@ti.com> wrote:
> Hi Kevin,
>
> On Wednesday 31 May 2017 06:51 AM, Kevin Hilman wrote:
>> In order GPIOS from this controller to be used with the "gpio-hogs"
>> property, the tca6416 node has to properly labeled as a gpio-controller,
>> and use #gpio-cells.
>>
>> With that, the SEL_A, SEL_B, SEL_C lines that are used to select VPIF
>> input can be configured using GPIO hogs.
>>
>> As an example, example, the configuration below selects the analog video
>> input on the da850-evm UI board:
>>
>> &tca6416 {
>>        status = "okay";
>>
>>        sel_a {
>>               gpio-hog;
>>               gpios = <7 GPIO_ACTIVE_HIGH>;
>>               output-high;
>>               line-name = "ADC_ENn";
>>        };
>>        sel_b {
>>               gpio-hog;
>>               gpios = <6 GPIO_ACTIVE_HIGH>;
>>               output-high;
>>               line-name = "CAMERA_ENn";
>>        };
>>        sel_c {
>>               gpio-hog;
>>               gpios = <5 GPIO_ACTIVE_HIGH>;
>>               output-low;
>>               line-name = "VIDEO_IN_ENn";
>>        };
>> };
>>
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>
> This patch looks good to me. On the topic of using gpio hogs for this
> sort of thing, in the past I felt using enable-gpios property is better.
>
> My reasoning given to Bartosz is here:
> https://patchwork.kernel.org/patch/9578031/

Sure, that's fine when they are used for a specific functionality, but
using gpio-hog is very useful for testing/debugging, so this patch
just aims at fixing the basics.

That being said, I'm still not convinced what the best place for this
is because they're not really part of the VPIF either (e.g. they
control the character LCD which has nothing to do with the VPIF.)

In any case, I'm not trying to solve that problem in this patch, so
thanks for the review.

Kevin

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

* [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs
  2017-06-02 20:27   ` Kevin Hilman
@ 2017-06-06 10:22     ` Sekhar Nori
  0 siblings, 0 replies; 4+ messages in thread
From: Sekhar Nori @ 2017-06-06 10:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 03 June 2017 01:57 AM, Kevin Hilman wrote:
> On Thu, Jun 1, 2017 at 11:01 PM, Sekhar Nori <nsekhar@ti.com> wrote:
>> Hi Kevin,
>>
>> On Wednesday 31 May 2017 06:51 AM, Kevin Hilman wrote:
>>> In order GPIOS from this controller to be used with the "gpio-hogs"
>>> property, the tca6416 node has to properly labeled as a gpio-controller,
>>> and use #gpio-cells.
>>>
>>> With that, the SEL_A, SEL_B, SEL_C lines that are used to select VPIF
>>> input can be configured using GPIO hogs.
>>>
>>> As an example, example, the configuration below selects the analog video
>>> input on the da850-evm UI board:
>>>
>>> &tca6416 {
>>>        status = "okay";
>>>
>>>        sel_a {
>>>               gpio-hog;
>>>               gpios = <7 GPIO_ACTIVE_HIGH>;
>>>               output-high;
>>>               line-name = "ADC_ENn";
>>>        };
>>>        sel_b {
>>>               gpio-hog;
>>>               gpios = <6 GPIO_ACTIVE_HIGH>;
>>>               output-high;
>>>               line-name = "CAMERA_ENn";
>>>        };
>>>        sel_c {
>>>               gpio-hog;
>>>               gpios = <5 GPIO_ACTIVE_HIGH>;
>>>               output-low;
>>>               line-name = "VIDEO_IN_ENn";
>>>        };
>>> };
>>>
>>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>>
>> This patch looks good to me. On the topic of using gpio hogs for this
>> sort of thing, in the past I felt using enable-gpios property is better.
>>
>> My reasoning given to Bartosz is here:
>> https://patchwork.kernel.org/patch/9578031/
> 
> Sure, that's fine when they are used for a specific functionality, but
> using gpio-hog is very useful for testing/debugging, so this patch
> just aims at fixing the basics.

Agreed.

> That being said, I'm still not convinced what the best place for this
> is because they're not really part of the VPIF either (e.g. they
> control the character LCD which has nothing to do with the VPIF.)

Agreed too. And this reminds me that this was discussed earlier.

https://patchwork.kernel.org/patch/9586853/

> In any case, I'm not trying to solve that problem in this patch, so
> thanks for the review.

I have now applied the patch to my v4.13/dt branch.

Thanks,
Sekhar

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

end of thread, other threads:[~2017-06-06 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31  1:21 [PATCH] ARM: dts: da850-evm: fix tca6416 for use with GPIO hogs Kevin Hilman
2017-06-02  6:01 ` Sekhar Nori
2017-06-02 20:27   ` Kevin Hilman
2017-06-06 10:22     ` Sekhar Nori

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.