Re: [PATCH v2 2/2] input: adxl34x: Add OF match support
From: Geert Uytterhoeven <hidden>
Date: 2015-01-15 17:45:33
Also in:
linux-i2c, linux-sh
On Thu, Jan 15, 2015 at 3:54 PM, Laurent Pinchart [off-list ref] wrote:
The I2C subsystem can match devices without explicit OF support based on the part of their compatible property after the comma. However, this mechanism uses the first compatible value only. For adxl34x OF device nodes the compatible property will contain the more specific "adi,adxl345" or "adi,adxl346" value first. This prevents the device node from being matched with the adxl34x driver. Fix this by adding an OF match table with an "adi,adxl345" compatible entry. There's no need to add the "adi,adxl346" entry as the ADXL346 is backward-compatible with the ADXL345 with differences handled by runtime detection of the device model.
Thanks!
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Acked-by: Geert Uytterhoeven <redacted>
quoted hunk
--- a/drivers/input/misc/adxl34x-i2c.c +++ b/drivers/input/misc/adxl34x-i2c.c
+#ifdef CONFIG_OF
+static const struct of_device_id adxl34x_of_id[] = {
+ /*
+ * The ADXL346 is backward-compatible with the ADXL345. Differences are
+ * handled by runtime detection of the device model, there's thus no
+ * need for listing the "adi,adxl346" compatible value explicitly.
+ */
+ { .compatible = "adi,adxl345", },
+ /*
+ * Deprecated, DT nodes should use one or more of the device-specific
+ * compatible values "adi,adxl345" and "adi,adxl346".Ideally, the two comments above are moved to a real DT binding document ;-)
+ */
+ { .compatible = "adi,adxl34x", },I'd append "/* deprecated */" to the line above, so "git grep adxl34x" will show its deprecated status.
+ { }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds