Re: [PATCH v8 4/4] iio: cdc: add Texas Instruments FDC1004 driver
From: Victor Chernyakin
Date: Tue Nov 10 2026 - 19:18:47 EST
> > +static const int fdc1004_calibbias_decomposed[] = {
> > + lower_32_bits(fdc1004_calibbias[0]), upper_32_bits(fdc1004_calibbias[0]),
> > + lower_32_bits(fdc1004_calibbias[1]), upper_32_bits(fdc1004_calibbias[1]),
> > + lower_32_bits(fdc1004_calibbias[2]), upper_32_bits(fdc1004_calibbias[2]),
> > +};
> > +
> > +static const int fdc1004_calibscale_decomposed[] = {
> > + lower_32_bits(fdc1004_calibscale[0]), upper_32_bits(fdc1004_calibscale[0]),
> > + lower_32_bits(fdc1004_calibscale[1]), upper_32_bits(fdc1004_calibscale[1]),
> > + lower_32_bits(fdc1004_calibscale[2]), upper_32_bits(fdc1004_calibscale[2]),
> > +};
>
> Can we prepare them dynamically at runtime? Use global variables and a macro
> from once.h to make the populate function a singleton, so we don't have as many
> copies as devices on the system that are driven by this code. We can probably
> do this later, though.
Are you sure there's a separate copy for each device? In my understanding,
these static variables are loaded along with the module, and the module
is loaded only once and shared between all devices.