Skip to content

Commit 357a07c

Browse files
sch-mdavem330
authored andcommitted
net: phy: intel-xway: enable integrated led functions
The Intel xway phys offer the possibility to deactivate the integrated LED function and to control the LEDs manually. If this was set by the bootloader, it must be ensured that the integrated LED function is enabled for all LEDs when loading the driver. Before commit 6e2d85e ("net: phy: Stop with excessive soft reset") the LEDs were enabled by a soft-reset of the PHY (using genphy_soft_reset). Initialize the XWAY_MDIO_LED with it's default value (which is applied during a soft reset) instead of adding back the soft reset. This brings back the default LED configuration while still preventing an excessive amount of soft resets. Fixes: 6e2d85e ("net: phy: Stop with excessive soft reset") Signed-off-by: Martin Schiller <ms@dev.tdt.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5718458 commit 357a07c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/net/phy/intel-xway.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111

1212
#define XWAY_MDIO_IMASK 0x19 /* interrupt mask */
1313
#define XWAY_MDIO_ISTAT 0x1A /* interrupt status */
14+
#define XWAY_MDIO_LED 0x1B /* led control */
15+
16+
/* bit 15:12 are reserved */
17+
#define XWAY_MDIO_LED_LED3_EN BIT(11) /* Enable the integrated function of LED3 */
18+
#define XWAY_MDIO_LED_LED2_EN BIT(10) /* Enable the integrated function of LED2 */
19+
#define XWAY_MDIO_LED_LED1_EN BIT(9) /* Enable the integrated function of LED1 */
20+
#define XWAY_MDIO_LED_LED0_EN BIT(8) /* Enable the integrated function of LED0 */
21+
/* bit 7:4 are reserved */
22+
#define XWAY_MDIO_LED_LED3_DA BIT(3) /* Direct Access to LED3 */
23+
#define XWAY_MDIO_LED_LED2_DA BIT(2) /* Direct Access to LED2 */
24+
#define XWAY_MDIO_LED_LED1_DA BIT(1) /* Direct Access to LED1 */
25+
#define XWAY_MDIO_LED_LED0_DA BIT(0) /* Direct Access to LED0 */
1426

1527
#define XWAY_MDIO_INIT_WOL BIT(15) /* Wake-On-LAN */
1628
#define XWAY_MDIO_INIT_MSRE BIT(14)
@@ -159,6 +171,15 @@ static int xway_gphy_config_init(struct phy_device *phydev)
159171
/* Clear all pending interrupts */
160172
phy_read(phydev, XWAY_MDIO_ISTAT);
161173

174+
/* Ensure that integrated led function is enabled for all leds */
175+
err = phy_write(phydev, XWAY_MDIO_LED,
176+
XWAY_MDIO_LED_LED0_EN |
177+
XWAY_MDIO_LED_LED1_EN |
178+
XWAY_MDIO_LED_LED2_EN |
179+
XWAY_MDIO_LED_LED3_EN);
180+
if (err)
181+
return err;
182+
162183
phy_write_mmd(phydev, MDIO_MMD_VEND2, XWAY_MMD_LEDCH,
163184
XWAY_MMD_LEDCH_NACS_NONE |
164185
XWAY_MMD_LEDCH_SBF_F02HZ |

0 commit comments

Comments
 (0)