提交 10340f8d 编写于 作者: F Florian Fainelli 提交者: Jens Axboe

ata: ahci_brcm: Add back regulators management

While reworking the resources management and departing from using
ahci_platform_enable_resources() which did not allow a proper step
separation like we need, we unfortunately lost the ability to control
AHCI regulators. This broke some Broadcom STB systems that do expect
regulators to be turned on to link up with attached hard drives.

Fixes: c0cdf2ac ("ata: ahci_brcm: Fix AHCI resources management")
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 6ee1d745
...@@ -377,6 +377,10 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev) ...@@ -377,6 +377,10 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev)
if (ret) if (ret)
return ret; return ret;
ret = ahci_platform_enable_regulators(hpriv);
if (ret)
goto out_disable_clks;
brcm_sata_init(priv); brcm_sata_init(priv);
brcm_sata_phys_enable(priv); brcm_sata_phys_enable(priv);
brcm_sata_alpm_init(hpriv); brcm_sata_alpm_init(hpriv);
...@@ -406,6 +410,8 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev) ...@@ -406,6 +410,8 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev)
ahci_platform_disable_phys(hpriv); ahci_platform_disable_phys(hpriv);
out_disable_phys: out_disable_phys:
brcm_sata_phys_disable(priv); brcm_sata_phys_disable(priv);
ahci_platform_disable_regulators(hpriv);
out_disable_clks:
ahci_platform_disable_clks(hpriv); ahci_platform_disable_clks(hpriv);
return ret; return ret;
} }
...@@ -490,6 +496,10 @@ static int brcm_ahci_probe(struct platform_device *pdev) ...@@ -490,6 +496,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
if (ret) if (ret)
goto out_reset; goto out_reset;
ret = ahci_platform_enable_regulators(hpriv);
if (ret)
goto out_disable_clks;
/* Must be first so as to configure endianness including that /* Must be first so as to configure endianness including that
* of the standard AHCI register space. * of the standard AHCI register space.
*/ */
...@@ -499,7 +509,7 @@ static int brcm_ahci_probe(struct platform_device *pdev) ...@@ -499,7 +509,7 @@ static int brcm_ahci_probe(struct platform_device *pdev)
priv->port_mask = brcm_ahci_get_portmask(hpriv, priv); priv->port_mask = brcm_ahci_get_portmask(hpriv, priv);
if (!priv->port_mask) { if (!priv->port_mask) {
ret = -ENODEV; ret = -ENODEV;
goto out_disable_clks; goto out_disable_regulators;
} }
/* Must be done before ahci_platform_enable_phys() */ /* Must be done before ahci_platform_enable_phys() */
...@@ -524,6 +534,8 @@ static int brcm_ahci_probe(struct platform_device *pdev) ...@@ -524,6 +534,8 @@ static int brcm_ahci_probe(struct platform_device *pdev)
ahci_platform_disable_phys(hpriv); ahci_platform_disable_phys(hpriv);
out_disable_phys: out_disable_phys:
brcm_sata_phys_disable(priv); brcm_sata_phys_disable(priv);
out_disable_regulators:
ahci_platform_disable_regulators(hpriv);
out_disable_clks: out_disable_clks:
ahci_platform_disable_clks(hpriv); ahci_platform_disable_clks(hpriv);
out_reset: out_reset:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册