Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Beniamin Bia <biabeniamin@gmail.com>
Cc: <linux-iio@vger.kernel.org>, Beniamin Bia <beniamin.bia@analog.com>
Subject: Re: [PATCH 1/2] staging: iio: frequency: ad9833: Get frequency value statically
Date: Fri, 1 Feb 2019 11:24:01 +0000	[thread overview]
Message-ID: <20190201112401.00005d16@huawei.com> (raw)
In-Reply-To: <20190201093638.26068-1-biabeniamin@gmail.com>

On Fri, 1 Feb 2019 11:36:37 +0200
Beniamin Bia <biabeniamin@gmail.com> wrote:

> The value of frequency is taken from ad9834.c instead of platform data

Why?  I would rather see this move over to DT than take aways the flexibility
that was previously there.

Jonathan

> 
> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
> ---
>  drivers/staging/iio/frequency/ad9834.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
> index 995acdd7c942..d92d4bf71261 100644
> --- a/drivers/staging/iio/frequency/ad9834.c
> +++ b/drivers/staging/iio/frequency/ad9834.c
> @@ -99,6 +99,16 @@ enum ad9834_supported_device_ids {
>  	ID_AD9838,
>  };
>  
> +static struct ad9834_platform_data default_config = {
> +	.mclk = 25000000,
> +	.freq0 = 1000000,
> +	.freq1 = 5000000,
> +	.phase0 = 512,
> +	.phase1 = 1024,
> +	.en_div2 = false,
> +	.en_signbit_msb_out = false,
> +};
> +
>  static unsigned int ad9834_calc_freqreg(unsigned long mclk, unsigned long fout)
>  {
>  	unsigned long long freqreg = (u64)fout * (u64)BIT(AD9834_FREQ_BITS);
> @@ -391,16 +401,13 @@ static const struct iio_info ad9833_info = {
>  
>  static int ad9834_probe(struct spi_device *spi)
>  {
> -	struct ad9834_platform_data *pdata = dev_get_platdata(&spi->dev);
> +	struct ad9834_platform_data *pdata;
>  	struct ad9834_state *st;
>  	struct iio_dev *indio_dev;
>  	struct regulator *reg;
>  	int ret;
>  
> -	if (!pdata) {
> -		dev_dbg(&spi->dev, "no platform data?\n");
> -		return -ENODEV;
> -	}
> +	pdata = &default_config;
>  
>  	reg = devm_regulator_get(&spi->dev, "avdd");
>  	if (IS_ERR(reg))



  parent reply	other threads:[~2019-02-01 11:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  9:36 [PATCH 1/2] staging: iio: frequency: ad9833: Get frequency value statically Beniamin Bia
2019-02-01  9:36 ` [PATCH 2/2] staging: iio: frequency: ad9833: Load clock using clock framework Beniamin Bia
2019-02-01 11:24 ` Jonathan Cameron [this message]
2019-02-01 12:25   ` [PATCH 1/2] staging: iio: frequency: ad9833: Get frequency value statically Bia, Beniamin
2019-02-01 12:42     ` 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=20190201112401.00005d16@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=beniamin.bia@analog.com \
    --cc=biabeniamin@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox