All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH v1 2/4] iio: gyro: bmg160: Don't let interrupt mode to be open drain
Date: Sun, 16 Nov 2014 20:20:22 +0000	[thread overview]
Message-ID: <54690706.4000609@kernel.org> (raw)
In-Reply-To: <1412998408-31870-3-git-send-email-srinivas.pandruvada@linux.intel.com>

On 11/10/14 04:33, Srinivas Pandruvada wrote:
> Change the mode to push/pull type instead of open drain as some
> platforms fails to drive the GPIO pin with open drain.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git

Ultimately this might want to be configurable via device tree
or similar, but fair enough for now...

> ---
>  drivers/iio/gyro/bmg160.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c
> index 22bf9db..fa2e376 100644
> --- a/drivers/iio/gyro/bmg160.c
> +++ b/drivers/iio/gyro/bmg160.c
> @@ -67,6 +67,9 @@
>  #define BMG160_REG_INT_EN_0		0x15
>  #define BMG160_DATA_ENABLE_INT		BIT(7)
>  
> +#define BMG160_REG_INT_EN_1		0x16
> +#define BMG160_INT1_BIT_OD		BIT(1)
> +
>  #define BMG160_REG_XOUT_L		0x02
>  #define BMG160_AXIS_TO_REG(axis)	(BMG160_REG_XOUT_L + (axis * 2))
>  
> @@ -222,6 +225,19 @@ static int bmg160_chip_init(struct bmg160_data *data)
>  	data->slope_thres = ret;
>  
>  	/* Set default interrupt mode */
> +	ret = i2c_smbus_read_byte_data(data->client, BMG160_REG_INT_EN_1);
> +	if (ret < 0) {
> +		dev_err(&data->client->dev, "Error reading reg_int_en_1\n");
> +		return ret;
> +	}
> +	ret &= ~BMG160_INT1_BIT_OD;
> +	ret = i2c_smbus_write_byte_data(data->client,
> +					BMG160_REG_INT_EN_1, ret);
> +	if (ret < 0) {
> +		dev_err(&data->client->dev, "Error writing reg_int_en_1\n");
> +		return ret;
> +	}
> +
>  	ret = i2c_smbus_write_byte_data(data->client,
>  					BMG160_REG_INT_RST_LATCH,
>  					BMG160_INT_MODE_LATCH_INT |
> 


  reply	other threads:[~2014-11-16 20:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-11  3:33 [PATCH v1 0/4] BMG160 updates Srinivas Pandruvada
2014-10-11  3:33 ` [PATCH v1 1/4] iio: gyro: bmg160: Error handling when mode set fails Srinivas Pandruvada
2014-11-16 20:19   ` Jonathan Cameron
2014-10-11  3:33 ` [PATCH v1 2/4] iio: gyro: bmg160: Don't let interrupt mode to be open drain Srinivas Pandruvada
2014-11-16 20:20   ` Jonathan Cameron [this message]
2014-10-11  3:33 ` [PATCH v1 3/4] iio: gyro: bmg160: Send x, y and z motion separately Srinivas Pandruvada
2014-11-16 20:21   ` Jonathan Cameron
2014-10-11  3:33 ` [PATCH v1 4/4] iio: gyro: bmg160: Fix iio_event_spec direction Srinivas Pandruvada
2014-11-16 20:21   ` 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=54690706.4000609@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /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.