Commit 368a148e authored by Jani Nikula's avatar Jani Nikula Committed by Tomi Valkeinen

OMAP: DSS2: omap_dss_probe() conditional compilation cleanup

Move a number of #ifdefs from code into dss.h and elsewhere, and
conditionally define no-op static inline functions, cleaning up the
code. This style is according to Documentation/SubmittingPatches.
Signed-off-by: default avatarJani Nikula <ext-jani.1.nikula@nokia.com>
Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent 044d32ff
...@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void) ...@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void)
if (dss_debugfs_dir) if (dss_debugfs_dir)
debugfs_remove_recursive(dss_debugfs_dir); debugfs_remove_recursive(dss_debugfs_dir);
} }
#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
static inline int dss_initialize_debugfs(void)
{
return 0;
}
static inline void dss_uninitialize_debugfs(void)
{
}
#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */ #endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
/* PLATFORM DEVICE */ /* PLATFORM DEVICE */
...@@ -518,56 +526,47 @@ static int omap_dss_probe(struct platform_device *pdev) ...@@ -518,56 +526,47 @@ static int omap_dss_probe(struct platform_device *pdev)
goto fail0; goto fail0;
} }
#ifdef CONFIG_OMAP2_DSS_RFBI
r = rfbi_init(); r = rfbi_init();
if (r) { if (r) {
DSSERR("Failed to initialize rfbi\n"); DSSERR("Failed to initialize rfbi\n");
goto fail0; goto fail0;
} }
#endif
#ifdef CONFIG_OMAP2_DSS_DPI
r = dpi_init(pdev); r = dpi_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize dpi\n"); DSSERR("Failed to initialize dpi\n");
goto fail0; goto fail0;
} }
#endif
r = dispc_init(); r = dispc_init();
if (r) { if (r) {
DSSERR("Failed to initialize dispc\n"); DSSERR("Failed to initialize dispc\n");
goto fail0; goto fail0;
} }
#ifdef CONFIG_OMAP2_DSS_VENC
r = venc_init(pdev); r = venc_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize venc\n"); DSSERR("Failed to initialize venc\n");
goto fail0; goto fail0;
} }
#endif
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_SDI
r = sdi_init(skip_init); r = sdi_init(skip_init);
if (r) { if (r) {
DSSERR("Failed to initialize SDI\n"); DSSERR("Failed to initialize SDI\n");
goto fail0; goto fail0;
} }
#endif
#ifdef CONFIG_OMAP2_DSS_DSI
r = dsi_init(pdev); r = dsi_init(pdev);
if (r) { if (r) {
DSSERR("Failed to initialize DSI\n"); DSSERR("Failed to initialize DSI\n");
goto fail0; goto fail0;
} }
#endif
} }
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
r = dss_initialize_debugfs(); r = dss_initialize_debugfs();
if (r) if (r)
goto fail0; goto fail0;
#endif
for (i = 0; i < pdata->num_devices; ++i) { for (i = 0; i < pdata->num_devices; ++i) {
struct omap_dss_device *dssdev = pdata->devices[i]; struct omap_dss_device *dssdev = pdata->devices[i];
...@@ -595,27 +594,15 @@ static int omap_dss_remove(struct platform_device *pdev) ...@@ -595,27 +594,15 @@ static int omap_dss_remove(struct platform_device *pdev)
int i; int i;
int c; int c;
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
dss_uninitialize_debugfs(); dss_uninitialize_debugfs();
#endif
#ifdef CONFIG_OMAP2_DSS_VENC
venc_exit(); venc_exit();
#endif
dispc_exit(); dispc_exit();
#ifdef CONFIG_OMAP2_DSS_DPI
dpi_exit(); dpi_exit();
#endif
#ifdef CONFIG_OMAP2_DSS_RFBI
rfbi_exit(); rfbi_exit();
#endif
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
#ifdef CONFIG_OMAP2_DSS_DSI
dsi_exit(); dsi_exit();
#endif
#ifdef CONFIG_OMAP2_DSS_SDI
sdi_exit(); sdi_exit();
#endif
} }
dss_exit(); dss_exit();
......
...@@ -242,11 +242,22 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, ...@@ -242,11 +242,22 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
struct dispc_clock_info *dispc_cinfo); struct dispc_clock_info *dispc_cinfo);
/* SDI */ /* SDI */
#ifdef CONFIG_OMAP2_DSS_SDI
int sdi_init(bool skip_init); int sdi_init(bool skip_init);
void sdi_exit(void); void sdi_exit(void);
int sdi_init_display(struct omap_dss_device *display); int sdi_init_display(struct omap_dss_device *display);
#else
static inline int sdi_init(bool skip_init)
{
return 0;
}
static inline void sdi_exit(void)
{
}
#endif
/* DSI */ /* DSI */
#ifdef CONFIG_OMAP2_DSS_DSI
int dsi_init(struct platform_device *pdev); int dsi_init(struct platform_device *pdev);
void dsi_exit(void); void dsi_exit(void);
...@@ -270,11 +281,30 @@ void dsi_pll_uninit(void); ...@@ -270,11 +281,30 @@ void dsi_pll_uninit(void);
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size, u32 fifo_size, enum omap_burst_size *burst_size,
u32 *fifo_low, u32 *fifo_high); u32 *fifo_low, u32 *fifo_high);
#else
static inline int dsi_init(struct platform_device *pdev)
{
return 0;
}
static inline void dsi_exit(void)
{
}
#endif
/* DPI */ /* DPI */
#ifdef CONFIG_OMAP2_DSS_DPI
int dpi_init(struct platform_device *pdev); int dpi_init(struct platform_device *pdev);
void dpi_exit(void); void dpi_exit(void);
int dpi_init_display(struct omap_dss_device *dssdev); int dpi_init_display(struct omap_dss_device *dssdev);
#else
static inline int dpi_init(struct platform_device *pdev)
{
return 0;
}
static inline void dpi_exit(void)
{
}
#endif
/* DISPC */ /* DISPC */
int dispc_init(void); int dispc_init(void);
...@@ -362,12 +392,23 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo); ...@@ -362,12 +392,23 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo);
/* VENC */ /* VENC */
#ifdef CONFIG_OMAP2_DSS_VENC
int venc_init(struct platform_device *pdev); int venc_init(struct platform_device *pdev);
void venc_exit(void); void venc_exit(void);
void venc_dump_regs(struct seq_file *s); void venc_dump_regs(struct seq_file *s);
int venc_init_display(struct omap_dss_device *display); int venc_init_display(struct omap_dss_device *display);
#else
static inline int venc_init(struct platform_device *pdev)
{
return 0;
}
static inline void venc_exit(void)
{
}
#endif
/* RFBI */ /* RFBI */
#ifdef CONFIG_OMAP2_DSS_RFBI
int rfbi_init(void); int rfbi_init(void);
void rfbi_exit(void); void rfbi_exit(void);
void rfbi_dump_regs(struct seq_file *s); void rfbi_dump_regs(struct seq_file *s);
...@@ -379,6 +420,15 @@ void rfbi_transfer_area(u16 width, u16 height, ...@@ -379,6 +420,15 @@ void rfbi_transfer_area(u16 width, u16 height,
void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t); void rfbi_set_timings(int rfbi_module, struct rfbi_timings *t);
unsigned long rfbi_get_max_tx_rate(void); unsigned long rfbi_get_max_tx_rate(void);
int rfbi_init_display(struct omap_dss_device *display); int rfbi_init_display(struct omap_dss_device *display);
#else
static inline int rfbi_init(void)
{
return 0;
}
static inline void rfbi_exit(void)
{
}
#endif
#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment