[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d1229162-b97b-4261-9c4a-e1f83ef14378@baylibre.com>
Date: Wed, 9 Oct 2024 16:53:52 +0200
From: Guillaume Stols <gstols@...libre.com>
To: Nuno Sá <noname.nuno@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Jonathan Corbet <corbet@....net>
Cc: linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
aardelean@...libre.com, dlechner@...libre.com, jstephan@...libre.com,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v4 5/8] iio: adc: ad7606: Add compatibility to fw_nodes
On 10/9/24 16:39, Nuno Sá wrote:
> On Wed, 2024-10-09 at 09:19 +0000, Guillaume Stols wrote:
>> On the parallel version, the current implementation is only compatible
>> with id tables and won't work with fw_nodes, this commit intends to fix
>> it.
>>
>> Doing so required to declare ad7606_chip_info structures in the .h file
>> so to make them accessible to all the driver files that can set a
>> pointer to the corresponding chip as the driver data.
>>
>> Signed-off-by: Guillaume Stols <gstols@...libre.com>
>> ---
>> drivers/iio/adc/ad7606.c | 283 ++++++++++++++++++++++++-------------------
>> drivers/iio/adc/ad7606.h | 32 +++--
>> drivers/iio/adc/ad7606_par.c | 30 +++--
>> drivers/iio/adc/ad7606_spi.c | 96 +++++++++------
>> 4 files changed, 254 insertions(+), 187 deletions(-)
>>
>> diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
>> index 5b276d087ec3..dfbdea8c28ba 100644
>> --- a/drivers/iio/adc/ad7606.c
>> +++ b/drivers/iio/adc/ad7606.c
>> @@ -78,6 +78,155 @@ static const unsigned int ad7616_oversampling_avail[8] = {
>>
> ...
>
>> +const struct ad7606_chip_info ad7616_info = {
>> + .channels = ad7616_channels,
>> + .init_delay_ms = 15,
>> + .name = "ad7616",
>> + .num_channels = 17,
>> + .oversampling_avail = ad7616_oversampling_avail,
>> + .oversampling_num = ARRAY_SIZE(ad7616_oversampling_avail),
>> + .os_req_reset = true,
>> + .scale_setup_cb = ad7606_16bit_chan_scale_setup,
>> +};
>> +EXPORT_SYMBOL_NS_GPL(ad7616_info, IIO_AD7606);
>>
> Maybe my eyes are tricking me but I'm not seeing any MODULE_IMPORT_NS() in the
> drivers?
Hi Nuno,
The ad7606_spi.c and ad7606_par.c use MODULE_IMPORT_NS(IIO_AD7606).
Chip infos are used in the "coupling" structures, e.g:
static const struct ad7606_bus_info ad7616_bus_info = {
.chip_info = &ad7616_info,¬
.bops = &ad7616_spi_bops,¬
};¬
Guillaume
> - Nuno Sá
>
>
Powered by blists - more mailing lists