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 7F90BC43334 for ; Thu, 21 Jul 2022 08:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=QwLZZ0hyDmcD40HAZ5nt7T3vLyG2pn9yEHiT+r4FQ20=; b=ao6dLozNBp0WZfX5m8pU/GcnR1 qI6Lwqu4hRoiWWTzEFEkfub3LJD79nVwJ85y0xhL+Iidk6iJW70rhqAsIL1LoWVH1SwlZMvjkKeLv DzemE2ioDXj4z9+9zAxHYEhhChfeChgBUpu/wE9aXw+MQ9WZB30eajHnhvZUM9nMrqKqy+fa8ORHG v5FWwkAPf1kMSsgv+li/A/wcyB8vh1WXXkhfP/giLvjcRzXWkwWzP7SagT+gXAv9Z6YUhmsVbsYz/ f7x9FyBucYVTO04LZp0paygdOX6IbcaJRAKmA2lcFdgl0cWXQrfh7MQcCELMRDNEQav+h8sc+f6WF nR/lHGig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oERHm-002JPa-QN; Thu, 21 Jul 2022 08:11:54 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oERHa-002JGC-M4; Thu, 21 Jul 2022 08:11:44 +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 06DF566019C1; Thu, 21 Jul 2022 09:11:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1658391099; bh=SJisIOXjYiUbIUddCNuNcj76WFqgshgEYwzoNjpp4Oc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=erhMGGDJFWDxnTZiWNNBmANaV8+g4O1yT65ICZCm02keCwYCMTNsEPWnQ47JQ+0VO uI5nVl+kTaYJu6qU34k1Zo7rDvuCh/X4uqmaAdVm0GuLH/cJ9VGtNqsjd2xsoqF7qf WDVl0lWMlNLHei+CvbnfqMkAM2OWEChDmNv14O7WoBx25aIDOp6CZ9uv5ukbM1tpxC CbD//WX+kbQBe2dMLVUAoGZbioDAL60QzgY88HXI53ayCZGw0a8KI6Zl4Qk3uZsgV4 buurn/kmQouwX4ZuL2TS+5DmO8PsE1Xg90vp62CMuARp0vp/zJE4GOU9zGqQOxgHcO 6nSmwZpr0jx6w== Message-ID: Date: Thu, 21 Jul 2022 10:11:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 3/4] thermal: mediatek: control buffer enablement tweaks Content-Language: en-US To: Amjad Ouled-Ameur , matthias.bgg@gmail.com Cc: rafael@kernel.org, fparent@baylibre.com, amitk@kernel.org, daniel.lezcano@linaro.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, robh+dt@kernel.org, rui.zhang@intel.com, Markus Schneider-Pargmann References: <20220720181854.547881-1-aouledameur@baylibre.com> <20220720181854.547881-4-aouledameur@baylibre.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220720181854.547881-4-aouledameur@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220721_011142_886305_4CF0C02D X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 20/07/22 20:18, Amjad Ouled-Ameur ha scritto: > From: Markus Schneider-Pargmann > > Add logic in order to be able to turn on the control buffer on MT8365. > This change now allows to have control buffer support for MTK_THERMAL_V1, > and it allows to define the register offset, and mask used to enable it. > > Signed-off-by: Markus Schneider-Pargmann > Signed-off-by: Fabien Parent > Reviewed-by: Amjad Ouled-Ameur > Tested-by: Amjad Ouled-Ameur > --- > drivers/thermal/mtk_thermal.c | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > > diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c > index 216eb0d61c5b..1dc276f8c4f1 100644 > --- a/drivers/thermal/mtk_thermal.c > +++ b/drivers/thermal/mtk_thermal.c > @@ -283,6 +283,9 @@ struct mtk_thermal_data { > bool need_switch_bank; > struct thermal_bank_cfg bank_data[MAX_NUM_ZONES]; > enum mtk_thermal_version version; > + u32 apmixed_buffer_ctl_reg; > + u32 apmixed_buffer_ctl_mask; > + u32 apmixed_buffer_ctl_set; > }; > > struct mtk_thermal { > @@ -578,6 +581,9 @@ static const struct mtk_thermal_data mt7622_thermal_data = { > .adcpnp = mt7622_adcpnp, > .sensor_mux_values = mt7622_mux_values, > .version = MTK_THERMAL_V2, > + .apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1, > + .apmixed_buffer_ctl_mask = ~0x37, This is effectively GENMASK(31, 6) | BIT(3) :-) > + .apmixed_buffer_ctl_set = 0x1, ...and this is BIT(0) > }; > > /* > @@ -1031,14 +1037,18 @@ static const struct of_device_id mtk_thermal_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, mtk_thermal_of_match); > > -static void mtk_thermal_turn_on_buffer(void __iomem *apmixed_base) > +static void mtk_thermal_turn_on_buffer(struct mtk_thermal *mt, > + void __iomem *apmixed_base) > { > int tmp; Since you're practically restructuring this function, please fix this wrong variable type, as this should be a u32. Regards, Angelo