mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: George Stark <gnstark@sberdevices.ru>
Cc: jic23@kernel.org, lars@metafoo.de, neil.armstrong@linaro.org,
	khilman@baylibre.com, jbrunet@baylibre.com,
	martin.blumenstingl@googlemail.com, nuno.sa@analog.com,
	linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
	kernel@sberdevices.ru
Subject: Re: [PATCH v1] meson saradc: add iio device attrib to switch channel 7 mux
Date: Sat, 27 May 2023 11:21:01 +0300	[thread overview]
Message-ID: <ZHG9bYO1PNuPJhWn@smile.fi.intel.com> (raw)
In-Reply-To: <20230524000111.14370-1-gnstark@sberdevices.ru>

On Wed, May 24, 2023 at 03:01:11AM +0300, George Stark wrote:
> Patch adds two sysfs nodes: chan7_mux to set mux state
> and chan7_mux_available to show available mux states.
> Mux can be used to debug and calibrate adc by
> switching and measuring well-known inputs like gnd, vdd etc.

GND
Vdd

...

> +static ssize_t chan7_mux_store(struct device *dev,
> +			       struct device_attribute *attr,
> +			       const char *buf, size_t count)
> +{
> +	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(chan7_vol); i++)
> +		if (!strcmp(chan7_vol[i], buf)) {
> +			meson_sar_adc_set_chan7_mux(indio_dev, i);
> +			return count;
> +		}
> +
> +	return -EINVAL;

NIH sysfs_match_string().

> +}

...

> +static IIO_DEVICE_ATTR_RW(chan7_mux, -1);
> +static IIO_DEVICE_ATTR_RO(chan7_mux_available, -1);

Place each of them near to the respective callback(s),

...

> +static struct attribute *meson_sar_adc_attrs[] = {
> +	&iio_dev_attr_chan7_mux_available.dev_attr.attr,
> +	&iio_dev_attr_chan7_mux.dev_attr.attr,
> +	NULL,

No comma for the terminator entry.

> +};

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2023-05-27  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24  0:01 George Stark
2023-05-27  8:21 ` Andy Shevchenko [this message]
2023-05-27 21:37   ` George Stark

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=ZHG9bYO1PNuPJhWn@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gnstark@sberdevices.ru \
    --cc=jbrunet@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=kernel@sberdevices.ru \
    --cc=khilman@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=nuno.sa@analog.com \
    /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

all inboxes | Powered by JetHome®