From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 03/13] staging:iio:ad7606: Remove default device configuration from platform data
Date: Sat, 22 Oct 2016 16:24:12 +0100 [thread overview]
Message-ID: <31919a5c-4be7-e2a4-0728-c5e9827bcbca@kernel.org> (raw)
In-Reply-To: <1476896828-10544-4-git-send-email-lars@metafoo.de>
On 19/10/16 18:06, Lars-Peter Clausen wrote:
> While for some very selected setups it might be useful to be able to
> provide default configuration data via the platform data, generally this
> becomes very impractical as the number of configuration options increases.
> So the general policy is to use the power-on default values of the device
> and let the application using the device configure it according to its
> needs.
>
> Implement this scheme for the ad7606 driver by removing support for
> specifying a default configuration via the platform data.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.
Thanks,
Jonathan
> ---
> drivers/staging/iio/adc/ad7606.h | 4 ----
> drivers/staging/iio/adc/ad7606_core.c | 12 ++----------
> 2 files changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7606.h b/drivers/staging/iio/adc/ad7606.h
> index 380c56a..cf6be65 100644
> --- a/drivers/staging/iio/adc/ad7606.h
> +++ b/drivers/staging/iio/adc/ad7606.h
> @@ -15,8 +15,6 @@
>
> /**
> * struct ad7606_platform_data - platform/board specific information
> - * @default_os: default oversampling value {0, 2, 4, 8, 16, 32, 64}
> - * @default_range: default range +/-{5000, 10000} mVolt
> * @gpio_convst: number of gpio connected to the CONVST pin
> * @gpio_reset: gpio connected to the RESET pin, if not used set to -1
> * @gpio_range: gpio connected to the RANGE pin, if not used set to -1
> @@ -28,8 +26,6 @@
> */
>
> struct ad7606_platform_data {
> - unsigned int default_os;
> - unsigned int default_range;
> unsigned int gpio_convst;
> unsigned int gpio_reset;
> unsigned int gpio_range;
> diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
> index 1093647..a16c6f5 100644
> --- a/drivers/staging/iio/adc/ad7606_core.c
> +++ b/drivers/staging/iio/adc/ad7606_core.c
> @@ -452,16 +452,8 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
> st->dev = dev;
> st->bops = bops;
> st->base_address = base_address;
> - st->range = pdata->default_range == 10000 ? 10000 : 5000;
> -
> - ret = ad7606_oversampling_get_index(pdata->default_os);
> - if (ret < 0) {
> - dev_warn(dev, "oversampling %d is not supported\n",
> - pdata->default_os);
> - st->oversampling = 0;
> - } else {
> - st->oversampling = pdata->default_os;
> - }
> + st->range = 5000;
> + st->oversampling = 0;
>
> st->reg = devm_regulator_get(dev, "vcc");
> if (!IS_ERR(st->reg)) {
>
next prev parent reply other threads:[~2016-10-22 15:24 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 17:06 [PATCH 00/13] staging:iio:ad7606: Towards moving out of staging Lars-Peter Clausen
2016-10-19 17:06 ` [PATCH 01/13] staging:iio:ad7606: Remove unused int_vref_mv field Lars-Peter Clausen
2016-10-22 15:22 ` Jonathan Cameron
2016-10-19 17:06 ` [PATCH 02/13] staging:iio:ad7606: Remove redundant name field from ad7606_chip_info Lars-Peter Clausen
2016-10-22 15:23 ` Jonathan Cameron
2016-10-19 17:06 ` [PATCH 03/13] staging:iio:ad7606: Remove default device configuration from platform data Lars-Peter Clausen
2016-10-22 15:24 ` Jonathan Cameron [this message]
2016-10-19 17:06 ` [PATCH 04/13] staging:iio:ad7606: Remove out-of-band error reporting Lars-Peter Clausen
2016-10-22 15:27 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 05/13] staging:iio:ad7606: Use oversampling ratio of 1 for no oversampling Lars-Peter Clausen
2016-10-22 15:28 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 06/13] staging:iio:ad7606: Avoid allocating buffer for each data capture Lars-Peter Clausen
2016-10-22 15:28 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 07/13] staging:iio:ad7606: Factor out common code between periodic and one-shot capture Lars-Peter Clausen
2016-10-22 17:01 ` Jonathan Cameron
2016-10-22 17:02 ` Jonathan Cameron
2016-10-22 17:20 ` Lars-Peter Clausen
2016-10-22 17:33 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 08/13] staging:iio:ad7606: Move set_drvdata() into common code Lars-Peter Clausen
2016-10-22 16:59 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 09/13] staging:iio:ad7606: Let the common probe function return int Lars-Peter Clausen
2016-10-22 17:02 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 10/13] staging:iio:ad7606: Let common remove function take a struct device * Lars-Peter Clausen
2016-10-22 17:09 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 11/13] staging:iio:ad7606: Run trigger handler only once per trigger event Lars-Peter Clausen
2016-10-22 17:04 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 12/13] staging:iio:ad7606: Use GPIO descriptor API Lars-Peter Clausen
2016-10-22 17:09 ` Jonathan Cameron
2016-10-19 17:07 ` [PATCH 13/13] staging:iio:ad7606: Move buffer code to main source file Lars-Peter Clausen
2016-10-22 17:11 ` 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=31919a5c-4be7-e2a4-0728-c5e9827bcbca@kernel.org \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@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).