Re: [PATCH v2 2/3] Input: aw86938 - add driver for Awinic AW86938
From: Dmitry Torokhov
Date: Mon Feb 02 2026 - 06:08:58 EST
On Mon, Feb 02, 2026 at 11:19:36AM +0100, Konrad Dybcio wrote:
> On 2/2/26 11:14 AM, Luca Weiss wrote:
> > Hi Konrad,
> >
> > On Mon Feb 2, 2026 at 11:12 AM CET, Konrad Dybcio wrote:
> >> On 2/1/26 2:49 AM, Dmitry Torokhov wrote:
> >>> Hi Griffin,
> >>>
> >>> On Wed, Jan 28, 2026 at 04:51:14PM +0100, Griffin Kroah-Hartman wrote:
> >>>> @@ -717,9 +746,19 @@ static int aw86927_detect(struct aw86927_data *haptics)
> >>>>
> >>>> chip_id = be16_to_cpu(read_buf);
> >>>>
> >>>> - if (chip_id != AW86927_CHIPID) {
> >>>> - dev_err(haptics->dev, "Unexpected CHIPID value 0x%x\n", chip_id);
> >>>> - return -ENODEV;
> >>>> + switch (haptics->model) {
> >>>> + case AW86927:
> >>>> + if (chip_id != AW86927_CHIPID) {
> >>>> + dev_err(haptics->dev, "Unexpected CHIPID value 0x%x\n", chip_id);
> >>>> + return -ENODEV;
> >>>> + }
> >>>
> >>> If we are able to query chip ID why do we need to have separate
> >>> compatibles? I would define chip data structure with differences between
> >>> variants and assign and use it instead of having separate compatible.
> >>
> >> dt-bindings guidelines explicitly call for this, a chipid comparison
> >> then works as a safety net
> >
> > Are you saying, that
> >
> > 1. we should enforce dt-bindings == CHIP_ID (what's currently done)
>
> This
No. If there is a compatible chip with different ID (for whatever reason
- maybe there is additional functionality that either board does not
need or the driver does not implement) we absolutely should not refuse
to bind the driver.
Hint: this thing is called _compatible_ for a reason.
>
> >
> > or
> >
> > 2. we should have both compatibles with no handling based on compatible,
> > but only use CHIP_ID at runtime to change behavior
>
> This is spaghetti
I really do not understand the aversion of DT maintainers to generic
compatibles. We see this in I2C HID where we keep adding compatibles
for what could be described via device properties.
Thanks.
--
Dmitry