From: Jonathan Cameron <jic23@cam.ac.uk>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 08/13] staging:iio:max1363 move to new abi.
Date: Tue, 30 Mar 2010 15:31:23 +0100 [thread overview]
Message-ID: <4BB20B3B.3090107@cam.ac.uk> (raw)
In-Reply-To: <1269808879-28838-9-git-send-email-jic23@cam.ac.uk>
...
> +static ssize_t max1363_read_single_channel(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct iio_dev *dev_info = dev_get_drvdata(dev);
> + struct max1363_state *st = iio_dev_get_devdata(dev_info);
> + struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
> + struct i2c_client *client = st->client;
> + int ret = 0, len = 0;
> + s32 data ;
> + char rxbuf[2];
> + long mask;
> +
> + mutex_lock(&dev_info->mlock);
> + /* If ring buffer capture is occuring, query the buffer */
> + if (iio_ring_enabled(dev_info)) {
> + mask = max1363_mode_table[this_attr->address].modemask;
> + data = max1363_single_channel_from_ring(mask, st);
> + if (data < 0) {
> + ret = data;
> + goto error_ret;
> + }
> + } else {
> + /* Check to see if current scan mode is correct */
> + if (st->current_mode !=
> + &max1363_mode_table[this_attr->address]) {
> + /* Update scan mode if needed */
> + st->current_mode
> + = &max1363_mode_table[this_attr->address];
> + ret = max1363_set_scan_mode(st);
> + if (ret)
> + goto error_ret;
> + }
> + /* Get reading */
> + data = i2c_master_recv(client, rxbuf, 2);
> + if (data < 0) {
> + ret = data;
> + goto error_ret;
> + }
> + data = rxbuf[1];
This is clearly wrong. I'm only reading the lower 8 bits of the relevant channel.
Trivial fix, so I'll roll it into next version. For reference that series will also have
patches add the remaining devices listed to be added to this driver on the iioutils wiki.
Jonathan
....
prev parent reply other threads:[~2010-03-30 14:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 20:41 [PATCH 00/13] Staging: IIO: ABI changes round 1, V1 Jonathan Cameron
2010-03-28 20:41 ` [PATCH 01/13] staging:iio: Add new in_raw definitions for adc channels Jonathan Cameron
2010-03-28 20:41 ` [PATCH 02/13] staging:iio: Add new attrs for sampling frequency available and temp_raw Jonathan Cameron
2010-03-28 20:41 ` [PATCH 03/13] iio:staging:accelerometers move towards the new abi Jonathan Cameron
2010-03-28 20:41 ` [PATCH 04/13] staging:iio: Support functions for scan mask matching Jonathan Cameron
2010-03-28 20:41 ` [PATCH 05/13] staging: iio: Move from class to bus Jonathan Cameron
2010-03-28 20:41 ` [PATCH 06/13] staging:iio: Move event attributes into the event[n] device in sysfs Jonathan Cameron
2010-03-28 20:41 ` [PATCH 07/13] staging:iio: Clean out unused IIO_SCAN_EL and add IIO_SCAN_NAMED_EL_C Jonathan Cameron
2010-03-28 20:41 ` [PATCH 08/13] staging:iio:max1363 move to new abi Jonathan Cameron
2010-03-28 20:41 ` [PATCH 09/13] staging:iio: Documentation, update iio_utils.h for the move to a bus Jonathan Cameron
2010-03-28 20:41 ` [PATCH 10/13] staging:iio: ABI documentation (partial) Jonathan Cameron
2010-03-28 20:41 ` [PATCH 11/13] staging:iio: Directory name changes to match new ABI Jonathan Cameron
2010-03-28 20:41 ` [PATCH 12/13] staging:iio:tsl2563: change lux to illuminance0_input to match new abi Jonathan Cameron
2010-03-28 20:41 ` [PATCH 13/13] staging:iio: Remove naming via IDR's where no longer necessary under " Jonathan Cameron
2010-03-29 13:55 ` [PATCH 10/13] staging:iio: ABI documentation (partial) Jonathan Cameron
2010-03-30 14:31 ` Jonathan Cameron [this message]
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=4BB20B3B.3090107@cam.ac.uk \
--to=jic23@cam.ac.uk \
--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