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

Commit 3e8c04eb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull libata changes from Tejun Heo:
 "Mostly driver-specific changes.  Nothing too noteworthy.

  This pull request contains three merges from for-3.19-fixes.  The
  first two are to pull ahci_xgene and sata_dwc_460ex fix commits which
  are depended upon by later changes.  The last one is to pull in a fix
  patch which missed the v3.19-rc window"

* 'for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (24 commits)
  ahci_xgene: Fix the dma state machine lockup for the ATA_CMD_SMART PIO mode command.
  ata: libahci: Use of_platform_device_create only if supported
  sata_mv: Delete unnecessary checks before the function call "phy_power_off"
  ata: Delete unnecessary checks before the function call "pci_dev_put"
  ata: pata_platform: fix owner module reference mismatch for scsi host
  ata: ahci_platform: fix owner module reference mismatch for scsi host
  pata_pdc2027x: Use 64-bit timekeeping
  ata: libahci: Fix devres cleanup on failure
  ata: libahci: Allow using multiple regulators
  Documentation: bindings: Add the regulator property to the sub-nodes AHCI bindings
  ata: libahci: Clean-up the ahci_platform_en/disable_phys functions
  sata_rcar: extend PM methods
  sata_dwc_460ex: disable compilation on ARM and ARM64
  ata: libata-core: Remove unused function
  sata_dwc_460ex: convert to devm_kzalloc in ->probe()
  sata_dwc_460ex: remove extra message
  sata_dwc_460ex: use np local variable in ->probe()
  sata_dwc_460ex: fix most of the sparse warnings
  sata_dwc_460ex: enable COMPILE_TEST for the driver
  sata_dwc_460ex: remove redundant dev_set_drvdata
  ...
parents 44dbf058 b12aa1f2
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -38,8 +38,9 @@ Required properties when using sub-nodes:


Sub-nodes required properties:
Sub-nodes required properties:
- reg		    : the port number
- reg		    : the port number
And at least one of the following properties:
- phys		    : reference to the SATA PHY node
- phys		    : reference to the SATA PHY node

- target-supply    : regulator for SATA target power


Examples:
Examples:
        sata@ffe08000 {
        sata@ffe08000 {
@@ -68,10 +69,12 @@ With sub-nodes:
		sata0: sata-port@0 {
		sata0: sata-port@0 {
			reg = <0>;
			reg = <0>;
			phys = <&sata_phy 0>;
			phys = <&sata_phy 0>;
			target-supply = <&reg_sata0>;
		};
		};


		sata1: sata-port@1 {
		sata1: sata-port@1 {
			reg = <1>;
			reg = <1>;
			phys = <&sata_phy 1>;
			phys = <&sata_phy 1>;
			target-supply = <&reg_sata1>;;
		};
		};
	};
	};
+1 −1
Original line number Original line Diff line number Diff line
@@ -269,7 +269,7 @@ config ATA_PIIX


config SATA_DWC
config SATA_DWC
	tristate "DesignWare Cores SATA support"
	tristate "DesignWare Cores SATA support"
	depends on 460EX
	depends on 460EX || (COMPILE_TEST && !(ARM || ARM64))
	help
	help
	  This option enables support for the on-chip SATA controller of the
	  This option enables support for the on-chip SATA controller of the
	  AppliedMicro processor 460EX.
	  AppliedMicro processor 460EX.
+5 −1
Original line number Original line Diff line number Diff line
@@ -333,7 +333,7 @@ struct ahci_host_priv {
	u32			em_msg_type;	/* EM message type */
	u32			em_msg_type;	/* EM message type */
	bool			got_runtime_pm; /* Did we do pm_runtime_get? */
	bool			got_runtime_pm; /* Did we do pm_runtime_get? */
	struct clk		*clks[AHCI_MAX_CLKS]; /* Optional */
	struct clk		*clks[AHCI_MAX_CLKS]; /* Optional */
	struct regulator	*target_pwr;	/* Optional */
	struct regulator	**target_pwrs;	/* Optional */
	/*
	/*
	 * If platform uses PHYs. There is a 1:1 relation between the port number and
	 * If platform uses PHYs. There is a 1:1 relation between the port number and
	 * the PHY position in this array.
	 * the PHY position in this array.
@@ -354,6 +354,10 @@ extern int ahci_ignore_sss;
extern struct device_attribute *ahci_shost_attrs[];
extern struct device_attribute *ahci_shost_attrs[];
extern struct device_attribute *ahci_sdev_attrs[];
extern struct device_attribute *ahci_sdev_attrs[];


/*
 * This must be instantiated by the edge drivers.  Read the comments
 * for ATA_BASE_SHT
 */
#define AHCI_SHT(drv_name)						\
#define AHCI_SHT(drv_name)						\
	ATA_NCQ_SHT(drv_name),						\
	ATA_NCQ_SHT(drv_name),						\
	.can_queue		= AHCI_MAX_CMDS - 1,			\
	.can_queue		= AHCI_MAX_CMDS - 1,			\
+9 −2
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@
#include <linux/ahci_platform.h>
#include <linux/ahci_platform.h>
#include "ahci.h"
#include "ahci.h"


#define DRV_NAME "ahci_da850"

/* SATA PHY Control Register offset from AHCI base */
/* SATA PHY Control Register offset from AHCI base */
#define SATA_P0PHYCR_REG	0x178
#define SATA_P0PHYCR_REG	0x178


@@ -59,6 +61,10 @@ static const struct ata_port_info ahci_da850_port_info = {
	.port_ops	= &ahci_platform_ops,
	.port_ops	= &ahci_platform_ops,
};
};


static struct scsi_host_template ahci_platform_sht = {
	AHCI_SHT(DRV_NAME),
};

static int ahci_da850_probe(struct platform_device *pdev)
static int ahci_da850_probe(struct platform_device *pdev)
{
{
	struct device *dev = &pdev->dev;
	struct device *dev = &pdev->dev;
@@ -85,7 +91,8 @@ static int ahci_da850_probe(struct platform_device *pdev)


	da850_sata_init(dev, pwrdn_reg, hpriv->mmio);
	da850_sata_init(dev, pwrdn_reg, hpriv->mmio);


	rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info);
	rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info,
				     &ahci_platform_sht);
	if (rc)
	if (rc)
		goto disable_resources;
		goto disable_resources;


@@ -102,7 +109,7 @@ static struct platform_driver ahci_da850_driver = {
	.probe = ahci_da850_probe,
	.probe = ahci_da850_probe,
	.remove = ata_platform_remove_one,
	.remove = ata_platform_remove_one,
	.driver = {
	.driver = {
		.name = "ahci_da850",
		.name = DRV_NAME,
		.pm = &ahci_da850_pm_ops,
		.pm = &ahci_da850_pm_ops,
	},
	},
};
};
+14 −11
Original line number Original line Diff line number Diff line
@@ -28,6 +28,8 @@
#include <linux/libata.h>
#include <linux/libata.h>
#include "ahci.h"
#include "ahci.h"


#define DRV_NAME "ahci-imx"

enum {
enum {
	/* Timer 1-ms Register */
	/* Timer 1-ms Register */
	IMX_TIMER1MS				= 0x00e0,
	IMX_TIMER1MS				= 0x00e0,
@@ -221,11 +223,9 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv)
	if (imxpriv->no_device)
	if (imxpriv->no_device)
		return 0;
		return 0;


	if (hpriv->target_pwr) {
	ret = ahci_platform_enable_regulators(hpriv);
		ret = regulator_enable(hpriv->target_pwr);
	if (ret)
	if (ret)
		return ret;
		return ret;
	}


	ret = clk_prepare_enable(imxpriv->sata_ref_clk);
	ret = clk_prepare_enable(imxpriv->sata_ref_clk);
	if (ret < 0)
	if (ret < 0)
@@ -270,8 +270,7 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv)
disable_clk:
disable_clk:
	clk_disable_unprepare(imxpriv->sata_ref_clk);
	clk_disable_unprepare(imxpriv->sata_ref_clk);
disable_regulator:
disable_regulator:
	if (hpriv->target_pwr)
	ahci_platform_disable_regulators(hpriv);
		regulator_disable(hpriv->target_pwr);


	return ret;
	return ret;
}
}
@@ -291,8 +290,7 @@ static void imx_sata_disable(struct ahci_host_priv *hpriv)


	clk_disable_unprepare(imxpriv->sata_ref_clk);
	clk_disable_unprepare(imxpriv->sata_ref_clk);


	if (hpriv->target_pwr)
	ahci_platform_disable_regulators(hpriv);
		regulator_disable(hpriv->target_pwr);
}
}


static void ahci_imx_error_handler(struct ata_port *ap)
static void ahci_imx_error_handler(struct ata_port *ap)
@@ -524,6 +522,10 @@ static u32 imx_ahci_parse_props(struct device *dev,
	return reg_value;
	return reg_value;
}
}


static struct scsi_host_template ahci_platform_sht = {
	AHCI_SHT(DRV_NAME),
};

static int imx_ahci_probe(struct platform_device *pdev)
static int imx_ahci_probe(struct platform_device *pdev)
{
{
	struct device *dev = &pdev->dev;
	struct device *dev = &pdev->dev;
@@ -620,7 +622,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
	reg_val = clk_get_rate(imxpriv->ahb_clk) / 1000;
	reg_val = clk_get_rate(imxpriv->ahb_clk) / 1000;
	writel(reg_val, hpriv->mmio + IMX_TIMER1MS);
	writel(reg_val, hpriv->mmio + IMX_TIMER1MS);


	ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info);
	ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info,
				      &ahci_platform_sht);
	if (ret)
	if (ret)
		goto disable_sata;
		goto disable_sata;


@@ -678,7 +681,7 @@ static struct platform_driver imx_ahci_driver = {
	.probe = imx_ahci_probe,
	.probe = imx_ahci_probe,
	.remove = ata_platform_remove_one,
	.remove = ata_platform_remove_one,
	.driver = {
	.driver = {
		.name = "ahci-imx",
		.name = DRV_NAME,
		.of_match_table = imx_ahci_of_match,
		.of_match_table = imx_ahci_of_match,
		.pm = &ahci_imx_pm_ops,
		.pm = &ahci_imx_pm_ops,
	},
	},
Loading