From: Jonathan Cameron <jic23@kernel.org>
To: Colin Parker <colin.foeparker@aclima.io>
Cc: linux-iio@vger.kernel.org, ak@it-klinger.de,
foeparker.colin@gmail.com, Colin Parker <colin.parker@aclima.io>
Subject: Re: [PATCH] IIO: BME280: Updates to Humidity readings need ctrl_reg write!
Date: Sun, 3 Sep 2017 17:34:15 +0100 [thread overview]
Message-ID: <20170903173415.6a86f166@archlinux> (raw)
In-Reply-To: <1503962499-11417-1-git-send-email-colin.parker@aclimalabs.com>
On Mon, 28 Aug 2017 16:21:39 -0700
Colin Parker <colin.foeparker@aclima.io> wrote:
> From: Colin Parker <colin.parker@aclima.io>
>
> The ctrl_reg register needs to be written after any write to
> the humidity registers. The value written to the ctrl_reg register
> does not necessarily need to change, but a write operation must
> occur.
That's nasty.
>
> The regmap_update_bits functions will not write to a register
> if the register value matches the value to be written. This saves
> unnecessary bus operations. The change in this patch forces a bus
> write during the chip_config operation by switching to
> regmap_write_bits.
>
> This will fix issues where the Humidity Sensor Oversampling bits
> are not updated after initialization.
>
> Signed-off-by: Colin Parker <colin.parker@aclima.io>
I'd just like to leave a little more time for Andreas to respond to
this before I apply it.
Give me a bump if it looks like I have forgotten about it after next
weekend.
Thanks,
Jonathan
> ---
> drivers/iio/pressure/bmp280-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index 0d2ea3e..8f26428 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -573,7 +573,7 @@ static int bmp280_chip_config(struct bmp280_data *data)
> u8 osrs = BMP280_OSRS_TEMP_X(data->oversampling_temp + 1) |
> BMP280_OSRS_PRESS_X(data->oversampling_press + 1);
>
> - ret = regmap_update_bits(data->regmap, BMP280_REG_CTRL_MEAS,
> + ret = regmap_write_bits(data->regmap, BMP280_REG_CTRL_MEAS,
> BMP280_OSRS_TEMP_MASK |
> BMP280_OSRS_PRESS_MASK |
> BMP280_MODE_MASK,
next prev parent reply other threads:[~2017-09-03 16:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 23:21 [PATCH] IIO: BME280: Updates to Humidity readings need ctrl_reg write! Colin Parker
2017-09-03 16:34 ` Jonathan Cameron [this message]
2017-09-04 17:20 ` Andreas Klinger
2017-09-10 13:48 ` 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=20170903173415.6a86f166@archlinux \
--to=jic23@kernel.org \
--cc=ak@it-klinger.de \
--cc=colin.foeparker@aclima.io \
--cc=colin.parker@aclima.io \
--cc=foeparker.colin@gmail.com \
--cc=linux-iio@vger.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).