Thread (3 messages) 3 messages, 2 authors, 2024-08-11

Re: [PATCH RFC v2] net: dsa: mv88e6xxx: Support LED control

From: Andrew Lunn <andrew@lunn.ch>
Date: 2024-08-11 20:59:29
Also in: lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help