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 194BDC433F5 for ; Sat, 4 Dec 2021 13:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355038AbhLDNiO (ORCPT ); Sat, 4 Dec 2021 08:38:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbhLDNiN (ORCPT ); Sat, 4 Dec 2021 08:38:13 -0500 Received: from relay03.th.seeweb.it (relay03.th.seeweb.it [IPv6:2001:4b7a:2000:18::164]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5474EC061751; Sat, 4 Dec 2021 05:34:46 -0800 (PST) Received: from [192.168.1.101] (83.6.167.217.neoplus.adsl.tpnet.pl [83.6.167.217]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id B1BC320153; Sat, 4 Dec 2021 14:34:41 +0100 (CET) Message-ID: Date: Sat, 4 Dec 2021 14:34:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 1/3] thermal: qcom: lmh: Add support for sm8150 Content-Language: en-US To: Thara Gopinath , agross@kernel.org, bjorn.andersson@linaro.org, daniel.lezcano@linaro.org, rafael@kernel.org, rui.zhang@intel.com, robh+dt@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211202223802.382068-1-thara.gopinath@linaro.org> <20211202223802.382068-2-thara.gopinath@linaro.org> From: Konrad Dybcio In-Reply-To: <20211202223802.382068-2-thara.gopinath@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 02.12.2021 23:38, Thara Gopinath wrote: > Add compatible to support LMh for sm8150 SoC. > sm8150 does not require explicit enabling for various LMh subsystems. > Move this piece of code under condition that it is executed only > for sdm845 SoC. > > Signed-off-by: Thara Gopinath > --- > drivers/thermal/qcom/lmh.c | 61 ++++++++++++++++++++------------------ > 1 file changed, 32 insertions(+), 29 deletions(-) [...] > - return ret; > + if (of_device_is_compatible(np, "qcom,sdm845-lmh")) { > + if (!qcom_scm_lmh_dcvsh_available()) > + return -EINVAL; I don't believe this is the correct approach, as different SoCs may require different sequences of these writes (for example SDM660/MSM8998 seems to only enable the thermal algorithm), and there will (hopefully) be interest in adding LMH support for more platforms, so perhaps separating this somehow could keep this a bit cleaner and easier to work with for the next person.. Konrad