diff options
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index fa60a7b19d12..eb30f758fdeb 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3334,6 +3334,20 @@ static int mv88e6xxx_setup_upstream_port(struct mv88e6xxx_chip *chip, int port) return 0; } +static int mv88e6xxx_setup_led(struct mv88e6xxx_chip *chip, int port) +{ + int err; + + /* LED0 = link/activity, LED1 = 10/100 */ + err = mv88e6xxx_wait_bit(chip, chip->info->port_base_addr + port, + MV88E6XXX_PORT_LED_CONTROL, 15, 0); + if (err) + return err; + + return mv88e6xxx_write(chip, chip->info->port_base_addr + port, + MV88E6XXX_PORT_LED_CONTROL, 0x80b3); +} + static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) { struct device_node *phy_handle = NULL; @@ -3386,6 +3400,12 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port) if (err) return err; + if (chip->info->num_gpio) { + err = mv88e6xxx_setup_led(chip, port); + if (err) + return err; + } + /* Port Control 2: don't force a good FCS, set the MTU size to * 10222 bytes, disable 802.1q tags checking, don't discard * tagged or untagged frames on this port, skip destination @@ -3881,10 +3901,13 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip) return 0; } +#include "mv88e6xxx_debugfs.c" + static void mv88e6xxx_teardown(struct dsa_switch *ds) { struct mv88e6xxx_chip *chip = ds->priv; + mv88e6xxx_remove_debugfs(chip); mv88e6xxx_teardown_devlink_params(ds); dsa_devlink_resources_unregister(ds); mv88e6xxx_teardown_devlink_regions_global(ds); @@ -4024,6 +4047,8 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) if (err) goto unlock; + mv88e6xxx_init_debugfs(chip); + unlock: mv88e6xxx_reg_unlock(chip); |