devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lorenzo Bianconi
	<lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lorenzo.bianconi-qxv4g6HH51o@public.gmane.org
Subject: Re: [PATCH v2 05/10] iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable
Date: Sat, 22 Jul 2017 21:21:19 +0100	[thread overview]
Message-ID: <20170722212119.016f86f6@kernel.org> (raw)
In-Reply-To: <20170717173905.8209-6-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>

On Mon, 17 Jul 2017 19:39:00 +0200
Lorenzo Bianconi <lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
Applied to the togreg branch of iio.git and pushed out
as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/humidity/hts221.h        |  3 +--
>  drivers/iio/humidity/hts221_buffer.c |  4 ++--
>  drivers/iio/humidity/hts221_core.c   | 24 +++++-------------------
>  3 files changed, 8 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/iio/humidity/hts221.h b/drivers/iio/humidity/hts221.h
> index bf33d8f6396c..69dfa5c63ec2 100644
> --- a/drivers/iio/humidity/hts221.h
> +++ b/drivers/iio/humidity/hts221.h
> @@ -62,8 +62,7 @@ extern const struct dev_pm_ops hts221_pm_ops;
>  
>  int hts221_config_drdy(struct hts221_hw *hw, bool enable);
>  int hts221_probe(struct iio_dev *iio_dev);
> -int hts221_power_on(struct hts221_hw *hw);
> -int hts221_power_off(struct hts221_hw *hw);
> +int hts221_set_enable(struct hts221_hw *hw, bool enable);
>  int hts221_allocate_buffers(struct hts221_hw *hw);
>  int hts221_allocate_trigger(struct hts221_hw *hw);
>  
> diff --git a/drivers/iio/humidity/hts221_buffer.c b/drivers/iio/humidity/hts221_buffer.c
> index 7d19a3da7ab7..c4ed153ad397 100644
> --- a/drivers/iio/humidity/hts221_buffer.c
> +++ b/drivers/iio/humidity/hts221_buffer.c
> @@ -109,12 +109,12 @@ int hts221_allocate_trigger(struct hts221_hw *hw)
>  
>  static int hts221_buffer_preenable(struct iio_dev *iio_dev)
>  {
> -	return hts221_power_on(iio_priv(iio_dev));
> +	return hts221_set_enable(iio_priv(iio_dev), true);
>  }
>  
>  static int hts221_buffer_postdisable(struct iio_dev *iio_dev)
>  {
> -	return hts221_power_off(iio_priv(iio_dev));
> +	return hts221_set_enable(iio_priv(iio_dev), false);
>  }
>  
>  static const struct iio_buffer_setup_ops hts221_buffer_ops = {
> diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c
> index f99adc44139e..dc55d9fbc702 100644
> --- a/drivers/iio/humidity/hts221_core.c
> +++ b/drivers/iio/humidity/hts221_core.c
> @@ -285,30 +285,16 @@ hts221_sysfs_temp_oversampling_avail(struct device *dev,
>  	return len;
>  }
>  
> -int hts221_power_on(struct hts221_hw *hw)
> +int hts221_set_enable(struct hts221_hw *hw, bool enable)
>  {
>  	int err;
>  
>  	err = hts221_write_with_mask(hw, HTS221_REG_CNTRL1_ADDR,
> -				     HTS221_ENABLE_MASK, true);
> +				     HTS221_ENABLE_MASK, enable);
>  	if (err < 0)
>  		return err;
>  
> -	hw->enabled = true;
> -
> -	return 0;
> -}
> -
> -int hts221_power_off(struct hts221_hw *hw)
> -{
> -	int err;
> -
> -	err = hts221_write_with_mask(hw, HTS221_REG_CNTRL1_ADDR,
> -				     HTS221_ENABLE_MASK, false);
> -	if (err < 0)
> -		return err;
> -
> -	hw->enabled = false;
> +	hw->enabled = enable;
>  
>  	return 0;
>  }
> @@ -463,7 +449,7 @@ static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val)
>  	u8 data[HTS221_DATA_SIZE];
>  	int err;
>  
> -	err = hts221_power_on(hw);
> +	err = hts221_set_enable(hw, true);
>  	if (err < 0)
>  		return err;
>  
> @@ -473,7 +459,7 @@ static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val)
>  	if (err < 0)
>  		return err;
>  
> -	hts221_power_off(hw);
> +	hts221_set_enable(hw, false);
>  
>  	*val = (s16)get_unaligned_le16(data);
>  

--
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-07-22 20:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 17:38 [PATCH v2 00/10] hts221: add new features and fix power-off procedure Lorenzo Bianconi
     [not found] ` <20170717173905.8209-1-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-17 17:38   ` [PATCH v2 01/10] iio: humidity: hts221: refactor write_with_mask code Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-2-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 17:57       ` Jonathan Cameron
2017-07-17 17:38   ` [PATCH v2 02/10] iio: humidity: hts221: move BDU configuration in probe routine Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-3-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 17:58       ` Jonathan Cameron
2017-07-17 17:38   ` [PATCH v2 03/10] iio: humidity: hts221: do not overwrite reserved data during power-down Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-4-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 18:02       ` Jonathan Cameron
2017-07-17 17:38   ` [PATCH v2 04/10] iio: humidity: hts221: avoid useless ODR reconfiguration Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-5-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 20:19       ` Jonathan Cameron
2017-07-17 17:39   ` [PATCH v2 05/10] iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-6-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 20:21       ` Jonathan Cameron [this message]
2017-07-17 17:39   ` [PATCH v2 06/10] iio: humidity: hts221: support active-low interrupts Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-7-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 20:22       ` Jonathan Cameron
2017-07-17 17:39   ` [PATCH v2 07/10] dt-bindings: " Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-8-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 20:23       ` Jonathan Cameron
2017-07-17 17:39   ` [PATCH v2 08/10] iio: humidity: hts221: support open drain mode Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-9-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-22 20:25       ` Jonathan Cameron
     [not found]         ` <20170722212524.6fc06db7-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-07-25 19:01           ` Jonathan Cameron
2017-07-17 17:39   ` [PATCH v2 09/10] dt-bindings: " Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-10-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-24 17:48       ` Rob Herring
2017-07-25 19:02         ` Jonathan Cameron
2017-07-17 17:39   ` [PATCH v2 10/10] iio: humidity: hts221: move drdy enable logic in hts221_trig_set_state() Lorenzo Bianconi
     [not found]     ` <20170717173905.8209-11-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-07-25 19:03       ` 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=20170722212119.016f86f6@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lorenzo.bianconi-qxv4g6HH51o@public.gmane.org \
    --cc=lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@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).