1 // SPDX-License-Identifier: GPL-2.0-only
3 * Analog TV Connector driver
5 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
6 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
9 #include <linux/slab.h>
10 #include <linux/module.h>
11 #include <linux/platform_device.h>
14 #include "../dss/omapdss.h"
16 struct panel_drv_data
{
17 struct omap_dss_device dssdev
;
22 #define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
24 static int tvc_connect(struct omap_dss_device
*src
,
25 struct omap_dss_device
*dst
)
30 static void tvc_disconnect(struct omap_dss_device
*src
,
31 struct omap_dss_device
*dst
)
35 static const struct omap_dss_device_ops tvc_ops
= {
36 .connect
= tvc_connect
,
37 .disconnect
= tvc_disconnect
,
40 static int tvc_probe(struct platform_device
*pdev
)
42 struct panel_drv_data
*ddata
;
43 struct omap_dss_device
*dssdev
;
45 ddata
= devm_kzalloc(&pdev
->dev
, sizeof(*ddata
), GFP_KERNEL
);
49 platform_set_drvdata(pdev
, ddata
);
50 ddata
->dev
= &pdev
->dev
;
52 dssdev
= &ddata
->dssdev
;
53 dssdev
->ops
= &tvc_ops
;
54 dssdev
->dev
= &pdev
->dev
;
55 dssdev
->type
= OMAP_DISPLAY_TYPE_VENC
;
56 dssdev
->display
= true;
57 dssdev
->owner
= THIS_MODULE
;
58 dssdev
->of_ports
= BIT(0);
60 omapdss_display_init(dssdev
);
61 omapdss_device_register(dssdev
);
66 static int __exit
tvc_remove(struct platform_device
*pdev
)
68 struct panel_drv_data
*ddata
= platform_get_drvdata(pdev
);
70 omapdss_device_unregister(&ddata
->dssdev
);
75 static const struct of_device_id tvc_of_match
[] = {
76 { .compatible
= "omapdss,svideo-connector", },
77 { .compatible
= "omapdss,composite-video-connector", },
81 MODULE_DEVICE_TABLE(of
, tvc_of_match
);
83 static struct platform_driver tvc_connector_driver
= {
85 .remove
= __exit_p(tvc_remove
),
87 .name
= "connector-analog-tv",
88 .of_match_table
= tvc_of_match
,
89 .suppress_bind_attrs
= true,
93 module_platform_driver(tvc_connector_driver
);
95 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
96 MODULE_DESCRIPTION("Analog TV Connector driver");
97 MODULE_LICENSE("GPL");