public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: "Datta, Shubhrajyoti" <shubhrajyoti@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: Re: [RFC] [PATCH] Adding support for BMP085 pressure sensor.
Date: Mon, 14 Jun 2010 12:16:32 +0200	[thread overview]
Message-ID: <201006141216.32386.oneukum@suse.de> (raw)
In-Reply-To: <0680EC522D0CC943BC586913CF3768C003B34A60A3@dbde02.ent.ti.com>

Am Montag, 14. Juni 2010 12:13:44 schrieb Datta, Shubhrajyoti:
> +static s32 bmp085_get_calibration_data(struct i2c_client *client)
> +{
> +       u8 tmp[BMP085_CALIBRATION_DATA_LENGTH];
> +       struct bmp085_data *data = i2c_get_clientdata(client);
> +       struct bmp085_calibration_data *cali = &(data->calibration);
> +       s32 status = i2c_smbus_read_i2c_block_data(client,
> +                               BMP085_CALIBRATION_DATA_START,
> +                               BMP085_CALIBRATION_DATA_LENGTH, tmp);
> +
> +       cali->AC1 =  (tmp[0] << 8) | tmp[1];
> +       cali->AC2 =  (tmp[2] << 8) | tmp[3];
> +       cali->AC3 =  (tmp[4] << 8) | tmp[5];
> +       cali->AC4 =  (tmp[6] << 8) | tmp[7];
> +       cali->AC5 =  (tmp[8] << 8) | tmp[9];
> +       cali->AC6 = (tmp[10] << 8) | tmp[11];

Please use the macros for reading be16 data.

	Regards
		Oliver

  reply	other threads:[~2010-06-14 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 10:13 [RFC] [PATCH] Adding support for BMP085 pressure sensor Datta, Shubhrajyoti
2010-06-14 10:16 ` Oliver Neukum [this message]
2010-06-14 10:30 ` Oliver Neukum
2010-06-14 10:35 ` Stefan Schmidt
2010-06-14 10:58   ` Christoph Mair
2010-06-14 10:59   ` Datta, Shubhrajyoti
2010-06-14 11:55 ` J.I. Cameron
2010-06-14 14:14   ` Datta, Shubhrajyoti
  -- strict thread matches above, loose matches on Subject: below --
2010-06-14 14:19 Datta, Shubhrajyoti
2010-06-14 16:44 ` Jonathan Cameron
2010-06-14 16:44 ` Randy Dunlap

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=201006141216.32386.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shubhrajyoti@ti.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