All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Cromie <jim.cromie@gmail.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [patch 2.6.27-rc6 5/6 ] hwmon/pc87360 separate sysfs
Date: Wed, 10 Sep 2008 09:41:06 +0000	[thread overview]
Message-ID: <48C79632.8020605@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]

inlined and attached

 From a65aa33f5fac6543cf390c9acbcbd2011f3ffe3d Mon Sep 17 00:00:00 2001
From: Jim Cromie <jim.cromie@gmail.com>
Date: Sat, 28 Jun 2008 20:42:24 -0600
Subject: [PATCH] hwmon/pc87360 separate alarm files - add dev_dbg help

temp and vin status register values may be set by chip specifications,
set again by bios, or by this previously loaded driver.
Debug output nicely displays modprobe init=\d actions.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 drivers/hwmon/pc87360.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index ebb235b..cf265d2 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -1290,10 +1290,11 @@ static void pc87360_init_device(struct 
platform_device *pdev,
 
     nr = data->innr < 11 ? data->innr : 11;
     for (i = 0; i < nr; i++) {
+        reg = pc87360_read_value(data, LD_IN, i,
+                     PC87365_REG_IN_STATUS);
+        dev_dbg(&pdev->dev, "bios in%d status:0x%02x\n", i, reg);
         if (init >= init_in[i]) {
             /* Forcibly enable voltage channel */
-            reg = pc87360_read_value(data, LD_IN, i,
-                         PC87365_REG_IN_STATUS);
             if (!(reg & CHAN_ENA)) {
                 dev_dbg(&pdev->dev, "Forcibly "
                     "enabling in%d\n", i);
@@ -1306,18 +1307,23 @@ static void pc87360_init_device(struct 
platform_device *pdev,
 
     /* We can't blindly trust the Super-I/O space configuration bit,
        most BIOS won't set it properly */
+    dev_dbg(&pdev->dev, "bios thermistors:%d\n", use_thermistors);
     for (i = 11; i < data->innr; i++) {
         reg = pc87360_read_value(data, LD_IN, i,
                      PC87365_REG_TEMP_STATUS);
         use_thermistors = use_thermistors || (reg & CHAN_ENA);
+        /* thermistors are temp[4-6], measured on vin[11-14] */
+        dev_dbg(&pdev->dev, "bios temp%d_status:0x%02x\n", i-7, reg);
     }
+    dev_dbg(&pdev->dev, "using thermistors:%d\n", use_thermistors);
 
     i = use_thermistors ? 2 : 0;
     for (; i < data->tempnr; i++) {
+        reg = pc87360_read_value(data, LD_TEMP, i,
+                     PC87365_REG_TEMP_STATUS);
+        dev_dbg(&pdev->dev, "bios temp%d_status:0x%02x\n", i+1, reg);
         if (init >= init_temp[i]) {
             /* Forcibly enable temperature channel */
-            reg = pc87360_read_value(data, LD_TEMP, i,
-                         PC87365_REG_TEMP_STATUS);
             if (!(reg & CHAN_ENA)) {
                 dev_dbg(&pdev->dev, "Forcibly "
                     "enabling temp%d\n", i+1);
@@ -1359,6 +1365,7 @@ static void pc87360_init_device(struct 
platform_device *pdev,
     if (data->innr) {
         reg = pc87360_read_value(data, LD_IN, NO_BANK,
                      PC87365_REG_IN_CONFIG);
+        dev_dbg(&pdev->dev, "bios vin-cfg:0x%02x\n", reg);
         if (reg & CHAN_ENA) {
             dev_dbg(&pdev->dev, "Forcibly "
                 "enabling monitoring (VLM)\n");
@@ -1371,6 +1378,7 @@ static void pc87360_init_device(struct 
platform_device *pdev,
     if (data->tempnr) {
         reg = pc87360_read_value(data, LD_TEMP, NO_BANK,
                      PC87365_REG_TEMP_CONFIG);
+        dev_dbg(&pdev->dev, "bios temp-cfg:0x%02x\n", reg);
         if (reg & CHAN_ENA) {
             dev_dbg(&pdev->dev, "Forcibly enabling "
                 "monitoring (TMS)\n");
-- 
1.5.5.1


[-- Attachment #2: 0005-hwmon-pc87360-separate-alarm-files-add-dev_dbg-hel.patch --]
[-- Type: text/x-patch, Size: 3038 bytes --]

From a65aa33f5fac6543cf390c9acbcbd2011f3ffe3d Mon Sep 17 00:00:00 2001
From: Jim Cromie <jim.cromie@gmail.com>
Date: Sat, 28 Jun 2008 20:42:24 -0600
Subject: [PATCH] hwmon/pc87360 separate alarm files - add dev_dbg help

temp and vin status register values may be set by chip specifications,
set again by bios, or by this previously loaded driver.
Debug output nicely displays modprobe init=\d actions.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 drivers/hwmon/pc87360.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index ebb235b..cf265d2 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -1290,10 +1290,11 @@ static void pc87360_init_device(struct platform_device *pdev,
 
 	nr = data->innr < 11 ? data->innr : 11;
 	for (i = 0; i < nr; i++) {
+		reg = pc87360_read_value(data, LD_IN, i,
+					 PC87365_REG_IN_STATUS);
+		dev_dbg(&pdev->dev, "bios in%d status:0x%02x\n", i, reg);
 		if (init >= init_in[i]) {
 			/* Forcibly enable voltage channel */
-			reg = pc87360_read_value(data, LD_IN, i,
-						 PC87365_REG_IN_STATUS);
 			if (!(reg & CHAN_ENA)) {
 				dev_dbg(&pdev->dev, "Forcibly "
 					"enabling in%d\n", i);
@@ -1306,18 +1307,23 @@ static void pc87360_init_device(struct platform_device *pdev,
 
 	/* We can't blindly trust the Super-I/O space configuration bit,
 	   most BIOS won't set it properly */
+	dev_dbg(&pdev->dev, "bios thermistors:%d\n", use_thermistors);
 	for (i = 11; i < data->innr; i++) {
 		reg = pc87360_read_value(data, LD_IN, i,
 					 PC87365_REG_TEMP_STATUS);
 		use_thermistors = use_thermistors || (reg & CHAN_ENA);
+		/* thermistors are temp[4-6], measured on vin[11-14] */
+		dev_dbg(&pdev->dev, "bios temp%d_status:0x%02x\n", i-7, reg);
 	}
+	dev_dbg(&pdev->dev, "using thermistors:%d\n", use_thermistors);
 
 	i = use_thermistors ? 2 : 0;
 	for (; i < data->tempnr; i++) {
+		reg = pc87360_read_value(data, LD_TEMP, i,
+					 PC87365_REG_TEMP_STATUS);
+		dev_dbg(&pdev->dev, "bios temp%d_status:0x%02x\n", i+1, reg);
 		if (init >= init_temp[i]) {
 			/* Forcibly enable temperature channel */
-			reg = pc87360_read_value(data, LD_TEMP, i,
-						 PC87365_REG_TEMP_STATUS);
 			if (!(reg & CHAN_ENA)) {
 				dev_dbg(&pdev->dev, "Forcibly "
 					"enabling temp%d\n", i+1);
@@ -1359,6 +1365,7 @@ static void pc87360_init_device(struct platform_device *pdev,
 	if (data->innr) {
 		reg = pc87360_read_value(data, LD_IN, NO_BANK,
 					 PC87365_REG_IN_CONFIG);
+		dev_dbg(&pdev->dev, "bios vin-cfg:0x%02x\n", reg);
 		if (reg & CHAN_ENA) {
 			dev_dbg(&pdev->dev, "Forcibly "
 				"enabling monitoring (VLM)\n");
@@ -1371,6 +1378,7 @@ static void pc87360_init_device(struct platform_device *pdev,
 	if (data->tempnr) {
 		reg = pc87360_read_value(data, LD_TEMP, NO_BANK,
 					 PC87365_REG_TEMP_CONFIG);
+		dev_dbg(&pdev->dev, "bios temp-cfg:0x%02x\n", reg);
 		if (reg & CHAN_ENA) {
 			dev_dbg(&pdev->dev, "Forcibly enabling "
 				"monitoring (TMS)\n");
-- 
1.5.5.1


[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

                 reply	other threads:[~2008-09-10  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48C79632.8020605@gmail.com \
    --to=jim.cromie@gmail.com \
    --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.