From patchwork Thu Nov 7 17:02:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= X-Patchwork-Id: 13866800 Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B651F217F54; Thu, 7 Nov 2024 17:03:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.75.144.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730998989; cv=none; b=BYIuO9Lic1r9fXA3P+LWlWfzKzVQnZXcPfhseH+76Rv3QVKY+HNmBwGZJdzOvfRFsAC1hHiN3kcOS/vbUeWqQ5n2OOqmSWxFizZa2fOPZgzgvMG6m67MwGiApxnDzr6EkpkxDO69PWE+oCoTgaAmkOXMK9iknC66IlMQ6vXtcoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730998989; c=relaxed/simple; bh=LA1yHm9JefRTzAcl7oQuKzrTAdjvePqLu6hR07bVDBU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yh3OyQh9W11mYaJQry0f/hHZIr/3o6Syilf9cJbppUYnA96xgVuKjBNWVibm5cIz+aGDHDdzkrwJHwLV4Q7QsIZVsO4mpasBwtgw6mCXQCct05nZXZjRzYaLXrBlEhByduvnyhkxPSnjxQ/+uL/5BKQsy50cXjPWUkDdPgMf1KI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org; spf=pass smtp.mailfrom=mainlining.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=i2EsQkMK; arc=none smtp.client-ip=5.75.144.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mainlining.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="i2EsQkMK" Received: from [192.168.118.162] (254C2715.nat.pool.telekom.hu [37.76.39.21]) by mail.mainlining.org (Postfix) with ESMTPSA id E0FE0E45C4; Thu, 7 Nov 2024 17:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mainlining.org; s=psm; t=1730998986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SS6oPEKwC33ey53SPdqjnM/5YgQcFeMfM2H7KRWWuck=; b=i2EsQkMKEJJZhOmzH4LmrThFtjQ6/7eZKAK28UQO6oeGLtLiZvyZrXvMBzB7sKguL1sfrQ PofXoIZkQhRzDBFQJ9YiSn2ZZgUr4o97AKlnR0x54pNTVNxH2ZSjJf0xQPJef35BMVPgdm 4ePVpxjc1dJGwHXFlexaZ9fd1wajwxfB13h6Fe9CgoAvAoVumnIGxkvv69I+uQO7qYa7FN EC6qcdoSkh4Hriuxb36jUgGlNmzE7u9gn7iNZ+nd0lrs+xxnRokiZz3bwbUBGqnQSC23dZ jyhjE1DL/GDNMH9OOgkOGBEKmP1hzTVAZj4tZDXO2DiONw4k+LKJtMP/UX8r5Q== From: =?utf-8?b?QmFybmFiw6FzIEN6w6ltw6Fu?= Date: Thu, 07 Nov 2024 18:02:50 +0100 Subject: [PATCH v3 09/14] thermal/drivers/qcom/tsens-v1: Add support for MSM8937 tsens Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241107-msm8917-v3-9-6ddc5acd978b@mainlining.org> References: <20241107-msm8917-v3-0-6ddc5acd978b@mainlining.org> In-Reply-To: <20241107-msm8917-v3-0-6ddc5acd978b@mainlining.org> To: Bjorn Andersson , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Lee Jones , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Joerg Roedel , Will Deacon , Robin Murphy , Srinivas Kandagatla Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux.dev, =?utf-8?b?QmFybmFiw6Fz?= =?utf-8?b?IEN6w6ltw6Fu?= , Dmitry Baryshkov X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730998970; l=2407; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=LA1yHm9JefRTzAcl7oQuKzrTAdjvePqLu6hR07bVDBU=; b=wiEELKM4lZYF5c55Ae0JFmi2JOhhGOoNTAzc1MZcBu3BIhVR0UZZJcINmKMWgZOQPW7GVk2WG K8ctq8AQoVWCcaHSfFCl6KlmpepF4cc8BLGMg4h8Xshe84B597tqHW5 X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= Add support for tsens v1.4 block what can be found in MSM8937 and MSM8917. Reviewed-by: Dmitry Baryshkov Signed-off-by: Barnabás Czémán --- drivers/thermal/qcom/tsens-v1.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-v1.c b/drivers/thermal/qcom/tsens-v1.c index dc1c4ae2d8b01b42a0edbb7f12a5780b25d0c8ac..50787cf68bfae48da6061d8e75956308f41053be 100644 --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c @@ -162,6 +162,19 @@ struct tsens_plat_data data_tsens_v1 = { .fields = tsens_v1_regfields, }; +static const struct tsens_ops ops_8937 = { + .init = init_common, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_tsens_valid, +}; + +struct tsens_plat_data data_8937 = { + .num_sensors = 11, + .ops = &ops_8937, + .feat = &tsens_v1_feat, + .fields = tsens_v1_regfields, +}; + static const struct tsens_ops ops_8956 = { .init = init_8956, .calibrate = tsens_calibrate_common, diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 0b4421bf478544dfa071c792dc812ffaedc9c635..d2db804692f01d300b555d491e8a1acc597b3819 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1119,6 +1119,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,msm8916-tsens", .data = &data_8916, + }, { + .compatible = "qcom,msm8937-tsens", + .data = &data_8937, }, { .compatible = "qcom,msm8939-tsens", .data = &data_8939, diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index cab39de045b100030de6a1209c58bb09561a3224..7b36a0318fa6a078e73ce26dfe7387e4435148b4 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -647,7 +647,7 @@ extern struct tsens_plat_data data_8960; extern struct tsens_plat_data data_8226, data_8909, data_8916, data_8939, data_8974, data_9607; /* TSENS v1 targets */ -extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; +extern struct tsens_plat_data data_tsens_v1, data_8937, data_8976, data_8956; /* TSENS v2 targets */ extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;