[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7e874408-d125-4002-9ce3-ec2653fb6c46@lunn.ch>
Date: Sun, 11 Aug 2024 22:59:18 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Christian Marangi <ansuelsmth@...il.com>,
Tim Harvey <tharvey@...eworks.com>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH RFC v2] net: dsa: mv88e6xxx: Support LED control
> You could also add a
> mv88e6xxx_port_led_read(chip, port, *reg)
> {
> int err;
>
> err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_LED_CONTROL, reg);
> *reg &= 0x3ff;
>
> return err;
Actually, this wrong. You first need to write the register pointer
number you want to read:
err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_LED_CONTROL, ptr);
if (err)
return err;
and then do a read, and mask the only the lower 10 bits, where the
register value will be:
err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_LED_CONTROL, val);
*val &= 0x3ff;
return err;
Andrew
Powered by blists - more mailing lists