Skip to content

Commit 63c2b42

Browse files
committed
phy: apple: atc: Split atcphy_dp_configure_lane()
No functional change but orders the register writes in the same way as macOS does. This makes the comparison of Linux and macOS traces much simple. The output of `diff` is now mostly legible. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent be0adf3 commit 63c2b42

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

drivers/phy/apple/atc.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,30 @@ atcphy_dp_configure_lane(struct apple_atcphy *atcphy, unsigned int lane,
12461246
clear32(tx_shm + LN_AUSPMA_TX_SHM_TXA_IMP_REG0, LN_TXA_HIZ);
12471247
set32(tx_shm + LN_AUSPMA_TX_SHM_TXA_IMP_REG0, LN_TXA_HIZ_OV);
12481248

1249+
return 0;
1250+
}
1251+
1252+
static int
1253+
atcphy_dp_configure_lane2(struct apple_atcphy *atcphy, unsigned int lane,
1254+
const struct atcphy_dp_link_rate_configuration *cfg)
1255+
{
1256+
void __iomem *tx_shm, *rx_shm, *rx_top;
1257+
1258+
switch (lane) {
1259+
case 0:
1260+
tx_shm = atcphy->regs.core + LN0_AUSPMA_TX_SHM;
1261+
rx_shm = atcphy->regs.core + LN0_AUSPMA_RX_SHM;
1262+
rx_top = atcphy->regs.core + LN0_AUSPMA_RX_TOP;
1263+
break;
1264+
case 1:
1265+
tx_shm = atcphy->regs.core + LN1_AUSPMA_TX_SHM;
1266+
rx_shm = atcphy->regs.core + LN1_AUSPMA_RX_SHM;
1267+
rx_top = atcphy->regs.core + LN1_AUSPMA_RX_TOP;
1268+
break;
1269+
default:
1270+
return -EINVAL;
1271+
}
1272+
12491273
clear32(rx_shm + LN_AUSPMA_RX_SHM_TJ_RXA_AFE_CTRL1,
12501274
LN_RX_DIV20_RESET_N);
12511275
set32(rx_shm + LN_AUSPMA_RX_SHM_TJ_RXA_AFE_CTRL1,
@@ -1515,6 +1539,18 @@ static int atcphy_dp_configure(struct apple_atcphy *atcphy,
15151539
return ret;
15161540
}
15171541

1542+
if (mode_cfg->dp_lane[0]) {
1543+
ret = atcphy_dp_configure_lane2(atcphy, 0, cfg);
1544+
if (ret)
1545+
return ret;
1546+
}
1547+
1548+
if (mode_cfg->dp_lane[1]) {
1549+
ret = atcphy_dp_configure_lane2(atcphy, 1, cfg);
1550+
if (ret)
1551+
return ret;
1552+
}
1553+
15181554
core_clear32(atcphy, ACIOPHY_LANE_DP_CFG_BLK_TX_DP_CTRL0,
15191555
DP_PMA_BYTECLK_RESET);
15201556
core_clear32(atcphy, ACIOPHY_LANE_DP_CFG_BLK_TX_DP_CTRL0,

0 commit comments

Comments
 (0)