From patchwork Sat Apr 1 22:08:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 669645 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 0E191C76196 for ; Sat, 1 Apr 2023 22:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbjDAWI2 (ORCPT ); Sat, 1 Apr 2023 18:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbjDAWIY (ORCPT ); Sat, 1 Apr 2023 18:08:24 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B15C2B0CB for ; Sat, 1 Apr 2023 15:08:22 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id h9so26658276ljq.2 for ; Sat, 01 Apr 2023 15:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680386901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p7Y3KWurDVmeNMJ1PgoNSWwvLTrrzW/b+U81BYECoKQ=; b=WL6veunStgKvS/trjZTjbc5YO4zQum/MCdtE3rB7wM7s+JjAR+j1wDmxs59w29Ajjz eCtCdR7nsdZGNNW23rWOc0U0xhCskN3PmBhkEu0THZm52oTQ4x4wxryMzSti4xFhnT7z vF801nMY/k8l3LKdb5yButx2bU7H/sTQIl7dUlAFmd87k2uHwAv1UCLXMnPJdflpufYL 9BwZJvd6OAQeK4gbUBS4aC/4Fru88nhTv/EG/iDKAwxlV3OAqltg/E9cHjZ6z/bAR0ir HOCLISPIsJ/8HmWAhDn29wOavKw7hQLzbGFUKPgYebH6woJURAckseIXO0843Qgywyz9 nKwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680386901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p7Y3KWurDVmeNMJ1PgoNSWwvLTrrzW/b+U81BYECoKQ=; b=6arMxz4BLXCTScwJ7G5V48SwRZ7xllQGj1OCkiogk0nEXi1W56Lg1lhkhp6XhvjP+c jpkyX4SaUk6vku1BdIopzLRhuwzBRij//888uyDYclP2o7raqRD0qwGH0eTgJp3WKkVn zzgYLpzamDKD3hpx8P2HdzxIYAFwJtsmmI5SuFFyeqRbsKxZw6PduR5vlTysHYRpp2LO z95gNafTcBVmmjmvlLZe6qK5uxDSEmQI5hjOYHUGRzfVNcgrMUaSFVzy5mWEwEFMx7Xb 66X/B3cfoyomd72GYdbf3m9ycrU2eYU1xfnjdas5pOzaAAwU6/nBMu5DO20pc1f7ssmI 1YyQ== X-Gm-Message-State: AAQBX9f8ULdA01lp/nDXe6G8wQk1okqmHFAqKY4q0M3AEVVaG63P5Wvw cGe/9d3LZsX81dGKV8SHAFAc+A== X-Google-Smtp-Source: AKy350YJE78lIeCkl5UjUQWNcbugthNjhLSEs2bkDo+SlJ9QrSPkLbCENDegNkd9WqIMkX4MDx2u7w== X-Received: by 2002:a2e:97ce:0:b0:2a2:5a2e:1d46 with SMTP id m14-20020a2e97ce000000b002a25a2e1d46mr9235511ljj.28.1680386901602; Sat, 01 Apr 2023 15:08:21 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id k17-20020a2e9211000000b0029bd4d0d3f2sm997590ljg.33.2023.04.01.15.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 15:08:21 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Johan Hovold , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org Subject: [PATCH v2 16/22] arm64: dts: qcom: pm8350c: allow overriding SID and label Date: Sun, 2 Apr 2023 01:08:04 +0300 Message-Id: <20230401220810.3563708-17-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230401220810.3563708-1-dmitry.baryshkov@linaro.org> References: <20230401220810.3563708-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The platform can use several instances of PM8350C PMIC. Allow overriding the SID and node labels inside pm8350c.dtsi. Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/pm8350c.dtsi | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/pm8350c.dtsi b/arch/arm64/boot/dts/qcom/pm8350c.dtsi index ee25c07ce31d..ddfc8fd6bb3e 100644 --- a/arch/arm64/boot/dts/qcom/pm8350c.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8350c.dtsi @@ -6,12 +6,23 @@ #include #include +/* (Sadly) this PMIC can be configured to be at different SIDs */ +#ifndef PMIC_SID + #define PMIC_SID 2 +#endif + +#ifndef PMIC_LABEL + #define PMIC_LABEL pm8350c +#endif + +#include "pmic-dyn-header.dtsi" + / { thermal-zones { pm8350c-thermal { polling-delay-passive = <100>; polling-delay = <0>; - thermal-sensors = <&pm8350c_temp_alarm>; + thermal-sensors = <&LABEL(temp_alarm)>; trips { trip0 { @@ -31,33 +42,35 @@ pm8350c-crit { }; &spmi_bus { - pm8350c: pmic@2 { + pmic@PMIC_SID { compatible = "qcom,pm8350c", "qcom,spmi-pmic"; - reg = <0x2 SPMI_USID>; + reg = ; #address-cells = <1>; #size-cells = <0>; - pm8350c_temp_alarm: temp-alarm@a00 { + LABEL(temp_alarm): temp-alarm@a00 { compatible = "qcom,spmi-temp-alarm"; reg = <0xa00>; interrupts = <0x2 0xa 0x0 IRQ_TYPE_EDGE_BOTH>; #thermal-sensor-cells = <0>; }; - pm8350c_gpios: gpio@8800 { + LABEL(gpios): gpio@8800 { compatible = "qcom,pm8350c-gpio", "qcom,spmi-gpio"; reg = <0x8800>; gpio-controller; - gpio-ranges = <&pm8350c_gpios 0 0 9>; + gpio-ranges = <&LABEL(gpios) 0 0 9>; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; }; - pm8350c_pwm: pwm { + LABEL(pwm): pwm { compatible = "qcom,pm8350c-pwm"; #pwm-cells = <2>; status = "disabled"; }; }; }; + +#include "pmic-dyn-footer.dtsi"