From 1b1219047e7633bb458fdcc92a3ff79739e81e22 Mon Sep 17 00:00:00 2001 From: Zongdong Jiao Date: Wed, 31 Jul 2019 15:30:56 +0800 Subject: [PATCH] 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 --- MAINTAINERS | 2 +- .../vout/hdmitx/hdmi_tx_20/hw/hdmi_tx_hw.c | 18 +++++++++++++ include/linux/amlogic/media/sound/hdmi_earc.h | 26 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 include/linux/amlogic/media/sound/hdmi_earc.h diff --git a/MAINTAINERS b/MAINTAINERS index d221b8a8f4c7..1cf49af04a0a 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 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 2dc690405d8c..b6ffa514dd29 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 #include "checksha.h" +#include 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 000000000000..97e30afe8ed5 --- /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