author | Zongdong Jiao <zongdong.jiao@amlogic.com> | 2019-07-31 07:30:56 (GMT) |
---|---|---|
committer | Zongdong Jiao <zongdong.jiao@amlogic.com> | 2019-07-31 07:30:56 (GMT) |
commit | 1b1219047e7633bb458fdcc92a3ff79739e81e22 (patch) | |
tree | 7a9b6cce041d90f4229050de8f2514a32d11d8c3 | |
parent | 04dfff2d98391d06b8dd98d92ad39bf993aa4a6c (diff) | |
download | common-1b1219047e7633bb458fdcc92a3ff79739e81e22.zip common-1b1219047e7633bb458fdcc92a3ff79739e81e22.tar.gz common-1b1219047e7633bb458fdcc92a3ff79739e81e22.tar.bz2 |
eARCrx: add hdmitx hpd notify [1/1]
PD#SWPL-6861
Problem:
Lack hdmitx hpd event notify to eARC
Solution:
Add hdmitx hpd event notify to eARC in HPD interrupt handler
w/o any delay.
Verify:
TBD
Change-Id: Ic7f35365a2af634dee604f7121d62738b4b17a8d
Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c | 18 | ||||
-rw-r--r-- | include/linux/amlogic/media/sound/hdmi_earc.h | 26 |
3 files changed, 45 insertions, 1 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index d221b8a..1cf49af 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15085,4 +15085,4 @@ F: drivers/amlogic/drm/meson_vpu.c AMLOGIC ADD DTS FOR T312 PLATFORM M: hualing chen <hualing.chen@amlogic.com> F: arch/arm64/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi -F: arch/arm/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi
\ No newline at end of file +F: arch/arm/boot/dts/amlogic/mesontm2_t962x3_t312-panel.dtsi diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c index 2dc6904..b6ffa51 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c @@ -47,6 +47,7 @@ #include "hw_clk.h" #include <linux/arm-smccc.h> #include "checksha.h" +#include <linux/amlogic/media/sound/hdmi_earc.h> static void mode420_half_horizontal_para(void); static void hdmi_phy_suspend(void); @@ -641,6 +642,20 @@ void HDMITX_Meson_Init(struct hdmitx_dev *hdev) hdev->HWOp.CntlMisc(hdev, MISC_AVMUTE_OP, CLR_AVMUTE); } +static void hdmitx_phy_bandgap_en(struct hdmitx_dev *hdev) +{ + switch (hdev->chip_type) { + case MESON_CPU_ID_TM2: + hd_write_reg(P_TM2_HHI_HDMI_PHY_CNTL0, 0x0b4242); + break; + case MESON_CPU_ID_SM1: + hd_write_reg(P_HHI_HDMI_PHY_CNTL0, 0x0b4242); + break; + default: + break; + } +} + static irqreturn_t intr_handler(int irq, void *dev) { /* get interrupt status */ @@ -670,6 +685,8 @@ static irqreturn_t intr_handler(int irq, void *dev) hdev->hdmitx_event |= HDMI_TX_HPD_PLUGIN; hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGOUT; hdev->rhpd_state = 1; + hdmitx_phy_bandgap_en(hdev); + earc_hdmitx_hpdst(1); queue_delayed_work(hdev->hdmi_wq, &hdev->work_hpd_plugin, HZ / 2); } @@ -678,6 +695,7 @@ static irqreturn_t intr_handler(int irq, void *dev) hdev->hdmitx_event |= HDMI_TX_HPD_PLUGOUT; hdev->hdmitx_event &= ~HDMI_TX_HPD_PLUGIN; hdev->rhpd_state = 0; + earc_hdmitx_hpdst(0); queue_delayed_work(hdev->hdmi_wq, &hdev->work_hpd_plugout, HZ / 20); } diff --git a/include/linux/amlogic/media/sound/hdmi_earc.h b/include/linux/amlogic/media/sound/hdmi_earc.h new file mode 100644 index 0000000..97e30af --- a/dev/null +++ b/include/linux/amlogic/media/sound/hdmi_earc.h @@ -0,0 +1,26 @@ +/* + * include/linux/amlogic/media/sound/hdmi_earc.h + * + * Copyright (C) 2017 Amlogic, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + */ + +#ifndef __HDMI_EARC_H__ +#define __HDMI_EARC_H__ + +extern void earc_hdmitx_hpdst(bool st); + +void earc_hdmitx_hpdst(bool st) +{ +}; +#endif |