Re: [PATCH v1] net: mdio: fixed set gpio in ...switch_fn()

From: Andrew Lunn
Date: Wed Apr 12 2023 - 11:42:26 EST


On Wed, Apr 12, 2023 at 11:02:21PM +0800, Yan Wang wrote:
> DTS,e.g:
> mdio_mux {
> compatible = "mdio-mux-gpio";
> pinctrl-0 = <&pinctrl_mdio_mux>;
> pinctrl-names = "default";
> gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>,<&gpio1 10 GPIO_ACTIVE_HIGH>;
> enable-gpios = <&gpio1 13 1>;
> mdio-parent-bus = <&mdio0>;
> #address-cells = <1>;
> #size-cells = <0>;
> mdio@0{...};
> ...
> mido@3{...};
>
> };
>
> If desired_child = 2, that don't control gpio1_10.I do not understand,
> but chang the third parameter to NULL of the gpiod_set_array_value_cansleep().
> it can work normally on the IMX8MP platform.

Please could you explain the problem you are seeing in more details.

What i think you mean is that then passing s->gpios->info, gpio1 10 is
not being set to the correct value?

If so, this is not the correct fix. It seems like either the IMX8MP
gpio driver is broken, or possibly there is a bug in the gpio core.
You need to find the real problem.

Andrew