From 349c3d95f5f34379679489a29c19513644e0c08a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 29 Aug 2013 10:06:43 +0300 Subject: OMAPDSS: SDI: change regulator handling Regulator handling for DPI and SDI is currently handled in the core.c, using the 'virtual' omapdss platform device. Nowadays we have proper devices for both DPI and SDI, and so we can handle the regulators inside the respective drivers. This patch moves the regulator handling for SDI into sdi.c. Signed-off-by: Tomi Valkeinen Reviewed-by: Archit Taneja --- drivers/video/omap2/dss/core.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'drivers/video/omap2/dss/core.c') diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 1aeb274e30fc..a07d62644026 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -44,7 +44,6 @@ static struct { struct platform_device *pdev; struct regulator *vdds_dsi_reg; - struct regulator *vdds_sdi_reg; const char *default_display_name; } core; @@ -95,20 +94,6 @@ struct regulator *dss_get_vdds_dsi(void) return reg; } -struct regulator *dss_get_vdds_sdi(void) -{ - struct regulator *reg; - - if (core.vdds_sdi_reg != NULL) - return core.vdds_sdi_reg; - - reg = devm_regulator_get(&core.pdev->dev, "vdds_sdi"); - if (!IS_ERR(reg)) - core.vdds_sdi_reg = reg; - - return reg; -} - int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask) { struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; -- cgit v1.2.3-59-g8ed1b From 4123de21389319dece55eba5955cf10ac88ef700 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 29 Aug 2013 10:06:55 +0300 Subject: OMAPDSS: DPI: change regulator handling Regulator handling for DPI and SDI is currently handled in the core.c, using the 'virtual' omapdss platform device. Nowadays we have proper devices for both DPI and SDI, and so we can handle the regulators inside the respective drivers. This patch moves the regulator handling for DPI into dpi.c. Signed-off-by: Tomi Valkeinen Reviewed-by: Archit Taneja --- drivers/video/omap2/dss/core.c | 18 ------------------ drivers/video/omap2/dss/dpi.c | 10 +++------- drivers/video/omap2/dss/dss.h | 1 - 3 files changed, 3 insertions(+), 26 deletions(-) (limited to 'drivers/video/omap2/dss/core.c') diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index a07d62644026..71e6a77ec687 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -43,8 +43,6 @@ static struct { struct platform_device *pdev; - struct regulator *vdds_dsi_reg; - const char *default_display_name; } core; @@ -78,22 +76,6 @@ struct platform_device *dss_get_core_pdev(void) return core.pdev; } -/* REGULATORS */ - -struct regulator *dss_get_vdds_dsi(void) -{ - struct regulator *reg; - - if (core.vdds_dsi_reg != NULL) - return core.vdds_dsi_reg; - - reg = devm_regulator_get(&core.pdev->dev, "vdds_dsi"); - if (!IS_ERR(reg)) - core.vdds_dsi_reg = reg; - - return reg; -} - int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask) { struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index a6b331ef7763..89c7a6e7b185 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c @@ -554,14 +554,10 @@ static int dpi_init_regulator(void) if (dpi.vdds_dsi_reg) return 0; - vdds_dsi = dss_get_vdds_dsi(); - + vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi"); if (IS_ERR(vdds_dsi)) { - vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi"); - if (IS_ERR(vdds_dsi)) { - DSSERR("can't get VDDS_DSI regulator\n"); - return PTR_ERR(vdds_dsi); - } + DSSERR("can't get VDDS_DSI regulator\n"); + return PTR_ERR(vdds_dsi); } dpi.vdds_dsi_reg = vdds_dsi; diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 7d97de46b17f..146349f6ae91 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -164,7 +164,6 @@ struct platform_device; /* core */ struct platform_device *dss_get_core_pdev(void); struct bus_type *dss_get_bus(void); -struct regulator *dss_get_vdds_dsi(void); int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask); void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask); int dss_set_min_bus_tput(struct device *dev, unsigned long tput); -- cgit v1.2.3-59-g8ed1b From b3864299c1602efabcdb87d0264a45845530b7c9 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Nov 2012 11:58:47 +0200 Subject: OMAPDSS: DSS: remove legacy dss bus support With all the old panels removed and all the old panel model APIs removed from the DSS encoders, we can now remove the custom omapdss-bus which was used in the old panel model. Signed-off-by: Tomi Valkeinen Reviewed-by: Archit Taneja --- drivers/video/omap2/dss/core.c | 291 +---------------------------------------- drivers/video/omap2/dss/dss.h | 9 -- include/video/omapdss.h | 6 - 3 files changed, 4 insertions(+), 302 deletions(-) (limited to 'drivers/video/omap2/dss/core.c') diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 71e6a77ec687..415b5d6385fc 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -248,235 +248,6 @@ static struct platform_driver omap_dss_driver = { }, }; -/* BUS */ -static int dss_bus_match(struct device *dev, struct device_driver *driver) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - - DSSDBG("bus_match. dev %s/%s, drv %s\n", - dev_name(dev), dssdev->driver_name, driver->name); - - return strcmp(dssdev->driver_name, driver->name) == 0; -} - -static struct bus_type dss_bus_type = { - .name = "omapdss", - .match = dss_bus_match, -}; - -static void dss_bus_release(struct device *dev) -{ - DSSDBG("bus_release\n"); -} - -static struct device dss_bus = { - .release = dss_bus_release, -}; - -struct bus_type *dss_get_bus(void) -{ - return &dss_bus_type; -} - -/* DRIVER */ -static int dss_driver_probe(struct device *dev) -{ - int r; - struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver); - struct omap_dss_device *dssdev = to_dss_device(dev); - - DSSDBG("driver_probe: dev %s/%s, drv %s\n", - dev_name(dev), dssdev->driver_name, - dssdrv->driver.name); - - r = dssdrv->probe(dssdev); - - if (r) { - DSSERR("driver probe failed: %d\n", r); - return r; - } - - DSSDBG("probe done for device %s\n", dev_name(dev)); - - dssdev->driver = dssdrv; - - return 0; -} - -static int dss_driver_remove(struct device *dev) -{ - struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver); - struct omap_dss_device *dssdev = to_dss_device(dev); - - DSSDBG("driver_remove: dev %s/%s\n", dev_name(dev), - dssdev->driver_name); - - dssdrv->remove(dssdev); - - dssdev->driver = NULL; - - return 0; -} - -static int omapdss_default_connect(struct omap_dss_device *dssdev) -{ - struct omap_dss_device *out; - struct omap_overlay_manager *mgr; - int r; - - out = dssdev->output; - - if (out == NULL) - return -ENODEV; - - mgr = omap_dss_get_overlay_manager(out->dispc_channel); - if (!mgr) - return -ENODEV; - - r = dss_mgr_connect(mgr, out); - if (r) - return r; - - return 0; -} - -static void omapdss_default_disconnect(struct omap_dss_device *dssdev) -{ - struct omap_dss_device *out; - struct omap_overlay_manager *mgr; - - out = dssdev->output; - - if (out == NULL) - return; - - mgr = out->manager; - - if (mgr == NULL) - return; - - dss_mgr_disconnect(mgr, out); -} - -int omap_dss_register_driver(struct omap_dss_driver *dssdriver) -{ - dssdriver->driver.bus = &dss_bus_type; - dssdriver->driver.probe = dss_driver_probe; - dssdriver->driver.remove = dss_driver_remove; - - if (dssdriver->get_resolution == NULL) - dssdriver->get_resolution = omapdss_default_get_resolution; - if (dssdriver->get_recommended_bpp == NULL) - dssdriver->get_recommended_bpp = - omapdss_default_get_recommended_bpp; - if (dssdriver->get_timings == NULL) - dssdriver->get_timings = omapdss_default_get_timings; - if (dssdriver->connect == NULL) - dssdriver->connect = omapdss_default_connect; - if (dssdriver->disconnect == NULL) - dssdriver->disconnect = omapdss_default_disconnect; - - return driver_register(&dssdriver->driver); -} -EXPORT_SYMBOL(omap_dss_register_driver); - -void omap_dss_unregister_driver(struct omap_dss_driver *dssdriver) -{ - driver_unregister(&dssdriver->driver); -} -EXPORT_SYMBOL(omap_dss_unregister_driver); - -/* DEVICE */ - -static void omap_dss_dev_release(struct device *dev) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - kfree(dssdev); -} - -static int disp_num_counter; - -struct omap_dss_device *dss_alloc_and_init_device(struct device *parent) -{ - struct omap_dss_device *dssdev; - - dssdev = kzalloc(sizeof(*dssdev), GFP_KERNEL); - if (!dssdev) - return NULL; - - dssdev->old_dev.bus = &dss_bus_type; - dssdev->old_dev.parent = parent; - dssdev->old_dev.release = omap_dss_dev_release; - dev_set_name(&dssdev->old_dev, "display%d", disp_num_counter++); - - device_initialize(&dssdev->old_dev); - - return dssdev; -} - -int dss_add_device(struct omap_dss_device *dssdev) -{ - dssdev->dev = &dssdev->old_dev; - - omapdss_register_display(dssdev); - return device_add(&dssdev->old_dev); -} - -void dss_put_device(struct omap_dss_device *dssdev) -{ - put_device(&dssdev->old_dev); -} - -void dss_unregister_device(struct omap_dss_device *dssdev) -{ - device_unregister(&dssdev->old_dev); - omapdss_unregister_display(dssdev); -} - -static int dss_unregister_dss_dev(struct device *dev, void *data) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - dss_unregister_device(dssdev); - return 0; -} - -void dss_unregister_child_devices(struct device *parent) -{ - device_for_each_child(parent, NULL, dss_unregister_dss_dev); -} - -void dss_copy_device_pdata(struct omap_dss_device *dst, - const struct omap_dss_device *src) -{ - u8 *d = (u8 *)dst; - u8 *s = (u8 *)src; - size_t dsize = sizeof(struct device); - - memcpy(d + dsize, s + dsize, sizeof(struct omap_dss_device) - dsize); -} - -/* BUS */ -static int __init omap_dss_bus_register(void) -{ - int r; - - r = bus_register(&dss_bus_type); - if (r) { - DSSERR("bus register failed\n"); - return r; - } - - dev_set_name(&dss_bus, "omapdss"); - r = device_register(&dss_bus); - if (r) { - DSSERR("bus driver register failed\n"); - bus_unregister(&dss_bus_type); - return r; - } - - return 0; -} - /* INIT */ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { #ifdef CONFIG_OMAP2_DSS_DSI @@ -522,7 +293,7 @@ static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)]; -static int __init omap_dss_register_drivers(void) +static int __init omap_dss_init(void) { int r; int i; @@ -553,6 +324,8 @@ static int __init omap_dss_register_drivers(void) dss_output_drv_loaded[i] = true; } + dss_initialized = true; + return 0; err_dispc: @@ -563,7 +336,7 @@ err_dss: return r; } -static void __exit omap_dss_unregister_drivers(void) +static void __exit omap_dss_exit(void) { int i; @@ -578,64 +351,8 @@ static void __exit omap_dss_unregister_drivers(void) platform_driver_unregister(&omap_dss_driver); } -#ifdef CONFIG_OMAP2_DSS_MODULE -static void omap_dss_bus_unregister(void) -{ - device_unregister(&dss_bus); - - bus_unregister(&dss_bus_type); -} - -static int __init omap_dss_init(void) -{ - int r; - - r = omap_dss_bus_register(); - if (r) - return r; - - r = omap_dss_register_drivers(); - if (r) { - omap_dss_bus_unregister(); - return r; - } - - dss_initialized = true; - - return 0; -} - -static void __exit omap_dss_exit(void) -{ - omap_dss_unregister_drivers(); - - omap_dss_bus_unregister(); -} - module_init(omap_dss_init); module_exit(omap_dss_exit); -#else -static int __init omap_dss_init(void) -{ - return omap_dss_bus_register(); -} - -static int __init omap_dss_init2(void) -{ - int r; - - r = omap_dss_register_drivers(); - if (r) - return r; - - dss_initialized = true; - - return 0; -} - -core_initcall(omap_dss_init); -device_initcall(omap_dss_init2); -#endif MODULE_AUTHOR("Tomi Valkeinen "); MODULE_DESCRIPTION("OMAP2/3 Display Subsystem"); diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 68dd27f21a25..e172531d196b 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -163,20 +163,11 @@ struct platform_device; /* core */ struct platform_device *dss_get_core_pdev(void); -struct bus_type *dss_get_bus(void); int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask); void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask); int dss_set_min_bus_tput(struct device *dev, unsigned long tput); int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)); -struct omap_dss_device *dss_alloc_and_init_device(struct device *parent); -int dss_add_device(struct omap_dss_device *dssdev); -void dss_unregister_device(struct omap_dss_device *dssdev); -void dss_unregister_child_devices(struct device *parent); -void dss_put_device(struct omap_dss_device *dssdev); -void dss_copy_device_pdata(struct omap_dss_device *dst, - const struct omap_dss_device *src); - /* display */ int dss_suspend_all_devices(void); int dss_resume_all_devices(void); diff --git a/include/video/omapdss.h b/include/video/omapdss.h index ca04b56c8f9d..763b11b58153 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -703,10 +703,6 @@ struct omapdss_dsi_ops { }; struct omap_dss_device { - /* old device, to be removed */ - struct device old_dev; - - /* new device, pointer to panel device */ struct device *dev; struct module *owner; @@ -808,8 +804,6 @@ struct omap_dss_hdmi_data }; struct omap_dss_driver { - struct device_driver driver; - int (*probe)(struct omap_dss_device *); void (*remove)(struct omap_dss_device *); -- cgit v1.2.3-59-g8ed1b