Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35210446rwd; Mon, 10 Jul 2023 04:22:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlHe9fxLnQP0nynE36IFelMw74rMYcnK5mWfbTPAuxgUjndsam5SzfyMzhWsB+kcd5AgAC7p X-Received: by 2002:a17:906:c152:b0:974:fb94:8067 with SMTP id dp18-20020a170906c15200b00974fb948067mr15621304ejc.23.1688988179731; Mon, 10 Jul 2023 04:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688988179; cv=none; d=google.com; s=arc-20160816; b=U6ktnAjvyWz/1lmOLzxO0qO+LyO7p5+2JYPBcN7/vrZysq/djE7Mmb6MBlImrzCGIT Ua9ZNew54KFDNpw7FioOr4v2F/VXc4Wzr63Z7Z54BtRN0ZeoFtMuapCarzHNjf1752AT Lea+8bV+C1QfKdwXUD4gWwtGGLoJaOyXRPyMGX9PskkipluV9V3AJ/gwfxddScU5bywI fshfdenq7tTyYDQeJi3CpCVpjhybQhhrWus+nUlc6rn/3h1S7eEQ21ls8h7Z97Bq74Fk yhQid0e7R89sRUAOUq/nZT0x9s494Po6DdWgVKtSN6QZ3tLqfE61Ne8MqeSyAjzMHyu3 DmdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aYM+VhhL/noCdx5e6LwN0rToSkbZN8EkGwcPCz2bMkE=; fh=X4rJ+cR0B+d5Oa7pFIBp3MHYxg8a+8b0Sx0w3zuICOE=; b=HMJRmVgVRxu44+Z0RtbKfTNLwc+ggcti9Jchwh5Oi8iNb7EQnyEX5F9Ckklr8FEitS lyqXNfNYNOX076+lW4bKITBqRNYP+h9o7DQSX1HUEtB2v8vu2Z/JVZHVt7jTkINdBF3a YqvqpDbpBirat/+CZ/e7uEaegATwLLYppHygSgS7cS3kzsgqLoOWPEPH/S/Dk52Crhuz rZ0wQScKOaN7eddDE7TqlpP77WfIT+8lTYDnHq19M16LwaWw5mBuWiH/mU0pyKAl45UM 5AxGTvIOlA0DrUhLlF6b5jQaSc7KP45MJKKcYIWxO0AN10a+amFAfccQY6H9U62kkwcR e+bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lYYksZ0T; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a170906241400b00992c8f94336si9886597eja.233.2023.07.10.04.22.35; Mon, 10 Jul 2023 04:22:59 -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=@quicinc.com header.s=qcppdkim1 header.b=lYYksZ0T; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232989AbjGJKlN (ORCPT + 99 others); Mon, 10 Jul 2023 06:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbjGJKlJ (ORCPT ); Mon, 10 Jul 2023 06:41:09 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DB9BE7; Mon, 10 Jul 2023 03:41:05 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36A8emHC028581; Mon, 10 Jul 2023 10:41:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=aYM+VhhL/noCdx5e6LwN0rToSkbZN8EkGwcPCz2bMkE=; b=lYYksZ0T/gxfYjzGAU5W9nMuIyVkzp9zRtCHscew/7sUde3lTW8f/9ixWf8pl5w5ik4p zqXvbcTRr2aTem+0EIaRZPcu07CN7M31AL9nhjrpwbZovxIO8xG/Mpw6O5qMalVNoONo 7QgzSDBIhFETw95D2vvjlrWzYUiYe3+qATNuBgg3PLwBIXPkcdT4guqJzmUJcP+A5MQi WYJZH1+QmzlugXRG19FEXScVH+7+vzZeGMTV7wlLeusYIWjN6Spw+co4FiGl1dGWr3c/ sb3EzFkLVMratA1MrToB1oqJvUM18nQG4HmPWRK/ap7uA2CggXWhKKwRRp1q84GU+WYg Lw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rrdpn0fu6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 10:41:00 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36AAcOM4008941 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 10:38:24 GMT Received: from hu-ipkumar-blr.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 10 Jul 2023 03:38:19 -0700 From: Praveenkumar I To: , , , , , , , , , , , , , , CC: Subject: [PATCH 6/6] thermal/drivers/tsens: Add IPQ5332 support Date: Mon, 10 Jul 2023 16:07:35 +0530 Message-ID: <20230710103735.1375847-7-quic_ipkumar@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710103735.1375847-1-quic_ipkumar@quicinc.com> References: <20230710103735.1375847-1-quic_ipkumar@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nI6BaXxuRS0Mk8yDz92637YYSHG4XCVN X-Proofpoint-ORIG-GUID: nI6BaXxuRS0Mk8yDz92637YYSHG4XCVN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_08,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100097 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as like IPQ8074. But as the SoCs does not have RPM, kernel needs to take care of sensor enablement and calibration. Hence introduced new ops and data for IPQ5332 and reused the feature_config from IPQ8074. Signed-off-by: Praveenkumar I --- drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++ drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index db48b1d95348..8b6e3876fd2c 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { .fields = tsens_v2_regfields, }; +static const struct tsens_ops ops_ipq5332_v2 = { + .init = init_common, + .get_temp = get_temp_tsens_valid, + .calibrate = tsens_v2_calibration, +}; + +struct tsens_plat_data data_ipq5332 = { + .sensors_to_en = 0xF800, + .ops = &ops_ipq5332_v2, + .feat = &ipq8074_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 169690355dad..e8ba2901cda8 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1140,6 +1140,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 f8897bc8944e..36040f9beebc 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -701,6 +701,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__ */ -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project