From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Cc: Hugo Meric <hugo.meric-Qt13gs6zZMY@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [lm-sensors] HMC6343
Date: Tue, 7 Jul 2009 13:46:38 +0200 [thread overview]
Message-ID: <20090707134638.6ff1b324@hyperion.delvare> (raw)
In-Reply-To: <4A5333C6.3080802-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
On Tue, 07 Jul 2009 11:38:46 +0000, Jonathan Cameron wrote:
> Basically it's protocol is a standard smbus type write byte command
> (address 0x19) followed by a delay (command specific) and then
> a read of multiple bytes (number is command dependant.)
>
> Unfortunately the device doesn't seem do anything helpful like notify
> you of how many bytes it is sending (as per smbus block read).
>
> I fear to make this work you'll need to write a kernel space driver.
> The first step is a conventional smbus send byte command. Follow this
> with a suitable delay. The second will need to make use of
> i2c_transfer with a msg looking something like
>
> char bob[6];
> struct i2c_msg read_msg = {
> .addr = 0x19,
> .flags = I2C_M_RD,
> .len = 6, // as appropriate to the command
> .buf = bob,
> };
>
> then i2c_transfer(adap, &read_msg, 1);
>
> should do the job.
Note: this could be done from userspace too if needed. The i2c-dev
interface supports raw reads and writes.
--
Jean Delvare
next prev parent reply other threads:[~2009-07-07 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <23114.97301.qm@web28307.mail.ukl.yahoo.com>
[not found] ` <20090707095934.7b86524f@hyperion.delvare>
[not found] ` <20090707095934.7b86524f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-07 11:38 ` [lm-sensors] HMC6343 Jonathan Cameron
[not found] ` <4A5333C6.3080802-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2009-07-07 11:46 ` Jean Delvare [this message]
[not found] ` <20090707134638.6ff1b324-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-07 11:54 ` Jonathan Cameron
[not found] ` <4A53375B.9070304-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2009-07-07 12:20 ` HMC6343 Jean Delvare
[not found] ` <874671.80619.qm@web28313.mail.ukl.yahoo.com>
[not found] ` <874671.80619.qm-KpgP/9vcbyPGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2009-07-08 10:37 ` Re : [lm-sensors] HMC6343 Jonathan Cameron
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=20090707134638.6ff1b324@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=hugo.meric-Qt13gs6zZMY@public.gmane.org \
--cc=jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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;
as well as URLs for NNTP newsgroup(s).