[OpenWrt-Devel] [PATCH] ath79: use gpio_hog instead of gpio-export

mail at adrianschmutzler.de mail at adrianschmutzler.de
Sat Aug 10 16:20:29 EDT 2019


Hi,

> +    usb {
> +        gpio-hog;
> +        line-name = "tp-link:power:usb";
> +        gpios = <6 GPIO_ACTIVE_HIGH>;
> +        output-high;
>      };
>  };

As stated earlier, I would prefer calling those blocks usb-power, usb1-power, etc..

> diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts
> b/target/linux/ath79/dts/qca9531_yuncore_a770.dts
> index da5b6dc7db..18ad6307a1 100644
> --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts
> +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts
> @@ -8,7 +8,7 @@
> 
>  / {
>      model = "YunCore A770";
> -    compatible = "yuncore,a770", "qca,qca9531";
> +    compatible = "yuncore,a770", "qca,qca9533";

This should be removed.

> diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> index 6d32fa3fc4..378c87c9ee 100644
> --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi
> @@ -54,22 +54,23 @@
>              gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
>          };
>      };
> +};
> 
> -    gpio-export {
> -        compatible = "gpio-export";
> -
> -        gpio_shift_register_oe {
> -            gpio-export,name = "tp-link:oe:sr";
> -            gpio-export,output = <0>;
> -            gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
> -        };
> +&gpio {
> +    status = "okay";
> 
> -        gpio_shift_register_reset {
> -            gpio-export,name = "tp-link:reset:sr";
> -            gpio-export,output = <1>;
> -            gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
> -        };
> +    sr {
> +        gpio-hog;
> +        line-name = "tp-link:oe:sr";
> +        gpios = <16 GPIO_ACTIVE_HIGH>;
> +        output-low;
> +    };
> 
> +    sr {
> +        gpio-hog;
> +        line-name = "tp-link:reset:sr";
> +        gpios = <19 GPIO_ACTIVE_HIGH>;
> +        output-high;
>      };

Those two should have different node names.

> diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts
> b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts
> index f4add2fe31..d892d0e960 100644
> --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts
> +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts
> @@ -41,22 +41,6 @@
>          };
>      };
> 
> -    gpio-export {
> -        compatible = "gpio-export";
> -
> -        gpio_shift_register_oe {
> -            gpio-export,name = "tp-link:oe:sr";
> -            gpio-export,output = <0>;
> -            gpios = <&gpio 1 GPIO_ACTIVE_LOW>;    // 74HC595 /OE (Output
> Enable)
> -        };
> -
> -        gpio_shift_register_reset {
> -            gpio-export,name = "tp-link:reset:sr";
> -            gpio-export,output = <1>;
> -            gpios = <&gpio 21 GPIO_ACTIVE_LOW>;    // 74HC595 /SRCLR (Serial
> Clear)
> -        };
> -    };
> -
>      leds {
>          compatible = "gpio-leds";
> 
> @@ -148,15 +132,29 @@
> 
>  };
> 
> -&pcie {
> +&gpio {
>      status = "okay";
> +
> +    sr {
> +        gpio-hog;
> +        line-name = "tp-link:oe:sr";
> +        gpios = <1 GPIO_ACTIVE_LOW>;
> +        output-low;
> +    };
> +
> +    sr {
> +        gpio-hog;
> +        line-name = "tp-link:reset:sr";
> +        gpios = <21 GPIO_ACTIVE_LOW>;
> +        output-high;
> +    };
>  };

Same here.

Rest looks good, I haven't checked for duplicate &gpio definitions (you seem to have addressed some).

Best

Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20190810/aca8fded/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list