Skip to contentSkip to conversation

hwmon: Add support for w83791d sensor chip

PATCH New Charles Spirakis 3 participants 8 messages Feb 14, 2006 – Mar 30, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

From: Charles Spirakis <bezaur at hotmail.com>

Add support for the w83791d sensor chip. The w83791d hardware is somewhere between the w83781d and the w83792d and this driver code is derived from the code that supports those chips.

Signed-off by: Charles Spirakis <bezaur at gmail.com>

---

  Documentation/hwmon/w83791d |  117 +++
  drivers/hwmon/Kconfig       |   10
  drivers/hwmon/Kconfig.orig  |  462 ++++++++++++
  drivers/hwmon/Makefile      |    1
  drivers/hwmon/w83791d.c     | 1647

++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 2237 insertions(+)

Full patch included in attachement.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w83791d_support.patch
Type: text/x-patch
Size: 71394 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060214/8c325fe5/w83791d_support-0001.bin

#1 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

From: Charles Spirakis <bezaur at gmail.com>

Add support for the w83791d sensor chip. The w83791d hardware is somewhere between the w83781d and the w83792d and this driver code is derived from the code that supports those chips.

Signed-off by: Charles Spirakis <bezaur at gmail.com>

---

Resend. Removing the Kconfig.orig which didn't belong in the patch.

-- charles

Quoted 15 lines · Charles Spirakis

From: Charles Spirakis <bezaur at hotmail.com>

Add support for the w83791d sensor chip. The w83791d hardware is somewhere between the w83781d and the w83792d and this driver code is derived from the code that supports those chips.

Signed-off by: Charles Spirakis <bezaur at gmail.com>

---

  Documentation/hwmon/w83791d |  117 +++
  drivers/hwmon/Kconfig       |   10
  drivers/hwmon/Kconfig.orig  |  462 ++++++++++++
  drivers/hwmon/Makefile      |    1
  drivers/hwmon/w83791d.c     | 1647
Quoted 8 lines

++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 2237 insertions(+)

Full patch included in attachement.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: w83791d_support.patch
Type: text/x-patch
Size: 56322 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060214/be853dcf/w83791d_support-0001.bin

#2 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

In reply to Charles Spirakis
Quoted 6 lines · Charles Spirakis

From: Charles Spirakis <bezaur at gmail.com>

Add support for the w83791d sensor chip. The w83791d hardware is somewhere between the w83781d and the w83792d and this driver code is derived from the code that supports those chips.

Please hold on, I will do the review this week as I hope.

Regards
Rudolf

#3 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

In reply to Charles Spirakis

No problem, I know y'all are busy.

I have validated the patch applies cleanly on 2.6.16-rc5 as well. Please let me know if there is anything I can do to help.

Thanks!

-- charles

Quoted 14 lines · Rudolf Marek
Quoted 6 lines · Charles Spirakis

From: Charles Spirakis <bezaur at gmail.com>

Add support for the w83791d sensor chip. The w83791d hardware is somewhere between the w83781d and the w83792d and this driver code is derived from the code that supports those chips.

Please hold on, I will do the review this week as I hope.

Regards
Rudolf

#5 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

In reply to Charles Spirakis

Thanks! I'll start working on an updated patch.

I think I understand most of your issues, but I do have two questions:

1) Do you have an example of the SENSOR_ARRAY style? I grep'ed for SENSOR_ARRAY in the 2.6.16 kernel and didn't see anything. Is this a concept (i.e. use arrays) or specific macro/code? Is there sample code you can point me to?

2) What did you mean by:

Quoted 11 lines
(quoted diff) +9 -0
+       /* Determine the chip type. */
+       if (kind <= 0) {
+               /* get vendor ID */
+               val2 = w83791d_read(new_client, W83791D_REG_CHIPMAN);
+               if (val2 != 0x5c) {     /* the vendor is NOT Winbond */
+                       goto ERROR1;
+               }
+               val1 = w83791d_read(new_client, W83791D_REG_WCHIPID);
+               if (val1 = 0x71 && address >= 0x2c) {

Maybe you check the device adr and adr reg too

Do you mean the serial bus address register (index 0x48)? Don't I already know the address of the device based on the reads that I'm doing? Or are you saying I should confirm that the address register has an address that matches the address of the reads that I'm doing?

-- charles

#6 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

In reply to Charles Spirakis

Hi Charles,

Quoted 8 lines

Thanks! I'll start working on an updated patch.

I think I understand most of your issues, but I do have two questions:

1) Do you have an example of the SENSOR_ARRAY style? I grep'ed for SENSOR_ARRAY in the 2.6.16 kernel and didn't see anything. Is this a concept (i.e. use arrays) or specific macro/code? Is there sample code you can point me to?

This is something new, not in 2.6.16. You'll have to take a look at Linus' latest (2.6.16-git14 right now) or any recent -mm. There's no macro named SENSOR_ARRAY, by the way, but Rudolf was obviously referring to the possibility to define sysfs files within arrays rather than individually, so that they are then easier to instanciate. This is done using the SENSOR_ATTR and SENSOR_ATTR_2 macros. You can find examples of use in the following drivers:
f71805f
pc87360
w83627ehf
w83792d

Quoted 12 lines

2) What did you mean by:

Quoted 10 lines
(quoted diff) +9 -0
+       /* Determine the chip type. */
+       if (kind <= 0) {
+               /* get vendor ID */
+               val2 = w83791d_read(new_client, W83791D_REG_CHIPMAN);
+               if (val2 != 0x5c) {     /* the vendor is NOT Winbond */
+                       goto ERROR1;
+               }
+               val1 = w83791d_read(new_client, W83791D_REG_WCHIPID);
+               if (val1 = 0x71 && address >= 0x2c) {
Quoted 6 lines
Quoted 1 line

Maybe you check the device adr and adr reg too

Do you mean the serial bus address register (index 0x48)? Don't I already know the address of the device based on the reads that I'm doing? Or are you saying I should confirm that the address register has an address that matches the address of the reads that I'm doing?

Yes, verifying that register 0x48 holds the address is a good safety check. If it doesn't, then you know that it cannot be a W83791D chip, and this avoids a chip misdetection. Many other drivers do that (adm9240, it87, lm78, w83627hf, w83781d, w83792d.)

Thanks,

Signature · 1 line
Jean Delvare
#7 lore raw

PATCH 1/1 hwmon: Add support for w83791d sensor chip

In reply to Charles Spirakis

On 3/28/06, Jean Delvare <khali at linux-fr.org> wrote:
...

Quoted 12 lines

This is something new, not in 2.6.16. You'll have to take a look at Linus' latest (2.6.16-git14 right now) or any recent -mm. There's no macro named SENSOR_ARRAY, by the way, but Rudolf was obviously referring to the possibility to define sysfs files within arrays rather than individually, so that they are then easier to instanciate. This is done using the SENSOR_ATTR and SENSOR_ATTR_2 macros. You can find examples of use in the following drivers:
f71805f
pc87360
w83627ehf
w83792d

Thanks! Found it (and the macro definitions in <linux/hwmon-sysfs.h>). Will update to use these...

...

Quoted 11 lines
Quoted 6 lines

Do you mean the serial bus address register (index 0x48)? Don't I already know the address of the device based on the reads that I'm doing? Or are you saying I should confirm that the address register has an address that matches the address of the reads that I'm doing?

Yes, verifying that register 0x48 holds the address is a good safety check. If it doesn't, then you know that it cannot be a W83791D chip, and this avoids a chip misdetection. Many other drivers do that (adm9240, it87, lm78, w83627hf, w83781d, w83792d.)

OK, will do.