]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ata: ahci_brcm: Allow optional reset controller to be used
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 1 Oct 2018 17:33:00 +0000 (10:33 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Oct 2018 22:39:09 +0000 (16:39 -0600)
On BCM63138, we need to reset the AHCI core prior to start utilizing it,
grab the reset controller device cookie and do that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/ahci_brcm.c

index f3d557777d8292bd7739a477b70cc47f5df802e0..0e401b7c085609ae6a6ca6a4ed67c22c51f41e83 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 #include <linux/string.h>
 
 #include "ahci.h"
@@ -94,6 +95,7 @@ struct brcm_ahci_priv {
        u32 port_mask;
        u32 quirks;
        enum brcm_ahci_version version;
+       struct reset_control *rcdev;
 };
 
 static inline u32 brcm_sata_readreg(void __iomem *addr)
@@ -411,6 +413,11 @@ static int brcm_ahci_probe(struct platform_device *pdev)
        if (IS_ERR(priv->top_ctrl))
                return PTR_ERR(priv->top_ctrl);
 
+       /* Reset is optional depending on platform */
+       priv->rcdev = devm_reset_control_get(&pdev->dev, "ahci");
+       if (!IS_ERR_OR_NULL(priv->rcdev))
+               reset_control_deassert(priv->rcdev);
+
        if ((priv->version == BRCM_SATA_BCM7425) ||
                (priv->version == BRCM_SATA_NSP)) {
                priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;