Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7206
b: refs/heads/master
c: d65da6e
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Sep 5, 2005
1 parent 13758aa commit b5d8236
Show file tree
Hide file tree
Showing 167 changed files with 2,850 additions and 4,585 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8566cfc9fe0934f52ddedc12b083176116c13978
refs/heads/master: d65da6eae10cc77f93ead0188cde0b45f124d912
7 changes: 6 additions & 1 deletion trunk/Documentation/hwmon/lm78
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ Kernel driver lm78
==================

Supported chips:
* National Semiconductor LM78 / LM78-J
* National Semiconductor LM78
Prefix: 'lm78'
Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
Datasheet: Publicly available at the National Semiconductor website
http://www.national.com/
* National Semiconductor LM78-J
Prefix: 'lm78-j'
Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
Datasheet: Publicly available at the National Semiconductor website
http://www.national.com/
* National Semiconductor LM79
Prefix: 'lm79'
Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
Expand Down
174 changes: 0 additions & 174 deletions trunk/Documentation/hwmon/w83792d

This file was deleted.

94 changes: 26 additions & 68 deletions trunk/Documentation/i2c/chips/max6875
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ Kernel driver max6875
Supported chips:
* Maxim MAX6874, MAX6875
Prefix: 'max6875'
Addresses scanned: None (see below)
Addresses scanned: 0x50, 0x52
Datasheet:
http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf

Author: Ben Gardner <bgardner@wabtec.com>


Module Parameters
-----------------

* allow_write int
Set to non-zero to enable write permission:
*0: Read only
1: Read and write


Description
-----------

Expand All @@ -24,85 +33,34 @@ registers.

The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
and outputs:

vin gpi vout
MAX6874 6 4 8
MAX6875 4 3 5

See the datasheet for more information.
MAX6874 chips can have four different addresses (as opposed to only two for
the MAX6875). The additional addresses (0x54 and 0x56) are not probed by
this driver by default, but the probe module parameter can be used if
needed.

See the datasheet for details on how to program the EEPROM.


Sysfs entries
-------------

eeprom - 512 bytes of user-defined EEPROM space.


General Remarks
---------------

Valid addresses for the MAX6875 are 0x50 and 0x52.
Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
The driver does not probe any address, so you must force the address.

Example:
$ modprobe max6875 force=0,0x50

The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
addresses. For example, for address 0x50, it also reserves 0x51.
The even-address instance is called 'max6875', the odd one is 'max6875 subclient'.


Programming the chip using i2c-dev
----------------------------------
eeprom_user - 512 bytes of user-defined EEPROM space. Only writable if
allow_write was set and register 0x43 is 0.

Use the i2c-dev interface to access and program the chips.
Reads and writes are performed differently depending on the address range.
eeprom_config - 70 bytes of config EEPROM. Note that changes will not get
loaded into register space until a power cycle or device reset.

The configuration registers are at addresses 0x00 - 0x45.
Use i2c_smbus_write_byte_data() to write a register and
i2c_smbus_read_byte_data() to read a register.
The command is the register number.
reg_config - 70 bytes of register space. Any changes take affect immediately.

Examples:
To write a 1 to register 0x45:
i2c_smbus_write_byte_data(fd, 0x45, 1);

To read register 0x45:
value = i2c_smbus_read_byte_data(fd, 0x45);


The configuration EEPROM is at addresses 0x8000 - 0x8045.
The user EEPROM is at addresses 0x8100 - 0x82ff.

Use i2c_smbus_write_word_data() to write a byte to EEPROM.

The command is the upper byte of the address: 0x80, 0x81, or 0x82.
The data word is the lower part of the address or'd with data << 8.
cmd = address >> 8;
val = (address & 0xff) | (data << 8);

Example:
To write 0x5a to address 0x8003:
i2c_smbus_write_word_data(fd, 0x80, 0x5a03);


Reading data from the EEPROM is a little more complicated.
Use i2c_smbus_write_byte_data() to set the read address and then
i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data.

Example:
To read data starting at offset 0x8100, first set the address:
i2c_smbus_write_byte_data(fd, 0x81, 0x00);

And then read the data
value = i2c_smbus_read_byte(fd);

or

count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);

The block read should read 16 bytes.
0x84 is the block read command.
General Remarks
---------------

See the datasheet for more details.
A typical application will require that the EEPROMs be programmed once and
never altered afterwards.

2 changes: 1 addition & 1 deletion trunk/Documentation/i2c/functionality
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CHECKING THROUGH /DEV
If you try to access an adapter from a userspace program, you will have
to use the /dev interface. You will still have to check whether the
functionality you need is supported, of course. This is done using
the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect
the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2c_detect
program, is below:

int file;
Expand Down
Loading

0 comments on commit b5d8236

Please sign in to comment.