From: Jonathan Cameron <jic23@kernel.org>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: enric.balletbo@collabora.com, linux-iio@vger.kernel.org,
Nick Vaccaro <nvaccaro@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Fabien Lahoudere <fabien.lahoudere@collabora.com>,
Benson Leung <bleung@chromium.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: cros_ec: set calibscale for 3d MEMS to unit vector
Date: Sun, 25 Aug 2019 19:12:25 +0100 [thread overview]
Message-ID: <20190825191225.3db3587c@archlinux> (raw)
In-Reply-To: <20190820051029.118905-1-gwendal@chromium.org>
On Mon, 19 Aug 2019 22:10:29 -0700
Gwendal Grignou <gwendal@chromium.org> wrote:
> By default, set the calibscale vector to unit vector.
> It prevents sending 0 as calibscale when not initialized.
>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Fix for a real case or paranoia?
If a fix, then fixes tag and preferably which hardware it applies to.
Thanks,
Jonathan
> ---
>
> drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> index fd833295bb173..d44ae126f4578 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> @@ -90,7 +90,7 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
> struct cros_ec_dev *ec = dev_get_drvdata(pdev->dev.parent);
> struct cros_ec_sensor_platform *sensor_platform = dev_get_platdata(dev);
> u32 ver_mask;
> - int ret;
> + int ret, i;
>
> platform_set_drvdata(pdev, indio_dev);
>
> @@ -136,6 +136,9 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
> /* Set sign vector, only used for backward compatibility. */
> memset(state->sign, 1, CROS_EC_SENSOR_MAX_AXIS);
>
> + for (i = CROS_EC_SENSOR_X; i < CROS_EC_SENSOR_MAX_AXIS; i++)
> + state->calib[i].scale = MOTION_SENSE_DEFAULT_SCALE;
> +
> /* 0 is a correct value used to stop the device */
> state->frequencies[0] = 0;
> if (state->msg->version < 3) {
prev parent reply other threads:[~2019-08-25 18:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 5:10 [PATCH] iio: cros_ec: set calibscale for 3d MEMS to unit vector Gwendal Grignou
2019-08-25 18:12 ` Jonathan Cameron [this message]
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=20190825191225.3db3587c@archlinux \
--to=jic23@kernel.org \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=fabien.lahoudere@collabora.com \
--cc=groeck@chromium.org \
--cc=gwendal@chromium.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvaccaro@chromium.org \
--cc=pmeerw@pmeerw.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.