From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795979656; b=0CgL8UhZCsvUz+Fh0h6xnHGnzRaMjAe9EAJgRi/AipJ5/wxvjS5Y833j6ubVnyF3kZ1k dBRz6Nf4Mg1/eKPOsoc8IiR2t2tRQ4gx55ymrNM9Tll4HJIZ3fiLdH7VJwbnsPDRjkpYQ e7qzeL7RCevAK/kk5xF4CTXuc7/M8myo5qnbjfWUh1j+Wt1O5hHAfqoxA4QBVPNoFxv0e IPL+t3IIlAUzw4FZ15aB7hN4PGUk7poomyid8GRm4myKFnL+t7OXFVfcLsA+Jzp2Cmou0 WDVG/M5VL0/FrFRk/1qNfq3Q3ERR6RN4DnV0aXS9JbhTuEN3JO48Vk45kPMX52OC6rg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795979656; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=7wlKEYYNOIZcGKxu9lEIvy9WuRfgybqfUjZIMj3kPI8=; b=ESy0HqAbvGeI/RTHskvgKg1xfHU5UXlC9+DnUfrl9brWOEdxgC7cFFSj0ni/wueoKMTg bCQNJQdIEP8rLlRjFDk/M0rHd/VUM2ah40ua59NwYjuoxTIHarFPpRgrYdziTvLwKuXzh My1aXQTVsKgolqwUhjsM9dKPv3dpxuZqS3fay1szVHJh6BSbYJQr1iLFmzsKcVySCr28p Ig9dHqjuv+EpS8rn0fZaA1QJcL/wiaW6xepaZRrFfc24yE/zwdYe8vPLA6+aLbycAfbO1 ts1ZYFYVttkxGvjnSi/4+bqoWl3LAWKCQrsA+RiXaUPXLNXjHtz0T9ZVr4Rku8zctpA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZZ+JQmoa; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B8BB606A31C; Sun, 29 Nov 2026 19:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZZ+JQmoa Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48D021F00896; Sun, 29 Nov 2026 19:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795979656; bh=7wlKEYYNOIZcGKxu9lEIvy9WuRfgybqfUjZIMj3kPI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=ZZ+JQmoaNmJtQ4nJh9xoXSSv7JoBa2X9jsYO7MGmb9HnzPDvqlN4QjfvrX2srT8M4 rR3Ok0rmsy8yw8yTmskeLVTPXgN82BY8/oOPcSsPx8QsgCikSD8WctGlG3AiG5eSRP 6UbE4POZsGJh2iC0WfRDt2miGUDFU6snD7i5I+GxLly6jQlmuuRU+QjjhdRVHOqeMG a7klrFC9dCoNe7sPjbCJfFd37bsTQ6E9tfcgfu2PRZsRt5Mda0ogFlSGUMm0Hp3CYu 9euVK+DwFIOo0lsD1VgnPpYlj2b4LRdvhzZY8TBT1pGGCbl+WNJYbP3gPOuZwrcRJh VtOOH1M9O7vnQ== Date: Sun, 29 Nov 2026 19:14:07 +0000 From: Jonathan Cameron To: Jishnu Prakash Cc: Andy Shevchenko , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Kamal Wadhwa , Anjelique Melendez , Manaf Meethalavalappu Pallikunhi , Priyansh Jain Subject: Re: [PATCH v2 3/7] iio: adc: qcom-spmi-adc5-gen3: Add support for QCOM PMIC5 Gen4 ADC Message-ID: <20261129191407.0597e44e@jic23-hlaptop> In-Reply-To: References: <20261120-pmic5_gen4_adc-v2-0-94d0e1fd6847@oss.qualcomm.com> <20261120-pmic5_gen4_adc-v2-3-94d0e1fd6847@oss.qualcomm.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 29 Nov 2026 19:42:14 +0530 Jishnu Prakash wrote: > Hi Andy, > > On 11/20/2026 3:44 PM, Andy Shevchenko wrote: > > On Fri, Nov 20, 2026 at 02:49:43PM +0530, Jishnu Prakash wrote: > >> PMIC5 Gen4 ADC is similar to PMIC5 Gen3 ADC, with several changes made > >> for improved performance, mostly at the hardware level. > >> > >> One significant software change is that ratiometric conversion resolution > >> has been increased from 14 bits to 16 bits, so the maximum value of > >> these measurements needs to be updated for Gen4. Add a new scaling > >> function for thermistor channels which use this type of conversion. > >> > >> It is possible that the master PMIC has ADC of one generation and it needs > >> to communicate with another PMIC with ADC of a different generation. For > >> example, on SM8750, PMK8550 is the master PMIC with Gen3 ADC and it > >> communicates with PMIH0108, which has Gen4 ADC. Add a new DT property > >> "qcom,adc5-gen4" to distinguish Gen4 channels under a Gen3 master, to > >> ensure that their conversions are handled correctly. > >> > >> In the latest PMIC arbiter version (v8), there can be up to 4 buses > >> under the PMIC arbiter and 32 PMICs under each bus. In order to > >> support communication between ADC on the master PMIC and ADCs on any > >> of the other PMICs, a field of width 2 bits is added for bus index > >> and the bits for SID are extended from 4 to 5 bits, in the SID > >> register. Add support for this. > > > > ... > > > >> - /* Write SID */ > >> - buf[0] = FIELD_PREP(ADC5_GEN3_SID_MASK, prop->sid); > >> + /* Write SID and bus_id*/ > > > > Missed space. > > > >> + buf[0] = FIELD_PREP(ADC5_GEN4_BUS_INDEX_MASK, prop->bus_index) | > >> + FIELD_PREP(ADC5_GEN4_SID_MASK, prop->sid); > > > > ... > > > >> -static const struct adc5_data adc5_gen3_data_pmic = { > >> - .full_scale_code_volt = 0x70e4, > >> - .adc_chans = adc5_gen3_chans_pmic, > >> - .info = &adc5_gen3_info, > >> - .decimation = (unsigned int [ADC5_DECIMATION_SAMPLES_MAX]) > >> - { 85, 340, 1360 }, > >> - .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 }, > >> -}; > > > > Seems like this is existing piece and you moved it up. Please, split that part > > to a separate prerequisite patch. > > I think I moved it upwards because it was referenced in adc5_gen3_get_fw_channel_data(), > which came before this point, but that was not really needed, as I could use a > forward declaration instead. I'll move it back here and keep a forward declaration > for it in the next patch version. Moving it is better, but simple code moves can be separate patches so that reviewers can immediately see that you are just moving code. Otherwise they are looking closely to spot what changed! >