From: Dan Carpenter <dan.carpenter@oracle.com>
To: Beniamin Bia <biabeniamin@outlook.com>
Cc: jic23@kernel.org, devel@driverdev.osuosl.org, lars@metafoo.de,
Michael.Hennerich@analog.com, linux-iio@vger.kernel.org,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
pmeerw@pmeerw.net, knaack.h@gmx.de,
Beniamin Bia <beniamin.bia@analog.com>
Subject: Re: [PATCH 1/2] staging: iio: frequency: ad9834: Move frequency to standard iio types
Date: Wed, 6 Feb 2019 17:59:19 +0300 [thread overview]
Message-ID: <20190206145919.GA1978@kadam> (raw)
In-Reply-To: <20190206120542.16617-1-biabeniamin@outlook.com>
On Wed, Feb 06, 2019 at 02:05:41PM +0200, Beniamin Bia wrote:
> Frequency attribute is added with a standard type from iio framework
> instead of custom attribute. This is a small step towards removing any
> unnecessary custom attribute.
>
> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
This doesn't match your email. You should probably add a From: to
give your @analog.com address authorship credit.
> ---
> drivers/staging/iio/frequency/ad9834.c | 97 +++++++++++++++++++++-----
> 1 file changed, 80 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
> index f036f75d1f22..370e8263899e 100644
> --- a/drivers/staging/iio/frequency/ad9834.c
> +++ b/drivers/staging/iio/frequency/ad9834.c
> @@ -29,8 +29,7 @@
> /* Registers */
>
> #define AD9834_REG_CMD 0
> -#define AD9834_REG_FREQ0 BIT(14)
> -#define AD9834_REG_FREQ1 BIT(15)
> +#define AD9834_REG_FREQ(chann) (BIT(14) << (chann))
Only one 'n' in "chan", please. But we actually pass the address not
the channel here so that was unexpected to me. I think the channel is
always the same as the address? So maybe it doesn't matter.
> #define AD9834_REG_PHASE0 (BIT(15) | BIT(14))
> #define AD9834_REG_PHASE1 (BIT(15) | BIT(14) | BIT(13))
>
> @@ -81,6 +80,9 @@ struct ad9834_state {
> struct spi_message freq_msg;
> struct mutex lock; /* protect sensor state */
>
> + unsigned long frequency0;
> + unsigned long frequency1;
I don't understand why we have two frequencies when we only ever use
one.
> +
> /*
> * DMA (thus cache coherency maintenance) requires the
> * transfer buffers to live in their own cache lines.
> @@ -100,6 +102,25 @@ enum ad9834_supported_device_ids {
> ID_AD9838,
> };
>
> +#define AD9833_CHANNEL(_chan) { \
No need for the underscore. (I think?)
> + .type = IIO_ALTVOLTAGE, \
> + .indexed = 1, \
> + .output = 1, \
> + .address = (_chan), \
> + .channel = (_chan), \
> + .info_mask_separate = BIT(IIO_CHAN_INFO_FREQUENCY) \
> +}
regards,
dan carpenter
next parent reply other threads:[~2019-02-06 15:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190206120542.16617-1-biabeniamin@outlook.com>
2019-02-06 14:59 ` Dan Carpenter [this message]
2019-02-09 17:45 ` [PATCH 1/2] staging: iio: frequency: ad9834: Move frequency to standard iio types Jonathan Cameron
[not found] ` <20190206120542.16617-2-biabeniamin@outlook.com>
2019-02-09 17:46 ` [PATCH 2/2] staging: iio: frequency: ad9834: Move phase and scale to standard iio attribute Jonathan Cameron
2019-02-06 12:25 [PATCH 1/2] staging: iio: frequency: ad9834: Move frequency to standard iio types Beniamin Bia
2019-02-09 17:26 ` 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=20190206145919.GA1978@kadam \
--to=dan.carpenter@oracle.com \
--cc=Michael.Hennerich@analog.com \
--cc=beniamin.bia@analog.com \
--cc=biabeniamin@outlook.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.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=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).