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

Commit 4214cc55 authored by hayeswang's avatar hayeswang Committed by David S. Miller
Browse files

r8152: check if disabling ALDPS is finished



Use PLA 0xe000 bit 8 to check if disabling ALDPS is finished.

Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent befb2de1
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2836,9 +2836,15 @@ static void r8153_aldps_en(struct r8152 *tp, bool enable)
		data |= EN_ALDPS;
		ocp_reg_write(tp, OCP_POWER_CFG, data);
	} else {
		int i;

		data &= ~EN_ALDPS;
		ocp_reg_write(tp, OCP_POWER_CFG, data);
		msleep(20);
		for (i = 0; i < 20; i++) {
			usleep_range(1000, 2000);
			if (ocp_read_word(tp, MCU_TYPE_PLA, 0xe000) & 0x0100)
				break;
		}
	}
}