public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Michael Welling <mwelling@ieee.org>,
	Philippe Reynes <tremyfr@yahoo.fr>,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org,
	Alban Bedel <alban.bedel@avionic-design.de>
Subject: Re: [PATCH v2 2/2] iio: add driver for the TI DAC8554
Date: Fri, 12 Dec 2014 17:15:36 +0100	[thread overview]
Message-ID: <20141212161536.GC1142@avionic-0071.adnet.avionic-design.de> (raw)
In-Reply-To: <548AD814.2060206@kernel.org>

On Fri, Dec 12, 2014 at 11:57:08AM +0000, Jonathan Cameron wrote:
> On 06/12/14 11:36, Hartmut Knaack wrote:
> > Nikolaus Schulz schrieb am 24.11.2014 um 20:50:
> >> The TI DAC8554 is a quad-channel Digital-to-Analog Converter with an SPI
> >> interface.
> >>
> >> Changes in v2:
> >> * Use DMA-safe buffer for SPI transfer
> >> * Normalize powerdown_mode name "hi-z" to "three_state" as per
> >>   ABI/testing/sysfs-bus-iio
> >> * Register device late in probe function
> >> * Avoid powerdown broadcast update, which touches all DAC on the bus
> > There are a few issues left, please see my comments inline.
> 1 little one from me...
> >>
> >> Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
> >> ---
> >>  drivers/iio/dac/Kconfig      |  10 ++
> >>  drivers/iio/dac/Makefile     |   1 +
> >>  drivers/iio/dac/ti-dac8554.c | 374 +++++++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 385 insertions(+)
> >>  create mode 100644 drivers/iio/dac/ti-dac8554.c
[...]
> >> diff --git a/drivers/iio/dac/ti-dac8554.c b/drivers/iio/dac/ti-dac8554.c
> >> new file mode 100644
> >> index 0000000..fca751f
> >> --- /dev/null
> >> +++ b/drivers/iio/dac/ti-dac8554.c
[...]
> >> +static int dac8554_powerdown(struct dac8554_state *st,
> >> +			     u8 powerdown_mode)
> >> +{
> >> +	int chan, cmd, ret;
> >> +
> >> +	for (chan = DAC8554_DAC_CHANNELS-1; chan >= 0; --chan) {
> > Please mind spaces around operators.
> >> +		cmd = chan ? DAC8554_CMD_STORE_DAC_N
> >> +			   : DAC8554_CMD_STORE_DAC_N_UPDATE_ALL;
> >> +		ret = dac8554_spi_write(st, cmd, chan,
> >> +				DAC8554_PWRDN_TO_SR(powerdown_mode));
> >> +		if (ret)
> >> +			return ret;
> >> +	}
> >> +
> >> +	memset(st->powerdown_mode, powerdown_mode, sizeof(st->powerdown_mode));
> >> +	memset(st->powerdown, true, sizeof(st->powerdown));
> Whilst this probably works, I think for the boolean case it is less
> than entirely obvious, so probably better to have a simple loop.

Yeah, I agree it's better to keep it as simple and obvious as possible.
Fixed in v3.

> >> +
> >> +	return 0;
> >> +}

-- 
Avionic Design GmbH
Nikolaus Schulz
Wragekamp 10
D-22397 Hamburg
Germany

Tel.:  +49 40 88187-163
Fax:   +49 40 88187-150
Email: nikolaus.schulz@avionic-design.de

Avionic Design GmbH
Amtsgericht Hamburg HRB 82598
Geschäftsführung: Cornelis Broers
Ust.-Ident-Nr.: DE813378254

  reply	other threads:[~2014-12-12 16:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1416858614-32265-1-git-send-email-nikolaus.schulz@avionic-design.de>
2014-11-24 19:50 ` [PATCH v2 2/2] iio: add driver for the TI DAC8554 Nikolaus Schulz
2014-12-06 11:36   ` Hartmut Knaack
2014-12-12 11:57     ` Jonathan Cameron
2014-12-12 16:15       ` Nikolaus Schulz [this message]
2014-12-12 15:58     ` Nikolaus Schulz
2014-12-12 18:14       ` Jonathan Cameron
2014-12-13 11:18       ` Hartmut Knaack
2014-12-13 11:24         ` Hartmut Knaack
2014-12-13 11:25         ` Lars-Peter Clausen
2014-12-15 10:02         ` Nikolaus Schulz
2014-12-13 11:32     ` Lars-Peter Clausen
2014-12-13 11:29   ` Lars-Peter Clausen
2014-12-15 10:22     ` Nikolaus Schulz

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=20141212161536.GC1142@avionic-0071.adnet.avionic-design.de \
    --to=nikolaus.schulz@avionic-design.de \
    --cc=alban.bedel@avionic-design.de \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwelling@ieee.org \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=tremyfr@yahoo.fr \
    /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