Patchwork nand: gpmi-nand: Fix clock registration

login
register
mail settings
Submitter Fabio Estevam
Date Oct. 8, 2012, 3:22 a.m.
Message ID <CAOMZO5AE22Kscv8JAxiazzR5NSvEH+qs4QxBC6aEQqi3ZCpCpg@mail.gmail.com>
Download mbox | patch
Permalink /patch/189883/
State New
Headers show

Comments

Fabio Estevam - Oct. 8, 2012, 3:22 a.m.
On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie <b32955@freescale.com> wrote:
> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> On a mx28 board the following error happens since commit 638064e56c
>> (mtd: gpmi: change the code for clocks):
>>
>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>
>> Acquire the clock using "NULL" as it was done previously, so that the driver
>> can register on mx23/mx28 as well.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> index c46be6c..1f23cb4 100644
>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>       int i;
>>
>>       /* The main clock is stored in the first. */
>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>> +     r->clock[0] = clk_get(this->dev, NULL);
> Please do not change this line.
>
> The gpmi_io is for mx6q.
> If you replace it with `NULL`. The mx6q can not find the proper clock.

What about this?

index 42978f1b..7b1aded 100644

Can you please test it on mx28?

Regards,

Fabio Estevam
Fabio Estevam - Oct. 8, 2012, 3:31 a.m.
On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
>
> This patch is really not needed.
>
> The clk_get() can get the right clock in the mx23/mx28. I tested them.

Please test it on linux-next.

gpmi nand can not event be probed.

Regards,

Fabio Estevam
Huang Shijie - Oct. 8, 2012, 3:32 a.m.
于 2012年10月08日 11:22, Fabio Estevam 写道:
> On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie <b32955@freescale.com> wrote:
>> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>>
>>> On a mx28 board the following error happens since commit 638064e56c
>>> (mtd: gpmi: change the code for clocks):
>>>
>>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>>
>>> Acquire the clock using "NULL" as it was done previously, so that the driver
>>> can register on mx23/mx28 as well.
>>>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>> ---
>>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> index c46be6c..1f23cb4 100644
>>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>>       int i;
>>>
>>>       /* The main clock is stored in the first. */
>>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>>> +     r->clock[0] = clk_get(this->dev, NULL);
>> Please do not change this line.
>>
>> The gpmi_io is for mx6q.
>> If you replace it with `NULL`. The mx6q can not find the proper clock.
> What about this?
>
> index 42978f1b..7b1aded 100644
> --- a/drivers/clk/mxs/clk-imx28.c
> +++ b/drivers/clk/mxs/clk-imx28.c
> @@ -139,7 +139,7 @@ enum imx28_clk {
>         ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
>         emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
>         clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
> -       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
> +       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
>         fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
>         clk_max
>  };
> @@ -208,7 +208,7 @@ int __init mx28_clocks_init(void)
>         clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
>         clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
>         clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
> -       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
> +       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
:)

This patch is really not needed.

The clk_get() can get the right clock in the mx23/mx28. I tested them.

Please read the code of clk_get().


BR
Huang Shijie


>         clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
>         clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
>         clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);
>
> Can you please test it on mx28?
>
> Regards,
>
> Fabio Estevam
>
Huang Shijie - Oct. 8, 2012, 4:53 a.m.
于 2012年10月08日 11:31, Fabio Estevam 写道:
> On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie<b32955@freescale.com>  wrote:
>> This patch is really not needed.
>>
>> The clk_get() can get the right clock in the mx23/mx28. I tested them.
> Please test it on linux-next.
>
> gpmi nand can not event be probed.
ok.

I will test the linux-next as soon as possible.


BR
Huang Shijie
> Regards,
>
> Fabio Estevam
>
Huang Shijie - Oct. 10, 2012, 2:44 a.m.
于 2012年10月08日 11:22, Fabio Estevam 写道:
> On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie<b32955@freescale.com>  wrote:
>> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>>> From: Fabio Estevam<fabio.estevam@freescale.com>
>>>
>>> On a mx28 board the following error happens since commit 638064e56c
>>> (mtd: gpmi: change the code for clocks):
>>>
>>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>>
>>> Acquire the clock using "NULL" as it was done previously, so that the driver
>>> can register on mx23/mx28 as well.
>>>
>>> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
>>> ---
>>>   drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> index c46be6c..1f23cb4 100644
>>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>>        int i;
>>>
>>>        /* The main clock is stored in the first. */
>>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>>> +     r->clock[0] = clk_get(this->dev, NULL);
>> Please do not change this line.
>>
>> The gpmi_io is for mx6q.
>> If you replace it with `NULL`. The mx6q can not find the proper clock.
> What about this?
>
> index 42978f1b..7b1aded 100644
> --- a/drivers/clk/mxs/clk-imx28.c
> +++ b/drivers/clk/mxs/clk-imx28.c
> @@ -139,7 +139,7 @@ enum imx28_clk {
>          ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
>          emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
>          clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
> -       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
> +       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
>          fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
>          clk_max
>   };
> @@ -208,7 +208,7 @@ int __init mx28_clocks_init(void)
>          clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
>          clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
>          clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
> -       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
> +       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
>          clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
>          clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
>          clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);
>
> Can you please test it on mx28?
I tested it in the linux-next with mx28-evk board. It did not works.

thanks a lot.

Huang Shijie
> Regards,
>
> Fabio Estevam
>

Patch

--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -139,7 +139,7 @@  enum imx28_clk {
        ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
        emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
        clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
-       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
+       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
        fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
        clk_max
 };
@@ -208,7 +208,7 @@  int __init mx28_clocks_init(void)
        clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
        clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
        clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
-       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
+       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
        clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
        clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
        clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);