Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-22 Thread Linus Walleij
On Tue, Jan 19, 2021 at 4:20 AM DENG Qingfang wrote: > On Mon, Jan 18, 2021 at 10:55 PM Linus Walleij > wrote: > > > > So for offset 0..14 this becomes bits > > 0, 1, 2, 4, 5, 6, 8, 9, 10, 12 ... 18 > > > > What is the logic in this and is it what you intend? > > Yes. Bit 0..2 are phy 0's LED 0

Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-18 Thread DENG Qingfang
Hi Linus, On Mon, Jan 18, 2021 at 10:55 PM Linus Walleij wrote: > > So for offset 0..14 this becomes bits > 0, 1, 2, 4, 5, 6, 8, 9, 10, 12 ... 18 > > What is the logic in this and is it what you intend? Yes. Bit 0..2 are phy 0's LED 0..2, bit 4..6 are phy 1's LED 0..2, etc. > Please add a comm

Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-18 Thread Linus Walleij
On Mon, Jan 11, 2021 at 6:46 AM DENG Qingfang wrote: > MT7530's LED controller can drive up to 15 LED/GPIOs. > > Add support for GPIO control and allow users to use its GPIOs by > setting gpio-controller property in device tree. > > Signed-off-by: DENG Qingfang Double-check the initial output c

Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-11 Thread Russell King - ARM Linux admin
On Mon, Jan 11, 2021 at 09:40:00PM +0800, DENG Qingfang wrote: > On Mon, Jan 11, 2021 at 7:04 PM Russell King - ARM Linux admin > wrote: > > > > FYI, Documentation/driver-api/gpio/consumer.rst says: > > > > For output GPIOs, the value provided becomes the initial output value. > > This helps a

Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-11 Thread DENG Qingfang
On Mon, Jan 11, 2021 at 7:04 PM Russell King - ARM Linux admin wrote: > > FYI, Documentation/driver-api/gpio/consumer.rst says: > > For output GPIOs, the value provided becomes the initial output value. > This helps avoid signal glitching during system startup. > > Setting the pin to be an out

Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-11 Thread Russell King - ARM Linux admin
On Mon, Jan 11, 2021 at 01:44:28PM +0800, DENG Qingfang wrote: > +static int > +mt7530_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int > value) > +{ > + struct mt7530_priv *priv = gpiochip_get_data(gc); > + u32 bit = mt7530_gpio_to_bit(offset); > + > + mt7530_set(p

[PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support

2021-01-10 Thread DENG Qingfang
MT7530's LED controller can drive up to 15 LED/GPIOs. Add support for GPIO control and allow users to use its GPIOs by setting gpio-controller property in device tree. Signed-off-by: DENG Qingfang --- drivers/net/dsa/mt7530.c | 96 drivers/net/dsa/mt7530