All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "pmeerw@pmeerw.net" <pmeerw@pmeerw.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"Tirdea, Irina" <irina.tirdea@intel.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"Reus, Adriana" <adriana.reus@intel.com>
Subject: Re: [PATCH 2/2] iio: accel: kxcjk-1013: optimize i2c transfers in trigger handler
Date: Fri, 20 Feb 2015 15:27:43 +0000	[thread overview]
Message-ID: <1424446063.2916.17.camel@spandruv-mobl2> (raw)
In-Reply-To: <alpine.DEB.2.02.1502201621430.2739@pmeerw.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1372 bytes --]

On Fri, 2015-02-20 at 16:23 +0100, Peter Meerwald wrote:
> > > > > +
> > > > > +		values[i] = data & 0xFF;
> > > > > +		values[i+1] = data >> 8;
> > > > 
> > > > this is incorrect; it forces the data to be little endian, however, the
> > > > endianness (as specified in the driver's .scan_type) is IIO_CPU -- the
> > > > code breaks for big-endian CPUs
> > > > 
> > > > since _read_i2c_block_data() can't do endianness conversion (and the chip
> > > > does i2c endianness, i.e. little-endian), the .scan_type should become
> > > > IIO_LE and above code is correct again but still ugly :)
> > > > 
> > > > bottom line: change .scan_type to IIO_LE
> > > > 
> > > Good point. Changing the endianess to IIO_LE is correct for either kxcjk1013_read_block_data or i2c_smbus_read_i2c_block_data.
> > > Will fix this in the next version. Thanks for catching this!
> > > 
> > I don't think changing to IIO_LE is good idea as when i2c_read_bock..
> > then the scan type will be CPU. So better to fix endianness in this
> > function.
> 
> the chip has little-endian data registers; i2c_read_block() just transfers 
> the data (no endianness conversion), so the data will still be 
> little-endian
You are right.
> 
> p.
> 

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

WARNING: multiple messages have this Message-ID (diff)
From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "pmeerw@pmeerw.net" <pmeerw@pmeerw.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"Tirdea, Irina" <irina.tirdea@intel.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"Reus, Adriana" <adriana.reus@intel.com>
Subject: Re: [PATCH 2/2] iio: accel: kxcjk-1013: optimize i2c transfers in trigger handler
Date: Fri, 20 Feb 2015 15:27:43 +0000	[thread overview]
Message-ID: <1424446063.2916.17.camel@spandruv-mobl2> (raw)
In-Reply-To: <alpine.DEB.2.02.1502201621430.2739@pmeerw.net>

T24gRnJpLCAyMDE1LTAyLTIwIGF0IDE2OjIzICswMTAwLCBQZXRlciBNZWVyd2FsZCB3cm90ZToN
Cj4gPiA+ID4gPiArDQo+ID4gPiA+ID4gKwkJdmFsdWVzW2ldID0gZGF0YSAmIDB4RkY7DQo+ID4g
PiA+ID4gKwkJdmFsdWVzW2krMV0gPSBkYXRhID4+IDg7DQo+ID4gPiA+IA0KPiA+ID4gPiB0aGlz
IGlzIGluY29ycmVjdDsgaXQgZm9yY2VzIHRoZSBkYXRhIHRvIGJlIGxpdHRsZSBlbmRpYW4sIGhv
d2V2ZXIsIHRoZQ0KPiA+ID4gPiBlbmRpYW5uZXNzIChhcyBzcGVjaWZpZWQgaW4gdGhlIGRyaXZl
cidzIC5zY2FuX3R5cGUpIGlzIElJT19DUFUgLS0gdGhlDQo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YmxvY2soKSBqdXN0IHRyYW5zZmVycyANCj4gdGhlIGRhdGEgKG5v
IGVuZGlhbm5lc3MgY29udmVyc2lvbiksIHNvIHRoZSBkYXRhIHdpbGwgc3RpbGwgYmUgDQo+IGxp
dHRsZS1lbmRpYW4NCllvdSBhcmUgcmlnaHQuDQo+IA0KPiBwLg0KPiANCg0K

  reply	other threads:[~2015-02-20 15:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 18:21 [PATCH 0/2] kxcjk-1013 driver optimizations Irina Tirdea
2015-02-16 18:21 ` [PATCH 1/2] iio: accel: kxcjk-1013: use available_scan_masks Irina Tirdea
2015-02-16 18:21 ` [PATCH 2/2] iio: accel: kxcjk-1013: optimize i2c transfers in trigger handler Irina Tirdea
2015-02-16 19:26   ` Peter Meerwald
2015-02-20 12:02     ` Tirdea, Irina
2015-02-20 12:02       ` Tirdea, Irina
2015-02-20 14:58       ` Pandruvada, Srinivas
2015-02-20 14:58         ` Pandruvada, Srinivas
2015-02-20 15:23         ` Peter Meerwald
2015-02-20 15:27           ` Pandruvada, Srinivas [this message]
2015-02-20 15:27             ` Pandruvada, Srinivas
2015-02-21 18:29       ` Jonathan Cameron
2015-02-24 17:25         ` Tirdea, Irina
2015-02-24 17:25           ` Tirdea, Irina
2015-02-16 19:14 ` [PATCH 0/2] kxcjk-1013 driver optimizations Peter Meerwald
2015-02-20 12:03   ` Tirdea, Irina
2015-02-21 18:26     ` Jonathan Cameron
2015-02-24 17:22       ` Tirdea, Irina

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=1424446063.2916.17.camel@spandruv-mobl2 \
    --to=srinivas.pandruvada@intel.com \
    --cc=adriana.reus@intel.com \
    --cc=irina.tirdea@intel.com \
    --cc=jic23@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.