Skip to contentSkip to conversation

I2C patches for 2.6.12

PATCH New Greg KH 4 participants 47 messages Jun 22, 2005 – Jun 29, 2005

Subsystems (11)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 I2C patches for 2.6.12

Here are a bunch of i2c patches that have been in the -mm tree for the past few months. There are a few new drivers in here, a bunch of spelling fixes, lots of documentation updates, and a few other minor things.

Please pull from:

	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git/
or from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6.git/

if it isn't synced up yet.

The full patch series will sent to the linux-kernel and sensors mailing lists, if anyone wants to see them.

thanks,

greg k-h

 Documentation/feature-removal-schedule.txt |   10 
 Documentation/i2c/busses/i2c-sis69x        |    2 
 Documentation/i2c/chips/adm1021            |  111 +++
 Documentation/i2c/chips/adm1025            |   51 +
 Documentation/i2c/chips/adm1026            |   93 ++
 Documentation/i2c/chips/adm1031            |   35 
 Documentation/i2c/chips/adm9240            |  177 ++++
 Documentation/i2c/chips/asb100             |   72 +
 Documentation/i2c/chips/ds1621             |  108 ++
 Documentation/i2c/chips/eeprom             |   96 ++
 Documentation/i2c/chips/fscher             |  169 ++++
 Documentation/i2c/chips/gl518sm            |   74 ++
 Documentation/i2c/chips/it87               |   96 ++
 Documentation/i2c/chips/lm63               |   57 +
 Documentation/i2c/chips/lm75               |   65 +
 Documentation/i2c/chips/lm77               |   22 
 Documentation/i2c/chips/lm78               |   82 ++
 Documentation/i2c/chips/lm80               |   56 +
 Documentation/i2c/chips/lm83               |   76 ++
 Documentation/i2c/chips/lm85               |  221 +++++
 Documentation/i2c/chips/lm87               |   73 +
 Documentation/i2c/chips/lm90               |  121 +++
 Documentation/i2c/chips/lm92               |   37 +
 Documentation/i2c/chips/max1619            |   29 
 Documentation/i2c/chips/max6875            |   54 +
 Documentation/i2c/chips/pc87360            |  189 +++++
 Documentation/i2c/chips/pca9539            |   47 +
 Documentation/i2c/chips/pcf8574            |   69 +
 Documentation/i2c/chips/pcf8591            |   90 ++
 Documentation/i2c/chips/sis5595            |  106 ++
 Documentation/i2c/chips/smsc47b397         |  168 ++++
 Documentation/i2c/chips/smsc47b397.txt     |  146 ---
 Documentation/i2c/chips/smsc47m1           |   52 +
 Documentation/i2c/chips/via686a            |   65 +
 Documentation/i2c/chips/w83627hf           |   66 +
 Documentation/i2c/chips/w83781d            |  428 +++++++++++
 Documentation/i2c/chips/w83l785ts          |   39 +
 Documentation/i2c/porting-clients          |    2 
 Documentation/i2c/userspace-tools          |   39 +
 Documentation/i2c/writing-clients          |   64 -
 MAINTAINERS                                |   16 
 arch/ppc/platforms/83xx/mpc834x_sys.c      |   20 
 drivers/acorn/char/pcf8583.c               |    3 
 drivers/i2c/algos/i2c-algo-pca.c           |    8 
 drivers/i2c/algos/i2c-algo-sibyte.c        |    1 
 drivers/i2c/busses/Kconfig                 |   34 
 drivers/i2c/busses/i2c-ali1535.c           |    1 
 drivers/i2c/busses/i2c-ali15x3.c           |    1 
 drivers/i2c/busses/i2c-amd756.c            |    1 
 drivers/i2c/busses/i2c-amd8111.c           |    1 
 drivers/i2c/busses/i2c-au1550.c            |    1 
 drivers/i2c/busses/i2c-elektor.c           |    1 
 drivers/i2c/busses/i2c-frodo.c             |    1 
 drivers/i2c/busses/i2c-i801.c              |    1 
 drivers/i2c/busses/i2c-i810.c              |    1 
 drivers/i2c/busses/i2c-ibm_iic.c           |    2 
 drivers/i2c/busses/i2c-ibm_iic.h           |    1 
 drivers/i2c/busses/i2c-iop3xx.c            |    2 
 drivers/i2c/busses/i2c-isa.c               |    1 
 drivers/i2c/busses/i2c-ite.c               |    1 
 drivers/i2c/busses/i2c-ixp2000.c           |    5 
 drivers/i2c/busses/i2c-ixp4xx.c            |    5 
 drivers/i2c/busses/i2c-keywest.c           |    1 
 drivers/i2c/busses/i2c-mpc.c               |   18 
 drivers/i2c/busses/i2c-nforce2.c           |    1 
 drivers/i2c/busses/i2c-parport-light.c     |    1 
 drivers/i2c/busses/i2c-parport.c           |    3 
 drivers/i2c/busses/i2c-pca-isa.c           |    1 
 drivers/i2c/busses/i2c-piix4.c             |    1 
 drivers/i2c/busses/i2c-prosavage.c         |    1 
 drivers/i2c/busses/i2c-rpx.c               |    1 
 drivers/i2c/busses/i2c-s3c2410.c           |    3 
 drivers/i2c/busses/i2c-savage4.c           |    1 
 drivers/i2c/busses/i2c-sibyte.c            |    1 
 drivers/i2c/busses/i2c-sis5595.c           |    1 
 drivers/i2c/busses/i2c-sis630.c            |    1 
 drivers/i2c/busses/i2c-sis96x.c            |    1 
 drivers/i2c/busses/i2c-stub.c              |    1 
 drivers/i2c/busses/i2c-via.c               |    1 
 drivers/i2c/busses/i2c-viapro.c            |    1 
 drivers/i2c/busses/i2c-voodoo3.c           |    1 
 drivers/i2c/busses/scx200_acb.c            |    1 
 drivers/i2c/chips/Kconfig                  |  117 ++-
 drivers/i2c/chips/Makefile                 |   10 
 drivers/i2c/chips/adm1021.c                |    9 
 drivers/i2c/chips/adm1025.c                |    5 
 drivers/i2c/chips/adm1026.c                |    8 
 drivers/i2c/chips/adm1031.c                |    2 
 drivers/i2c/chips/adm9240.c                |  829 +++++++++++++++++++++-
 drivers/i2c/chips/asb100.c                 |    5 
 drivers/i2c/chips/atxp1.c                  |  385 ++++++++++
 drivers/i2c/chips/ds1337.c                 |  107 +-
 drivers/i2c/chips/ds1374.c                 |  272 +++++++
 drivers/i2c/chips/ds1621.c                 |    4 
 drivers/i2c/chips/eeprom.c                 |    1 
 drivers/i2c/chips/fscher.c                 |    1 
 drivers/i2c/chips/gl518sm.c                |    1 
 drivers/i2c/chips/isp1301_omap.c           |    1 
 drivers/i2c/chips/it87.c                   |  398 +++++-----
 drivers/i2c/chips/lm63.c                   |  274 +++----
 drivers/i2c/chips/lm75.c                   |    1 
 drivers/i2c/chips/lm77.c                   |    1 
 drivers/i2c/chips/lm78.c                   |    5 
 drivers/i2c/chips/lm80.c                   |    1 
 drivers/i2c/chips/lm83.c                   |  162 ++--
 drivers/i2c/chips/lm85.c                   |    5 
 drivers/i2c/chips/lm87.c                   |    1 
 drivers/i2c/chips/lm90.c                   |  281 ++++---
 drivers/i2c/chips/m41t00.c                 |    3 
 drivers/i2c/chips/max1619.c                |    1 
 drivers/i2c/chips/max6875.c                |  473 ++++++++++++
 drivers/i2c/chips/pc87360.c                |    1 
 drivers/i2c/chips/pca9539.c                |  192 +++++
 drivers/i2c/chips/pcf8574.c                |    6 
 drivers/i2c/chips/rtc8564.c                |    4 
 drivers/i2c/chips/sis5595.c                |    1 
 drivers/i2c/chips/smsc47m1.c               |   10 
 drivers/i2c/chips/tps65010.c               | 1072 +++++++++++++++++++++++++++++
 drivers/i2c/chips/via686a.c                |  303 ++++----
 drivers/i2c/chips/w83627ehf.c              |  870 +++++++++++++++++++++++
 drivers/i2c/chips/w83627hf.c               |    2 
 drivers/i2c/chips/w83781d.c                |   78 --
 drivers/i2c/chips/w83l785ts.c              |    1 
 drivers/i2c/i2c-core.c                     |  102 --
 drivers/i2c/i2c-dev.c                      |    3 
 drivers/macintosh/therm_windtunnel.c       |    6 
 drivers/media/video/adv7170.c              |   16 
 drivers/media/video/adv7175.c              |   16 
 drivers/media/video/bt819.c                |   16 
 drivers/media/video/bt832.c                |    4 
 drivers/media/video/bt856.c                |   16 
 drivers/media/video/msp3400.c              |    1 
 drivers/media/video/saa5246a.c             |    1 
 drivers/media/video/saa5249.c              |    1 
 drivers/media/video/saa7110.c              |   16 
 drivers/media/video/saa7111.c              |   16 
 drivers/media/video/saa7114.c              |   16 
 drivers/media/video/saa7134/saa6752hs.c    |    1 
 drivers/media/video/saa7185.c              |   16 
 drivers/media/video/tda7432.c              |    1 
 drivers/media/video/tda9840.c              |    1 
 drivers/media/video/tda9875.c              |    1 
 drivers/media/video/tda9887.c              |    1 
 drivers/media/video/tea6415c.c             |    1 
 drivers/media/video/tea6420.c              |    1 
 drivers/media/video/tuner-3036.c           |   23 
 drivers/media/video/tuner-core.c           |   11 
 drivers/media/video/tvaudio.c              |    1 
 drivers/media/video/tveeprom.c             |    1 
 drivers/media/video/vpx3220.c              |   16 
 drivers/video/matrox/matroxfb_maven.c      |    1 
 include/asm-arm/arch-omap/tps65010.h       |   76 ++
 include/linux/hwmon-sysfs.h                |   36 
 include/linux/i2c-id.h                     |    1 
 include/linux/i2c-sysfs.h                  |   36 
 include/linux/i2c-vid.h                    |   12 
 include/linux/i2c.h                        |   12 
 157 files changed, 8574 insertions(+), 1514 deletions(-)

------------

Alexey Dobriyan:
I2C: drivers/i2c/*: #include <linux/config.h> cleanup

Andrew Morton:
I2C: fix ds1374 build

[email protected]:
max6875: new i2c device driver

[email protected]:
I2C: add new pca9539 driver

Clemens Koller:
I2C: rtc8564.c remove duplicate include

David Brownell:
I2C: add i2c driver for TPS6501x

Dominik Hackl:
I2C: include of jiffies.h for some i2c drivers

Grant Coady:
I2C: add adm9240 driver documentation
I2C: driver adm1021: remove die_code
I2C: adm9240 driver cleanup
I2C: remove <linux/delay.h> from via686a
I2C: Setting w83627hf fan divisor 128 fails.
I2C: sysfs names: rename to cpu0_vid, take 3
I2C: add new hardware monitor driver: adm9240

Greg Kroah-Hartman:
I2C: fix up ds1374.c driver so it will build.
I2C: fix up some sysfs device attribute file parameters
I2C: mark all functions static in atxp1 driver

Jean Delvare:
I2C: w83781d: remove non-i2c sensor chips
I2C: rename i2c-sysfs.h to hwmon-sysfs.h
I2C: lm63 uses new sysfs callbacks
I2C: drivers/i2c/chips/it87.c: use dynamic sysfs callbacks
I2C: lm83 uses new sysfs callbacks
I2C: pcf8574 driver cleanup
I2C: lm90 uses new sysfs callbacks
I2C: Sensors mailing list has moved
I2C: Kill another macro abuse in via686a
I2C: Coding style cleanups to via686a
I2C: chips/Kconfig corrections
I2C: Kill common macro abuse in chip drivers
I2C: Remove redundancy from i2c-core.c
I2C: Add support for the LPC47M15x and LPC47M192 chips to smsc47m1
I2C: Fix bugs in the new w83627ehf driver
I2C: New hardware monitoring driver: w83627ehf
I2C: #include <linux/config.h> cleanup
I2C: Merge unused address lists in some video drivers
I2C: Kill address ranges in non-sensors i2c chip drivers

Kumar Gala:
I2C: Allow for sharing of the interrupt line for i2c-mpc.c

Ladislav Michl:
ds1337: export ds1337_do_command
ds1337 driver works also with ds1339 chip
I2C: ds1337: search by bus number
I2C: ds1337 3/4
I2C: ds1337 2/4
I2C: ds1337: Make time format consistent with other RTC drivers
I2C: ds1337: i2c_transfer() checking
I2C: ds1337 1/4

Randy Vinson:
I2C: Add support for Maxim/Dallas DS1374 Real-Time Clock Chip (1/2)
I2C: Add support for Maxim/Dallas DS1374 Real-Time Clock Chip (2/2)

Rudolf Marek:
I2C: documentation update 3/3
I2C: documentation update 2/3
I2C: KConfig update - some EXPERIMENTAL removal
I2C: documentation update 1/3

Sebastian Witt:
I2C: add new atxp1 driver
I2C: i2c-vid.h: Support for VID to reg conversion

Steven Cole:
Spelling fixes for drivers/i2c.

Sylvain Munaut:
i2c: Race fix for i2c-mpc.c

Tobias Klauser:
I2C: Spelling fixes for drivers/i2c/i2c-dev.c
I2C: Spelling fixes for drivers/i2c/i2c-core.c
I2C: Spelling fixes for drivers/i2c/busses/i2c-parport.c
I2C: Spelling fixes for drivers/i2c/algos/i2c-algo-pca.c

author
#1 lore raw

PATCH 1/1 I2C: Kill address ranges in non-sensors i2c chip drivers

[PATCH] I2C: Kill address ranges in non-sensors i2c chip drivers

Some months ago, you killed the address ranges mechanism from all sensors i2c chip drivers (both the module parameters and the in-code address lists). I think it was a very good move, as the ranges can easily be replaced by individual addresses, and this allowed for significant cleanups in the i2c core (let alone the impressive size shrink for all these drivers).

Unfortunately you did not do the same for non-sensors i2c chip drivers. These need the address ranges even less, so we could get rid of the ranges here as well for another significant i2c core cleanup. Here comes a patch which does just that. Since the process is exactly the same as what you did for the other drivers set already, I did not split this one in parts.

A documentation update is included.

The change saves 308 bytes in the i2c core, and an average 1382 bytes for chip drivers which use I2C_CLIENT_INSMOD, 126 bytes for those which do not.

This change is required if we want to merge the sensors and non-sensors i2c code (and we want to do this).

Index: gregkh-2.6/Documentation/i2c/writing-clients
===================================================================

---
commit b3d5496ea5915fa4848fe307af9f7097f312e932
tree e358977311df194ebac13d57c5e8abf1a87bd65c
parent 2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e
author Jean Delvare <[email protected]> Sat, 02 Apr 2005 20:31:02 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:48 -0700

 Documentation/i2c/writing-clients       |   64 ++++++-------------------------
 drivers/acorn/char/pcf8583.c            |    3 -
 drivers/i2c/chips/isp1301_omap.c        |    1 
 drivers/i2c/chips/m41t00.c              |    3 -
 drivers/i2c/chips/rtc8564.c             |    3 -
 drivers/i2c/i2c-core.c                  |   35 -----------------
 drivers/macintosh/therm_windtunnel.c    |    6 ++-
 drivers/media/video/adv7170.c           |    6 ---
 drivers/media/video/adv7175.c           |    6 ---
 drivers/media/video/bt819.c             |    6 ---
 drivers/media/video/bt832.c             |    4 +-
 drivers/media/video/bt856.c             |    6 ---
 drivers/media/video/msp3400.c           |    1 
 drivers/media/video/saa5246a.c          |    1 
 drivers/media/video/saa5249.c           |    1 
 drivers/media/video/saa7110.c           |    6 ---
 drivers/media/video/saa7111.c           |    6 ---
 drivers/media/video/saa7114.c           |    6 ---
 drivers/media/video/saa7134/saa6752hs.c |    1 
 drivers/media/video/saa7185.c           |    6 ---
 drivers/media/video/tda7432.c           |    1 
 drivers/media/video/tda9840.c           |    1 
 drivers/media/video/tda9875.c           |    1 
 drivers/media/video/tda9887.c           |    1 
 drivers/media/video/tea6415c.c          |    1 
 drivers/media/video/tea6420.c           |    1 
 drivers/media/video/tuner-3036.c        |   13 ++----
 drivers/media/video/tuner-core.c        |   11 ++---
 drivers/media/video/tvaudio.c           |    1 
 drivers/media/video/tveeprom.c          |    1 
 drivers/media/video/vpx3220.c           |    6 ---
 drivers/video/matrox/matroxfb_maven.c   |    1 
 include/linux/i2c.h                     |   12 ------
 33 files changed, 28 insertions(+), 194 deletions(-)
Documentation/i2c/writing-clients +13 -51
@@ -171,45 +171,31 @@ The following lists are used internally:
 
   normal_i2c: filled in by the module writer. 
      A list of I2C addresses which should normally be examined.
-   normal_i2c_range: filled in by the module writer.
-     A list of pairs of I2C addresses, each pair being an inclusive range of
-     addresses which should normally be examined.
    probe: insmod parameter. 
      A list of pairs. The first value is a bus number (-1 for any I2C bus), 
      the second is the address. These addresses are also probed, as if they 
      were in the 'normal' list.
-   probe_range: insmod parameter. 
-     A list of triples. The first value is a bus number (-1 for any I2C bus), 
-     the second and third are addresses.  These form an inclusive range of 
-     addresses that are also probed, as if they were in the 'normal' list.
    ignore: insmod parameter.
      A list of pairs. The first value is a bus number (-1 for any I2C bus), 
      the second is the I2C address. These addresses are never probed. 
      This parameter overrules 'normal' and 'probe', but not the 'force' lists.
-   ignore_range: insmod parameter. 
-     A list of triples. The first value is a bus number (-1 for any I2C bus), 
-     the second and third are addresses. These form an inclusive range of 
-     I2C addresses that are never probed.
-     This parameter overrules 'normal' and 'probe', but not the 'force' lists.
    force: insmod parameter. 
      A list of pairs. The first value is a bus number (-1 for any I2C bus),
      the second is the I2C address. A device is blindly assumed to be on
      the given address, no probing is done. 
 
-Fortunately, as a module writer, you just have to define the `normal' 
-and/or `normal_range' parameters. The complete declaration could look
-like this:
-
-  /* Scan 0x20 to 0x2f, 0x37, and 0x40 to 0x4f */
-  static unsigned short normal_i2c[] = { 0x37,I2C_CLIENT_END }; 
-  static unsigned short normal_i2c_range[] = { 0x20, 0x2f, 0x40, 0x4f, 
-                                               I2C_CLIENT_END };
+Fortunately, as a module writer, you just have to define the `normal_i2c' 
+parameter. The complete declaration could look like this:
+
+  /* Scan 0x37, and 0x48 to 0x4f */
+  static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
+                                         0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
 
   /* Magic definition of all other variables and things */
   I2C_CLIENT_INSMOD;
 
-Note that you *have* to call the two defined variables `normal_i2c' and
-`normal_i2c_range', without any prefix!
+Note that you *have* to call the defined variable `normal_i2c',
+without any prefix!
 
 
 Probing classes (sensors)
@@ -223,39 +209,17 @@ The following lists are used internally.
 
    normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.
      A list of I2C addresses which should normally be examined.
-   normal_i2c_range: filled in by the module writer. Terminated by 
-     SENSORS_I2C_END
-     A list of pairs of I2C addresses, each pair being an inclusive range of
-     addresses which should normally be examined.
    normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
      A list of ISA addresses which should normally be examined.
-   normal_isa_range: filled in by the module writer. Terminated by 
-     SENSORS_ISA_END
-     A list of triples. The first two elements are ISA addresses, being an
-     range of addresses which should normally be examined. The third is the
-     modulo parameter: only addresses which are 0 module this value relative
-     to the first address of the range are actually considered.
    probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.
      A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second is the address. These
      addresses are also probed, as if they were in the 'normal' list.
-   probe_range: insmod parameter. Initialize this list with SENSORS_I2C_END 
-     values.
-     A list of triples. The first value is a bus number (SENSORS_ISA_BUS for
-     the ISA bus, -1 for any I2C bus), the second and third are addresses. 
-     These form an inclusive range of addresses that are also probed, as
-     if they were in the 'normal' list.
    ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.
      A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
      the ISA bus, -1 for any I2C bus), the second is the I2C address. These
      addresses are never probed. This parameter overrules 'normal' and 
      'probe', but not the 'force' lists.
-   ignore_range: insmod parameter. Initialize this list with SENSORS_I2C_END 
-      values.
-     A list of triples. The first value is a bus number (SENSORS_ISA_BUS for
-     the ISA bus, -1 for any I2C bus), the second and third are addresses. 
-     These form an inclusive range of I2C addresses that are never probed.
-     This parameter overrules 'normal' and 'probe', but not the 'force' lists.
 
 Also used is a list of pointers to sensors_force_data structures:
    force_data: insmod parameters. A list, ending with an element of which
@@ -269,16 +233,14 @@ Also used is a list of pointers to senso
 So we have a generic insmod variabled `force', and chip-specific variables
 `force_CHIPNAME'.
 
-Fortunately, as a module writer, you just have to define the `normal' 
-and/or `normal_range' parameters, and define what chip names are used. 
+Fortunately, as a module writer, you just have to define the `normal_i2c' 
+and `normal_isa' parameters, and define what chip names are used. 
 The complete declaration could look like this:
-  /* Scan i2c addresses 0x20 to 0x2f, 0x37, and 0x40 to 0x4f
-  static unsigned short normal_i2c[] = {0x37,SENSORS_I2C_END};
-  static unsigned short normal_i2c_range[] = {0x20,0x2f,0x40,0x4f,
-                                              SENSORS_I2C_END};
+  /* Scan i2c addresses 0x37, and 0x48 to 0x4f */
+  static unsigned short normal_i2c[] = { 0x37, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
+                                         0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
   /* Scan ISA address 0x290 */
   static unsigned int normal_isa[] = {0x0290,SENSORS_ISA_END};
-  static unsigned int normal_isa_range[] = {SENSORS_ISA_END};
 
   /* Define chips foo and bar, as well as all module parameters and things */
   SENSORS_INSMOD_2(foo,bar);
drivers/acorn/char/pcf8583.c +0 -3
@@ -26,11 +26,8 @@ static unsigned short normal_addr[] = { 
 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_addr,
-	.normal_i2c_range	= ignore,
 	.probe			= ignore,
-	.probe_range		= ignore,
 	.ignore			= ignore,
-	.ignore_range		= ignore,
 	.force			= ignore,
 };
 
drivers/i2c/chips/isp1301_omap.c +0 -1
@@ -145,7 +145,6 @@ static inline void notresponding(struct 
 static unsigned short normal_i2c[] = {
 	ISP_BASE, ISP_BASE + 1,
 	I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 I2C_CLIENT_INSMOD;
 
drivers/i2c/chips/m41t00.c +0 -3
@@ -40,11 +40,8 @@ static unsigned short normal_addr[] = { 
 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_addr,
-	.normal_i2c_range	= ignore,
 	.probe			= ignore,
-	.probe_range		= ignore,
 	.ignore			= ignore,
-	.ignore_range		= ignore,
 	.force			= ignore,
 };
 
drivers/i2c/chips/rtc8564.c +0 -3
@@ -66,11 +66,8 @@ static unsigned short normal_addr[] = { 
 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_addr,
-	.normal_i2c_range	= ignore,
 	.probe			= ignore,
-	.probe_range		= ignore,
 	.ignore			= ignore,
-	.ignore_range		= ignore,
 	.force			= ignore,
 };
 
drivers/i2c/i2c-core.c +0 -35
@@ -742,18 +742,6 @@ int i2c_probe(struct i2c_adapter *adapte
 				found = 1;
 			}
 		}
-		for (i = 0;
-		     !found && (address_data->ignore_range[i] != I2C_CLIENT_END);
-		     i += 3) {
-			if (((adap_id == address_data->ignore_range[i]) ||
-			    ((address_data->ignore_range[i]==ANY_I2C_BUS))) &&
-			    (addr >= address_data->ignore_range[i+1]) &&
-			    (addr <= address_data->ignore_range[i+2])) {
-				dev_dbg(&adapter->dev, "found ignore_range parameter for adapter %d, "
-					"addr %04x\n", adap_id,addr);
-				found = 1;
-			}
-		}
 		if (found) 
 			continue;
 
@@ -770,17 +758,6 @@ int i2c_probe(struct i2c_adapter *adapte
 		}
 
 		for (i = 0;
-		     !found && (address_data->normal_i2c_range[i] != I2C_CLIENT_END);
-		     i += 2) {
-			if ((addr >= address_data->normal_i2c_range[i]) &&
-			    (addr <= address_data->normal_i2c_range[i+1])) {
-				found = 1;
-				dev_dbg(&adapter->dev, "found normal i2c_range entry for adapter %d, "
-					"addr %04x\n", adap_id,addr);
-			}
-		}
-
-		for (i = 0;
 		     !found && (address_data->probe[i] != I2C_CLIENT_END);
 		     i += 2) {
 			if (((adap_id == address_data->probe[i]) ||
@@ -791,18 +768,6 @@ int i2c_probe(struct i2c_adapter *adapte
 					"addr %04x\n", adap_id,addr);
 			}
 		}
-		for (i = 0;
-		     !found && (address_data->probe_range[i] != I2C_CLIENT_END);
-		     i += 3) {
-			if (((adap_id == address_data->probe_range[i]) ||
-			   (address_data->probe_range[i] == ANY_I2C_BUS)) &&
-			   (addr >= address_data->probe_range[i+1]) &&
-			   (addr <= address_data->probe_range[i+2])) {
-				found = 1;
-				dev_dbg(&adapter->dev, "found probe_range parameter for adapter %d, "
-					"addr %04x\n", adap_id,addr);
-			}
-		}
 		if (!found) 
 			continue;
 
drivers/macintosh/therm_windtunnel.c +4 -2
@@ -51,8 +51,10 @@
 static int 			do_probe( struct i2c_adapter *adapter, int addr, int kind);
 
 /* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
-static unsigned short		normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END };
-static unsigned short		normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END };
+static unsigned short		normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
+						 0x4c, 0x4d, 0x4e, 0x4f,
+						 0x2c, 0x2d, 0x2e, 0x2f,
+						 I2C_CLIENT_END };
 
 I2C_CLIENT_INSMOD;
 
drivers/media/video/adv7170.c +0 -6
@@ -384,21 +384,15 @@ static unsigned short normal_i2c[] =
 	I2C_ADV7171 >> 1, (I2C_ADV7171 >> 1) + 1,
 	I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/adv7175.c +0 -6
@@ -434,21 +434,15 @@ static unsigned short normal_i2c[] =
 	I2C_ADV7176 >> 1, (I2C_ADV7176 >> 1) + 1,
 	I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/bt819.c +0 -6
@@ -500,21 +500,15 @@ static unsigned short normal_i2c[] = {
 	I2C_BT819 >> 1,
 	I2C_CLIENT_END,
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/bt832.c +2 -2
@@ -39,8 +39,8 @@
 MODULE_LICENSE("GPL");
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = {I2C_CLIENT_END};
-static unsigned short normal_i2c_range[] = {I2C_BT832_ALT1>>1,I2C_BT832_ALT2>>1,I2C_CLIENT_END};
+static unsigned short normal_i2c[] = { I2C_BT832_ALT1>>1, I2C_BT832_ALT2>>1,
+				       I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 /* ---------------------------------------------------------------------- */
drivers/media/video/bt856.c +0 -6
@@ -288,21 +288,15 @@ bt856_command (struct i2c_client *client
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
  */
 static unsigned short normal_i2c[] = { I2C_BT856 >> 1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/msp3400.c +0 -1
@@ -147,7 +147,6 @@ static unsigned short normal_i2c[] = {
 	I2C_MSP3400C_ALT  >> 1,
 	I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END,I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 /* ----------------------------------------------------------------------- */
drivers/media/video/saa5246a.c +0 -1
@@ -64,7 +64,6 @@ static struct video_device saa_template;
 
 /* Addresses to scan */
 static unsigned short normal_i2c[]	 = { I2C_ADDRESS, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
drivers/media/video/saa5249.c +0 -1
@@ -132,7 +132,6 @@ static struct video_device saa_template;
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {34>>1,I2C_CLIENT_END};
-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 static struct i2c_client client_template;
drivers/media/video/saa7110.c +0 -6
@@ -463,21 +463,15 @@ static unsigned short normal_i2c[] = {
 	(I2C_SAA7110 >> 1) + 1,
 	I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/saa7111.c +0 -6
@@ -482,21 +482,15 @@ saa7111_command (struct i2c_client *clie
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
  */
 static unsigned short normal_i2c[] = { I2C_SAA7111 >> 1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/saa7114.c +0 -6
@@ -820,21 +820,15 @@ saa7114_command (struct i2c_client *clie
  */
 static unsigned short normal_i2c[] =
     { I2C_SAA7114 >> 1, I2C_SAA7114A >> 1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/saa7134/saa6752hs.c +0 -1
@@ -22,7 +22,6 @@
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {0x20, I2C_CLIENT_END};
-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 MODULE_DESCRIPTION("device driver for saa6752hs MPEG2 encoder");
drivers/media/video/saa7185.c +0 -6
@@ -380,21 +380,15 @@ saa7185_command (struct i2c_client *clie
  * concerning the addresses: i2c wants 7 bit (without the r/w bit), so '>>1'
  */
 static unsigned short normal_i2c[] = { I2C_SAA7185 >> 1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/media/video/tda7432.c +0 -1
@@ -74,7 +74,6 @@ static unsigned short normal_i2c[] = {
 	I2C_TDA7432 >> 1,
 	I2C_CLIENT_END,
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END, I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 /* Structure of address and subaddresses for the tda7432 */
drivers/media/video/tda9840.c +0 -1
@@ -43,7 +43,6 @@ MODULE_PARM_DESC(debug, "Turn on/off dev
 
 /* addresses to scan, found only at 0x42 (7-Bit) */
 static unsigned short normal_i2c[] = { I2C_TDA9840, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
drivers/media/video/tda9875.c +0 -1
@@ -44,7 +44,6 @@ static unsigned short normal_i2c[] =  {
     I2C_TDA9875 >> 1,
     I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 /* This is a superset of the TDA9875 */
drivers/media/video/tda9887.c +0 -1
@@ -33,7 +33,6 @@ static unsigned short normal_i2c[] = {
 	0x96 >>1,
 	I2C_CLIENT_END,
 };
-static unsigned short normal_i2c_range[] = {I2C_CLIENT_END,I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 /* insmod options */
drivers/media/video/tea6415c.c +0 -1
@@ -43,7 +43,6 @@ MODULE_PARM_DESC(debug, "Turn on/off dev
 
 /* addresses to scan, found only at 0x03 and/or 0x43 (7-bit) */
 static unsigned short normal_i2c[] = { I2C_TEA6415C_1, I2C_TEA6415C_2, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
drivers/media/video/tea6420.c +0 -1
@@ -40,7 +40,6 @@ MODULE_PARM_DESC(debug, "Turn on/off dev
 
 /* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */
 static unsigned short normal_i2c[] = { I2C_TEA6420_1, I2C_TEA6420_2, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
drivers/media/video/tuner-3036.c +5 -8
@@ -34,19 +34,16 @@ static int this_adap;
 static struct i2c_client client_template;
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = {I2C_CLIENT_END};
-static unsigned short normal_i2c_range[] = {0x60, 0x61, I2C_CLIENT_END};
+static unsigned short normal_i2c[] = { 0x60, 0x61, I2C_CLIENT_END };
 static unsigned short probe[2]        = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2]  = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2]       = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2]        = { I2C_CLIENT_END, I2C_CLIENT_END };
 
 static struct i2c_client_address_data addr_data = {
-	normal_i2c, normal_i2c_range, 
-	probe, probe_range, 
-	ignore, ignore_range, 
-	force
+	.normal_i2c	= normal_i2c,
+	.probe		= probe,
+	.ignore		= ignore,
+	.force		= force,
 };
 
 /* ---------------------------------------------------------------------- */
drivers/media/video/tuner-core.c +4 -7
@@ -28,10 +28,8 @@
 /* standard i2c insmod options */
 static unsigned short normal_i2c[] = {
 	0x4b, /* tda8290 */
-	I2C_CLIENT_END
-};
-static unsigned short normal_i2c_range[] = {
-	0x60, 0x6f,
+	0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+	0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
 	I2C_CLIENT_END
 };
 I2C_CLIENT_INSMOD;
@@ -225,9 +223,8 @@ static int tuner_attach(struct i2c_adapt
 static int tuner_probe(struct i2c_adapter *adap)
 {
 	if (0 != addr) {
-		normal_i2c[0]       = addr;
-		normal_i2c_range[0] = addr;
-		normal_i2c_range[1] = addr;
+		normal_i2c[0] = addr;
+		normal_i2c[1] = I2C_CLIENT_END;
 	}
 	this_adap = 0;
 
drivers/media/video/tvaudio.c +0 -1
@@ -148,7 +148,6 @@ static unsigned short normal_i2c[] = {
 	I2C_TDA9874   >> 1,
 	I2C_PIC16C54  >> 1,
 	I2C_CLIENT_END };
-static unsigned short normal_i2c_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 static struct i2c_driver driver;
drivers/media/video/tveeprom.c +0 -1
@@ -482,7 +482,6 @@ static unsigned short normal_i2c[] = {
 	0xa0 >> 1,
 	I2C_CLIENT_END,
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 struct i2c_driver i2c_driver_tveeprom;
drivers/media/video/vpx3220.c +0 -6
@@ -569,21 +569,15 @@ static unsigned short normal_i2c[] =
     { I2C_VPX3220 >> 1, (I2C_VPX3220 >> 1) + 4,
 	I2C_CLIENT_END
 };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
 static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
 static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.normal_i2c_range	= normal_i2c_range,
 	.probe			= probe,
-	.probe_range		= probe_range,
 	.ignore			= ignore,
-	.ignore_range		= ignore_range,
 	.force			= force
 };
 
drivers/video/matrox/matroxfb_maven.c +0 -1
@@ -1230,7 +1230,6 @@ static int maven_shutdown_client(struct 
 }
 
 static unsigned short normal_i2c[] = { MAVEN_I2CID, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { MAVEN_I2CID, MAVEN_I2CID, I2C_CLIENT_END };
 I2C_CLIENT_INSMOD;
 
 static struct i2c_driver maven_driver;
include/linux/i2c.h +0 -12
@@ -290,11 +290,8 @@ static inline void i2c_set_adapdata (str
  */
 struct i2c_client_address_data {
 	unsigned short *normal_i2c;
-	unsigned short *normal_i2c_range;
 	unsigned short *probe;
-	unsigned short *probe_range;
 	unsigned short *ignore;
-	unsigned short *ignore_range;
 	unsigned short *force;
 };
 
@@ -563,24 +560,15 @@ union i2c_smbus_data {
 #define I2C_CLIENT_INSMOD \
   I2C_CLIENT_MODULE_PARM(probe, \
                       "List of adapter,address pairs to scan additionally"); \
-  I2C_CLIENT_MODULE_PARM(probe_range, \
-                      "List of adapter,start-addr,end-addr triples to scan " \
-                      "additionally"); \
   I2C_CLIENT_MODULE_PARM(ignore, \
                       "List of adapter,address pairs not to scan"); \
-  I2C_CLIENT_MODULE_PARM(ignore_range, \
-                      "List of adapter,start-addr,end-addr triples not to " \
-                      "scan"); \
   I2C_CLIENT_MODULE_PARM(force, \
                       "List of adapter,address pairs to boldly assume " \
                       "to be present"); \
 	static struct i2c_client_address_data addr_data = {		\
 			.normal_i2c = 		normal_i2c,		\
-			.normal_i2c_range =	normal_i2c_range,	\
 			.probe =		probe,			\
-			.probe_range =		probe_range,		\
 			.ignore =		ignore,			\
-			.ignore_range =		ignore_range,		\
 			.force =		force,			\
 		}
 
author
#2 lore raw

PATCH 1/1 I2C: i2c-vid.h: Support for VID to reg conversion

[PATCH] I2C: i2c-vid.h: Support for VID to reg conversion

Adds conversion from VID (mV) to register value. Used by the atxp1 I2C module. Removed uneeded switch case.

---
commit 3886246a257e828248ce1e72ced00408a3557f0d
tree ef1a71bf68f653b277de964d5c3156c90f21cd2f
parent 792f156d61d327671f58829dc04ad5609152e393
author Sebastian Witt <[email protected]> Wed, 13 Apr 2005 22:25:39 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:49 -0700

 include/linux/i2c-vid.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
include/linux/i2c-vid.h +12 -0
@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, 
 		                     2050 - (val) * 50);
 	}
 }
+
+static inline int vid_to_reg(int val, int vrm)
+{
+	switch (vrm) {
+	case 91:		/* VRM 9.1 */
+	case 90:		/* VRM 9.0 */
+		return ((val >= 1100) && (val <= 1850) ?
+			((18499 - val * 10) / 25 + 5) / 10 : -1);
+	default:
+		return -1;
+	}
+}
author
#3 lore raw

PATCH 1/1 I2C: Merge unused address lists in some video drivers

[PATCH] I2C: Merge unused address lists in some video drivers

On top of my previous patch which removes the use of address ranges in video i2c drivers, this one can save an additional few bytes of memory. Most of these drivers which do not use I2C_CLIENT_INSMOD initialize the unused address lists in a less than optimal way. This patch simply optimizes this, by using a single one-element list instead of 3 different lists with two elements each.

This saves an average 63 bytes on these drivers.

diff -ruN linux-2.6.12-rc1-bk5.orig/drivers/media/video/adv7170.c linux-2.6.12-rc1-bk5/drivers/media/video/adv7170.c

---
commit 68cc9d0b714d7d533c0cfc257a62f7f7f4f22a11
tree 616ee332d4a489598141512cbc01f591e1e84dec
parent b3d5496ea5915fa4848fe307af9f7097f312e932
author Jean Delvare <[email protected]> Sat, 02 Apr 2005 20:04:41 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:49 -0700

 drivers/media/video/adv7170.c    |   10 ++++------
 drivers/media/video/adv7175.c    |   10 ++++------
 drivers/media/video/bt819.c      |   10 ++++------
 drivers/media/video/bt856.c      |   10 ++++------
 drivers/media/video/saa7110.c    |   10 ++++------
 drivers/media/video/saa7111.c    |   10 ++++------
 drivers/media/video/saa7114.c    |   10 ++++------
 drivers/media/video/saa7185.c    |   10 ++++------
 drivers/media/video/tuner-3036.c |   10 ++++------
 drivers/media/video/vpx3220.c    |   10 ++++------
 10 files changed, 40 insertions(+), 60 deletions(-)
drivers/media/video/adv7170.c +4 -6
@@ -385,15 +385,13 @@ static unsigned short normal_i2c[] =
 	I2C_CLIENT_END
 };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_adv7170;
drivers/media/video/adv7175.c +4 -6
@@ -435,15 +435,13 @@ static unsigned short normal_i2c[] =
 	I2C_CLIENT_END
 };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_adv7175;
drivers/media/video/bt819.c +4 -6
@@ -501,15 +501,13 @@ static unsigned short normal_i2c[] = {
 	I2C_CLIENT_END,
 };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_bt819;
drivers/media/video/bt856.c +4 -6
@@ -289,15 +289,13 @@ bt856_command (struct i2c_client *client
  */
 static unsigned short normal_i2c[] = { I2C_BT856 >> 1, I2C_CLIENT_END };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_bt856;
drivers/media/video/saa7110.c +4 -6
@@ -464,15 +464,13 @@ static unsigned short normal_i2c[] = {
 	I2C_CLIENT_END
 };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_saa7110;
drivers/media/video/saa7111.c +4 -6
@@ -483,15 +483,13 @@ saa7111_command (struct i2c_client *clie
  */
 static unsigned short normal_i2c[] = { I2C_SAA7111 >> 1, I2C_CLIENT_END };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_saa7111;
drivers/media/video/saa7114.c +4 -6
@@ -821,15 +821,13 @@ saa7114_command (struct i2c_client *clie
 static unsigned short normal_i2c[] =
     { I2C_SAA7114 >> 1, I2C_SAA7114A >> 1, I2C_CLIENT_END };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_saa7114;
drivers/media/video/saa7185.c +4 -6
@@ -381,15 +381,13 @@ saa7185_command (struct i2c_client *clie
  */
 static unsigned short normal_i2c[] = { I2C_SAA7185 >> 1, I2C_CLIENT_END };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver i2c_driver_saa7185;
drivers/media/video/tuner-3036.c +4 -6
@@ -35,15 +35,13 @@ static struct i2c_client client_template
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = { 0x60, 0x61, I2C_CLIENT_END };
-static unsigned short probe[2]        = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2]       = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2]        = { I2C_CLIENT_END, I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c	= normal_i2c,
-	.probe		= probe,
-	.ignore		= ignore,
-	.force		= force,
+	.probe		= &ignore,
+	.ignore		= &ignore,
+	.force		= &ignore,
 };
 
 /* ---------------------------------------------------------------------- */
drivers/media/video/vpx3220.c +4 -6
@@ -570,15 +570,13 @@ static unsigned short normal_i2c[] =
 	I2C_CLIENT_END
 };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
 	.normal_i2c		= normal_i2c,
-	.probe			= probe,
-	.ignore			= ignore,
-	.force			= force
+	.probe			= &ignore,
+	.ignore			= &ignore,
+	.force			= &ignore,
 };
 
 static struct i2c_driver vpx3220_i2c_driver;
author
#4 lore raw

PATCH 1/1 I2C: rtc8564.c remove duplicate include

[PATCH] I2C: rtc8564.c remove duplicate include

[PATCH] I2C rtc8564.c remove duplicate include

Trivial fix: removes duplicate include line.

---
commit 792f156d61d327671f58829dc04ad5609152e393
tree 4dd7af551142c79867620b20e3f8d91dfa402529
parent 68cc9d0b714d7d533c0cfc257a62f7f7f4f22a11
author Clemens Koller <[email protected]> Mon, 11 Apr 2005 11:49:14 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:49 -0700

 drivers/i2c/chips/rtc8564.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/i2c/chips/rtc8564.c +0 -1
@@ -19,7 +19,6 @@
 #include <linux/string.h>
 #include <linux/rtc.h>		/* get the user-level API */
 #include <linux/init.h>
-#include <linux/init.h>
 
 #include "rtc8564.h"
 
author
#5 lore raw

PATCH 1/1 I2C: ds1337 1/4

[PATCH] I2C: ds1337 1/4

Use i2c_transfer to send message, so we get proper bus locking.

---
commit 3e9d0ba1305cd7c6efd2ab3a003e58a27da1796b
tree bdbcf0d4fca8ed72cb59ae89fa9e513bd2c3da3e
parent 69113efac29e5f1b7a03dd4fdca5ede6901f4eb8
author Ladislav Michl <[email protected]> Fri, 08 Apr 2005 15:00:21 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:50 -0700

 drivers/i2c/chips/ds1337.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/i2c/chips/ds1337.c +3 -5
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2005 James Chapman <[email protected]>
  *
- *	based on linux/drivers/acron/char/pcf8583.c
+ *	based on linux/drivers/acorn/char/pcf8583.c
  *  Copyright (C) 2000 Russell King
  *
  * This program is free software; you can redistribute it and/or modify
@@ -119,8 +119,7 @@ static int ds1337_get_datetime(struct i2
 	msg[1].len = sizeof(buf);
 	msg[1].buf = &buf[0];
 
-	result = client->adapter->algo->master_xfer(client->adapter,
-						    &msg[0], 2);
+	result = i2c_transfer(client->adapter, msg, 2);
 
 	dev_dbg(&client->adapter->dev,
 		"%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n",
@@ -194,8 +193,7 @@ static int ds1337_set_datetime(struct i2
 	msg[0].len = sizeof(buf);
 	msg[0].buf = &buf[0];
 
-	result = client->adapter->algo->master_xfer(client->adapter,
-						    &msg[0], 1);
+	result = i2c_transfer(client->adapter, msg, 1);
 	if (result < 0) {
 		dev_err(&client->adapter->dev, "ds1337[%d]: error "
 			"writing data! %d\n", data->id, result);
author
#6 lore raw

PATCH 1/1 I2C: mark all functions static in atxp1 driver

[PATCH] I2C: mark all functions static in atxp1 driver

---
commit 69113efac29e5f1b7a03dd4fdca5ede6901f4eb8
tree 5decc38a1b2f5ede2f8d987c1f749f28a5432556
parent 9cb7d18433ea6db04b3999e8d0b8f52fba551c2d
author Greg K-H <[email protected]> Tue, 05 Apr 2005 18:00:47 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:50 -0700

 drivers/i2c/chips/atxp1.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/i2c/chips/atxp1.c +6 -6
@@ -99,7 +99,7 @@ static struct atxp1_data * atxp1_update_
 }
 
 /* sys file functions for cpu0_vid */
-ssize_t atxp1_showvcore(struct device *dev, char *buf)
+static ssize_t atxp1_showvcore(struct device *dev, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -111,7 +111,7 @@ ssize_t atxp1_showvcore(struct device *d
 	return size;
 }
 
-ssize_t atxp1_storevcore(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storevcore(struct device *dev, const char* buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
@@ -169,7 +169,7 @@ ssize_t atxp1_storevcore(struct device *
 static DEVICE_ATTR(cpu0_vid, S_IRUGO | S_IWUSR, atxp1_showvcore, atxp1_storevcore);
 
 /* sys file functions for GPIO1 */
-ssize_t atxp1_showgpio1(struct device *dev, char *buf)
+static ssize_t atxp1_showgpio1(struct device *dev, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -181,7 +181,7 @@ ssize_t atxp1_showgpio1(struct device *d
 	return size;
 }
 
-ssize_t atxp1_storegpio1(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storegpio1(struct device *dev, const char* buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
@@ -211,7 +211,7 @@ ssize_t atxp1_storegpio1(struct device *
 static DEVICE_ATTR(gpio1, S_IRUGO | S_IWUSR, atxp1_showgpio1, atxp1_storegpio1);
 
 /* sys file functions for GPIO2 */
-ssize_t atxp1_showgpio2(struct device *dev, char *buf)
+static ssize_t atxp1_showgpio2(struct device *dev, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -223,7 +223,7 @@ ssize_t atxp1_showgpio2(struct device *d
 	return size;
 }
 
-ssize_t atxp1_storegpio2(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storegpio2(struct device *dev, const char* buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
author
#7 lore raw

PATCH 1/1 I2C: add new atxp1 driver

[PATCH] I2C: add new atxp1 driver

Adds support for the Attansic ATXP1 I2C device, found on some x86 plattforms to change CPU and other voltages. Depends on the previous i2c-vid.h patch.

---
commit 9cb7d18433ea6db04b3999e8d0b8f52fba551c2d
tree 0feff7401b43c5b3b2def0ae64db8f6c385a596b
parent 3886246a257e828248ce1e72ced00408a3557f0d
author Sebastian Witt <[email protected]> Wed, 13 Apr 2005 22:27:53 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:50 -0700

 drivers/i2c/chips/Kconfig  |   13 ++
 drivers/i2c/chips/Makefile |    1 
 drivers/i2c/chips/atxp1.c  |  361 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 375 insertions(+), 0 deletions(-)
drivers/i2c/chips/Kconfig +13 -0
@@ -62,6 +62,19 @@ config SENSORS_ASB100
 	  This driver can also be built as a module.  If so, the module
 	  will be called asb100.
 
+config SENSORS_ATXP1
+	tristate "Attansic ATXP1 VID controller"
+	depends on I2C && EXPERIMENTAL
+	help
+	  If you say yes here you get support for the Attansic ATXP1 VID
+	  controller.
+
+	  If your board have such a chip, you are able to control your CPU
+	  core and other voltages.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called atxp1.
+
 config SENSORS_DS1621
 	tristate "Dallas Semiconductor DS1621 and DS1625"
 	depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021
 obj-$(CONFIG_SENSORS_ADM1025)	+= adm1025.o
 obj-$(CONFIG_SENSORS_ADM1026)	+= adm1026.o
 obj-$(CONFIG_SENSORS_ADM1031)	+= adm1031.o
+obj-$(CONFIG_SENSORS_ATXP1)	+= atxp1.o
 obj-$(CONFIG_SENSORS_DS1337)	+= ds1337.o
 obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
drivers/i2c/chips/atxp1.c new file +361 -0

361 lines not on this page · raw message

author
#8 lore raw

PATCH 1/1 I2C: ds1337: i2c_transfer() checking

[PATCH] I2C: ds1337: i2c_transfer() checking

i2c_transfer returns number of sucessfully transfered messages. Change error checking to accordingly. (ds1337_set_datetime never returned sucess)

---
commit 00588243053bb40d0406c7843833f8fae81294ab
tree abf967a76d51f002a878ce6e6544c0b1c6cde62e
parent 0b46e334d77b2d3b8b3aa665c81c4afbe9f1f458
author Ladislav Michl <[email protected]> Wed, 04 May 2005 08:13:54 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:51 -0700

 drivers/i2c/chips/ds1337.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
drivers/i2c/chips/ds1337.c +9 -12
@@ -122,7 +122,7 @@ static int ds1337_get_datetime(struct i2
 		__FUNCTION__, result, buf[0], buf[1], buf[2], buf[3],
 		buf[4], buf[5], buf[6]);
 
-	if (result >= 0) {
+	if (result == 2) {
 		dt->tm_sec = BCD2BIN(buf[0]);
 		dt->tm_min = BCD2BIN(buf[1]);
 		val = buf[2] & 0x3f;
@@ -140,12 +140,12 @@ static int ds1337_get_datetime(struct i2
 			__FUNCTION__, dt->tm_sec, dt->tm_min,
 			dt->tm_hour, dt->tm_mday,
 			dt->tm_mon, dt->tm_year, dt->tm_wday);
-	} else {
-		dev_err(&client->dev, "error reading data! %d\n", result);
-		result = -EIO;
+
+		return 0;
 	}
 
-	return result;
+	dev_err(&client->dev, "error reading data! %d\n", result);
+	return -EIO;
 }
 
 static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
@@ -185,14 +185,11 @@ static int ds1337_set_datetime(struct i2
 	msg[0].buf = &buf[0];
 
 	result = i2c_transfer(client->adapter, msg, 1);
-	if (result < 0) {
-		dev_err(&client->dev, "error writing data! %d\n", result);
-		result = -EIO;
-	} else {
-		result = 0;
-	}
+	if (result == 1)
+		return 0;
 
-	return result;
+	dev_err(&client->dev, "error writing data! %d\n", result);
+	return -EIO;
 }
 
 static int ds1337_command(struct i2c_client *client, unsigned int cmd,
author
#9 lore raw

PATCH 1/1 I2C: ds1337: Make time format consistent with other RTC drivers

[PATCH] I2C: ds1337: Make time format consistent with other RTC drivers

Make time format consistent with other RTC drivers.

---
commit 0b46e334d77b2d3b8b3aa665c81c4afbe9f1f458
tree ecf82d1aa2a4416835a082500970df3784e1194e
parent d01b79d0613ebb6810bb48baf6e53e9319701fea
author Ladislav Michl <[email protected]> Wed, 04 May 2005 08:13:13 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:51 -0700

 drivers/i2c/chips/ds1337.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
drivers/i2c/chips/ds1337.c +6 -7
@@ -130,8 +130,8 @@ static int ds1337_get_datetime(struct i2
 		dt->tm_wday = BCD2BIN(buf[3]) - 1;
 		dt->tm_mday = BCD2BIN(buf[4]);
 		val = buf[5] & 0x7f;
-		dt->tm_mon = BCD2BIN(val);
-		dt->tm_year = 1900 + BCD2BIN(buf[6]);
+		dt->tm_mon = BCD2BIN(val) - 1;
+		dt->tm_year = BCD2BIN(buf[6]);
 		if (buf[5] & 0x80)
 			dt->tm_year += 100;
 
@@ -171,12 +171,11 @@ static int ds1337_set_datetime(struct i2
 	buf[3] = BIN2BCD(dt->tm_hour) | (1 << 6);
 	buf[4] = BIN2BCD(dt->tm_wday) + 1;
 	buf[5] = BIN2BCD(dt->tm_mday);
-	buf[6] = BIN2BCD(dt->tm_mon);
-	if (dt->tm_year >= 2000) {
-		val = dt->tm_year - 2000;
+	buf[6] = BIN2BCD(dt->tm_mon) + 1;
+	val = dt->tm_year;
+	if (val >= 100) {
+		val -= 100;
 		buf[6] |= (1 << 7);
-	} else {
-		val = dt->tm_year - 1900;
 	}
 	buf[7] = BIN2BCD(val);
 
author
#10 lore raw

PATCH 1/1 I2C: ds1337 2/4

[PATCH] I2C: ds1337 2/4

Use correct macros to convert between bdc and bin. See linux/bcd.h

---
commit 6069ffde15472da9d041a58df490d388bb175d51
tree 0e1b536969aafe6bb3a9a567be46a61b8be91886
parent 3e9d0ba1305cd7c6efd2ab3a003e58a27da1796b
author Ladislav Michl <[email protected]> Fri, 08 Apr 2005 15:02:16 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:51 -0700

 drivers/i2c/chips/ds1337.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
drivers/i2c/chips/ds1337.c +14 -14
@@ -127,15 +127,15 @@ static int ds1337_get_datetime(struct i2
 		buf[4], buf[5], buf[6]);
 
 	if (result >= 0) {
-		dt->tm_sec = BCD_TO_BIN(buf[0]);
-		dt->tm_min = BCD_TO_BIN(buf[1]);
+		dt->tm_sec = BCD2BIN(buf[0]);
+		dt->tm_min = BCD2BIN(buf[1]);
 		val = buf[2] & 0x3f;
-		dt->tm_hour = BCD_TO_BIN(val);
-		dt->tm_wday = BCD_TO_BIN(buf[3]) - 1;
-		dt->tm_mday = BCD_TO_BIN(buf[4]);
+		dt->tm_hour = BCD2BIN(val);
+		dt->tm_wday = BCD2BIN(buf[3]) - 1;
+		dt->tm_mday = BCD2BIN(buf[4]);
 		val = buf[5] & 0x7f;
-		dt->tm_mon = BCD_TO_BIN(val);
-		dt->tm_year = 1900 + BCD_TO_BIN(buf[6]);
+		dt->tm_mon = BCD2BIN(val);
+		dt->tm_year = 1900 + BCD2BIN(buf[6]);
 		if (buf[5] & 0x80)
 			dt->tm_year += 100;
 
@@ -174,19 +174,19 @@ static int ds1337_set_datetime(struct i2
 		dt->tm_mday, dt->tm_mon, dt->tm_year, dt->tm_wday);
 
 	buf[0] = 0;		/* reg offset */
-	buf[1] = BIN_TO_BCD(dt->tm_sec);
-	buf[2] = BIN_TO_BCD(dt->tm_min);
-	buf[3] = BIN_TO_BCD(dt->tm_hour) | (1 << 6);
-	buf[4] = BIN_TO_BCD(dt->tm_wday) + 1;
-	buf[5] = BIN_TO_BCD(dt->tm_mday);
-	buf[6] = BIN_TO_BCD(dt->tm_mon);
+	buf[1] = BIN2BCD(dt->tm_sec);
+	buf[2] = BIN2BCD(dt->tm_min);
+	buf[3] = BIN2BCD(dt->tm_hour) | (1 << 6);
+	buf[4] = BIN2BCD(dt->tm_wday) + 1;
+	buf[5] = BIN2BCD(dt->tm_mday);
+	buf[6] = BIN2BCD(dt->tm_mon);
 	if (dt->tm_year >= 2000) {
 		val = dt->tm_year - 2000;
 		buf[6] |= (1 << 7);
 	} else {
 		val = dt->tm_year - 1900;
 	}
-	buf[7] = BIN_TO_BCD(val);
+	buf[7] = BIN2BCD(val);
 
 	msg[0].addr = client->addr;
 	msg[0].flags = 0;
author
#11 lore raw

PATCH 1/1 I2C: ds1337 3/4

[PATCH] I2C: ds1337 3/4

dev_{dbg,err} functions should print client's device name. data->id can be dropped from message, because device is determined by bus it hangs on (it has fixed address).

---
commit d01b79d0613ebb6810bb48baf6e53e9319701fea
tree 49f92093fae3b372011b1f2855cf581d9a1ad1e4
parent 6069ffde15472da9d041a58df490d388bb175d51
author Ladislav Michl <[email protected]> Fri, 08 Apr 2005 15:06:39 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:51 -0700

 drivers/i2c/chips/ds1337.c |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)
drivers/i2c/chips/ds1337.c +8 -17
@@ -95,7 +95,6 @@ static inline int ds1337_read(struct i2c
  */
 static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt)
 {
-	struct ds1337_data *data = i2c_get_clientdata(client);
 	int result;
 	u8 buf[7];
 	u8 val;
@@ -103,9 +102,7 @@ static int ds1337_get_datetime(struct i2
 	u8 offs = 0;
 
 	if (!dt) {
-		dev_dbg(&client->adapter->dev, "%s: EINVAL: dt=NULL\n",
-			__FUNCTION__);
-
+		dev_dbg(&client->dev, "%s: EINVAL: dt=NULL\n", __FUNCTION__);
 		return -EINVAL;
 	}
 
@@ -121,8 +118,7 @@ static int ds1337_get_datetime(struct i2
 
 	result = i2c_transfer(client->adapter, msg, 2);
 
-	dev_dbg(&client->adapter->dev,
-		"%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n",
+	dev_dbg(&client->dev, "%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n",
 		__FUNCTION__, result, buf[0], buf[1], buf[2], buf[3],
 		buf[4], buf[5], buf[6]);
 
@@ -139,14 +135,13 @@ static int ds1337_get_datetime(struct i2
 		if (buf[5] & 0x80)
 			dt->tm_year += 100;
 
-		dev_dbg(&client->adapter->dev, "%s: secs=%d, mins=%d, "
+		dev_dbg(&client->dev, "%s: secs=%d, mins=%d, "
 			"hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n",
 			__FUNCTION__, dt->tm_sec, dt->tm_min,
 			dt->tm_hour, dt->tm_mday,
 			dt->tm_mon, dt->tm_year, dt->tm_wday);
 	} else {
-		dev_err(&client->adapter->dev, "ds1337[%d]: error reading "
-			"data! %d\n", data->id, result);
+		dev_err(&client->dev, "error reading data! %d\n", result);
 		result = -EIO;
 	}
 
@@ -155,20 +150,17 @@ static int ds1337_get_datetime(struct i2
 
 static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
 {
-	struct ds1337_data *data = i2c_get_clientdata(client);
 	int result;
 	u8 buf[8];
 	u8 val;
 	struct i2c_msg msg[1];
 
 	if (!dt) {
-		dev_dbg(&client->adapter->dev, "%s: EINVAL: dt=NULL\n",
-			__FUNCTION__);
-
+		dev_dbg(&client->dev, "%s: EINVAL: dt=NULL\n", __FUNCTION__);
 		return -EINVAL;
 	}
 
-	dev_dbg(&client->adapter->dev, "%s: secs=%d, mins=%d, hours=%d, "
+	dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, "
 		"mday=%d, mon=%d, year=%d, wday=%d\n", __FUNCTION__,
 		dt->tm_sec, dt->tm_min, dt->tm_hour,
 		dt->tm_mday, dt->tm_mon, dt->tm_year, dt->tm_wday);
@@ -195,8 +187,7 @@ static int ds1337_set_datetime(struct i2
 
 	result = i2c_transfer(client->adapter, msg, 1);
 	if (result < 0) {
-		dev_err(&client->adapter->dev, "ds1337[%d]: error "
-			"writing data! %d\n", data->id, result);
+		dev_err(&client->dev, "error writing data! %d\n", result);
 		result = -EIO;
 	} else {
 		result = 0;
@@ -208,7 +199,7 @@ static int ds1337_set_datetime(struct i2
 static int ds1337_command(struct i2c_client *client, unsigned int cmd,
 			  void *arg)
 {
-	dev_dbg(&client->adapter->dev, "%s: cmd=%d\n", __FUNCTION__, cmd);
+	dev_dbg(&client->dev, "%s: cmd=%d\n", __FUNCTION__, cmd);
 
 	switch (cmd) {
 	case DS1337_GET_DATE:
author
#12 lore raw

PATCH 1/1 I2C: ds1337: search by bus number

[PATCH] I2C: ds1337: search by bus number

Chip is searched by bus number rather than its own proprietary id.

---
commit 86919833dbeac668762ae7056ead2d35d070f622
tree 5c704a3c8fb85f44cde1102d7e6f09508427be4d
parent 00588243053bb40d0406c7843833f8fae81294ab
author Ladislav Michl <[email protected]> Wed, 04 May 2005 08:14:38 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:52 -0700

 drivers/i2c/chips/ds1337.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/i2c/chips/ds1337.c +2 -5
@@ -69,13 +69,11 @@ static struct i2c_driver ds1337_driver =
 struct ds1337_data {
 	struct i2c_client client;
 	struct list_head list;
-	int id;
 };
 
 /*
  * Internal variables
  */
-static int ds1337_id;
 static LIST_HEAD(ds1337_clients);
 
 static inline int ds1337_read(struct i2c_client *client, u8 reg, u8 *value)
@@ -213,7 +211,7 @@ static int ds1337_command(struct i2c_cli
  * Public API for access to specific device. Useful for low-level
  * RTC access from kernel code.
  */
-int ds1337_do_command(int id, int cmd, void *arg)
+int ds1337_do_command(int bus, int cmd, void *arg)
 {
 	struct list_head *walk;
 	struct list_head *tmp;
@@ -221,7 +219,7 @@ int ds1337_do_command(int id, int cmd, v
 
 	list_for_each_safe(walk, tmp, &ds1337_clients) {
 		data = list_entry(walk, struct ds1337_data, list);
-		if (data->id == id)
+		if (data->client.adapter->nr == bus)
 			return ds1337_command(&data->client, cmd, arg);
 	}
 
@@ -331,7 +329,6 @@ static int ds1337_detect(struct i2c_adap
 	ds1337_init_client(new_client);
 
 	/* Add client to local list */
-	data->id = ds1337_id++;
 	list_add(&data->list, &ds1337_clients);
 
 	return 0;
author
#13 lore raw

PATCH 1/1 ds1337 driver works also with ds1339 chip

[PATCH] ds1337 driver works also with ds1339 chip

Quoted 3 lines · Jean Delvare

Additionally, I would welcome an additional patch documenting the fact that the ds1337 driver will work fine with the Dallas DS1339 real-time clock chip.

Document the fact that ds1337 driver works also with DS1339 real-time clock chip.

---
commit 912b9c0c52b95696165e84d67fdab2af81a2213e
tree a5f560a549354680bd68991e29a15380306650c4
parent 86919833dbeac668762ae7056ead2d35d070f622
author Ladislav Michl <[email protected]> Tue, 10 May 2005 14:08:04 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:52 -0700

 drivers/i2c/chips/Kconfig  |    4 ++--
 drivers/i2c/chips/ds1337.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/chips/Kconfig +2 -2
@@ -379,12 +379,12 @@ menu "Other I2C Chip support"
 	depends on I2C
 
 config SENSORS_DS1337
-	tristate "Dallas Semiconductor DS1337 Real Time Clock"
+	tristate "Dallas Semiconductor DS1337 and DS1339 Real Time Clock"
 	depends on I2C && EXPERIMENTAL
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for Dallas Semiconductor
-	  DS1337 real-time clock chips. 
+	  DS1337 and DS1339 real-time clock chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called ds1337.
drivers/i2c/chips/ds1337.c +1 -1
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- * Driver for Dallas Semiconductor DS1337 real time clock chip
+ * Driver for Dallas Semiconductor DS1337 and DS1339 real time clock chip
  */
 
 #include <linux/config.h>
author
#14 lore raw

PATCH 1/1 ds1337: export ds1337_do_command

[PATCH] ds1337: export ds1337_do_command

---
commit da17838c5e7256976c34c5d051dc8fb3c6f364b7
tree 179d41ec3c1e01263cae06cee297ebcf35769aa7
parent 912b9c0c52b95696165e84d67fdab2af81a2213e
author Ladislav Michl <[email protected]> Wed, 11 May 2005 10:32:54 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:52 -0700

 drivers/i2c/chips/ds1337.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/i2c/chips/ds1337.c +2 -0
@@ -380,5 +380,7 @@ MODULE_AUTHOR("James Chapman <jchapman@k
 MODULE_DESCRIPTION("DS1337 RTC driver");
 MODULE_LICENSE("GPL");
 
+EXPORT_SYMBOL_GPL(ds1337_do_command);
+
 module_init(ds1337_init);
 module_exit(ds1337_exit);
author
#15 lore raw

PATCH 1/1 I2C: add new hardware monitor driver: adm9240

[PATCH] I2C: add new hardware monitor driver: adm9240

Completion of Michiel Rook's port of adm9240 to 2.6 with addition of auto fan clock divider based on Jean Delvare's algorithm, and replaces scaling macros with static inlines.

---
commit 40b5cda28aafe3744d8808c21f7959e472a9ecb1
tree cd332f677f3c7855fcd026300cf284af08d0846b
parent a551ef79d9413727f76d22dc47b5b15d1d03073b
author Grant Coady <[email protected]> Sat, 30 Apr 2005 21:41:29 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:53 -0700

 drivers/i2c/chips/Kconfig   |   11 +
 drivers/i2c/chips/Makefile  |    1 
 drivers/i2c/chips/adm9240.c |  768 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 780 insertions(+), 0 deletions(-)
drivers/i2c/chips/Kconfig +11 -0
@@ -51,6 +51,17 @@ config SENSORS_ADM1031
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1031.
 
+config SENSORS_ADM9240
+	tristate "Analog Devices ADM9240 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for Analog Devices ADM9240,
+	  Dallas DS1780, National Semiconductor LM81 sensor chips.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called adm9240.
+
 config SENSORS_ASB100
 	tristate "Asus ASB100 Bach"
 	depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021
 obj-$(CONFIG_SENSORS_ADM1025)	+= adm1025.o
 obj-$(CONFIG_SENSORS_ADM1026)	+= adm1026.o
 obj-$(CONFIG_SENSORS_ADM1031)	+= adm1031.o
+obj-$(CONFIG_SENSORS_ADM9240)	+= adm9240.o
 obj-$(CONFIG_SENSORS_ATXP1)	+= atxp1.o
 obj-$(CONFIG_SENSORS_DS1337)	+= ds1337.o
 obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
drivers/i2c/chips/adm9240.c new file +768 -0

768 lines not on this page · raw message

author
#16 lore raw

PATCH 1/1 I2C: #include <linux/config.h> cleanup

[PATCH] I2C: #include <linux/config.h> cleanup

Hi Alexey,

Quoted 4 lines

Files that don't use CONFIG_* stuff shouldn't include config.h Files that use CONFIG_* stuff should include config.h

It's that simple. ;-)

I agree. This won't change anything though, as all drivers include either device.h or module.h, which in turn include config.h. But you are still correct, so I approve your patch.

For completeness, I would propose the following on top of your own patch:

i2c bus drivers do not need to define DEBUG themselves, as the Kconfig system takes care of it.

---
commit a551ef79d9413727f76d22dc47b5b15d1d03073b
tree 4b43e032dc6b6cb5de78ce700b12762ab71483e0
parent f0bb60e7b1a0a26c25d8cbf81dda7afbc8bd2982
author Jean Delvare <[email protected]> Sat, 16 Apr 2005 18:49:22 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:53 -0700

 drivers/i2c/busses/i2c-ixp2000.c |    5 -----
 drivers/i2c/busses/i2c-ixp4xx.c  |    5 -----
 2 files changed, 0 insertions(+), 10 deletions(-)
drivers/i2c/busses/i2c-ixp2000.c +0 -5
@@ -26,11 +26,6 @@
  * 'enabled' to drive the GPIOs.
  */
 
-#include <linux/config.h>
-#ifdef CONFIG_I2C_DEBUG_BUS
-#define DEBUG	1
-#endif
-
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
drivers/i2c/busses/i2c-ixp4xx.c +0 -5
@@ -26,11 +26,6 @@
  *       that is passed as the platform_data to this driver.
  */
 
-#include <linux/config.h>
-#ifdef CONFIG_I2C_DEBUG_BUS
-#define DEBUG	1
-#endif
-
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/device.h>
author
#17 lore raw

PATCH 1/1 I2C: drivers/i2c/*: #include <linux/config.h> cleanup

[PATCH] I2C: drivers/i2c/*: #include <linux/config.h> cleanup

Files that don't use CONFIG_* stuff shouldn't include config.h Files that use CONFIG_* stuff should include config.h

It's that simple. ;-)

---
commit f0bb60e7b1a0a26c25d8cbf81dda7afbc8bd2982
tree 93dc5302d0299e8167c2affc1d65a705219c0d88
parent da17838c5e7256976c34c5d051dc8fb3c6f364b7
author Alexey Dobriyan <[email protected]> Sat, 16 Apr 2005 18:10:02 +0000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:53 -0700

 drivers/i2c/algos/i2c-algo-sibyte.c    |    1 -
 drivers/i2c/busses/i2c-ali1535.c       |    1 -
 drivers/i2c/busses/i2c-ali15x3.c       |    1 -
 drivers/i2c/busses/i2c-amd756.c        |    1 -
 drivers/i2c/busses/i2c-amd8111.c       |    1 -
 drivers/i2c/busses/i2c-au1550.c        |    1 -
 drivers/i2c/busses/i2c-elektor.c       |    1 -
 drivers/i2c/busses/i2c-frodo.c         |    1 -
 drivers/i2c/busses/i2c-i801.c          |    1 -
 drivers/i2c/busses/i2c-i810.c          |    1 -
 drivers/i2c/busses/i2c-ibm_iic.h       |    1 -
 drivers/i2c/busses/i2c-isa.c           |    1 -
 drivers/i2c/busses/i2c-ite.c           |    1 -
 drivers/i2c/busses/i2c-keywest.c       |    1 -
 drivers/i2c/busses/i2c-nforce2.c       |    1 -
 drivers/i2c/busses/i2c-parport-light.c |    1 -
 drivers/i2c/busses/i2c-parport.c       |    1 -
 drivers/i2c/busses/i2c-pca-isa.c       |    1 -
 drivers/i2c/busses/i2c-piix4.c         |    1 -
 drivers/i2c/busses/i2c-prosavage.c     |    1 -
 drivers/i2c/busses/i2c-rpx.c           |    1 -
 drivers/i2c/busses/i2c-s3c2410.c       |    1 +
 drivers/i2c/busses/i2c-savage4.c       |    1 -
 drivers/i2c/busses/i2c-sibyte.c        |    1 -
 drivers/i2c/busses/i2c-sis5595.c       |    1 -
 drivers/i2c/busses/i2c-sis630.c        |    1 -
 drivers/i2c/busses/i2c-sis96x.c        |    1 -
 drivers/i2c/busses/i2c-stub.c          |    1 -
 drivers/i2c/busses/i2c-via.c           |    1 -
 drivers/i2c/busses/i2c-viapro.c        |    1 -
 drivers/i2c/busses/i2c-voodoo3.c       |    1 -
 drivers/i2c/busses/scx200_acb.c        |    1 -
 drivers/i2c/chips/adm1021.c            |    1 -
 drivers/i2c/chips/adm1025.c            |    1 -
 drivers/i2c/chips/adm1026.c            |    1 -
 drivers/i2c/chips/ds1337.c             |    1 -
 drivers/i2c/chips/eeprom.c             |    1 -
 drivers/i2c/chips/fscher.c             |    1 -
 drivers/i2c/chips/gl518sm.c            |    1 -
 drivers/i2c/chips/it87.c               |    1 -
 drivers/i2c/chips/lm63.c               |    1 -
 drivers/i2c/chips/lm75.c               |    1 -
 drivers/i2c/chips/lm77.c               |    1 -
 drivers/i2c/chips/lm78.c               |    1 -
 drivers/i2c/chips/lm80.c               |    1 -
 drivers/i2c/chips/lm83.c               |    1 -
 drivers/i2c/chips/lm85.c               |    1 -
 drivers/i2c/chips/lm87.c               |    1 -
 drivers/i2c/chips/lm90.c               |    1 -
 drivers/i2c/chips/max1619.c            |    1 -
 drivers/i2c/chips/pc87360.c            |    1 -
 drivers/i2c/chips/via686a.c            |    1 -
 drivers/i2c/chips/w83781d.c            |    1 -
 drivers/i2c/chips/w83l785ts.c          |    1 -
 drivers/i2c/i2c-core.c                 |    1 -
 drivers/i2c/i2c-dev.c                  |    1 -
 56 files changed, 1 insertions(+), 55 deletions(-)
drivers/i2c/algos/i2c-algo-sibyte.c +0 -1
@@ -24,7 +24,6 @@
 
 /* Ported for SiByte SOCs by Broadcom Corporation.  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-ali1535.c +0 -1
@@ -53,7 +53,6 @@
 
 /* Note: we assume there can only be one ALI1535, with one SMBus interface */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-ali15x3.c +0 -1
@@ -60,7 +60,6 @@
 
 /* Note: we assume there can only be one ALI15X3, with one SMBus interface */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-amd756.c +0 -1
@@ -37,7 +37,6 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-amd8111.c +0 -1
@@ -8,7 +8,6 @@
  * the Free Software Foundation version 2.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-au1550.c +0 -1
@@ -27,7 +27,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <linux/config.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
drivers/i2c/busses/i2c-elektor.c +0 -1
@@ -25,7 +25,6 @@
 /* Partialy rewriten by Oleg I. Vdovikin for mmapped support of 
    for Alpha Processor Inc. UP-2000(+) boards */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
drivers/i2c/busses/i2c-frodo.c +0 -1
@@ -12,7 +12,6 @@
  * version 2 as published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-i801.c +0 -1
@@ -41,7 +41,6 @@
 
 /* Note: we assume there can only be one I801, with one SMBus interface */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-i810.c +0 -1
@@ -34,7 +34,6 @@
    i815			1132           
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-ibm_iic.h +0 -1
@@ -22,7 +22,6 @@
 #ifndef __I2C_IBM_IIC_H_
 #define __I2C_IBM_IIC_H_
 
-#include <linux/config.h>
 #include <linux/i2c.h> 
 
 struct iic_regs {
drivers/i2c/busses/i2c-isa.c +0 -1
@@ -24,7 +24,6 @@
    the SMBus and the ISA bus very much easier. See lm78.c for an example
    of this. */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-ite.c +0 -1
@@ -33,7 +33,6 @@
 /* With some changes from Kyösti Mälkki <[email protected]> and even
    Frodo Looijaard <[email protected]> */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
drivers/i2c/busses/i2c-keywest.c +0 -1
@@ -46,7 +46,6 @@
     sound driver to be happy
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
drivers/i2c/busses/i2c-nforce2.c +0 -1
@@ -37,7 +37,6 @@
 
 /* Note: we assume there can only be one nForce2, with two SMBus interfaces */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-parport-light.c +0 -1
@@ -24,7 +24,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  * ------------------------------------------------------------------------ */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-parport.c +0 -1
@@ -24,7 +24,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  * ------------------------------------------------------------------------ */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-pca-isa.c +0 -1
@@ -17,7 +17,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/module.h>
drivers/i2c/busses/i2c-piix4.c +0 -1
@@ -28,7 +28,6 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/pci.h>
drivers/i2c/busses/i2c-prosavage.c +0 -1
@@ -54,7 +54,6 @@
  *    (Additional documentation needed :(
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
drivers/i2c/busses/i2c-rpx.c +0 -1
@@ -11,7 +11,6 @@
  * changed to eliminate RPXLite references.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-s3c2410.c +1 -0
@@ -20,6 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
drivers/i2c/busses/i2c-savage4.c +0 -1
@@ -29,7 +29,6 @@
    it easier to add later.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/i2c-sibyte.c +0 -1
@@ -17,7 +17,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/i2c-algo-sibyte.h>
 #include <asm/sibyte/sb1250_regs.h>
drivers/i2c/busses/i2c-sis5595.c +0 -1
@@ -55,7 +55,6 @@
  * Add adapter resets
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
drivers/i2c/busses/i2c-sis630.c +0 -1
@@ -48,7 +48,6 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
drivers/i2c/busses/i2c-sis96x.c +0 -1
@@ -32,7 +32,6 @@
     We assume there can only be one SiS96x with one SMBus interface.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-stub.c +0 -1
@@ -21,7 +21,6 @@
 
 #define DEBUG 1
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
drivers/i2c/busses/i2c-via.c +0 -1
@@ -21,7 +21,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
drivers/i2c/busses/i2c-viapro.c +0 -1
@@ -33,7 +33,6 @@
    Note: we assume there can only be one device, with one SMBus interface.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
drivers/i2c/busses/i2c-voodoo3.c +0 -1
@@ -27,7 +27,6 @@
 /* This interfaces to the I2C bus of the Voodoo3 to gain access to
     the BT869 and possibly other I2C devices. */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
drivers/i2c/busses/scx200_acb.c +0 -1
@@ -24,7 +24,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
drivers/i2c/chips/adm1021.c +0 -1
@@ -19,7 +19,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/adm1025.c +0 -1
@@ -45,7 +45,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/adm1026.c +0 -1
@@ -23,7 +23,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/ds1337.c +0 -1
@@ -13,7 +13,6 @@
  * Driver for Dallas Semiconductor DS1337 and DS1339 real time clock chip
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/eeprom.c +0 -1
@@ -26,7 +26,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
drivers/i2c/chips/fscher.c +0 -1
@@ -26,7 +26,6 @@
  *  and Philip Edelbrock <[email protected]>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/gl518sm.c +0 -1
@@ -36,7 +36,6 @@
  * 2004-01-31  Code review and approval. (Jean Delvare)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/it87.c +0 -1
@@ -31,7 +31,6 @@
     type at module load time.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm63.c +0 -1
@@ -37,7 +37,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm75.c +0 -1
@@ -18,7 +18,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm77.c +0 -1
@@ -25,7 +25,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm78.c +0 -1
@@ -18,7 +18,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm80.c +0 -1
@@ -21,7 +21,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm83.c +0 -1
@@ -27,7 +27,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm85.c +0 -1
@@ -23,7 +23,6 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm87.c +0 -1
@@ -52,7 +52,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/lm90.c +0 -1
@@ -70,7 +70,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/max1619.c +0 -1
@@ -26,7 +26,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/pc87360.c +0 -1
@@ -33,7 +33,6 @@
  *  the standard Super-I/O addresses is used (0x2E/0x2F or 0x4E/0x4F).
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/via686a.c +0 -1
@@ -30,7 +30,6 @@
     Warning - only supports a single device.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
drivers/i2c/chips/w83781d.c +0 -1
@@ -35,7 +35,6 @@
 
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
drivers/i2c/chips/w83l785ts.c +0 -1
@@ -30,7 +30,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/init.h>
drivers/i2c/i2c-core.c +0 -1
@@ -21,7 +21,6 @@
    All SMBus-related things are written by Frodo Looijaard <[email protected]>
    SMBus 2.0 support by Mark Studebaker <[email protected]>                */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
drivers/i2c/i2c-dev.c +0 -1
@@ -29,7 +29,6 @@
 /* The devfs code is contributed by Philipp Matthias Hahn 
    <[email protected]> */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
author
#18 lore raw

PATCH 1/1 I2C: New hardware monitoring driver: w83627ehf

[PATCH] I2C: New hardware monitoring driver: w83627ehf

This is a new hardware monitoring driver, w83627ehf, which supports the Winbond W83627EHF Super-I/O chip. The driver is not complete, but already usable. It only implements fan speed and temperature monitoring, while the chip also supports voltage inputs with VID, PWM output and temperature sensor selection. I have no more time to work on this, but anyone with supported hardware could add the missing functionalities later.

This driver is largely derived from the w83627hf driver.

Thanks to Leon Moonen and Steve Cliffe for tesing the preliminary versions of my driver and reporting the problems they encountered.

Thanks to Grant Coady for noticing and fixing various corner cases in the fan management. This third version of the driver hopefully addresses all the issues the original version had.

---
commit 08e7e2789e0da49eadeb17121e24af22efeee84b
tree 0e7edd2ffc4ad0a3b1e5c5fe070fb1bc460696cf
parent 40b5cda28aafe3744d8808c21f7959e472a9ecb1
author Jean Delvare <[email protected]> Mon, 25 Apr 2005 22:43:25 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:54 -0700

 drivers/i2c/chips/Kconfig     |   14 +
 drivers/i2c/chips/Makefile    |    1 
 drivers/i2c/chips/w83627ehf.c |  839 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 854 insertions(+), 0 deletions(-)
drivers/i2c/chips/Kconfig +14 -0
@@ -384,6 +384,20 @@ config SENSORS_W83627HF
 	  This driver can also be built as a module.  If so, the module
 	  will be called w83627hf.
 
+config SENSORS_W83627EHF
+	tristate "Winbond W83627EHF"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	select I2C_ISA
+	help
+	  If you say yes here you get preliminary support for the hardware
+	  monitoring functionality of the Winbond W83627EHF Super-I/O chip.
+	  Only fan and temperature inputs are supported at the moment, while
+	  the chip does much more than that.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called w83627ehf.
+
 endmenu
 
 menu "Other I2C Chip support"
drivers/i2c/chips/Makefile +1 -0
@@ -41,6 +41,7 @@ obj-$(CONFIG_SENSORS_SIS5595)	+= sis5595
 obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
 obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
+obj-$(CONFIG_SENSORS_W83627EHF)	+= w83627ehf.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 
drivers/i2c/chips/w83627ehf.c new file +839 -0

839 lines not on this page · raw message

author
#19 lore raw

PATCH 1/1 I2C: Fix bugs in the new w83627ehf driver

[PATCH] I2C: Fix bugs in the new w83627ehf driver

These are the fixes for the bug you spotted in my new w83627ehf driver:
- Explicit division by 0.

---
commit b9110b1c893f45ec66ae39e359decdfad84525be
tree 0fcb89b2f770df7995445b4e74251549bea6baf6
parent 08e7e2789e0da49eadeb17121e24af22efeee84b
author Jean Delvare <[email protected]> Mon, 02 May 2005 23:08:22 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:54 -0700

 drivers/i2c/chips/w83627ehf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/chips/w83627ehf.c +1 -1
@@ -450,7 +450,7 @@ store_fan_min(struct device *dev, const 
 		data->fan_min[nr] = 1;
 		new_div = 0; /* 1 == (1 << 0) */
 		dev_warn(dev, "fan%u low limit %u above maximum %u, set to "
-			 "maximum\n", nr + 1, val, fan_from_reg(1, 0));
+			 "maximum\n", nr + 1, val, fan_from_reg(1, 1));
 	} else {
 		/* Automatically pick the best divider, i.e. the one such
 		   that the min limit will correspond to a register value
author
#20 lore raw

PATCH 1/1 I2C: Add support for the LPC47M15x and LPC47M192 chips to smsc47m1

[PATCH] I2C: Add support for the LPC47M15x and LPC47M192 chips to smsc47m1

This simple patch adds support for the SMSC LPC47M15x and LPC47M192 chips to the smsc47m1 hardware monitoring driver. These chips are compatible with the other ones already supported by the driver, so I see no reason not to support them, especially when the Linux 2.4 version of the driver does already.

I also modified the info printks to name the chips by their real name.

---
commit ec5ce552d946a55c1e504054627c9068fb7afb8a
tree 88a4ff89a92939fbc6da3b92d80a6025a3351432
parent b9110b1c893f45ec66ae39e359decdfad84525be
author Jean Delvare <[email protected]> Tue, 26 Apr 2005 22:09:43 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:54 -0700

 drivers/i2c/chips/Kconfig    |    2 +-
 drivers/i2c/chips/smsc47m1.c |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/i2c/chips/Kconfig +1 -1
@@ -331,7 +331,7 @@ config SENSORS_SMSC47M1
 	help
 	  If you say yes here you get support for the integrated fan
 	  monitoring and control capabilities of the SMSC LPC47B27x,
-	  LPC47M10x, LPC47M13x and LPC47M14x chips.
+	  LPC47M10x, LPC47M13x, LPC47M14x, LPC47M15x and LPC47M192 chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called smsc47m1.
drivers/i2c/chips/smsc47m1.c +6 -4
@@ -372,14 +372,16 @@ static int smsc47m1_find(int *address)
 	 * SMSC LPC47M10x/LPC47M13x (device id 0x59), LPC47M14x (device id
 	 * 0x5F) and LPC47B27x (device id 0x51) have fan control.
 	 * The LPC47M15x and LPC47M192 chips "with hardware monitoring block"
-	 * can do much more besides (device id 0x60, unsupported).
+	 * can do much more besides (device id 0x60).
 	 */
 	if (val == 0x51)
-		printk(KERN_INFO "smsc47m1: Found SMSC47B27x\n");
+		printk(KERN_INFO "smsc47m1: Found SMSC LPC47B27x\n");
 	else if (val == 0x59)
-		printk(KERN_INFO "smsc47m1: Found SMSC47M10x/SMSC47M13x\n");
+		printk(KERN_INFO "smsc47m1: Found SMSC LPC47M10x/LPC47M13x\n");
 	else if (val == 0x5F)
-		printk(KERN_INFO "smsc47m1: Found SMSC47M14x\n");
+		printk(KERN_INFO "smsc47m1: Found SMSC LPC47M14x\n");
+	else if (val == 0x60)
+		printk(KERN_INFO "smsc47m1: Found SMSC LPC47M15x/LPC47M192\n");
 	else {
 		superio_exit();
 		return -ENODEV;
author
#21 lore raw

PATCH 1/1 I2C: Allow for sharing of the interrupt line for i2c-mpc.c

[PATCH] I2C: Allow for sharing of the interrupt line for i2c-mpc.c

I2C-MPC: Allow for sharing of the interrupt line

On the MPC8548 devices we have multiple I2C-MPC buses however they are on the same interrupt line. Made request_irq pass SA_SHIRQ now so the second bus can register for the same IRQ.

---
commit 30aedcb33970367e50b5edf373e9cd1a5cebcbe1
tree 8b94e494c2fd0d8c874500bc1b0733eef64d831b
parent 44bbe87e9017efa050bb1b506c6822f1f3bb94d7
author Kumar Gala <[email protected]> Tue, 03 May 2005 18:50:38 -0500 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:55 -0700

 drivers/i2c/busses/i2c-mpc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-mpc.c +2 -2
@@ -325,7 +325,7 @@ static int __devinit mpc_i2c_probe(struc
 	if (i2c->irq != OCP_IRQ_NA)
 	{
 		if ((result = request_irq(ocp->def->irq, mpc_i2c_isr,
-					  0, "i2c-mpc", i2c)) < 0) {
+					  SA_SHIRQ, "i2c-mpc", i2c)) < 0) {
 			printk(KERN_ERR
 			       "i2c-mpc - failed to attach interrupt\n");
 			goto fail_irq;
@@ -424,7 +424,7 @@ static int fsl_i2c_probe(struct device *
 
 	if (i2c->irq != 0)
 		if ((result = request_irq(i2c->irq, mpc_i2c_isr,
-					  0, "fsl-i2c", i2c)) < 0) {
+					  SA_SHIRQ, "i2c-mpc", i2c)) < 0) {
 			printk(KERN_ERR
 			       "i2c-mpc - failed to attach interrupt\n");
 			goto fail_irq;
author
#22 lore raw

PATCH 1/1 Spelling fixes for drivers/i2c.

[PATCH] Spelling fixes for drivers/i2c.

Here are some spelling corrections for drivers/i2c.

occured -> occurred
intialization -> initialization
Everytime -> Every time
transfering -> transferring
relevent -> relevant
continous -> continuous
neccessary -> necessary
explicitely -> explicitly
Celcius -> Celsius
differenciate -> differentiate

---
commit 44bbe87e9017efa050bb1b506c6822f1f3bb94d7
tree 62656712b3707592fb8fb8e152a200e71dbbb150
parent ec5ce552d946a55c1e504054627c9068fb7afb8a
author Steven Cole <[email protected]> Tue, 03 May 2005 18:21:25 -0600 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:55 -0700

 drivers/i2c/algos/i2c-algo-pca.c |    4 ++--
 drivers/i2c/busses/i2c-ibm_iic.c |    2 +-
 drivers/i2c/busses/i2c-iop3xx.c  |    2 +-
 drivers/i2c/busses/i2c-s3c2410.c |    2 +-
 drivers/i2c/chips/adm1031.c      |    2 +-
 drivers/i2c/chips/ds1621.c       |    4 ++--
 drivers/i2c/chips/it87.c         |    4 ++--
 drivers/i2c/chips/lm63.c         |    4 ++--
 drivers/i2c/chips/lm78.c         |    4 ++--
 drivers/i2c/chips/lm83.c         |    2 +-
 drivers/i2c/chips/lm90.c         |    8 ++++----
 11 files changed, 19 insertions(+), 19 deletions(-)
drivers/i2c/algos/i2c-algo-pca.c +2 -2
@@ -49,7 +49,7 @@ static int i2c_debug=0;
 /*
  * Generate a start condition on the i2c bus.
  *
- * returns after the start condition has occured
+ * returns after the start condition has occurred
  */
 static void pca_start(struct i2c_algo_pca_data *adap)
 {
@@ -64,7 +64,7 @@ static void pca_start(struct i2c_algo_pc
 /*
  * Generate a repeated start condition on the i2c bus 
  *
- * return after the repeated start condition has occured
+ * return after the repeated start condition has occurred
  */
 static void pca_repeated_start(struct i2c_algo_pca_data *adap)
 {
drivers/i2c/busses/i2c-ibm_iic.c +1 -1
@@ -695,7 +695,7 @@ static int __devinit iic_probe(struct oc
 
 	dev->irq = iic_force_poll ? -1 : ocp->def->irq;
 	if (dev->irq >= 0){
-		/* Disable interrupts until we finish intialization,
+		/* Disable interrupts until we finish initialization,
 		   assumes level-sensitive IRQ setup...
 		 */
 		iic_interrupt_mode(dev, 0);
drivers/i2c/busses/i2c-iop3xx.c +1 -1
@@ -85,7 +85,7 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx
 	u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;
 
 	/* 
-	 * Everytime unit enable is asserted, GPOD needs to be cleared
+	 * Every time unit enable is asserted, GPOD needs to be cleared
 	 * on IOP321 to avoid data corruption on the bus.
 	 */
 #ifdef CONFIG_ARCH_IOP321
drivers/i2c/busses/i2c-s3c2410.c +1 -1
@@ -534,7 +534,7 @@ static int s3c24xx_i2c_doxfer(struct s3c
 /* s3c24xx_i2c_xfer
  *
  * first port of call from the i2c bus code when an message needs
- * transfering across the i2c bus.
+ * transferring across the i2c bus.
 */
 
 static int s3c24xx_i2c_xfer(struct i2c_adapter *adap,
drivers/i2c/chips/adm1031.c +1 -1
@@ -440,7 +440,7 @@ pwm_reg(2);
 
 /*
  * That function checks the cases where the fan reading is not
- * relevent.  It is used to provide 0 as fan reading when the fan is
+ * relevant.  It is used to provide 0 as fan reading when the fan is
  * not supposed to run
  */
 static int trust_fan_readings(struct adm1031_data *data, int chan)
drivers/i2c/chips/ds1621.c +2 -2
@@ -121,7 +121,7 @@ static int ds1621_write_value(struct i2c
 static void ds1621_init_client(struct i2c_client *client)
 {
 	int reg = ds1621_read_value(client, DS1621_REG_CONF);
-	/* switch to continous conversion mode */
+	/* switch to continuous conversion mode */
 	reg &= ~ DS1621_REG_CONFIG_1SHOT;
 
 	/* setup output polarity */
@@ -303,7 +303,7 @@ static struct ds1621_data *ds1621_update
 		data->temp_max = ds1621_read_value(client,
 						    DS1621_REG_TEMP_MAX);
 
-		/* reset alarms if neccessary */
+		/* reset alarms if necessary */
 		new_conf = data->conf;
 		if (data->temp < data->temp_min)
 			new_conf &= ~DS1621_ALARM_TEMP_LOW;
drivers/i2c/chips/it87.c +2 -2
@@ -953,7 +953,7 @@ static int it87_detach_client(struct i2c
 	return 0;
 }
 
-/* The SMBus locks itself, but ISA access must be locked explicitely! 
+/* The SMBus locks itself, but ISA access must be locked explicitly! 
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
@@ -973,7 +973,7 @@ static int it87_read_value(struct i2c_cl
 		return i2c_smbus_read_byte_data(client, reg);
 }
 
-/* The SMBus locks itself, but ISA access muse be locked explicitely! 
+/* The SMBus locks itself, but ISA access muse be locked explicitly! 
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
drivers/i2c/chips/lm63.c +2 -2
@@ -98,9 +98,9 @@ SENSORS_INSMOD_1(lm63);
  * Conversions and various macros
  * For tachometer counts, the LM63 uses 16-bit values.
  * For local temperature and high limit, remote critical limit and hysteresis
- * value, it uses signed 8-bit values with LSB = 1 degree Celcius.
+ * value, it uses signed 8-bit values with LSB = 1 degree Celsius.
  * For remote temperature, low and high limits, it uses signed 11-bit values
- * with LSB = 0.125 degree Celcius, left-justified in 16-bit registers.
+ * with LSB = 0.125 degree Celsius, left-justified in 16-bit registers.
  */
 
 #define FAN_FROM_REG(reg)	((reg) == 0xFFFC || (reg) == 0 ? 0 : \
drivers/i2c/chips/lm78.c +2 -2
@@ -670,7 +670,7 @@ static int lm78_detach_client(struct i2c
 	return 0;
 }
 
-/* The SMBus locks itself, but ISA access must be locked explicitely! 
+/* The SMBus locks itself, but ISA access must be locked explicitly! 
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,
@@ -689,7 +689,7 @@ static int lm78_read_value(struct i2c_cl
 		return i2c_smbus_read_byte_data(client, reg);
 }
 
-/* The SMBus locks itself, but ISA access muse be locked explicitely! 
+/* The SMBus locks itself, but ISA access muse be locked explicitly! 
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the LM78 BUSY flag at this moment - it could lead to deadlocks,
drivers/i2c/chips/lm83.c +1 -1
@@ -80,7 +80,7 @@ SENSORS_INSMOD_1(lm83);
 
 /*
  * Conversions and various macros
- * The LM83 uses signed 8-bit values with LSB = 1 degree Celcius.
+ * The LM83 uses signed 8-bit values with LSB = 1 degree Celsius.
  */
 
 #define TEMP_FROM_REG(val)	((val) * 1000)
drivers/i2c/chips/lm90.c +4 -4
@@ -19,7 +19,7 @@
  * Complete datasheets can be obtained from National's website at:
  *   http://www.national.com/pf/LM/LM89.html
  *   http://www.national.com/pf/LM/LM99.html
- * Note that there is no way to differenciate between both chips.
+ * Note that there is no way to differentiate between both chips.
  *
  * This driver also supports the LM86, another sensor chip made by
  * National Semiconductor. It is exactly similar to the LM90 except it
@@ -39,7 +39,7 @@
  * chips made by Maxim. These chips are similar to the LM86. Complete
  * datasheet can be obtained at Maxim's website at:
  *   http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
- * Note that there is no easy way to differenciate between the three
+ * Note that there is no easy way to differentiate between the three
  * variants. The extra address and features of the MAX6659 are not
  * supported by this driver.
  *
@@ -138,9 +138,9 @@ SENSORS_INSMOD_6(lm90, adm1032, lm99, lm
 /*
  * Conversions and various macros
  * For local temperatures and limits, critical limits and the hysteresis
- * value, the LM90 uses signed 8-bit values with LSB = 1 degree Celcius.
+ * value, the LM90 uses signed 8-bit values with LSB = 1 degree Celsius.
  * For remote temperatures and limits, it uses signed 11-bit values with
- * LSB = 0.125 degree Celcius, left-justified in 16-bit registers.
+ * LSB = 0.125 degree Celsius, left-justified in 16-bit registers.
  */
 
 #define TEMP1_FROM_REG(val)	((val) * 1000)
author
#23 lore raw

PATCH 1/1 I2C: Remove redundancy from i2c-core.c

[PATCH] I2C: Remove redundancy from i2c-core.c

Call i2c_transfer() from i2c_master_send() and i2c_master_recv() to avoid the redundant code that was in all three functions. It also removes unnecessary debug statements as suggested by Jean Delvare.

This is important for the non-blocking interfaces because they will have to handle a non-blocking interface in this area. Having it in one place greatly simplifies the changes.

---
commit 815f55f280fb2781ba1c2a350516b73e55119c60
tree 48c06bd1650d44aa274989ce2696eb5091d3805c
parent 30aedcb33970367e50b5edf373e9cd1a5cebcbe1
author Jean Delvare <[email protected]> Sat, 07 May 2005 22:58:46 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:55 -0700

 drivers/i2c/i2c-core.c |   64 +++++++++++++++---------------------------------
 1 files changed, 20 insertions(+), 44 deletions(-)
drivers/i2c/i2c-core.c +20 -44
@@ -611,27 +611,16 @@ int i2c_master_send(struct i2c_client *c
 	struct i2c_adapter *adap=client->adapter;
 	struct i2c_msg msg;
 
-	if (client->adapter->algo->master_xfer) {
-		msg.addr   = client->addr;
-		msg.flags = client->flags & I2C_M_TEN;
-		msg.len = count;
-		msg.buf = (char *)buf;
+	msg.addr = client->addr;
+	msg.flags = client->flags & I2C_M_TEN;
+	msg.len = count;
+	msg.buf = (char *)buf;
 	
-		dev_dbg(&client->adapter->dev, "master_send: writing %d bytes.\n",
-			count);
-	
-		down(&adap->bus_lock);
-		ret = adap->algo->master_xfer(adap,&msg,1);
-		up(&adap->bus_lock);
-
-		/* if everything went ok (i.e. 1 msg transmitted), return #bytes
-		 * transmitted, else error code.
-		 */
-		return (ret == 1 )? count : ret;
-	} else {
-		dev_err(&client->adapter->dev, "I2C level transfers not supported\n");
-		return -ENOSYS;
-	}
+	ret = i2c_transfer(adap, &msg, 1);
+
+	/* If everything went ok (i.e. 1 msg transmitted), return #bytes
+	   transmitted, else error code. */
+	return (ret == 1) ? count : ret;
 }
 
 int i2c_master_recv(struct i2c_client *client, char *buf ,int count)
@@ -639,31 +628,18 @@ int i2c_master_recv(struct i2c_client *c
 	struct i2c_adapter *adap=client->adapter;
 	struct i2c_msg msg;
 	int ret;
-	if (client->adapter->algo->master_xfer) {
-		msg.addr   = client->addr;
-		msg.flags = client->flags & I2C_M_TEN;
-		msg.flags |= I2C_M_RD;
-		msg.len = count;
-		msg.buf = buf;
 
-		dev_dbg(&client->adapter->dev, "master_recv: reading %d bytes.\n",
-			count);
-	
-		down(&adap->bus_lock);
-		ret = adap->algo->master_xfer(adap,&msg,1);
-		up(&adap->bus_lock);
-	
-		dev_dbg(&client->adapter->dev, "master_recv: return:%d (count:%d, addr:0x%02x)\n",
-			ret, count, client->addr);
-	
-		/* if everything went ok (i.e. 1 msg transmitted), return #bytes
-	 	* transmitted, else error code.
-	 	*/
-		return (ret == 1 )? count : ret;
-	} else {
-		dev_err(&client->adapter->dev, "I2C level transfers not supported\n");
-		return -ENOSYS;
-	}
+	msg.addr = client->addr;
+	msg.flags = client->flags & I2C_M_TEN;
+	msg.flags |= I2C_M_RD;
+	msg.len = count;
+	msg.buf = buf;
+
+	ret = i2c_transfer(adap, &msg, 1);
+
+	/* If everything went ok (i.e. 1 msg transmitted), return #bytes
+	   transmitted, else error code. */
+	return (ret == 1) ? count : ret;
 }
 
 
author
#24 lore raw

PATCH 1/1 I2C: sysfs names: rename to cpu0_vid, take 3

[PATCH] I2C: sysfs names: rename to cpu0_vid, take 3

This small patch changes two drivers, adm1025 and adm1026, to report vid as cpu0_vid sysfs name as used by the other drivers.

Added duplicated names and six month warning for old names to be removed as requested. Compile tested.

---
commit 937df8df907ce63b0f7e19adf6e3cdef1687fac3
tree 4ac2a146290bcda4c741fa82b3a09e2d42f773b5
parent abc01922477104e8d72b494902aff37135c409e7
author Grant Coady <[email protected]> Thu, 12 May 2005 11:59:29 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:56 -0700

 Documentation/feature-removal-schedule.txt |   10 ++++++++++
 drivers/i2c/chips/adm1025.c                |    4 ++++
 drivers/i2c/chips/adm1026.c                |    5 ++++-
 3 files changed, 18 insertions(+), 1 deletions(-)
Documentation/feature-removal-schedule.txt +10 -0
@@ -83,3 +83,13 @@ Why:	Deprecated in favour of the new ioc
 	more efficient.  You should really be using libraw1394 for raw1394
 	access anyway.
 Who:	Jody McIntyre <[email protected]>
+
+---------------------------
+
+What:	i2c sysfs name change: in1_ref, vid deprecated in favour of cpu0_vid
+When:	November 2005
+Files:	drivers/i2c/chips/adm1025.c, drivers/i2c/chips/adm1026.c
+Why:	Match the other drivers' name for the same function, duplicate names
+	will be available until removal of old names.
+Who:	Grant Coady <[email protected]>
+
drivers/i2c/chips/adm1025.c +4 -0
@@ -286,7 +286,9 @@ static ssize_t show_vid(struct device *d
 	struct adm1025_data *data = adm1025_update_device(dev);
 	return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm));
 }
+/* in1_ref is deprecated in favour of cpu0_vid, remove after 2005-11-11 */
 static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL);
+static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 
 static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
 {
@@ -436,7 +438,9 @@ static int adm1025_detect(struct i2c_ada
 	device_create_file(&new_client->dev, &dev_attr_temp1_max);
 	device_create_file(&new_client->dev, &dev_attr_temp2_max);
 	device_create_file(&new_client->dev, &dev_attr_alarms);
+	/* in1_ref is deprecated, remove after 2005-11-11 */
 	device_create_file(&new_client->dev, &dev_attr_in1_ref);
+	device_create_file(&new_client->dev, &dev_attr_cpu0_vid);
 	device_create_file(&new_client->dev, &dev_attr_vrm);
 
 	/* Pin 11 is either in4 (+12V) or VID4 */
drivers/i2c/chips/adm1026.c +4 -1
@@ -1224,8 +1224,9 @@ static ssize_t show_vid_reg(struct devic
 	struct adm1026_data *data = adm1026_update_device(dev);
 	return sprintf(buf,"%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));
 }
-
+/* vid deprecated in favour of cpu0_vid, remove after 2005-11-11 */
 static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL);
+static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
 
 static ssize_t show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf)
 {
@@ -1665,7 +1666,9 @@ int adm1026_detect(struct i2c_adapter *a
 	device_create_file(&new_client->dev, &dev_attr_temp1_crit_enable);
 	device_create_file(&new_client->dev, &dev_attr_temp2_crit_enable);
 	device_create_file(&new_client->dev, &dev_attr_temp3_crit_enable);
+	/* vid deprecated in favour of cpu0_vid, remove after 2005-11-11 */
 	device_create_file(&new_client->dev, &dev_attr_vid);
+	device_create_file(&new_client->dev, &dev_attr_cpu0_vid);
 	device_create_file(&new_client->dev, &dev_attr_vrm);
 	device_create_file(&new_client->dev, &dev_attr_alarms);
 	device_create_file(&new_client->dev, &dev_attr_alarm_mask);
author
#25 lore raw

PATCH 1/1 I2C: Setting w83627hf fan divisor 128 fails.

[PATCH] I2C: Setting w83627hf fan divisor 128 fails.

Jarkko Lavinen provided patch to fix: "couldn't set the divisor 128 through fan1_div sysfs entry even though the chip supports it and setting divisors 1..64 worked. This was due to POWER_TO_REG() only checking 2's powers 0 till 5 but not 6."

This patch applies that fix to w83627hf and w83781d drivers.

---
commit abc01922477104e8d72b494902aff37135c409e7
tree 7ef178b1a14e89c88bac1a976c238c91fc1697ee
parent b9826b3ee8faa468a26782e3bf37716a73d96730
author Grant Coady <[email protected]> Thu, 12 May 2005 13:41:51 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:56 -0700

 drivers/i2c/chips/w83627hf.c |    2 +-
 drivers/i2c/chips/w83781d.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/chips/w83627hf.c +1 -1
@@ -264,7 +264,7 @@ static inline u8 DIV_TO_REG(long val)
 {
 	int i;
 	val = SENSORS_LIMIT(val, 1, 128) >> 1;
-	for (i = 0; i < 6; i++) {
+	for (i = 0; i < 7; i++) {
 		if (val == 0)
 			break;
 		val >>= 1;
drivers/i2c/chips/w83781d.c +1 -1
@@ -192,7 +192,7 @@ DIV_TO_REG(long val, enum chips type)
 	val = SENSORS_LIMIT(val, 1,
 			    ((type == w83781d
 			      || type == as99127f) ? 8 : 128)) >> 1;
-	for (i = 0; i < 6; i++) {
+	for (i = 0; i < 7; i++) {
 		if (val == 0)
 			break;
 		val >>= 1;
author
#26 lore raw

PATCH 1/1 I2C: remove <linux/delay.h> from via686a

[PATCH] I2C: remove <linux/delay.h> from via686a

In my cross-reference checking of sysfs names, the via686a needs special case treatment as it the only driver expands S_IWUSR to 00200 with gcc -E. (00200 is the correct value for S_IWUSR).

This is caused by the driver including <linux/delay.h>, it compiles fine without that header but I am unable to test drive the change.

---
commit b9826b3ee8faa468a26782e3bf37716a73d96730
tree e714c037b2862cf8c592311c09958ffba818259d
parent 815f55f280fb2781ba1c2a350516b73e55119c60
author Grant Coady <[email protected]> Fri, 06 May 2005 17:40:51 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:56 -0700

 drivers/i2c/chips/via686a.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/i2c/chips/via686a.c +0 -1
@@ -33,7 +33,6 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
-#include <linux/delay.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
author
#27 lore raw

PATCH 1/1 I2C: Kill common macro abuse in chip drivers

[PATCH] I2C: Kill common macro abuse in chip drivers

This patch kills a common macro abuse in i2c chip drivers: defining ALARMS_FROM_REG returning its argument unchanged. Dropping the macro makes the code somewhat more readable IMHO.

---
commit 68188ba7de2db9999ff08a4544a78b2f10eb08bd
tree 37e0406d7f2b6ace2bc73043bda0c745d3aa5e37
parent ff3240946d6a3d9f2ecf273f7330e09eec5484eb
author Jean Delvare <[email protected]> Mon, 16 May 2005 18:52:38 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:57 -0700

 drivers/i2c/chips/asb100.c  |    4 +---
 drivers/i2c/chips/it87.c    |    4 +---
 drivers/i2c/chips/lm85.c    |    4 +---
 drivers/i2c/chips/via686a.c |    4 +---
 drivers/i2c/chips/w83781d.c |    3 +--
 5 files changed, 5 insertions(+), 14 deletions(-)
drivers/i2c/chips/asb100.c +1 -3
@@ -169,8 +169,6 @@ static int ASB100_PWM_FROM_REG(u8 reg)
 	return reg * 16;
 }
 
-#define ALARMS_FROM_REG(val) (val)
-
 #define DIV_FROM_REG(val) (1 << (val))
 
 /* FAN DIV: 1, 2, 4, or 8 (defaults to 2)
@@ -557,7 +555,7 @@ device_create_file(&client->dev, &dev_at
 static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct asb100_data *data = asb100_update_device(dev);
-	return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
+	return sprintf(buf, "%u\n", data->alarms);
 }
 
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
drivers/i2c/chips/it87.c +1 -3
@@ -172,8 +172,6 @@ static inline u8 FAN_TO_REG(long rpm, in
 					((val)+500)/1000),-128,127))
 #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000)
 
-#define ALARMS_FROM_REG(val) (val)
-
 #define PWM_TO_REG(val)   ((val) >> 1)
 #define PWM_FROM_REG(val) (((val)&0x7f) << 1)
 
@@ -665,7 +663,7 @@ show_pwm_offset(3);
 static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
+	return sprintf(buf, "%u\n", data->alarms);
 }
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
drivers/i2c/chips/lm85.c +1 -3
@@ -284,8 +284,6 @@ static int ZONE_TO_REG( int zone )
 /* i2c-vid.h defines vid_from_reg() */
 #define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm)))
 
-#define ALARMS_FROM_REG(val) (val)
-
 /* Unlike some other drivers we DO NOT set initial limits.  Use
  * the config file to set limits.  Some users have reported
  * motherboards shutting down when we set limits in a previous
@@ -480,7 +478,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUS
 static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct lm85_data *data = lm85_update_device(dev);
-	return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
+	return sprintf(buf, "%u\n", data->alarms);
 }
 
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
drivers/i2c/chips/via686a.c +1 -3
@@ -292,8 +292,6 @@ static inline long TEMP_FROM_REG10(u16 v
 	        tempLUT[eightBits + 1] * twoBits) * 25;
 }
 
-#define ALARMS_FROM_REG(val) (val)
-
 #define DIV_FROM_REG(val) (1 << (val))
 #define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1)
 
@@ -570,7 +568,7 @@ show_fan_offset(2);
 /* Alarms */
 static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms));
+	return sprintf(buf, "%u\n", data->alarms);
 }
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
drivers/i2c/chips/w83781d.c +1 -2
@@ -172,7 +172,6 @@ FAN_TO_REG(long rpm, int div)
 						: (val)) / 1000, 0, 0xff))
 #define TEMP_FROM_REG(val)		(((val) & 0x80 ? (val)-0x100 : (val)) * 1000)
 
-#define ALARMS_FROM_REG(val)		(val)
 #define PWM_FROM_REG(val)		(val)
 #define PWM_TO_REG(val)			(SENSORS_LIMIT((val),0,255))
 #define BEEP_MASK_FROM_REG(val,type)	((type) == as99127f ? \
@@ -523,7 +522,7 @@ static ssize_t
 show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct w83781d_data *data = w83781d_update_device(dev);
-	return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
+	return sprintf(buf, "%u\n", data->alarms);
 }
 
 static
author
#28 lore raw

PATCH 1/1 I2C: adm9240 driver cleanup

[PATCH] I2C: adm9240 driver cleanup

This patch adds an info print of detected VRM stolen from Sebastian Witt's atxp1 sriver. ADM9240 already has vrm accessor removed.

Write no-op and whitespace fixes removed :)

Couple of comments changed, tested on 2.6.11.9.

---
commit 8e8f9289cc5b781d583d5aed935abf060207bbd3
tree d058803efab6b2f359ca750ec50e73681da3ce8d
parent 937df8df907ce63b0f7e19adf6e3cdef1687fac3
author Grant Coady <[email protected]> Fri, 13 May 2005 20:26:10 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:57 -0700

 drivers/i2c/chips/adm9240.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/chips/adm9240.c +5 -2
@@ -165,7 +165,7 @@ struct adm9240_data {
 	s8 temp_high;		/* rw	temp1_max */
 	s8 temp_hyst;		/* rw	temp1_max_hyst */
 	u16 alarms;		/* ro	alarms */
-	u8 aout;		/* rw	analog_out */
+	u8 aout;		/* rw	aout_output */
 	u8 vid;			/* ro	vid */
 	u8 vrm;			/* --	vrm set on startup, no accessor */
 };
@@ -192,7 +192,7 @@ static ssize_t show_##value(struct devic
 }
 show_temp(temp_high, 1000);
 show_temp(temp_hyst, 1000);
-show_temp(temp, 500);
+show_temp(temp, 500); /* 0.5'C per bit */
 
 #define set_temp(value, reg)					\
 static ssize_t set_##value(struct device *dev, const char *buf,	\
@@ -630,6 +630,9 @@ static void adm9240_init_client(struct i
 
 	data->vrm = i2c_which_vrm(); /* need this to report vid as mV */
 
+	dev_info(&client->dev, "Using VRM: %d.%d\n", data->vrm / 10,
+			data->vrm % 10);
+
 	if (conf & 1) { /* measurement cycle running: report state */
 
 		dev_info(&client->dev, "status: config 0x%02x mode %u\n",
author
#29 lore raw

PATCH 1/1 I2C: include of jiffies.h for some i2c drivers

[PATCH] I2C: include of jiffies.h for some i2c drivers

This patch includes jiffies.h in two i2c drivers. (jiffies.h is needed for the time_after function.)

---
commit ff3240946d6a3d9f2ecf273f7330e09eec5484eb
tree 2bb70f76eb190a9301a7f30f264306f82363c12a
parent 8e8f9289cc5b781d583d5aed935abf060207bbd3
author Dominik Hackl <[email protected]> Mon, 16 May 2005 18:12:18 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:57 -0700

 drivers/i2c/chips/asb100.c  |    1 +
 drivers/i2c/chips/sis5595.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
drivers/i2c/chips/asb100.c +1 -0
@@ -42,6 +42,7 @@
 #include <linux/i2c-sensor.h>
 #include <linux/i2c-vid.h>
 #include <linux/init.h>
+#include <linux/jiffies.h>
 #include "lm75.h"
 
 /*
drivers/i2c/chips/sis5595.c +1 -0
@@ -57,6 +57,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/init.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 
 
author
#30 lore raw

PATCH 1/1 I2C: chips/Kconfig corrections

[PATCH] I2C: chips/Kconfig corrections

Here are some corrections for drivers/i2c/chips/Kconfig.

---
commit 057923f0f5ba346fc128ae0a1c3842d8c12bd7f0
tree 6c9cc5d15b6164988c0cb4a994cd22a8d45983c5
parent 6afe15595031bb9801af6207feed0bafc25b6e6b
author Jean Delvare <[email protected]> Tue, 17 May 2005 18:09:36 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:58 -0700

 drivers/i2c/chips/Kconfig |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/i2c/chips/Kconfig +6 -3
@@ -29,6 +29,7 @@ config SENSORS_ADM1025
 	help
 	  If you say yes here you get support for Analog Devices ADM1025
 	  and Philips NE1619 sensor chips.
+
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1025.
 
@@ -38,6 +39,8 @@ config SENSORS_ADM1026
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for Analog Devices ADM1026
+	  sensor chip.
+
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1026.
 
@@ -48,6 +51,7 @@ config SENSORS_ADM1031
 	help
 	  If you say yes here you get support for Analog Devices ADM1031 
 	  and ADM1030 sensor chips.
+
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1031.
 
@@ -198,8 +202,7 @@ config SENSORS_LM78
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for National Semiconductor LM78,
-	  LM78-J and LM79.  This can also be built as a module which can be
-	  inserted and removed while the kernel is running.
+	  LM78-J and LM79.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm78.
@@ -232,7 +235,7 @@ config SENSORS_LM85
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for National Semiconductor LM85
-	  sensor chips and clones: ADT7463 and ADM1027.
+	  sensor chips and clones: ADT7463, EMC6D100, EMC6D102 and ADM1027.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm85.
author
#31 lore raw

PATCH 1/1 I2C: driver adm1021: remove die_code

[PATCH] I2C: driver adm1021: remove die_code

This patch removes die_code from adm1021 as nothing within the driver uses it.

---
commit 6afe15595031bb9801af6207feed0bafc25b6e6b
tree 144126d9d5e1808e91e46007e5b990bf9b1f1bbc
parent be8992c249e42398ee905450688c135ab761674c
author Grant Coady <[email protected]> Tue, 17 May 2005 17:16:02 +1000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:58 -0700

 drivers/i2c/chips/adm1021.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
drivers/i2c/chips/adm1021.c +0 -8
@@ -102,8 +102,6 @@ struct adm1021_data {
 	u8	remote_temp_hyst;
 	u8	remote_temp_input;
 	u8	alarms;
-	/* special values for ADM1021 only */
-	u8	die_code;
         /* Special values for ADM1023 only */
 	u8	remote_temp_prec;
 	u8	remote_temp_os_prec;
@@ -155,7 +153,6 @@ static ssize_t show_##value(struct devic
 	return sprintf(buf, "%d\n", data->value);			\
 }
 show2(alarms);
-show2(die_code);
 
 #define set(value, reg)	\
 static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)	\
@@ -182,7 +179,6 @@ static DEVICE_ATTR(temp2_max, S_IWUSR | 
 static DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_remote_temp_hyst, set_remote_temp_hyst);
 static DEVICE_ATTR(temp2_input, S_IRUGO, show_remote_temp_input, NULL);
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
-static DEVICE_ATTR(die_code, S_IRUGO, show_die_code, NULL);
 
 
 static int adm1021_attach_adapter(struct i2c_adapter *adapter)
@@ -306,8 +302,6 @@ static int adm1021_detect(struct i2c_ada
 	device_create_file(&new_client->dev, &dev_attr_temp2_min);
 	device_create_file(&new_client->dev, &dev_attr_temp2_input);
 	device_create_file(&new_client->dev, &dev_attr_alarms);
-	if (data->type == adm1021)
-		device_create_file(&new_client->dev, &dev_attr_die_code);
 
 	return 0;
 
@@ -370,8 +364,6 @@ static struct adm1021_data *adm1021_upda
 		data->remote_temp_max = adm1021_read_value(client, ADM1021_REG_REMOTE_TOS_R);
 		data->remote_temp_hyst = adm1021_read_value(client, ADM1021_REG_REMOTE_THYST_R);
 		data->alarms = adm1021_read_value(client, ADM1021_REG_STATUS) & 0x7c;
-		if (data->type == adm1021)
-			data->die_code = adm1021_read_value(client, ADM1021_REG_DIE_CODE);
 		if (data->type == adm1023) {
 			data->remote_temp_prec = adm1021_read_value(client, ADM1021_REG_REM_TEMP_PREC);
 			data->remote_temp_os_prec = adm1021_read_value(client, ADM1021_REG_REM_TOS_PREC);
author
#32 lore raw

PATCH 1/1 I2C: Coding style cleanups to via686a

[PATCH] I2C: Coding style cleanups to via686a

The via686a hardware monitoring driver has infamous coding style at the moment. I'd like to clean up the mess before I start working on other changes to this driver. Is the following patch acceptable? No code change, only coding style (indentation, alignments, trailing white space, a few parentheses and a typo).

---
commit be8992c249e42398ee905450688c135ab761674c
tree 29f41874649a86f5616301ca78eae96b79a8c5eb
parent 68188ba7de2db9999ff08a4544a78b2f10eb08bd
author Jean Delvare <[email protected]> Mon, 16 May 2005 19:00:52 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:58 -0700

 drivers/i2c/chips/via686a.c |  274 ++++++++++++++++++++++---------------------
 1 files changed, 139 insertions(+), 135 deletions(-)
drivers/i2c/chips/via686a.c +139 -135
@@ -1,12 +1,12 @@
 /*
     via686a.c - Part of lm_sensors, Linux kernel modules
                 for hardware monitoring
-                
+
     Copyright (c) 1998 - 2002  Frodo Looijaard <[email protected]>,
                         Kyösti Mälkki <[email protected]>,
 			Mark Studebaker <[email protected]>,
 			and Bob Dougherty <[email protected]>
-    (Some conversion-factor data were contributed by Jonathan Teh Soon Yew 
+    (Some conversion-factor data were contributed by Jonathan Teh Soon Yew
     <[email protected]> and Alex van Kaam <[email protected]>.)
 
     This program is free software; you can redistribute it and/or modify
@@ -64,19 +64,19 @@ SENSORS_INSMOD_1(via686a);
 /* Many VIA686A constants specified below */
 
 /* Length of ISA address segment */
-#define VIA686A_EXTENT 0x80
-#define VIA686A_BASE_REG 0x70
-#define VIA686A_ENABLE_REG 0x74
+#define VIA686A_EXTENT		0x80
+#define VIA686A_BASE_REG	0x70
+#define VIA686A_ENABLE_REG	0x74
 
 /* The VIA686A registers */
 /* ins numbered 0-4 */
-#define VIA686A_REG_IN_MAX(nr) (0x2b + ((nr) * 2))
-#define VIA686A_REG_IN_MIN(nr) (0x2c + ((nr) * 2))
-#define VIA686A_REG_IN(nr)     (0x22 + (nr))
+#define VIA686A_REG_IN_MAX(nr)	(0x2b + ((nr) * 2))
+#define VIA686A_REG_IN_MIN(nr)	(0x2c + ((nr) * 2))
+#define VIA686A_REG_IN(nr)	(0x22 + (nr))
 
 /* fans numbered 1-2 */
-#define VIA686A_REG_FAN_MIN(nr) (0x3a + (nr))
-#define VIA686A_REG_FAN(nr)     (0x28 + (nr))
+#define VIA686A_REG_FAN_MIN(nr)	(0x3a + (nr))
+#define VIA686A_REG_FAN(nr)	(0x28 + (nr))
 
 /* the following values are as speced by VIA: */
 static const u8 regtemp[] = { 0x20, 0x21, 0x1f };
@@ -87,26 +87,28 @@ static const u8 reghyst[] = { 0x3a, 0x3e
 #define VIA686A_REG_TEMP(nr)		(regtemp[nr])
 #define VIA686A_REG_TEMP_OVER(nr)	(regover[nr])
 #define VIA686A_REG_TEMP_HYST(nr)	(reghyst[nr])
-#define VIA686A_REG_TEMP_LOW1	0x4b	// bits 7-6
-#define VIA686A_REG_TEMP_LOW23	0x49	// 2 = bits 5-4, 3 = bits 7-6
-
-#define VIA686A_REG_ALARM1 0x41
-#define VIA686A_REG_ALARM2 0x42
-#define VIA686A_REG_FANDIV 0x47
-#define VIA686A_REG_CONFIG 0x40
-/* The following register sets temp interrupt mode (bits 1-0 for temp1, 
+/* bits 7-6 */
+#define VIA686A_REG_TEMP_LOW1	0x4b
+/* 2 = bits 5-4, 3 = bits 7-6 */
+#define VIA686A_REG_TEMP_LOW23	0x49
+
+#define VIA686A_REG_ALARM1	0x41
+#define VIA686A_REG_ALARM2	0x42
+#define VIA686A_REG_FANDIV	0x47
+#define VIA686A_REG_CONFIG	0x40
+/* The following register sets temp interrupt mode (bits 1-0 for temp1,
  3-2 for temp2, 5-4 for temp3).  Modes are:
     00 interrupt stays as long as value is out-of-range
     01 interrupt is cleared once register is read (default)
     10 comparator mode- like 00, but ignores hysteresis
     11 same as 00 */
-#define VIA686A_REG_TEMP_MODE 0x4b
+#define VIA686A_REG_TEMP_MODE		0x4b
 /* We'll just assume that you want to set all 3 simultaneously: */
-#define VIA686A_TEMP_MODE_MASK 0x3F
-#define VIA686A_TEMP_MODE_CONTINUOUS (0x00)
+#define VIA686A_TEMP_MODE_MASK		0x3F
+#define VIA686A_TEMP_MODE_CONTINUOUS	0x00
 
 /* Conversions. Limit checking is only done on the TO_REG
-   variants. 
+   variants.
 
 ********* VOLTAGE CONVERSIONS (Bob Dougherty) ********
  From HWMon.cpp (Copyright 1998-2000 Jonathan Teh Soon Yew):
@@ -119,7 +121,7 @@ static const u8 reghyst[] = { 0x3a, 0x3e
  That is:
  volts = (25*regVal+133)*factor
  regVal = (volts/factor-133)/25
- (These conversions were contributed by Jonathan Teh Soon Yew 
+ (These conversions were contributed by Jonathan Teh Soon Yew
  <[email protected]>) */
 static inline u8 IN_TO_REG(long val, int inNum)
 {
@@ -180,55 +182,55 @@ static inline u8 FAN_TO_REG(long rpm, in
       else
               return double(temp)*0.924-127.33;
 
- A fifth-order polynomial fits the unofficial data (provided by Alex van 
- Kaam <[email protected]>) a bit better.  It also give more reasonable 
- numbers on my machine (ie. they agree with what my BIOS tells me).  
+ A fifth-order polynomial fits the unofficial data (provided by Alex van
+ Kaam <[email protected]>) a bit better.  It also give more reasonable
+ numbers on my machine (ie. they agree with what my BIOS tells me).
  Here's the fifth-order fit to the 8-bit data:
- temp = 1.625093e-10*val^5 - 1.001632e-07*val^4 + 2.457653e-05*val^3 - 
+ temp = 1.625093e-10*val^5 - 1.001632e-07*val^4 + 2.457653e-05*val^3 -
         2.967619e-03*val^2 + 2.175144e-01*val - 7.090067e+0.
 
- (2000-10-25- RFD: thanks to Uwe Andersen <[email protected]> for 
+ (2000-10-25- RFD: thanks to Uwe Andersen <[email protected]> for
  finding my typos in this formula!)
 
- Alas, none of the elegant function-fit solutions will work because we 
- aren't allowed to use floating point in the kernel and doing it with 
- integers doesn't rpovide enough precision.  So we'll do boring old 
- look-up table stuff.  The unofficial data (see below) have effectively 
- 7-bit resolution (they are rounded to the nearest degree).  I'm assuming 
- that the transfer function of the device is monotonic and smooth, so a 
- smooth function fit to the data will allow us to get better precision.  
+ Alas, none of the elegant function-fit solutions will work because we
+ aren't allowed to use floating point in the kernel and doing it with
+ integers doesn't provide enough precision.  So we'll do boring old
+ look-up table stuff.  The unofficial data (see below) have effectively
+ 7-bit resolution (they are rounded to the nearest degree).  I'm assuming
+ that the transfer function of the device is monotonic and smooth, so a
+ smooth function fit to the data will allow us to get better precision.
  I used the 5th-order poly fit described above and solved for
- VIA register values 0-255.  I *10 before rounding, so we get tenth-degree 
- precision.  (I could have done all 1024 values for our 10-bit readings, 
- but the function is very linear in the useful range (0-80 deg C), so 
- we'll just use linear interpolation for 10-bit readings.)  So, tempLUT 
+ VIA register values 0-255.  I *10 before rounding, so we get tenth-degree
+ precision.  (I could have done all 1024 values for our 10-bit readings,
+ but the function is very linear in the useful range (0-80 deg C), so
+ we'll just use linear interpolation for 10-bit readings.)  So, tempLUT
  is the temp at via register values 0-255: */
 static const long tempLUT[] =
-    { -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-	    -503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-	    -362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
-	    -255, -246, -237, -229, -220, -212, -204, -196, -188, -180,
-	    -173, -166, -159, -152, -145, -139, -132, -126, -120, -114,
-	    -108, -102, -96, -91, -85, -80, -74, -69, -64, -59, -54, -49,
-	    -44, -39, -34, -29, -25, -20, -15, -11, -6, -2, 3, 7, 12, 16,
-	    20, 25, 29, 33, 37, 42, 46, 50, 54, 59, 63, 67, 71, 75, 79, 84,
-	    88, 92, 96, 100, 104, 109, 113, 117, 121, 125, 130, 134, 138,
-	    142, 146, 151, 155, 159, 163, 168, 172, 176, 181, 185, 189,
-	    193, 198, 202, 206, 211, 215, 219, 224, 228, 232, 237, 241,
-	    245, 250, 254, 259, 263, 267, 272, 276, 281, 285, 290, 294,
-	    299, 303, 307, 312, 316, 321, 325, 330, 334, 339, 344, 348,
-	    353, 357, 362, 366, 371, 376, 380, 385, 390, 395, 399, 404,
-	    409, 414, 419, 423, 428, 433, 438, 443, 449, 454, 459, 464,
-	    469, 475, 480, 486, 491, 497, 502, 508, 514, 520, 526, 532,
-	    538, 544, 551, 557, 564, 571, 578, 584, 592, 599, 606, 614,
-	    621, 629, 637, 645, 654, 662, 671, 680, 689, 698, 708, 718,
-	    728, 738, 749, 759, 770, 782, 793, 805, 818, 830, 843, 856,
-	    870, 883, 898, 912, 927, 943, 958, 975, 991, 1008, 1026, 1044,
-	    1062, 1081, 1101, 1121, 1141, 1162, 1184, 1206, 1229, 1252,
-	    1276, 1301, 1326, 1352, 1378, 1406, 1434, 1462
+{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
+	-503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
+	-362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
+	-255, -246, -237, -229, -220, -212, -204, -196, -188, -180,
+	-173, -166, -159, -152, -145, -139, -132, -126, -120, -114,
+	-108, -102, -96, -91, -85, -80, -74, -69, -64, -59, -54, -49,
+	-44, -39, -34, -29, -25, -20, -15, -11, -6, -2, 3, 7, 12, 16,
+	20, 25, 29, 33, 37, 42, 46, 50, 54, 59, 63, 67, 71, 75, 79, 84,
+	88, 92, 96, 100, 104, 109, 113, 117, 121, 125, 130, 134, 138,
+	142, 146, 151, 155, 159, 163, 168, 172, 176, 181, 185, 189,
+	193, 198, 202, 206, 211, 215, 219, 224, 228, 232, 237, 241,
+	245, 250, 254, 259, 263, 267, 272, 276, 281, 285, 290, 294,
+	299, 303, 307, 312, 316, 321, 325, 330, 334, 339, 344, 348,
+	353, 357, 362, 366, 371, 376, 380, 385, 390, 395, 399, 404,
+	409, 414, 419, 423, 428, 433, 438, 443, 449, 454, 459, 464,
+	469, 475, 480, 486, 491, 497, 502, 508, 514, 520, 526, 532,
+	538, 544, 551, 557, 564, 571, 578, 584, 592, 599, 606, 614,
+	621, 629, 637, 645, 654, 662, 671, 680, 689, 698, 708, 718,
+	728, 738, 749, 759, 770, 782, 793, 805, 818, 830, 843, 856,
+	870, 883, 898, 912, 927, 943, 958, 975, 991, 1008, 1026, 1044,
+	1062, 1081, 1101, 1121, 1141, 1162, 1184, 1206, 1229, 1252,
+	1276, 1301, 1326, 1352, 1378, 1406, 1434, 1462
 };
 
-/* the original LUT values from Alex van Kaam <[email protected]> 
+/* the original LUT values from Alex van Kaam <[email protected]>
    (for via register values 12-240):
 {-50,-49,-47,-45,-43,-41,-39,-38,-37,-35,-34,-33,-32,-31,
 -30,-29,-28,-27,-26,-25,-24,-24,-23,-22,-21,-20,-20,-19,-18,-17,-17,-16,-15,
@@ -243,26 +245,26 @@ static const long tempLUT[] =
 
 
  Here's the reverse LUT.  I got it by doing a 6-th order poly fit (needed
- an extra term for a good fit to these inverse data!) and then 
- solving for each temp value from -50 to 110 (the useable range for 
- this chip).  Here's the fit: 
- viaRegVal = -1.160370e-10*val^6 +3.193693e-08*val^5 - 1.464447e-06*val^4 
+ an extra term for a good fit to these inverse data!) and then
+ solving for each temp value from -50 to 110 (the useable range for
+ this chip).  Here's the fit:
+ viaRegVal = -1.160370e-10*val^6 +3.193693e-08*val^5 - 1.464447e-06*val^4
  - 2.525453e-04*val^3 + 1.424593e-02*val^2 + 2.148941e+00*val +7.275808e+01)
  Note that n=161: */
 static const u8 viaLUT[] =
-    { 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23,
-	    23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39, 40,
-	    41, 43, 45, 46, 48, 49, 51, 53, 55, 57, 59, 60, 62, 64, 66,
-	    69, 71, 73, 75, 77, 79, 82, 84, 86, 88, 91, 93, 95, 98, 100,
-	    103, 105, 107, 110, 112, 115, 117, 119, 122, 124, 126, 129,
-	    131, 134, 136, 138, 140, 143, 145, 147, 150, 152, 154, 156,
-	    158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180,
-	    182, 183, 185, 187, 188, 190, 192, 193, 195, 196, 198, 199,
-	    200, 202, 203, 205, 206, 207, 208, 209, 210, 211, 212, 213,
-	    214, 215, 216, 217, 218, 219, 220, 221, 222, 222, 223, 224,
-	    225, 226, 226, 227, 228, 228, 229, 230, 230, 231, 232, 232,
-	    233, 233, 234, 235, 235, 236, 236, 237, 237, 238, 238, 239,
-	    239, 240
+{ 12, 12, 13, 14, 14, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 23,
+	23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39, 40,
+	41, 43, 45, 46, 48, 49, 51, 53, 55, 57, 59, 60, 62, 64, 66,
+	69, 71, 73, 75, 77, 79, 82, 84, 86, 88, 91, 93, 95, 98, 100,
+	103, 105, 107, 110, 112, 115, 117, 119, 122, 124, 126, 129,
+	131, 134, 136, 138, 140, 143, 145, 147, 150, 152, 154, 156,
+	158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180,
+	182, 183, 185, 187, 188, 190, 192, 193, 195, 196, 198, 199,
+	200, 202, 203, 205, 206, 207, 208, 209, 210, 211, 212, 213,
+	214, 215, 216, 217, 218, 219, 220, 221, 222, 222, 223, 224,
+	225, 226, 226, 227, 228, 228, 229, 230, 230, 231, 232, 232,
+	233, 233, 234, 235, 235, 236, 236, 237, 237, 238, 238, 239,
+	239, 240
 };
 
 /* Converting temps to (8-bit) hyst and over registers
@@ -270,7 +272,7 @@ static const u8 viaLUT[] =
    The +50 is because the temps start at -50 */
 static inline u8 TEMP_TO_REG(long val)
 {
-	return viaLUT[val <= -50000 ? 0 : val >= 110000 ? 160 : 
+	return viaLUT[val <= -50000 ? 0 : val >= 110000 ? 160 :
 		      (val < 0 ? val - 500 : val + 500) / 1000 + 50];
 }
 
@@ -289,7 +291,7 @@ static inline long TEMP_FROM_REG10(u16 v
 
 	/* do some linear interpolation */
 	return (tempLUT[eightBits] * (4 - twoBits) +
-	        tempLUT[eightBits + 1] * twoBits) * 25;
+		tempLUT[eightBits + 1] * twoBits) * 25;
 }
 
 #define DIV_FROM_REG(val) (1 << (val))
@@ -354,28 +356,28 @@ static ssize_t show_in_max(struct device
 	return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_max[nr], nr));
 }
 
-static ssize_t set_in_min(struct device *dev, const char *buf, 
+static ssize_t set_in_min(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 
 	down(&data->update_lock);
-	data->in_min[nr] = IN_TO_REG(val,nr);
-	via686a_write_value(client, VIA686A_REG_IN_MIN(nr), 
+	data->in_min[nr] = IN_TO_REG(val, nr);
+	via686a_write_value(client, VIA686A_REG_IN_MIN(nr),
 			data->in_min[nr]);
 	up(&data->update_lock);
 	return count;
 }
-static ssize_t set_in_max(struct device *dev, const char *buf, 
+static ssize_t set_in_max(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
 	unsigned long val = simple_strtoul(buf, NULL, 10);
 
 	down(&data->update_lock);
-	data->in_max[nr] = IN_TO_REG(val,nr);
-	via686a_write_value(client, VIA686A_REG_IN_MAX(nr), 
+	data->in_max[nr] = IN_TO_REG(val, nr);
+	via686a_write_value(client, VIA686A_REG_IN_MAX(nr),
 			data->in_max[nr]);
 	up(&data->update_lock);
 	return count;
@@ -431,7 +433,7 @@ static ssize_t show_temp_hyst(struct dev
 	struct via686a_data *data = via686a_update_device(dev);
 	return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp_hyst[nr]));
 }
-static ssize_t set_temp_over(struct device *dev, const char *buf, 
+static ssize_t set_temp_over(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
@@ -443,7 +445,7 @@ static ssize_t set_temp_over(struct devi
 	up(&data->update_lock);
 	return count;
 }
-static ssize_t set_temp_hyst(struct device *dev, const char *buf, 
+static ssize_t set_temp_hyst(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
@@ -484,7 +486,7 @@ static DEVICE_ATTR(temp##offset##_input,
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, 		\
 		show_temp_##offset##_over, set_temp_##offset##_over);	\
 static DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_hyst, set_temp_##offset##_hyst);	
+		show_temp_##offset##_hyst, set_temp_##offset##_hyst);
 
 show_temp_offset(1);
 show_temp_offset(2);
@@ -493,19 +495,19 @@ show_temp_offset(3);
 /* 2 Fans */
 static ssize_t show_fan(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 
+	return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr],
 				DIV_FROM_REG(data->fan_div[nr])) );
 }
 static ssize_t show_fan_min(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf,"%d\n",
+	return sprintf(buf, "%d\n",
 		FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])) );
 }
 static ssize_t show_fan_div(struct device *dev, char *buf, int nr) {
 	struct via686a_data *data = via686a_update_device(dev);
-	return sprintf(buf,"%d\n", DIV_FROM_REG(data->fan_div[nr]) );
+	return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr]) );
 }
-static ssize_t set_fan_min(struct device *dev, const char *buf, 
+static ssize_t set_fan_min(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
@@ -517,7 +519,7 @@ static ssize_t set_fan_min(struct device
 	up(&data->update_lock);
 	return count;
 }
-static ssize_t set_fan_div(struct device *dev, const char *buf, 
+static ssize_t set_fan_div(struct device *dev, const char *buf,
 		size_t count, int nr) {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct via686a_data *data = i2c_get_clientdata(client);
@@ -608,11 +610,12 @@ static int via686a_detect(struct i2c_ada
 	}
 
 	/* 8231 requires multiple of 256, we enforce that on 686 as well */
-	if(force_addr)
+	if (force_addr)
 		address = force_addr & 0xFF00;
 
-	if(force_addr) {
-		dev_warn(&adapter->dev,"forcing ISA address 0x%04X\n", address);
+	if (force_addr) {
+		dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n",
+			 address);
 		if (PCIBIOS_SUCCESSFUL !=
 		    pci_write_config_word(s_bridge, VIA686A_BASE_REG, address))
 			return -ENODEV;
@@ -621,17 +624,17 @@ static int via686a_detect(struct i2c_ada
 	    pci_read_config_word(s_bridge, VIA686A_ENABLE_REG, &val))
 		return -ENODEV;
 	if (!(val & 0x0001)) {
-		dev_warn(&adapter->dev,"enabling sensors\n");
+		dev_warn(&adapter->dev, "enabling sensors\n");
 		if (PCIBIOS_SUCCESSFUL !=
 		    pci_write_config_word(s_bridge, VIA686A_ENABLE_REG,
-		                      val | 0x0001))
+					  val | 0x0001))
 			return -ENODEV;
 	}
 
 	/* Reserve the ISA region */
 	if (!request_region(address, VIA686A_EXTENT, via686a_driver.name)) {
-		dev_err(&adapter->dev,"region 0x%x already in use!\n",
-		       address);
+		dev_err(&adapter->dev, "region 0x%x already in use!\n",
+			address);
 		return -ENODEV;
 	}
 
@@ -656,7 +659,7 @@ static int via686a_detect(struct i2c_ada
 	/* Tell the I2C layer a new client has arrived */
 	if ((err = i2c_attach_client(new_client)))
 		goto ERROR3;
-	
+
 	/* Initialize the VIA686A chip */
 	via686a_init_client(new_client);
 
@@ -695,9 +698,9 @@ static int via686a_detect(struct i2c_ada
 
 	return 0;
 
-      ERROR3:
+ERROR3:
 	kfree(data);
-      ERROR0:
+ERROR0:
 	release_region(address, VIA686A_EXTENT);
 	return err;
 }
@@ -728,7 +731,7 @@ static void via686a_init_client(struct i
 	via686a_write_value(client, VIA686A_REG_CONFIG, (reg|0x01)&0x7F);
 
 	/* Configure temp interrupt mode for continuous-interrupt operation */
-	via686a_write_value(client, VIA686A_REG_TEMP_MODE, 
+	via686a_write_value(client, VIA686A_REG_TEMP_MODE,
 			    via686a_read_value(client, VIA686A_REG_TEMP_MODE) &
 			    !(VIA686A_TEMP_MODE_MASK | VIA686A_TEMP_MODE_CONTINUOUS));
 }
@@ -768,7 +771,7 @@ static struct via686a_data *via686a_upda
 			    via686a_read_value(client,
 					       VIA686A_REG_TEMP_HYST(i));
 		}
-		/* add in lower 2 bits 
+		/* add in lower 2 bits
 		   temp1 uses bits 7-6 of VIA686A_REG_TEMP_LOW1
 		   temp2 uses bits 5-4 of VIA686A_REG_TEMP_LOW23
 		   temp3 uses bits 7-6 of VIA686A_REG_TEMP_LOW23
@@ -800,35 +803,36 @@ static struct via686a_data *via686a_upda
 }
 
 static struct pci_device_id via686a_pci_ids[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4) },
-       { 0, }
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4) },
+	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(pci, via686a_pci_ids);
 
 static int __devinit via686a_pci_probe(struct pci_dev *dev,
-                                      const struct pci_device_id *id)
+				       const struct pci_device_id *id)
 {
-       u16 val;
-       int addr = 0;
+	u16 val;
+	int addr = 0;
 
-       if (PCIBIOS_SUCCESSFUL !=
-           pci_read_config_word(dev, VIA686A_BASE_REG, &val))
-               return -ENODEV;
-
-       addr = val & ~(VIA686A_EXTENT - 1);
-       if (addr == 0 && force_addr == 0) {
-               dev_err(&dev->dev,"base address not set - upgrade BIOS or use force_addr=0xaddr\n");
-               return -ENODEV;
-       }
-       if (force_addr)
-               addr = force_addr;      /* so detect will get called */
-
-       if (!addr) {
-               dev_err(&dev->dev,"No Via 686A sensors found.\n");
-               return -ENODEV;
-       }
-       normal_isa[0] = addr;
+	if (PCIBIOS_SUCCESSFUL !=
+	    pci_read_config_word(dev, VIA686A_BASE_REG, &val))
+		return -ENODEV;
+
+	addr = val & ~(VIA686A_EXTENT - 1);
+	if (addr == 0 && force_addr == 0) {
+		dev_err(&dev->dev, "base address not set - upgrade BIOS "
+			"or use force_addr=0xaddr\n");
+		return -ENODEV;
+	}
+	if (force_addr)
+		addr = force_addr;	/* so detect will get called */
+
+	if (!addr) {
+		dev_err(&dev->dev, "No Via 686A sensors found.\n");
+		return -ENODEV;
+	}
+	normal_isa[0] = addr;
 
 	s_bridge = pci_dev_get(dev);
 	if (i2c_add_driver(&via686a_driver)) {
@@ -844,14 +848,14 @@ static int __devinit via686a_pci_probe(s
 }
 
 static struct pci_driver via686a_pci_driver = {
-       .name		= "via686a",
-       .id_table	= via686a_pci_ids,
-       .probe		= via686a_pci_probe,
+	.name		= "via686a",
+	.id_table	= via686a_pci_ids,
+	.probe		= via686a_pci_probe,
 };
 
 static int __init sm_via686a_init(void)
 {
-       return pci_register_driver(&via686a_pci_driver);
+	return pci_register_driver(&via686a_pci_driver);
 }
 
 static void __exit sm_via686a_exit(void)
@@ -865,8 +869,8 @@ static void __exit sm_via686a_exit(void)
 }
 
 MODULE_AUTHOR("Kyösti Mälkki <[email protected]>, "
-              "Mark Studebaker <[email protected]> "
-             "and Bob Dougherty <[email protected]>");
+	      "Mark Studebaker <[email protected]> "
+	      "and Bob Dougherty <[email protected]>");
 MODULE_DESCRIPTION("VIA 686A Sensor device");
 MODULE_LICENSE("GPL");
 
author
#33 lore raw

PATCH 1/1 I2C: Spelling fixes for drivers/i2c/algos/i2c-algo-pca.c

[PATCH] I2C: Spelling fixes for drivers/i2c/algos/i2c-algo-pca.c

This patch fixes the some misspellings and a trailing whitespace in the comments.

---
commit 46b615f453202dbcf66452b500ab69c0e2148593
tree 4f2a4daab8bc675ed72c435cb7cee8e0ad78e751
parent 6f637a6494a1872c613fe68f64ea4831c3e5b037
author Tobias Klauser <[email protected]> Thu, 19 May 2005 22:27:23 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:59 -0700

 drivers/i2c/algos/i2c-algo-pca.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/algos/i2c-algo-pca.c +2 -2
@@ -62,7 +62,7 @@ static void pca_start(struct i2c_algo_pc
 }
 
 /*
- * Generate a repeated start condition on the i2c bus 
+ * Generate a repeated start condition on the i2c bus
  *
  * return after the repeated start condition has occurred
  */
@@ -82,7 +82,7 @@ static void pca_repeated_start(struct i2
  * returns after the stop condition has been generated
  *
  * STOPs do not generate an interrupt or set the SI flag, since the
- * part returns the the idle state (0xf8). Hence we don't need to
+ * part returns the idle state (0xf8). Hence we don't need to
  * pca_wait here.
  */
 static void pca_stop(struct i2c_algo_pca_data *adap)
author
#34 lore raw

PATCH 1/1 I2C: Kill another macro abuse in via686a

[PATCH] I2C: Kill another macro abuse in via686a

This patch kills another macro abuse in the via686a hardware monitoring driver. Using a macro just to alias an array is quite useless, isn't it?

---
commit 563db2fe9e0843da9d1d85d824f022be0ada4a3c
tree 2e5cec5b9e1d0cf34e2c03c65bc53d9784b287da
parent 057923f0f5ba346fc128ae0a1c3842d8c12bd7f0
author Jean Delvare <[email protected]> Tue, 17 May 2005 22:38:57 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:59 -0700

 drivers/i2c/chips/via686a.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)
drivers/i2c/chips/via686a.c +10 -13
@@ -78,15 +78,10 @@ SENSORS_INSMOD_1(via686a);
 #define VIA686A_REG_FAN_MIN(nr)	(0x3a + (nr))
 #define VIA686A_REG_FAN(nr)	(0x28 + (nr))
 
-/* the following values are as speced by VIA: */
-static const u8 regtemp[] = { 0x20, 0x21, 0x1f };
-static const u8 regover[] = { 0x39, 0x3d, 0x1d };
-static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e };
-
 /* temps numbered 1-3 */
-#define VIA686A_REG_TEMP(nr)		(regtemp[nr])
-#define VIA686A_REG_TEMP_OVER(nr)	(regover[nr])
-#define VIA686A_REG_TEMP_HYST(nr)	(reghyst[nr])
+static const u8 VIA686A_REG_TEMP[]	= { 0x20, 0x21, 0x1f };
+static const u8 VIA686A_REG_TEMP_OVER[]	= { 0x39, 0x3d, 0x1d };
+static const u8 VIA686A_REG_TEMP_HYST[]	= { 0x3a, 0x3e, 0x1e };
 /* bits 7-6 */
 #define VIA686A_REG_TEMP_LOW1	0x4b
 /* 2 = bits 5-4, 3 = bits 7-6 */
@@ -441,7 +436,8 @@ static ssize_t set_temp_over(struct devi
 
 	down(&data->update_lock);
 	data->temp_over[nr] = TEMP_TO_REG(val);
-	via686a_write_value(client, VIA686A_REG_TEMP_OVER(nr), data->temp_over[nr]);
+	via686a_write_value(client, VIA686A_REG_TEMP_OVER[nr],
+			    data->temp_over[nr]);
 	up(&data->update_lock);
 	return count;
 }
@@ -453,7 +449,8 @@ static ssize_t set_temp_hyst(struct devi
 
 	down(&data->update_lock);
 	data->temp_hyst[nr] = TEMP_TO_REG(val);
-	via686a_write_value(client, VIA686A_REG_TEMP_HYST(nr), data->temp_hyst[nr]);
+	via686a_write_value(client, VIA686A_REG_TEMP_HYST[nr],
+			    data->temp_hyst[nr]);
 	up(&data->update_lock);
 	return count;
 }
@@ -763,13 +760,13 @@ static struct via686a_data *via686a_upda
 		}
 		for (i = 0; i <= 2; i++) {
 			data->temp[i] = via686a_read_value(client,
-						 VIA686A_REG_TEMP(i)) << 2;
+						 VIA686A_REG_TEMP[i]) << 2;
 			data->temp_over[i] =
 			    via686a_read_value(client,
-					       VIA686A_REG_TEMP_OVER(i));
+					       VIA686A_REG_TEMP_OVER[i]);
 			data->temp_hyst[i] =
 			    via686a_read_value(client,
-					       VIA686A_REG_TEMP_HYST(i));
+					       VIA686A_REG_TEMP_HYST[i]);
 		}
 		/* add in lower 2 bits
 		   temp1 uses bits 7-6 of VIA686A_REG_TEMP_LOW1
author
#35 lore raw

PATCH 1/1 I2C: fix up some sysfs device attribute file parameters

[PATCH] I2C: fix up some sysfs device attribute file parameters

---
commit 6f637a6494a1872c613fe68f64ea4831c3e5b037
tree a18368e908290ca7bdf3430b0b5b9cbc0131da5b
parent 563db2fe9e0843da9d1d85d824f022be0ada4a3c
author Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:01:59 -0700 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:51:59 -0700

 drivers/i2c/chips/adm9240.c   |   54 ++++++++++++++++++++++++++++-------------
 drivers/i2c/chips/atxp1.c     |   12 +++++----
 drivers/i2c/chips/w83627ehf.c |   29 ++++++++++++++--------
 3 files changed, 61 insertions(+), 34 deletions(-)
drivers/i2c/chips/adm9240.c +37 -17
@@ -185,7 +185,9 @@ static int adm9240_write_value(struct i2
 
 /* temperature */
 #define show_temp(value, scale)					\
-static ssize_t show_##value(struct device *dev, char *buf)	\
+static ssize_t show_##value(struct device *dev,			\
+			    struct device_attribute *attr,	\
+			    char *buf)				\
 {								\
 	struct adm9240_data *data = adm9240_update_device(dev);	\
 	return sprintf(buf, "%d\n", data->value * scale);	\
@@ -195,8 +197,9 @@ show_temp(temp_hyst, 1000);
 show_temp(temp, 500); /* 0.5'C per bit */
 
 #define set_temp(value, reg)					\
-static ssize_t set_##value(struct device *dev, const char *buf,	\
-		size_t count)					\
+static ssize_t set_##value(struct device *dev, 			\
+			   struct device_attribute *attr,	\
+			   const char *buf, size_t count)	\
 {								\
 	struct i2c_client *client = to_i2c_client(dev);		\
 	struct adm9240_data *data = adm9240_update_device(dev);	\
@@ -266,26 +269,36 @@ static ssize_t set_in_max(struct device 
 }
 
 #define show_in_offset(offset)						\
-static ssize_t show_in##offset(struct device *dev, char *buf)		\
+static ssize_t show_in##offset(struct device *dev,			\
+			       struct device_attribute *attr,		\
+			       char *buf)				\
 {									\
 	return show_in(dev, buf, offset);				\
 }									\
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);	\
-static ssize_t show_in##offset##_min(struct device *dev, char *buf)	\
+static ssize_t show_in##offset##_min(struct device *dev,		\
+				     struct device_attribute *attr,	\
+				     char *buf)				\
 {									\
 	return show_in_min(dev, buf, offset);				\
 }									\
-static ssize_t show_in##offset##_max(struct device *dev, char *buf)	\
+static ssize_t show_in##offset##_max(struct device *dev,		\
+				     struct device_attribute *attr,	\
+				     char *buf)				\
 {									\
 	return show_in_max(dev, buf, offset);				\
 }									\
 static ssize_t								\
-set_in##offset##_min(struct device *dev, const char *buf, size_t count)	\
+set_in##offset##_min(struct device *dev,				\
+		     struct device_attribute *attr, const char *buf,	\
+		     size_t count)					\
 {									\
 	return set_in_min(dev, buf, count, offset);			\
 }									\
 static ssize_t								\
-set_in##offset##_max(struct device *dev, const char *buf, size_t count)	\
+set_in##offset##_max(struct device *dev,				\
+		     struct device_attribute *attr, const char *buf,	\
+		     size_t count)					\
 {									\
 	return set_in_max(dev, buf, count, offset);			\
 }									\
@@ -401,20 +414,27 @@ static ssize_t set_fan_min(struct device
 }
 
 #define show_fan_offset(offset)						\
-static ssize_t show_fan_##offset (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset (struct device *dev,			\
+				  struct device_attribute *attr,	\
+				  char *buf)				\
 {									\
 return show_fan(dev, buf, offset - 1);					\
 }									\
-static ssize_t show_fan_##offset##_div (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_div (struct device *dev,		\
+					struct device_attribute *attr,	\
+					char *buf)			\
 {									\
 return show_fan_div(dev, buf, offset - 1);				\
 }									\
-static ssize_t show_fan_##offset##_min (struct device *dev, char *buf)	\
+static ssize_t show_fan_##offset##_min (struct device *dev,		\
+					struct device_attribute *attr,	\
+					char *buf)			\
 {									\
 return show_fan_min(dev, buf, offset - 1);				\
 }									\
 static ssize_t set_fan_##offset##_min (struct device *dev, 		\
-const char *buf, size_t count)						\
+				       struct device_attribute *attr,	\
+				       const char *buf, size_t count)	\
 {									\
 return set_fan_min(dev, buf, count, offset - 1);			\
 }									\
@@ -429,7 +449,7 @@ show_fan_offset(1);
 show_fan_offset(2);
 
 /* alarms */
-static ssize_t show_alarms(struct device *dev, char *buf)
+static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct adm9240_data *data = adm9240_update_device(dev);
 	return sprintf(buf, "%u\n", data->alarms);
@@ -437,7 +457,7 @@ static ssize_t show_alarms(struct device
 static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 
 /* vid */
-static ssize_t show_vid(struct device *dev, char *buf)
+static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct adm9240_data *data = adm9240_update_device(dev);
 	return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
@@ -445,13 +465,13 @@ static ssize_t show_vid(struct device *d
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 
 /* analog output */
-static ssize_t show_aout(struct device *dev, char *buf)
+static ssize_t show_aout(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct adm9240_data *data = adm9240_update_device(dev);
 	return sprintf(buf, "%d\n", AOUT_FROM_REG(data->aout));
 }
 
-static ssize_t set_aout(struct device *dev, const char *buf, size_t count)
+static ssize_t set_aout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct adm9240_data *data = i2c_get_clientdata(client);
@@ -466,7 +486,7 @@ static ssize_t set_aout(struct device *d
 static DEVICE_ATTR(aout_output, S_IRUGO | S_IWUSR, show_aout, set_aout);
 
 /* chassis_clear */
-static ssize_t chassis_clear(struct device *dev, const char *buf, size_t count)
+static ssize_t chassis_clear(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	unsigned long val = simple_strtol(buf, NULL, 10);
drivers/i2c/chips/atxp1.c +6 -6
@@ -99,7 +99,7 @@ static struct atxp1_data * atxp1_update_
 }
 
 /* sys file functions for cpu0_vid */
-static ssize_t atxp1_showvcore(struct device *dev, char *buf)
+static ssize_t atxp1_showvcore(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -111,7 +111,7 @@ static ssize_t atxp1_showvcore(struct de
 	return size;
 }
 
-static ssize_t atxp1_storevcore(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storevcore(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
@@ -169,7 +169,7 @@ static ssize_t atxp1_storevcore(struct d
 static DEVICE_ATTR(cpu0_vid, S_IRUGO | S_IWUSR, atxp1_showvcore, atxp1_storevcore);
 
 /* sys file functions for GPIO1 */
-static ssize_t atxp1_showgpio1(struct device *dev, char *buf)
+static ssize_t atxp1_showgpio1(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -181,7 +181,7 @@ static ssize_t atxp1_showgpio1(struct de
 	return size;
 }
 
-static ssize_t atxp1_storegpio1(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storegpio1(struct device *dev, struct device_attribute *attr, const char*buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
@@ -211,7 +211,7 @@ static ssize_t atxp1_storegpio1(struct d
 static DEVICE_ATTR(gpio1, S_IRUGO | S_IWUSR, atxp1_showgpio1, atxp1_storegpio1);
 
 /* sys file functions for GPIO2 */
-static ssize_t atxp1_showgpio2(struct device *dev, char *buf)
+static ssize_t atxp1_showgpio2(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	int size;
 	struct atxp1_data *data;
@@ -223,7 +223,7 @@ static ssize_t atxp1_showgpio2(struct de
 	return size;
 }
 
-static ssize_t atxp1_storegpio2(struct device *dev, const char* buf, size_t count)
+static ssize_t atxp1_storegpio2(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct atxp1_data *data;
 	struct i2c_client *client;
drivers/i2c/chips/w83627ehf.c +18 -11
@@ -486,7 +486,8 @@ store_fan_min(struct device *dev, const 
 
 #define sysfs_fan_offset(offset) \
 static ssize_t \
-show_reg_fan_##offset(struct device *dev, char *buf) \
+show_reg_fan_##offset(struct device *dev, struct device_attribute *attr, \
+		      char *buf) \
 { \
 	return show_fan(dev, buf, offset-1); \
 } \
@@ -495,13 +496,14 @@ static DEVICE_ATTR(fan##offset##_input, 
 
 #define sysfs_fan_min_offset(offset) \
 static ssize_t \
-show_reg_fan##offset##_min(struct device *dev, char *buf) \
+show_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
+			   char *buf) \
 { \
 	return show_fan_min(dev, buf, offset-1); \
 } \
 static ssize_t \
-store_reg_fan##offset##_min(struct device *dev, const char *buf, \
-			    size_t count) \
+store_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
+			    const char *buf, size_t count) \
 { \
 	return store_fan_min(dev, buf, count, offset-1); \
 } \
@@ -511,7 +513,8 @@ static DEVICE_ATTR(fan##offset##_min, S_
 
 #define sysfs_fan_div_offset(offset) \
 static ssize_t \
-show_reg_fan##offset##_div(struct device *dev, char *buf) \
+show_reg_fan##offset##_div(struct device *dev, struct device_attribute *attr, \
+			   char *buf) \
 { \
 	return show_fan_div(dev, buf, offset - 1); \
 } \
@@ -536,7 +539,8 @@ sysfs_fan_div_offset(5);
 
 #define show_temp1_reg(reg) \
 static ssize_t \
-show_##reg(struct device *dev, char *buf) \
+show_##reg(struct device *dev, struct device_attribute *attr, \
+	   char *buf) \
 { \
 	struct w83627ehf_data *data = w83627ehf_update_device(dev); \
 	return sprintf(buf, "%d\n", temp1_from_reg(data->reg)); \
@@ -547,7 +551,8 @@ show_temp1_reg(temp1_max_hyst);
 
 #define store_temp1_reg(REG, reg) \
 static ssize_t \
-store_temp1_##reg(struct device *dev, const char *buf, size_t count) \
+store_temp1_##reg(struct device *dev, struct device_attribute *attr, \
+		  const char *buf, size_t count) \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct w83627ehf_data *data = i2c_get_clientdata(client); \
@@ -601,7 +606,8 @@ store_temp_reg(HYST, temp_max_hyst);
 
 #define sysfs_temp_offset(offset) \
 static ssize_t \
-show_reg_temp##offset (struct device *dev, char *buf) \
+show_reg_temp##offset (struct device *dev, struct device_attribute *attr, \
+		       char *buf) \
 { \
 	return show_temp(dev, buf, offset - 2); \
 } \
@@ -610,13 +616,14 @@ static DEVICE_ATTR(temp##offset##_input,
 
 #define sysfs_temp_reg_offset(reg, offset) \
 static ssize_t \
-show_reg_temp##offset##_##reg(struct device *dev, char *buf) \
+show_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
+			      char *buf) \
 { \
 	return show_temp_##reg(dev, buf, offset - 2); \
 } \
 static ssize_t \
-store_reg_temp##offset##_##reg(struct device *dev, const char *buf, \
-			       size_t count) \
+store_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
+			       const char *buf, size_t count) \
 { \
 	return store_temp_##reg(dev, buf, count, offset - 2); \
 } \
author
#36 lore raw

PATCH 1/1 I2C: Spelling fixes for drivers/i2c/busses/i2c-parport.c

[PATCH] I2C: Spelling fixes for drivers/i2c/busses/i2c-parport.c

This patch fixes a double "the" in a comment section.

---
commit 614e24be139c0ae70378349e6c6f0e21751e56bf
tree a2aec8b80eac393adb7b44baf0b875b802d496b7
parent 46b615f453202dbcf66452b500ab69c0e2148593
author Tobias Klauser <[email protected]> Thu, 19 May 2005 21:39:06 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:00 -0700

 drivers/i2c/busses/i2c-parport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/busses/i2c-parport.c +1 -1
@@ -130,7 +130,7 @@ static int parport_getsda(void *data)
 /* Encapsulate the functions above in the correct structure.
    Note that this is only a template, from which the real structures are
    copied. The attaching code will set getscl to NULL for adapters that
-   cannot read SCL back, and will also make the the data field point to
+   cannot read SCL back, and will also make the data field point to
    the parallel port structure. */
 static struct i2c_algo_bit_data parport_algo_data = {
 	.setsda		= parport_setsda,
author
#37 lore raw

PATCH 1/1 I2C: Spelling fixes for drivers/i2c/i2c-core.c

[PATCH] I2C: Spelling fixes for drivers/i2c/i2c-core.c

This patch fixes a misspelling in a comment section.

---
commit a551acc2cb1f13a9bd728b8cf86f9adafefdcfb2
tree 2ee02935a9df422b733969affbdcca3a873479c1
parent 614e24be139c0ae70378349e6c6f0e21751e56bf
author Tobias Klauser <[email protected]> Thu, 19 May 2005 21:40:38 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:00 -0700

 drivers/i2c/i2c-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/i2c-core.c +1 -1
@@ -238,7 +238,7 @@ int i2c_del_adapter(struct i2c_adapter *
 	}
 
 	/* detach any active clients. This must be done first, because
-	 * it can fail; in which case we give upp. */
+	 * it can fail; in which case we give up. */
 	list_for_each_safe(item, _n, &adap->clients) {
 		client = list_entry(item, struct i2c_client, list);
 
author
#38 lore raw

PATCH 1/1 I2C: Spelling fixes for drivers/i2c/i2c-dev.c

[PATCH] I2C: Spelling fixes for drivers/i2c/i2c-dev.c

This patch fixes a misspelling in a comment section.

---
commit d68a861d857c11a017a8f755fa250afaf8b1bcdb
tree 85975dd625d7a58da2a4e90c01729332a533c8a2
parent a551acc2cb1f13a9bd728b8cf86f9adafefdcfb2
author Tobias Klauser <[email protected]> Thu, 19 May 2005 21:41:47 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:00 -0700

 drivers/i2c/i2c-dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/i2c-dev.c +1 -1
@@ -213,7 +213,7 @@ static int i2cdev_ioctl(struct inode *in
 				   sizeof(rdwr_arg)))
 			return -EFAULT;
 
-		/* Put an arbritrary limit on the number of messages that can
+		/* Put an arbitrary limit on the number of messages that can
 		 * be sent at once */
 		if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
 			return -EINVAL;
author
#39 lore raw

PATCH 1/1 I2C: add i2c driver for TPS6501x

[PATCH] I2C: add i2c driver for TPS6501x

This adds an I2C driver for the TPS6501x series of power management chips. It's used on many OMAP based boards, and this driver has been widely used in the Linux-OMAP trees over the last year or so.

---
commit 72cd799544f2b36c2f07ceaeed6d984cb130d4f3
tree ee3f0696bd3b9b09af8f09f449eeac6c0eb3cac5
parent cc0b07ed479fd92806aef7d6dbc58b6dc6da3796
author David Brownell <[email protected]> Tue, 24 May 2005 17:34:51 -0700 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:01 -0700

 drivers/i2c/chips/Kconfig            |   19 +
 drivers/i2c/chips/Makefile           |    4 
 drivers/i2c/chips/tps65010.c         | 1072 ++++++++++++++++++++++++++++++++++
 include/asm-arm/arch-omap/tps65010.h |   76 ++
 4 files changed, 1169 insertions(+), 2 deletions(-)
drivers/i2c/chips/Kconfig +18 -1
@@ -1,5 +1,5 @@
 #
-# I2C Sensor device configuration
+# I2C Sensor and "other" chip configuration
 #
 
 menu "Hardware Sensors Chip support"
@@ -472,6 +472,23 @@ config ISP1301_OMAP
 	  This driver can also be built as a module.  If so, the module
 	  will be called isp1301_omap.
 
+# NOTE:  This isn't really OMAP-specific, except for the current
+# interface location in  <include/asm-arm/arch-omap/tps65010.h>
+# and having mostly OMAP-specific board support
+config TPS65010
+	tristate "TPS6501x Power Management chips"
+	depends on I2C && ARCH_OMAP
+	default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK
+	help
+	  If you say yes here you get support for the TPS6501x series of
+	  Power Management chips.  These include voltage regulators,
+	  lithium ion/polymer battery charging, and other features that
+	  are often used in portable devices like cell phones and cameras.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tps65010.
+
+
 config SENSORS_M41T00
 	tristate "ST M41T00 RTC chip"
 	depends on I2C && PPC32
drivers/i2c/chips/Makefile +3 -1
@@ -1,5 +1,5 @@
 #
-# Makefile for the kernel hardware sensors chip drivers.
+# Makefile for sensor and "other" I2C chip drivers.
 #
 
 # asb100, then w83781d go first, as they can override other drivers' addresses.
@@ -43,7 +43,9 @@ obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83627EHF)	+= w83627ehf.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
+
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
+obj-$(CONFIG_TPS65010)		+= tps65010.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/i2c/chips/tps65010.c new file +1072 -0

1,072 lines not on this page · raw message

include/asm-arm/arch-omap/tps65010.h +76 -0

92 lines not on this page · raw message

author
#40 lore raw

PATCH 1/1 i2c: Race fix for i2c-mpc.c

[PATCH] i2c: Race fix for i2c-mpc.c

i2c: Race fix for i2c-mpc.c

The problem was that the clock speed and driver data is initialized after the i2c adapter was added. This caused the i2c bus to start working at a wrong speed. (Mostly noticable on the second bus on mpc5200)

With this patch we've tried to keep the i2c adapter working perfectly all the time it is included in the system. Initialize before added, Remove garbage after deleleted.

Submitted-by Asier Llano Palacios

---
commit 7f02d56e54f2a8afaa01974df650ace9dc15d0cd
tree dd39ab530763bfb2f34e84c83d469199e53fc8b0
parent d68a861d857c11a017a8f755fa250afaf8b1bcdb
author Sylvain Munaut <[email protected]> Wed, 18 May 2005 19:39:57 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:01 -0700

 drivers/i2c/busses/i2c-mpc.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-mpc.c +8 -6
@@ -333,6 +333,9 @@ static int __devinit mpc_i2c_probe(struc
 	} else
 		i2c->irq = 0;
 
+	mpc_i2c_setclock(i2c);
+	ocp_set_drvdata(ocp, i2c);
+
 	i2c->adap = mpc_ops;
 	i2c_set_adapdata(&i2c->adap, i2c);
 
@@ -341,8 +344,6 @@ static int __devinit mpc_i2c_probe(struc
 		goto fail_add;
 	}
 
-	mpc_i2c_setclock(i2c);
-	ocp_set_drvdata(ocp, i2c);
 	return result;
 
       fail_add:
@@ -358,8 +359,8 @@ static int __devinit mpc_i2c_probe(struc
 static void __devexit mpc_i2c_remove(struct ocp_device *ocp)
 {
 	struct mpc_i2c *i2c = ocp_get_drvdata(ocp);
-	ocp_set_drvdata(ocp, NULL);
 	i2c_del_adapter(&i2c->adap);
+	ocp_set_drvdata(ocp, NULL);
 
 	if (ocp->def->irq != OCP_IRQ_NA)
 		free_irq(i2c->irq, i2c);
@@ -430,6 +431,9 @@ static int fsl_i2c_probe(struct device *
 			goto fail_irq;
 		}
 
+	mpc_i2c_setclock(i2c);
+	dev_set_drvdata(device, i2c);
+
 	i2c->adap = mpc_ops;
 	i2c_set_adapdata(&i2c->adap, i2c);
 	i2c->adap.dev.parent = &pdev->dev;
@@ -438,8 +442,6 @@ static int fsl_i2c_probe(struct device *
 		goto fail_add;
 	}
 
-	mpc_i2c_setclock(i2c);
-	dev_set_drvdata(device, i2c);
 	return result;
 
       fail_add:
@@ -456,8 +458,8 @@ static int fsl_i2c_remove(struct device 
 {
 	struct mpc_i2c *i2c = dev_get_drvdata(device);
 
-	dev_set_drvdata(device, NULL);
 	i2c_del_adapter(&i2c->adap);
+	dev_set_drvdata(device, NULL);
 
 	if (i2c->irq != 0)
 		free_irq(i2c->irq, i2c);
author
#41 lore raw

PATCH 1/1 I2C: Sensors mailing list has moved

[PATCH] I2C: Sensors mailing list has moved

The following patch updates all references to the sensors mailing list, so as to reflect the fact that the list recently moved to a new home and changed addresses. I'll work out a similar patch for Linux 2.4 soon.

---
commit cc0b07ed479fd92806aef7d6dbc58b6dc6da3796
tree d704525bd37b168e9cf61b7464fe4423b6c46b48
parent 7f02d56e54f2a8afaa01974df650ace9dc15d0cd
author Jean Delvare <[email protected]> Sun, 22 May 2005 09:39:11 +0200 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:01 -0700

 Documentation/i2c/busses/i2c-sis69x |    2 +-
 Documentation/i2c/porting-clients   |    2 +-
 MAINTAINERS                         |   16 ++++++++--------
 3 files changed, 10 insertions(+), 10 deletions(-)
Documentation/i2c/busses/i2c-sis69x +1 -1
@@ -42,7 +42,7 @@ I suspect that this driver could be made
 chipsets as well: 635, and 635T. If anyone owns a board with those chips
 AND is willing to risk crashing & burning an otherwise well-behaved kernel
 in the name of progress... please contact me at <[email protected]> or
-via the project's mailing list: <[email protected]>.  Please
+via the project's mailing list: <[email protected]>.  Please
 send bug reports and/or success stories as well.
 
 
Documentation/i2c/porting-clients +1 -1
@@ -57,7 +57,7 @@ Technical changes:
   Documentation/i2c/sysfs-interface for the individual files. Also
   convert the units these files read and write to the specified ones.
   If you need to add a new type of file, please discuss it on the
-  sensors mailing list <[email protected]> by providing a
+  sensors mailing list <[email protected]> by providing a
   patch to the Documentation/i2c/sysfs-interface file.
 
 * [Attach] For I2C drivers, the attach function should make sure
MAINTAINERS +8 -8
@@ -194,7 +194,7 @@ S:	Maintained
 ADM1025 HARDWARE MONITOR DRIVER
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Maintained
 
 ADT746X FAN DRIVER
@@ -242,7 +242,7 @@ S:	Maintained
 ALI1563 I2C DRIVER
 P:	Rudolf Marek
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Maintained
 
 ALPHA PORT
@@ -1002,7 +1002,7 @@ P:	Greg Kroah-Hartman
 M:	[email protected]
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 W:	http://www.lm-sensors.nu/
 S:	Maintained
 
@@ -1430,13 +1430,13 @@ S:	Supported
 LM83 HARDWARE MONITOR DRIVER
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Maintained
 
 LM90 HARDWARE MONITOR DRIVER
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Maintained
 
 LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP Dynamic Disks)
@@ -2075,7 +2075,7 @@ S:	Maintained
 SMSC47M1 HARDWARE MONITOR DRIVER
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Odd Fixes
 
 SMB FILESYSTEM
@@ -2614,7 +2614,7 @@ S:	Orphan
 W1 DALLAS'S 1-WIRE BUS
 P:	Evgeniy Polyakov
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Maintained
 
 W83L51xD SD/MMC CARD INTERFACE DRIVER
@@ -2627,7 +2627,7 @@ S:	Maintained
 W83L785TS HARDWARE MONITOR DRIVER
 P:	Jean Delvare
 M:	[email protected]
-L:	[email protected]
+L:	[email protected]
 S:	Odd Fixes
 
 WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
author
#42 lore raw

PATCH 1/1 I2C: documentation update 1/3

[PATCH] I2C: documentation update 1/3

This patch just changes the extension of Documentation/i2c/chips/smsc47b397.txt to none - to conform with naming in i2c subsystem directory.

---
commit 2bf34a1ca9d570dd4fab4d95c4de82d873ecf718
tree 293f1c49c9b0f6bf9421905ef1c475c28ed3d496
parent 72cd799544f2b36c2f07ceaeed6d984cb130d4f3
author [email protected] <[email protected]> Thu, 26 May 2005 12:42:11 +0000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:02 -0700

 Documentation/i2c/chips/smsc47b397     |  146 ++++++++++++++++++++++++++++++++
 Documentation/i2c/chips/smsc47b397.txt |  146 --------------------------------
 2 files changed, 146 insertions(+), 146 deletions(-)
Documentation/i2c/chips/smsc47b397 new file +146 -0
new file mode 100644
@@ -0,0 +1,146 @@
+November 23, 2004
+
+The following specification describes the SMSC LPC47B397-NC sensor chip
+(for which there is no public datasheet available).  This document was
+provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
+by Mark M. Hoffman <[email protected]>.
+
+* * * * *
+
+Methods for detecting the HP SIO and reading the thermal data on a dc7100.
+
+The thermal information on the dc7100 is contained in the SIO Hardware Monitor
+(HWM).  The information is accessed through an index/data pair.  The index/data
+pair is located at the HWM Base Address + 0 and the HWM Base Address + 1.  The
+HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
+and 0x61 (LSB).  Currently we are using 0x480 for the HWM Base Address and
+0x480 and 0x481 for the index/data pair.
+
+Reading temperature information.
+The temperature information is located in the following registers:
+Temp1		0x25	(Currently, this reflects the CPU temp on all systems).
+Temp2		0x26
+Temp3		0x27
+Temp4		0x80
+
+Programming Example
+The following is an example of how to read the HWM temperature registers:
+MOV	DX,480H
+MOV	AX,25H
+OUT	DX,AL
+MOV	DX,481H
+IN	AL,DX
+
+AL contains the data in hex, the temperature in Celsius is the decimal
+equivalent.
+
+Ex: If AL contains 0x2A, the temperature is 42 degrees C.
+
+Reading tach information.
+The fan speed information is located in the following registers:
+		LSB	MSB
+Tach1		0x28	0x29	(Currently, this reflects the CPU
+				fan speed on all systems).
+Tach2		0x2A	0x2B
+Tach3		0x2C	0x2D
+Tach4		0x2E	0x2F
+
+Important!!!
+Reading the tach LSB locks the tach MSB.
+The LSB Must be read first.
+
+How to convert the tach reading to RPM.
+The tach reading (TCount) is given by:  (Tach MSB * 256) + (Tach LSB)
+The SIO counts the number of 90kHz (11.111us) pulses per revolution.
+RPM = 60/(TCount * 11.111us)
+
+Example:
+Reg 0x28 = 0x9B
+Reg 0x29 = 0x08
+
+TCount = 0x89B = 2203
+
+RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
+
+Obtaining the SIO version.
+
+CONFIGURATION SEQUENCE
+To program the configuration registers, the following sequence must be followed:
+1. Enter Configuration Mode
+2. Configure the Configuration Registers
+3. Exit Configuration Mode.
+
+Enter Configuration Mode
+To place the chip into the Configuration State The config key (0x55) is written
+to the CONFIG PORT (0x2E).
+
+Configuration Mode
+In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
+the DATA PORT is at INDEX PORT address + 1.
+
+The desired configuration registers are accessed in two steps:
+a.	Write the index of the Logical Device Number Configuration Register
+	(i.e., 0x07) to the INDEX PORT and then write the number of the
+	desired logical device to the DATA PORT.
+
+b.	Write the address of the desired configuration register within the
+	logical device to the INDEX PORT and then write or read the config-
+	uration register through the DATA PORT.
+
+Note: If accessing the Global Configuration Registers, step (a) is not required.
+
+Exit Configuration Mode
+To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
+The chip returns to the RUN State.  (This is important).
+
+Programming Example
+The following is an example of how to read the SIO Device ID located at 0x20
+
+; ENTER CONFIGURATION MODE
+MOV	DX,02EH
+MOV	AX,055H
+OUT	DX,AL
+; GLOBAL CONFIGURATION  REGISTER
+MOV	DX,02EH
+MOV	AL,20H
+OUT	DX,AL
+; READ THE DATA
+MOV	DX,02FH
+IN	AL,DX
+; EXIT CONFIGURATION MODE
+MOV	DX,02EH
+MOV	AX,0AAH
+OUT	DX,AL
+
+The registers of interest for identifying the SIO on the dc7100 are Device ID
+(0x20) and Device Rev  (0x21).
+
+The Device ID will read 0X6F
+The Device Rev currently reads 0x01
+
+Obtaining the HWM Base Address.
+The following is an example of how to read the HWM Base Address located in
+Logical Device 8.
+
+; ENTER CONFIGURATION MODE
+MOV	DX,02EH
+MOV	AX,055H
+OUT	DX,AL
+; CONFIGURE REGISTER CRE0,
+; LOGICAL DEVICE 8
+MOV	DX,02EH
+MOV	AL,07H
+OUT	DX,AL ;Point to LD# Config Reg
+MOV	DX,02FH
+MOV	AL, 08H
+OUT	DX,AL;Point to Logical Device 8
+;
+MOV	DX,02EH
+MOV	AL,60H
+OUT	DX,AL	; Point to HWM Base Addr MSB
+MOV	DX,02FH
+IN	AL,DX	; Get MSB of HWM Base Addr
+; EXIT CONFIGURATION MODE
+MOV	DX,02EH
+MOV	AX,0AAH
+OUT	DX,AL
Documentation/i2c/chips/smsc47b397.txt deleted +0 -146

146 lines not on this page · raw message

author
#43 lore raw

PATCH 1/1 I2C: KConfig update - some EXPERIMENTAL removal

[PATCH] I2C: KConfig update - some EXPERIMENTAL removal

Following patch removes EXPERIMENTAL flag from some of I2C bus and chip drivers. It is removed when the driver is in kernel at least from 2.6.3 and I generally think there is no problem with it.

Also this patch adds SiS 745 to help option of sis96x and it also fixes nForce2 driver entry to reflect current state.

---
commit 5d740fe9fefda41292b5cabe70f4f8eff9f8aad0
tree 974485c72963e94570b339276ebf5defc8197442
parent 828621dda6381093ceafbe9381b6118cae3f9b13
author [email protected] <[email protected]> Sat, 28 May 2005 11:26:24 +0000 committer Greg Kroah-Hartman <[email protected]> Tue, 21 Jun 2005 21:52:02 -0700

 drivers/i2c/busses/Kconfig |   34 +++++++++++++++++-----------------
 drivers/i2c/chips/Kconfig  |   12 ++++++------
 2 files changed, 23 insertions(+), 23 deletions(-)
drivers/i2c/busses/Kconfig +17 -17
@@ -7,7 +7,7 @@ menu "I2C Hardware Bus support"
 
 config I2C_ALI1535
 	tristate "ALI 1535"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the SMB
 	  Host controller on Acer Labs Inc. (ALI) M1535 South Bridges.  The SMB
@@ -31,7 +31,7 @@ config I2C_ALI1563
 
 config I2C_ALI15X3
 	tristate "ALI 15x3"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the
 	  Acer Labs Inc. (ALI) M1514 and M1543 motherboard I2C interfaces.
@@ -41,7 +41,7 @@ config I2C_ALI15X3
 
 config I2C_AMD756
 	tristate "AMD 756/766/768/8111 and nVidia nForce"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the AMD
 	  756/766/768 mainboard I2C interfaces.  The driver also includes
@@ -66,7 +66,7 @@ config I2C_AMD756_S4882
 
 config I2C_AMD8111
 	tristate "AMD 8111"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the
 	  second (SMBus 2.0) AMD 8111 mainboard I2C interface.
@@ -109,7 +109,7 @@ config I2C_HYDRA
 
 config I2C_I801
 	tristate "Intel 82801 (ICH)"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the Intel
 	  801 family of mainboard I2C interfaces.  Specifically, the following
@@ -130,7 +130,7 @@ config I2C_I801
 
 config I2C_I810
 	tristate "Intel 810/815"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the Intel
@@ -183,7 +183,7 @@ config I2C_IOP3XX
 
 config I2C_ISA
 	tristate "ISA Bus support"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	help
 	  If you say yes to this option, support will be included for i2c
 	  interfaces that are on the ISA bus.
@@ -248,12 +248,11 @@ config I2C_MPC
 	  will be called i2c-mpc.
 
 config I2C_NFORCE2
-	tristate "Nvidia Nforce2"
-	depends on I2C && PCI && EXPERIMENTAL
+	tristate "Nvidia nForce2, nForce3 and nForce4"
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the Nvidia
-	  Nforce2 family of mainboard I2C interfaces.
-	  This driver also supports the nForce3 Pro 150 MCP.
+	  nForce2, nForce3 and nForce4 families of mainboard I2C interfaces.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-nforce2.
@@ -305,7 +304,7 @@ config I2C_PARPORT_LIGHT
 
 config I2C_PROSAVAGE
 	tristate "S3/VIA (Pro)Savage"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the
@@ -388,7 +387,7 @@ config SCx200_ACB
 
 config I2C_SIS5595
 	tristate "SiS 5595"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the 
 	  SiS5595 SMBus (a subset of I2C) interface.
@@ -398,7 +397,7 @@ config I2C_SIS5595
 
 config I2C_SIS630
 	tristate "SiS 630/730"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the 
 	  SiS630 and SiS730 SMBus (a subset of I2C) interface.
@@ -408,7 +407,7 @@ config I2C_SIS630
 
 config I2C_SIS96X
 	tristate "SiS 96x"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the SiS
 	  96x SMBus (a subset of I2C) interfaces.  Specifically, the following
@@ -419,6 +418,7 @@ config I2C_SIS96X
 	    648/961
 	    650/961
 	    735
+	    745
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-sis96x.
@@ -449,7 +449,7 @@ config I2C_VIA
 
 config I2C_VIAPRO
 	tristate "VIA 82C596/82C686/823x"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	help
 	  If you say yes to this option, support will be included for the VIA
 	  82C596/82C686/823x I2C interfaces.  Specifically, the following 
@@ -467,7 +467,7 @@ config I2C_VIAPRO
 
 config I2C_VOODOO3
 	tristate "Voodoo 3"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	select I2C_ALGOBIT
 	help
 	  If you say yes to this option, support will be included for the
drivers/i2c/chips/Kconfig +6 -6
@@ -11,7 +11,7 @@ config I2C_SENSOR
 
 config SENSORS_ADM1021
 	tristate "Analog Devices ADM1021 and compatibles"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for Analog Devices ADM1021 
@@ -125,7 +125,7 @@ config SENSORS_FSCPOS
 
 config SENSORS_GL518SM
 	tristate "Genesys Logic GL518SM"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for Genesys Logic GL518SM
@@ -147,7 +147,7 @@ config SENSORS_GL520SM
 
 config SENSORS_IT87
 	tristate "ITE IT87xx and compatibles"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for ITE IT87xx sensor chips
@@ -171,7 +171,7 @@ config SENSORS_LM63
 
 config SENSORS_LM75
 	tristate "National Semiconductor LM75 and compatibles"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for National Semiconductor LM75
@@ -341,7 +341,7 @@ config SENSORS_SMSC47M1
 
 config SENSORS_VIA686A
 	tristate "VIA686A"
-	depends on I2C && PCI && EXPERIMENTAL
+	depends on I2C && PCI
 	select I2C_SENSOR
 	select I2C_ISA
 	help
@@ -353,7 +353,7 @@ config SENSORS_VIA686A
 
 config SENSORS_W83781D
 	tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for the Winbond W8378x series
#44 lore raw

Re: [PATCH] I2C: add i2c driver for TPS6501x

In reply to Greg KH

Hi Greg, David,

Quoted 5 lines

[PATCH] I2C: add i2c driver for TPS6501x

This adds an I2C driver for the TPS6501x series of power management chips. It's used on many OMAP based boards, and this driver has been widely used in the Linux-OMAP trees over the last year or so.

There is a pending cleanup patch for this driver. It was posted by David on the lm-sensors mailing list on May 27th:
http://lists.lm-sensors.org/pipermail/lm-sensors/2005-May/012409.html
Greg, Can you please add this patch to your i2c tree?

Note that I am not entierly happy with this driver even after the patch is applied. It tries to load several times when the initial attempt fails. That's ugly and inefficient. The retries should be done on failed bus reads, rather than reloading the driver entirely on each error, so that as few actions as possible are retried. Or the bus driver could be improved to deal with errors at a lower level.

David, could you please work on a patch implementing either solution?

Thanks,

Signature · 1 line
Jean Delvare
#45 lore raw

[lm-sensors] Re: [PATCH] I2C: add i2c driver for TPS6501x

Quoted 4 lines

There is a pending cleanup patch for this driver. It was posted by David on the lm-sensors mailing list on May 27th:
http://lists.lm-sensors.org/pipermail/lm-sensors/2005-May/012409.html
Greg, Can you please add this patch to your i2c tree?

I'll post a refreshed version with a signed-off-by-yours-truly line. It may even have a bugfix for H3 boards, TBD ... :)

That same thread also has an I2C doc patch I sent, which hasn't yet been merged. (No point in telling folk to use the ID fields, they aren't normallly necessary and aren't described enough to be usable.)

Quoted 4 lines

Note that I am not entierly happy with this driver even after the patch is applied. It tries to load several times when the initial attempt fails. That's ugly and inefficient. The retries should be done on failed bus reads,

It's not clear that'd work. It seems like a hardware startup glitch specific to the H2 board, but nobody's had a lot of luck chasing down a better fix than the one you don't like. I'm told H2 boards are now available enough that some Universities are going to have them ... maybe we can plant a bug in some students' ears that will lead to a better software-only fix!

Quoted 5 lines

rather than reloading the driver entirely on each error, so
that as few actions as possible are retried. Or the bus driver could be improved to deal with errors at a lower level.

David, could you please work on a patch implementing either solution?

When I have some time I'll take another poke at the problem. No promises ... that is after all the best known fix.

On the other hand, it's been pointed out offline that the OMAP I2C bus driver hasn't been submitted yet, so maybe a look at that will turn up key issues. It's a more traditional I2C bus driver ... not an atypical I2C chip driver that needs to use IRQs and (in lieu of that pending async I2C API!) workqueues, exporting an API that's more at the level of ACPI power management internals than anything else. :)

- Dave