Skip to contentSkip to conversation

ata: pata_arasan and ahci_platform updates

PATCH In review Viresh Kumar 4 participants 7 messages May 9, 2012 – Jul 16, 2012

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

v3 cover ata: pata_arasan and ahci_platform updates

Jeff,

This patchset contains updates for pata_arasan and ahci_platform drivers. I have updated it as per earlier discussions for following patchset:
"clk: Add non CONFIG_HAVE_CLK routines"

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

V2->V3:
- Updated "ata/ahci_platform: Add clock framework support" as per latest patch for dummy clk APIs applied by Andrew Morton
- Dropped two patches, already got applied.

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

Viresh Kumar (3):
ata: pata_arasan: Add clk_{un}prepare() support
ata: pata_arasan: add Device Tree probing capability ata/ahci_platform: Add clock framework support

 .../devicetree/bindings/ata/pata-arasan.txt        |   17 ++++++
 drivers/ata/ahci.h                                 |    2 +
 drivers/ata/ahci_platform.c                        |   57 +++++++++++++++++---
 drivers/ata/pata_arasan_cf.c                       |   14 ++++-
 4 files changed, 81 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/ata/pata-arasan.txt
Signature · 1 line
1.7.9
#1 lore raw

PATCH v3 1/3 ata: pata_arasan: Add clk_{un}prepare() support

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 b943be0..febc914 100644
@@ -310,7 +310,7 @@ static int cf_init(struct arasan_cf_dev *acdev)
 	unsigned long flags;
 	int ret = 0;
 
-	ret = clk_enable(acdev->clk);
+	ret = clk_prepare_enable(acdev->clk);
 	if (ret) {
 		dev_dbg(acdev->host->dev, "clock enable failed");
 		return ret;
@@ -340,7 +340,7 @@ static void cf_exit(struct arasan_cf_dev *acdev)
 	writel(readl(acdev->vbase + OP_MODE) & ~CFHOST_ENB,
 			acdev->vbase + OP_MODE);
 	spin_unlock_irqrestore(&acdev->host->lock, flags);
-	clk_disable(acdev->clk);
+	clk_disable_unprepare(acdev->clk);
 }
 
 static void dma_callback(void *dev)
Signature · 1 line
1.7.9
#2 lore raw

Re: [PATCH V3 1/3] ata: pata_arasan: Add clk_{un}prepare() support

Quoted 8 lines · 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(-)

these do not apply to upstream, for me...

#3 lore raw

Re: [PATCH V3 1/3] ata: pata_arasan: Add clk_{un}prepare() support

Hi Jeff,

Quoted 16 lines · Jeff Garzik
Quoted 11 lines · 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(-)
Quoted 2 lines

these do not apply to upstream, for me...

Sorry for being late. I rebased them on linux-next that time as they had few dependency commits there.
Can you try it there?

--
Viresh

#4 lore raw

Re: [PATCH V3 1/3] ata: pata_arasan: Add clk_{un}prepare() support

Quoted 6 lines · viresh kumar
Quoted 2 lines

these do not apply to upstream, for me...

Sorry for being late. I rebased them on linux-next that time as they had few dependency commits there.
Can you try it there?

Ping !!

Can you please retry applying them?

#5 lore raw

PATCH v3 2/3 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 febc914..e455c95 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>
@@ -935,6 +936,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),
@@ -942,6 +951,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
#6 lore raw

PATCH v3 3/3 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 |   57 +++++++++++++++++++++++++++++++++++++-----
 2 files changed, 52 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 +50 -7

137 lines not on this page · raw message

Signature · 1 line
1.7.9