2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3 * Author: Archit Taneja <archit@ti.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
18 #include <linux/kernel.h>
19 #include <linux/module.h>
20 #include <linux/platform_device.h>
21 #include <linux/slab.h>
27 int omapdss_device_init_output(struct omap_dss_device *out)
29 out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
30 if (IS_ERR(out->next)) {
31 if (PTR_ERR(out->next) != -EPROBE_DEFER)
32 dev_err(out->dev, "failed to find video sink\n");
33 return PTR_ERR(out->next);
36 if (out->next && out->type != out->next->type) {
37 dev_err(out->dev, "output type and display type don't match\n");
43 EXPORT_SYMBOL(omapdss_device_init_output);
45 void omapdss_device_cleanup_output(struct omap_dss_device *out)
48 omapdss_device_put(out->next);
50 EXPORT_SYMBOL(omapdss_device_cleanup_output);
52 int dss_install_mgr_ops(struct dss_device *dss,
53 const struct dss_mgr_ops *mgr_ops,
54 struct omap_drm_private *priv)
59 dss->mgr_ops = mgr_ops;
60 dss->mgr_ops_priv = priv;
64 EXPORT_SYMBOL(dss_install_mgr_ops);
66 void dss_uninstall_mgr_ops(struct dss_device *dss)
69 dss->mgr_ops_priv = NULL;
71 EXPORT_SYMBOL(dss_uninstall_mgr_ops);
73 void dss_mgr_set_timings(struct omap_dss_device *dssdev,
74 const struct videomode *vm)
76 dssdev->dss->mgr_ops->set_timings(dssdev->dss->mgr_ops_priv,
77 dssdev->dispc_channel, vm);
79 EXPORT_SYMBOL(dss_mgr_set_timings);
81 void dss_mgr_set_lcd_config(struct omap_dss_device *dssdev,
82 const struct dss_lcd_mgr_config *config)
84 dssdev->dss->mgr_ops->set_lcd_config(dssdev->dss->mgr_ops_priv,
85 dssdev->dispc_channel, config);
87 EXPORT_SYMBOL(dss_mgr_set_lcd_config);
89 int dss_mgr_enable(struct omap_dss_device *dssdev)
91 return dssdev->dss->mgr_ops->enable(dssdev->dss->mgr_ops_priv,
92 dssdev->dispc_channel);
94 EXPORT_SYMBOL(dss_mgr_enable);
96 void dss_mgr_disable(struct omap_dss_device *dssdev)
98 dssdev->dss->mgr_ops->disable(dssdev->dss->mgr_ops_priv,
99 dssdev->dispc_channel);
101 EXPORT_SYMBOL(dss_mgr_disable);
103 void dss_mgr_start_update(struct omap_dss_device *dssdev)
105 dssdev->dss->mgr_ops->start_update(dssdev->dss->mgr_ops_priv,
106 dssdev->dispc_channel);
108 EXPORT_SYMBOL(dss_mgr_start_update);
110 int dss_mgr_register_framedone_handler(struct omap_dss_device *dssdev,
111 void (*handler)(void *), void *data)
113 struct dss_device *dss = dssdev->dss;
115 return dss->mgr_ops->register_framedone_handler(dss->mgr_ops_priv,
116 dssdev->dispc_channel,
119 EXPORT_SYMBOL(dss_mgr_register_framedone_handler);
121 void dss_mgr_unregister_framedone_handler(struct omap_dss_device *dssdev,
122 void (*handler)(void *), void *data)
124 struct dss_device *dss = dssdev->dss;
126 dss->mgr_ops->unregister_framedone_handler(dss->mgr_ops_priv,
127 dssdev->dispc_channel,
130 EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler);