mtd: onenand: omap2: Configure driver from DT
Move away from platform data configuration and use pure DT approach. 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 Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:

committed by
Boris Brezillon

parent
bdaca9345d
commit
a758f50f10
@@ -25,15 +25,43 @@ 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);
|
||||
/**
|
||||
* gpmc_omap_onenand_set_timings - set optimized sync timings.
|
||||
* @cs: Chip Select Region
|
||||
* @freq: Chip frequency
|
||||
* @latency: Burst latency cycle count
|
||||
* @info: Structure describing parameters used
|
||||
*
|
||||
* Sets optimized timings for the @cs region based on @freq and @latency.
|
||||
* Updates the @info structure based on the GPMC settings.
|
||||
*/
|
||||
int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
|
||||
int latency,
|
||||
struct gpmc_onenand_info *info);
|
||||
|
||||
#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,
|
||||
|
Reference in New Issue
Block a user