Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] sti: hdmi: add CEC notifier support

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Benjamin Gaignard and committed by
Mauro Carvalho Chehab
bca55958 e3a93adc

+14
+11
drivers/gpu/drm/sti/sti_hdmi.c
··· 771 771 clk_disable_unprepare(hdmi->clk_pix); 772 772 773 773 hdmi->enabled = false; 774 + 775 + cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID); 774 776 } 775 777 776 778 /** ··· 975 973 DRM_DEBUG_KMS("%s : %dx%d cm\n", 976 974 (hdmi->hdmi_monitor ? "hdmi monitor" : "dvi monitor"), 977 975 edid->width_cm, edid->height_cm); 976 + cec_notifier_set_phys_addr_from_edid(hdmi->notifier, edid); 978 977 979 978 count = drm_add_edid_modes(connector, edid); 980 979 drm_mode_connector_update_edid_property(connector, edid); ··· 1038 1035 } 1039 1036 1040 1037 DRM_DEBUG_DRIVER("hdmi cable disconnected\n"); 1038 + cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID); 1041 1039 return connector_status_disconnected; 1042 1040 } 1043 1041 ··· 1427 1423 goto release_adapter; 1428 1424 } 1429 1425 1426 + hdmi->notifier = cec_notifier_get(&pdev->dev); 1427 + if (!hdmi->notifier) 1428 + goto release_adapter; 1429 + 1430 1430 hdmi->reset = devm_reset_control_get(dev, "hdmi"); 1431 1431 /* Take hdmi out of reset */ 1432 1432 if (!IS_ERR(hdmi->reset)) ··· 1450 1442 { 1451 1443 struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); 1452 1444 1445 + cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID); 1446 + 1453 1447 i2c_put_adapter(hdmi->ddc_adapt); 1454 1448 if (hdmi->audio_pdev) 1455 1449 platform_device_unregister(hdmi->audio_pdev); 1456 1450 component_del(&pdev->dev, &sti_hdmi_ops); 1457 1451 1452 + cec_notifier_put(hdmi->notifier); 1458 1453 return 0; 1459 1454 } 1460 1455
+3
drivers/gpu/drm/sti/sti_hdmi.h
··· 11 11 #include <linux/platform_device.h> 12 12 13 13 #include <drm/drmP.h> 14 + #include <media/cec-notifier.h> 14 15 15 16 #define HDMI_STA 0x0010 16 17 #define HDMI_STA_DLL_LCK BIT(5) ··· 65 64 * @audio_pdev: ASoC hdmi-codec platform device 66 65 * @audio: hdmi audio parameters. 67 66 * @drm_connector: hdmi connector 67 + * @notifier: hotplug detect notifier 68 68 */ 69 69 struct sti_hdmi { 70 70 struct device dev; ··· 91 89 struct platform_device *audio_pdev; 92 90 struct hdmi_audio_params audio; 93 91 struct drm_connector *drm_connector; 92 + struct cec_notifier *notifier; 94 93 }; 95 94 96 95 u32 hdmi_read(struct sti_hdmi *hdmi, int offset);