From: Alan Cox <alan@linux.intel.com>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Alan Cox <alan@linux.jf.intel.com>, linux-input@vger.kernel.org
Subject: Re: [PATCH] Add a driver to support InvenSense mpu3050 gyroscope chip.
Date: Wed, 13 Apr 2011 14:07:11 +0100 [thread overview]
Message-ID: <20110413140711.260e04b8@bob.linux.org.uk> (raw)
In-Reply-To: <4DA57B40.2000402@cam.ac.uk>
> Could just fix the length in this. You only ever use it with the
> value 6. Hardly seems worth it's own function. I guess this may be
> because it gets used for other things in the full version? If so it
> doesn't do any harm here so might as well leave it alone.
In its current form, but there may well be future reasons for people to
update that depending upon their application of the device.
> > + u8 buffer[6];
> > + buffer[0] = MPU3050_XOUT_H;
> > + mpu3050_xyz_read_reg(client, buffer, 6);
> > + coords->x = buffer[0];
> > + coords->x = coords->x << 8 | buffer[1];
>
> Better to use le16_tocpu or similar rather than
> hand rolling these.
le16_to_cpu takes an u16 or similar input which means buffer then has
to be a u16[] array for alignment which means you need a separate input
and output buffer or to do uglies setting XOUT_H
(Normally I'd agree with you but in this case I'm unconvinced)
Alan
next prev parent reply other threads:[~2011-04-13 13:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 9:51 [PATCH] Add a driver to support InvenSense mpu3050 gyroscope chip Alan Cox
2011-04-13 10:30 ` Jonathan Cameron
2011-04-13 13:07 ` Alan Cox [this message]
2011-04-13 14:21 ` Jonathan Cameron
2011-04-13 14:30 ` Hennerich, Michael
2011-04-13 14:46 ` Alan Cox
2011-04-13 15:03 ` simon
2011-04-13 14:54 ` Alan Cox
2011-04-13 15:21 ` simon
-- strict thread matches above, loose matches on Subject: below --
2011-05-04 9:02 Alan Cox
2011-04-13 14:58 Alan Cox
2011-04-13 15:54 ` Jonathan Cameron
2011-04-13 14:55 Alan Cox
2011-04-06 12:38 Alan Cox
2011-03-09 13:47 Alan Cox
2011-03-14 15:39 ` Jonathan Cameron
2011-03-14 18:24 ` Alan Cox
2011-03-14 19:29 ` Jonathan Cameron
2011-03-14 20:14 ` Alan Cox
2011-03-15 6:02 ` Dmitry Torokhov
2011-03-15 11:59 ` Jonathan Cameron
2011-03-15 12:58 ` Alan Cox
2011-03-16 6:30 ` Dmitry Torokhov
2011-03-16 21:07 ` Rafael J. Wysocki
2011-03-15 9:44 ` Shubhrajyoti
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=20110413140711.260e04b8@bob.linux.org.uk \
--to=alan@linux.intel.com \
--cc=alan@linux.jf.intel.com \
--cc=jic23@cam.ac.uk \
--cc=linux-input@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 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.