Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
From: Couret Charles-Antoine <charles-antoine.couret@essensium.com>
To: Adam Michaelis <adam.michaelis@rockwellcollins.com>,
	linux-iio@vger.kernel.org
Cc: lars@metafoo.de, michael.hennerich@analog.com, jic23@kernel.org,
	knaack.h@gmx.de, pmeerw@pmeerw.net, robh+dt@kernel.org,
	mark.rutland@arm.com, devicetree@vger.kernel.org,
	brandon.maier@rockwellcollins.com,
	clayton.shotwell@rockwellcollins.com
Subject: Re: [PATCH 1/6] iio: ad7949: Support internal Vref
Date: Thu, 2 May 2019 08:30:53 +0200
Message-ID: <4f674e6a-2346-4ca3-4043-205e54473dbd@essensium.com> (raw)
In-Reply-To: <1556745423-11368-1-git-send-email-adam.michaelis@rockwellcollins.com>

Hi,
I read your patch series and it seems really good. Thank you for the 
improvements. :)
But I have one comment about it there:

Le 01/05/2019 à 23:16, Adam Michaelis a écrit :
> @@ -223,10 +247,18 @@ static int ad7949_spi_init(struct ad7949_adc_chip *ad7949_adc)
>   {
>   	int ret;
>   	int val;
> +	u16 adc_config = 0;
>   
> -	/* Sequencer disabled, CFG readback disabled, IN0 as default channel */
>   	ad7949_adc->current_channel = 0;
> -	ret = ad7949_spi_write_cfg(ad7949_adc, 0x3C79, AD7949_MASK_TOTAL);
> +	ad7949_adc->cfg = 0;
> +
> +	adc_config = (0x3c << 8);
> +	adc_config |= ((ad7949_adc->current_channel & 0x07) << 7);
> +	adc_config |= (1 << 6);
> +	adc_config |= (ad7949_adc->ref_sel << 3);
> +	adc_config |= 1;
> +
> +	ret = ad7949_spi_write_cfg(ad7949_adc, adc_config, AD7949_MASK_TOTAL);

That should be great to replace some _magic constants_ by a more 
explicit name, shouldn't it? Especially (0x3c << 8) and (1 << 6 parts).

Regards,

Charles-Antoine Couret


      parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 21:16 Adam Michaelis
2019-05-01 21:16 ` [PATCH 2/6] dt-bindings: iio: ad7949: Add adi,reference-select Adam Michaelis
2019-05-05 12:22   ` Jonathan Cameron
2019-05-06 19:28     ` Adam Michaelis
2019-05-07 18:21     ` Adam Michaelis
2019-05-11 10:38       ` Jonathan Cameron
2019-05-13 14:51         ` [External] " Adam Michaelis
2019-05-01 21:17 ` [PATCH 3/6] iio: ad7949: Support configuration read-back Adam Michaelis
2019-05-01 21:17 ` [PATCH 4/6] dt-bindings: iio: ad7949: Add cfg-readback option Adam Michaelis
2019-05-01 21:17 ` [PATCH 5/6] iio: ad7949: Fix SPI interfacing for 14-bit messages Adam Michaelis
2019-05-01 21:17 ` [PATCH 6/6] iio: ad7949: Fix dummy read cycle placement Adam Michaelis
2019-05-02  6:30 ` Couret Charles-Antoine [this message]

Reply instructions:

You may reply publically 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=4f674e6a-2346-4ca3-4043-205e54473dbd@essensium.com \
    --to=charles-antoine.couret@essensium.com \
    --cc=adam.michaelis@rockwellcollins.com \
    --cc=brandon.maier@rockwellcollins.com \
    --cc=clayton.shotwell@rockwellcollins.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michael.hennerich@analog.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@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

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox