diff mbox

[1/5] ARM: dts: exynos5250-arndale: Add node entry for gpio-buttons

Message ID 1360214129-4096-1-git-send-email-tushar.behera@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Tushar Behera Feb. 7, 2013, 5:15 a.m. UTC
Added GPIO buttons DT node to Arndale board file.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
This series is based on for-next branch of Kukjin Kim's tree
and added on top of the below patch:
https://patchwork.kernel.org/patch/2042451/
---
 arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

Comments

Kumar, Anil Feb. 7, 2013, 6:17 a.m. UTC | #1
On Thu, Feb 07, 2013 at 10:45:25, Tushar Behera wrote:
> Added GPIO buttons DT node to Arndale board file.
> 
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> This series is based on for-next branch of Kukjin Kim's tree
> and added on top of the below patch:
> https://patchwork.kernel.org/patch/2042451/
> ---
>  arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
>  1 files changed, 48 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
> index 63572f9..9ce40df 100644
> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
> @@ -119,4 +119,52 @@
>  	spi_2: spi@12d40000 {
>  		status = "disabled";
>  	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;

Just want to understand why these properties are here?  
As these properties are for child dt node. But have not seen
anyone is using here.

Sorry if I have misunderstood. 

> +
> +		menu {
> +			label = "SW-TACT2";
> +			gpios = <&gpx1 4 0 0x10000 2>;
> +			linux,code = <139>;
> +			gpio-key,wakeup;
> +		};
> +
> +		home {
> +			label = "SW-TACT3";
> +			gpios = <&gpx1 5 0 0x10000 2>;
> +			linux,code = <102>;
> +			gpio-key,wakeup;
> +		};
> +
> +		up {
> +			label = "SW-TACT4";
> +			gpios = <&gpx1 6 0 0x10000 2>;
> +			linux,code = <103>;
> +			gpio-key,wakeup;
> +		};
> +
> +		down {
> +			label = "SW-TACT5";
> +			gpios = <&gpx1 7 0 0x10000 2>;
> +			linux,code = <108>;
> +			gpio-key,wakeup;
> +		};
> +
> +		back {
> +			label = "SW-TACT6";
> +			gpios = <&gpx2 0 0 0x10000 2>;
> +			linux,code = <158>;
> +			gpio-key,wakeup;
> +		};
> +
> +		wakeup {
> +			label = "SW-TACT7";
> +			gpios = <&gpx2 1 0 0x10000 2>;
> +			linux,code = <143>;
> +			gpio-key,wakeup;
> +		};
> +	};
>  };
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Tushar Behera Feb. 7, 2013, 6:26 a.m. UTC | #2
On 02/07/2013 11:47 AM, Kumar, Anil wrote:
> On Thu, Feb 07, 2013 at 10:45:25, Tushar Behera wrote:
>> Added GPIO buttons DT node to Arndale board file.
>>
>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>> This series is based on for-next branch of Kukjin Kim's tree
>> and added on top of the below patch:
>> https://patchwork.kernel.org/patch/2042451/
>> ---
>>  arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
>>  1 files changed, 48 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
>> index 63572f9..9ce40df 100644
>> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
>> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
>> @@ -119,4 +119,52 @@
>>  	spi_2: spi@12d40000 {
>>  		status = "disabled";
>>  	};
>> +
>> +	gpio_keys {
>> +		compatible = "gpio-keys";
>> +		#address-cells = <1>;
>> +		#size-cells = <0>;
> 
> Just want to understand why these properties are here?  
> As these properties are for child dt node. But have not seen
> anyone is using here.
> 

That is how gpio_keys node entries are defined in other .dts files.
Manish Badarkhe Feb. 7, 2013, 6:36 a.m. UTC | #3
Hi Tushar

On Thu, Feb 7, 2013 at 11:56 AM, Tushar Behera <tushar.behera@linaro.org> wrote:
> On 02/07/2013 11:47 AM, Kumar, Anil wrote:
>> On Thu, Feb 07, 2013 at 10:45:25, Tushar Behera wrote:
>>> Added GPIO buttons DT node to Arndale board file.
>>>
>>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>>> ---
>>> This series is based on for-next branch of Kukjin Kim's tree
>>> and added on top of the below patch:
>>> https://patchwork.kernel.org/patch/2042451/
>>> ---
>>>  arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
>>>  1 files changed, 48 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
>>> index 63572f9..9ce40df 100644
>>> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
>>> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
>>> @@ -119,4 +119,52 @@
>>>      spi_2: spi@12d40000 {
>>>              status = "disabled";
>>>      };
>>> +
>>> +    gpio_keys {
>>> +            compatible = "gpio-keys";
>>> +            #address-cells = <1>;
>>> +            #size-cells = <0>;
>>
>> Just want to understand why these properties are here?
>> As these properties are for child dt node. But have not seen
>> anyone is using here.
>>
>
> That is how gpio_keys node entries are defined in other .dts files.

I have gone through example for address-cells and size-cells in following link:
http://devicetree.org/mediawiki/index.php?title=Device_Tree_Usage&stable=1#CPU_addressing

which indicates that these fields are for child "reg".
I think, here in child node there is no "reg". so there is no use
of address-cells and size-cells propeties.

Correct me if I am wrong here?

Thanks
Manish Badarkhe
Tushar Behera Feb. 7, 2013, 6:56 a.m. UTC | #4
On 02/07/2013 12:06 PM, Manish Badarkhe wrote:
> Hi Tushar
> 
> On Thu, Feb 7, 2013 at 11:56 AM, Tushar Behera <tushar.behera@linaro.org> wrote:
>> On 02/07/2013 11:47 AM, Kumar, Anil wrote:
>>> On Thu, Feb 07, 2013 at 10:45:25, Tushar Behera wrote:
>>>> Added GPIO buttons DT node to Arndale board file.
>>>>
>>>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>>>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>>>> ---
>>>> This series is based on for-next branch of Kukjin Kim's tree
>>>> and added on top of the below patch:
>>>> https://patchwork.kernel.org/patch/2042451/
>>>> ---
>>>>  arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
>>>>  1 files changed, 48 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
>>>> index 63572f9..9ce40df 100644
>>>> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
>>>> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
>>>> @@ -119,4 +119,52 @@
>>>>      spi_2: spi@12d40000 {
>>>>              status = "disabled";
>>>>      };
>>>> +
>>>> +    gpio_keys {
>>>> +            compatible = "gpio-keys";
>>>> +            #address-cells = <1>;
>>>> +            #size-cells = <0>;
>>>
>>> Just want to understand why these properties are here?
>>> As these properties are for child dt node. But have not seen
>>> anyone is using here.
>>>
>>
>> That is how gpio_keys node entries are defined in other .dts files.
> 
> I have gone through example for address-cells and size-cells in following link:
> http://devicetree.org/mediawiki/index.php?title=Device_Tree_Usage&stable=1#CPU_addressing
> 
> which indicates that these fields are for child "reg".
> I think, here in child node there is no "reg". so there is no use
> of address-cells and size-cells propeties.
> 

Please check Documentation/devicetree/bindings/gpio/gpio_keys.txt

And whether these properties are required or not, I will let device tree
experts to comment on that.

As such, currently all node entries for gpio_keys use these properties.
girishks2000@gmail.com Feb. 7, 2013, 7:43 a.m. UTC | #5
On Wed, Feb 6, 2013 at 10:56 PM, Tushar Behera <tushar.behera@linaro.org> wrote:
> On 02/07/2013 12:06 PM, Manish Badarkhe wrote:
>> Hi Tushar
>>
>> On Thu, Feb 7, 2013 at 11:56 AM, Tushar Behera <tushar.behera@linaro.org> wrote:
>>> On 02/07/2013 11:47 AM, Kumar, Anil wrote:
>>>> On Thu, Feb 07, 2013 at 10:45:25, Tushar Behera wrote:
>>>>> Added GPIO buttons DT node to Arndale board file.
>>>>>
>>>>> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
>>>>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>>>>> ---
>>>>> This series is based on for-next branch of Kukjin Kim's tree
>>>>> and added on top of the below patch:
>>>>> https://patchwork.kernel.org/patch/2042451/
>>>>> ---
>>>>>  arch/arm/boot/dts/exynos5250-arndale.dts |   48 ++++++++++++++++++++++++++++++
>>>>>  1 files changed, 48 insertions(+), 0 deletions(-)
>>>>>
>>>>> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
>>>>> index 63572f9..9ce40df 100644
>>>>> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
>>>>> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
>>>>> @@ -119,4 +119,52 @@
>>>>>      spi_2: spi@12d40000 {
>>>>>              status = "disabled";
>>>>>      };
>>>>> +
>>>>> +    gpio_keys {
>>>>> +            compatible = "gpio-keys";
>>>>> +            #address-cells = <1>;
>>>>> +            #size-cells = <0>;
>>>>
>>>> Just want to understand why these properties are here?
>>>> As these properties are for child dt node. But have not seen
>>>> anyone is using here.
>>>>
>>>
>>> That is how gpio_keys node entries are defined in other .dts files.
>>
>> I have gone through example for address-cells and size-cells in following link:
>> http://devicetree.org/mediawiki/index.php?title=Device_Tree_Usage&stable=1#CPU_addressing
>>
>> which indicates that these fields are for child "reg".
>> I think, here in child node there is no "reg". so there is no use
>> of address-cells and size-cells propeties.
>>
>
> Please check Documentation/devicetree/bindings/gpio/gpio_keys.txt
>
> And whether these properties are required or not, I will let device tree
> experts to comment on that.
>
> As such, currently all node entries for gpio_keys use these properties.
you can just verify by a simple test.
delete the 2 lines. address-cells and size cells.
this will have no affect.
now with these 2 lines deleted lines add a dummy reg property with
address and cell. dtb compiler will warn.
So I think what manish reffered is right.
There is also a reference of smdk4210 for kepads.
>
> --
> Tushar Behera
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tushar Behera Feb. 7, 2013, 9:40 a.m. UTC | #6
+CC: David Jander <david@protonic.nl>
+CC: Dmitry Torokhov <dtor@mail.ru>

On 02/07/2013 01:13 PM, Girish KS wrote:
>>>>>> +
>>>>>> +    gpio_keys {
>>>>>> +            compatible = "gpio-keys";
>>>>>> +            #address-cells = <1>;
>>>>>> +            #size-cells = <0>;
>>>>>
>>>>> Just want to understand why these properties are here?
>>>>> As these properties are for child dt node. But have not seen
>>>>> anyone is using here.
>>>>>
>>>>
>>>> That is how gpio_keys node entries are defined in other .dts files.
>>>
>>> I have gone through example for address-cells and size-cells in following link:
>>> http://devicetree.org/mediawiki/index.php?title=Device_Tree_Usage&stable=1#CPU_addressing
>>>
>>> which indicates that these fields are for child "reg".
>>> I think, here in child node there is no "reg". so there is no use
>>> of address-cells and size-cells propeties.
>>>
>>
>> Please check Documentation/devicetree/bindings/gpio/gpio_keys.txt
>>
>> And whether these properties are required or not, I will let device tree
>> experts to comment on that.
>>
>> As such, currently all node entries for gpio_keys use these properties.
> you can just verify by a simple test.
> delete the 2 lines. address-cells and size cells.
> this will have no affect.
> now with these 2 lines deleted lines add a dummy reg property with
> address and cell. dtb compiler will warn.
> So I think what manish reffered is right.
> There is also a reference of smdk4210 for kepads.

Right. Compilation is ok even after removing the address-cell and
size-cell properties.

But since this is used across all the instances, I would like to know
the view of the authors on this.

David, Dimitry,

Can you please let us know your opinion on this? If these properties are
not required, then we can remove them from the documentation and from
node entries in several other dts files.

>>
>> --
>> Tushar Behera
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tomasz Figa Feb. 7, 2013, 10:30 a.m. UTC | #7
Hi,

I'm wondering why Exynos5250 has not been migrated to use pinctrl yet.

Support for it in pinctrl-samsung driver has been already merged, but I 
don't see any pinctrl nodes in exynos5250.dtsi.

This is important because the legacy gpio-samsung support is going to be 
dropped, as it already happened in case of Exynos 4.

CC'ing Thomas Abraham as he might know something.

Best regards,
Tomasz Figa Feb. 7, 2013, 11:25 a.m. UTC | #8
On Thursday 07 of February 2013 15:10:27 Tushar Behera wrote:
> +CC: David Jander <david@protonic.nl>
> +CC: Dmitry Torokhov <dtor@mail.ru>
> 
> On 02/07/2013 01:13 PM, Girish KS wrote:
> >>>>>> +
> >>>>>> +    gpio_keys {
> >>>>>> +            compatible = "gpio-keys";
> >>>>>> +            #address-cells = <1>;
> >>>>>> +            #size-cells = <0>;
> >>>>> 
> >>>>> Just want to understand why these properties are here?
> >>>>> As these properties are for child dt node. But have not seen
> >>>>> anyone is using here.
> >>>> 
> >>>> That is how gpio_keys node entries are defined in other .dts files.
> >>> 
> >>> I have gone through example for address-cells and size-cells in
> >>> following link:
> >>> http://devicetree.org/mediawiki/index.php?title=Device_Tree_Usage&s
> >>> table=1#CPU_addressing
> >>> 
> >>> which indicates that these fields are for child "reg".
> >>> I think, here in child node there is no "reg". so there is no use
> >>> of address-cells and size-cells propeties.
> >> 
> >> Please check Documentation/devicetree/bindings/gpio/gpio_keys.txt
> >> 
> >> And whether these properties are required or not, I will let device
> >> tree experts to comment on that.
> >> 
> >> As such, currently all node entries for gpio_keys use these
> >> properties.
> > 
> > you can just verify by a simple test.
> > delete the 2 lines. address-cells and size cells.
> > this will have no affect.
> > now with these 2 lines deleted lines add a dummy reg property with
> > address and cell. dtb compiler will warn.
> > So I think what manish reffered is right.
> > There is also a reference of smdk4210 for kepads.
> 
> Right. Compilation is ok even after removing the address-cell and
> size-cell properties.
> 
> But since this is used across all the instances, I would like to know
> the view of the authors on this.
> 
> David, Dimitry,
> 
> Can you please let us know your opinion on this? If these properties are
> not required, then we can remove them from the documentation and from
> node entries in several other dts files.

The #address-cells and #size-cells are used only together with reg 
properties of sub nodes. They define how many cells in reg specifier are 
used for registers address and length.

So, if you have #address-cells = <1> and #size-cells = <0>, then your reg 
specifier will be simply <addr>. You can get more complex specifiers using 
more address cells and size cells, like:

#address-cells = <3>;
#size-cells = <1>;

subdev@1,2,3 {
	reg = <1 2 3 0x1000>;
	/* ... */
};

If you don't intend to use reg property for child device addressing then 
you don't define #address-cells and #size-cells properties.

I think that the documentation of gpio_keys binding should be corrected 
and possibly also moved to bindings/input instead of bindings/gpio, as 
this directory is intended to be used for GPIO controllers, not GPIO 
consumers.

Best regards,
Kim Kukjin March 11, 2013, 2:05 a.m. UTC | #9
Tomasz Figa wrote:
> 
> Hi,
> 
> I'm wondering why Exynos5250 has not been migrated to use pinctrl yet.
> 
> Support for it in pinctrl-samsung driver has been already merged, but I
> don't see any pinctrl nodes in exynos5250.dtsi.
> 
> This is important because the legacy gpio-samsung support is going to be
> dropped, as it already happened in case of Exynos 4.
> 
> CC'ing Thomas Abraham as he might know something.
> 
Tushar and all,

I agree with Tomasz's opinion to support pinctrl instead of gpio on exynos5250
stuff.

Please re-submit with using pinctrl is in samsung tree.

If any problems, please let us know.

Thanks.

- Kukjin
Tushar Behera March 11, 2013, 9:44 a.m. UTC | #10
On 03/11/2013 07:35 AM, Kukjin Kim wrote:
> Tomasz Figa wrote:
>>
>> Hi,
>>
>> I'm wondering why Exynos5250 has not been migrated to use pinctrl yet.
>>
>> Support for it in pinctrl-samsung driver has been already merged, but I
>> don't see any pinctrl nodes in exynos5250.dtsi.
>>
>> This is important because the legacy gpio-samsung support is going to be
>> dropped, as it already happened in case of Exynos 4.
>>
>> CC'ing Thomas Abraham as he might know something.
>>
> Tushar and all,
> 
> I agree with Tomasz's opinion to support pinctrl instead of gpio on exynos5250
> stuff.
> 
> Please re-submit with using pinctrl is in samsung tree.
> 

Ok. I will rebase the patchset on for-next branch and re-submit.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
index 63572f9..9ce40df 100644
--- a/arch/arm/boot/dts/exynos5250-arndale.dts
+++ b/arch/arm/boot/dts/exynos5250-arndale.dts
@@ -119,4 +119,52 @@ 
 	spi_2: spi@12d40000 {
 		status = "disabled";
 	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		menu {
+			label = "SW-TACT2";
+			gpios = <&gpx1 4 0 0x10000 2>;
+			linux,code = <139>;
+			gpio-key,wakeup;
+		};
+
+		home {
+			label = "SW-TACT3";
+			gpios = <&gpx1 5 0 0x10000 2>;
+			linux,code = <102>;
+			gpio-key,wakeup;
+		};
+
+		up {
+			label = "SW-TACT4";
+			gpios = <&gpx1 6 0 0x10000 2>;
+			linux,code = <103>;
+			gpio-key,wakeup;
+		};
+
+		down {
+			label = "SW-TACT5";
+			gpios = <&gpx1 7 0 0x10000 2>;
+			linux,code = <108>;
+			gpio-key,wakeup;
+		};
+
+		back {
+			label = "SW-TACT6";
+			gpios = <&gpx2 0 0 0x10000 2>;
+			linux,code = <158>;
+			gpio-key,wakeup;
+		};
+
+		wakeup {
+			label = "SW-TACT7";
+			gpios = <&gpx2 1 0 0x10000 2>;
+			linux,code = <143>;
+			gpio-key,wakeup;
+		};
+	};
 };