From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 4/4] emc1403: thermal sensor support
Date: Thu, 29 Apr 2010 18:04:29 +0000 [thread overview]
Message-ID: <20100429200429.06d67c01@hyperion.delvare> (raw)
In-Reply-To: <20100414125205.23181.15562.stgit@localhost.localdomain>
Hi Alan,
On Mon, 26 Apr 2010 11:09:13 +0100, Alan Cox wrote:
> +static int emc1403_detect(struct i2c_client *client,
> + struct i2c_board_info *info)
> +{
> + int id;
> + /* Check if thermal chip is SMSC and EMC1403 */
> +
> + id = i2c_smbus_read_byte_data(client, THERMAL_SMSC_ID_REG);
> + if (id != 0x5d)
> + return -ENODEV;
> +
> + /* Note: 0x25 is the 1404 which is very similar and this
> + driver could be extended */
> + id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
> + if (id != 0x21)
> + return -ENODEV;
> +
> + id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG);
> + if (id != 0x01)
> + return -ENODEV;
> +
> + strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
> + return 0;
> +}
> + (...)
> +
> +const static struct i2c_device_id emc1403_idtable[] = {
> + { "emc1403", 0 },
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, emc1403_idtable);
> +
> +static struct i2c_driver sensor_emc1403 = {
> + .driver = {
> + .name = "emc1403",
> + },
> + .detect = emc1403_detect,
> + .probe = emc1403_probe,
> + .remove = emc1403_remove,
> + .id_table = emc1403_idtable,
> +};
I had to apply the following patch for device detection to actually
work:
---
drivers/hwmon/emc1403.c | 6 ++++++
1 file changed, 6 insertions(+)
--- linux-2.6.34-rc5.orig/drivers/hwmon/emc1403.c 2010-04-26 15:44:23.000000000 +0200
+++ linux-2.6.34-rc5/drivers/hwmon/emc1403.c 2010-04-29 19:45:06.000000000 +0200
@@ -332,6 +332,10 @@ static int emc1403_remove(struct i2c_cli
return 0;
}
+static const unsigned short emc1403_address_list[] = {
+ 0x18, 0x2a, 0x4c, 0x4d, I2C_CLIENT_END
+};
+
const static struct i2c_device_id emc1403_idtable[] = {
{ "emc1403", 0 },
{ }
@@ -339,6 +343,7 @@ const static struct i2c_device_id emc140
MODULE_DEVICE_TABLE(i2c, emc1403_idtable);
static struct i2c_driver sensor_emc1403 = {
+ .class = I2C_CLASS_HWMON,
.driver = {
.name = "emc1403",
},
@@ -346,6 +351,7 @@ static struct i2c_driver sensor_emc1403
.probe = emc1403_probe,
.remove = emc1403_remove,
.id_table = emc1403_idtable,
+ .address_list = emc1403_address_list,
};
static int __init sensor_emc1403_init(void)
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2010-04-29 18:04 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-14 12:51 [PATCH 0/4] Various intel small device drivers Alan Cox
2010-04-14 12:51 ` [PATCH 1/4] hmc6352: Add driver for the HMC6352 compass Alan Cox
[not found] ` <20100414125136.23181.16788.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-04-14 13:48 ` Jonathan Cameron
2010-04-14 13:48 ` Jonathan Cameron
[not found] ` <4BC5C7A8.1040807-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2010-04-14 14:32 ` Alan Cox
2010-04-14 14:32 ` Alan Cox
[not found] ` <20100414153234.22765666-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-14 14:51 ` Jonathan Cameron
2010-04-14 14:51 ` Jonathan Cameron
2010-04-14 15:19 ` Alan Cox
[not found] ` <20100414161904.713eef78-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-14 16:39 ` Jonathan Cameron
2010-04-14 16:39 ` Jonathan Cameron
2010-04-14 21:36 ` Joe Perches
2010-04-14 21:36 ` Joe Perches
[not found] ` <1271280993.1833.36.camel-AkRN8/LKpobuYGix6ZUp1Q@public.gmane.org>
2010-04-15 12:11 ` Alan Cox
2010-04-15 12:11 ` Alan Cox
[not found] ` <20100415131153.0e383ef3-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-15 15:57 ` Joe Perches
2010-04-15 15:57 ` Joe Perches
[not found] ` <4BC5D681.20707-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2010-04-14 16:56 ` isl29020: ALS driver as misc device Alan Cox
2010-04-14 16:56 ` Alan Cox
[not found] ` <20100414175602.44580f3c-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-14 17:01 ` Greg KH
2010-04-14 17:01 ` Greg KH
[not found] ` <20100414170153.GA7494-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2010-04-15 10:09 ` Jonathan Cameron
2010-04-15 10:09 ` Jonathan Cameron
[not found] ` <4BC6E5CF.9070302-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2010-04-15 11:17 ` Alan Cox
2010-04-15 11:17 ` Alan Cox
[not found] ` <20100415121726.1b2a5a87-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-26 10:59 ` Jonathan Cameron
2010-04-26 10:59 ` Jonathan Cameron
2010-04-14 12:51 ` [PATCH 2/4] isl29020: ambient light sensor Alan Cox
[not found] ` <20100414125147.23181.5817.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-04-14 22:45 ` Daniel Mack
2010-04-14 22:45 ` Daniel Mack
[not found] ` <20100414224542.GX30807-ahpEBR4enfnCULTFXS99ULNAH6kLmebB@public.gmane.org>
2010-04-14 22:35 ` Alan Cox
2010-04-14 22:35 ` Alan Cox
[not found] ` <20100414233554.3f020155-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-04-15 6:20 ` Daniel Mack
2010-04-15 6:20 ` Daniel Mack
2010-04-15 10:15 ` Jonathan Cameron
2010-04-14 12:52 ` [PATCH 4/4] emc1403: thermal sensor support Alan Cox
2010-04-14 12:52 ` [lm-sensors] " Alan Cox
2010-04-21 14:17 ` Jean Delvare
2010-04-23 15:12 ` Alan Cox
2010-04-26 9:04 ` Jean Delvare
2010-04-26 10:09 ` Alan Cox
2010-04-27 12:25 ` Jean Delvare
2010-04-28 11:00 ` Jean Delvare
2010-04-29 18:04 ` Jean Delvare [this message]
2010-05-04 9:34 ` Jean Delvare
2010-05-04 11:33 ` Alan Cox
2010-05-04 14:54 ` Jean Delvare
2010-05-04 19:19 ` Jean Delvare
2010-05-04 22:53 ` Alan Cox
[not found] ` <20100414124913.23181.75903.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-04-14 12:52 ` [PATCH 3/4] liss331d1: accelerometer driver Alan Cox
2010-04-14 12:52 ` Alan Cox
2010-04-14 22:12 ` Éric Piel
[not found] ` <4BC63DC5.8040501-hGVxb2UgFK3z+pZb47iToQ@public.gmane.org>
2010-04-14 22:34 ` Daniel Mack
2010-04-14 22:34 ` Daniel Mack
[not found] ` <20100414223429.GW30807-ahpEBR4enfnCULTFXS99ULNAH6kLmebB@public.gmane.org>
2010-04-14 23:05 ` Neil Brown
2010-04-14 23:05 ` Neil Brown
2010-04-15 9:47 ` Éric Piel
2010-04-14 22:37 ` Alan Cox
2010-04-14 22:37 ` Alan Cox
2010-04-15 10:28 ` Jonathan Cameron
2010-04-15 10:28 ` Jonathan Cameron
[not found] ` <4BC6EA64.4070308-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2010-04-15 10:02 ` Alan Cox
2010-04-15 10:02 ` Alan Cox
[not found] ` <20100414125155.23181.56610.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-04-15 19:12 ` Pavel Machek
2010-04-15 19:12 ` Pavel Machek
2010-04-14 13:30 ` [PATCH 0/4] Various intel small device drivers Jean Delvare
2010-04-14 13:30 ` Jean Delvare
[not found] ` <20100414153052.4e07f0cc-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-14 13:49 ` Alan Cox
2010-04-14 13:49 ` Alan Cox
[not found] ` <20100414144912.12c83f51-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-04-14 13:55 ` Jonathan Cameron
2010-04-14 13:55 ` Jonathan Cameron
[not found] ` <4BC5C96B.7050901-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2010-04-14 14:19 ` Alan Cox
2010-04-14 14:19 ` Alan Cox
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=20100429200429.06d67c01@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.