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>
This commit is contained in:
Laurent Pinchart
2018-02-13 14:00:41 +02:00
committed by Tomi Valkeinen
parent 72877cf38b
commit d3541ca81d
6 changed files with 14 additions and 19 deletions

View File

@@ -18,10 +18,11 @@
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/list.h>
#include "dss.h"
#include "omapdss.h"
static struct dss_device *dss_device;
static const struct dispc_ops *ops;
static struct list_head omapdss_comp_list;
@@ -43,15 +44,9 @@ void omapdss_set_dss(struct dss_device *dss)
}
EXPORT_SYMBOL(omapdss_set_dss);
void dispc_set_ops(const struct dispc_ops *o)
const struct dispc_ops *dispc_get_ops(struct dss_device *dss)
{
ops = o;
}
EXPORT_SYMBOL(dispc_set_ops);
const struct dispc_ops *dispc_get_ops(void)
{
return ops;
return dss->dispc_ops;
}
EXPORT_SYMBOL(dispc_get_ops);

View File

@@ -4622,7 +4622,7 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
dispc_runtime_put();
dispc_set_ops(&dispc_ops);
dss->dispc_ops = &dispc_ops;
dispc.debugfs = dss_debugfs_create_file(dss, "dispc", dispc_dump_regs,
&dispc);
@@ -4637,9 +4637,11 @@ err_runtime_get:
static void dispc_unbind(struct device *dev, struct device *master,
void *data)
{
struct dss_device *dss = dispc.dss;
dss_debugfs_remove_file(dispc.debugfs);
dispc_set_ops(NULL);
dss->dispc_ops = NULL;
pm_runtime_disable(dev);

View File

@@ -271,6 +271,8 @@ struct dss_device {
struct dss_pll *plls[4];
struct dss_pll *video1_pll;
struct dss_pll *video2_pll;
const struct dispc_ops *dispc_ops;
};
/* core */

View File

@@ -733,8 +733,7 @@ struct dispc_ops {
const u32 *(*ovl_get_color_modes)(enum omap_plane_id plane);
};
void dispc_set_ops(const struct dispc_ops *o);
const struct dispc_ops *dispc_get_ops(void);
const struct dispc_ops *dispc_get_ops(struct dss_device *dss);
bool omapdss_component_is_display(struct device_node *node);
bool omapdss_component_is_output(struct device_node *node);