refactor(drivers/marvell/comphy-3700): simplify usage of sata power off

Function mvebu_a3700_comphy_sata_power_off() uses comphy_mode parameter
only for extracting mode bits. Mode is always COMPHY_SATA_MODE, so
there is no need to pass comphy_mode parameter to this function. Use
directly COMPHY_SATA_MODE in mvebu_a3700_comphy_sata_power_off().

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: Ib6b7c2bf62c1ef4d8a6af240c08696d5cd506b14
This commit is contained in:
Pali Rohár 2021-09-23 12:33:42 +02:00
parent 2245bb8a77
commit fc299ce07b

View file

@ -919,10 +919,9 @@ static int mvebu_a3700_comphy_usb3_power_off(void)
return 0; return 0;
} }
static int mvebu_a3700_comphy_sata_power_off(uint32_t comphy_mode) static int mvebu_a3700_comphy_sata_power_off(void)
{ {
uintptr_t comphy_indir_regs = COMPHY_INDIRECT_REG; uintptr_t comphy_indir_regs = COMPHY_INDIRECT_REG;
int mode = COMPHY_GET_MODE(comphy_mode);
uint32_t offset; uint32_t offset;
debug_enter(); debug_enter();
@ -930,12 +929,12 @@ static int mvebu_a3700_comphy_sata_power_off(uint32_t comphy_mode)
/* Set phy isolation mode */ /* Set phy isolation mode */
offset = COMPHY_ISOLATION_CTRL_REG + SATAPHY_LANE2_REG_BASE_OFFSET; offset = COMPHY_ISOLATION_CTRL_REG + SATAPHY_LANE2_REG_BASE_OFFSET;
comphy_set_indirect(comphy_indir_regs, offset, PHY_ISOLATE_MODE, comphy_set_indirect(comphy_indir_regs, offset, PHY_ISOLATE_MODE,
PHY_ISOLATE_MODE, mode); PHY_ISOLATE_MODE, COMPHY_SATA_MODE);
/* Power off PLL, Tx, Rx */ /* Power off PLL, Tx, Rx */
offset = COMPHY_POWER_PLL_CTRL + SATAPHY_LANE2_REG_BASE_OFFSET; offset = COMPHY_POWER_PLL_CTRL + SATAPHY_LANE2_REG_BASE_OFFSET;
comphy_set_indirect(comphy_indir_regs, offset, 0, comphy_set_indirect(comphy_indir_regs, offset, 0,
PU_PLL_BIT | PU_RX_BIT | PU_TX_BIT, mode); PU_PLL_BIT | PU_RX_BIT | PU_TX_BIT, COMPHY_SATA_MODE);
debug_exit(); debug_exit();
@ -968,7 +967,7 @@ int mvebu_3700_comphy_power_off(uint8_t comphy_index, uint32_t comphy_mode)
err = mvebu_a3700_comphy_usb3_power_off(); err = mvebu_a3700_comphy_usb3_power_off();
break; break;
case (COMPHY_SATA_MODE): case (COMPHY_SATA_MODE):
err = mvebu_a3700_comphy_sata_power_off(comphy_mode); err = mvebu_a3700_comphy_sata_power_off();
break; break;
default: default: