Hi Dmitry,
On 12/6/2025 7:52 AM, Dmitry Baryshkov wrote:
On Thu, Nov 27, 2025 at 07:10:35PM +0530, Jishnu Prakash wrote:
quoted
The ADC architecture on PMIC5 Gen3 is similar to that on PMIC5 Gen2,
with all SW communication to ADC going through PMK8550 which
communicates with other PMICs through PBS.
...
quoted
drivers/iio/adc/Kconfig | 30 +
drivers/iio/adc/Makefile | 2 +
drivers/iio/adc/qcom-adc5-gen3-common.c | 107 +++
drivers/iio/adc/qcom-spmi-adc5-gen3.c | 767 ++++++++++++++++++
include/linux/iio/adc/qcom-adc5-gen3-common.h | 216 +++++
5 files changed, 1122 insertions(+)
create mode 100644 drivers/iio/adc/qcom-adc5-gen3-common.c
create mode 100644 drivers/iio/adc/qcom-spmi-adc5-gen3.c
create mode 100644 include/linux/iio/adc/qcom-adc5-gen3-common.h
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 58a14e6833f6..da201a9a6950 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -1319,6 +1319,36 @@ config QCOM_SPMI_ADC5
To compile this driver as a module, choose M here: the module will
be called qcom-spmi-adc5.
+config QCOM_ADC5_GEN3_COMMON
+ tristate
This Kconfig (and the module) are used only by QCOM_SPMI_ADC5_GEN3. Why
do you need to separate them? Your thermal module doesn't depend on the
common functions.
The module added with the above config has five exported functions which are
all used in the thermal module. But now it looks like I have exported functions
both in the common module (drivers/iio/adc/qcom-adc5-gen3-common.c) as well as
in the main ADC driver file (drivers/iio/adc/qcom-spmi-adc5-gen3.c), which
seems like unnecessary separation. So I can drop the separate file as you
mentioned, and keep all the exported functions in the main driver file alone,
in the next patch series.
Thanks,
Jishnu
quoted
+
+config QCOM_SPMI_ADC5_GEN3
+ tristate "Qualcomm Technologies Inc. SPMI PMIC5 GEN3 ADC"
+ depends on SPMI && THERMAL
+ select REGMAP_SPMI
+ select QCOM_VADC_COMMON
+ select QCOM_ADC5_GEN3_COMMON
+ select AUXILIARY_BUS
+ help