Commit 3b3600ff authored by David S. Miller's avatar David S. Miller

Merge branch 'mv88e6xxx-Disable-ports-to-save-power'

Andrew Lunn says:

====================
mv88e6xxx: Disable ports to save power

Save some power by disabling ports. The first patch fully disables a
port when it is runtime disabled. The second disables any ports which
are not used at all.

Depending on configuration strapping, this can lower the temperature
of an idle switch a few degrees.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2ce1aef9 100a9b9d
......@@ -2428,6 +2428,9 @@ static void mv88e6xxx_port_disable(struct dsa_switch *ds, int port)
mutex_lock(&chip->reg_lock);
if (mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED))
dev_err(chip->dev, "failed to disable port\n");
if (chip->info->ops->serdes_irq_free)
chip->info->ops->serdes_irq_free(chip, port);
......@@ -2596,8 +2599,18 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
/* Setup Switch Port Registers */
for (i = 0; i < mv88e6xxx_num_ports(chip); i++) {
if (dsa_is_unused_port(ds, i))
if (dsa_is_unused_port(ds, i)) {
err = mv88e6xxx_port_set_state(chip, i,
BR_STATE_DISABLED);
if (err)
goto unlock;
err = mv88e6xxx_serdes_power(chip, i, false);
if (err)
goto unlock;
continue;
}
err = mv88e6xxx_setup_port(chip, i);
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment