All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
	linux-iio@vger.kernel.org,
	Device-drivers-devel@blackfin.uclinux.org, drivers@analog.com
Subject: Re: [PATCH] staging:iio:dac Add AD5064 driver
Date: Fri, 14 Oct 2011 16:52:17 +0200	[thread overview]
Message-ID: <4E984CA1.40702@metafoo.de> (raw)
In-Reply-To: <4E98458D.70603@cam.ac.uk>

On 10/14/2011 04:22 PM, Jonathan Cameron wrote:
> On 10/13/11 12:40, Lars-Peter Clausen wrote:
>> This patch adds support for the Analog Devices AD6064, AD6064-1, AD6044, AD6024
>> quad channel digital-to-analog converter devices.
> Very nice.
> 
> Dependency has gone to Greg just now so please send this on as well.
>>
>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
>>
>>[...]
>> +
>> +struct ad5064_state {
>> +	struct spi_device		*spi;
>> +	const struct ad5064_chip_info	*chip_info;
>> +	struct regulator_bulk_data	vref_reg[AD5064_DAC_CHANNELS];
>> +	bool				pwr_down[AD5064_DAC_CHANNELS];
>> +	u8				pwr_down_mode[AD5064_DAC_CHANNELS];
>> +	unsigned int			dac_cache[AD5064_DAC_CHANNELS];
> 
> utter nitpick, but probably blank line before this and not after?

uhm, yes. I'll fix this in the version I'll send out to GregKH.

>> +	/*
>> +	 * DMA (thus cache coherency maintenance) requires the
>> +	 * transfer buffers to live in their own cache lines.
>> +	 */
>> +
>> +	__be32 data ____cacheline_aligned;
>> +};
>> [...]
>> +
>> +static int ad5064_write_raw(struct iio_dev *indio_dev,
>> +	struct iio_chan_spec const *chan, int val, int val2, long mask)
>> +{
>> +	struct ad5064_state *st = iio_priv(indio_dev);
>> +	int ret;
>> +
>> +	switch (mask) {
>> +	case 0:
>> +		if (val > (1 << chan->scan_type.realbits))

I'll also change this check to reject negative values as well.

>> +			return -EINVAL;
>> +
>> +		mutex_lock(&indio_dev->mlock);
>> +		ret = ad5064_spi_write(st, AD5064_CMD_WRITE_INPUT_N_UPDATE_N,
>> +				chan->address, val, chan->scan_type.shift);
>> +		if (ret == 0)
>> +			st->dac_cache[chan->channel] = val;
>> +		mutex_unlock(&indio_dev->mlock);
>> +		break;
>> +	default:
>> +		ret = -EINVAL;
>> +	}
>> +
>> +	return ret;
>> +}
>> +
>> [...]

  reply	other threads:[~2011-10-14 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 11:40 [PATCH] staging:iio:dac Add AD5064 driver Lars-Peter Clausen
2011-10-14 14:22 ` Jonathan Cameron
2011-10-14 14:52   ` Lars-Peter Clausen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17  7:38 Lars-Peter Clausen
2011-10-17 22:39 ` Greg KH
2011-10-07 11:08 Lars-Peter Clausen
2011-10-07 12:24 ` Jonathan Cameron
2011-10-07 19:18   ` Lars-Peter Clausen
2011-10-10  8:41     ` Jonathan Cameron
2011-10-10 14:39       ` Lars-Peter Clausen

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=4E984CA1.40702@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Device-drivers-devel@blackfin.uclinux.org \
    --cc=drivers@analog.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.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.