diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-03-19 09:36:37 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-03-19 14:20:03 -0400 |
commit | 3661aa99d82ed06e3781964d43d89be1050593c0 (patch) | |
tree | e63a7da1b74c753891bba8497a5dcdd1a0dea761 | |
parent | 7b09ac704bac2de5bf0362793edc22a0094e381c (diff) |
ata: sata_mv: add proper definitions for LP_PHY_CTL register values
Commit 9013d64e661fc ("ata: sata_mv: fix disk hotplug for Armada
370/XP SoCs") added some manipulation of the LP_PHY_CTL register, but
using magic values. This commit changes the code to use proper
definitions for the LP_PHY_CTL register, which allows to document what
the different bits are doing.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | drivers/ata/sata_mv.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index f8c33e3772b8..0281785c7a28 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -306,6 +306,11 @@ enum { | |||
306 | MV5_PHY_CTL = 0x0C, | 306 | MV5_PHY_CTL = 0x0C, |
307 | SATA_IFCFG = 0x050, | 307 | SATA_IFCFG = 0x050, |
308 | LP_PHY_CTL = 0x058, | 308 | LP_PHY_CTL = 0x058, |
309 | LP_PHY_CTL_PIN_PU_PLL = (1 << 0), | ||
310 | LP_PHY_CTL_PIN_PU_RX = (1 << 1), | ||
311 | LP_PHY_CTL_PIN_PU_TX = (1 << 2), | ||
312 | LP_PHY_CTL_GEN_TX_3G = (1 << 5), | ||
313 | LP_PHY_CTL_GEN_RX_3G = (1 << 9), | ||
309 | 314 | ||
310 | MV_M2_PREAMP_MASK = 0x7e0, | 315 | MV_M2_PREAMP_MASK = 0x7e0, |
311 | 316 | ||
@@ -1391,10 +1396,17 @@ static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val) | |||
1391 | /* | 1396 | /* |
1392 | * Set PHY speed according to SControl speed. | 1397 | * Set PHY speed according to SControl speed. |
1393 | */ | 1398 | */ |
1394 | if ((val & 0xf0) == 0x10) | 1399 | u32 lp_phy_val = |
1395 | writelfl(0x7, lp_phy_addr); | 1400 | LP_PHY_CTL_PIN_PU_PLL | |
1396 | else | 1401 | LP_PHY_CTL_PIN_PU_RX | |
1397 | writelfl(0x227, lp_phy_addr); | 1402 | LP_PHY_CTL_PIN_PU_TX; |
1403 | |||
1404 | if ((val & 0xf0) != 0x10) | ||
1405 | lp_phy_val |= | ||
1406 | LP_PHY_CTL_GEN_TX_3G | | ||
1407 | LP_PHY_CTL_GEN_RX_3G; | ||
1408 | |||
1409 | writelfl(lp_phy_val, lp_phy_addr); | ||
1398 | } | 1410 | } |
1399 | } | 1411 | } |
1400 | writelfl(val, addr); | 1412 | writelfl(val, addr); |