Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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)