Patchwork [V8,5/5] MX53 Enable the AHCI SATA on MX53 SMD board

login
register
mail settings
Submitter Richard Zhu
Date Sept. 22, 2011, 10:14 a.m.
Message ID <1316686488-4684-6-git-send-email-richard.zhu@linaro.org>
Download mbox | patch
Permalink /patch/115923/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Richard Zhu - Sept. 22, 2011, 10:14 a.m.
Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
---
 arch/arm/mach-mx5/board-mx53_smd.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
Fabio Estevam - Sept. 22, 2011, 10:36 a.m.
On Thu, Sep 22, 2011 at 7:14 AM, Richard Zhu <richard.zhu@linaro.org> wrote:
> Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
> ---
>  arch/arm/mach-mx5/board-mx53_smd.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
> index bc02894..9d06fbe 100644
> --- a/arch/arm/mach-mx5/board-mx53_smd.c
> +++ b/arch/arm/mach-mx5/board-mx53_smd.c
> @@ -35,6 +35,7 @@
>  #include "devices-imx53.h"
>
>  #define SMD_FEC_PHY_RST                IMX_GPIO_NR(7, 6)
> +#define MX53_SMD_SATA_PWR_EN    IMX_GPIO_NR(3, 3)
>
>  static iomux_v3_cfg_t mx53_smd_pads[] = {
>        MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
> @@ -111,6 +112,19 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
>        .bitrate = 100000,
>  };
>
> +static inline void mx53_smd_ahci_pwr_on(void)
> +{
> +       int ret;
> +
> +       /* Enable SATA PWR */
> +       ret = gpio_request(MX53_SMD_SATA_PWR_EN, "ahci-sata-pwr");

Please use gpio_request_one.

> +       if (ret) {
> +               printk(KERN_ERR "failed to get SATA_PWR_EN: %d\n", ret);

You can use pr_err instead.

Regards,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov - Sept. 22, 2011, 11:42 a.m.
Hello.

On 22-09-2011 14:14, Richard Zhu wrote:

> Signed-off-by: Richard Zhu<richard.zhu@linaro.org>
> ---
>   arch/arm/mach-mx5/board-mx53_smd.c |   16 ++++++++++++++++
>   1 files changed, 16 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
> index bc02894..9d06fbe 100644
> --- a/arch/arm/mach-mx5/board-mx53_smd.c
> +++ b/arch/arm/mach-mx5/board-mx53_smd.c
[...]
> @@ -111,6 +112,19 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
>   	.bitrate = 100000,
>   };
>
> +static inline void mx53_smd_ahci_pwr_on(void)
> +{
> +	int ret;
> +
> +	/* Enable SATA PWR */
> +	ret = gpio_request(MX53_SMD_SATA_PWR_EN, "ahci-sata-pwr");
> +	if (ret) {
> +		printk(KERN_ERR "failed to get SATA_PWR_EN: %d\n", ret);
> +		return;
> +	}
> +	gpio_direction_output(MX53_SMD_SATA_PWR_EN, 1);

    You can use gpio_request_one() instead of gpio_request()/gpio_direction_*().

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Richard Zhu - Sept. 22, 2011, 3:24 p.m.
Hi Fabio&Sergei:
Thanks for your comments.
Accepted. Would be changed later.

Best Regard
Richard Zhu

On 22/09/2011, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> On 22-09-2011 14:14, Richard Zhu wrote:
>
>> Signed-off-by: Richard Zhu<richard.zhu@linaro.org>
>> ---
>>   arch/arm/mach-mx5/board-mx53_smd.c |   16 ++++++++++++++++
>>   1 files changed, 16 insertions(+), 0 deletions(-)
>
>> diff --git a/arch/arm/mach-mx5/board-mx53_smd.c
>> b/arch/arm/mach-mx5/board-mx53_smd.c
>> index bc02894..9d06fbe 100644
>> --- a/arch/arm/mach-mx5/board-mx53_smd.c
>> +++ b/arch/arm/mach-mx5/board-mx53_smd.c
> [...]
>> @@ -111,6 +112,19 @@ static const struct imxi2c_platform_data
>> mx53_smd_i2c_data __initconst = {
>>   	.bitrate = 100000,
>>   };
>>
>> +static inline void mx53_smd_ahci_pwr_on(void)
>> +{
>> +	int ret;
>> +
>> +	/* Enable SATA PWR */
>> +	ret = gpio_request(MX53_SMD_SATA_PWR_EN, "ahci-sata-pwr");
>> +	if (ret) {
>> +		printk(KERN_ERR "failed to get SATA_PWR_EN: %d\n", ret);
>> +		return;
>> +	}
>> +	gpio_direction_output(MX53_SMD_SATA_PWR_EN, 1);
>
>     You can use gpio_request_one() instead of
> gpio_request()/gpio_direction_*().
>
> WBR, Sergei
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index bc02894..9d06fbe 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -35,6 +35,7 @@ 
 #include "devices-imx53.h"
 
 #define SMD_FEC_PHY_RST		IMX_GPIO_NR(7, 6)
+#define MX53_SMD_SATA_PWR_EN    IMX_GPIO_NR(3, 3)
 
 static iomux_v3_cfg_t mx53_smd_pads[] = {
 	MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
@@ -111,6 +112,19 @@  static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
 	.bitrate = 100000,
 };
 
+static inline void mx53_smd_ahci_pwr_on(void)
+{
+	int ret;
+
+	/* Enable SATA PWR */
+	ret = gpio_request(MX53_SMD_SATA_PWR_EN, "ahci-sata-pwr");
+	if (ret) {
+		printk(KERN_ERR "failed to get SATA_PWR_EN: %d\n", ret);
+		return;
+	}
+	gpio_direction_output(MX53_SMD_SATA_PWR_EN, 1);
+}
+
 static void __init mx53_smd_board_init(void)
 {
 	imx53_soc_init();
@@ -125,6 +139,8 @@  static void __init mx53_smd_board_init(void)
 	imx53_add_sdhci_esdhc_imx(0, NULL);
 	imx53_add_sdhci_esdhc_imx(1, NULL);
 	imx53_add_sdhci_esdhc_imx(2, NULL);
+	mx53_smd_ahci_pwr_on();
+	imx53_add_ahci_imx();
 }
 
 static void __init mx53_smd_timer_init(void)