0178-phy-phy-mtk-tphy-make-shared-banks-optional-for-V1-T.patch 1.2 KB

123456789101112131415161718192021222324252627282930
  1. From d7a38584713b00cf9ae97aed89d5e8fb7e3c1bea Mon Sep 17 00:00:00 2001
  2. From: Chunfeng Yun <[email protected]>
  3. Date: Thu, 7 Dec 2017 19:53:35 +0800
  4. Subject: [PATCH 178/224] phy: phy-mtk-tphy: make shared banks optional for V1
  5. TPHY
  6. V1 TPHY for SATA doesn't have shared banks if it isn't shared
  7. with PCIe or USB, so make it optional.
  8. Signed-off-by: Chunfeng Yun <[email protected]>
  9. Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  10. ---
  11. drivers/phy/mediatek/phy-mtk-tphy.c | 5 +++--
  12. 1 file changed, 3 insertions(+), 2 deletions(-)
  13. --- a/drivers/phy/mediatek/phy-mtk-tphy.c
  14. +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
  15. @@ -1023,9 +1023,10 @@ static int mtk_tphy_probe(struct platfor
  16. tphy->dev = dev;
  17. platform_set_drvdata(pdev, tphy);
  18. - if (tphy->pdata->version == MTK_PHY_V1) {
  19. + sif_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  20. + /* SATA phy of V1 needn't it if not shared with PCIe or USB */
  21. + if (sif_res && tphy->pdata->version == MTK_PHY_V1) {
  22. /* get banks shared by multiple phys */
  23. - sif_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  24. tphy->sif_base = devm_ioremap_resource(dev, sif_res);
  25. if (IS_ERR(tphy->sif_base)) {
  26. dev_err(dev, "failed to remap sif regs\n");