From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: "Aguirre Rodriguez,
Sergio Alberto" <saaguirre-l0cyMroinI0@public.gmane.org>
Cc: "linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
"Hiremath, Vaibhav" <hvaibhav-l0cyMroinI0@public.gmane.org>
Subject: Re: Calling an I2C camera sensor with SMBUS API?
Date: Fri, 12 Dec 2008 16:44:26 +0100 [thread overview]
Message-ID: <20081212164426.27b4f5cd@hyperion.delvare> (raw)
In-Reply-To: <A24693684029E5489D1D202277BE894415E6E424-EovWT4A8QTWIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
Hi Sergio,
On Thu, 11 Dec 2008 17:55:26 -0600, Aguirre Rodriguez, Sergio Alberto wrote:
> Some days back, Vaibhav Hiremath submitted patches to linux-omap and
> video4linux trees for an I2C video codec chip, and he was suggested to
> use SMBUS API instead of manually constructing i2c messages and sending
> using i2c_transfer API.
>
> So I attempted to do the same for a camera sensor I've been working on.
>
> But one thing I noticed is that my sensor needs to access 16-bit register
> addresses in the device, and I saw in SMBUS spec 2.0 that the equivalent
> thing (SMBUS commands) are only 8-bit length.
>
> So, should this automatically discard using SMBUS api for my case, or am
> I missing something else? (like a SMBUS 16-bit expansion or so)
You are correct, SMBus messaging implies an 8-bit command field (which
is most frequently used for register addressing.) There are no 16-bit
command variants. For writes, we can cheat because there is no
direction change between the address and the data, but for reads
there's simply nothing we can do to work around this limitation. So,
unless your device is write-only, you indeed can't use the SMBus-level
API for 16-bit register addresses and you have to stick to the
I2C-level API.
--
Jean Delvare
next prev parent reply other threads:[~2008-12-12 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 23:55 Calling an I2C camera sensor with SMBUS API? Aguirre Rodriguez, Sergio Alberto
[not found] ` <A24693684029E5489D1D202277BE894415E6E424-EovWT4A8QTWIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2008-12-12 15:44 ` Jean Delvare [this message]
[not found] ` <20081212164426.27b4f5cd-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-12-12 16:46 ` David Brownell
[not found] ` <200812120846.48960.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-12-12 17:07 ` Jean Delvare
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=20081212164426.27b4f5cd@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=hvaibhav-l0cyMroinI0@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=saaguirre-l0cyMroinI0@public.gmane.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