]> bbs.cooldavid.org Git - net-next-2.6.git/blame - Documentation/misc-devices/max6875
tg3: Remove tg3_config_info definition
[net-next-2.6.git] / Documentation / misc-devices / max6875
CommitLineData
c3bc4cae
BG
1Kernel driver max6875
2=====================
3
4Supported chips:
089bd866
JD
5 * Maxim MAX6874, MAX6875
6 Prefix: 'max6875'
93ffa435 7 Addresses scanned: None (see below)
089bd866 8 Datasheet:
c3bc4cae
BG
9 http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf
10
11Author: Ben Gardner <bgardner@wabtec.com>
12
13
c3bc4cae
BG
14Description
15-----------
16
089bd866 17The Maxim MAX6875 is an EEPROM-programmable power-supply sequencer/supervisor.
c3bc4cae
BG
18It provides timed outputs that can be used as a watchdog, if properly wired.
19It also provides 512 bytes of user EEPROM.
20
089bd866 21At reset, the MAX6875 reads the configuration EEPROM into its configuration
c3bc4cae
BG
22registers. The chip then begins to operate according to the values in the
23registers.
24
089bd866
JD
25The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
26and outputs:
089bd866
JD
27 vin gpi vout
28MAX6874 6 4 8
29MAX6875 4 3 5
30
93ffa435 31See the datasheet for more information.
c3bc4cae
BG
32
33
34Sysfs entries
35-------------
36
93ffa435 37eeprom - 512 bytes of user-defined EEPROM space.
c3bc4cae
BG
38
39
40General Remarks
41---------------
42
93ffa435
BG
43Valid addresses for the MAX6875 are 0x50 and 0x52.
44Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
b835d7fb
JD
45The driver does not probe any address, so you explicitly instantiate the
46devices.
93ffa435
BG
47
48Example:
b835d7fb
JD
49$ modprobe max6875
50$ echo max6875 0x50 > /sys/bus/i2c/devices/i2c-0/new_device
93ffa435
BG
51
52The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
53addresses. For example, for address 0x50, it also reserves 0x51.
bd8d421f 54The even-address instance is called 'max6875', the odd one is 'dummy'.
93ffa435
BG
55
56
57Programming the chip using i2c-dev
58----------------------------------
59
60Use the i2c-dev interface to access and program the chips.
0283fe6c 61Reads and writes are performed differently depending on the address range.
93ffa435
BG
62
63The configuration registers are at addresses 0x00 - 0x45.
64Use i2c_smbus_write_byte_data() to write a register and
65i2c_smbus_read_byte_data() to read a register.
66The command is the register number.
67
68Examples:
69To write a 1 to register 0x45:
70 i2c_smbus_write_byte_data(fd, 0x45, 1);
71
72To read register 0x45:
73 value = i2c_smbus_read_byte_data(fd, 0x45);
74
75
76The configuration EEPROM is at addresses 0x8000 - 0x8045.
77The user EEPROM is at addresses 0x8100 - 0x82ff.
78
79Use i2c_smbus_write_word_data() to write a byte to EEPROM.
80
81The command is the upper byte of the address: 0x80, 0x81, or 0x82.
82The data word is the lower part of the address or'd with data << 8.
83 cmd = address >> 8;
84 val = (address & 0xff) | (data << 8);
85
86Example:
87To write 0x5a to address 0x8003:
88 i2c_smbus_write_word_data(fd, 0x80, 0x5a03);
89
90
91Reading data from the EEPROM is a little more complicated.
92Use i2c_smbus_write_byte_data() to set the read address and then
93i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data.
94
95Example:
96To read data starting at offset 0x8100, first set the address:
97 i2c_smbus_write_byte_data(fd, 0x81, 0x00);
98
99And then read the data
100 value = i2c_smbus_read_byte(fd);
101
102 or
103
4b2643d7 104 count = i2c_smbus_read_i2c_block_data(fd, 0x84, 16, buffer);
93ffa435
BG
105
106The block read should read 16 bytes.
1070x84 is the block read command.
108
109See the datasheet for more details.
c3bc4cae 110