[PATCH] nand: gpmi-nand: Fix clock registration

Fabio Estevam festevam at gmail.com
Sun Oct 7 23:22:08 EDT 2012


On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie <b32955 at freescale.com> wrote:
> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>> From: Fabio Estevam <fabio.estevam at 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 at 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?

Regards,

Fabio Estevam



More information about the linux-mtd mailing list