On Mon, Jul 18, 2022 at 10:27 PM Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote: > > Hello, > > we have a customer board here that uses two 8 port latches to drive > LEDs. The setup looks as follows: > > CLK0 ----------------------. ,--------. > CLK1 -------------------. `--------|> #0 | > | | | > IN0 -----------------+--|-----------|D0 Q0|-----|◁ > IN1 ---------------+-|--|-----------|D1 Q1|-----|◁ > IN2 -------------+-|-|--|-----------|D2 Q2|-----|◁ > IN3 -----------+-|-|-|--|-----------|D3 Q3|-----|◁ > IN4 ---------+-|-|-|-|--|-----------|D4 Q4|-----|◁ > IN5 -------+-|-|-|-|-|--|-----------|D5 Q5|-----|◁ > IN6 -----+-|-|-|-|-|-|--|-----------|D6 Q6|-----|◁ > IN7 ---+-|-|-|-|-|-|-|--|-----------|D7 Q7|-----|◁ > | | | | | | | | | `--------' > | | | | | | | | | > | | | | | | | | | ,--------. > | | | | | | | | `-----------|> #1 | > | | | | | | | | | | > | | | | | | | `--------------|D0 Q0|-----|◁ > | | | | | | `----------------|D1 Q1|-----|◁ > | | | | | `------------------|D2 Q2|-----|◁ > | | | | `--------------------|D3 Q3|-----|◁ > | | | `----------------------|D4 Q4|-----|◁ > | | `------------------------|D5 Q5|-----|◁ > | `--------------------------|D6 Q6|-----|◁ > `----------------------------|D7 Q7|-----|◁ > `--------' > > > So to change output 2 of latch #1 you have to apply the changed level on > IN2, apply the previous level on the other inputs (to keep the other > outputs constant) and toggle CLK1 once. > > This way you can drive 16 LEDs (or in general outputs) using only 10 > GPIOs. (And with a higher number of latches the proportion becomes a bit > more useful.) > > Actually this construct is a general GPO (no input :-) controller, and I > wonder if you would accept a driver that models it as a gpio controller. > > The dt binding could look as follows: > > latch-gpo { > compatible = "latch-gpo"; > pinctrl-0 = <...>; > pinctrl-names = <...>; > > clk-gpios = /* CLK0 */ <...>, /* CLK1 */ <...>; > data-gpios = /* IN0 */ <...>, /* IN1 */ <...>, ...; > }; > > What do you think? Bart, what happened to the [1]? Is it abandoned, forgotten? Uwe, isn't it what you need? [1]: https://lore.kernel.org/linux-gpio/20220205215918.8924-1-maukka@xxxxxxxxxxxx/ -- With Best Regards, Andy Shevchenko