2 * Analog TV Connector driver
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
12 #include <linux/slab.h>
13 #include <linux/module.h>
14 #include <linux/platform_device.h>
17 #include "../dss/omapdss.h"
19 struct panel_drv_data {
20 struct omap_dss_device dssdev;
25 #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
27 static int tvc_connect(struct omap_dss_device *src,
28 struct omap_dss_device *dst)
33 static void tvc_disconnect(struct omap_dss_device *src,
34 struct omap_dss_device *dst)
38 static const struct omap_dss_device_ops tvc_ops = {
39 .connect = tvc_connect,
40 .disconnect = tvc_disconnect,
43 static int tvc_probe(struct platform_device *pdev)
45 struct panel_drv_data *ddata;
46 struct omap_dss_device *dssdev;
48 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
52 platform_set_drvdata(pdev, ddata);
53 ddata->dev = &pdev->dev;
55 dssdev = &ddata->dssdev;
56 dssdev->ops = &tvc_ops;
57 dssdev->dev = &pdev->dev;
58 dssdev->type = OMAP_DISPLAY_TYPE_VENC;
59 dssdev->display = true;
60 dssdev->owner = THIS_MODULE;
61 dssdev->of_ports = BIT(0);
63 omapdss_display_init(dssdev);
64 omapdss_device_register(dssdev);
69 static int __exit tvc_remove(struct platform_device *pdev)
71 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
73 omapdss_device_unregister(&ddata->dssdev);
78 static const struct of_device_id tvc_of_match[] = {
79 { .compatible = "omapdss,svideo-connector", },
80 { .compatible = "omapdss,composite-video-connector", },
84 MODULE_DEVICE_TABLE(of, tvc_of_match);
86 static struct platform_driver tvc_connector_driver = {
88 .remove = __exit_p(tvc_remove),
90 .name = "connector-analog-tv",
91 .of_match_table = tvc_of_match,
92 .suppress_bind_attrs = true,
96 module_platform_driver(tvc_connector_driver);
98 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
99 MODULE_DESCRIPTION("Analog TV Connector driver");
100 MODULE_LICENSE("GPL");