Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9543d252
Commit
9543d252
authored
Sep 13, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge kroah.com:/home/greg/linux/BK/bleed-2.6
into kroah.com:/home/greg/linux/BK/i2c-2.6
parents
8a690d16
73c0d39f
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
276 additions
and
43 deletions
+276
-43
Documentation/i2c/i2c-stub
Documentation/i2c/i2c-stub
+33
-0
drivers/i2c/algos/i2c-algo-ite.c
drivers/i2c/algos/i2c-algo-ite.c
+0
-8
drivers/i2c/busses/Kconfig
drivers/i2c/busses/Kconfig
+13
-0
drivers/i2c/busses/Makefile
drivers/i2c/busses/Makefile
+1
-0
drivers/i2c/busses/i2c-ali1535.c
drivers/i2c/busses/i2c-ali1535.c
+2
-0
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali1563.c
+2
-0
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-ali15x3.c
+2
-0
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd756.c
+2
-0
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-amd8111.c
+2
-0
drivers/i2c/busses/i2c-hydra.c
drivers/i2c/busses/i2c-hydra.c
+2
-0
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-i801.c
+2
-0
drivers/i2c/busses/i2c-i810.c
drivers/i2c/busses/i2c-i810.c
+2
-0
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-nforce2.c
+3
-0
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-piix4.c
+2
-0
drivers/i2c/busses/i2c-prosavage.c
drivers/i2c/busses/i2c-prosavage.c
+2
-0
drivers/i2c/busses/i2c-savage4.c
drivers/i2c/busses/i2c-savage4.c
+2
-0
drivers/i2c/busses/i2c-sis5595.c
drivers/i2c/busses/i2c-sis5595.c
+2
-0
drivers/i2c/busses/i2c-sis630.c
drivers/i2c/busses/i2c-sis630.c
+2
-0
drivers/i2c/busses/i2c-sis96x.c
drivers/i2c/busses/i2c-sis96x.c
+2
-0
drivers/i2c/busses/i2c-stub.c
drivers/i2c/busses/i2c-stub.c
+125
-0
drivers/i2c/busses/i2c-via.c
drivers/i2c/busses/i2c-via.c
+2
-0
drivers/i2c/busses/i2c-viapro.c
drivers/i2c/busses/i2c-viapro.c
+2
-0
drivers/i2c/busses/i2c-voodoo3.c
drivers/i2c/busses/i2c-voodoo3.c
+2
-0
drivers/i2c/chips/adm1021.c
drivers/i2c/chips/adm1021.c
+1
-1
drivers/i2c/chips/adm1025.c
drivers/i2c/chips/adm1025.c
+9
-7
drivers/i2c/chips/ds1621.c
drivers/i2c/chips/ds1621.c
+1
-1
drivers/i2c/chips/eeprom.c
drivers/i2c/chips/eeprom.c
+1
-1
drivers/i2c/chips/fscher.c
drivers/i2c/chips/fscher.c
+1
-1
drivers/i2c/chips/gl518sm.c
drivers/i2c/chips/gl518sm.c
+5
-3
drivers/i2c/chips/it87.c
drivers/i2c/chips/it87.c
+1
-1
drivers/i2c/chips/lm75.c
drivers/i2c/chips/lm75.c
+1
-1
drivers/i2c/chips/lm77.c
drivers/i2c/chips/lm77.c
+1
-1
drivers/i2c/chips/lm80.c
drivers/i2c/chips/lm80.c
+4
-3
drivers/i2c/chips/lm83.c
drivers/i2c/chips/lm83.c
+3
-2
drivers/i2c/chips/lm85.c
drivers/i2c/chips/lm85.c
+3
-1
drivers/i2c/chips/lm90.c
drivers/i2c/chips/lm90.c
+5
-3
drivers/i2c/chips/max1619.c
drivers/i2c/chips/max1619.c
+3
-2
drivers/i2c/chips/pcf8574.c
drivers/i2c/chips/pcf8574.c
+1
-1
drivers/i2c/chips/pcf8591.c
drivers/i2c/chips/pcf8591.c
+1
-1
drivers/w1/Makefile
drivers/w1/Makefile
+4
-0
drivers/w1/w1.c
drivers/w1/w1.c
+7
-2
drivers/w1/w1.h
drivers/w1/w1.h
+2
-0
drivers/w1/w1_int.c
drivers/w1/w1_int.c
+4
-2
drivers/w1/w1_int.h
drivers/w1/w1_int.h
+1
-1
drivers/w1/w1_netlink.c
drivers/w1/w1_netlink.c
+8
-0
No files found.
Documentation/i2c/i2c-stub
0 → 100644
View file @
9543d252
MODULE: i2c-stub
DESCRIPTION:
This module is a very simple fake I2C/SMBus driver. It implements three
types of SMBus commands: write quick, (r/w) byte data, and (r/w) word data.
No hardware is needed nor associated with this module. It will accept write
quick commands to all addresses; it will respond to the other commands (also
to all addresses) by reading from or writing to an array in memory. It will
also spam the kernel logs for every command it handles.
The typical use-case is like this:
1. load this module
2. use i2cset (from lm_sensors project) to pre-load some data
3. load the target sensors chip driver module
4. observe its behavior in the kernel log
CAVEATS:
There are independent arrays for byte/data and word/data commands. Depending
on if/how a target driver mixes them, you'll need to be careful.
If your target driver polls some byte or word waiting for it to change, the
stub could lock it up. Use i2cset to unlock it.
If the hardware for your driver has banked registers (e.g. Winbond sensors
chips) this module will not work well - although it could be extended to
support that pretty easily.
If you spam it hard enough, printk can be lossy. This module really wants
something like relayfs.
drivers/i2c/algos/i2c-algo-ite.c
View file @
9543d252
...
@@ -107,14 +107,6 @@ static int wait_for_bb(struct i2c_algo_iic_data *adap)
...
@@ -107,14 +107,6 @@ static int wait_for_bb(struct i2c_algo_iic_data *adap)
return
(
timeout
<=
0
);
return
(
timeout
<=
0
);
}
}
/*
* Puts this process to sleep for a period equal to timeout
*/
static
inline
void
iic_sleep
(
unsigned
long
timeout
)
{
schedule_timeout
(
timeout
*
HZ
);
}
/* After we issue a transaction on the IIC bus, this function
/* After we issue a transaction on the IIC bus, this function
* is called. It puts this process to sleep until we get an interrupt from
* is called. It puts this process to sleep until we get an interrupt from
* from the controller telling us that the transaction we requested in complete.
* from the controller telling us that the transaction we requested in complete.
...
...
drivers/i2c/busses/Kconfig
View file @
9543d252
...
@@ -376,6 +376,19 @@ config I2C_SIS96X
...
@@ -376,6 +376,19 @@ config I2C_SIS96X
This driver can also be built as a module. If so, the module
This driver can also be built as a module. If so, the module
will be called i2c-sis96x.
will be called i2c-sis96x.
config I2C_STUB
tristate "I2C/SMBus Test Stub"
depends on I2C && EXPERIMENTAL && 'm'
default 'n'
help
This module may be useful to developers of SMBus client drivers,
especially for certain kinds of sensor chips.
If you do build this module, be sure to read the notes and warnings
in Documentation/i2c/i2c-stub.
If you don't know what to do here, definitely say N.
config I2C_VIA
config I2C_VIA
tristate "VIA 82C586B"
tristate "VIA 82C586B"
depends on I2C && PCI && EXPERIMENTAL
depends on I2C && PCI && EXPERIMENTAL
...
...
drivers/i2c/busses/Makefile
View file @
9543d252
...
@@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_SAVAGE4) += i2c-savage4.o
...
@@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_SAVAGE4) += i2c-savage4.o
obj-$(CONFIG_I2C_SIS5595)
+=
i2c-sis5595.o
obj-$(CONFIG_I2C_SIS5595)
+=
i2c-sis5595.o
obj-$(CONFIG_I2C_SIS630)
+=
i2c-sis630.o
obj-$(CONFIG_I2C_SIS630)
+=
i2c-sis630.o
obj-$(CONFIG_I2C_SIS96X)
+=
i2c-sis96x.o
obj-$(CONFIG_I2C_SIS96X)
+=
i2c-sis96x.o
obj-$(CONFIG_I2C_STUB)
+=
i2c-stub.o
obj-$(CONFIG_I2C_VIA)
+=
i2c-via.o
obj-$(CONFIG_I2C_VIA)
+=
i2c-via.o
obj-$(CONFIG_I2C_VIAPRO)
+=
i2c-viapro.o
obj-$(CONFIG_I2C_VIAPRO)
+=
i2c-viapro.o
obj-$(CONFIG_I2C_VOODOO3)
+=
i2c-voodoo3.o
obj-$(CONFIG_I2C_VOODOO3)
+=
i2c-voodoo3.o
...
...
drivers/i2c/busses/i2c-ali1535.c
View file @
9543d252
...
@@ -496,6 +496,8 @@ static struct pci_device_id ali1535_ids[] = {
...
@@ -496,6 +496,8 @@ static struct pci_device_id ali1535_ids[] = {
{
},
{
},
};
};
MODULE_DEVICE_TABLE
(
pci
,
ali1535_ids
);
static
int
__devinit
ali1535_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
ali1535_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
if
(
ali1535_setup
(
dev
))
{
if
(
ali1535_setup
(
dev
))
{
...
...
drivers/i2c/busses/i2c-ali1563.c
View file @
9543d252
...
@@ -394,6 +394,8 @@ static struct pci_device_id __devinitdata ali1563_id_table[] = {
...
@@ -394,6 +394,8 @@ static struct pci_device_id __devinitdata ali1563_id_table[] = {
{},
{},
};
};
MODULE_DEVICE_TABLE
(
pci
,
ali1563_id_table
);
static
struct
pci_driver
ali1563_pci_driver
=
{
static
struct
pci_driver
ali1563_pci_driver
=
{
.
name
=
"ali1563_i2c"
,
.
name
=
"ali1563_i2c"
,
.
id_table
=
ali1563_id_table
,
.
id_table
=
ali1563_id_table
,
...
...
drivers/i2c/busses/i2c-ali15x3.c
View file @
9543d252
...
@@ -486,6 +486,8 @@ static struct pci_device_id ali15x3_ids[] = {
...
@@ -486,6 +486,8 @@ static struct pci_device_id ali15x3_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
ali15x3_ids
);
static
int
__devinit
ali15x3_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
ali15x3_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
if
(
ali15x3_setup
(
dev
))
{
if
(
ali15x3_setup
(
dev
))
{
...
...
drivers/i2c/busses/i2c-amd756.c
View file @
9543d252
...
@@ -320,6 +320,8 @@ static struct pci_device_id amd756_ids[] = {
...
@@ -320,6 +320,8 @@ static struct pci_device_id amd756_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
amd756_ids
);
static
int
__devinit
amd756_probe
(
struct
pci_dev
*
pdev
,
static
int
__devinit
amd756_probe
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
id
)
const
struct
pci_device_id
*
id
)
{
{
...
...
drivers/i2c/busses/i2c-amd8111.c
View file @
9543d252
...
@@ -336,6 +336,8 @@ static struct pci_device_id amd8111_ids[] = {
...
@@ -336,6 +336,8 @@ static struct pci_device_id amd8111_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
amd8111_ids
);
static
int
__devinit
amd8111_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
amd8111_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
struct
amd_smbus
*
smbus
;
struct
amd_smbus
*
smbus
;
...
...
drivers/i2c/busses/i2c-hydra.c
View file @
9543d252
...
@@ -120,6 +120,8 @@ static struct pci_device_id hydra_ids[] = {
...
@@ -120,6 +120,8 @@ static struct pci_device_id hydra_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
hydra_ids
);
static
int
__devinit
hydra_probe
(
struct
pci_dev
*
dev
,
static
int
__devinit
hydra_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
const
struct
pci_device_id
*
id
)
{
{
...
...
drivers/i2c/busses/i2c-i801.c
View file @
9543d252
...
@@ -599,6 +599,8 @@ static struct pci_device_id i801_ids[] = {
...
@@ -599,6 +599,8 @@ static struct pci_device_id i801_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
i801_ids
);
static
int
__devinit
i801_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
i801_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
...
...
drivers/i2c/busses/i2c-i810.c
View file @
9543d252
...
@@ -201,6 +201,8 @@ static struct pci_device_id i810_ids[] __devinitdata = {
...
@@ -201,6 +201,8 @@ static struct pci_device_id i810_ids[] __devinitdata = {
{
0
,
},
{
0
,
},
};
};
MODULE_DEVICE_TABLE
(
pci
,
i810_ids
);
static
int
__devinit
i810_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
i810_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
int
retval
;
int
retval
;
...
...
drivers/i2c/busses/i2c-nforce2.c
View file @
9543d252
...
@@ -298,6 +298,9 @@ static struct pci_device_id nforce2_ids[] = {
...
@@ -298,6 +298,9 @@ static struct pci_device_id nforce2_ids[] = {
};
};
MODULE_DEVICE_TABLE
(
pci
,
nforce2_ids
);
static
int
__devinit
nforce2_probe_smb
(
struct
pci_dev
*
dev
,
int
reg
,
static
int
__devinit
nforce2_probe_smb
(
struct
pci_dev
*
dev
,
int
reg
,
struct
nforce2_smbus
*
smbus
,
char
*
name
)
struct
nforce2_smbus
*
smbus
,
char
*
name
)
{
{
...
...
drivers/i2c/busses/i2c-piix4.c
View file @
9543d252
...
@@ -459,6 +459,8 @@ static struct pci_device_id piix4_ids[] = {
...
@@ -459,6 +459,8 @@ static struct pci_device_id piix4_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
piix4_ids
);
static
int
__devinit
piix4_probe
(
struct
pci_dev
*
dev
,
static
int
__devinit
piix4_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
const
struct
pci_device_id
*
id
)
{
{
...
...
drivers/i2c/busses/i2c-prosavage.c
View file @
9543d252
...
@@ -313,6 +313,8 @@ static struct pci_device_id prosavage_pci_tbl[] = {
...
@@ -313,6 +313,8 @@ static struct pci_device_id prosavage_pci_tbl[] = {
{
0
,
},
{
0
,
},
};
};
MODULE_DEVICE_TABLE
(
pci
,
prosavage_pci_tbl
);
static
struct
pci_driver
prosavage_driver
=
{
static
struct
pci_driver
prosavage_driver
=
{
.
name
=
"prosavage_smbus"
,
.
name
=
"prosavage_smbus"
,
.
id_table
=
prosavage_pci_tbl
,
.
id_table
=
prosavage_pci_tbl
,
...
...
drivers/i2c/busses/i2c-savage4.c
View file @
9543d252
...
@@ -157,6 +157,8 @@ static struct pci_device_id savage4_ids[] __devinitdata = {
...
@@ -157,6 +157,8 @@ static struct pci_device_id savage4_ids[] __devinitdata = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
savage4_ids
);
static
int
__devinit
savage4_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
savage4_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
int
retval
;
int
retval
;
...
...
drivers/i2c/busses/i2c-sis5595.c
View file @
9543d252
...
@@ -371,6 +371,8 @@ static struct pci_device_id sis5595_ids[] __devinitdata = {
...
@@ -371,6 +371,8 @@ static struct pci_device_id sis5595_ids[] __devinitdata = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
sis5595_ids
);
static
int
__devinit
sis5595_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
sis5595_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
if
(
sis5595_setup
(
dev
))
{
if
(
sis5595_setup
(
dev
))
{
...
...
drivers/i2c/busses/i2c-sis630.c
View file @
9543d252
...
@@ -468,6 +468,8 @@ static struct pci_device_id sis630_ids[] __devinitdata = {
...
@@ -468,6 +468,8 @@ static struct pci_device_id sis630_ids[] __devinitdata = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
sis630_ids
);
static
int
__devinit
sis630_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
sis630_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
if
(
sis630_setup
(
dev
))
{
if
(
sis630_setup
(
dev
))
{
...
...
drivers/i2c/busses/i2c-sis96x.c
View file @
9543d252
...
@@ -278,6 +278,8 @@ static struct pci_device_id sis96x_ids[] = {
...
@@ -278,6 +278,8 @@ static struct pci_device_id sis96x_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
sis96x_ids
);
static
int
__devinit
sis96x_probe
(
struct
pci_dev
*
dev
,
static
int
__devinit
sis96x_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
const
struct
pci_device_id
*
id
)
{
{
...
...
drivers/i2c/busses/i2c-stub.c
0 → 100644
View file @
9543d252
/*
i2c-stub.c - Part of lm_sensors, Linux kernel modules for hardware
monitoring
Copyright (c) 2004 Mark M. Hoffman <mhoffman@lightlink.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define DEBUG 1
#include <linux/config.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/i2c.h>
static
u8
stub_bytes
[
256
];
static
u16
stub_words
[
256
];
/* Return -1 on error. */
static
s32
stub_xfer
(
struct
i2c_adapter
*
adap
,
u16
addr
,
unsigned
short
flags
,
char
read_write
,
u8
command
,
int
size
,
union
i2c_smbus_data
*
data
)
{
s32
ret
;
switch
(
size
)
{
case
I2C_SMBUS_QUICK
:
dev_dbg
(
&
adap
->
dev
,
"smbus quick - addr 0x%02x
\n
"
,
addr
);
ret
=
0
;
break
;
case
I2C_SMBUS_BYTE_DATA
:
if
(
read_write
==
I2C_SMBUS_WRITE
)
{
stub_bytes
[
command
]
=
data
->
byte
;
dev_dbg
(
&
adap
->
dev
,
"smbus byte data - addr 0x%02x, "
"wrote 0x%02x at 0x%02x.
\n
"
,
addr
,
data
->
byte
,
command
);
}
else
{
data
->
byte
=
stub_bytes
[
command
];
dev_dbg
(
&
adap
->
dev
,
"smbus byte data - addr 0x%02x, "
"read 0x%02x at 0x%02x.
\n
"
,
addr
,
data
->
byte
,
command
);
}
ret
=
0
;
break
;
case
I2C_SMBUS_WORD_DATA
:
if
(
read_write
==
I2C_SMBUS_WRITE
)
{
stub_words
[
command
]
=
data
->
word
;
dev_dbg
(
&
adap
->
dev
,
"smbus word data - addr 0x%02x, "
"wrote 0x%04x at 0x%02x.
\n
"
,
addr
,
data
->
word
,
command
);
}
else
{
data
->
word
=
stub_words
[
command
];
dev_dbg
(
&
adap
->
dev
,
"smbus word data - addr 0x%02x, "
"read 0x%04x at 0x%02x.
\n
"
,
addr
,
data
->
word
,
command
);
}
ret
=
0
;
break
;
default:
dev_dbg
(
&
adap
->
dev
,
"Unsupported I2C/SMBus command
\n
"
);
ret
=
-
1
;
break
;
}
/* switch (size) */
return
ret
;
}
static
u32
stub_func
(
struct
i2c_adapter
*
adapter
)
{
return
I2C_FUNC_SMBUS_QUICK
|
I2C_FUNC_SMBUS_BYTE_DATA
|
I2C_FUNC_SMBUS_WORD_DATA
;
}
static
struct
i2c_algorithm
smbus_algorithm
=
{
.
name
=
"Non-I2C SMBus adapter"
,
.
id
=
I2C_ALGO_SMBUS
,
.
functionality
=
stub_func
,
.
smbus_xfer
=
stub_xfer
,
};
static
struct
i2c_adapter
stub_adapter
=
{
.
owner
=
THIS_MODULE
,
.
class
=
I2C_CLASS_HWMON
,
.
algo
=
&
smbus_algorithm
,
.
name
=
"SMBus stub driver"
,
};
static
int
__init
i2c_stub_init
(
void
)
{
printk
(
KERN_INFO
"i2c-stub loaded
\n
"
);
return
i2c_add_adapter
(
&
stub_adapter
);
}
static
void
__exit
i2c_stub_exit
(
void
)
{
i2c_del_adapter
(
&
stub_adapter
);
}
MODULE_AUTHOR
(
"Mark M. Hoffman <mhoffman@lightlink.com>"
);
MODULE_DESCRIPTION
(
"I2C stub driver"
);
MODULE_LICENSE
(
"GPL"
);
module_init
(
i2c_stub_init
);
module_exit
(
i2c_stub_exit
);
drivers/i2c/busses/i2c-via.c
View file @
9543d252
...
@@ -99,6 +99,8 @@ static struct pci_device_id vt586b_ids[] __devinitdata = {
...
@@ -99,6 +99,8 @@ static struct pci_device_id vt586b_ids[] __devinitdata = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
vt586b_ids
);
static
int
__devinit
vt586b_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
vt586b_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
u16
base
;
u16
base
;
...
...
drivers/i2c/busses/i2c-viapro.c
View file @
9543d252
...
@@ -454,6 +454,8 @@ static struct pci_device_id vt596_ids[] = {
...
@@ -454,6 +454,8 @@ static struct pci_device_id vt596_ids[] = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
vt596_ids
);
static
struct
pci_driver
vt596_driver
=
{
static
struct
pci_driver
vt596_driver
=
{
.
name
=
"vt596_smbus"
,
.
name
=
"vt596_smbus"
,
.
id_table
=
vt596_ids
,
.
id_table
=
vt596_ids
,
...
...
drivers/i2c/busses/i2c-voodoo3.c
View file @
9543d252
...
@@ -195,6 +195,8 @@ static struct pci_device_id voodoo3_ids[] __devinitdata = {
...
@@ -195,6 +195,8 @@ static struct pci_device_id voodoo3_ids[] __devinitdata = {
{
0
,
}
{
0
,
}
};
};
MODULE_DEVICE_TABLE
(
pci
,
voodoo3_ids
);
static
int
__devinit
voodoo3_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
voodoo3_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
int
retval
;
int
retval
;
...
...
drivers/i2c/chips/adm1021.c
View file @
9543d252
...
@@ -148,7 +148,7 @@ static struct i2c_driver adm1021_driver = {
...
@@ -148,7 +148,7 @@ static struct i2c_driver adm1021_driver = {
.
detach_client
=
adm1021_detach_client
,
.
detach_client
=
adm1021_detach_client
,
};
};
static
int
adm1021_id
=
0
;
static
int
adm1021_id
;
#define show(value) \
#define show(value) \
static ssize_t show_##value(struct device *dev, char *buf) \
static ssize_t show_##value(struct device *dev, char *buf) \
...
...
drivers/i2c/chips/adm1025.c
View file @
9543d252
...
@@ -153,7 +153,7 @@ struct adm1025_data {
...
@@ -153,7 +153,7 @@ struct adm1025_data {
* Internal variables
* Internal variables
*/
*/
static
int
adm1025_id
=
0
;
static
int
adm1025_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
@@ -212,8 +212,8 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
...
@@ -212,8 +212,8 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct adm1025_data *data = i2c_get_clientdata(client); \
struct adm1025_data *data = i2c_get_clientdata(client); \
data->in_min[offset] = IN_TO_REG(simple_strtol(buf, NULL, 10),
\
long val = simple_strtol(buf, NULL, 10);
\
in_scale[offset]); \
data->in_min[offset] = IN_TO_REG(val,
in_scale[offset]); \
i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MIN(offset), \
i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MIN(offset), \
data->in_min[offset]); \
data->in_min[offset]); \
return count; \
return count; \
...
@@ -223,8 +223,8 @@ static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \
...
@@ -223,8 +223,8 @@ static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct adm1025_data *data = i2c_get_clientdata(client); \
struct adm1025_data *data = i2c_get_clientdata(client); \
data->in_max[offset] = IN_TO_REG(simple_strtol(buf, NULL, 10),
\
long val = simple_strtol(buf, NULL, 10);
\
in_scale[offset]); \
data->in_max[offset] = IN_TO_REG(val,
in_scale[offset]); \
i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MAX(offset), \
i2c_smbus_write_byte_data(client, ADM1025_REG_IN_MAX(offset), \
data->in_max[offset]); \
data->in_max[offset]); \
return count; \
return count; \
...
@@ -246,7 +246,8 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
...
@@ -246,7 +246,8 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct adm1025_data *data = i2c_get_clientdata(client); \
struct adm1025_data *data = i2c_get_clientdata(client); \
data->temp_min[offset-1] = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->temp_min[offset-1] = TEMP_TO_REG(val); \
i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_LOW(offset-1), \
i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_LOW(offset-1), \
data->temp_min[offset-1]); \
data->temp_min[offset-1]); \
return count; \
return count; \
...
@@ -256,7 +257,8 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
...
@@ -256,7 +257,8 @@ static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct adm1025_data *data = i2c_get_clientdata(client); \
struct adm1025_data *data = i2c_get_clientdata(client); \
data->temp_max[offset-1] = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->temp_max[offset-1] = TEMP_TO_REG(val); \
i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_HIGH(offset-1), \
i2c_smbus_write_byte_data(client, ADM1025_REG_TEMP_HIGH(offset-1), \
data->temp_max[offset-1]); \
data->temp_max[offset-1]); \
return count; \
return count; \
...
...
drivers/i2c/chips/ds1621.c
View file @
9543d252
...
@@ -96,7 +96,7 @@ static struct i2c_driver ds1621_driver = {
...
@@ -96,7 +96,7 @@ static struct i2c_driver ds1621_driver = {
.
detach_client
=
ds1621_detach_client
,
.
detach_client
=
ds1621_detach_client
,
};
};
static
int
ds1621_id
=
0
;
static
int
ds1621_id
;
/* All registers are word-sized, except for the configuration register.
/* All registers are word-sized, except for the configuration register.
DS1621 uses a high-byte first convention, which is exactly opposite to
DS1621 uses a high-byte first convention, which is exactly opposite to
...
...
drivers/i2c/chips/eeprom.c
View file @
9543d252
...
@@ -86,7 +86,7 @@ static struct i2c_driver eeprom_driver = {
...
@@ -86,7 +86,7 @@ static struct i2c_driver eeprom_driver = {
.
detach_client
=
eeprom_detach_client
,
.
detach_client
=
eeprom_detach_client
,
};
};
static
int
eeprom_id
=
0
;
static
int
eeprom_id
;
static
void
eeprom_update_client
(
struct
i2c_client
*
client
,
u8
slice
)
static
void
eeprom_update_client
(
struct
i2c_client
*
client
,
u8
slice
)
{
{
...
...
drivers/i2c/chips/fscher.c
View file @
9543d252
...
@@ -156,7 +156,7 @@ struct fscher_data {
...
@@ -156,7 +156,7 @@ struct fscher_data {
* Internal variables
* Internal variables
*/
*/
static
int
fscher_id
=
0
;
static
int
fscher_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
...
drivers/i2c/chips/gl518sm.c
View file @
9543d252
...
@@ -164,7 +164,7 @@ static struct i2c_driver gl518_driver = {
...
@@ -164,7 +164,7 @@ static struct i2c_driver gl518_driver = {
* Internal variables
* Internal variables
*/
*/
static
int
gl518_id
=
0
;
static
int
gl518_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
@@ -217,7 +217,8 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
...
@@ -217,7 +217,8 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct gl518_data *data = i2c_get_clientdata(client); \
struct gl518_data *data = i2c_get_clientdata(client); \
data->value = type##_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->value = type##_TO_REG(val); \
gl518_write_value(client, reg, data->value); \
gl518_write_value(client, reg, data->value); \
return count; \
return count; \
}
}
...
@@ -229,7 +230,8 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
...
@@ -229,7 +230,8 @@ static ssize_t set_##suffix(struct device *dev, const char *buf, \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct gl518_data *data = i2c_get_clientdata(client); \
struct gl518_data *data = i2c_get_clientdata(client); \
int regvalue = gl518_read_value(client, reg); \
int regvalue = gl518_read_value(client, reg); \
data->value = type##_TO_REG(simple_strtoul(buf, NULL, 10)); \
unsigned long val = simple_strtoul(buf, NULL, 10); \
data->value = type##_TO_REG(val); \
regvalue = (regvalue & ~mask) | (data->value << shift); \
regvalue = (regvalue & ~mask) | (data->value << shift); \
gl518_write_value(client, reg, regvalue); \
gl518_write_value(client, reg, regvalue); \
return count; \
return count; \
...
...
drivers/i2c/chips/it87.c
View file @
9543d252
...
@@ -226,7 +226,7 @@ static struct i2c_driver it87_driver = {
...
@@ -226,7 +226,7 @@ static struct i2c_driver it87_driver = {
.
detach_client
=
it87_detach_client
,
.
detach_client
=
it87_detach_client
,
};
};
static
int
it87_id
=
0
;
static
int
it87_id
;
static
ssize_t
show_in
(
struct
device
*
dev
,
char
*
buf
,
int
nr
)
static
ssize_t
show_in
(
struct
device
*
dev
,
char
*
buf
,
int
nr
)
{
{
...
...
drivers/i2c/chips/lm75.c
View file @
9543d252
...
@@ -74,7 +74,7 @@ static struct i2c_driver lm75_driver = {
...
@@ -74,7 +74,7 @@ static struct i2c_driver lm75_driver = {
.
detach_client
=
lm75_detach_client
,
.
detach_client
=
lm75_detach_client
,
};
};
static
int
lm75_id
=
0
;
static
int
lm75_id
;
#define show(value) \
#define show(value) \
static ssize_t show_##value(struct device *dev, char *buf) \
static ssize_t show_##value(struct device *dev, char *buf) \
...
...
drivers/i2c/chips/lm77.c
View file @
9543d252
...
@@ -83,7 +83,7 @@ static struct i2c_driver lm77_driver = {
...
@@ -83,7 +83,7 @@ static struct i2c_driver lm77_driver = {
.
detach_client
=
lm77_detach_client
,
.
detach_client
=
lm77_detach_client
,
};
};
static
int
lm77_id
=
0
;
static
int
lm77_id
;
/* straight from the datasheet */
/* straight from the datasheet */
#define LM77_TEMP_MIN (-55000)
#define LM77_TEMP_MIN (-55000)
...
...
drivers/i2c/chips/lm80.c
View file @
9543d252
...
@@ -145,7 +145,7 @@ static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value);
...
@@ -145,7 +145,7 @@ static int lm80_write_value(struct i2c_client *client, u8 reg, u8 value);
* Internal variables
* Internal variables
*/
*/
static
int
lm80_id
=
0
;
static
int
lm80_id
;
/*
/*
* Driver data (common to all clients)
* Driver data (common to all clients)
...
@@ -262,14 +262,15 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
...
@@ -262,14 +262,15 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
{
{
struct
i2c_client
*
client
=
to_i2c_client
(
dev
);
struct
i2c_client
*
client
=
to_i2c_client
(
dev
);
struct
lm80_data
*
data
=
i2c_get_clientdata
(
client
);
struct
lm80_data
*
data
=
i2c_get_clientdata
(
client
);
unsigned
long
min
;
unsigned
long
min
,
val
;
u8
reg
;
u8
reg
;
/* Save fan_min */
/* Save fan_min */
min
=
FAN_FROM_REG
(
data
->
fan_min
[
nr
],
min
=
FAN_FROM_REG
(
data
->
fan_min
[
nr
],
DIV_FROM_REG
(
data
->
fan_div
[
nr
]));
DIV_FROM_REG
(
data
->
fan_div
[
nr
]));
data
->
fan_div
[
nr
]
=
DIV_TO_REG
(
simple_strtoul
(
buf
,
NULL
,
10
));
val
=
simple_strtoul
(
buf
,
NULL
,
10
);
data
->
fan_div
[
nr
]
=
DIV_TO_REG
(
val
);
reg
=
(
lm80_read_value
(
client
,
LM80_REG_FANDIV
)
&
~
(
3
<<
(
2
*
(
nr
+
1
))))
reg
=
(
lm80_read_value
(
client
,
LM80_REG_FANDIV
)
&
~
(
3
<<
(
2
*
(
nr
+
1
))))
|
(
data
->
fan_div
[
nr
]
<<
(
2
*
(
nr
+
1
)));
|
(
data
->
fan_div
[
nr
]
<<
(
2
*
(
nr
+
1
)));
...
...
drivers/i2c/chips/lm83.c
View file @
9543d252
...
@@ -152,7 +152,7 @@ struct lm83_data {
...
@@ -152,7 +152,7 @@ struct lm83_data {
* Internal variables
* Internal variables
*/
*/
static
int
lm83_id
=
0
;
static
int
lm83_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
@@ -180,7 +180,8 @@ static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \
...
@@ -180,7 +180,8 @@ static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct lm83_data *data = i2c_get_clientdata(client); \
struct lm83_data *data = i2c_get_clientdata(client); \
data->value = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->value = TEMP_TO_REG(val); \
i2c_smbus_write_byte_data(client, reg, data->value); \
i2c_smbus_write_byte_data(client, reg, data->value); \
return count; \
return count; \
}
}
...
...
drivers/i2c/chips/lm85.c
View file @
9543d252
...
@@ -405,7 +405,7 @@ static struct i2c_driver lm85_driver = {
...
@@ -405,7 +405,7 @@ static struct i2c_driver lm85_driver = {
};
};
/* Unique ID assigned to each LM85 detected */
/* Unique ID assigned to each LM85 detected */
static
int
lm85_id
=
0
;
static
int
lm85_id
;
/* 4 Fans */
/* 4 Fans */
...
@@ -707,6 +707,8 @@ show_temp_reg(3);
...
@@ -707,6 +707,8 @@ show_temp_reg(3);
int
lm85_attach_adapter
(
struct
i2c_adapter
*
adapter
)
int
lm85_attach_adapter
(
struct
i2c_adapter
*
adapter
)
{
{
if
(
!
(
adapter
->
class
&
I2C_CLASS_HWMON
))
return
0
;
return
i2c_detect
(
adapter
,
&
addr_data
,
lm85_detect
);
return
i2c_detect
(
adapter
,
&
addr_data
,
lm85_detect
);
}
}
...
...
drivers/i2c/chips/lm90.c
View file @
9543d252
...
@@ -187,7 +187,7 @@ struct lm90_data {
...
@@ -187,7 +187,7 @@ struct lm90_data {
* Internal variables
* Internal variables
*/
*/
static
int
lm90_id
=
0
;
static
int
lm90_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
@@ -214,7 +214,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
...
@@ -214,7 +214,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct lm90_data *data = i2c_get_clientdata(client); \
struct lm90_data *data = i2c_get_clientdata(client); \
data->value = TEMP1_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->value = TEMP1_TO_REG(val); \
i2c_smbus_write_byte_data(client, reg, data->value); \
i2c_smbus_write_byte_data(client, reg, data->value); \
return count; \
return count; \
}
}
...
@@ -224,7 +225,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
...
@@ -224,7 +225,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct lm90_data *data = i2c_get_clientdata(client); \
struct lm90_data *data = i2c_get_clientdata(client); \
data->value = TEMP2_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->value = TEMP2_TO_REG(val); \
i2c_smbus_write_byte_data(client, regh, data->value >> 8); \
i2c_smbus_write_byte_data(client, regh, data->value >> 8); \
i2c_smbus_write_byte_data(client, regl, data->value & 0xff); \
i2c_smbus_write_byte_data(client, regl, data->value & 0xff); \
return count; \
return count; \
...
...
drivers/i2c/chips/max1619.c
View file @
9543d252
...
@@ -120,7 +120,7 @@ struct max1619_data {
...
@@ -120,7 +120,7 @@ struct max1619_data {
* Internal variables
* Internal variables
*/
*/
static
int
max1619_id
=
0
;
static
int
max1619_id
;
/*
/*
* Sysfs stuff
* Sysfs stuff
...
@@ -145,7 +145,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
...
@@ -145,7 +145,8 @@ static ssize_t set_##value(struct device *dev, const char *buf, \
{ \
{ \
struct i2c_client *client = to_i2c_client(dev); \
struct i2c_client *client = to_i2c_client(dev); \
struct max1619_data *data = i2c_get_clientdata(client); \
struct max1619_data *data = i2c_get_clientdata(client); \
data->value = TEMP_TO_REG(simple_strtol(buf, NULL, 10)); \
long val = simple_strtol(buf, NULL, 10); \
data->value = TEMP_TO_REG(val); \
i2c_smbus_write_byte_data(client, reg, data->value); \
i2c_smbus_write_byte_data(client, reg, data->value); \
return count; \
return count; \
}
}
...
...
drivers/i2c/chips/pcf8574.c
View file @
9543d252
...
@@ -77,7 +77,7 @@ static struct i2c_driver pcf8574_driver = {
...
@@ -77,7 +77,7 @@ static struct i2c_driver pcf8574_driver = {
.
detach_client
=
pcf8574_detach_client
,
.
detach_client
=
pcf8574_detach_client
,
};
};
static
int
pcf8574_id
=
0
;
static
int
pcf8574_id
;
/* following are the sysfs callback functions */
/* following are the sysfs callback functions */
static
ssize_t
show_read
(
struct
device
*
dev
,
char
*
buf
)
static
ssize_t
show_read
(
struct
device
*
dev
,
char
*
buf
)
...
...
drivers/i2c/chips/pcf8591.c
View file @
9543d252
...
@@ -99,7 +99,7 @@ static struct i2c_driver pcf8591_driver = {
...
@@ -99,7 +99,7 @@ static struct i2c_driver pcf8591_driver = {
.
detach_client
=
pcf8591_detach_client
,
.
detach_client
=
pcf8591_detach_client
,
};
};
static
int
pcf8591_id
=
0
;
static
int
pcf8591_id
;
/* following are the sysfs callback functions */
/* following are the sysfs callback functions */
#define show_in_channel(channel) \
#define show_in_channel(channel) \
...
...
drivers/w1/Makefile
View file @
9543d252
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
# Makefile for the Dallas's 1-wire bus.
# Makefile for the Dallas's 1-wire bus.
#
#
ifneq
($(CONFIG_NET), y)
EXTRA_CFLAGS
+=
-DNETLINK_DISABLED
endif
obj-$(CONFIG_W1)
+=
wire.o
obj-$(CONFIG_W1)
+=
wire.o
wire-objs
:=
w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o
wire-objs
:=
w1.o w1_int.o w1_family.o w1_netlink.o w1_io.o
...
...
drivers/w1/w1.c
View file @
9543d252
...
@@ -47,9 +47,11 @@ MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol.");
...
@@ -47,9 +47,11 @@ MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol.");
static
int
w1_timeout
=
10
;
static
int
w1_timeout
=
10
;
int
w1_max_slave_count
=
10
;
int
w1_max_slave_count
=
10
;
int
w1_max_slave_ttl
=
10
;
module_param_named
(
timeout
,
w1_timeout
,
int
,
0
);
module_param_named
(
timeout
,
w1_timeout
,
int
,
0
);
module_param_named
(
max_slave_count
,
w1_max_slave_count
,
int
,
0
);
module_param_named
(
max_slave_count
,
w1_max_slave_count
,
int
,
0
);
module_param_named
(
slave_ttl
,
w1_max_slave_ttl
,
int
,
0
);
spinlock_t
w1_mlock
=
SPIN_LOCK_UNLOCKED
;
spinlock_t
w1_mlock
=
SPIN_LOCK_UNLOCKED
;
LIST_HEAD
(
w1_masters
);
LIST_HEAD
(
w1_masters
);
...
@@ -431,6 +433,7 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
...
@@ -431,6 +433,7 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
return
err
;
return
err
;
}
}
sl
->
ttl
=
dev
->
slave_ttl
;
dev
->
slave_count
++
;
dev
->
slave_count
++
;
memcpy
(
&
msg
.
id
.
id
,
rn
,
sizeof
(
msg
.
id
.
id
));
memcpy
(
&
msg
.
id
.
id
,
rn
,
sizeof
(
msg
.
id
.
id
));
...
@@ -569,7 +572,7 @@ static void w1_search(struct w1_master *dev)
...
@@ -569,7 +572,7 @@ static void w1_search(struct w1_master *dev)
}
}
if
(
slave_count
==
dev
->
slave_count
&&
if
(
slave_count
==
dev
->
slave_count
&&
((
rn
>>
56
)
&
0xff
)
==
w1_calc_crc8
((
u8
*
)
&
rn
,
7
))
{
rn
&&
((
rn
>>
56
)
&
0xff
)
==
w1_calc_crc8
((
u8
*
)
&
rn
,
7
))
{
w1_attach_slave_device
(
dev
,
(
struct
w1_reg_num
*
)
&
rn
);
w1_attach_slave_device
(
dev
,
(
struct
w1_reg_num
*
)
&
rn
);
}
}
}
}
...
@@ -718,7 +721,7 @@ int w1_process(void *data)
...
@@ -718,7 +721,7 @@ int w1_process(void *data)
list_for_each_safe
(
ent
,
n
,
&
dev
->
slist
)
{
list_for_each_safe
(
ent
,
n
,
&
dev
->
slist
)
{
sl
=
list_entry
(
ent
,
struct
w1_slave
,
w1_slave_entry
);
sl
=
list_entry
(
ent
,
struct
w1_slave
,
w1_slave_entry
);
if
(
sl
&&
!
test_bit
(
W1_SLAVE_ACTIVE
,
(
unsigned
long
*
)
&
sl
->
flags
))
{
if
(
sl
&&
!
test_bit
(
W1_SLAVE_ACTIVE
,
(
unsigned
long
*
)
&
sl
->
flags
)
&&
!--
sl
->
ttl
)
{
list_del
(
&
sl
->
w1_slave_entry
);
list_del
(
&
sl
->
w1_slave_entry
);
w1_slave_detach
(
sl
);
w1_slave_detach
(
sl
);
...
@@ -726,6 +729,8 @@ int w1_process(void *data)
...
@@ -726,6 +729,8 @@ int w1_process(void *data)
dev
->
slave_count
--
;
dev
->
slave_count
--
;
}
}
else
if
(
test_bit
(
W1_SLAVE_ACTIVE
,
(
unsigned
long
*
)
&
sl
->
flags
))
sl
->
ttl
=
dev
->
slave_ttl
;
}
}
up
(
&
dev
->
mutex
);
up
(
&
dev
->
mutex
);
}
}
...
...
drivers/w1/w1.h
View file @
9543d252
...
@@ -63,6 +63,7 @@ struct w1_slave
...
@@ -63,6 +63,7 @@ struct w1_slave
atomic_t
refcnt
;
atomic_t
refcnt
;
u8
rom
[
9
];
u8
rom
[
9
];
u32
flags
;
u32
flags
;
int
ttl
;
struct
w1_master
*
master
;
struct
w1_master
*
master
;
struct
w1_family
*
family
;
struct
w1_family
*
family
;
...
@@ -99,6 +100,7 @@ struct w1_master
...
@@ -99,6 +100,7 @@ struct w1_master
struct
list_head
slist
;
struct
list_head
slist
;
int
max_slave_count
,
slave_count
;
int
max_slave_count
,
slave_count
;
unsigned
long
attempts
;
unsigned
long
attempts
;
int
slave_ttl
;
int
initialized
;
int
initialized
;
u32
id
;
u32
id
;
...
...
drivers/w1/w1_int.c
View file @
9543d252
...
@@ -32,12 +32,13 @@ extern struct device_driver w1_driver;
...
@@ -32,12 +32,13 @@ extern struct device_driver w1_driver;
extern
struct
bus_type
w1_bus_type
;
extern
struct
bus_type
w1_bus_type
;
extern
struct
device
w1_device
;
extern
struct
device
w1_device
;
extern
int
w1_max_slave_count
;
extern
int
w1_max_slave_count
;
extern
int
w1_max_slave_ttl
;
extern
struct
list_head
w1_masters
;
extern
struct
list_head
w1_masters
;
extern
spinlock_t
w1_mlock
;
extern
spinlock_t
w1_mlock
;
extern
int
w1_process
(
void
*
);
extern
int
w1_process
(
void
*
);
struct
w1_master
*
w1_alloc_dev
(
u32
id
,
int
slave_count
,
struct
w1_master
*
w1_alloc_dev
(
u32
id
,
int
slave_count
,
int
slave_ttl
,
struct
device_driver
*
driver
,
struct
device
*
device
)
struct
device_driver
*
driver
,
struct
device
*
device
)
{
{
struct
w1_master
*
dev
;
struct
w1_master
*
dev
;
...
@@ -65,6 +66,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count,
...
@@ -65,6 +66,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count,
dev
->
kpid
=
-
1
;
dev
->
kpid
=
-
1
;
dev
->
initialized
=
0
;
dev
->
initialized
=
0
;
dev
->
id
=
id
;
dev
->
id
=
id
;
dev
->
slave_ttl
=
slave_ttl
;
atomic_set
(
&
dev
->
refcnt
,
2
);
atomic_set
(
&
dev
->
refcnt
,
2
);
...
@@ -121,7 +123,7 @@ int w1_add_master_device(struct w1_bus_master *master)
...
@@ -121,7 +123,7 @@ int w1_add_master_device(struct w1_bus_master *master)
int
retval
=
0
;
int
retval
=
0
;
struct
w1_netlink_msg
msg
;
struct
w1_netlink_msg
msg
;
dev
=
w1_alloc_dev
(
w1_ids
++
,
w1_max_slave_count
,
&
w1_driver
,
&
w1_device
);
dev
=
w1_alloc_dev
(
w1_ids
++
,
w1_max_slave_count
,
w1_max_slave_ttl
,
&
w1_driver
,
&
w1_device
);
if
(
!
dev
)
if
(
!
dev
)
return
-
ENOMEM
;
return
-
ENOMEM
;
...
...
drivers/w1/w1_int.h
View file @
9543d252
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include "w1.h"
#include "w1.h"
struct
w1_master
*
w1_alloc_dev
(
int
,
struct
device_driver
*
,
struct
device
*
);
struct
w1_master
*
w1_alloc_dev
(
u32
,
int
,
int
,
struct
device_driver
*
,
struct
device
*
);
void
w1_free_dev
(
struct
w1_master
*
dev
);
void
w1_free_dev
(
struct
w1_master
*
dev
);
int
w1_add_master_device
(
struct
w1_bus_master
*
);
int
w1_add_master_device
(
struct
w1_bus_master
*
);
void
w1_remove_master_device
(
struct
w1_bus_master
*
);
void
w1_remove_master_device
(
struct
w1_bus_master
*
);
...
...
drivers/w1/w1_netlink.c
View file @
9543d252
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "w1_log.h"
#include "w1_log.h"
#include "w1_netlink.h"
#include "w1_netlink.h"
#ifndef NETLINK_DISABLED
void
w1_netlink_send
(
struct
w1_master
*
dev
,
struct
w1_netlink_msg
*
msg
)
void
w1_netlink_send
(
struct
w1_master
*
dev
,
struct
w1_netlink_msg
*
msg
)
{
{
unsigned
int
size
;
unsigned
int
size
;
...
@@ -53,3 +54,10 @@ void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg)
...
@@ -53,3 +54,10 @@ void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg)
nlmsg_failure:
nlmsg_failure:
return
;
return
;
}
}
#else
#warning Netlink support is disabled. Please compile with NET support enabled.
void
w1_netlink_send
(
struct
w1_master
*
dev
,
struct
w1_netlink_msg
*
msg
)
{
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment