[PATCH] mtd: gpmi: add gpmi_devdata{} to simplify the code

Huang Shijie b32955 at freescale.com
Sun Mar 23 22:28:05 EDT 2014


On Fri, Mar 21, 2014 at 11:15:21AM +0000, Gupta, Pekon wrote:
> >From: Huang Shijie [mailto:b32955 at freescale.com]
> >于 2014年03月21日 18:29, Gupta, Pekon 写道:
> >> Ezequiel has got approval for 2 new generic MTD bindings (refer l2-mtd.git)
> >> 	commit 8dd49165ef5f46b5ad9ba296c559ccff315f9421
> >> 	mtd: nand: Add a devicetree binding for ECC strength and ECC step size
> >> So, I think<1>  can be replaced by "nand-ecc-strength".
> >>
> >>
> >"nand-ecc-strength" is add the ECC strength for the NAND, but my patch
> >is add
> >the maximum ECC strength the BCH controller can support.
> >
> >they are different things.
> >
> Ok then it's also tied to your IP / SoC revision right ?

yes.
> 
> >>> >
> >>> >    [2] add the gpmi_devdata_imx{23|28|6q} to replace the gpmi_ids.
> >>> >
> >> Can you use "compatible" string in DT for this ?
> >>
> >>
> >sorry, could you please give me an example?
> >
> >I do not know what's your meaning. :(
> >
> 
> Can you use something like this, instead of populating static for each chip.
> 
> if (of_device_is_compatible(of_node, "imx23") || of_device_is_compatible(child, "imx28")) {
> 	bch_max_ecc_strength = 20;
> 	max_chain_delay = 16;
> } elseif (of_device_is_compatible(of_node, "imx6q") {
> 	bch_max_ecc_strength = 40;
> 	max_chain_delay = 12;
> } elseif (of_device_is_compatible(of_node, "imx6sx") {
> 	bch_max_ecc_strength = 40;
> 	max_chain_delay = 0; /* whatever is here */
> } else {
> 	bch_max_ecc_strength = 1; /* whatever is default */
> 	max_chain_delay = 0; /* whatever is default */
> }
> 

thanks Pekon. But as Ezequiel said, i also think that this patch is more readable.

Thanks again
Huang Shijie




More information about the linux-mtd mailing list