diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-02-13 07:00:41 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-03-01 02:18:18 -0500 |
commit | d3541ca81dbddeefa0c42df448211a9dbaef0843 (patch) | |
tree | f6a9425fa31c30f7f4597fd6ab48a8a250bf7502 /drivers/gpu/drm/omapdrm/dss | |
parent | 72877cf38b4b78fbb3a852f2288d7f2a7af0db22 (diff) |
drm: omapdrm: dss: Store dispc ops in dss_device structure
Remove the global dispc ops variable by storing it in the dss_device
structure.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/base.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dss.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 |
4 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 6346bc967a77..c248c3c31904 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c | |||
@@ -18,10 +18,11 @@ | |||
18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_graph.h> | 19 | #include <linux/of_graph.h> |
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | |||
22 | #include "dss.h" | ||
21 | #include "omapdss.h" | 23 | #include "omapdss.h" |
22 | 24 | ||
23 | static struct dss_device *dss_device; | 25 | static struct dss_device *dss_device; |
24 | static const struct dispc_ops *ops; | ||
25 | 26 | ||
26 | static struct list_head omapdss_comp_list; | 27 | static struct list_head omapdss_comp_list; |
27 | 28 | ||
@@ -43,15 +44,9 @@ void omapdss_set_dss(struct dss_device *dss) | |||
43 | } | 44 | } |
44 | EXPORT_SYMBOL(omapdss_set_dss); | 45 | EXPORT_SYMBOL(omapdss_set_dss); |
45 | 46 | ||
46 | void dispc_set_ops(const struct dispc_ops *o) | 47 | const struct dispc_ops *dispc_get_ops(struct dss_device *dss) |
47 | { | ||
48 | ops = o; | ||
49 | } | ||
50 | EXPORT_SYMBOL(dispc_set_ops); | ||
51 | |||
52 | const struct dispc_ops *dispc_get_ops(void) | ||
53 | { | 48 | { |
54 | return ops; | 49 | return dss->dispc_ops; |
55 | } | 50 | } |
56 | EXPORT_SYMBOL(dispc_get_ops); | 51 | EXPORT_SYMBOL(dispc_get_ops); |
57 | 52 | ||
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 8019cc9f4f97..aae6037f499f 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
@@ -4622,7 +4622,7 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) | |||
4622 | 4622 | ||
4623 | dispc_runtime_put(); | 4623 | dispc_runtime_put(); |
4624 | 4624 | ||
4625 | dispc_set_ops(&dispc_ops); | 4625 | dss->dispc_ops = &dispc_ops; |
4626 | 4626 | ||
4627 | dispc.debugfs = dss_debugfs_create_file(dss, "dispc", dispc_dump_regs, | 4627 | dispc.debugfs = dss_debugfs_create_file(dss, "dispc", dispc_dump_regs, |
4628 | &dispc); | 4628 | &dispc); |
@@ -4637,9 +4637,11 @@ err_runtime_get: | |||
4637 | static void dispc_unbind(struct device *dev, struct device *master, | 4637 | static void dispc_unbind(struct device *dev, struct device *master, |
4638 | void *data) | 4638 | void *data) |
4639 | { | 4639 | { |
4640 | struct dss_device *dss = dispc.dss; | ||
4641 | |||
4640 | dss_debugfs_remove_file(dispc.debugfs); | 4642 | dss_debugfs_remove_file(dispc.debugfs); |
4641 | 4643 | ||
4642 | dispc_set_ops(NULL); | 4644 | dss->dispc_ops = NULL; |
4643 | 4645 | ||
4644 | pm_runtime_disable(dev); | 4646 | pm_runtime_disable(dev); |
4645 | 4647 | ||
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h index 764c52025a27..348378f1b5a5 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.h +++ b/drivers/gpu/drm/omapdrm/dss/dss.h | |||
@@ -271,6 +271,8 @@ struct dss_device { | |||
271 | struct dss_pll *plls[4]; | 271 | struct dss_pll *plls[4]; |
272 | struct dss_pll *video1_pll; | 272 | struct dss_pll *video1_pll; |
273 | struct dss_pll *video2_pll; | 273 | struct dss_pll *video2_pll; |
274 | |||
275 | const struct dispc_ops *dispc_ops; | ||
274 | }; | 276 | }; |
275 | 277 | ||
276 | /* core */ | 278 | /* core */ |
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 312485714703..4bf7843b4aec 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h | |||
@@ -733,8 +733,7 @@ struct dispc_ops { | |||
733 | const u32 *(*ovl_get_color_modes)(enum omap_plane_id plane); | 733 | const u32 *(*ovl_get_color_modes)(enum omap_plane_id plane); |
734 | }; | 734 | }; |
735 | 735 | ||
736 | void dispc_set_ops(const struct dispc_ops *o); | 736 | const struct dispc_ops *dispc_get_ops(struct dss_device *dss); |
737 | const struct dispc_ops *dispc_get_ops(void); | ||
738 | 737 | ||
739 | bool omapdss_component_is_display(struct device_node *node); | 738 | bool omapdss_component_is_display(struct device_node *node); |
740 | bool omapdss_component_is_output(struct device_node *node); | 739 | bool omapdss_component_is_output(struct device_node *node); |