On Fri, 30 Jun 2023 at 23:59, Bjorn Andersson <quic_bjorande@xxxxxxxxxxx> wrote: > > On Fri, Jun 30, 2023 at 08:42:23PM +0300, Dmitry Baryshkov wrote: > > On Fri, 30 Jun 2023 at 19:15, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> wrote: > > > > > > On 30.06.2023 14:57, Dmitry Baryshkov wrote: > > > > On Fri, 30 Jun 2023 at 14:27, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> wrote: > > > >> > > > >> On 30.06.2023 12:07, Dmitry Baryshkov wrote: > > > >>> On Fri, 30 Jun 2023 at 11:19, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> wrote: > > > >>>> > > > >>>> On 30.06.2023 08:13, Dmitry Baryshkov wrote: > > > >>>>> Add thermal zones controlled through the ADC-TM (ADC thermal monitoring) > > > >>>>> PMIC interface. This includes several onboard sensors and the XO thermal > > > >>>>> sensor. > > > >>>>> > > > >>>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> > > > >>>>> --- > > > >>>> [...] > > > >>>>> > > > >>>>> + channel@144 { > > > >>>>> + reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>; > > > >>>> This define should be cleaned up.. Since it takes a sid argument, > > > >>>> it really is ADC7_AMUX_THM1_100K_PU(sid) > > > >>> > > > >>> I don't think I understood your comment. The define itself is specific > > > >>> to PM8350, other PMICs might have different channel assignments. > > > >> > > > >> include/dt-bindings/iio/qcom,spmi-vadc.h > > > >> 263:#define ADC7_AMUX_THM1_100K_PU 0x44 > > > > > > > > Do you want to define PM8350_ADC7_AMUX_THM1_100K_PU(sid) using > > > > ADC7_AMUX_THM1_100K_PU ? > > > > Or to make all users use ADC7_AMUX_THM1_100K_PU? > > > > > > > > > >Or add the SID > > > > argument to ADC7_AMUX_THM1_100K_PU and switch to it? > > > This. > > > > > > Since we have a generic binding for it (not sure what sort of ABI-ish rules > > > apply here, probably not very many since it's just a dumb preprocessor define), > > > we should not redefine it for each PMIC, especially since the SIDs are variable > > > nowadays :/ > > > > I think it would be worth to have per-PMIC headers (which define which > > channels are available on this PMIC), but to use values from the > > qcom,spmi-vadc.h header to define those per-PMIC values. > > > > WDYT? > > > > Note that the channel relates to this PMIC, but the sid is of the > measured PMIC. So I'm not sure which PMIC you're thinking of when you > say per-PMIC... Not quite. Both sid and channel are for the peasuring PMIC (pm8350b, pm8350, etc). On pmk8350 we further multiplex them into the 8 channels of adc-tm. > > Regards, > Bjorn -- With best wishes Dmitry