devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iio: accel: st_accel: handle deprecated bindings
Date: Sat, 7 Jan 2017 14:42:43 -0500	[thread overview]
Message-ID: <f264315c-4c4e-6e7f-80cf-e9cdf9aea237@kernel.org> (raw)
In-Reply-To: <20170105133233.24237-1-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On 05/01/17 08:32, Linus Walleij wrote:
> The earlier deployed LIS3LV02DL driver had already defined a few
> DT bindings that need to be supported by the new more generic
> driver and listed as compatible but deprecated bindings in the
> documentation.
> 
> After this we can start to activate the new driver with the old
> systems where applicable.
> 
> As part of this enablement: make us depend on the old drivers
> not being in use so we don't get a kernel with two competing
> drivers.
> 
> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Applied to the togreg branch of iio.git. Will push out as testing sometime soonish.
> ---
>  Documentation/devicetree/bindings/iio/accel/lis302.txt | 2 +-
>  Documentation/devicetree/bindings/iio/st-sensors.txt   | 2 ++
>  drivers/iio/accel/Kconfig                              | 2 ++
>  drivers/iio/accel/st_accel_i2c.c                       | 5 +++++
>  drivers/iio/accel/st_accel_spi.c                       | 9 +++++++++
>  5 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/lis302.txt b/Documentation/devicetree/bindings/iio/accel/lis302.txt
> index 2a19bff9693f..dfdce67826ba 100644
> --- a/Documentation/devicetree/bindings/iio/accel/lis302.txt
> +++ b/Documentation/devicetree/bindings/iio/accel/lis302.txt
> @@ -5,7 +5,7 @@ that apply in on the generic device (independent from the bus).
>  
>  
>  Required properties for the SPI bindings:
> - - compatible: 		should be set to "st,lis3lv02d_spi"
> + - compatible: 		should be set to "st,lis3lv02d-spi"
>   - reg:			the chipselect index
>   - spi-max-frequency:	maximal bus speed, should be set to 1000000 unless
>  			constrained by external circuitry
> diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
> index c040c9ad1889..eaa8fbba34e2 100644
> --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
> @@ -27,6 +27,8 @@ standard bindings from pinctrl/pinctrl-bindings.txt.
>  Valid compatible strings:
>  
>  Accelerometers:
> +- st,lis3lv02d (deprecated, use st,lis3lv02dl-accel)
> +- st,lis302dl-spi (deprecated, use st,lis3lv02dl-accel)
>  - st,lis3lv02dl-accel
>  - st,lsm303dlh-accel
>  - st,lsm303dlhc-accel
> diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig
> index c68bdb649005..ea295fe0f561 100644
> --- a/drivers/iio/accel/Kconfig
> +++ b/drivers/iio/accel/Kconfig
> @@ -140,11 +140,13 @@ config IIO_ST_ACCEL_3AXIS
>  
>  config IIO_ST_ACCEL_I2C_3AXIS
>  	tristate
> +	depends on !SENSORS_LIS3_I2C
>  	depends on IIO_ST_ACCEL_3AXIS
>  	depends on IIO_ST_SENSORS_I2C
>  
>  config IIO_ST_ACCEL_SPI_3AXIS
>  	tristate
> +	depends on !SENSORS_LIS3_SPI
>  	depends on IIO_ST_ACCEL_3AXIS
>  	depends on IIO_ST_SENSORS_SPI
>  
> diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
> index c0f8867aa1ea..99a7cdbe3d5d 100644
> --- a/drivers/iio/accel/st_accel_i2c.c
> +++ b/drivers/iio/accel/st_accel_i2c.c
> @@ -21,6 +21,11 @@
>  #ifdef CONFIG_OF
>  static const struct of_device_id st_accel_of_match[] = {
>  	{
> +		/* An older compatible */
> +		.compatible = "st,lis3lv02d",
> +		.data = LIS3LV02DL_ACCEL_DEV_NAME,
> +	},
> +	{
>  		.compatible = "st,lis3lv02dl-accel",
>  		.data = LIS3LV02DL_ACCEL_DEV_NAME,
>  	},
> diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c
> index c25ac50d4600..29a15f27a51b 100644
> --- a/drivers/iio/accel/st_accel_spi.c
> +++ b/drivers/iio/accel/st_accel_spi.c
> @@ -65,9 +65,18 @@ static const struct spi_device_id st_accel_id_table[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, st_accel_id_table);
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id lis302dl_spi_dt_ids[] = {
> +	{ .compatible = "st,lis302dl-spi" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, lis302dl_spi_dt_ids);
> +#endif
> +
>  static struct spi_driver st_accel_driver = {
>  	.driver = {
>  		.name = "st-accel-spi",
> +		.of_match_table = of_match_ptr(lis302dl_spi_dt_ids),
>  	},
>  	.probe = st_accel_spi_probe,
>  	.remove = st_accel_spi_remove,
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-01-07 19:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 13:32 [PATCH] iio: accel: st_accel: handle deprecated bindings Linus Walleij
     [not found] ` <20170105133233.24237-1-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-01-07 19:42   ` Jonathan Cameron [this message]
2017-01-09 18:16   ` Rob Herring
2017-01-10 19:55     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f264315c-4c4e-6e7f-80cf-e9cdf9aea237@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).