Re: [PATCH v3 1/2] dt-bindings: gpio: 74x164: Introduce the 'registers-default' property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 30, 2020 at 10:49 PM Fabio Estevam <festevam@xxxxxxxxx> wrote:

> There are cases where a certain default output value in the 74x164
> output is needed.
>
> For example: the imx6ul-evk board has the Ethernet PHY reset controlled
> by the 74x164 chip.
>
> After enabling the OE pin, the output pins of the 74x164 chip go to
> zero by default, which makes the Ethernet PHY not to be detected.

So should the ethernet PHY not just have some reset-gpios
that it obtain and de-assert as part of probing?

For example drivers/net/phy/mdio_bus.c has this:

        /* de-assert bus level PHY GPIO reset */
        gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW);

Other drivers can do the same.

Deferred probe should ascertain that this GPIO driver gets
loaded before the ethernet phy driver.

> Add a new optional property called 'registers-default' that allows
> describing the default output value for each shift register.
>
> Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>
(...)
>  Optional properties:
>  - enable-gpios: GPIO connected to the OE (Output Enable) pin.
> +- registers-default: An array of 8-bit values describing the default output
> +value of each shift registers.

What this does is to set up several of the GPIO lines to default
values, right?

I think this is a hack, there have again and again been proposed
to have a way to set up initial values of GPIO lines. I think we
need to fix that instead.

I am sorry that initial values just stalemate all the time.

I imagine that codewise it should just be some lines in
of_gpiochip_scan_gpios() in gpiolib-of.c (which can later be
made into generic device properties if ACPI needs this too).

The format of the OF bindings is what people have been
discussing for too long, whether gpio-initial-values, etc.
I would just implement what the DT people want and will ACK
so it solves your problem.

I will try to look up references to earlier discussions on this.

Yours,
Linus Walleij



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux