From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 774AF1DB12E for ; Thu, 17 Jul 2025 06:04:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752732292; cv=none; b=aAzeDSm2/P4YgvRLxe9au+f4UPTSShddaHQyBen7jC+Dz3lruTQCNZ3TbudK4+VTt4anNMSPsxEQ+XxZDqyPvwvc80kEda++ooWL0z2LT9ohTt+YzOZBrBke1abrBgGM+mP/uQGnXQi+wfoYEsa95K0bD1nKFkUjWJSgw3NRaUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752732292; c=relaxed/simple; bh=/eI8FTCpncUNzSRdBop7/8qiRihLxNb69wVgieMvvy4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pmAJso3B3EXKwGoUMQ2g2y8ZzHWhQm11JlEwlK2S/6I1jCvnsr6R7fN5WSHHjLWpVI6gGZLtdTnVJbCagJQD98jI9fEWNhKg6P761QS4L5GPGG4vPAeotbQdqOdE3zObGQICKQYBcL49fzK0vZ9HqStxUcV8dXx8ky1qqtidruU= 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=ZLV2ZRl3; arc=none smtp.client-ip=205.220.168.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="ZLV2ZRl3" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56H46Hhb020653 for ; Thu, 17 Jul 2025 06:04:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ectNLSsr0geVGNTSYPuw96/Hkm3S5cAjwHokocTaqA8=; b=ZLV2ZRl3Rg7wgDRP QHagA1gAAS0/iFZO9Pv79mBwHopjmEYU0EToYHuzp8p1PzSAidNDCf+daY/1orXP JeuHLrQ2nzP7Rpax4gt0jUBmdfykWeQhIqslBIaugLjmfkJcKgCMoo6r1NJhtw5z nTUm90E1rgRpXDRchNCkFkmSDv4kXGiYAWDas9VRLAS4OGFe5AI7G7/aZk1V9i6I TyixfZRUj/uJgX8ocsO2BXwG6sfFQT4pe4kQNOFclCgkwQVSQUJ4YMH4Yh/EgPlL MscWNr3p1StnFBB6AD2afK2e1e/JpqFQaVaWYAnV4aeGoFq4m/ly29TS5/zjvZqY JClcIA== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47w5dphft2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 17 Jul 2025 06:04:49 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-74d15d90cdbso624890b3a.0 for ; Wed, 16 Jul 2025 23:04:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752732289; x=1753337089; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ectNLSsr0geVGNTSYPuw96/Hkm3S5cAjwHokocTaqA8=; b=qED0oitSxefLoDFg4IW5P5CCTdEtmH2Fh0h9QwWzsupdTmvm8RScuZSvFDtpZMx44L J+tP9n/eyXInumC+6IeeqSmBQAdFkOIzK7FF4WK1u3FKbPDCav5GdziqESuvjckvvprp 8ff9Pwyh6i0CLBs6Tl1YYfhg/fNyf4tKs9roQOS8PLBDE/A+E1vRvITbgr/M8RQkB26d nINDmmCOiNGcBhqKreV6PzfScSD+Evxyf+UlxQKlHl6KrXCPcX6Q3W2azzqw2GZDYjkl IhtaAhcd0pmXAuuHaUUIPUO2OhlgJv9KXPPdtHwSXMMqaBOZK/0JKMESEzn8PNX6Vadj P1tg== X-Forwarded-Encrypted: i=1; AJvYcCVsrKZT6SNTwriI3dNGl3nCgXXg7OZ0VfKceHaWBih3sIbSC8XC0qYAAXnfqM1IZLbXP/3tkjep+Eon@vger.kernel.org X-Gm-Message-State: AOJu0YyEH7oBeldkNBs26z9+i5n5UP1YY4ue9Q/zBHDlQ/Z64MLXFqh+ ENqzvJr5z4qnCk+wjbpwgaxlSawcdBx1kf81NV0nq5PBN/IVqPx0Ir6rDh2jDic1W7CT+MNCOZh T58AhMzIJv1anOpVnDNRcctOEHzcgpp+q9n6BeT4535HFRt4DfVqpMp9yAkK8fOhY X-Gm-Gg: ASbGncv5EjJrQAfb3WdMs3MgOzOfXC4yYuvEzxk9pUCZUoIbygsrYbqwAkWzCCZDTTm 39RreCEzZz57ykIEeMHsPwRsRHiol+Mskr6DqMFSg0KjlzXMfJQ7XJQYHB7oyD3o/HX6G4GZ/Ln +Y4CORQhDrRMrsn1VhMg3IpQPH3axpkPyKAfJicAR8H810YEJPFakk6Cfa4hOeOsZvuucWRr9wB VwHV40Gi+F2Am3pt2gxJobtbi8F0OSKZUnaj7luPxrbhA8poivbV9OvV1/cqPJqCdZootMLYr03 RROm93tS5L8UW12HzuhkTsUMbL+9HO6MIyseQ1ijDfVYZeUm4gUxPYDuz2wN X-Received: by 2002:a05:6a00:1945:b0:736:5f75:4a3b with SMTP id d2e1a72fcca58-75722869626mr7421077b3a.7.1752732288316; Wed, 16 Jul 2025 23:04:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyCadxiKqAnRGrg3kJEgXbKAZ6HS0QuHqlNsqoAGcHtBpNmUUMpDgDD0/MOYYxsR7Y2b2Q5w== X-Received: by 2002:a05:6a00:1945:b0:736:5f75:4a3b with SMTP id d2e1a72fcca58-75722869626mr7421020b3a.7.1752732287518; Wed, 16 Jul 2025 23:04:47 -0700 (PDT) Received: from [10.216.10.110] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-74eb9dd73c3sm14960668b3a.7.2025.07.16.23.04.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jul 2025 23:04:47 -0700 (PDT) Message-ID: <617d207c-995a-4375-bd5d-2e1e5c459bba@oss.qualcomm.com> Date: Thu, 17 Jul 2025 11:34:34 +0530 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V6 4/5] iio: adc: Add support for QCOM PMIC5 Gen3 ADC To: Jonathan Cameron Cc: 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, quic_kamalw@quicinc.com, 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, quic_skakitap@quicinc.com, neil.armstrong@linaro.org, stephan.gerhold@linaro.org References: <20250509110959.3384306-1-jishnu.prakash@oss.qualcomm.com> <20250509110959.3384306-5-jishnu.prakash@oss.qualcomm.com> <20250511140418.33171ca3@jic23-huawei> <20250628173112.63d9334e@jic23-huawei> <5b55acbf-065d-4383-a816-82561bf91273@oss.qualcomm.com> <20250713143149.60763b52@jic23-huawei> Content-Language: en-US From: Jishnu Prakash In-Reply-To: <20250713143149.60763b52@jic23-huawei> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzE3MDA1MCBTYWx0ZWRfX5OAYDHtxFVta Zmrfpq9KevjelKDqZmOCAXG8o4+91ZlYiOGUIxI17RJlPQHTdXDj0oyEAWiNCzWKFaK6csz4val KvM3/lGVAJGdIS9wmDoBVlXbg7QJkdQOyZ9fWI90hwFPUYrYTBXKnBH6ScfKsbYvBeeYDY/IRnn w3HGJWcxtab2wv1ia1SNhrPSwMEBpqXnghCAa6YV+brel3ITat+gK3TUEWSeBkqF+dXZh53m9st J3JMeSQdrouY3glL9wwdjJM3ZzFSt1BVGNuA+1WOHUfMsFHOL3N+YnMgwHGP8ttjPdwmqSSaQVq 03ljJDNxQAH/i2P3hXubfDuB3RYt7/25Xcl/2fD1hSgemENeCcpAdIxr+NU/aqnJmHEKOhGFnJU RJ0O69B/wY+loIjgzY1bx1B8zco9twSKYxSjTEIYRXzRDjWm2OU+pdgO4VFhFSqW8UnB0IYC X-Proofpoint-GUID: BH-j9WxsiuDcNabZdfL6yUpvtfl66bNG X-Proofpoint-ORIG-GUID: BH-j9WxsiuDcNabZdfL6yUpvtfl66bNG X-Authority-Analysis: v=2.4 cv=Y+r4sgeN c=1 sm=1 tr=0 ts=68789281 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=Wb1JkmetP80A:10 a=EUspDBNiAAAA:8 a=rjtObUXQbTieMrY6Fj4A:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 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-07-17_01,2025-07-16_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=740 phishscore=0 malwarescore=0 priorityscore=1501 adultscore=0 impostorscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507170050 Hi Jonathan, On 7/13/2025 7:01 PM, Jonathan Cameron wrote: > On Thu, 10 Jul 2025 12:14:13 +0530 > Jishnu Prakash wrote: > >> Hi Jonathan, >> >> On 6/28/2025 10:01 PM, Jonathan Cameron wrote: >>> >>> >>>>>> + .hw_settle_1 = (unsigned int [VADC_HW_SETTLE_SAMPLES_MAX]) >>>>>> + { 15, 100, 200, 300, 400, 500, 600, 700, >>>>>> + 1000, 2000, 4000, 8000, 16000, 32000, >>>>>> + 64000, 128000 }, >>>>> Andy often points this out, but I'll do it this time. Fixed numbers (typically power of 2) >>>>> elements per line make it much easier to see which element is which in these arrays. >>>>> Reduce the indent a little to allow that here. >> >> ... >> >>>>> >>>>> It was never worth bothering with release until we had devm managed form but >>>>> now we do the code complexity cost is low enough to make it reasonable. >>>>> >>>>>> + indio_dev->name = pdev->name; >>>>> >>>>> Just to check. Does that end up as a part number or similar? >>>> >>>> I printed this name and it appeared like this: >>>> >>>> indio_dev->name: c426000.spmi:pmic@0:adc@9000 >>>> >>>> It only gets the DT node names, which are generic, there are >>>> no part numbers in this name. >>> I thought it might be something along those lines. >>> >>> indio_dev->name should be the part number so hard code it rather than >>> getting it from the pdev->name >>> >> >> Actually there would be more than one PMIC which can function as the master PMIC >> for Gen3 ADC functionality, so I don't think I can simply hard code a name here >> based on PMK8550, if we want to keep the part number correct. >> >> Since we can't get the part number directly from the DT node names, we >> could try one of the following ways to add it: >> >> 1. Add a devicetree property for the part number >> This would be simple, but I'm not sure if this is the best way, >> if the below method looks good. > Nope as if you need a part number, that's should be via the compatible. >> >> 2. Add a string in the compatible property for the part number. >> This means updating the compatible from "qcom,spmi-adc5-gen3" >> to something like this for PMK8550: >> >> compatible = "qcom,pmk8550-adc5-gen3", "qcom,spmi-adc5-gen3"; >> >> and then extracting the part number from the first string. > > Do it via a compatible lookup + data in relevant tables rather > than messing with string break up. Sometimes we'll get the > part number of the fallback compatible but I don't really care. > However, see below - I think spmi-adc5-gen3 is effectively the > part number for the IP. It just happens to be inside a PMIC > that has another name. > >> >> Please let me know which method you would prefer. >> >> In addition, does the below string look fine, to assign to >> indio_dev->name for PMK8550? >> >> pmk8550_adc > > That's ok, though given it's an ADC anyway, pmk8550 should be sufficient > for this IIO specific name. > If it makes no practical difference what PMIC it is for this driver > then simply use spmi-adc5-gem3 or something along those lines. > So kind of a generic part number for the IP rather than specifics of > which PMIC it is implemented in. > Thanks for your confirmation. Your above statement is true here, the exact PMIC used here does not make any practical difference for the driver's functionality, so I'll use the generic part name "spmi-adc5-gen3" for this IP. Thanks, Jishnu > Jonathan > >