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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AED6C433EF for ; Thu, 21 Jul 2022 08:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbiGUILo (ORCPT ); Thu, 21 Jul 2022 04:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbiGUILm (ORCPT ); Thu, 21 Jul 2022 04:11:42 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1269F785BA; Thu, 21 Jul 2022 01:11:41 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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