From patchwork Tue Oct 13 17:28:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11835697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62C3472D3 for ; Tue, 13 Oct 2020 18:11:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C25A625357 for ; Tue, 13 Oct 2020 17:30:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jQht/apn"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="F6Ukqv+8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C25A625357 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Xm5QZFJM3zYlSqAm3vgSQ1T+AzUEHeTE1JZBoAl5/Qg=; b=jQht/apnzkt0kh8zh8dvTCtFf7 qO17Ms36DAEa+mdhxpwX6dWnt6a8InCRZDh9mSSJ9X/iEvTMC0dlE5MfAbI5iG/3Ci2dfFTY0pxyg iF3EttlgofsQjjTkuFG0wGhCGmMj7vQfRWHzghgjG9NzGr6DOYzdxK7QhFbm0j2j6PbG5mu+5OUzV +nf7MVcVEnPgYFCDW9LaDcWaoUMeWqYycx3b00nGplAh0SDaJmIPxQiPl5V0HDHl1oMn1r6tGpyIO W0muS4s6Z5GUAYJNZ+Pi2PB4Lk98GXpQADLvVpNZk3riDKvi/3zXr9SVoYDVEsaZwzMEOq5HX+kcM 0jhJ32UQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSO6P-0003OR-21; Tue, 13 Oct 2020 17:28:45 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSO6L-0003N8-Lg for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 17:28:43 +0000 Received: by mail-wm1-x341.google.com with SMTP id f21so415390wml.3 for ; Tue, 13 Oct 2020 10:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jOUfisstoXGjLG7B1xLKFejULL7TZhQ40jOISFOxPnU=; b=F6Ukqv+8YI+sJda97ZCJUyO9hIVT8bLkuxZmx1fKqz/YgLrDO+H9aG9zIA5jBCUsST kZ2Ybdk/YtWdYxxD+zrP7wR7LLCUokfeRQ9bKGPeqkLbJ1adEKXZGF1aPhwwtIAWE5/y dehHYAl4t4o6PkqQTIqxSHzQs0JE1gT7aBAUbnSvvokWVTNQzdXRxm+WKysvNfPvuhGh dXOziZSHKBSFVk2uNwp+dF2U/Dcg0OHWMNCwN13Dcl2ytpY9l2I/HVpRlhyCvgFqqaYT baCEn9vhLBP0tXKqoKxjgxaPOabfFN6hXeMUS7m2gnPZqbScz/qwc/DcD0A9NMVui6aL 9KyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jOUfisstoXGjLG7B1xLKFejULL7TZhQ40jOISFOxPnU=; b=Egk48QG3urkgdvN1SLQTDHwYOuVpeTaBeNR6njCVGQxnHA2aZNXd/sFEZ93kDRSy6I pNvyuuTrXxeeLZMvgVaqGDsEB86yK+N5sace24IvYTnTw8B2crfGHEPJdatsoz36N89E v3Ke01XRtD0Lggh2TCEJBEwWIYK6+FVhJ5gOAeKXfOHKJs8/cBEoziEUVAc5ntFbdcyy d1IYhuVppAozS0yjwb/6qf+kVp45qwLC9qlVspIACULDULrKWY69qA+R/s6tiDbGGJiG /HjoQ3Q2d1Dmqm0WEtPEFXyI5lHyN19niQ9kAOYdmH3SU/IwsJOCjyHByCSMpIinx+sa cfeQ== X-Gm-Message-State: AOAM5324TTnhx6IL/8cnVfbnM5+brVYAADK9pOXbC4CMckZHMSn6zUyV 4/gUsccs29XAQmrS5msQcvuSdA== X-Google-Smtp-Source: ABdhPJyII7msKF/kt2LYUO+vOQnrtcFfBpDhNh+hbPbyCS1UAIQk+s29Sdhn/oxOJTnZrGXrPidf3A== X-Received: by 2002:a7b:c0c8:: with SMTP id s8mr906810wmh.78.1602610119013; Tue, 13 Oct 2020 10:28:39 -0700 (PDT) Received: from localhost.localdomain (26.165.185.81.rev.sfr.net. [81.185.165.26]) by smtp.gmail.com with ESMTPSA id c14sm315131wrv.12.2020.10.13.10.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 10:28:37 -0700 (PDT) From: Fabien Parent To: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/mediatek: mtk_hdmi: move 2 registers address into of_data Date: Tue, 13 Oct 2020 19:28:31 +0200 Message-Id: <20201013172832.4055545-1-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_132841_848078_679DE95E X-CRM114-Status: GOOD ( 16.93 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chunkuang.hu@kernel.org, daniel@ffwll.ch, airlied@linux.ie, Fabien Parent , p.zabel@pengutronix.de, matthias.bgg@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On MT8167, the two registers SYS_CFG1C and SYS_CFG20 don't have the same address as on MT8173. Add OF data in order to store the address of these two registers. Signed-off-by: Fabien Parent --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 45 ++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index a97725680d4e..c70f195c21be 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -36,6 +36,11 @@ #define NCTS_BYTES 7 +struct mtk_hdmi_data { + uint32_t sys_cfg1c; + uint32_t sys_cfg20; +}; + enum mtk_hdmi_clk_id { MTK_HDMI_CLK_HDMI_PIXEL, MTK_HDMI_CLK_HDMI_PLL, @@ -146,6 +151,7 @@ struct hdmi_audio_param { }; struct mtk_hdmi { + const struct mtk_hdmi_data *data; struct drm_bridge bridge; struct drm_bridge *next_bridge; struct drm_connector conn; @@ -244,21 +250,24 @@ static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable) */ if (hdmi_phy->conf && hdmi_phy->conf->tz_disabled) regmap_update_bits(hdmi->sys_regmap, - hdmi->sys_offset + HDMI_SYS_CFG20, + hdmi->sys_offset + hdmi->data->sys_cfg20, 0x80008005, enable ? 0x80000005 : 0x8000); else arm_smccc_smc(MTK_SIP_SET_AUTHORIZED_SECURE_REG, 0x14000904, 0x80000000, 0, 0, 0, 0, 0, &res); - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg20, HDMI_PCLK_FREE_RUN, enable ? HDMI_PCLK_FREE_RUN : 0); - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg1c, HDMI_ON | ANLG_ON, enable ? (HDMI_ON | ANLG_ON) : 0); } static void mtk_hdmi_hw_1p4_version_enable(struct mtk_hdmi *hdmi, bool enable) { - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg20, HDMI2P0_EN, enable ? 0 : HDMI2P0_EN); } @@ -274,12 +283,15 @@ static void mtk_hdmi_hw_aud_unmute(struct mtk_hdmi *hdmi) static void mtk_hdmi_hw_reset(struct mtk_hdmi *hdmi) { - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg1c, HDMI_RST, HDMI_RST); - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg1c, HDMI_RST, 0); mtk_hdmi_clear_bits(hdmi, GRL_CFG3, CFG3_CONTROL_PACKET_DELAY); - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG1C, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg1c, ANLG_ON, ANLG_ON); } @@ -362,16 +374,19 @@ static void mtk_hdmi_hw_send_aud_packet(struct mtk_hdmi *hdmi, bool enable) static void mtk_hdmi_hw_config_sys(struct mtk_hdmi *hdmi) { - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg20, HDMI_OUT_FIFO_EN | MHL_MODE_ON, 0); usleep_range(2000, 4000); - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg20, HDMI_OUT_FIFO_EN | MHL_MODE_ON, HDMI_OUT_FIFO_EN); } static void mtk_hdmi_hw_set_deep_color_mode(struct mtk_hdmi *hdmi) { - regmap_update_bits(hdmi->sys_regmap, hdmi->sys_offset + HDMI_SYS_CFG20, + regmap_update_bits(hdmi->sys_regmap, + hdmi->sys_offset + hdmi->data->sys_cfg20, DEEP_COLOR_MODE_MASK | DEEP_COLOR_EN, COLOR_8BIT_MODE); } @@ -1733,6 +1748,7 @@ static int mtk_drm_hdmi_probe(struct platform_device *pdev) return -ENOMEM; hdmi->dev = dev; + hdmi->conf = of_device_get_match_data(dev); ret = mtk_hdmi_dt_parse_pdata(hdmi, pdev); if (ret) @@ -1813,8 +1829,15 @@ static int mtk_hdmi_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(mtk_hdmi_pm_ops, mtk_hdmi_suspend, mtk_hdmi_resume); + +static struct mtk_hdmi_data mt8173_hdmi_driver_data = { + .sys_cfg1c = HDMI_SYS_CFG1C, + .sys_cfg20 = HDMI_SYS_CFG20, +}; + static const struct of_device_id mtk_drm_hdmi_of_ids[] = { - { .compatible = "mediatek,mt8173-hdmi", }, + { .compatible = "mediatek,mt8173-hdmi", + .data = &mt8173_hdmi_driver_data }, {} }; From patchwork Tue Oct 13 17:28:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11835707 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62CBD7349 for ; Tue, 13 Oct 2020 18:11:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C49D425358 for ; Tue, 13 Oct 2020 17:30:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KUv0TvNk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="D0TVrEyk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C49D425358 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fU+OE02HZKnneWFa4DTSF+ksoASm4EOmcUax5sM1HdA=; b=KUv0TvNkXdJ2G2CJke/thJ5Bm WZ2h1B7WxvgFFOBz6UWTp3wrVyltxNhnhWfqWPSjC56j7kHix+TGGdarve5DVyGD/jdgWioiEerB5 zAp9WPPpEFmuWtCZKXb5UDpejn+qYnn7yODRuQfIRON1NGG5zJv+JU2onqK562RPzgxKIA0YIUEsu lKEMo5o5r4LvDKOAutWmbEtq7LEmSG5wUBtJJTl4rGbG7+bdjSiYZ/g7beawhcRNGIYD8JujqZLt9 4gh6sxwpH3LIrmZKGXgpbe+nmXwrHlx1wzetHMng0Wpe45G5/ZPUrxsIGtgp6X+bUd0MDMiEmPduB WBZJolcyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSO6S-0003Pz-NB; Tue, 13 Oct 2020 17:28:48 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSO6L-0003ND-Ty for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 17:28:44 +0000 Received: by mail-wr1-x444.google.com with SMTP id b8so290773wrn.0 for ; Tue, 13 Oct 2020 10:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BlvyC7xO8X+UHJiYhKqKJwROYowmoGRyG38cye9lek4=; b=D0TVrEykWlhUm/bhD8ZKE0gqYKXdhzaQPwZnWz2KAvB+bJoSW4qWFnIWLlwPD8HqCV 07pjsS3ciagYi1TM74PzjqWI/LHA8n4Vmq2SVyVa3BLpXuDL+71kspidJi2ih8Qk1Nnx vV5/69FEsmRN85s9O9nXCt/zXoXMfuQYZHQDRYM2h1kdc8BVhudtr40OxORl1pVWBHdo Jz8N/i+sFqoHRircz4tWcKo4vXBbCZcpxY3+0byc28QSDoxEqtzXWJaA2Do1uYYWNGks 6rkMAECv++08P5bTNC6qU3aVYzM2+NnF2RC2mWfhlX1oFGVsit5GA6/PTwhZRBfMi+Jg EFew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BlvyC7xO8X+UHJiYhKqKJwROYowmoGRyG38cye9lek4=; b=ouD7AZD6pTneMVyd5d/AF9w4qom9qdcm5iVa8rgSlgZmCI2G8EHzQitJx/tku5nfY9 AbO87oLRNPNTTmtKvy5cwn344GTHjrekKERI+HFFJvNQnYf93JrmR/OacuK40ouM+i3y FnyWLCFjlxBzoJ2fmytGzfMet9xbjDUrJDMe6k3YOy9k1f5xkEbP9NSdDN4m1LyzFOVh 6M++k2rLQuA6CpUR/ajWKMLG9oE6tEc+DfjqIWB+kCFh37NLABh2TBgde/At8mDGFIIN Umi7ATrydS0G/9J2bDY8wgnbpJ+E1ICgHJ5tyAJ+ZiyUH4jHm4LbE3sWkWkBZUN4yDts Jj8Q== X-Gm-Message-State: AOAM531ISSnSJ3d2sPuxS9/IBy1vY7+w06coHFoAK2vi0+iJ8jbmGShz n7dks5mYSgaineLXeh+Kuon1pkf6/pd7+87u X-Google-Smtp-Source: ABdhPJyqabbY0J2ewYDvY5SXI4bIKi5qYlD68/sg3m435CHU1JYk/TdfVENPchAt/0NsWUmXwDj2Xg== X-Received: by 2002:adf:80e4:: with SMTP id 91mr795643wrl.223.1602610120882; Tue, 13 Oct 2020 10:28:40 -0700 (PDT) Received: from localhost.localdomain (26.165.185.81.rev.sfr.net. [81.185.165.26]) by smtp.gmail.com with ESMTPSA id c14sm315131wrv.12.2020.10.13.10.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 10:28:40 -0700 (PDT) From: Fabien Parent To: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/mediatek: mtk_hdmi: add MT8167 support for HDMI Date: Tue, 13 Oct 2020 19:28:32 +0200 Message-Id: <20201013172832.4055545-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013172832.4055545-1-fparent@baylibre.com> References: <20201013172832.4055545-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201013_132842_021304_2989780E X-CRM114-Status: GOOD ( 15.08 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chunkuang.hu@kernel.org, daniel@ffwll.ch, airlied@linux.ie, Fabien Parent , p.zabel@pengutronix.de, matthias.bgg@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support for HDMI on MT8167. HDMI on MT8167 is similar to MT8173/MT2701 execpt for the two registers: SYS_CFG1C and SYS_CFG20 Signed-off-by: Fabien Parent --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 7 +++++++ drivers/gpu/drm/mediatek/mtk_hdmi_regs.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index c70f195c21be..7762be5cb446 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1835,9 +1835,16 @@ static struct mtk_hdmi_data mt8173_hdmi_driver_data = { .sys_cfg20 = HDMI_SYS_CFG20, }; +static struct mtk_hdmi_conf mt8167_hdmi_driver_data = { + .sys_cfg1c = MT8167_HDMI_SYS_CFG1C, + .sys_cfg20 = MT8167_HDMI_SYS_CFG20, +}; + static const struct of_device_id mtk_drm_hdmi_of_ids[] = { { .compatible = "mediatek,mt8173-hdmi", .data = &mt8173_hdmi_driver_data }, + { .compatible = "mediatek,mt8167-hdmi", + .data = &mt8167_hdmi_driver_data }, {} }; diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h b/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h index 2050ba45b23a..a0f9c367d7aa 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_regs.h @@ -195,6 +195,7 @@ #define GEN_RGB (0 << 7) #define HDMI_SYS_CFG1C 0x000 +#define MT8167_HDMI_SYS_CFG1C 0x800 #define HDMI_ON BIT(0) #define HDMI_RST BIT(1) #define ANLG_ON BIT(2) @@ -211,6 +212,7 @@ #define HTPLG_PIN_SEL_OFF BIT(30) #define AES_EFUSE_ENABLE BIT(31) #define HDMI_SYS_CFG20 0x004 +#define MT8167_HDMI_SYS_CFG20 0x804 #define DEEP_COLOR_MODE_MASK (3 << 1) #define COLOR_8BIT_MODE (0 << 1) #define COLOR_10BIT_MODE (1 << 1)