From: Marcelo Penna Guerra <eu@marcelopenna.org>
To: Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver changes 2.6.0-test1
Date: Wed, 23 Jul 2003 14:43:55 -0300 [thread overview]
Message-ID: <200307231443.56168.eu@marcelopenna.org> (raw)
In-Reply-To: <10586300964092@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 810 bytes --]
Hi,
This code doesn't work well. I was porting this code to 2.5 myself, so I did
some fixes to the code in 2.6.0-test1-ac3.
On Saturday 19 July 2003 12:54, Greg KH wrote:
> + smbus->adapter.algo_data = smbus;
> +*/
The problem is here. If you leave this line commented out, you'll have
problems when inserting the chip module.
> smbus->adapter = nforce2_adapter;
Also, I don't see the point in commenting out all this lines just to introduce
a nforce2_adapter struct. If this is the correct aprouch, just remove the
duplicate code instead of just commenting it out.
Attached is a patch to fix this problems. I can't test it very well as I can
only see the sensors in my board with i2c-isa, but everything loads fine.
This patch also moves the PCI ids to the pci_ids.h file.
Marcelo Penna Guerra
[-- Attachment #2: i2c-nforce2.diff --]
[-- Type: text/x-diff, Size: 2087 bytes --]
diff -Naur linux-2.6.0-test1/drivers/i2c/busses/i2c-nforce2.c linux-2.6.0-test1.new/drivers/i2c/busses/i2c-nforce2.c
--- linux-2.6.0-test1/drivers/i2c/busses/i2c-nforce2.c 2003-07-23 09:49:38.093802760 -0300
+++ linux-2.6.0-test1.new/drivers/i2c/busses/i2c-nforce2.c 2003-07-23 09:58:07.000000000 -0300
@@ -48,9 +48,6 @@
MODULE_DESCRIPTION("nForce2 SMBus driver");
-#ifndef PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS
-#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
-#endif
/* TODO: sync with lm-sensors */
#ifndef I2C_HW_SMBUS_NFORCE2
#define I2C_HW_SMBUS_NFORCE2 0x0c
@@ -120,16 +117,6 @@
.functionality = nforce2_func,
};
-static struct i2c_adapter nforce2_adapter = {
- .owner = THIS_MODULE,
- .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2,
- .class = I2C_ADAP_CLASS_SMBUS,
- .algo = &smbus_algorithm,
- .dev = {
- .name = "unset",
- },
-};
-
#if 0
/* Internally used pause function */
@@ -334,13 +321,12 @@
smbus->base, smbus->base+smbus->size-1, name);
return -1;
}
-/*
+
smbus->adapter.owner = THIS_MODULE;
smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
-*/
- smbus->adapter = nforce2_adapter;
+ smbus->adapter.class = I2C_ADAP_CLASS_SMBUS;
smbus->adapter.dev.parent = &dev->dev;
snprintf(smbus->adapter.dev.name, DEVICE_NAME_SIZE,
"SMBus nForce2 adapter at %04x", smbus->base);
diff -Naur linux-2.6.0-test1/include/linux/pci_ids.h linux-2.6.0-test1.new/include/linux/pci_ids.h
--- linux-2.6.0-test1/include/linux/pci_ids.h 2003-07-23 10:04:27.268627640 -0300
+++ linux-2.6.0-test1.new/include/linux/pci_ids.h 2003-07-23 09:52:12.000000000 -0300
@@ -1024,6 +1024,7 @@
#define PCI_DEVICE_ID_NVIDIA_NFORCE 0x01a4
#define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc
#define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
#define PCI_DEVICE_ID_NVIDIA_GEFORCE3 0x0200
#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201
#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_2 0x0202
next prev parent reply other threads:[~2003-07-23 20:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-19 15:52 [BK PATCH] i2c driver changes for 2.6.0-test1 Greg KH
2003-07-19 15:54 ` [PATCH] i2c driver changes 2.6.0-test1 Greg KH
2003-07-19 15:54 ` Greg KH
2003-07-19 15:54 ` Greg KH
2003-07-19 15:54 ` Greg KH
2003-07-19 15:54 ` Greg KH
2003-07-19 15:54 ` Greg KH
2003-07-23 17:43 ` Marcelo Penna Guerra [this message]
2003-07-24 13:27 ` Greg KH
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=200307231443.56168.eu@marcelopenna.org \
--to=eu@marcelopenna.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
/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).