From patchwork Fri Jan 5 14:54:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13512243 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02D342E630 for ; Fri, 5 Jan 2024 14:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="TQAZM/lL" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a2814fa68eeso134408666b.1 for ; Fri, 05 Jan 2024 06:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1704466480; x=1705071280; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jvqHpSG2cKdnmJ9eXRXA0NxGczv5lsHJ2CQrOmhp7+4=; b=TQAZM/lL5eIxYThN3x0CoCFE4XF6qNwW0Q/68HhpoOc52k2zo3rtZFGB3vTs/o+QvS SqSNzPscDL21Qhf6o0ahbWuQBf35I/H14TmDb9Y3w6Q3KauuDAydhtHoinLFOwG0trH9 TCqxW8jQB+UM600Yc0P2Vc3YJPfboL18suE915J/tip5H6DBR3xS36T6HVdaSUNdjptH takugx60vxz46lJILjrV3I93/GPjbXcDG8aZYFW7aK33Jc75q4DnDUJCvchfv0FVgIPF 15IsQCbisTlZHUo6HPexoAcLIUKvEyy64+gAGcBSDfkzW9JavnTCO+0THgj7DIaMFWk/ /w4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704466480; x=1705071280; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jvqHpSG2cKdnmJ9eXRXA0NxGczv5lsHJ2CQrOmhp7+4=; b=bPnmgNqfmYL8ByTpH0SLDDksTWXP+Cw0c6F5TZmNRnvNrtAmjH5OcQ7AbQw6gG1dMM lS3yrCZ9SzcvM8DR5MK57SvcvwQ9Gc8XFz/Oc2KVCCDcQVZLQ68MEtVpKp43id+XLqif RBTOluLGWsJndHWqpZ0u7OV7OYKYSFSiv/M+EkrDUoCtx/0ZM7z30hR+EJJHSnxMQdYj Zu3Ya41BfB1uTpUnN2aIxYYmCkVxTTHqlDlQJSf2Tvu/2aLFRsDK0kqIUG31EWXjwqjY Jho07SG4+55I0uURBdsI62zHioMADNz95sQkLjmKbTBN8D0MKWYVHoQYjuN0/D5wHoHP V/sg== X-Gm-Message-State: AOJu0Yz08SS6jPOyAtw/mz82e8vDj/vG2ht4VD0mBqlTgZDfbqpE4XBR BpyisXouseh4Cm9Oh1zUvbV2EPrHXcstAA== X-Google-Smtp-Source: AGHT+IH041yxCVJ0TTR5qGGoL88yZ4dSxuZjqIdFGUseiPOwfwTWfGvD6HHrkRkkcQWkCdH7O1VR5A== X-Received: by 2002:a17:906:dfd0:b0:a29:3cad:1c5d with SMTP id jt16-20020a170906dfd000b00a293cad1c5dmr566975ejc.37.1704466480300; Fri, 05 Jan 2024 06:54:40 -0800 (PST) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a17-20020a1709065f9100b00a2471bb0d11sm963140eju.31.2024.01.05.06.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 06:54:40 -0800 (PST) From: Luca Weiss Date: Fri, 05 Jan 2024 15:54:27 +0100 Subject: [PATCH 1/2] arm64: dts: qcom: sm7225-fairphone-fp4: Add PMK8003 thermals Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240105-fp4-thermals-v1-1-f95875a536b7@fairphone.com> References: <20240105-fp4-thermals-v1-0-f95875a536b7@fairphone.com> In-Reply-To: <20240105-fp4-thermals-v1-0-f95875a536b7@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.4 Configure the thermals for the XO_THERM thermistor connected to the PMK8003 (which is called PMK8350 in software). The ADC configuration for PMK8350_ADC7_AMUX_THM1_100K_PU has already been added in the past. The trip points can really only be considered as placeholders, more configuration with cooling etc. can be added later. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts index ade619805519..b7ccfe4011bb 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -112,6 +112,20 @@ active-config0 { }; }; }; + + xo-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pmk8350_adc_tm 0>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; }; }; @@ -490,6 +504,17 @@ conn-therm@1 { }; }; +&pmk8350_adc_tm { + status = "okay"; + + xo-therm@0 { + reg = <0>; + io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time-us = <200>; + }; +}; + &pmk8350_rtc { status = "okay"; }; From patchwork Fri Jan 5 14:54:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13512244 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAEAD2E40A for ; Fri, 5 Jan 2024 14:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="a/ZLHPR6" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-55739500b39so490068a12.0 for ; Fri, 05 Jan 2024 06:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1704466482; x=1705071282; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jq9n9lpe0Y+9jpO1UU+afvnCvK//2FOqgM2SLn2wYw4=; b=a/ZLHPR6gJOb2iJq0m46DqCOW/N06vrAQ4Q4aO4dKp13Kho/xJ2QbNMHry5R+gkVRa IyG9mQFb3asG25mUQUlKYATofFX1wA19AhVC+Lsvj8RnuipeNLClCKF9mv3u4nULjuiv lTlfjTeKEahkZuVQVa2MxLXGls7f+kjdyrr94aZlleWi1mn2R4cHnvPZE8Otp9Io2NbL I1xTGEQvWyKY2CrQstIHn96W5alkkrEN94PFBOZKrQGxlKQ9YHLEyUe+xPAbkr2TlIZw jRu2o0d+F3jeDailnC5WU+BhLgzZ1C+5UVO5y3ZN3zpS31wv/wDaf4NEpEIeLUJxl+X/ 2RrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704466482; x=1705071282; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jq9n9lpe0Y+9jpO1UU+afvnCvK//2FOqgM2SLn2wYw4=; b=cBaffKBFPQmMx1ypWLW1ChZIXZQmYXgsbi2VRR/OQYAScpc5/KIjVFwLY1G6UkCE1s NAsk+7dUa/mlnh3/EOKPZSfXD1ETLaFytycQEnVKaDqsS/20Nv1Ank+QskQL86rOkMAK BoouJ4qodFSWkpsCKu1MTpt3fp3MGga/+Dfmydl82bgwikgB0KQjz5o9MdlrAQ69DXfG odOYgEp+FcrLeXVQDU907Njl7dCMQ0iP9pZXeOAO8CmzSG5ahWZy5EQK04rg6ZXun8au JYKGREvdTAGR73LVhiD9k1uw2STN5ecZrv9pDF0LZ888fGoewX3Fvhjyr9uWO5AHC/hj wEzQ== X-Gm-Message-State: AOJu0Ywt6S0ZGihBHjk2jOv80hMcvuNTaMYb6U/3VNaCkq1q/noatYSN j1U3gOxUrkb3sxSNBwQc7y+fUpXfQnPIFA== X-Google-Smtp-Source: AGHT+IGiujnXbcayqnFfrIGyXs5O5L/tyn/ZR4i3KUdWhw+JxaofT2MFT33e2kZLo6hyhMONijzo1A== X-Received: by 2002:a17:906:d0d1:b0:a28:a13e:2339 with SMTP id bq17-20020a170906d0d100b00a28a13e2339mr1183827ejb.61.1704466482186; Fri, 05 Jan 2024 06:54:42 -0800 (PST) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a17-20020a1709065f9100b00a2471bb0d11sm963140eju.31.2024.01.05.06.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 06:54:41 -0800 (PST) From: Luca Weiss Date: Fri, 05 Jan 2024 15:54:28 +0100 Subject: [PATCH 2/2] arm64: dts: qcom: sm7225-fairphone-fp4: Add PM6150L thermals Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240105-fp4-thermals-v1-2-f95875a536b7@fairphone.com> References: <20240105-fp4-thermals-v1-0-f95875a536b7@fairphone.com> In-Reply-To: <20240105-fp4-thermals-v1-0-f95875a536b7@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.4 Configure the thermals for the PA_THERM1, MSM_THERM, PA_THERM0, RFC_CAM_THERM, CAM_FLASH_THERM and QUIET_THERM thermistors connected to PM6150L. Due to hardware constraints we can only register 4 zones with pm6150l_adc_tm, the other 2 we can register via generic-adc-thermal. The trip points can really only be considered as placeholders, more configuration with cooling etc. can be added later. Signed-off-by: Luca Weiss --- arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 191 ++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts index b7ccfe4011bb..6f435a7ed855 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -84,6 +84,20 @@ memory@efe01000 { }; }; + msm_therm_sensor: thermal-sensor-msm { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&pm6150l_adc ADC5_AMUX_THM2_100K_PU>; + io-channel-names = "sensor-channel"; + }; + + rear_cam_sensor: thermal-sensor-rear-cam { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&pm6150l_adc ADC5_GPIO2_100K_PU>; + io-channel-names = "sensor-channel"; + }; + thermal-zones { chg-skin-thermal { polling-delay-passive = <0>; @@ -113,6 +127,90 @@ active-config0 { }; }; + pa0-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pm6150l_adc_tm 1>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + pa1-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pm6150l_adc_tm 0>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + quiet-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pm6150l_adc_tm 3>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + rear-cam-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&rear_cam_sensor>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + rfc-flash-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&pm6150l_adc_tm 2>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + + sdm-skin-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&msm_therm_sensor>; + + trips { + active-config0 { + temperature = <125000>; + hysteresis = <1000>; + type = "passive"; + }; + }; + }; + xo-thermal { polling-delay-passive = <0>; polling-delay = <0>; @@ -423,6 +521,91 @@ &mpss { status = "okay"; }; +&pm6150l_adc { + pinctrl-0 = <&pm6150l_adc_default>; + pinctrl-names = "default"; + + channel@4d { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "pa_therm1"; + }; + + channel@4e { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "msm_therm"; + }; + + channel@4f { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "pa_therm0"; + }; + + channel@53 { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "rear_cam_therm"; + }; + + channel@54 { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "rear_cam_flash_therm"; + }; + + channel@55 { + reg = ; + qcom,ratiometric; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + label = "quiet_therm"; + }; +}; + +&pm6150l_adc_tm { + status = "okay"; + + pa-therm1@0 { + reg = <0>; + io-channels = <&pm6150l_adc ADC5_AMUX_THM1_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time-us = <200>; + }; + + pa-therm0@1 { + reg = <1>; + io-channels = <&pm6150l_adc ADC5_AMUX_THM3_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time-us = <200>; + }; + + rear-cam-flash-therm@2 { + reg = <2>; + io-channels = <&pm6150l_adc ADC5_GPIO3_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time-us = <200>; + }; + + quiet-therm@3 { + reg = <3>; + io-channels = <&pm6150l_adc ADC5_GPIO4_100K_PU>; + qcom,ratiometric; + qcom,hw-settle-time-us = <200>; + }; +}; + &pm6150l_flash { status = "okay"; @@ -445,6 +628,14 @@ led-1 { }; }; +&pm6150l_gpios { + pm6150l_adc_default: adc-default-state { + pins = "gpio6", "gpio7", "gpio10"; + function = PMIC_GPIO_FUNC_NORMAL; + bias-high-impedance; + }; +}; + &pm6150l_wled { qcom,switching-freq = <800>; qcom,current-limit-microamp = <20000>;