aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraneeth Bajjuri2016-03-16 16:55:02 -0500
committerPraneeth Bajjuri2016-03-16 16:55:02 -0500
commitb45e1c1a604ae715723d211db98caac6a9c08577 (patch)
tree48daf7c52cdc55f688819ea126fa0f8326064c2d
parent9a1e03d0e8fb7b025eaed7a8357294145c9f497b (diff)
parentba9386974bb3c977cbfa9a2ef9d09eda36ebc6bd (diff)
downloadkernel-video-b45e1c1a604ae715723d211db98caac6a9c08577.tar.gz
kernel-video-b45e1c1a604ae715723d211db98caac6a9c08577.tar.xz
kernel-video-b45e1c1a604ae715723d211db98caac6a9c08577.zip
Merge branch 'p-ti-linux-3.14.y-common' into p-ti-linux-3.14.y-android
* p-ti-linux-3.14.y-common: OMAPDRM: Register HDMI HPD Callback for HDMI HPD Interrupts OMAPDSS: Added New API to Register Callback for Notification of HPD Conflicts: drivers/video/fbdev/omap2/dss/hdmi5.c Change-Id: If661df80907b1c5e3f4944c55ea0494c4f3c35d0 Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_connector.c13
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c3
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.h2
-rw-r--r--drivers/gpu/drm/omapdrm/omap_irq.c25
-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.c17
-rw-r--r--include/video/omapdss.h8
11 files changed, 97 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index e5c72ee525a..5b02f8ad727 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -146,6 +146,9 @@ static enum drm_connector_status omap_connector_detect(
146 struct omap_dss_driver *dssdrv = dssdev->driver; 146 struct omap_dss_driver *dssdrv = dssdev->driver;
147 enum drm_connector_status ret; 147 enum drm_connector_status ret;
148 148
149 if (force)
150 ret = connector_status_connected;
151
149 if (dssdrv->detect) { 152 if (dssdrv->detect) {
150 if (dssdrv->detect(dssdev)) 153 if (dssdrv->detect(dssdev))
151 ret = connector_status_connected; 154 ret = connector_status_connected;
@@ -336,11 +339,21 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
336 omap_connector->encoder = encoder; 339 omap_connector->encoder = encoder;
337 340
338 connector = &omap_connector->base; 341 connector = &omap_connector->base;
342 connector->force = DRM_FORCE_ON;
339 343
340 drm_connector_init(dev, connector, &omap_connector_funcs, 344 drm_connector_init(dev, connector, &omap_connector_funcs,
341 connector_type); 345 connector_type);
342 drm_connector_helper_add(connector, &omap_connector_helper_funcs); 346 drm_connector_helper_add(connector, &omap_connector_helper_funcs);
343 347
348 if (dssdev->driver->register_hpd_callback) {
349 dssdev->driver->register_hpd_callback(dssdev,
350 omap_hdmi_hpd_irq_handler,
351 dev);
352
353 DBG("Registered ISR omap_drm_hdmi_hpd_irq");
354 }
355
356
344#if 0 /* enable when dss2 supports hotplug */ 357#if 0 /* enable when dss2 supports hotplug */
345 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_HPD) 358 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_HPD)
346 connector->polled = 0; 359 connector->polled = 0;
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index ad35d9b5436..8526b2c427f 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -17,6 +17,7 @@
17 * this program. If not, see <http://www.gnu.org/licenses/>. 17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */ 18 */
19 19
20#include <linux/interrupt.h>
20#include "omap_drv.h" 21#include "omap_drv.h"
21 22
22#include "drm_crtc_helper.h" 23#include "drm_crtc_helper.h"
@@ -142,6 +143,7 @@ static int omap_connect_dssdevs(void)
142 143
143 for_each_dss_dev(dssdev) { 144 for_each_dss_dev(dssdev) {
144 r = dssdev->driver->connect(dssdev); 145 r = dssdev->driver->connect(dssdev);
146
145 if (r == -EPROBE_DEFER) { 147 if (r == -EPROBE_DEFER) {
146 omap_dss_put_device(dssdev); 148 omap_dss_put_device(dssdev);
147 goto cleanup; 149 goto cleanup;
@@ -900,6 +902,7 @@ static int pdev_probe(struct platform_device *device)
900 902
901 DBG("%s", device->name); 903 DBG("%s", device->name);
902 return drm_platform_init(&omap_drm_driver, device); 904 return drm_platform_init(&omap_drm_driver, device);
905
903} 906}
904 907
905static int pdev_remove(struct platform_device *device) 908static int pdev_remove(struct platform_device *device)
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index d3394503333..12f3f295df6 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -151,6 +151,7 @@ int omap_gem_resume(struct device *dev);
151int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id); 151int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id);
152void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id); 152void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id);
153irqreturn_t omap_irq_handler(int irq, void *arg); 153irqreturn_t omap_irq_handler(int irq, void *arg);
154irqreturn_t omap_hdmi_hpd_irq_handler(int irq, void *arg);
154void omap_irq_preinstall(struct drm_device *dev); 155void omap_irq_preinstall(struct drm_device *dev);
155int omap_irq_postinstall(struct drm_device *dev); 156int omap_irq_postinstall(struct drm_device *dev);
156void omap_irq_uninstall(struct drm_device *dev); 157void omap_irq_uninstall(struct drm_device *dev);
@@ -367,6 +368,7 @@ struct drm_gem_object *omap_gem_new_ext(struct drm_device *dev,
367 368
368void omap_gem_op_update(void); 369void omap_gem_op_update(void);
369int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj); 370int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj);
371
370/*********************************/ 372/*********************************/
371 373
372 374
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c
index 3eb097efc48..86d88bbc0f0 100644
--- a/drivers/gpu/drm/omapdrm/omap_irq.c
+++ b/drivers/gpu/drm/omapdrm/omap_irq.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include "omap_drv.h" 20#include "omap_drv.h"
21#include "drm_fb_helper.h"
21 22
22static DEFINE_SPINLOCK(list_lock); 23static DEFINE_SPINLOCK(list_lock);
23 24
@@ -187,6 +188,30 @@ void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id)
187 dispc_runtime_put(); 188 dispc_runtime_put();
188} 189}
189 190
191irqreturn_t omap_hdmi_hpd_irq_handler(int irq, void *arg)
192{
193 struct drm_device *dev = (struct drm_device *)arg;
194 struct drm_connector *connector;
195 struct omap_drm_private *priv = dev->dev_private;
196 unsigned long flags = 0;
197
198 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
199 if ((connector->connector_type == DRM_MODE_CONNECTOR_HDMIA) ||
200 (connector->connector_type == DRM_MODE_CONNECTOR_HDMIB)) {
201 connector->status = connector_status_unknown;
202
203 if (priv->fbdev) {
204 spin_lock_irqsave(&list_lock, flags);
205 drm_kms_helper_poll_enable(dev);
206 connector->force = 0;
207 spin_unlock_irqrestore(&list_lock, flags);
208 }
209 }
210 }
211
212 return IRQ_HANDLED;
213}
214
190irqreturn_t omap_irq_handler(int irq, void *arg) 215irqreturn_t omap_irq_handler(int irq, void *arg)
191{ 216{
192 struct drm_device *dev = (struct drm_device *) arg; 217 struct drm_device *dev = (struct drm_device *) arg;
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 6cdfab90c88..9e8ba019ae3 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-tlc59108.c
@@ -286,8 +286,8 @@ static struct omap_dss_driver panel_dpi_ops = {
286 .set_timings = panel_dpi_set_timings, 286 .set_timings = panel_dpi_set_timings,
287 .get_timings = panel_dpi_get_timings, 287 .get_timings = panel_dpi_get_timings,
288 .check_timings = panel_dpi_check_timings, 288 .check_timings = panel_dpi_check_timings,
289
290 .get_resolution = omapdss_default_get_resolution, 289 .get_resolution = omapdss_default_get_resolution,
290 .register_hpd_callback = NULL,
291}; 291};
292 292
293static int tlc_probe_of(struct device *dev) 293static 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 7acc36ccc3b..585849a6464 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -328,6 +328,8 @@ struct omap_hdmi {
328 328
329 bool core_enabled; 329 bool core_enabled;
330 bool display_enabled; 330 bool display_enabled;
331 dss_hdmi_hpd_cb hpd_cb_func;
332 void *hpd_cb_data;
331 333
332 struct omap_dss_device output; 334 struct omap_dss_device output;
333 335
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index afcdc3e0cab..292a66914e3 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -110,9 +110,13 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
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 extcon_set_state(&hdmi.edev, 1); 112 extcon_set_state(&hdmi.edev, 1);
113 if (hdmi.hpd_cb_func)
114 hdmi.hpd_cb_func(irq, hdmi.hpd_cb_data);
113 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) { 115 } else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
114 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_LDOON); 116 hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_LDOON);
115 extcon_set_state(&hdmi.edev, 0); 117 extcon_set_state(&hdmi.edev, 0);
118 if (hdmi.hpd_cb_func)
119 hdmi.hpd_cb_func(irq, hdmi.hpd_cb_data);
116 } 120 }
117 121
118 return IRQ_HANDLED; 122 return IRQ_HANDLED;
@@ -547,6 +551,17 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,
547 return 0; 551 return 0;
548} 552}
549 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
550static const struct omapdss_hdmi_ops hdmi_ops = { 565static const struct omapdss_hdmi_ops hdmi_ops = {
551 .connect = hdmi_connect, 566 .connect = hdmi_connect,
552 .disconnect = hdmi_disconnect, 567 .disconnect = hdmi_disconnect,
@@ -561,6 +576,7 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
561 .read_edid = hdmi_read_edid, 576 .read_edid = hdmi_read_edid,
562 .set_infoframe = hdmi_set_infoframe, 577 .set_infoframe = hdmi_set_infoframe,
563 .set_hdmi_mode = hdmi_set_hdmi_mode, 578 .set_hdmi_mode = hdmi_set_hdmi_mode,
579 .register_hpd_callback = hdmi_register_hpd_callback
564}; 580};
565 581
566static void hdmi_init_output(struct platform_device *pdev) 582static void hdmi_init_output(struct platform_device *pdev)
@@ -752,6 +768,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
752 768
753 hdmi.edev.name = "hdmi"; 769 hdmi.edev.name = "hdmi";
754 hdmi.edev.print_state = NULL; 770 hdmi.edev.print_state = NULL;
771 hdmi.hpd_cb_func = NULL;
755 772
756 r = extcon_dev_register(&hdmi.edev); 773 r = extcon_dev_register(&hdmi.edev);
757 if (r) 774 if (r)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index f8d2fc6db64..0711d11d426 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);