diff mbox

[OpenWrt-Devel] brcm63xx: HG553 buttons support

Message ID 20150715070554.431e20d7@samsung
State Changes Requested
Delegated to: Jonas Gorski
Headers show

Commit Message

Cezary Jackiewicz July 15, 2015, 5:05 a.m. UTC
This patch adds buttons support for Huawei EchoLife HG553.

Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
---

Comments

Rafał Miłecki July 15, 2015, 5:59 a.m. UTC | #1
On 15 July 2015 at 07:05, Cezary Jackiewicz <cezary.jackiewicz@gmail.com> wrote:
> @@ -6,6 +6,25 @@
>         model = "Huawei EchoLife HG553";
>         compatible = "huawei,hg553", "brcm,bcm6358";
>
> +       gpio-keys-polled {
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               poll-interval = <20>;
> +               debounce-interval = <60>;
> +
> +               rfkill {
> +                       label = "rfkill";
> +                       gpios = <&gpio0 9 1>;
> +                       linux,code = <247>;
> +               };
> +               reset {
> +                       label = "reset";
> +                       gpios = <&gpio1 5 1>;
> +                       linux,code = <0x198>;
> +               };
> +       };

I really think you bcm63xx guys should start using KEY_* at some point :)
Jonas Gorski July 15, 2015, 10:21 a.m. UTC | #2
Hi,

On Wed, Jul 15, 2015 at 7:05 AM, Cezary Jackiewicz
<cezary.jackiewicz@gmail.com> wrote:
> This patch adds buttons support for Huawei EchoLife HG553.
>
> Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>

Generally looks good, but a few nitpicks:

> ---
>
> diff --git a/target/linux/brcm63xx/dts/hg553.dts b/target/linux/brcm63xx/dts/hg553.dts
> index 140e2de..fa22403 100644
> --- a/target/linux/brcm63xx/dts/hg553.dts
> +++ b/target/linux/brcm63xx/dts/hg553.dts
> @@ -6,6 +6,25 @@
>         model = "Huawei EchoLife HG553";
>         compatible = "huawei,hg553", "brcm,bcm6358";
>
> +       gpio-keys-polled {
> +               compatible = "gpio-keys-polled";
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +               poll-interval = <20>;
> +               debounce-interval = <60>;
> +
> +               rfkill {
> +                       label = "rfkill";
> +                       gpios = <&gpio0 9 1>;
> +                       linux,code = <247>;
> +               };

Add an empty line here please.

> +               reset {
> +                       label = "reset";
> +                       gpios = <&gpio1 5 1>;
> +                       linux,code = <0x198>;

Please decide on either hexadecimal or decimal for the codes.


Regards
Jonas
Jonas Gorski July 15, 2015, 10:23 a.m. UTC | #3
On Wed, Jul 15, 2015 at 7:59 AM, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 15 July 2015 at 07:05, Cezary Jackiewicz <cezary.jackiewicz@gmail.com> wrote:
>> @@ -6,6 +6,25 @@
>>         model = "Huawei EchoLife HG553";
>>         compatible = "huawei,hg553", "brcm,bcm6358";
>>
>> +       gpio-keys-polled {
>> +               compatible = "gpio-keys-polled";
>> +               #address-cells = <1>;
>> +               #size-cells = <0>;
>> +               poll-interval = <20>;
>> +               debounce-interval = <60>;
>> +
>> +               rfkill {
>> +                       label = "rfkill";
>> +                       gpios = <&gpio0 9 1>;
>> +                       linux,code = <247>;
>> +               };
>> +               reset {
>> +                       label = "reset";
>> +                       gpios = <&gpio1 5 1>;
>> +                       linux,code = <0x198>;
>> +               };
>> +       };
>
> I really think you bcm63xx guys should start using KEY_* at some point :)

The dts files are built out of tree, so we currently don't have access
to dt-includes.


Jonas
John Crispin July 15, 2015, 10:25 a.m. UTC | #4
On 15/07/2015 12:23, Jonas Gorski wrote:
> On Wed, Jul 15, 2015 at 7:59 AM, Rafał Miłecki <zajec5@gmail.com> wrote:
>> On 15 July 2015 at 07:05, Cezary Jackiewicz <cezary.jackiewicz@gmail.com> wrote:
>>> @@ -6,6 +6,25 @@
>>>         model = "Huawei EchoLife HG553";
>>>         compatible = "huawei,hg553", "brcm,bcm6358";
>>>
>>> +       gpio-keys-polled {
>>> +               compatible = "gpio-keys-polled";
>>> +               #address-cells = <1>;
>>> +               #size-cells = <0>;
>>> +               poll-interval = <20>;
>>> +               debounce-interval = <60>;
>>> +
>>> +               rfkill {
>>> +                       label = "rfkill";
>>> +                       gpios = <&gpio0 9 1>;
>>> +                       linux,code = <247>;
>>> +               };
>>> +               reset {
>>> +                       label = "reset";
>>> +                       gpios = <&gpio1 5 1>;
>>> +                       linux,code = <0x198>;
>>> +               };
>>> +       };
>>
>> I really think you bcm63xx guys should start using KEY_* at some point :)
> 
> The dts files are built out of tree, so we currently don't have access
> to dt-includes.
> 

i have the same problem on ramips/lantiq so maybe we should make the
headers available in trunk in some way. while porting the new mediatek
arm soc i noticed that the header includes make the dts files more readable.
Jonas Gorski July 16, 2015, 11:18 a.m. UTC | #5
On Wed, Jul 15, 2015 at 12:25 PM, John Crispin <blogic@openwrt.org> wrote:
> On 15/07/2015 12:23, Jonas Gorski wrote:
>> On Wed, Jul 15, 2015 at 7:59 AM, Rafał Miłecki <zajec5@gmail.com> wrote:
>>> On 15 July 2015 at 07:05, Cezary Jackiewicz <cezary.jackiewicz@gmail.com> wrote:
>>>> @@ -6,6 +6,25 @@
>>>>         model = "Huawei EchoLife HG553";
>>>>         compatible = "huawei,hg553", "brcm,bcm6358";
>>>>
>>>> +       gpio-keys-polled {
>>>> +               compatible = "gpio-keys-polled";
>>>> +               #address-cells = <1>;
>>>> +               #size-cells = <0>;
>>>> +               poll-interval = <20>;
>>>> +               debounce-interval = <60>;
>>>> +
>>>> +               rfkill {
>>>> +                       label = "rfkill";
>>>> +                       gpios = <&gpio0 9 1>;
>>>> +                       linux,code = <247>;
>>>> +               };
>>>> +               reset {
>>>> +                       label = "reset";
>>>> +                       gpios = <&gpio1 5 1>;
>>>> +                       linux,code = <0x198>;
>>>> +               };
>>>> +       };
>>>
>>> I really think you bcm63xx guys should start using KEY_* at some point :)
>>
>> The dts files are built out of tree, so we currently don't have access
>> to dt-includes.
>>
>
> i have the same problem on ramips/lantiq so maybe we should make the
> headers available in trunk in some way. while porting the new mediatek
> arm soc i noticed that the header includes make the dts files more readable.

I just copied the CPP invocation from the kernel (without the dependency
tracking) and added it as a new define which works at least for me,
see r46389, r46390, r46391.

Hopefully I got all usecases covered (I saw ppc passes some extra dtc flags).


Jonas
diff mbox

Patch

diff --git a/target/linux/brcm63xx/dts/hg553.dts b/target/linux/brcm63xx/dts/hg553.dts
index 140e2de..fa22403 100644
--- a/target/linux/brcm63xx/dts/hg553.dts
+++ b/target/linux/brcm63xx/dts/hg553.dts
@@ -6,6 +6,25 @@ 
 	model = "Huawei EchoLife HG553";
 	compatible = "huawei,hg553", "brcm,bcm6358";
 
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		debounce-interval = <60>;
+
+		rfkill {
+			label = "rfkill";
+			gpios = <&gpio0 9 1>;
+			linux,code = <247>;
+		};
+		reset {
+			label = "reset";
+			gpios = <&gpio1 5 1>;
+			linux,code = <0x198>;
+		};
+	};
+
 	gpio-leds {
 		compatible = "gpio-leds";