All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Charles Keepax <ckeepax@opensource.cirrus.com>,
	Song Qiang <songqiang1304521@gmail.com>,
	Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>,
	Martin Kelly <mkelly@xevo.com>,
	Jonathan Marek <jonathan@marek.ca>,
	Brian Masney <masneyb@onstation.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	letux-kernel@openphoenux.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 06/10] iio: gyro: itg3200: add mount matrix support
Date: Sun, 3 Mar 2019 15:22:15 +0000	[thread overview]
Message-ID: <20190303152215.52b0504c@archlinux> (raw)
In-Reply-To: <ad1f1af237439dcf2a0769280f9e7b1806d484f2.1550768574.git.hns@goldelico.com>

On Thu, 21 Feb 2019 18:02:51 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

> This patch allows to read a mount-matrix device tree
> property and report to user-space or in-kernel iio
> clients.
> 
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/gyro/itg3200_core.c  | 20 ++++++++++++++++++++
>  include/linux/iio/gyro/itg3200.h |  1 +
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c
> index 7adecb562c81..203a6be33b70 100644
> --- a/drivers/iio/gyro/itg3200_core.c
> +++ b/drivers/iio/gyro/itg3200_core.c
> @@ -242,6 +242,20 @@ static int itg3200_initial_setup(struct iio_dev *indio_dev)
>  	return ret;
>  }
>  
> +static const struct iio_mount_matrix *
> +itg3200_get_mount_matrix(const struct iio_dev *indio_dev,
> +			  const struct iio_chan_spec *chan)
> +{
> +	struct itg3200 *data = iio_priv(indio_dev);
> +
> +	return &data->orientation;
> +}
> +
> +static const struct iio_chan_spec_ext_info itg3200_ext_info[] = {
> +	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, itg3200_get_mount_matrix),
> +	{ }
> +};
> +
>  #define ITG3200_ST						\
>  	{ .sign = 's', .realbits = 16, .storagebits = 16, .endianness = IIO_BE }
>  
> @@ -255,6 +269,7 @@ static int itg3200_initial_setup(struct iio_dev *indio_dev)
>  	.address = ITG3200_REG_GYRO_ ## _mod ## OUT_H, \
>  	.scan_index = ITG3200_SCAN_GYRO_ ## _mod, \
>  	.scan_type = ITG3200_ST, \
> +	.ext_info = itg3200_ext_info, \
>  }
>  
>  static const struct iio_chan_spec itg3200_channels[] = {
> @@ -297,6 +312,11 @@ static int itg3200_probe(struct i2c_client *client,
>  
>  	st = iio_priv(indio_dev);
>  
> +	ret = iio_read_mount_matrix(&client->dev, "mount-matrix",
> +				&st->orientation);
> +	if (ret)
> +		return ret;
> +
>  	i2c_set_clientdata(client, indio_dev);
>  	st->i2c = client;
>  
> diff --git a/include/linux/iio/gyro/itg3200.h b/include/linux/iio/gyro/itg3200.h
> index 2a820850f284..0a30fddccfb3 100644
> --- a/include/linux/iio/gyro/itg3200.h
> +++ b/include/linux/iio/gyro/itg3200.h
> @@ -104,6 +104,7 @@
>  struct itg3200 {
>  	struct i2c_client	*i2c;
>  	struct iio_trigger	*trig;
> +	struct iio_mount_matrix orientation;
>  };
>  
>  enum ITG3200_SCAN_INDEX {


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

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 17:02 [PATCH v2 00/10] iio mount matrix - revitalize missing bindings documentation and provide code for bmc150, bmg160, bma180, itg3200, hmc584x H. Nikolaus Schaller
2019-02-21 17:02 ` [PATCH v2 01/10] iio: Allow to read mount matrix from ACPI H. Nikolaus Schaller
2019-03-03 14:59   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 02/10] iio: document bindings for mounting matrices H. Nikolaus Schaller
2019-02-22 23:42   ` Rob Herring
2019-02-22 23:42     ` Rob Herring
2019-02-25 16:32   ` Jonathan Corbet
2019-02-25 16:32     ` Jonathan Corbet
2019-02-25 18:24     ` Linus Walleij
2019-02-25 18:24       ` Linus Walleij
2019-02-25 18:29       ` Jonathan Corbet
2019-02-25 18:29         ` Jonathan Corbet
2019-02-25 19:38       ` Rob Herring
2019-02-25 19:38         ` Rob Herring
2019-03-03 15:19   ` Jonathan Cameron
2019-03-03 15:19     ` Jonathan Cameron
2019-03-07 12:53     ` H. Nikolaus Schaller
2019-03-07 12:53       ` H. Nikolaus Schaller
2019-07-23  7:42   ` Linus Walleij
2019-07-23  7:42     ` Linus Walleij
2019-07-23  9:46     ` H. Nikolaus Schaller
2019-07-23  9:46       ` H. Nikolaus Schaller
2019-07-28  7:50       ` Jonathan Cameron
2019-07-28  7:50         ` Jonathan Cameron
2019-07-28 10:07         ` Linus Walleij
2019-07-28 10:07           ` Linus Walleij
2019-07-23 15:39     ` Andy Shevchenko
2019-07-23 15:39       ` Andy Shevchenko
2019-02-21 17:02 ` [PATCH v2 03/10] iio: accel: bmc150: add mount matrix support H. Nikolaus Schaller
2019-03-03 15:20   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 04/10] iio: accel: bma180: " H. Nikolaus Schaller
2019-03-03 15:20   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 05/10] iio: gyro: bmg160: " H. Nikolaus Schaller
2019-03-03 15:21   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 06/10] iio: gyro: itg3200: " H. Nikolaus Schaller
2019-03-03 15:22   ` Jonathan Cameron [this message]
2019-02-21 17:02 ` [PATCH v2 07/10] iio: magnetometer: bmc150: " H. Nikolaus Schaller
2019-03-03 15:23   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 08/10] iio: magnetometer: hmc5843: " H. Nikolaus Schaller
2019-03-03 15:24   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 09/10] iio: mpu6050: improve code readability H. Nikolaus Schaller
2019-03-03 15:30   ` Jonathan Cameron
2019-02-21 17:02 ` [PATCH v2 10/10] iio: ak8975: " H. Nikolaus Schaller
2019-03-03 15:30   ` Jonathan Cameron
2019-02-22 14:48 ` [PATCH v2 00/10] iio mount matrix - revitalize missing bindings documentation and provide code for bmc150, bmg160, bma180, itg3200, hmc584x Andy Shevchenko
2019-02-22 14:48   ` Andy Shevchenko
2019-03-03 15:32   ` Jonathan Cameron
2019-03-03 15:32     ` Jonathan Cameron
2019-04-04  6:29     ` H. Nikolaus Schaller
2019-04-04  6:29       ` H. Nikolaus Schaller
2019-04-07 11:41       ` Jonathan Cameron
2019-04-07 11:41         ` Jonathan Cameron
2019-04-08  6:32         ` H. Nikolaus Schaller
2019-02-22 16:24 ` Linus Walleij
2019-02-22 16:24   ` Linus Walleij

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=20190303152215.52b0504c@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=jmaneyrol@invensense.com \
    --cc=jonathan@marek.ca \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=letux-kernel@openphoenux.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=masneyb@onstation.org \
    --cc=mkelly@xevo.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=songqiang1304521@gmail.com \
    --cc=stephan@gerhold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.