All of lore.kernel.org
 help / color / mirror / Atom feed
From: Couret Charles-Antoine <charles-antoine.couret@essensium.com>
To: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/2] Add AD7949 ADC driver family
Date: Mon, 8 Oct 2018 23:18:03 +0200	[thread overview]
Message-ID: <09d26591-d200-b561-0baa-f40b2970a062@essensium.com> (raw)
In-Reply-To: <20181007172522.04d50998@archlinux>

Le 07/10/2018 à 18:25, Jonathan Cameron a écrit :
> Hi Charles-Antoine, 

Hello,

Thank you for your code review, I'm trying to take everything into 
account but I have some questions about it before making the V2.

>> +#define AD7949_OFFSET_CHANNEL_SEL	7
>> +#define AD7949_CFG_READ_BACK		0x1
>> +#define AD7949_CFG_REG_SIZE_BITS	14
>> +
>> +enum {
>> +	HEIGHT_14BITS = 0,
>> +	QUAD_16BITS,
>> +	HEIGHT_16BITS,
> Height? I guess EIGHT was the intent.
> I would just use the part numbers for this rather than a
> descriptive phrase.

Thank you for the typo.

But I don't understand your remark. What do you mean by "part numbers" 
here?

>> +	struct spi_message msg;
>> +	struct spi_transfer tx[] = {
>> +		{
>> +			.tx_buf = &buf_value,
>> +			.len = 4,
>> +			.bits_per_word = bits_per_word,
>> +		},
>> +	};
>> +
>> +	ad7949_adc->cfg = buf_value >> shift;
>> +	spi_message_init(&msg);
>> +	spi_message_add_tail(&tx[0], &msg);
>> +	ret = spi_sync(ad7949_adc->spi, &msg);
>> +	udelay(2);
> These delays need explaining as they are non obvious and there
> may be cleaner ways to handle them.

I want to add this comment:

     /* This delay is to avoid a new request before the required time to
      * send a new command to the device
      */

It is clear and relevant enough?

>
>> +	struct spi_message msg;
>> +	struct spi_transfer tx[] = {
>> +		{
>> +			.rx_buf = &buf_value,
>> +			.len = 4,
>> +			.bits_per_word = bits_per_word,
>> +		},
>> +	};
> I 'think' this is the same in every call of this function, so why not
> set it up in the probe function and have it ready all the time rather than
> spinning up a new copy here each time.
bits_per_word depends on if the configuration readback is enabled or 
not. It could be changed in runtime. So I considered we can not optimize 
in that way.

Regards,
Charles-Antoine Couret

  reply	other threads:[~2018-10-09  4:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-06 20:30 [PATCH 1/2] Add AD7949 ADC driver family Charles-Antoine Couret
2018-10-06 20:30 ` [PATCH 2/2] Add ad7949 device tree bindings in documentation Charles-Antoine Couret
2018-10-07 16:00   ` Jonathan Cameron
2018-10-07 16:25 ` [PATCH 1/2] Add AD7949 ADC driver family Jonathan Cameron
2018-10-08 21:18   ` Couret Charles-Antoine [this message]
2018-10-09  6:25     ` Ardelean, Alexandru
2018-10-09  7:12       ` Couret Charles-Antoine
2018-10-13 12:25         ` 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=09d26591-d200-b561-0baa-f40b2970a062@essensium.com \
    --to=charles-antoine.couret@essensium.com \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=linux-iio@vger.kernel.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 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.