From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Application using i2c-imx.c
Date: Wed, 09 Dec 2009 15:46:40 +0000 [thread overview]
Message-ID: <20091209164640.412a2db1@hyperion.delvare> (raw)
In-Reply-To: <2655c0a70912080328w33f34840x5e0702ce750cec70@mail.gmail.com>
Hi Javier,
What about NOT TOP-POSTING, as I requested once already?
On Wed, 9 Dec 2009 16:29:34 +0100, Javier Zugasti wrote:
> Thank you very much for your reply Jean.
> I patched the kernel tree with the patch you linked me to and then selected
> the hwmon and lm73 option in the menuconfig options (together with the i2c
> of course).
>
> After that I used a cross-compiler to compile the kernel for my board and
> transferred the images to my board and started my linux there.
>
> I assume the system supports i2c now.
> No i2c devices appear in the /dev directory or in /sys/bus/i2c/devices
Which kernel are you running? I2C adapters only show
in /sys/bus/i2c/devices since kernel 2.6.32. For older kernels you
would look for them in /sys/class/i2c-adapter.
Assuming you run an older kernel, please list the entries
under /sys/class/i2c-adapter.
, but
> the lm73 appears in /sys/bus/i2c/drivers and i2c appears in the file
> /proc/devices:
>
> cat /proc/devices
> Character devices:
> ...
> *89 i2c*
> ...
This means i2c-dev is loaded, but you shouldn't need it, see below.
> So now, how can I write an application in the user space that reads the
> temperature from the lm73? Do I have to use IOCTL calls or how do I do it?
With the lm73 driver you're using, access to the LM73 chip is done
through sysfs, very easily. You would have to go through ioctls
on /dev/i2c* nodes only if you did _not_ have a kernel driver for the
LM73.
--
Jean Delvare
http://khali.linux-fr.org/wishlist.html
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2009-12-09 15:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 11:28 [lm-sensors] Application using i2c-imx.c Javier Zugasti
2009-12-09 8:04 ` Jean Delvare
2009-12-09 15:29 ` Javier Zugasti
2009-12-09 15:46 ` Jean Delvare [this message]
2009-12-09 16:12 ` Javier Zugasti
2009-12-09 16:25 ` Jean Delvare
2009-12-09 16:39 ` Javier Zugasti
2009-12-09 16:49 ` 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=20091209164640.412a2db1@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@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.