From nobody Fri Dec 26 13:29:28 2025 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 CC6D614A61B for ; Fri, 5 Jul 2024 12:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720183217; cv=none; b=dapksm1sAj8Y9brQ0fcRH6d5Or41mVBl5J/e/B+/lnGAZ0R2aRzbhhiaLR7QfzIb3YM9BwRYnfLpvHnA7JqP3wZTa4w9R73vOD8IPORiVyU7inlSJ5H28jO0N1tkWYM7yng3FoYMw0YYf5VBCJM5FPSKwmDKjJE3UhG6IWY3Gjo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720183217; c=relaxed/simple; bh=Nt2iq+qg5boCRZ0EqNaZFVPjBYGDaMf+7TTr358t9AI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jBX1e3FHsKdNEO9RReNySOU64Cgs5CAThsLUINKm3Bml87m4uFHJmYSCK0qqm46PBILDE0vLnO8WpgaJT4C7AAnEG8OURaR7TE2f6FdeMmZNily8SzYgH1K84pDKReb0HhB8aQbu11AaXQHNFem+NoxJOzTJ2k/MeplohcYez8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=qngMOQ17; arc=none smtp.client-ip=209.85.218.46 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="qngMOQ17" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a77c9d3e593so82055466b.0 for ; Fri, 05 Jul 2024 05:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1720183214; x=1720788014; 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=2TKJxxFdbT1m75EyS915frE7gzWvL0YWMkfBTtcQJ9Y=; b=qngMOQ17999F/az0hully1iuiZASro24Y+zVDlyBw/PoAf7C9daUwsC1weCJ2r/BKX 4ORKss41ukmZWFvhme5Z5kefjhwTiToK6UY0/sQxQ2GnZQYlpTqMgjEPhAW+clh/9YFj sn5UvV9wK4ze+XVOcpKSo73XjMX3MbdyJdjihrH/zuhXrcYuKP4mngAdcu7UFlrGXxEO z5NOPsYKBcsjQt0n5gx2AEBDqR7a95slTfV94BvVBu7Hmvj0B/qbu5FEZKo7/ddCBjIk kv8GaeVqNSYcFxuW8WoPwXu5eT5h+3IEWXs5OlKqv6fm4jFi9xn/050jXbRLkT0l7wb6 QfRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720183214; x=1720788014; 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=2TKJxxFdbT1m75EyS915frE7gzWvL0YWMkfBTtcQJ9Y=; b=hD6UMAkYlRffkXNHB+MXlXAQiUXOXJfyf3foYejwTgrDNsPQdqC+bh6TNsxZyw7vT8 H33l5QpIoO/c3YevqwPwv9xUJt2Ye505/AXu/vGWwrofPuHHctVXYBcQ01zLir/Bfr5S nGdvm4HDEihhpWpWezjImywKY+DD9yrBR5jEVQQXoVOfD5cCqwqCw4RZ0sF1Um3JbaZf EdhQJBft0PJh+jZsiNxD3DplqvbwGDDnWlFTnjYU9vlbH5rqStjsniWcRVDEWijHLKV5 g6PFwD9dAFDBPY2aB1ARmlWOFG6SRwDXrqkVXmfD5OR2pEo7AOJlfJb62Ip6IK+FEe5u bUjQ== X-Forwarded-Encrypted: i=1; AJvYcCVg6YE/bZbPl3zrMDotz+RmpywjbdSuz1tPYEfCmKu8eClbPoq0/YGS5aIE8TKHjokwXfdJZSQJwetZLLsM3prbUzJOpNQW8UWym1x8 X-Gm-Message-State: AOJu0YzsA3Ld6/MYJpH6JTSxbDXwb1PNP+RMDM/BeiS72ENb9SBu0JQy tSoXXPQJN7CHP8/iUKf8EAmPByZkDy0Ry71KwsrIOjewnb6pEE4axxh2e4ZlQAM= X-Google-Smtp-Source: AGHT+IEtMbYTsd0gdLTiMY5AKurmr9zYWlPVFpAKFjwrVCKaLJfv2RWnXz+ziKcQ5XLpvY6+6z055A== X-Received: by 2002:a17:906:5acd:b0:a77:b81a:2471 with SMTP id a640c23a62f3a-a77ba7115d5mr317894266b.49.1720183214164; Fri, 05 Jul 2024 05:40:14 -0700 (PDT) Received: from [100.64.0.4] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a77d0908f51sm40930666b.125.2024.07.05.05.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 05:40:13 -0700 (PDT) From: Luca Weiss Date: Fri, 05 Jul 2024 14:40:10 +0200 Subject: [PATCH v2 2/2] arm64: dts: qcom: sm7225-fairphone-fp4: Add PM6150L thermals Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240705-fp4-thermals-v2-2-a4870a8d084f@fairphone.com> References: <20240705-fp4-thermals-v2-0-a4870a8d084f@fairphone.com> In-Reply-To: <20240705-fp4-thermals-v2-0-a4870a8d084f@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , AngeloGioacchino Del Regno 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.14.0 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 | 189 ++++++++++++++++++= ++++ 1 file changed, 189 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64= /boot/dts/qcom/sm7225-fairphone-fp4.dts index e263010c348c..2ee2561b57b1 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -93,6 +93,20 @@ memory@efe01000 { }; }; =20 + msm_therm_sensor: thermal-sensor-msm { + compatible =3D "generic-adc-thermal"; + #thermal-sensor-cells =3D <0>; + io-channels =3D <&pm6150l_adc ADC5_AMUX_THM2_100K_PU>; + io-channel-names =3D "sensor-channel"; + }; + + rear_cam_sensor: thermal-sensor-rear-cam { + compatible =3D "generic-adc-thermal"; + #thermal-sensor-cells =3D <0>; + io-channels =3D <&pm6150l_adc ADC5_GPIO2_100K_PU>; + io-channel-names =3D "sensor-channel"; + }; + thermal-zones { chg-skin-thermal { thermal-sensors =3D <&pm7250b_adc_tm 0>; @@ -118,6 +132,30 @@ active-config0 { }; }; =20 + pa0-thermal { + thermal-sensors =3D <&pm6150l_adc_tm 1>; + + trips { + active-config0 { + temperature =3D <125000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + }; + + pa1-thermal { + thermal-sensors =3D <&pm6150l_adc_tm 0>; + + trips { + active-config0 { + temperature =3D <125000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + }; + pm8008-thermal { polling-delay-passive =3D <100>; thermal-sensors =3D <&pm8008>; @@ -137,6 +175,64 @@ trip1 { }; }; =20 + quiet-thermal { + thermal-sensors =3D <&pm6150l_adc_tm 3>; + + trips { + active-config0 { + temperature =3D <125000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + }; + + rear-cam-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <5000>; + thermal-sensors =3D <&rear_cam_sensor>; + + trips { + active-config0 { + temperature =3D <125000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + }; + + rfc-flash-thermal { + thermal-sensors =3D <&pm6150l_adc_tm 2>; + + trips { + active-config0 { + temperature =3D <125000>; + hysteresis =3D <1000>; + type =3D "passive"; + }; + }; + }; + + sdm-skin-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <5000>; + thermal-sensors =3D <&msm_therm_sensor>; + + trips { + trip0 { + temperature =3D <45000>; + hysteresis =3D <0>; + type =3D "passive"; + }; + + trip1 { + temperature =3D <55000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + xo-thermal { thermal-sensors =3D <&pmk8350_adc_tm 0>; =20 @@ -596,6 +692,91 @@ &mpss { status =3D "okay"; }; =20 +&pm6150l_adc { + pinctrl-0 =3D <&pm6150l_adc_default>; + pinctrl-names =3D "default"; + + channel@4d { + reg =3D ; + label =3D "pa_therm1"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; + + channel@4e { + reg =3D ; + label =3D "msm_therm"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; + + channel@4f { + reg =3D ; + label =3D "pa_therm0"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; + + channel@53 { + reg =3D ; + label =3D "rear_cam_therm"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; + + channel@54 { + reg =3D ; + label =3D "rear_cam_flash_therm"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; + + channel@55 { + reg =3D ; + label =3D "quiet_therm"; + qcom,hw-settle-time =3D <200>; + qcom,pre-scaling =3D <1 1>; + qcom,ratiometric; + }; +}; + +&pm6150l_adc_tm { + status =3D "okay"; + + pa-therm1@0 { + reg =3D <0>; + io-channels =3D <&pm6150l_adc ADC5_AMUX_THM1_100K_PU>; + qcom,hw-settle-time-us =3D <200>; + qcom,ratiometric; + }; + + pa-therm0@1 { + reg =3D <1>; + io-channels =3D <&pm6150l_adc ADC5_AMUX_THM3_100K_PU>; + qcom,hw-settle-time-us =3D <200>; + qcom,ratiometric; + }; + + rear-cam-flash-therm@2 { + reg =3D <2>; + io-channels =3D <&pm6150l_adc ADC5_GPIO3_100K_PU>; + qcom,hw-settle-time-us =3D <200>; + qcom,ratiometric; + }; + + quiet-therm@3 { + reg =3D <3>; + io-channels =3D <&pm6150l_adc ADC5_GPIO4_100K_PU>; + qcom,hw-settle-time-us =3D <200>; + qcom,ratiometric; + }; +}; + &pm6150l_flash { status =3D "okay"; =20 @@ -618,6 +799,14 @@ led-1 { }; }; =20 +&pm6150l_gpios { + pm6150l_adc_default: adc-default-state { + pins =3D "gpio6", "gpio7", "gpio10"; + function =3D PMIC_GPIO_FUNC_NORMAL; + bias-high-impedance; + }; +}; + &pm6150l_wled { qcom,switching-freq =3D <800>; qcom,current-limit-microamp =3D <20000>; --=20 2.45.2