diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-02-20 11:50:06 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 14:44:51 +0300 |
commit | 00928eaf52007ee4e1fb7dc860bc02a56c125bb4 (patch) | |
tree | f5e4b086bf57243d1d5b1ae7f38891c26b473263 /drivers/video/omap2/dss/core.c | |
parent | e23d83b0c92bbe30d1fe9d5c0b972e50c6593946 (diff) | |
download | op-kernel-dev-00928eaf52007ee4e1fb7dc860bc02a56c125bb4.zip op-kernel-dev-00928eaf52007ee4e1fb7dc860bc02a56c125bb4.tar.gz |
OMAPDSS: clean up the omapdss platform data mess
The omapdss pdata handling is a mess. This is more evident when trying
to use device tree for DSS, as we don't have platform data anymore in
that case. This patch cleans the pdata handling by:
- Remove struct omap_display_platform_data. It was used just as a
wrapper for struct omap_dss_board_info.
- Pass the platform data only to omapdss device. The drivers for omap
dss hwmods do not need the platform data. This should also work better
for DT, as we can create omapdss device programmatically in generic omap
boot code, and thus we can pass the pdata to it.
- Create dss functions for get_ctx_loss_count and dsi_enable/disable_pads
that the dss hwmod drivers can call.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/core.c')
-rw-r--r-- | drivers/video/omap2/dss/core.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 64cb8aa..b37b6f4 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -87,6 +87,41 @@ struct regulator *dss_get_vdds_sdi(void) return reg; } +int dss_get_ctx_loss_count(struct device *dev) +{ + struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; + int cnt; + + if (!board_data->get_context_loss_count) + return -ENOENT; + + cnt = board_data->get_context_loss_count(dev); + + WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt); + + return cnt; +} + +int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask) +{ + struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; + + if (!board_data->dsi_enable_pads) + return -ENOENT; + + return board_data->dsi_enable_pads(dsi_id, lane_mask); +} + +void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask) +{ + struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; + + if (!board_data->dsi_enable_pads) + return; + + return board_data->dsi_disable_pads(dsi_id, lane_mask); +} + int dss_set_min_bus_tput(struct device *dev, unsigned long tput) { struct omap_dss_board_info *pdata = core.pdev->dev.platform_data; |