aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Cooksey2016-02-29 17:25:37 -0600
committerPraneeth Bajjuri2016-03-16 16:47:21 -0500
commit764a4f8a51c7f65b9c3aec6f2e50d5222bf04b1a (patch)
tree09357af34d8dbfbeb9ca03e71b4fa4ce682ff855
parent5f46899279c629d1da1a6575785bc83896865ce2 (diff)
downloadkernel-video-764a4f8a51c7f65b9c3aec6f2e50d5222bf04b1a.tar.gz
kernel-video-764a4f8a51c7f65b9c3aec6f2e50d5222bf04b1a.tar.xz
kernel-video-764a4f8a51c7f65b9c3aec6f2e50d5222bf04b1a.zip
OMAPDSS: Added New API to Register Callback for Notification of HPD
An additional DSS API was added for registering a callback function to be invoked when a display HPD detect event occurs. Change-Id: I13d126826c0c2bde4b8f542ecb64d9cf65606444 Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
-rw-r--r--drivers/video/fbdev/omap2/displays-new/connector-hdmi.c12
-rw-r--r--drivers/video/fbdev/omap2/displays-new/dra7-evm-encoder-tpd12s015.c13
-rw-r--r--drivers/video/fbdev/omap2/displays-new/panel-tc3587xxbg.c1
-rw-r--r--drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c2
-rw-r--r--drivers/video/fbdev/omap2/dss/hdmi.h2
-rw-r--r--drivers/video/fbdev/omap2/dss/hdmi5.c20
-rw-r--r--include/video/omapdss.h8
7 files changed, 57 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
index dd36d714b39..6036bf6203c 100644
--- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
@@ -187,6 +187,17 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
187 return in->ops.hdmi->set_infoframe(in, avi); 187 return in->ops.hdmi->set_infoframe(in, avi);
188} 188}
189 189
190static int hdmic_register_hpd_callback(struct omap_dss_device *dssdev,
191 dss_hdmi_hpd_cb func,
192 void *data)
193{
194 struct panel_drv_data *ddata = to_panel_data(dssdev);
195 struct omap_dss_device *in = ddata->in;
196
197 if (in->ops.hdmi->register_hpd_callback)
198 return in->ops.hdmi->register_hpd_callback(in, func, data);
199}
200
190static struct omap_dss_driver hdmic_driver = { 201static struct omap_dss_driver hdmic_driver = {
191 .connect = hdmic_connect, 202 .connect = hdmic_connect,
192 .disconnect = hdmic_disconnect, 203 .disconnect = hdmic_disconnect,
@@ -204,6 +215,7 @@ static struct omap_dss_driver hdmic_driver = {
204 .detect = hdmic_detect, 215 .detect = hdmic_detect,
205 .set_hdmi_mode = hdmic_set_hdmi_mode, 216 .set_hdmi_mode = hdmic_set_hdmi_mode,
206 .set_hdmi_infoframe = hdmic_set_infoframe, 217 .set_hdmi_infoframe = hdmic_set_infoframe,
218 .register_hpd_callback = hdmic_register_hpd_callback,
207}; 219};
208 220
209static int hdmic_probe_pdata(struct platform_device *pdev) 221static int hdmic_probe_pdata(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/omap2/displays-new/dra7-evm-encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/dra7-evm-encoder-tpd12s015.c
index 6e4a7234a86..a55fd611523 100644
--- a/drivers/video/fbdev/omap2/displays-new/dra7-evm-encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/dra7-evm-encoder-tpd12s015.c
@@ -48,6 +48,7 @@ struct panel_drv_data {
48 struct pinctrl_state *pin_state_ddc; 48 struct pinctrl_state *pin_state_ddc;
49 49
50 struct i2c_adapter *ddc_i2c_adapter; 50 struct i2c_adapter *ddc_i2c_adapter;
51 dss_hdmi_hpd_cb hpd_func;
51}; 52};
52 53
53static struct platform_device *mcasp; 54static struct platform_device *mcasp;
@@ -291,6 +292,17 @@ static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,
291 return in->ops.hdmi->set_hdmi_mode(in, hdmi_mode); 292 return in->ops.hdmi->set_hdmi_mode(in, hdmi_mode);
292} 293}
293 294
295static int tpd_register_hpd_callback(struct omap_dss_device *dssdev,
296 dss_hdmi_hpd_cb func,
297 void *data)
298{
299 struct panel_drv_data *ddata = to_panel_data(dssdev);
300 struct omap_dss_device *in = ddata->in;
301
302 if (in->ops.hdmi->register_hpd_callback)
303 return in->ops.hdmi->register_hpd_callback(dssdev, func, data);
304}
305
294static const struct omapdss_hdmi_ops tpd_hdmi_ops = { 306static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
295 .connect = tpd_connect, 307 .connect = tpd_connect,
296 .disconnect = tpd_disconnect, 308 .disconnect = tpd_disconnect,
@@ -306,6 +318,7 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
306 .detect = tpd_detect, 318 .detect = tpd_detect,
307 .set_infoframe = tpd_set_infoframe, 319 .set_infoframe = tpd_set_infoframe,
308 .set_hdmi_mode = tpd_set_hdmi_mode, 320 .set_hdmi_mode = tpd_set_hdmi_mode,
321 .register_hpd_callback = tpd_register_hpd_callback
309}; 322};
310 323
311static int tpd_probe_of(struct platform_device *pdev) 324static int tpd_probe_of(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tc3587xxbg.c b/drivers/video/fbdev/omap2/displays-new/panel-tc3587xxbg.c
index 744b6e820bd..0781223df73 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-tc3587xxbg.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-tc3587xxbg.c
@@ -540,6 +540,7 @@ static struct omap_dss_driver tc358768_dpi_ops = {
540 .check_timings = tc358768_check_timings, 540 .check_timings = tc358768_check_timings,
541 .set_timings = tc358768_set_timings, 541 .set_timings = tc358768_set_timings,
542 .get_timings = tc358768_get_timings, 542 .get_timings = tc358768_get_timings,
543 .register_hpd_callback = NULL,
543}; 544};
544 545
545static const struct of_device_id tc3587xxbg_of_match[] = { 546static const struct of_device_id tc3587xxbg_of_match[] = {
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c b/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c
index 140dae9bbf8..c44862295f2 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c
@@ -283,8 +283,8 @@ static struct omap_dss_driver panel_dpi_ops = {
283 .set_timings = panel_dpi_set_timings, 283 .set_timings = panel_dpi_set_timings,
284 .get_timings = panel_dpi_get_timings, 284 .get_timings = panel_dpi_get_timings,
285 .check_timings = panel_dpi_check_timings, 285 .check_timings = panel_dpi_check_timings,
286
287 .get_resolution = omapdss_default_get_resolution, 286 .get_resolution = omapdss_default_get_resolution,
287 .register_hpd_callback = NULL,
288}; 288};
289 289
290static int tlc_probe_of(struct device *dev) 290static int tlc_probe_of(struct device *dev)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 449a122af8a..2014748852f 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -327,6 +327,8 @@ struct omap_hdmi {
327 327
328 bool core_enabled; 328 bool core_enabled;
329 bool display_enabled; 329 bool display_enabled;
330 dss_hdmi_hpd_cb hpd_cb_func;
331 void *hpd_cb_data;
330 332
331 struct omap_dss_device output; 333 struct omap_dss_device output;
332 334
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 8863adef981..a6e8a495c26 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -109,8 +109,14 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
109 109
110 } else if (irqstatus & HDMI_IRQ_LINK_CONNECT) { 110 } else if (irqstatus & HDMI_IRQ_LINK_CONNECT) {
111 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_TXON); 111 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_TXON);
112
113 if (hdmi.hpd_cb_func)
114 hdmi.hpd_cb_func(irq, hdmi.hpd_cb_data);
112 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) { 115 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
113 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_LDOON); 116 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_LDOON);
117
118 if (hdmi.hpd_cb_func)
119 hdmi.hpd_cb_func(irq, hdmi.hpd_cb_data);
114 } 120 }
115 121
116 return IRQ_HANDLED; 122 return IRQ_HANDLED;
@@ -545,6 +551,17 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,
545 return 0; 551 return 0;
546} 552}
547 553
554static int hdmi_register_hpd_callback(struct omap_dss_device *dssdev,
555 dss_hdmi_hpd_cb func,
556 void *data)
557
558{
559 hdmi.hpd_cb_func = func;
560 hdmi.hpd_cb_data = data;
561
562 return 0;
563}
564
548static const struct omapdss_hdmi_ops hdmi_ops = { 565static const struct omapdss_hdmi_ops hdmi_ops = {
549 .connect = hdmi_connect, 566 .connect = hdmi_connect,
550 .disconnect = hdmi_disconnect, 567 .disconnect = hdmi_disconnect,
@@ -559,6 +576,7 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
559 .read_edid = hdmi_read_edid, 576 .read_edid = hdmi_read_edid,
560 .set_infoframe = hdmi_set_infoframe, 577 .set_infoframe = hdmi_set_infoframe,
561 .set_hdmi_mode = hdmi_set_hdmi_mode, 578 .set_hdmi_mode = hdmi_set_hdmi_mode,
579 .register_hpd_callback = hdmi_register_hpd_callback
562}; 580};
563 581
564static void hdmi_init_output(struct platform_device *pdev) 582static void hdmi_init_output(struct platform_device *pdev)
@@ -748,6 +766,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
748 return r; 766 return r;
749 } 767 }
750 768
769 hdmi.hpd_cb_func = NULL;
770
751 pm_runtime_enable(&pdev->dev); 771 pm_runtime_enable(&pdev->dev);
752 772
753 hdmi_init_output(pdev); 773 hdmi_init_output(pdev);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 13eec485e5b..aadbd2a733e 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -336,6 +336,8 @@ struct omap_dss_board_info {
336 enum omapdss_version version; 336 enum omapdss_version version;
337}; 337};
338 338
339typedef irqreturn_t (*dss_hdmi_hpd_cb)(int irq, void *data);
340
339/* Init with the board info */ 341/* Init with the board info */
340extern int omap_display_init(struct omap_dss_board_info *board_data); 342extern int omap_display_init(struct omap_dss_board_info *board_data);
341/* HDMI mux init*/ 343/* HDMI mux init*/
@@ -636,6 +638,9 @@ struct omapdss_hdmi_ops {
636 int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode); 638 int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
637 int (*set_infoframe)(struct omap_dss_device *dssdev, 639 int (*set_infoframe)(struct omap_dss_device *dssdev,
638 const struct hdmi_avi_infoframe *avi); 640 const struct hdmi_avi_infoframe *avi);
641 int (*register_hpd_callback)(struct omap_dss_device *dssdev,
642 dss_hdmi_hpd_cb func,
643 void *data);
639}; 644};
640 645
641struct omapdss_dsi_ops { 646struct omapdss_dsi_ops {
@@ -849,6 +854,9 @@ struct omap_dss_driver {
849 int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode); 854 int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
850 int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev, 855 int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev,
851 const struct hdmi_avi_infoframe *avi); 856 const struct hdmi_avi_infoframe *avi);
857 int (*register_hpd_callback)(struct omap_dss_device *dssdev,
858 dss_hdmi_hpd_cb func,
859 void *data);
852}; 860};
853 861
854enum omapdss_version omapdss_get_version(void); 862enum omapdss_version omapdss_get_version(void);