linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 08/12] iio:adc:ad799x: Add helper function to read/write config register
Date: Sun, 13 Jul 2014 21:57:49 +0100	[thread overview]
Message-ID: <53C2F2CD.1010805@kernel.org> (raw)
In-Reply-To: <1402548856-3564-9-git-send-email-pmeerw@pmeerw.net>

On 12/06/14 05:54, Peter Meerwald wrote:
> 16-bit on ad7997/ad7998, 8-bit elsewhere
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
> ---
>   drivers/iio/adc/ad799x.c | 24 ++++++++++++++++++++++++
>   1 file changed, 24 insertions(+)
>
> diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
> index 92401c9..fe2a9b1 100644
> --- a/drivers/iio/adc/ad799x.c
> +++ b/drivers/iio/adc/ad799x.c
> @@ -136,6 +136,30 @@ struct ad799x_state {
>   	unsigned int			transfer_size;
>   };
>
> +static int ad799x_write_config(struct ad799x_state *st, u16 val)
> +{
> +	switch (st->id) {
> +	case ad7997:
> +	case ad7998:
> +		return i2c_smbus_write_word_swapped(st->client, AD7998_CONF_REG,
> +			val);
> +	default:
> +		return i2c_smbus_write_byte_data(st->client, AD7998_CONF_REG,
> +			val);
> +	}
> +}
> +
> +static int ad799x_read_config(struct ad799x_state *st)
> +{
> +	switch (st->id) {
> +	case ad7997:
> +	case ad7998:
> +		return i2c_smbus_read_word_swapped(st->client, AD7998_CONF_REG);
> +	default:
> +		return i2c_smbus_read_byte_data(st->client, AD7998_CONF_REG);
> +	}
> +}
> +
>   /**
>    * ad799x_trigger_handler() bh of trigger launched polling to ring buffer
>    *
>


  reply	other threads:[~2014-07-13 20:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12  4:54 [PATCH v3 00/12] ad799x cleanup Peter Meerwald
2014-06-12  4:54 ` [PATCH v3 01/12] iio:adc:ad799x: Fix reading and writing of event values, apply shift Peter Meerwald
2014-06-12  8:07   ` Lars-Peter Clausen
2014-06-14 14:19     ` Jonathan Cameron
2014-06-29 14:47       ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 02/12] iio:adc:ad799x: Fix ad799x_chip_info kerneldoc Peter Meerwald
2014-06-14 14:21   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 03/12] iio:adc:ad799x: Drop I2C access helper functions Peter Meerwald
2014-06-12  8:10   ` Lars-Peter Clausen
2014-06-14 14:26     ` Jonathan Cameron
2014-07-13 20:47     ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 04/12] iio:adc:ad799x: Save some lines in ad7997_8_update_scan_mode() exit handling Peter Meerwald
2014-07-13 20:56   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 05/12] iio:adc:ad799x: Use BIT() and GENMASK() Peter Meerwald
2014-07-13 20:56   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 06/12] iio:adc:ad799x: Only expose event interface when IRQ is available Peter Meerwald
2014-07-13 20:56   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 07/12] iio:adc:ad799x: Make chan_spec const in ad799x_chip_config struct Peter Meerwald
2014-07-13 20:57   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 08/12] iio:adc:ad799x: Add helper function to read/write config register Peter Meerwald
2014-07-13 20:57   ` Jonathan Cameron [this message]
2014-06-12  4:54 ` [PATCH v3 09/12] iio:adc:ad799x: Write default config on probe and reset alert status on probe Peter Meerwald
2014-07-13 20:58   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 10/12] iio:adc:ad799x: Set conversion channels and rename ad7997_8_update_scan_mode() Peter Meerwald
2014-07-13 20:58   ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 11/12] iio:adc:ad799x: Return more meaningful event enabled state Peter Meerwald
2014-06-12  8:08   ` Lars-Peter Clausen
2014-07-13 20:59     ` Jonathan Cameron
2014-06-12  4:54 ` [PATCH v3 12/12] iio:adc:ad799x: Allow to write event config Peter Meerwald
2014-06-12  8:08   ` Lars-Peter Clausen
2014-07-13 21:01     ` 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=53C2F2CD.1010805@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.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 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).