From patchwork Tue Oct 13 18:19:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11836037 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 801FE1130 for ; Tue, 13 Oct 2020 18:19: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 0F961208D5 for ; Tue, 13 Oct 2020 18:19:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FhfmsopY"; 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="BdRLGXOL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F961208D5 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=7kWC0EwY4OGQtecMSsbKGEVdIqYcO0XU2QMoAR0XqmY=; b=FhfmsopYTn5jMT8kcR8zxXD0Sl BHdXri+kBlgNYwdtgNtar+6eNgQvy3sIJbIyKpHU0eeaa6XTbE4ryoZKpMjpOVBLQom/AeGsEIiak qxz/evrcjfC0oJqvJTrmpfQlMTC8UH1tZpmKXf11KFwf4HD6idWUP+pv40zf4XyY4LskLh5bZHFLl pb4ZCLxlPMrMAy1JtAAHver4ErU+ZWcx5uDASE7SlzIJXJ6fWxFFOticE9reT8etw325HMW6a15Ti uRX1JsPtA35y9HX1DKHI4ZMu/ukdrL3s7FCorFIQ+Pmf6eS5XUJ49OmAOzWvT03s+24PAT2lDI5Gh Rh/kAjZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSOtc-000068-9B; Tue, 13 Oct 2020 18:19:36 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSOtY-00005A-VJ for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 18:19:34 +0000 Received: by mail-wr1-x441.google.com with SMTP id h5so445553wrv.7 for ; Tue, 13 Oct 2020 11:19:32 -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=X/7tcaBSc33elA/rgEtQckaex9Y37TpIvbkMTYD15FQ=; b=BdRLGXOLVtwcCJKHFN6LI1uz2W2nHnSEpCRh+ZLlcat9mhHmZBiIXd63grxdiihmc9 Rzl1CP6E+6aF19o6YBDWhZf/F8Yig576Lp+0GwWRASCYZYeOVhcmkfVj+X/AiupkBRKO i/T9O4iECcpZjmChTnGsLJffcGbey9NzagrQMSmFVRha8gYIGw8CIXj/P7lRuaGx9l1V N2SRv/sgeRwFCwTY2Z/nfzHekT9VbSn9GuvkYPslkZUAfv/zXsq3A8BKYbBNLt3yymXk bLpzabmAzwfd4pL/T4eaWHhJJBw9a/YeyOJ9Pn5/Itc79u9DvzTG5/k9FC0gnQp4gZMY V9Tw== 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=X/7tcaBSc33elA/rgEtQckaex9Y37TpIvbkMTYD15FQ=; b=ekWOW3Q02e0tK4PzjEt/kU9+k/S+JsOvszVB6bEoYC8HYGv3+pqQmezzeNuW8xXxzT b3u6ZBw57NX2PC55mtrHfytEcsKk54YDqF65p2Vgq+NCsGpNkErpjeNfzKFV9oOm5noO sivlF2ThF6TGwPIfpv6DLrqdq3KhB3usFrCTNr422V4c/DMHcIebYnelzzyCO++JTi0n kLSl/+B7ClDm0XXtbzSpHn+0+5jCg/Hoq3htMVRslkNxymOXDTi4/eTewaJo8ROtMUQx yCAW6pejZkmGr7TX5IOG8daXmDPJ1OdWeXZAVjHxALN8W9MGEBoVYq6R8wnIXCdBpNF8 NsYg== X-Gm-Message-State: AOAM532ssosyoy8R52RJAc3z6ZeZ+HNXejUEwYdUczHk03AmW1q6B8NQ ep1HSiEibNKOSomkjZhC+yufUQ== X-Google-Smtp-Source: ABdhPJxZZitZjRw01kW+dkf7x7AY+4r6rKZrX9DRFpRSi9rssDlZuRg60T6qu6WkP0UpWaKM8+Gvuw== X-Received: by 2002:adf:e88a:: with SMTP id d10mr1075084wrm.247.1602613171397; Tue, 13 Oct 2020 11:19:31 -0700 (PDT) Received: from localhost.localdomain (26.165.185.81.rev.sfr.net. [81.185.165.26]) by smtp.gmail.com with ESMTPSA id w11sm490261wrs.26.2020.10.13.11.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 11:19:30 -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 v2 1/2] drm/mediatek: mtk_hdmi: move 2 registers address into of_data Date: Tue, 13 Oct 2020 20:19:23 +0200 Message-Id: <20201013181924.4143303-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_141933_023229_A4876498 X-CRM114-Status: GOOD ( 17.14 ) 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:441 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 --- Changelog: v2: no changes 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..57370c036497 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->data = 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 18:19:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11836039 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 998301130 for ; Tue, 13 Oct 2020 18:19:52 +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 69AFB208D5 for ; Tue, 13 Oct 2020 18:19:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JOiP6dpN"; 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="XaJ/M1ab" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69AFB208D5 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=i5/dmUokZHBmR5vaAmmqd3VLHTuWxUh/YVwBg4VEAGw=; b=JOiP6dpNk1lMYhkn3IFfiPHn4 bGHgKm6Rxofy8kQVAcbQALAlci6UbTRxwaVjRQzYnbKj/n58bBm9Qc/7Qz1Ebg20yQQdm7r7qJvV3 kEsAm64BN9BqQeTZe89E8bMXwWrWGZhtJwUuTPLE3CfPSr1nwjMcVxHU61i1jhcr5CiWL3gLRYKk0 IqMOHR+b7r7A9zg/GDr3PHYeRFDqZFTOckWodqeDS55xeo95Iohfk+LOjDMJet31eFtrjmEsPm6EM GwntzcYxY+KgPGbchOHtQ3TLij0/ikSVv7RPLzktk7Wt2bLEG/THuLq8m3bYI1Wcph0oUMRYdixSB UXOMfwing==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSOth-00007v-Kj; Tue, 13 Oct 2020 18:19:41 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSOte-00006Z-7b for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2020 18:19:39 +0000 Received: by mail-wr1-x441.google.com with SMTP id e18so427384wrw.9 for ; Tue, 13 Oct 2020 11:19:38 -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=DtmadPtoPcokiIT8ReATg1pXkhzL2SuRBo5LddIMSVk=; b=XaJ/M1ab0sb3wmangM5YA2nqcNI4cEEK4J6J89RdjZa7KK4sbY6rvX6VV/uDqCY7eO BprKBVKFXAG30XVHwS7YwvDUaWfw0dXOKYgetZjYxpT/n+Ia5D7O55KZihuxApT5Pyki sbzNbcI3uvDJ1ZBR/KYTICZUnQS/SlRcHS2ZEM/N2HSx665DzSjuHKS7vc8cWnrAYct8 SbiI2gfLvKdP5sLgqQkcgjoxbuFtBm2XSjhdOeuz/kSJa1/HQIiF84fRT+s+N35dz+dn Bl/jOSnjWmGuofs/y0yw1TpV3mHyL/6vgt+zExdqElnlh3fGLf8nFLMl9Vf6SuTYbn3h SIqQ== 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=DtmadPtoPcokiIT8ReATg1pXkhzL2SuRBo5LddIMSVk=; b=sY8e8ACMrIgjzB++Ob0wNUk1+25GCDTyY6+CEsvsQoyOYWDwtOJPYl25j24mGWf6+V unzyzBBMlKckAfUW6OsGU5s6ugGbHGLG/1grZRSS4g3S/9yv/kO2+utPYP6yczK9MJH3 aZAZFpvQwWhXU1iLQymAaldPkv/S2HZPH51I9Rtqei+chxi8qs8bTGDaZhoiRM0z4ix1 EWKy265JzjCNBVVWw/dQoqUsWdTXKeSXDROLa655kCYZjtcjmpAhHMOefjyXHFl90Ln5 V+B7UPOcJ4dDjmiBMyHD9/8mR7Ogn4B3iIgAW9MwtzXsvLCG11UuMm2mRIOjgzz/9phN upsA== X-Gm-Message-State: AOAM5331URe3fmSGeUy/hyDh+NovXnx2DLQHjBlnpqbhsSsAcc4DWgI+ ChLKIHinnblfsW3TZV6L3rAM+V7nN0OSL10O X-Google-Smtp-Source: ABdhPJyYKFgxPBtvreY/bLMuxhTn3K88Do7E39RQO4MJweOu72cwzI7cuyOtwYsoYixEPS6WFk3dGg== X-Received: by 2002:adf:8541:: with SMTP id 59mr1042100wrh.61.1602613177428; Tue, 13 Oct 2020 11:19:37 -0700 (PDT) Received: from localhost.localdomain (26.165.185.81.rev.sfr.net. [81.185.165.26]) by smtp.gmail.com with ESMTPSA id w11sm490261wrs.26.2020.10.13.11.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 11:19:36 -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 v2 2/2] drm/mediatek: mtk_hdmi: add MT8167 support for HDMI Date: Tue, 13 Oct 2020 20:19:24 +0200 Message-Id: <20201013181924.4143303-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013181924.4143303-1-fparent@baylibre.com> References: <20201013181924.4143303-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_141938_327825_845473B9 X-CRM114-Status: GOOD ( 15.34 ) 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:441 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 --- Changelog: v2: fix name of pdata structure 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 57370c036497..484ea9cd654a 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_data 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)