diff mbox

[U-Boot,3/6] arm: omap-common: sata: prepare driver for DM conversion

Message ID 1453106863-18128-4-git-send-email-mugunthanvnm@ti.com
State Deferred
Delegated to: Tom Rini
Headers show

Commit Message

Mugunthan V N Jan. 18, 2016, 8:47 a.m. UTC
Prepare sata driver for DM conversion by abstracting sata phy
init to seperate function.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 arch/arm/cpu/armv7/omap-common/sata.c | 13 +++++++++----
 include/sata.h                        |  2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

Comments

Tom Rini Jan. 19, 2016, 6:10 p.m. UTC | #1
On Mon, Jan 18, 2016 at 02:17:40PM +0530, Mugunthan V N wrote:

> Prepare sata driver for DM conversion by abstracting sata phy
> init to seperate function.
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap-common/sata.c b/arch/arm/cpu/armv7/omap-common/sata.c
index 0c82689..5ebd799 100644
--- a/arch/arm/cpu/armv7/omap-common/sata.c
+++ b/arch/arm/cpu/armv7/omap-common/sata.c
@@ -32,15 +32,20 @@  struct omap_pipe3 sata_phy = {
 	.dpll_map = dpll_map_sata,
 };
 
+int enable_sata_phy(void)
+{
+	sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata;
+
+	/* Power up the PHY */
+	return phy_pipe3_power_on(&sata_phy);
+}
+
 int init_sata(int dev)
 {
 	int ret;
 	u32 val;
 
-	sata_phy.power_reg = (void __iomem *)(*ctrl)->control_phy_power_sata;
-
-	/* Power up the PHY */
-	phy_pipe3_power_on(&sata_phy);
+	enable_sata_phy();
 
 	/* Enable SATA module, No Idle, No Standby */
 	val = TI_SATA_IDLE_NO | TI_SATA_STANDBY_NO;
diff --git a/include/sata.h b/include/sata.h
index fa61da8..c2b5360 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -16,4 +16,6 @@  int sata_port_status(int dev, int port);
 
 extern block_dev_desc_t sata_dev_desc[];
 
+int enable_sata_phy(void);
+
 #endif