Commit Graph
52 Commits
Author SHA1 Message Date
Jean Delvare 239b3d0344 Backport memory allocation reworking from Linux 2.6.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2445 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-17 17:20:01 +00:00
Jean Delvare 32b628a4fa Fix bogus memset. Reported by Ralf Roesch.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2401 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-29 17:25:15 +00:00
Jean Delvare 1da4a32706 Remove memtype completely.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2222 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-01-17 11:14:00 +00:00
Jean Delvare eeea6d92b7 Whitespace changes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2104 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-11-29 13:18:55 +00:00
Mark D. Studebaker 9098477852 add failure printks
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2094 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-11-26 03:17:01 +00:00
Jean Delvare 787a1efef1 Get rid of EEPROM memory types, they were unused. This is a
backport from Linux 2.6 (sort of).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1997 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-09-24 21:05:40 +00:00
Jean Delvare bc34ae1749 Divide the eeproms into slices to speed reads up.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1970 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-08-23 19:20:31 +00:00
Jean Delvare 52df8b5abf Use capable() to protect Vaio's passwords and other security-
related data.
        Simplify the sysctl callback function.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1967 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-08-16 12:05:36 +00:00
Jean Delvare da916a854b Ignore Sony Vaio EEPROMs with a password set (override
with force parameter).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1949 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-08-09 14:18:13 +00:00
Jean Delvare 7c3528bebb Trivial and pointless code optimization.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1933 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-08-01 16:14:56 +00:00
Kyosti Malkki 1cfe63804a (Kyösti) Cleanups
Copy sysctl enums to chip drivers from sensors.h for now,
   as seen in drivers included in 2.5 tree. File no longer included
   from kernel side.

   Apply i2c-proc change in CVS tagged -km2.

   Partial clean and sort of includes everywhere.

   Add i2c-dev.h, as a partial copy from i2c.
   Add to sensors.h from i2c-proc.h to compile things.
   Remove i2c-isa.h.

   Reflect header file changes to lib/ and prog/.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1705 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-01-21 20:01:27 +00:00
Kyosti Malkki 39391ba6ea (Kyösti) some cleanups for 2.4+
Module refcounting using .owner, removing of inc/dec_use.
   These require (yet unreleased) i2c 2.8.0+.

   Named initializers everywhere. Unified namespace.

   Cleanup for 2.5, remove EXPORT_NO_SYMBOLS, declare everything
   static. Apply initcalls.

   PCI device registration changes for busses started, replicating
   from i2c-amd*. While everything does compile, nothing really
   works. Well, maybe i2c-amd* ported back from 2.5 tree.

   After updating your work directory, run
    > cvs diff -u -r LAST-PRE-2-8-I2C > lm-2.8-patches-1

   BEWARE: I have not even insmoded any of these yet.

   To compile, you need i2c from cvs too.
   For 2.4 kernel :
    > cvs co -r lk2-4 i2c

   For 2.5 kernel :
    > cvs co i2c


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1698 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-01-17 01:19:52 +00:00
Mark D. Studebaker 8ddee6dd5c better handling of read errors
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1689 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-01-05 16:00:57 +00:00
Mark D. Studebaker 3978a26e03 correct functionality detection for i2c block
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1688 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-01-05 05:53:15 +00:00
Mark D. Studebaker 454e70e79a use i2c block reads if that functionality is available.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1686 7894878c-1315-0410-8ee3-d5d059ff63e0
2003-01-05 01:33:34 +00:00
Mark D. Studebaker 76eeba555b don't corrupt 24RF08's when checksum == 1.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1522 7894878c-1315-0410-8ee3-d5d059ff63e0
2002-09-07 19:16:24 +00:00
Mark D. Studebaker f3beaa1809 rename /proc entries from "data16-31" to simply "10" (hex)
which is shorter, simpler, easier to use in scripts,
      and the best reason is that it's alphabetical so that
      "cat *" output is in the correct order.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1321 7894878c-1315-0410-8ee3-d5d059ff63e0
2002-02-16 16:33:57 +00:00
Mark D. Studebaker eaf609b21d add /proc entries for bytes 128-255; patch from
Jean Delvare <delvare@ensicaen.ismra.fr>


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1310 7894878c-1315-0410-8ee3-d5d059ff63e0
2002-02-09 16:33:33 +00:00
Mark D. Studebaker 9c3fc08f51 clean up some confusing (still untested) write code inside #if 0.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1269 7894878c-1315-0410-8ee3-d5d059ff63e0
2001-12-19 00:44:35 +00:00
Mark D. Studebaker 7bd97f4667 Add MODULE_LICENSE("GPL") to all modules
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1201 7894878c-1315-0410-8ee3-d5d059ff63e0
2001-10-13 17:48:43 +00:00
Mark D. Studebaker 5c91c75f11 malloc.h -> slab.h
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1193 7894878c-1315-0410-8ee3-d5d059ff63e0
2001-09-29 18:32:15 +00:00
Mark D. Studebaker a21694024e Change from sensors_x to i2c_x for x =
_sysctl_real
		_register_entry
		_proc_real
		_detect
		_deregister_entry
		_chips_data
      which were the global symbols renamed in i2c-proc.[ch] in the
      i2c package.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1101 7894878c-1315-0410-8ee3-d5d059ff63e0
2001-05-27 22:49:28 +00:00
Mark D. Studebaker b5d014bd46 Disable sensors.c and i2c-isa.h in the Module.mk files.
Leave the files there for now.
      Remove old installed sensors.o in kernel/Module.mk.
      sensors.c was moved to i2c-proc.c in the i2c package.
      i2c-isa.h was appended to i2c.h in the i2c package.
      Delete all but the SYSCTL and ALARMS definitions in sensors.h,
      as the rest of the file was moved to i2c-proc.h in the i2c package.
      Remove #include "i2c-isa.h" lines in all chip drivers and
      in bus driver i2c-isa.c.
      This all probably breaks mkpatch.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1015 7894878c-1315-0410-8ee3-d5d059ff63e0
2001-02-06 02:53:46 +00:00
Frodo Looijaard aa0c8f6768 Updated the MUTEX definitions again - they are now guarded by
the horrible
         #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \
             (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0))
        They should now both work with 2.3 kernels (including 2.4 prepatches)
        and very new 2.2 kernels (ie. 2.2.18 prepatches)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@933 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-11-22 23:54:39 +00:00
Frodo Looijaard 4444c1464a Applied patch of Chip Salzenberg <chip@valinux.com>:
Better #ifdefs


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@929 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-11-18 11:38:15 +00:00
Mark D. Studebaker ac7ace0484 (mds) changed refresh time from 1.5 seconds to 5 minutes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@717 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-01-30 01:21:49 +00:00
Mark D. Studebaker 30fa84cbfd (mds) remove functionality check for WRITE_WORD
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@710 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-01-28 00:46:11 +00:00
Frodo Looijaard 6a2c82b491 `indent -kr -i8' on all kernel sources
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@707 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-01-24 20:37:01 +00:00
Frodo Looijaard 888d32f50b Removing kernel 2.0 and 2.1 compatibility pass 2
Eliminated compat.h


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@705 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-01-24 20:07:29 +00:00
Frodo Looijaard 9480bb5988 Removal of kernel 2.1 and 2.2 compatibility: pass one
Removed many #if statements


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@704 7894878c-1315-0410-8ee3-d5d059ff63e0
2000-01-24 19:30:08 +00:00
Frodo Looijaard fd545796ee Changes regarding the new i2c_check_addr function
Changes in sensors.c:

  sensors_detect now skips addresses which are already taken. Even a
  force parameter can not override this, as it could lead to major
  problems.
  For ISA addresses, the same is done; but the client drivers still need
  a check if they claim more than one ISA address (as all of the current
  ISA clients do).

Changes in chip drivers:

  Removed the comment about needing address registration

Changes in i2cdetect.c:

  Marks addresses which are already claimed

Changes in sensors-detect:

  Warns when an address is already claimed, and skips it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@667 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-12-08 20:37:09 +00:00
Frodo Looijaard 5059c482fd Just to make sure, added `#include <linux/version.h>' at several
other places.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@645 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-12-01 00:48:34 +00:00
Frodo Looijaard 52b2ce8f52 Patches to make it compatible with kernel 2.3.27 and newer
* Improved monitoring of /proc directories
  Instead of doing:
         proc_bus_i2c->fill_inode = &monitor_bus_i2c;
         void monitor_bus_i2c(struct inode *inode, int fill)
         {
           if (fill)
             MOD_INC_USE_COUNT;
           else
             MOD_DEC_USE_COUNT;
         }
  you can now simply set:
         proc_bus_i2c->owner = THIS_MODULE;
  and this is just as good!
* An old 2.3 problem seemingly never was resolved yet: instead of using
  a *wait_queue directly, you have to use a wait_queue_head_t and
  initialize it properly:
         #if (LINUX_VERSION_CODE < 0x020301)
         static struct wait_queue *pcf_wait = NULL;
         #else
         static wait_queue_head_t pcf_wait;
         #endif

         #if (LINUX_VERSION_CODE >= 0x020301)
            init_waitqueue_head(&pcf_wait);
         #endif
  except for this, semantics remain the same (but using a plain
  wait_queue_head_t instead of a pointer to a wait_queue)
* I had to change the semantics of sensors_register_entry slightly,
  to make the monitoring of /proc/sys/dev/* files possible for kernels
  2.3.27 and newer. It now takes an additional parameter, which you
  can specify as THIS_MODULE.
* THIS_MODULE is only defined in kernels 2.3.13 and later; added
  it to compat.h and the compatibility section of mkpatch.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@640 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-11-30 20:48:43 +00:00
Frodo Looijaard 52781e50b4 Preparations for better 10-bit address support
Updated for the changes in i2c_smbus_* functions


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@585 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-09-27 16:01:24 +00:00
Frodo Looijaard 9d88e65c71 `functionality' checking for clients implemented
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@584 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-09-27 14:19:46 +00:00
Frodo Looijaard 68a31e3480 Some code cleanups
* Removed several superfluous (struct i2c_client *) casts (they were left
  from the time we had separate structs for smbus and isa)
* Removed the internal lists of registered clients
  They have not been used for quite some time now, took memory space,
  and limited the maximum number of clients that could be registered.

Also removed two small Makefile errors - I am happy I caught them before
the next release!


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@582 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-09-27 13:20:45 +00:00
Frodo Looijaard acd5a15556 (Frodo) Massive commit of all things related to mkpatch. Let's just say
it works great now.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@516 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-07-23 23:43:13 +00:00
Frodo Looijaard fcbe78a669 First step to make it possible to integrate lm_sensors modules into
the kernel.

* <kernel/init.h> is now included for all modules
* Initialization-time only functions and variables are marked with __init
* EXPORT_SYMBOL or EXPORT_NO_SYMBOLS declarations added


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@513 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-07-23 11:43:58 +00:00
Kyosti Malkki 3014204a0d (Kyösti)
* renamed every smbus_*  access to i2c_smbus_*
 * everything in lm_sensors2/kernel/* compiles nicely :)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@499 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-07-20 22:46:49 +00:00
Frodo Looijaard 24e547b88e First round of lm_sensors changes for the new I2C tree
* The i2c package can no longer be compiled as part of the lm_sensors tree
* The archive of the i2c package is removed
* smbus, i2c-dev and i2c-proc modules and headers have been removed; they
  are now completely integrated into the i2c package
* The fake i2c.h header has been removed; this also allowed us to remove
  the ugly LM_SENSORS and TBD defines.
* A new variable I2C_HEADERS is introduced in the Makefile. This allows
  us to install the i2c headers in, for example, /usr/local/include/linux.
* All files now include <linux/i2c.h> instead of "i2c.h" and "smbus.h"

Status: 'make dep' works, all the right include files are found. 'make all'
         does not yet work.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@496 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-07-19 11:45:27 +00:00
Frodo Looijaard f1888417ca Bradley M. Keryan's patches to make lm_sensors compile against
2.3.x kernels (x >= 1).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@467 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-06-02 18:19:38 +00:00
Frodo Looijaard 1e88cbd54e Added insmod parameters to eeprom module, and fixed a typo in the
gl518sm module

Besides the usual parameters, eeprom.o understands insmod parameter 'checksum'.
Set it to one (ie. 'modprobe eeprom checksum=1') to make it ignore any
chips which do not come through the checksum.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@371 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-04-08 18:31:08 +00:00
Mark D. Studebaker c0c25c9c14 changed /proc permissions for vid and alarms and
other r/o stuff to 444.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@333 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-03-22 02:21:21 +00:00
Philip Edelbrock 7a9eb38752 (Phil) Made sure probing won't happen on the ISA bus for these SMBus/I2C
device drivers.  Specifically, I added these lines:

(in includes list)

#include "i2c-isa.h"


(Near beginning of *-attach-adapter function)

  /* Make sure we aren't probing the ISA bus!! */
  if (i2c_is_isa_adapter(adapter)) return 0;

This may be redundant is a couple of the files, but it shouldn't hurt.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@283 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-28 21:11:14 +00:00
Frodo Looijaard d78cd0cb5f Removed some compiler warnings
All our own code (ie. anything not in the i2c directory) compiles now without
warnings, even with WARN=1 (which sets -Wall -Wstrict-prototypes -Wshadow
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wnested-externs
-Winline). There is one exception: the lex code (conf-lex.l) complains about
unused functions. That's flex' fault, not ours!

The i2c code still emits many warnings with the above flags; that's Simon's
problem.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@233 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-16 21:59:05 +00:00
Frodo Looijaard 24792039f6 Adrian's copyright patch applied
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@207 7894878c-1315-0410-8ee3-d5d059ff63e0
1999-02-08 22:50:29 +00:00
Frodo Looijaard 750e0d00aa Slightly better copyright messages, now telling what the file belongs
to.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@96 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-20 17:04:11 +00:00
Philip Edelbrock b47bfd40c2 (Phil) Fixed some bugs in src/eeprom.c and added more stuff
to /prog/eeprom/decode-dimms.pl


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@94 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-20 07:48:16 +00:00
Philip Edelbrock de722b68e4 (Phil) Added some eeprom docs/tools and fixed some typos while I was at it.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@79 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-15 04:55:51 +00:00
Philip Edelbrock 446a74bd6a (Phil) Fixed some bugs and added read support for 128 bytes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@76 7894878c-1315-0410-8ee3-d5d059ff63e0
1998-12-14 00:31:22 +00:00