From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 75BD82FF159 for ; Tue, 26 Aug 2025 08:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197452; cv=none; b=FBbz5+czQ/AA6mRprrcVUPnl2DMGkDer8jD9OBYaqYcmToLBcEsu+4c4Pr6vxyGeB55O9X6m5UmBvvR66D3sSRam78V5fPyt4hdy5x33tb788KFkZr1lWa4uj6TjaH8Vv5+HYMW0jWCAcnQZlNXBcdcEz9ZTVBXd+ldLLBnS9S0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756197452; c=relaxed/simple; bh=ZlAQ2PmUBo3Nu4YF8y0u/CGafLXF6Q6N67s6YfEtYXE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dZ1tva99HNak9ePzrB0NZuf6Z9+xV1s1P1jYXGvMAAy7DjGwxdzkWDA5t9eEAWt23jUwSpYHLulQYL5VM9phJJ2z3rBBXXnnNMmCbnnjmdKIn2WXjJe1czq9TgLFKWku4P3UgcVmIcA5/wd1C7bIY/SeF183XcEUmqtYRUnjGSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=drGdDo5k; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="drGdDo5k" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 57Q4VAXR005250 for ; Tue, 26 Aug 2025 08:37:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=2r8iE3mffOt EEE74EjEXqvQmMXI97bIxGHeh+QyYSN0=; b=drGdDo5k/weDwc4vIv71ffbyOSx HSP/ypdec72cQUHsAczAizltV0X90AJv8T1jSsKCQGhb73Jv4j4Pd66jjSKpLg54 1ZKNt1zYBpZwj8IuvXuXjXsBBlMbXJ2QHix1R03fwR4F23aD/Iqv03+0+ziHCEty 7mSNO1fgBU/eYTj4e+qMN+6z9tGDBAUxx3nIcS7Etsgi9SVn2MyPNm9hf7cmPL5H /k8/Wj7sZx3P4tb7HqIOmnSXwx1lR+Lt3tjUotABBNyI2vfaPh5yZ1+YnoSYbE2r OUokh1Zdp42a6cimldlAVq5wyOkST+rYFI3t98R+kFjckV4M15N9whjQkuA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48rtpete80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 26 Aug 2025 08:37:29 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-246de620e6bso21779685ad.1 for ; Tue, 26 Aug 2025 01:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756197448; x=1756802248; 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=2r8iE3mffOtEEE74EjEXqvQmMXI97bIxGHeh+QyYSN0=; b=miU3uzTDk+Qp9LhFen73dEZhdz8INEwDyboBPeH1hlYVx4bCG+w/IDZ46aP2ecNw4v R6IFvmzN6ebvc4rxQ6yBeT8r/y8otCkE2Cx6PGeBsy6QzNbH7/4JYc4IzemCN2C1UB3S XK26dgOAuTbQjFytjiF7lpnQRNI50jZ/igMc772KpLmO5Ilqv/aGMV0ZPl/0SrGE4SIW vcfHqsYKQ+YnXiJ9O4yHggtiTdRTn26nVJ2nGpI9wdbMPNrGuZzNHx1OgyyJ4YdajLc4 WxMqxUmGCy0qx6DPgAmDAuRLtwAn2ok0O5vRVLwHcYh/MEQ5uhPiVS2ASfmoLS4Atyd0 JvuA== X-Forwarded-Encrypted: i=1; AJvYcCW2Lt44n2SZgKgylK5LsH85OFZeT10PpSDSTGlObA8RjirLoWNKka4z0QrnNzU5L+BaKjItcpwMuBx9@vger.kernel.org X-Gm-Message-State: AOJu0Ywc3BH37OibJj2GZ6+JsTY1GIRu4Pbxef2/9WEFaK7qWsBxXkiF 9mXOYHi3uomVd0LYTxnCYFKJ2OxBK/5teegz+BdIQ38mecDj1BopPbsrbyKBdSb5cZrBYTpcjcV hQb95LvK9gOza7OvERofBwT6epOIHq0fL+tfcEnGqqqEKy1o9lWWZ9WtJEfE20fX5 X-Gm-Gg: ASbGncuJSkPd7GwaRCyz+yQOCCU3X8ThQjrXwjXLBbiChXyg+Ra57L8GqCIedadcXWh FOadcL1XxjSrIWN393fK3xWD1hNd+f2Kk4Vqg3vd9olgqlm5bC66OfX4oVoCCmGFnaPp4aYqKbp 3D/nAMgu1vK/iq+erma/1QKtq++74QkWoRoIxN9BelfVaDa99XKHY4J5jAMPEDYRwkHwbLab1xU ycAgyqH/hITgfQK7cWkN1k76KmleUCOCQjB0ndJjOudqlvHWFomg1fmuOlV5A9SugmM2KT+sRXf xXo9yOn48w14fOIdomjq/UUFxfX8TLHgTCZUUuJyY0vDAnkisdelZPg22q6PK/kKq08Rxad61Uc = X-Received: by 2002:a17:902:c947:b0:246:50c0:ae8b with SMTP id d9443c01a7336-248753a2457mr8293565ad.0.1756197447629; Tue, 26 Aug 2025 01:37:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcsvanQQhVTqAj+3WpxmpEJxea1foazHjAxs5RPzZAL5wRL/q9M+jNuyC6x5ISWJOuSgidVg== X-Received: by 2002:a17:902:c947:b0:246:50c0:ae8b with SMTP id d9443c01a7336-248753a2457mr8293215ad.0.1756197447048; Tue, 26 Aug 2025 01:37:27 -0700 (PDT) Received: from hu-jprakash-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-246ed91ee20sm36924785ad.136.2025.08.26.01.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Aug 2025 01:37:26 -0700 (PDT) From: Jishnu Prakash To: jic23@kernel.org, robh@kernel.org, krzysztof.kozlowski@linaro.org, krzk+dt@kernel.org, conor+dt@kernel.org, agross@kernel.org, andersson@kernel.org, lumag@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konradybcio@kernel.org, daniel.lezcano@linaro.org, sboyd@kernel.org, amitk@kernel.org, thara.gopinath@gmail.com, lee@kernel.org, rafael@kernel.org, subbaraman.narayanamurthy@oss.qualcomm.com, david.collins@oss.qualcomm.com, anjelique.melendez@oss.qualcomm.com, kamal.wadhwa@oss.qualcomm.com Cc: rui.zhang@intel.com, lukasz.luba@arm.com, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, jishnu.prakash@oss.qualcomm.com, quic_kotarake@quicinc.com, neil.armstrong@linaro.org, stephan.gerhold@linaro.org, Jonathan Cameron Subject: [PATCH V7 2/5] dt-bindings: iio: adc: Split out QCOM VADC channel properties Date: Tue, 26 Aug 2025 14:06:54 +0530 Message-Id: <20250826083657.4005727-3-jishnu.prakash@oss.qualcomm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250826083657.4005727-1-jishnu.prakash@oss.qualcomm.com> References: <20250826083657.4005727-1-jishnu.prakash@oss.qualcomm.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: 6wJm7TW3ZlnUug9D8XWYcHbAqjJUkqbK X-Proofpoint-ORIG-GUID: 6wJm7TW3ZlnUug9D8XWYcHbAqjJUkqbK X-Authority-Analysis: v=2.4 cv=Hd8UTjE8 c=1 sm=1 tr=0 ts=68ad7249 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=2OwXVqhp2XgA:10 a=gEfo2CItAAAA:8 a=KKAkSRfTAAAA:8 a=i0EeH86SAAAA:8 a=EUspDBNiAAAA:8 a=oDDNj9Hd53LkpBrnXyAA:9 a=uG9DUKGECoFWVXl0Dc02:22 a=sptkURWiP4Gy88Gu7hUp:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODI1MDE0MiBTYWx0ZWRfXwlfynkcb3QNs Za8aC7JT+e5BeIBEqXuCFcVvfIgBR7tGrBo9j8QE7caHNE4vD8E9yDCKNfUkoJchMWjyUukgFyT LBa+YQyDsJAHthrT1jU55ONuJ3TSwb6xeowQ5cjhKbL4mSPwJDtH0uXYl8ORHCHaq6lySfY1B9x NSoxYzZzR0vNwiaYYcJ69vrBx5GBYq+AJI2+WEKFXWR+1SLqDaETn+fpZkIAQwH/9AGNtO/KWww /12ioQNpMm8lPBeU4o6JkGfMeCzq9hOPo2UPznMZPjbo2IMr8yXyG4BjtoQvrL3o0YOjSfunLsN Wo+vvVpc68ZOx1WRdzenwhqJjfkDap+7Ogel/FKNYFFRTqytE9V7FQCrhBWIRPjLxACjrapK6DK uPeXBTam X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-26_02,2025-08-26_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508250142 Split out the common channel properties for QCOM VADC devices into a separate file so that it can be included as a reference for devices using them. This will be needed for the upcoming ADC5 Gen3 binding support patch, as ADC5 Gen3 also uses all of these common properties. Reviewed-by: Krzysztof Kozlowski Acked-by: Jonathan Cameron Signed-off-by: Jishnu Prakash --- .../iio/adc/qcom,spmi-vadc-common.yaml | 87 +++++++++++++++++++ .../bindings/iio/adc/qcom,spmi-vadc.yaml | 75 +--------------- 2 files changed, 89 insertions(+), 73 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc-common.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc-common.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc-common.yaml new file mode 100644 index 000000000000..cd087911ee88 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc-common.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-vadc-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. SPMI PMIC ADC channels + +maintainers: + - Jishnu Prakash + +description: + This defines the common properties used to define Qualcomm VADC channels. + +properties: + reg: + description: + ADC channel number. + See include/dt-bindings/iio/adc/qcom,spmi-vadc.h + For PMIC7 ADC, the channel numbers are specified separately per PMIC + in the PMIC-specific files in include/dt-bindings/iio/adc. + maxItems: 1 + + label: + description: + ADC input of the platform as seen in the schematics. + For thermistor inputs connected to generic AMUX or GPIO inputs + these can vary across platform for the same pins. Hence select + the platform schematics name for this channel. + + qcom,decimation: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + This parameter is used to decrease ADC sampling rate. + Quicker measurements can be made by reducing decimation ratio. + + qcom,pre-scaling: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Used for scaling the channel input signal before the signal is + fed to VADC. The configuration for this node is to know the + pre-determined ratio and use it for post scaling. It is a pair of + integers, denoting the numerator and denominator of the fraction by which + input signal is multiplied. For example, <1 3> indicates the signal is scaled + down to 1/3 of its value before ADC measurement. + If property is not found default value depending on chip will be used. + oneOf: + - items: + - const: 1 + - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ] + - items: + - const: 10 + - const: 81 + + qcom,ratiometric: + type: boolean + description: | + Channel calibration type. + - For compatible property "qcom,spmi-vadc", if this property is + specified VADC will use the VDD reference (1.8V) and GND for + channel calibration. If property is not found, channel will be + calibrated with 0.625V and 1.25V reference channels, also + known as absolute calibration. + - For other compatible properties, if this property is specified + VADC will use the VDD reference (1.875V) and GND for channel + calibration. If property is not found, channel will be calibrated + with 0V and 1.25V reference channels, also known as absolute calibration. + + qcom,hw-settle-time: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Time between AMUX getting configured and the ADC starting + conversion. The 'hw_settle_time' is an index used from valid values + and programmed in hardware to achieve the hardware settling delay. + + qcom,avg-samples: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Number of samples to be used for measurement. + Averaging provides the option to obtain a single measurement + from the ADC that is an average of multiple samples. The value + selected is 2^(value). + +required: + - reg + +additionalProperties: true diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml index bc3f8ccde536..cf6f6ed2a378 100644 --- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml @@ -56,7 +56,7 @@ required: patternProperties: "^channel@[0-9a-f]+$": type: object - additionalProperties: false + unevaluatedProperties: false description: | Represents the external channels which are connected to the ADC. For compatible property "qcom,spmi-vadc" following channels, also known as @@ -64,79 +64,8 @@ patternProperties: configuration nodes should be defined: VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV, VADC_GND_REF and VADC_VDD_VADC. + $ref: /schemas/iio/adc/qcom,spmi-vadc-common.yaml - properties: - reg: - maxItems: 1 - description: | - ADC channel number. - See include/dt-bindings/iio/adc/qcom,spmi-vadc.h - For PMIC7 ADC, the channel numbers are specified separately per PMIC - in the PMIC-specific files in include/dt-bindings/iio/adc. - - label: - description: | - ADC input of the platform as seen in the schematics. - For thermistor inputs connected to generic AMUX or GPIO inputs - these can vary across platform for the same pins. Hence select - the platform schematics name for this channel. - - qcom,decimation: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - This parameter is used to decrease ADC sampling rate. - Quicker measurements can be made by reducing decimation ratio. - - qcom,pre-scaling: - description: | - Used for scaling the channel input signal before the signal is - fed to VADC. The configuration for this node is to know the - pre-determined ratio and use it for post scaling. It is a pair of - integers, denoting the numerator and denominator of the fraction by which - input signal is multiplied. For example, <1 3> indicates the signal is scaled - down to 1/3 of its value before ADC measurement. - If property is not found default value depending on chip will be used. - $ref: /schemas/types.yaml#/definitions/uint32-array - oneOf: - - items: - - const: 1 - - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ] - - items: - - const: 10 - - const: 81 - - qcom,ratiometric: - description: | - Channel calibration type. - - For compatible property "qcom,spmi-vadc", if this property is - specified VADC will use the VDD reference (1.8V) and GND for - channel calibration. If property is not found, channel will be - calibrated with 0.625V and 1.25V reference channels, also - known as absolute calibration. - - For compatible property "qcom,spmi-adc5", "qcom,spmi-adc7" and - "qcom,spmi-adc-rev2", if this property is specified VADC will use - the VDD reference (1.875V) and GND for channel calibration. If - property is not found, channel will be calibrated with 0V and 1.25V - reference channels, also known as absolute calibration. - type: boolean - - qcom,hw-settle-time: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - Time between AMUX getting configured and the ADC starting - conversion. The 'hw_settle_time' is an index used from valid values - and programmed in hardware to achieve the hardware settling delay. - - qcom,avg-samples: - $ref: /schemas/types.yaml#/definitions/uint32 - description: | - Number of samples to be used for measurement. - Averaging provides the option to obtain a single measurement - from the ADC that is an average of multiple samples. The value - selected is 2^(value). - - required: - - reg allOf: - if: -- 2.25.1