Re: [PATCH v2 2/2] input: adxl34x: Add OF match support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 15, 2015 at 3:54 PM, Laurent Pinchart
<laurent.pinchart+renesas@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx>

Acked-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> --- 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@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux