devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Denis CIOCCA <denis.ciocca@st.com>
Cc: Robert Jones <rjones@gateworks.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH 2/2] iio: accel: add support to LIS2DE12
Date: Sat, 16 Mar 2019 15:12:24 +0000	[thread overview]
Message-ID: <20190316151224.41a5f595@archlinux> (raw)
In-Reply-To: <20190316150632.716aedde@archlinux>

On Sat, 16 Mar 2019 15:06:32 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sat, 9 Mar 2019 01:14:21 +0000
> Denis CIOCCA <denis.ciocca@st.com> wrote:
> 
> > Acked-by: Denis Ciocca <denis.ciocca@st.com>  
> Applied with the minor tweak to drop the -accel postfix.
I clicked too quick as my build test was running slow.

This doesn't build. See below. For now I've backed out both
patches.

Jonathan

> 
> Thanks,
> 
> Jonathan
> 
> > 
> > Thanks,
> > Denis
> > 
> > -----Original Message-----
> > From: linux-iio-owner@vger.kernel.org <linux-iio-owner@vger.kernel.org> On Behalf Of Robert Jones
> > Sent: Tuesday, March 5, 2019 12:33 PM
> > To: Jonathan Cameron <jic23@kernel.org>; Rob Herring <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>
> > Cc: devicetree@vger.kernel.org; linux-iio@vger.kernel.org; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>; Robert Jones <rjones@gateworks.com>
> > Subject: [PATCH 2/2] iio: accel: add support to LIS2DE12
> > 
> > Add support to STMicroelectronics LIS2DE12 accelerometer in st_accel framework.
> > 
> > http://www.st.com/resource/en/datasheet/lis2de12.pdf
> > 
> > Signed-off-by: Robert Jones <rjones@gateworks.com>
> > ---
> >  drivers/iio/accel/Kconfig         |  2 +-
> >  drivers/iio/accel/st_accel.h      |  2 ++
> >  drivers/iio/accel/st_accel_core.c | 76 +++++++++++++++++++++++++++++++++++++++
> >  drivers/iio/accel/st_accel_i2c.c  |  5 +++
> >  4 files changed, 84 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 898839c..ffd0b4d 100644
> > --- a/drivers/iio/accel/Kconfig
> > +++ b/drivers/iio/accel/Kconfig
> > @@ -223,7 +223,7 @@ config IIO_ST_ACCEL_3AXIS
> >  	  Say yes here to build support for STMicroelectronics accelerometers:
> >  	  LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
> >  	  LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL,
> > -	  LNG2DM, LIS3DE
> > +	  LNG2DM, LIS3DE, LIS2DE12
> >  
> >  	  This driver can also be built as a module. If so, these modules
> >  	  will be created:
> > diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h index fd53258..753a5671 100644
> > --- a/drivers/iio/accel/st_accel.h
> > +++ b/drivers/iio/accel/st_accel.h
> > @@ -34,6 +34,7 @@ enum st_accel_type {
> >  	LIS3LV02DL,
> >  	LIS2DW12,
> >  	LIS3DHH,
> > +	LIS2DE12,
> >  	ST_ACCEL_MAX,
> >  };
> >  
> > @@ -57,6 +58,7 @@ enum st_accel_type {
> >  #define LIS2DW12_ACCEL_DEV_NAME		"lis2dw12"
> >  #define LIS3DHH_ACCEL_DEV_NAME		"lis3dhh"
> >  #define LIS3DE_ACCEL_DEV_NAME		"lis3de"
> > +#define LIS2DE12_ACCEL_DEV_NAME		"lis2de12_accel"
> >  
> >  /**
> >  * struct st_sensors_platform_data - default accel platform data diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
> > index 9930edf..aebd611 100644
> > --- a/drivers/iio/accel/st_accel_core.c
> > +++ b/drivers/iio/accel/st_accel_core.c
> > @@ -831,6 +831,82 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
> >  		.multi_read_bit = false,
> >  		.bootime = 2,
> >  	},
> > +	{
> > +	.wai = 0x33,
> > +	.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
> > +	.sensors_supported = {
> > +		[0] = LIS2DE12_ACCEL_DEV_NAME,
> > +	},
> > +	.ch = (struct iio_chan_spec *)st_accel_8bit_channels,
> > +	.odr = {
> > +		.addr = 0x20,
> > +		.mask = 0xf0,
> > +		.odr_avl = {
> > +			{ .hz = 1, .value = 0x01, },
> > +			{ .hz = 10, .value = 0x02, },
> > +			{ .hz = 25, .value = 0x03, },
> > +			{ .hz = 50, .value = 0x04, },
> > +			{ .hz = 100, .value = 0x05, },
> > +			{ .hz = 200, .value = 0x06, },
> > +			{ .hz = 400, .value = 0x07, },
> > +			{ .hz = 1600, .value = 0x08, },
> > +			{ .hz = 5376, .value = 0x09, },
> > +		},
> > +	},
> > +	.pw = {
> > +		.addr = 0x20,
> > +		.mask = 0xf0,
> > +		.value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
> > +	},
> > +	.enable_axis = {
> > +		.addr = ST_SENSORS_DEFAULT_AXIS_ADDR,
> > +		.mask = ST_SENSORS_DEFAULT_AXIS_MASK,
> > +	},
> > +	.fs = {
> > +		.addr = 0x23,
> > +		.mask = 0x30,
> > +		.fs_avl = {
> > +			[0] = {
> > +				.num = ST_ACCEL_FS_AVL_2G,
> > +				.value = 0x00,
> > +				.gain = IIO_G_TO_M_S_2(15600),
> > +			},
> > +			[1] = {
> > +				.num = ST_ACCEL_FS_AVL_4G,
> > +				.value = 0x01,
> > +				.gain = IIO_G_TO_M_S_2(31200),
> > +			},
> > +			[2] = {
> > +				.num = ST_ACCEL_FS_AVL_8G,
> > +				.value = 0x02,
> > +				.gain = IIO_G_TO_M_S_2(62500),
> > +			},
> > +			[3] = {
> > +				.num = ST_ACCEL_FS_AVL_16G,
> > +				.value = 0x03,
> > +				.gain = IIO_G_TO_M_S_2(187500),
> > +			},
> > +			},
> > +	},
> > +	.bdu = {
> > +		.addr = 0x23,
> > +		.mask = 0x80,
> > +	},
> > +	.drdy_irq = {
> > +		.addr = 0x22,
> > +		.mask_int1 = 0x10,
> > +		.mask_int2 = 0x00,
> > +		.addr_ihl = 0x25,
> > +		.mask_ihl = 0x02,
> > +		.addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
This has changed completely since.

 75d4c6d2e15d   iio: st_sensors: decouple irq1 configuration parameters from the irq2 ones
 
I'm going to guess you are working with a kernel predating that.
You'll need to update this to work with the current kernel.

   
> > +	},
> > +	.sim = {
> > +		.addr = 0x23,
> > +		.value = BIT(0),
> > +	},
> > +	.multi_read_bit = true,
> > +	.bootime = 2,
> > +	},
> >  };
> >  
> >  static int st_accel_read_raw(struct iio_dev *indio_dev, diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c
> > index de8ae43..cb6eb6f 100644
> > --- a/drivers/iio/accel/st_accel_i2c.c
> > +++ b/drivers/iio/accel/st_accel_i2c.c
> > @@ -102,6 +102,10 @@ static const struct of_device_id st_accel_of_match[] = {
> >  		.compatible = "st,lis3de",
> >  		.data = LIS3DE_ACCEL_DEV_NAME,
> >  	},
> > +	{
> > +		.compatible = "st,lis2de12-accel",
> > +		.data = LIS2DE12_ACCEL_DEV_NAME,
> > +	},
> >  	{},
> >  };
> >  MODULE_DEVICE_TABLE(of, st_accel_of_match); @@ -140,6 +144,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
> >  	{ LIS3LV02DL_ACCEL_DEV_NAME },
> >  	{ LIS2DW12_ACCEL_DEV_NAME },
> >  	{ LIS3DE_ACCEL_DEV_NAME },
> > +	{ LIS2DE12_ACCEL_DEV_NAME },
> >  	{},
> >  };
> >  MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
> > --
> > 2.9.2
> >   
> 

  reply	other threads:[~2019-03-16 15:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 20:32 [PATCH 0/2] iio: accel: add support for LIS2DE12 Robert Jones
2019-03-05 20:32 ` [PATCH 1/2] dt-bindings: iio: accel: add LIS2DE12 sensor device binding Robert Jones
2019-03-09  1:14   ` Denis CIOCCA
2019-03-09 18:20     ` Jonathan Cameron
2019-03-09 18:23       ` Jonathan Cameron
2019-03-11 16:31         ` Bobby Jones
2019-03-11 23:02         ` Denis CIOCCA
2019-03-16 15:06           ` Jonathan Cameron
2019-03-05 20:32 ` [PATCH 2/2] iio: accel: add support to LIS2DE12 Robert Jones
2019-03-09  1:14   ` Denis CIOCCA
2019-03-16 15:06     ` Jonathan Cameron
2019-03-16 15:12       ` Jonathan Cameron [this message]
2019-04-11  0:12 ` [PATCH v2 0/2] iio: accel: add support for LIS2DE12 Robert Jones
2019-04-11  0:12   ` [PATCH v2 1/2] dt-bindings: iio: accel: add LIS2DE12 sensor device binding Robert Jones
2019-04-14 10:04     ` Jonathan Cameron
2019-04-11  0:12   ` [PATCH v2 2/2] iio: accel: add support to LIS2DE12 Robert Jones
2019-04-14 10:05     ` 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=20190316151224.41a5f595@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=denis.ciocca@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=rjones@gateworks.com \
    --cc=robh+dt@kernel.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).