From d54ab561f04b9276d8734b90e23e525120530962 Mon Sep 17 00:00:00 2001 From: Tatenda Chipeperekwa Date: Thu, 25 Aug 2016 18:54:02 -0700 Subject: [PATCH 1/2] msm: mdss: remove unused APIs from external display header Remove unused APIs from the external display header while retaining the hdmi audio codec registration API for backward compatibility. Change-Id: I62e8d8810280fd42e1db1769ab95be877dc536ed CRs-Fixed: 1009284 Signed-off-by: Tatenda Chipeperekwa --- drivers/video/fbdev/msm/mdss_hdmi_tx.c | 22 --------- drivers/video/fbdev/msm/msm_ext_display.c | 6 +++ include/linux/msm_ext_display.h | 55 +++-------------------- 3 files changed, 13 insertions(+), 70 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index 3b4bc8acdd10..4c36fc226fd7 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -2971,28 +2971,6 @@ static int hdmi_tx_get_cable_status(struct platform_device *pdev, u32 vote) return hpd; } -int msm_hdmi_register_audio_codec(struct platform_device *pdev, - struct msm_ext_disp_audio_codec_ops *ops) -{ - struct hdmi_tx_ctrl *hdmi_ctrl = platform_get_drvdata(pdev); - int ret = 0; - - if (!hdmi_ctrl || !ops) { - DEV_ERR("%s: invalid input\n", __func__); - return -EPROBE_DEFER; - } - - ret = msm_ext_disp_register_audio_codec(hdmi_ctrl->ext_pdev, ops); - if (ret) { - pr_err("%s: failed to register codec\n", __func__); - goto end; - } - -end: - return ret; -} /* hdmi_tx_audio_register */ -EXPORT_SYMBOL(msm_hdmi_register_audio_codec); - static int hdmi_tx_setup_tmds_clk_rate(struct hdmi_tx_ctrl *hdmi_ctrl) { u32 rate = 0; diff --git a/drivers/video/fbdev/msm/msm_ext_display.c b/drivers/video/fbdev/msm/msm_ext_display.c index 903cab1ac059..e229f52057d4 100644 --- a/drivers/video/fbdev/msm/msm_ext_display.c +++ b/drivers/video/fbdev/msm/msm_ext_display.c @@ -636,6 +636,12 @@ end: return ret; } +int msm_hdmi_register_audio_codec(struct platform_device *pdev, + struct msm_ext_disp_audio_codec_ops *ops) +{ + return msm_ext_disp_register_audio_codec(pdev, ops); +} + int msm_ext_disp_register_audio_codec(struct platform_device *pdev, struct msm_ext_disp_audio_codec_ops *ops) { diff --git a/include/linux/msm_ext_display.h b/include/linux/msm_ext_display.h index 54c99d9cb245..873a778d5370 100644 --- a/include/linux/msm_ext_display.h +++ b/include/linux/msm_ext_display.h @@ -132,6 +132,13 @@ struct msm_ext_disp_init_data { int msm_ext_disp_register_audio_codec(struct platform_device *pdev, struct msm_ext_disp_audio_codec_ops *ops); +/* + * msm_hdmi_register_audio_codec() - wrapper for hdmi audio codec registration + * @pdev: platform device pointer + * @codec_ops: audio codec operations + */ +int msm_hdmi_register_audio_codec(struct platform_device *pdev, + struct msm_ext_disp_audio_codec_ops *ops); /* * msm_ext_disp_register_intf() - display interface registration * @init_data: data needed to register the display interface @@ -139,52 +146,4 @@ int msm_ext_disp_register_audio_codec(struct platform_device *pdev, int msm_ext_disp_register_intf(struct platform_device *pdev, struct msm_ext_disp_init_data *init_data); -/* TODO: remove all the display specific functions below */ -#ifdef CONFIG_FB_MSM_MDSS_DP_PANEL -int msm_dp_register_audio_codec(struct platform_device *pdev, - struct msm_ext_disp_audio_codec_ops *ops); - -#else -static inline int msm_dp_register_audio_codec(struct platform_device *pdev, - struct msm_ext_disp_audio_codec_ops *ops) { - return 0; -} -#endif /* CONFIG_FB_MSM_MDSS_DP_PANEL */ -#ifdef CONFIG_FB_MSM_MDSS_HDMI_PANEL -/* - * Register for HDMI cable connect or disconnect notification. - * @param handler callback handler for notification - * @return negative value as error otherwise current status of cable - */ -int register_hdmi_cable_notification( - struct ext_disp_cable_notify *handler); - -/* - * Un-register for HDMI cable connect or disconnect notification. - * @param handler callback handler for notification - * @return negative value as error - */ -int unregister_hdmi_cable_notification( - struct ext_disp_cable_notify *handler); - -int msm_hdmi_register_audio_codec(struct platform_device *pdev, - struct msm_ext_disp_audio_codec_ops *ops); - -#else -static inline int register_hdmi_cable_notification( - struct ext_disp_cable_notify *handler) { - return 0; -} - -static inline int unregister_hdmi_cable_notification( - struct ext_disp_cable_notify *handler) { - return 0; -} - -static inline int msm_hdmi_register_audio_codec(struct platform_device *pdev, - struct msm_ext_disp_audio_codec_ops *ops) { - return 0; -} -#endif /* CONFIG_FB_MSM_MDSS_HDMI_PANEL */ - #endif /*_MSM_EXT_DISPLAY_H_*/ From fb5a1b12767548c57674d4c039aba8e42fbc834b Mon Sep 17 00:00:00 2001 From: Tatenda Chipeperekwa Date: Thu, 25 Aug 2016 17:20:38 -0700 Subject: [PATCH 2/2] ARM: dts: msm: add audio codec as child of MSM External display Add the audio codec as a child node of the MSM External display node. The audio codec probe will happen after the External display probe, and will allow the audio codec to register with the External display independently of the display interface(s) that will the added after a hotplug event. Change-Id: I481e475ceff2ea0a07a0dfc4083526982674954c CRs-Fixed: 1009284 Signed-off-by: Tatenda Chipeperekwa --- arch/arm/boot/dts/qcom/msmcobalt-mdss.dtsi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/boot/dts/qcom/msmcobalt-mdss.dtsi b/arch/arm/boot/dts/qcom/msmcobalt-mdss.dtsi index 6025d9b54351..5c0974bb234b 100644 --- a/arch/arm/boot/dts/qcom/msmcobalt-mdss.dtsi +++ b/arch/arm/boot/dts/qcom/msmcobalt-mdss.dtsi @@ -445,6 +445,14 @@ qcom,mdss-fb-map = <&mdss_fb1>; }; + msm_ext_disp: qcom,msm_ext_disp { + compatible = "qcom,msm-ext-disp"; + + hdmi_audio: qcom,msm-hdmi-audio-rx { + compatible = "qcom,msm-hdmi-audio-codec-rx"; + }; + }; + mdss_dp_ctrl: qcom,dp_ctrl@c990000 { cell-index = <0>; compatible = "qcom,mdss-dp"; @@ -477,6 +485,8 @@ qcom,dp-usbpd-detection = <&pmicobalt_pdphy>; + qcom,msm_ext_disp = <&msm_ext_disp>; + qcom,core-supply-entries { #address-cells = <1>; #size-cells = <0>; @@ -589,10 +599,6 @@ }; }; - msm_ext_disp: qcom,msm_ext_disp { - compatible = "qcom,msm-ext-disp"; - }; - mdss_hdmi_tx: qcom,hdmi_tx@c9a0000 { cell-index = <0>; compatible = "qcom,hdmi-tx"; @@ -625,10 +631,6 @@ qcom,mdss-fb-map = <&mdss_fb2>; qcom,pluggable; - - hdmi_audio: qcom,msm-hdmi-audio-rx { - compatible = "qcom,msm-hdmi-audio-codec-rx"; - }; }; };