RE: [PATCH 6/6] hwmon: (pmbus/max20830): add support for max20830c and max20840c
From: Torreno, Alexis Czezar
Date: Wed Jul 01 2026 - 22:51:01 EST
> >>>
> >>> static const struct of_device_id max20830_of_match[] = {
> >>> - { .compatible = "adi,max20830" },
> >>> + { .compatible = "adi,max20830", .data = &max20830_chip },
> >>> + { .compatible = "adi,max20830c", .data = &max20830c_chip },
> >>> + { .compatible = "adi,max20840c", .data = &max20840c_chip },
> >>
> >> "adi,max20830" is a fallback for the other two chips, but that is not
> >> how the code is implemented.
> >>
> >
> > I may be inclined to just not use fallback as it seems to be more
> > complicated and a bit unnecessary. There's also other devices that may
> > be added on top of this so it lessens the complexity. Will edit the bindings
> regarding this.
> >
>
> You are missing the point. The fallback is perfectly valid. Technically the driver
> does not even need to support adi,max20830c and adi,max20840c.
> That is only used to validate that the chip is supported. That does not need a
> separate devicetree entry.
>
Checking if I understand this. I need to add a check that if DT chip->id = max20830,
and if the HW returns string of either nmax20830c or max20840c, device still probes
if ((buf == "max20830c" || buf == "max20840c) && chip->id != "max20830""
// then it's an error...
}
and
"That does not need a separate devicetree entry."
does this mean I shouldn't add to the bindings and max20830_id[]/max20830_of_match[]
entries, and keep it as is that it only takes max20830?
To add support for the 830c and 840c variants, the code discussed above is enough?