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

Mathias Kresin dev at kresin.me
Sun Aug 11 05:36:47 EDT 2019


02/08/2019 11:58, Birger Koblitz:
> ramips: use gpio_hog instead of gpio-export
> 
> The `gpio-export` functionality is a hack for
> missing kernel functionality, which was rejected in upstream kernel long
> time
> ago, for details see this email
> http://lists.infradead.org/pipermail/openwrt-devel/2019-February/015772.html,
> discussion in PR#1366 or
> https://github.com/openwrt/openwrt/pull/1814#issuecomment-462942022.
> 
> This patch converts all remaining ramips .dts(i) files which were
> using export-gpio and not making use of the change-direction functionality
> to using gpio_hog instead
> 
> Signed-off-by: Birger Koblitz <mail at birger-koblitz.de>
> 
> ---
> 
> diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
> b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
> index 4097dc6140..ea0d9801c1 100644
> --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
> +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
> @@ -21,39 +21,6 @@
>           bootargs = "console=ttyS0,115200";
>       };
>   
> -    gpio-export {
> -        compatible = "gpio-export";
> -        #size-cells = <0>;
> -
> -        modem-enable {
> -            gpio-export,name = "modem-enable";
> -            gpio-export,output = <1>;
> -            gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> -        };
> -
> -        modem-rf-enable {
> -            gpio-export,name = "modem-rf-enable";
> -            gpio-export,output = <1>;
> -            gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
> -        };
> -
> -        sim-select {
> -            gpio-export,name = "sim-select";
> -            gpio-export,output = <0>;
> -            gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
> -        };
> -
> -        sim1-detect {
> -            gpio-export,name = "sim1-detect";
> -            gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
> -        };
> -
> -        sim2-detect {
> -            gpio-export,name = "sim2-detect";
> -            gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
> -        };
> -    };
> -

Hey Birger,

similar to my comment for the lantiq version, this doesn't work as well.

AFAIR, the Tube e4g has two sim card slots and the "sim-select" gpio is 
supposed to be used from the userspace, to select which sim card slot 
should be used.

If we hog the gpio, it can't be manipulated from the userspace anymore.

I haven't had a closer look at the patch. There might be similar issues 
for other boards.

@Piotr can confirm what I might to remember?

Regards
Mathias

_______________________________________________
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