Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10483234rwp; Thu, 20 Jul 2023 23:06:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlHeTP6zHJt/HDtK5UT37BEa5vfD01EqTT43Rmfs0wVDikKZvvc1INsI/W80wAH2Dcg8kH8j X-Received: by 2002:a17:906:31d6:b0:997:d4ee:1b53 with SMTP id f22-20020a17090631d600b00997d4ee1b53mr865924ejf.48.1689919596327; Thu, 20 Jul 2023 23:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689919596; cv=none; d=google.com; s=arc-20160816; b=ADJrC4yQ/ZCZFgNcs9WsR6V3e59PncAfsGAFjnZwsfPjeuRnz8kGDfRKCTgbtKqTVc VJWlCYFnqdaUvl6aif5LM0B6Ffv3dqYv4C9IvfEjfv8pc6yuFvMFX+sQf/WL2Aigg832 zYrmWJvoAvdGkXlVKtX70iHYgvKslV0J3jSBqnlOSVgGmzPxjW3pP04XZCOG0F9xfffh raXALGd3zqRknOjNYeg9OAd9Oc0mUKxrYzI8UFrsTfoLQfqJui7DgklRYd372nuEb9KH myTMsNOseOumybEjhBve+wO7WCeFhEx/BUGeO694FMIUC5eiIvezeYeJ9cpFZvbKSETZ 0T8Q== 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=aDrEGWzK5xW/XLzPrRNTbcEJP+wW9LlOvmNV/qztgfg=; fh=X4rJ+cR0B+d5Oa7pFIBp3MHYxg8a+8b0Sx0w3zuICOE=; b=hySXQzzhhSyJALtXrjPvzkRBRdQVyKP9OAF9kqMpTKY9zWnIXap7rjRqo5xDCOp0Iz Q6mhS5tOcL0k2dqqjpt3J4MlTTHDBb2k7hKYKgqqso12MdG/gbPZJUPz2afoV85S0ofu PP1IwUEtMpA43amVR/QZLLvYwnEls3PsRWnfDxK3f+m54qaV/MmeFBI8Vpmm2X/Dnbt8 VULvCn/lbDFB2mWCYuLokoY+9htnMEfmbZUL8ctvIDrvJbG0+kUdQV6mtzVRvYY0mDOL L0nher7eUx5XhJZIZBRcXAWW2z51Tkfnm93Z57B/Xkqq76OMniNGJFv2QTpfW0s3QuW4 k+UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PsKykelV; 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 rs17-20020a170907037100b00992c0625ee8si1587737ejb.976.2023.07.20.23.05.46; Thu, 20 Jul 2023 23:06:36 -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=PsKykelV; 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 S229452AbjGUFsM (ORCPT + 99 others); Fri, 21 Jul 2023 01:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjGUFrt (ORCPT ); Fri, 21 Jul 2023 01:47:49 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 083BE3A8E; Thu, 20 Jul 2023 22:47:19 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36L5ge2K012103; Fri, 21 Jul 2023 05:47:11 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=aDrEGWzK5xW/XLzPrRNTbcEJP+wW9LlOvmNV/qztgfg=; b=PsKykelV0lvBWzc3dkYVKmfqjkTGfD625LepD+AdjX4+BTqpDMaLZPaiVs+pGOfP/3g6 3jHXFjuG2EGANhjf1uMH4o6rg8YBpQuP3Pw6dQFJGiII2pEMxGDrU6kXrrSBzdhfUIo8 ZvPmqZ2esRceSAmPfsulTtC3WRLH/t9sGHLqnRTo+W3/kdwZNgUgjJ2RakCi/sid+pAX OOrpSI9bq1ATw2vPKPhz7DCIU0sr3IEvKwf5XuVwFoCkL0Q6EmB410YwyJAMwY+fOweK DpKkdOU0fFDjqw1WWslDCc8Bu0nI5eEsAbVOuAjGOFGc1FoldpHfH+gvciSzqRJSyJ50 ww== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ryfyf0e0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 05:47:11 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36L5lA7j004119 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 05:47:10 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; Thu, 20 Jul 2023 22:47:05 -0700 From: Praveenkumar I To: , , , , , , , , , , , , , , CC: Subject: [PATCH v5 5/5] thermal/drivers/tsens: Add IPQ5332 support Date: Fri, 21 Jul 2023 11:16:19 +0530 Message-ID: <20230721054619.2366510-6-quic_ipkumar@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230721054619.2366510-1-quic_ipkumar@quicinc.com> References: <20230721054619.2366510-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: tErFpnpXXBvAuBewA9U9SVv8gGtY-Hr9 X-Proofpoint-ORIG-GUID: tErFpnpXXBvAuBewA9U9SVv8gGtY-Hr9 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-21_02,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 adultscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307210052 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,URIBL_BLOCKED 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. 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 --- [v5]: No changes. [v4]: No changes. [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 7190e477b173..512839597ac6 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -69,6 +69,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, +}; + static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = { /* ----- SROT ------ */ /* VERSION */ @@ -270,6 +281,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__ */ -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project