[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1C592E6A-8F14-4BCF-A760-CABE6642276C@watter.com>
Date: Wed, 20 Aug 2025 07:23:47 -0400
From: Ben Collins <bcollins@...ter.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Andrew Hepp <andrew.hepp@...pp.dev>,
linux-iio@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 4/5] iio: mcp9600: Recognize chip id for mcp9601
> On Aug 20, 2025, at 7:11 AM, Ben Collins <bcollins@...ter.com> wrote:
>
>>
>> On Aug 20, 2025, at 6:07 AM, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
>>
>> On Wed, Aug 20, 2025 at 2:45 AM Ben Collins <bcollins@...ter.com> wrote:
>>>
>>> The current driver works with mcp9601, but emits a warning because it
>>> does not recognize the chip id.
>>>
>>> MCP9601 is a superset of MCP9600. The drivers works without changes
>>> on this chipset.
>>>
>>> However, the 9601 chip supports open/closed-circuit detection if wired
>>> properly, so we'll need to be able to differentiate between them.
>>>
>>> Moved "struct mcp9600_data" up in the file since a later patch will
>>> need it and chip_info before the declerations.
>>
>> declarations
>>
>> ...
>>
>>> +struct mcp9600_data {
>>> + struct i2c_client *client;
>>> +};
>>> +
>>> #define MCP9600_CHANNELS(hj_num_ev, hj_ev_spec_off, cj_num_ev, cj_ev_spec_off) \
>>> { \
>>> { \
>>> @@ -123,10 +133,6 @@ static const struct iio_chan_spec mcp9600_channels[][2] = {
>>> MCP9600_CHANNELS(2, 0, 2, 0), /* Alerts: 1 2 3 4 */
>>> };
>>>
>>> -struct mcp9600_data {
>>> - struct i2c_client *client;
>>> -};
>>> -
>>
>> It's not obvious why this piece of change is needed. AFAICS it's a stray change.
>
> The explanation is in the changelog above. A follow up patch needs both struct
> declarations to be where I added one and moved mcp9600_data to. It’s just ordering
> so I don’t later have to forward declare new functions for filter_type, which make
> use of these structs, but need to be in the iio_chan_spec mcp9600_channels[]
> declaration.
>
> I guess I could move mcp9600_data in that series, but I had this in here before
> I split that series out, and it seemed simple enough to leave in.
Correction, patch 5/5 needs it. Either I move it in 4/5 (cleaner since I was
already adding a new related struct), or in 5/5, or a longer reorg to include
moving that struct and mcp9600_config() in the mcp9600-iir series.
Powered by blists - more mailing lists