From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 137C9C4332F for ; Mon, 7 Nov 2022 11:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r5VGI0yYZ7z5IzyXG1nbmvixbQOnNCoaimOSEccw37I=; b=HyMb3gWyVo8VPQ GmNIbkC4cfhxtVVaQ/rPcQxHpc2dHznw7SMHZaW1n0fTVTgR6j9KExfJgbQH1ZHL3/EgBP/struv8 KbeUCVoSpCZ3kBMLXDDS//bSj99+OZVgvKqITqcgpaarJ0c94x6TRdcUmB6uG8DtCmEqk6SFOtsRN EobBiKG4PyOeXwRF6j9QIrOQfgXaGSL0jqe+neaD0LejvX3wxnXx5f5qfD0IHVmrZM6lsZy/ZOBBy SoxKQZVGuMJqU95VkcyOKjbtvA+34q/rFruz18KLA8BsNwTwGBfyJps4Dn0LxmCpRTeDxnPZS/dkm 5omEYyAZ0mUr3Z7AzDUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os0BB-00E6rh-Pw; Mon, 07 Nov 2022 11:20:38 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os0Az-00E6m9-Vk; Mon, 07 Nov 2022 11:20:27 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id B6693660239F; Mon, 7 Nov 2022 11:20:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1667820024; bh=+5Huk55iq4Plx52+yZClp0DhD3oOu5tBVt54hs+t8xY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=G3lKnascRvbEDCDGxRQEXRx+38Te7xbje/SdqqKVMsWC+tpsomycebcMeFRhkpYFG GkR253l6CMfLGzU86DoQzcrSOfuNRwPm6vtOdzDr4rhEavDgoYcfV9ki/6MhNOonM9 PbnfEe7UHfHF/thyXAKD+zWjv+HSSIJ2cIMxjLjLHbZ/rYY4UrqjP8BbAJ8RGSH16k UI+YmFeCJ/hqa8gNRTkCisWSD7pC+HUu74kQSZd1YuI+Iu8rlKHWrSPQF4TvP+tBxt okiyNmzlEY4J7WpUOVoiOx7oWQcQh7blqSHEmuNJJf3Cv6+nDC3p+FO4CSidCB3pXm jmEqaCqSzyuWw== Message-ID: <05183178-32cb-98c0-4fcb-d5e78874e6c4@collabora.com> Date: Mon, 7 Nov 2022 12:20:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v3 03/12] drm/mediatek: hdmi: use a regmap instead of iomem Content-Language: en-US To: Guillaume Ranquet , Rob Herring , Chun-Kuang Hu , Chunfeng Yun , Jitao shi , Matthias Brugger , Vinod Koul , CK Hu , Daniel Vetter , David Airlie , Krzysztof Kozlowski , Philipp Zabel , Kishon Vijay Abraham I Cc: Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, stuart.lee@mediatek.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, mac.shen@mediatek.com, linux-phy@lists.infradead.org References: <20220919-v3-0-a803f2660127@baylibre.com> <20220919-v3-3-a803f2660127@baylibre.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220919-v3-3-a803f2660127@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_032026_196880_DE72D827 X-CRM114-Status: GOOD ( 16.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 04/11/22 15:09, Guillaume Ranquet ha scritto: > To prepare support for newer chips that need to share their address > range with a dedicated ddc driver, use a regmap. > > Signed-off-by: Guillaume Ranquet > --- > drivers/gpu/drm/mediatek/mtk_hdmi.c | 43 +++++++++++-------------------------- > 1 file changed, 13 insertions(+), 30 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 4c80b6896dc3..9b02b30a193a 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -171,7 +171,7 @@ struct mtk_hdmi { > u32 ibias_up; > struct regmap *sys_regmap; > unsigned int sys_offset; > - void __iomem *regs; > + struct regmap *regs; > enum hdmi_colorspace csp; > struct hdmi_audio_param aud_param; > bool audio_enable; > @@ -187,44 +187,29 @@ static inline struct mtk_hdmi *hdmi_ctx_from_bridge(struct drm_bridge *b) > return container_of(b, struct mtk_hdmi, bridge); > } > > -static u32 mtk_hdmi_read(struct mtk_hdmi *hdmi, u32 offset) > +static int mtk_hdmi_read(struct mtk_hdmi *hdmi, u32 offset, u32 *val) > { > - return readl(hdmi->regs + offset); > + return regmap_read(hdmi->regs, offset, val); > } > > static void mtk_hdmi_write(struct mtk_hdmi *hdmi, u32 offset, u32 val) > { > - writel(val, hdmi->regs + offset); > + regmap_write(hdmi->regs, offset, val); > } > > static void mtk_hdmi_clear_bits(struct mtk_hdmi *hdmi, u32 offset, u32 bits) You don't need these functions anymore, as these are now simply wrapping regmap calls, hence these don't contain any "real" logic anymore. Please remove them and use the regmap API directly. Thanks, Angelo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel