Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: qcom-qmp-usb: populate offsets configuration

Populate offsets configuration for the rest of USB PHYs to make it
possible to switch them to the new (single-node) bindings style.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230824211952.1397699-7-dmitry.baryshkov@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dmitry Baryshkov and committed by
Vinod Koul
2be22aae dc327622

+38 -3
+38 -3
drivers/phy/qualcomm/phy-qcom-qmp-usb.c
··· 1280 1280 1281 1281 static const struct qmp_usb_offsets qmp_usb_offsets_v3 = { 1282 1282 .serdes = 0, 1283 + .pcs = 0x600, 1284 + .tx = 0x200, 1285 + .rx = 0x400, 1286 + }; 1287 + 1288 + static const struct qmp_usb_offsets qmp_usb_offsets_v3_qcm2290 = { 1289 + .serdes = 0x0, 1283 1290 .pcs = 0xc00, 1284 1291 .pcs_misc = 0xa00, 1285 1292 .tx = 0x200, 1286 1293 .rx = 0x400, 1287 1294 .tx2 = 0x600, 1288 1295 .rx2 = 0x800, 1296 + }; 1297 + 1298 + static const struct qmp_usb_offsets qmp_usb_offsets_v4 = { 1299 + .serdes = 0, 1300 + .pcs = 0x0800, 1301 + .pcs_usb = 0x0e00, 1302 + .tx = 0x0200, 1303 + .rx = 0x0400, 1289 1304 }; 1290 1305 1291 1306 static const struct qmp_usb_offsets qmp_usb_offsets_v5 = { ··· 1313 1298 1314 1299 static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { 1315 1300 .lanes = 1, 1301 + 1302 + .offsets = &qmp_usb_offsets_v3, 1316 1303 1317 1304 .serdes_tbl = ipq8074_usb3_serdes_tbl, 1318 1305 .serdes_tbl_num = ARRAY_SIZE(ipq8074_usb3_serdes_tbl), ··· 1349 1332 1350 1333 static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { 1351 1334 .lanes = 1, 1335 + 1336 + .offsets = &qmp_usb_offsets_v3, 1352 1337 1353 1338 .serdes_tbl = msm8996_usb3_serdes_tbl, 1354 1339 .serdes_tbl_num = ARRAY_SIZE(msm8996_usb3_serdes_tbl), ··· 1404 1385 static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { 1405 1386 .lanes = 1, 1406 1387 1388 + .offsets = &qmp_usb_offsets_v3, 1389 + 1407 1390 .serdes_tbl = qmp_v3_usb3_uniphy_serdes_tbl, 1408 1391 .serdes_tbl_num = ARRAY_SIZE(qmp_v3_usb3_uniphy_serdes_tbl), 1409 1392 .tx_tbl = qmp_v3_usb3_uniphy_tx_tbl, ··· 1424 1403 static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { 1425 1404 .lanes = 2, 1426 1405 1406 + .offsets = &qmp_usb_offsets_v3_qcm2290, 1407 + 1427 1408 .serdes_tbl = msm8998_usb3_serdes_tbl, 1428 1409 .serdes_tbl_num = ARRAY_SIZE(msm8998_usb3_serdes_tbl), 1429 1410 .tx_tbl = msm8998_usb3_tx_tbl, ··· 1441 1418 1442 1419 static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { 1443 1420 .lanes = 1, 1421 + 1422 + .offsets = &qmp_usb_offsets_v4, 1444 1423 1445 1424 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1446 1425 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), ··· 1465 1440 static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { 1466 1441 .lanes = 1, 1467 1442 1443 + .offsets = &qmp_usb_offsets_v4, 1444 + 1468 1445 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1469 1446 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1470 1447 .tx_tbl = sm8250_usb3_uniphy_tx_tbl, ··· 1487 1460 1488 1461 static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { 1489 1462 .lanes = 1, 1463 + 1464 + .offsets = &qmp_usb_offsets_v4, 1490 1465 1491 1466 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1492 1467 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), ··· 1511 1482 static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { 1512 1483 .lanes = 1, 1513 1484 1485 + .offsets = &qmp_usb_offsets_v5, 1486 + 1514 1487 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1515 1488 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), 1516 1489 .tx_tbl = sdx65_usb3_uniphy_tx_tbl, ··· 1533 1502 1534 1503 static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { 1535 1504 .lanes = 1, 1505 + 1506 + .offsets = &qmp_usb_offsets_v5, 1536 1507 1537 1508 .serdes_tbl = sm8150_usb3_uniphy_serdes_tbl, 1538 1509 .serdes_tbl_num = ARRAY_SIZE(sm8150_usb3_uniphy_serdes_tbl), ··· 1557 1524 static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { 1558 1525 .lanes = 2, 1559 1526 1560 - .offsets = &qmp_usb_offsets_v3, 1527 + .offsets = &qmp_usb_offsets_v3_qcm2290, 1561 1528 1562 1529 .serdes_tbl = qcm2290_usb3_serdes_tbl, 1563 1530 .serdes_tbl_num = ARRAY_SIZE(qcm2290_usb3_serdes_tbl), ··· 2111 2078 2112 2079 qmp->serdes = base + offs->serdes; 2113 2080 qmp->pcs = base + offs->pcs; 2114 - qmp->pcs_misc = base + offs->pcs_misc; 2115 - qmp->pcs_usb = base + offs->pcs_usb; 2081 + if (offs->pcs_usb) 2082 + qmp->pcs_usb = base + offs->pcs_usb; 2083 + if (offs->pcs_misc) 2084 + qmp->pcs_misc = base + offs->pcs_misc; 2116 2085 qmp->tx = base + offs->tx; 2117 2086 qmp->rx = base + offs->rx; 2118 2087