Re: [PATCH 2/3] memory: omap-gpmc: Refactor OneNAND support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 07/11/17 13:31, Ladislav Michl wrote:
> Hi Roger,
> 
> On Tue, Nov 07, 2017 at 01:12:00PM +0200, Roger Quadros wrote:
>> Hi Ladislav,
>>
>> On 03/11/17 16:48, Ladislav Michl wrote:
>>> Use generic probe function to deal with OneNAND node and remove now useless
>>> gpmc_probe_onenand_child function.
>>> Import sync mode timing calculation function from mach-omap2/gpmc-onenand.c
>>> and prepare for MTD driver DTfication.
> [snip]
>>> --- a/include/linux/omap-gpmc.h
>>> +++ b/include/linux/omap-gpmc.h
>>> @@ -25,15 +25,33 @@ struct gpmc_nand_ops {
>>>  
>>>  struct gpmc_nand_regs;
>>>  
>>> +struct gpmc_onenand_info {
>>> +	bool sync_read;
>>> +	bool sync_write;
>>> +	int burst_len;
>>> +};
>>> +
>>>  #if IS_ENABLED(CONFIG_OMAP_GPMC)
>>>  struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
>>>  					     int cs);
>>> +int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
>>> +				  int latency,
>>> +				  struct gpmc_onenand_info *info);
>>
>> Do you want to move freq and latency into the gpmc_onenand_info data structure?
> 
> I do not have any strong preference here. This way freq and latency are input
> paramerers, while results are returned in struct gpmc_onenand_info.

OK then it is better as it is now.
>From the name "set_timings" it isn't apparent that 'info' is an output.

I think we should add proper documentation header to this function.

> 
> Latency should probably be computed in onenand_base as this is part of OneNAND
> specs.
> 
>>> +
>>>  #else
>>>  static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs,
>>>  							   int cs)
>>>  {
>>>  	return NULL;
>>>  }
>>> +
>>> +static inline
>>> +int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
>>> +				  int latency,
>>> +				  struct gpmc_onenand_info *info)
>>> +{
>>> +	return -EINVAL;
>>> +}
>>>  #endif /* CONFIG_OMAP_GPMC */
>>>  
>>>  extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
>>>
>>


-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux