Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3685690rwp; Sat, 15 Jul 2023 07:30:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVKqTRVdWF0a+mocWhTW8a9qtJOm75h5mCLZLX8CTU7E94LghEobcxME8i+3Snscq/QEha X-Received: by 2002:a17:907:908d:b0:98e:f13:e908 with SMTP id ge13-20020a170907908d00b0098e0f13e908mr6462338ejb.60.1689431432961; Sat, 15 Jul 2023 07:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689431432; cv=none; d=google.com; s=arc-20160816; b=tHDbzMv4+cabdia7aWWOb+YhB1qLvzjMQCbUzyv8jTjB6TCzEfAwZzEf5RX3cYz8y6 oreGjzX/MyNLu082ed27bBZROZnriMqGMemK2W7zDtRwr07zbtsAeXSHMX4vszIhDKlJ NqIhqJyrzE4nhhRWRhjgC7/sn78qUF0wvUghDVRSazJBhP3ILNXn61uA5rUsB3l06cVd qewCO37Mm8179cWo9w30R4X3ykcbgZNkgDWctVfWEh/+wFdrXKdbmPeOsqJy0O8PMnKK qWrrkxX+Qm02KuJqFoj3alehNAF55dmxYZ7t4QQAFB08S41VImTjjT+8LfiN6rDvusqS c+5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6/oofZQPgGTrFm/xFNaCXYysHJE6rz/K210kWzBmMEo=; fh=e/FTZnpiyUk3I5x46ML6eZW2ds1TH1MzvdaOeDzYXSk=; b=g93PdQW2FMjTzdCIgz2eSjeDxltW10oU8tsb8KIjIG0ps2hAwIbFYyTDZhN2PPvaDY lEGEHt9pHfH4XXAulQmVaRYxzB2+9BwbvRdp01JQqb3ajFciOoSVvShwcf9q2eX7xHM5 TcyzMiNZrkG98TlK7NnBZ1BfIxx6kWSJtmu/kqsitIZXpF/XPIb1Epe8C/By1xdx2G0L 9ci2eS74GgLumS0eeDK8QhzknwCCPtCTyVlK0jbmx6mwptQ4OOo5sK3uDCiSDfybVfpc eiKKeCPRaMo/pGHUuI++KH28VUkig2nj9sWZpqyeH4ALz+3DNvCh4DpEEG7ThU3PhZGl b8Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kScAPAkO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a1709066b9400b00992e0e54464si11239194ejr.254.2023.07.15.07.30.09; Sat, 15 Jul 2023 07:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kScAPAkO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbjGOOGo (ORCPT + 99 others); Sat, 15 Jul 2023 10:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbjGOOGm (ORCPT ); Sat, 15 Jul 2023 10:06:42 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27F3C3586 for ; Sat, 15 Jul 2023 07:06:40 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b933bbd3eeso5197961fa.1 for ; Sat, 15 Jul 2023 07:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689429998; x=1692021998; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6/oofZQPgGTrFm/xFNaCXYysHJE6rz/K210kWzBmMEo=; b=kScAPAkOrbs0cNL+KxnjWOLdaO/mPqHzA+sHslTQlpCjMvTNqZORsHtDzp8WUPt3OH bRsA8n41U01Tb/WWT6ruNe+f8Sa/3Gxr2geM588t33JOLYji+xcMkTL3VPofC07zozZI YMbyqrDlJkbV28eCpWuy2w7tcUNChEkLPGVJ9EBy3mr7MRsL0BKJ2UctnWzUZwkeaTY1 NZMONWOZBYDvNqke55iPzYRPJohp+fftnfYmtoS2nnNP9EXRrzmx7l/FVUyHJr46TFYl w4LVROATLDsbPKqfd2EokLOh95m9tde0vPAGpRp6iNzETaRiJi8BmRomYLjVM1XtHNEL ym5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689429998; x=1692021998; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6/oofZQPgGTrFm/xFNaCXYysHJE6rz/K210kWzBmMEo=; b=fxn565PvLTYJSjqX2zmt0RK2AAk8AZc2LXm8rQLMN1wrVsyZFahE497Us7AUK3xo0Y CYHLlFuAllcf/a7fXpBvqYLksw0HW/rFGQiw8ZqrEJ6eMVLYMYm14TQJLM7TQMpA+mA9 o+2RnpnWgBX6RXklhyMyCS8treDV1xgvmNZirUvwM28G9xsvupr1rIovSlkFfaWpy0Iv ZUmsze93fDGKZgdOiByuCvPzxfvs2JYRIXokn+xflRImu5OoGXNMsoqqQN8t8cr4rrBo LVCxn8NmHRChFuwprjqgbihIC2SAsUm9AsyTHjZsOZrZojFRPrHGvxZZvNguabMKe32l pY2w== X-Gm-Message-State: ABy/qLbkQ/MAkJMaT3faIqMITZ05PYDQPjmrk18tTeM3n/rsJoHDggcO jAWvoG/ubb57tLuuNhQl4W14VA== X-Received: by 2002:a19:5016:0:b0:4f7:3ee8:eede with SMTP id e22-20020a195016000000b004f73ee8eedemr6416135lfb.61.1689429998294; Sat, 15 Jul 2023 07:06:38 -0700 (PDT) Received: from [192.168.1.101] (abxi167.neoplus.adsl.tpnet.pl. [83.9.2.167]) by smtp.gmail.com with ESMTPSA id a13-20020ac2520d000000b004fb78984592sm1904245lfl.172.2023.07.15.07.06.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jul 2023 07:06:37 -0700 (PDT) Message-ID: Date: Sat, 15 Jul 2023 16:06:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 5/5] thermal/drivers/tsens: Add IPQ5332 support Content-Language: en-US To: Praveenkumar I , amitk@kernel.org, thara.gopinath@gmail.com, agross@kernel.org, andersson@kernel.org, rafael@kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: quic_varada@quicinc.com References: <20230713052732.787853-1-quic_ipkumar@quicinc.com> <20230713052732.787853-6-quic_ipkumar@quicinc.com> From: Konrad Dybcio In-Reply-To: <20230713052732.787853-6-quic_ipkumar@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.07.2023 07:27, Praveenkumar I wrote: > IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt. > It does not have RPM and kernel needs to take care of sensor > enablement, calibration. Hence introduced new feature_config, > ops and data for IPQ5332. > > Signed-off-by: Praveenkumar I > --- > [v3]: > No changes. > [v2]: > Added tsens_features for ipq5332 with VER_2_X_NO_RPM. Used > hw_ids to mention the available sensors. Dropped v2 in > ops_ipq5332. > > drivers/thermal/qcom/tsens-v2.c | 25 +++++++++++++++++++++++++ > drivers/thermal/qcom/tsens.c | 3 +++ > drivers/thermal/qcom/tsens.h | 2 +- > 3 files changed, 29 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c > index 781595a9a622..e25d9d34e519 100644 > --- a/drivers/thermal/qcom/tsens-v2.c > +++ b/drivers/thermal/qcom/tsens-v2.c > @@ -62,6 +62,17 @@ static struct tsens_features ipq8074_feat = { > .trip_max_temp = 204000, > }; > > +static struct tsens_features ipq5332_feat = { > + .ver_major = VER_2_X_NO_RPM, > + .crit_int = 1, > + .combo_int = 1, > + .adc = 0, > + .srot_split = 1, > + .max_sensors = 16, > + .trip_min_temp = 0, > + .trip_max_temp = 204000, 204 degrees Celcius? Konrad > +}; > + > static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = { > /* ----- SROT ------ */ > /* VERSION */ > @@ -262,6 +273,20 @@ struct tsens_plat_data data_ipq8074 = { > .fields = tsens_v2_regfields, > }; > > +static const struct tsens_ops ops_ipq5332 = { > + .init = init_tsens_v2_no_rpm, > + .get_temp = get_temp_tsens_valid, > + .calibrate = tsens_v2_calibration, > +}; > + > +struct tsens_plat_data data_ipq5332 = { > + .num_sensors = 5, > + .ops = &ops_ipq5332, > + .hw_ids = (unsigned int []){11, 12, 13, 14, 15}, > + .feat = &ipq5332_feat, > + .fields = tsens_v2_regfields, > +}; > + > /* Kept around for backward compatibility with old msm8996.dtsi */ > struct tsens_plat_data data_8996 = { > .num_sensors = 13, > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index 9dc0c2150948..af58a94628a8 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -1106,6 +1106,9 @@ static const struct of_device_id tsens_table[] = { > }, { > .compatible = "qcom,ipq8074-tsens", > .data = &data_ipq8074, > + }, { > + .compatible = "qcom,ipq5332-tsens", > + .data = &data_ipq5332, > }, { > .compatible = "qcom,mdm9607-tsens", > .data = &data_9607, > diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h > index b2e8f0f2b466..1dde363914cd 100644 > --- a/drivers/thermal/qcom/tsens.h > +++ b/drivers/thermal/qcom/tsens.h > @@ -648,6 +648,6 @@ extern struct tsens_plat_data data_8226, data_8909, data_8916, data_8939, data_8 > extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; > > /* TSENS v2 targets */ > -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; > +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, data_tsens_v2; > > #endif /* __QCOM_TSENS_H__ */