Skip to contentSkip to conversation

ata: pata_arasan and ahci_platform updates

PATCH New Viresh Kumar 1 participant 6 messages Apr 21, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover ata: pata_arasan and ahci_platform updates

Jeff,

This patchset contains updates for pata_arasan and ahci_platform drivers.
- First patch was earlier sent alone, just included here.
- Second one was sent earlier to you and following was the discussion there:
http://patchwork.ozlabs.org/patch/99677/

It is used by SPEAr13xx V1 for which is:
http://comments.gmane.org/gmane.linux.ports.arm.kernel/163042

- Others add DT support for them.

V1->V2:
- Removed covering #ifdef CONFIG_HAVE_CLK, #endifs around clk code in ahci_platform.

Patch to create non CONFIG_HAVE_CLK clk_*() routines is already floated with following subject line:
clk: Add non CONFIG_HAVE_CLK routines

Viresh Kumar (5):
ata/pata_arasan_cf: Move arasan_cf_pm_ops out of #ifdef, #endif
macros
ata: pata_arasan: Add clk_{un}prepare() support
ata: pata_arasan: add Device Tree probing capability
ata: ahci_platform: Add synopsys ahci controller in DT's compatible
list
ata/ahci_platform: Add clock framework support

 .../ata/{calxeda-sata.txt => ahci-platform.txt}    |    5 +-
 .../devicetree/bindings/ata/pata-arasan.txt        |   17 ++++++
 drivers/ata/ahci.h                                 |    2 +
 drivers/ata/ahci_platform.c                        |   56 +++++++++++++++++---
 drivers/ata/pata_arasan_cf.c                       |   16 ++++--
 5 files changed, 82 insertions(+), 14 deletions(-)
 rename Documentation/devicetree/bindings/ata/{calxeda-sata.txt => ahci-platform.txt} (90%)
 create mode 100644 Documentation/devicetree/bindings/ata/pata-arasan.txt
Signature · 1 line
1.7.9
#1 lore raw

PATCH v2 1/5 ata/pata_arasan_cf: Move arasan_cf_pm_ops out of #ifdef, #endif macros

#ifdef, #endif is not required in definition/usage of arasan_cf_pm_ops. So, move this definition and its usage outside of them.

---
 drivers/ata/pata_arasan_cf.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/ata/pata_arasan_cf.c +1 -3
index b370e35..5ebf1cc 100644
@@ -936,9 +936,9 @@ static int arasan_cf_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume);
-#endif
 
 static struct platform_driver arasan_cf_driver = {
 	.probe		= arasan_cf_probe,
@@ -946,9 +946,7 @@ static struct platform_driver arasan_cf_driver = {
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm	= &arasan_cf_pm_ops,
-#endif
 	},
 };
 
Signature · 1 line
1.7.9
#2 lore raw

PATCH v2 2/5 ata: pata_arasan: Add clk_{un}prepare() support

In reply to Viresh Kumar

clk_{un}prepare is mandatory for platforms using common clock framework. Since this driver is used by SPEAr platform, which supports common clock framework, add clk_{un}prepare() support for it.

---
 drivers/ata/pata_arasan_cf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/ata/pata_arasan_cf.c +2 -2
index 5ebf1cc..aa3b4d4 100644
@@ -311,7 +311,7 @@ static int cf_init(struct arasan_cf_dev *acdev)
 	int ret = 0;
 
 	if (!IS_ERR(acdev->clk)) {
-		ret = clk_enable(acdev->clk);
+		ret = clk_prepare_enable(acdev->clk);
 		if (ret) {
 			dev_dbg(acdev->host->dev, "clock enable failed");
 			return ret;
@@ -344,7 +344,7 @@ static void cf_exit(struct arasan_cf_dev *acdev)
 	spin_unlock_irqrestore(&acdev->host->lock, flags);
 
 	if (!IS_ERR(acdev->clk))
-		clk_disable(acdev->clk);
+		clk_disable_unprepare(acdev->clk);
 }
 
 static void dma_callback(void *dev)
Signature · 1 line
1.7.9
#3 lore raw

PATCH v2 3/5 ata: pata_arasan: add Device Tree probing capability

In reply to Viresh Kumar

SPEAr platforms now support DT and so must convert all drivers to support DT. This patch adds DT probing support for Arasan Compact Flash controller and updates its documentation too.

---
 .../devicetree/bindings/ata/pata-arasan.txt        |   17 +++++++++++++++++
 drivers/ata/pata_arasan_cf.c                       |   10 ++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/pata-arasan.txt
Documentation/devicetree/bindings/ata/pata-arasan.txt new file +17 -0
new file mode 100644
index 0000000..95ec7f8
@@ -0,0 +1,17 @@
+* ARASAN PATA COMPACT FLASH CONTROLLER
+
+Required properties:
+- compatible: "arasan,cf-spear1340"
+- reg: Address range of the CF registers
+- interrupt-parent: Should be the phandle for the interrupt controller
+  that services interrupts for this device
+- interrupt: Should contain the CF interrupt number
+
+Example:
+
+	cf@fc000000 {
+		compatible = "arasan,cf-spear1340";
+		reg = <0xfc000000 0x1000>;
+		interrupt-parent = <&vic1>;
+		interrupts = <12>;
+	};
drivers/ata/pata_arasan_cf.c +10 -0
index aa3b4d4..24b6fa8 100644
@@ -31,6 +31,7 @@
 #include <linux/kernel.h>
 #include <linux/libata.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pata_arasan_cf_data.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
@@ -940,6 +941,14 @@ static int arasan_cf_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume);
 
+#ifdef CONFIG_OF
+static const struct of_device_id arasan_cf_id_table[] = {
+	{ .compatible = "arasan,cf-spear1340" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, arasan_cf_id_table);
+#endif
+
 static struct platform_driver arasan_cf_driver = {
 	.probe		= arasan_cf_probe,
 	.remove		= __devexit_p(arasan_cf_remove),
@@ -947,6 +956,7 @@ static struct platform_driver arasan_cf_driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
 		.pm	= &arasan_cf_pm_ops,
+		.of_match_table = of_match_ptr(arasan_cf_id_table),
 	},
 };
 
Signature · 1 line
1.7.9
#4 lore raw

PATCH v2 4/5 ata: ahci_platform: Add synopsys ahci controller in DT's compatible list

In reply to Viresh Kumar

SPEAr13xx series of SoCs contain Synopsys AHCI SATA Controller which shares ahci_platform driver with other controller versions.

This patch updates DT compatible list for ahci_platform. It also updates and renames binding documentation to more generic name.

---
 .../ata/{calxeda-sata.txt => ahci-platform.txt}    |    5 ++---
 drivers/ata/ahci_platform.c                        |    1 +
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename Documentation/devicetree/bindings/ata/{calxeda-sata.txt => ahci-platform.txt} (90%)
Documentation/devicetree/bindings/ata/ahci-platform.txt renamed from Documentation/devicetree/bindings/ata/calxeda-sata.txt +2 -3
similarity index 90%
rename from Documentation/devicetree/bindings/ata/calxeda-sata.txt
rename to Documentation/devicetree/bindings/ata/ahci-platform.txt
index 79caa56..8bb8a76 100644
@@ -1,10 +1,10 @@
-* Calxeda SATA Controller
+* AHCI SATA Controller
 
 SATA nodes are defined to describe on-chip Serial ATA controllers.
 Each SATA controller should have its own node.
 
 Required properties:
-- compatible        : compatible list, contains "calxeda,hb-ahci"
+- compatible        : compatible list, contains "calxeda,hb-ahci" or "snps,spear-ahci"
 - interrupts        : <interrupt mapping for SATA IRQ>
 - reg               : <registers mapping>
 
@@ -14,4 +14,3 @@ Example:
                 reg = <0xffe08000 0x1000>;
                 interrupts = <115>;
         };
-
drivers/ata/ahci_platform.c +1 -0
index 0c86c77..9e419e1 100644
@@ -280,6 +280,7 @@ static struct dev_pm_ops ahci_pm_ops = {
 
 static const struct of_device_id ahci_of_match[] = {
 	{ .compatible = "calxeda,hb-ahci", },
+	{ .compatible = "snps,spear-ahci", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, ahci_of_match);
Signature · 1 line
1.7.9
#5 lore raw

PATCH v2 5/5 ata/ahci_platform: Add clock framework support

In reply to Viresh Kumar

On many architectures, drivers are supposed to prepare/unprepare & enable/disable functional clock of device. This patch adds clock support for ahci_platform.

---
 drivers/ata/ahci.h          |    2 +
 drivers/ata/ahci_platform.c |   55 +++++++++++++++++++++++++++++++++++++-----
 2 files changed, 50 insertions(+), 7 deletions(-)
drivers/ata/ahci.h +2 -0
index c2594dd..e36d7ae 100644
@@ -35,6 +35,7 @@
 #ifndef _AHCI_H
 #define _AHCI_H
 
+#include <linux/clk.h>
 #include <linux/libata.h>
 
 /* Enclosure Management Control */
@@ -302,6 +303,7 @@ struct ahci_host_priv {
 	u32 			em_loc; /* enclosure management location */
 	u32			em_buf_sz;	/* EM buffer size in byte */
 	u32			em_msg_type;	/* EM message type */
+	struct clk		*clk;		/* Only for platforms supporting clk */
 };
 
 extern int ahci_ignore_sss;
drivers/ata/ahci_platform.c +48 -7

135 lines not on this page · raw message

Signature · 1 line
1.7.9