From patchwork Fri Jan 6 15:39:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13091475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B94A2C54EBF for ; Fri, 6 Jan 2023 15:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233560AbjAFPj5 (ORCPT ); Fri, 6 Jan 2023 10:39:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234263AbjAFPjy (ORCPT ); Fri, 6 Jan 2023 10:39:54 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B037A906 for ; Fri, 6 Jan 2023 07:39:53 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id tz12so4225115ejc.9 for ; Fri, 06 Jan 2023 07:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; 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=dKfo3csM5YVpm75Odrr7cMYcdrBI/spn1my7oe7Ikhk=; b=aMXO1CFuuhMbogRgkJFX88/S6oG0J6Cns9rS3tuzXNwyooe8y7VtdhnsH0f1Xklf3Q 6OvRQAiIsU8YLdFhL9r1ysjJVS627Kllc78PLNS/xfETEFGXbSy4jJ+48Ss6yCGxoKn7 ANFtYuUJNsy5l6K12I+uDtvu9lvo33ULFb4beAX37Ap+kOcz0COxJTmAyWOAu56Pe6HP zX/3ypvDw57k2r/j8RM8SYMw7DiWVRvFmYXVEFudA5gd0XGLrBDIkGWEAwXBip8jNoXh 2WxTR/JG45mnxRyiHECJynbk/giIWy9thxecbWjAfwcSryc7kuLLCbD7ntboY3EFsIw2 UdeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dKfo3csM5YVpm75Odrr7cMYcdrBI/spn1my7oe7Ikhk=; b=WIv0ArvGeOXwz+h3HIVduosp9s/QEP6pr1hSsU1Fayd62rM5a2P97B2B0iLW2/VaAB md7F6Uyow+MfDxf27g4oyMUm4cjdnTucRZ3H6muciwUT/VQ8k2+Uf+jDQL9kcqjuwlTt 2c7cg1HD9LzctXljxlICg/pezgxAQbGJ5vk7fyYJvWcER38NiFz7ast6hQIHGh3SpsOW cW+uGq+QOfVCO1CU2HUKIA1g4MjnEm3gOt5ux9axyT9ZZ1ENfFTCOLEMnyV83beRbCOr hq0GfDnd7DATmaPOXfpuv78GN/v5h4pJ2on/h4fbUbfcDmtqC8VsJ8TvVSnPN1zBWWRD 69jA== X-Gm-Message-State: AFqh2kq3C1JG4QgZNYoiN4yWpZFkYWPeUiExDKj4GcR61XJ4LvF49XjR ivmyHBvWsoP94H591Slf6w9ejA== X-Google-Smtp-Source: AMrXdXsOyRUDY8eTet0D35T1l5K8RorTnSSAlMJKMff96LiunHit972nEL9f6APpfimuB2JpRWEMOg== X-Received: by 2002:a17:907:c386:b0:7c1:31b:2181 with SMTP id tm6-20020a170907c38600b007c1031b2181mr50124974ejc.19.1673019591602; Fri, 06 Jan 2023 07:39:51 -0800 (PST) Received: from [10.0.0.3] (217-149-174-217.nat.highway.telekom.at. [217.149.174.217]) by smtp.gmail.com with ESMTPSA id gx8-20020a170906f1c800b007aed2057eacsm496235ejb.221.2023.01.06.07.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 07:39:51 -0800 (PST) From: Luca Weiss Date: Fri, 06 Jan 2023 16:39:41 +0100 Subject: [PATCH 1/2] iio: adc: qcom-spmi-adc5: define ADC5_BAT_ID_100K_PU channel MIME-Version: 1.0 Message-Id: <20230106-pm7250b-bat_id-v1-1-82ca8f2db741@fairphone.com> References: <20230106-pm7250b-bat_id-v1-0-82ca8f2db741@fairphone.com> In-Reply-To: <20230106-pm7250b-bat_id-v1-0-82ca8f2db741@fairphone.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.11.2 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Define the ADC channel used for battery identification purposes so it can be used in drivers. Signed-off-by: Luca Weiss --- drivers/iio/adc/qcom-spmi-adc5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c index 821fee60a765..8c33da9de257 100644 --- a/drivers/iio/adc/qcom-spmi-adc5.c +++ b/drivers/iio/adc/qcom-spmi-adc5.c @@ -543,6 +543,8 @@ static const struct adc5_channels adc5_chans_pmic[ADC5_MAX_CHANNEL] = { SCALE_HW_CALIB_DEFAULT) [ADC5_XO_THERM_100K_PU] = ADC5_CHAN_TEMP("xo_therm", 0, SCALE_HW_CALIB_XOTHERM) + [ADC5_BAT_ID_100K_PU] = ADC5_CHAN_TEMP("bat_id", 0, + SCALE_HW_CALIB_DEFAULT) [ADC5_AMUX_THM1_100K_PU] = ADC5_CHAN_TEMP("amux_thm1_100k_pu", 0, SCALE_HW_CALIB_THERM_100K_PULLUP) [ADC5_AMUX_THM2_100K_PU] = ADC5_CHAN_TEMP("amux_thm2_100k_pu", 0, From patchwork Fri Jan 6 15:39:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13091476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9364C5479D for ; Fri, 6 Jan 2023 15:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234975AbjAFPkB (ORCPT ); Fri, 6 Jan 2023 10:40:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234989AbjAFPjz (ORCPT ); Fri, 6 Jan 2023 10:39:55 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DA87BDE3 for ; Fri, 6 Jan 2023 07:39:53 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id u9so4341707ejo.0 for ; Fri, 06 Jan 2023 07:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; 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=IrFALWtjvyHrEODn7/AmsHwOIckZb4wGAaCGF9DBAVM=; b=Jmun4CjNGliRP410OzyR1BUUiSsCJ5Bm43gNMHYkxiwSL9xVDWlb5av85NU3qMEPti w5p3ya5HuRHHodDPbKvNMLeJOvWHcuAKDkQ5r4BnjNISCMSEX7OFnr+CZb3Kd0/iGwdI 5+EEGGMjZ//u2TybrowJ8g5RlcHu5IxTg+Qe0VYOUl4ZJIcTQKpAuTordn4c0ioA3GaZ zy0HJkBPMO07WRa++itg1FVeDszYzXQ+6dQPOAqDjsYcUp72DcyDkmK8fiI1yvxy3DVH tz4FbtcaVS5lM8n0afLrNDLR/qgfNIfGCVUUK61tb9tIE8ZfINNPc3M16jF9Mgg1KLLE oTHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=IrFALWtjvyHrEODn7/AmsHwOIckZb4wGAaCGF9DBAVM=; b=WKjhyiJEbcLrkVrdP3fCbhdnepp+vcLn+R+LFoBeQIFNIOgMvPqtHstP3oMCisNAXC e2KIguAOMNlMk6KD8E/NE8oWcGU96mJT3S/3+Wkm3sB02GkrToJxD6iFMLTXzhzAzvsj tVhaT2yor1bFiDEToP6ZT6NfBAL6jQ3qDq/bI0hvIbQNg/dw4psez2gGXaktyuoG4Eka TrDWFqfCLor6/IVZfwucEhjJ/yaGuz5qBElRCm9P/U8S9tSRLupNQTgRKKykIsXP7kOn VUrNQ4Kft1A7YDwLdhnVHVxo1Fh3iEkqZ8v6JMPfs8wedOzp9CfEAhq6b+r2bl7pa6ML 3vtw== X-Gm-Message-State: AFqh2koNAbgLo7XDBw5AM5VDucR4jwdIYF/QEinpPm7LRV+uByI+gVBi zu03br2nOUCiyIEV4wxf+UYFaA== X-Google-Smtp-Source: AMrXdXu7mftrNvtn7RupRJFbxPZJo8dYVuvhmeBH27k1Q4dQpg1FR8BIZbUZvzI2v9kBDXiCohL1Bg== X-Received: by 2002:a17:907:c081:b0:84d:207d:c00e with SMTP id st1-20020a170907c08100b0084d207dc00emr2369537ejc.46.1673019592525; Fri, 06 Jan 2023 07:39:52 -0800 (PST) Received: from [10.0.0.3] (217-149-174-217.nat.highway.telekom.at. [217.149.174.217]) by smtp.gmail.com with ESMTPSA id gx8-20020a170906f1c800b007aed2057eacsm496235ejb.221.2023.01.06.07.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 07:39:52 -0800 (PST) From: Luca Weiss Date: Fri, 06 Jan 2023 16:39:42 +0100 Subject: [PATCH 2/2] arm64: dts: qcom: pm7250b: Add BAT_ID vadc channel MIME-Version: 1.0 Message-Id: <20230106-pm7250b-bat_id-v1-2-82ca8f2db741@fairphone.com> References: <20230106-pm7250b-bat_id-v1-0-82ca8f2db741@fairphone.com> In-Reply-To: <20230106-pm7250b-bat_id-v1-0-82ca8f2db741@fairphone.com> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.11.2 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add a node describing the ADC5_BAT_ID_100K_PU channel with the properties taken from downstream kernel. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index 61f7a6345150..d709d955a2f5 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -110,6 +110,14 @@ adc-chan@1e { label = "chg_mid"; }; + adc-chan@4b { + reg = ; + qcom,hw-settle-time = <200>; + qcom,pre-scaling = <1 1>; + qcom,ratiometric; + label = "bat_id"; + }; + adc-chan@83 { reg = ; qcom,pre-scaling = <1 3>;