Commit 3923b4dc authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] I2C: Add secondary Super-I/O address support to

This patch adds support for the secondary Super-I/O address to the
w83627hf driver. Most manufacturer use the primary address but at least
the EPoX EP-9NDA3+ had a Winbond W83627THF at the secondary address.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 49054393
......@@ -67,9 +67,9 @@ module_param(init, bool, 0);
MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
/* modified from kernel/include/traps.c */
#define REG 0x2e /* The register to read/write */
static int REG; /* The register to read/write */
#define DEV 0x07 /* Register: Logical device select */
#define VAL 0x2f /* The value to read/write */
static int VAL; /* The value to read/write */
/* logical device numbers for superio_select (below) */
#define W83627HF_LD_FDC 0x00
......@@ -938,10 +938,13 @@ static int w83627hf_attach_adapter(struct i2c_adapter *adapter)
return i2c_detect(adapter, &addr_data, w83627hf_detect);
}
static int w83627hf_find(int *address)
static int w83627hf_find(int sioaddr, int *address)
{
u16 val;
REG = sioaddr;
VAL = sioaddr + 1;
superio_enter();
val= superio_inb(DEVID);
if(val != W627_DEVID &&
......@@ -1422,7 +1425,8 @@ static int __init sensors_w83627hf_init(void)
{
int addr;
if (w83627hf_find(&addr)) {
if (w83627hf_find(0x2e, &addr)
&& w83627hf_find(0x4e, &addr)) {
return -ENODEV;
}
normal_isa[0] = addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment