diff options
| author | Ladislav Michl <ladis@linux-mips.org> | 2018-01-12 08:17:25 -0500 |
|---|---|---|
| committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2018-01-12 10:41:15 -0500 |
| commit | a758f50f10cfcf863f95372ff52e0d8d22fda9ba (patch) | |
| tree | 294a2badeec6d690b68db82d8dbd29637c6edec7 /include/linux | |
| parent | bdaca9345d41fd9420995469d27603ea62054691 (diff) | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/omap-gpmc.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/omap-gpmc.h b/include/linux/omap-gpmc.h index edfa280c3d56..053feb41510a 100644 --- a/include/linux/omap-gpmc.h +++ b/include/linux/omap-gpmc.h | |||
| @@ -25,15 +25,43 @@ struct gpmc_nand_ops { | |||
| 25 | 25 | ||
| 26 | struct gpmc_nand_regs; | 26 | struct gpmc_nand_regs; |
| 27 | 27 | ||
| 28 | struct gpmc_onenand_info { | ||
| 29 | bool sync_read; | ||
| 30 | bool sync_write; | ||
| 31 | int burst_len; | ||
| 32 | }; | ||
| 33 | |||
| 28 | #if IS_ENABLED(CONFIG_OMAP_GPMC) | 34 | #if IS_ENABLED(CONFIG_OMAP_GPMC) |
| 29 | struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, | 35 | struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, |
| 30 | int cs); | 36 | int cs); |
| 37 | /** | ||
| 38 | * gpmc_omap_onenand_set_timings - set optimized sync timings. | ||
| 39 | * @cs: Chip Select Region | ||
| 40 | * @freq: Chip frequency | ||
| 41 | * @latency: Burst latency cycle count | ||
| 42 | * @info: Structure describing parameters used | ||
| 43 | * | ||
| 44 | * Sets optimized timings for the @cs region based on @freq and @latency. | ||
| 45 | * Updates the @info structure based on the GPMC settings. | ||
| 46 | */ | ||
| 47 | int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq, | ||
| 48 | int latency, | ||
| 49 | struct gpmc_onenand_info *info); | ||
| 50 | |||
| 31 | #else | 51 | #else |
| 32 | static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, | 52 | static inline struct gpmc_nand_ops *gpmc_omap_get_nand_ops(struct gpmc_nand_regs *regs, |
| 33 | int cs) | 53 | int cs) |
| 34 | { | 54 | { |
| 35 | return NULL; | 55 | return NULL; |
| 36 | } | 56 | } |
| 57 | |||
| 58 | static inline | ||
| 59 | int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq, | ||
| 60 | int latency, | ||
| 61 | struct gpmc_onenand_info *info) | ||
| 62 | { | ||
| 63 | return -EINVAL; | ||
| 64 | } | ||
| 37 | #endif /* CONFIG_OMAP_GPMC */ | 65 | #endif /* CONFIG_OMAP_GPMC */ |
| 38 | 66 | ||
| 39 | extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t, | 67 | extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t, |
