Re: [PATCH V6 4/5] iio: adc: Add support for QCOM PMIC5 Gen3 ADC

From: Jonathan Cameron
Date: Sat Jun 28 2025 - 12:31:42 EST




> >> + .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.
>
> Does this look fine?
>
> .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 },
Look good.

> >> +static int adc5_gen3_probe(struct platform_device *pdev)
> >> +{
> >
> >> +
> >> + platform_set_drvdata(pdev, indio_dev);
> >> + init_completion(&adc->complete);
> >> + mutex_init(&adc->lock);
> > If spinning again for other reasons, in new code I have slight preference for
> > ret = devm_mutex_init(&adc->lock);
> > if (ret)
> > return ret;
> >
> > 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


Jonathan