Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0cbbbcda authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman
Browse files

ata: ahci_brcm: Allow optional reset controller to be used



commit 2b2c47d9e1fe90311b725125d6252a859ee87a79 upstream.

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb3f6286
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/string.h>
#include <linux/string.h>


#include "ahci.h"
#include "ahci.h"
@@ -87,6 +88,7 @@ struct brcm_ahci_priv {
	u32 port_mask;
	u32 port_mask;
	u32 quirks;
	u32 quirks;
	enum brcm_ahci_version version;
	enum brcm_ahci_version version;
	struct reset_control *rcdev;
};
};


static const struct ata_port_info ahci_brcm_port_info = {
static const struct ata_port_info ahci_brcm_port_info = {
@@ -327,6 +329,11 @@ static int brcm_ahci_probe(struct platform_device *pdev)
	if (IS_ERR(priv->top_ctrl))
	if (IS_ERR(priv->top_ctrl))
		return PTR_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) ||
	if ((priv->version == BRCM_SATA_BCM7425) ||
		(priv->version == BRCM_SATA_NSP)) {
		(priv->version == BRCM_SATA_NSP)) {
		priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;
		priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;