1. 15 7月, 2008 3 次提交
    • J
      i2c: Add detection capability to new-style drivers · 4735c98f
      Jean Delvare 提交于
      Add a mechanism to let new-style i2c drivers optionally autodetect
      devices they would support on selected buses and ask i2c-core to
      instantiate them. This is a replacement for legacy i2c drivers, much
      cleaner.
      
      Where drivers had to implement both a legacy i2c_driver and a
      new-style i2c_driver so far, this mechanism makes it possible to get
      rid of the legacy i2c_driver and implement both enumerated and
      detected device support with just one (new-style) i2c_driver.
      
      Here is a quick conversion guide for these drivers, step by step:
      
      * Delete the legacy driver definition, registration and removal.
        Delete the attach_adapter and detach_client methods of the legacy
        driver.
      
      * Change the prototype of the legacy detect function from
          static int foo_detect(struct i2c_adapter *adapter, int address, int kind);
        to
          static int foo_detect(struct i2c_client *client, int kind,
          			  struct i2c_board_info *info);
      
      * Set the new-style driver detect callback to this new function, and
        set its address_data to &addr_data (addr_data is generally provided
        by I2C_CLIENT_INSMOD.)
      
      * Add the appropriate class to the new-style driver. This is
        typically the class the legacy attach_adapter method was checking
        for. Class checking is now mandatory (done by i2c-core.) See
        <linux/i2c.h> for the list of available classes.
      
      * Remove the i2c_client allocation and freeing from the detect
        function. A pre-allocated client is now handed to you by i2c-core,
        and is freed automatically.
      
      * Make the detect function fill the type field of the i2c_board_info
        structure it was passed as a parameter, and return 0, on success. If
        the detection fails, return -ENODEV.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      4735c98f
    • J
      i2c: Delete unused function i2c_smbus_write_quick · 67c2e665
      Jean Delvare 提交于
      Function i2c_smbus_write_quick has no users left, so we can delete it.
      
      Also update the list of these helper functions which are gone but
      could be added back if needed.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      67c2e665
    • D
      i2c-core: Return -Errno, not -1 · 24a5bb7b
      David Brownell 提交于
      More updates to the I2C stack's fault reporting:  make the core stop
      returning "-1" (usually "-EPERM") for all faults.  Instead, pass lower
      level fault code up the stack, or return some appropriate errno.
      
      This patch happens to touch almost exclusively SMBus calls.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      24a5bb7b
  2. 02 7月, 2008 1 次提交
  3. 30 4月, 2008 1 次提交
    • J
      i2c: Add support for device alias names · d2653e92
      Jean Delvare 提交于
      Based on earlier work by Jon Smirl and Jochen Friedrich.
      
      This patch allows new-style i2c chip drivers to have alias names using
      the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
      point, the old i2c driver binding scheme (driver_name/type) is still
      supported.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Jochen Friedrich <jochen@scram.de>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      d2653e92
  4. 28 1月, 2008 1 次提交
  5. 12 7月, 2007 1 次提交
    • J
      i2c: Fix the i2c_smbus_read_i2c_block_data() prototype · 4b2643d7
      Jean Delvare 提交于
      Let the drivers specify how many bytes they want to read with
      i2c_smbus_read_i2c_block_data(). So far, the block count was
      hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
      Many driver authors complained about this before, and I believe it's
      about time to fix it. Right now, authors have to do technically stupid
      things, such as individual byte reads or full-fledged I2C messaging,
      to work around the problem. We do not want to encourage that.
      
      I even found that some bus drivers (e.g. i2c-amd8111) already
      implemented I2C block read the "right" way, that is, they didn't
      follow the old, broken standard. The fact that it was never noticed
      before just shows how little i2c_smbus_read_i2c_block_data() was used,
      which isn't that surprising given how broken its prototype was so far.
      
      There are some obvious compatiblity considerations:
      * This changes the i2c_smbus_read_i2c_block_data() prototype. Users
        outside the kernel tree will notice at compilation time, and will
        have to update their code.
      * User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
        the changed expectations would affect tools such as i2cdump. In order
        to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
        a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
        old numeric value. When i2c-dev receives a transaction with the
        old value, it can convert it to the new format on the fly.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      4b2643d7
  6. 02 5月, 2007 4 次提交
  7. 14 2月, 2007 1 次提交
    • D
      i2c: Add driver suspend/resume/shutdown support · f37dd80a
      David Brownell 提交于
      Driver model updates for the I2C core:
      
       - Add new suspend(), resume(), and shutdown() methods.  Use them in the
         standard driver model style; document them.
      
       - Minor doc updates to highlight zero-initialized fields in drivers, and
         the driver model accessors for "clientdata".
      
      If any i2c drivers were previously using the old suspend/resume calls
      in "struct driver", they were getting warning messages ... and will
      now no longer work.  Other than that, this patch changes no behaviors;
      and it lets I2C drivers use conventional PM and shutdown support.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      f37dd80a
  8. 06 1月, 2006 4 次提交
  9. 08 11月, 2005 1 次提交
  10. 31 10月, 2005 1 次提交
  11. 29 10月, 2005 2 次提交
  12. 06 9月, 2005 6 次提交
    • J
      [PATCH] I2C: Rewrite i2c_probe · a89ba0bc
      Jean Delvare 提交于
      i2c_probe was quite complex and slow, so I rewrote it in a more
      efficient and hopefully clearer way.
      
      Note that this slightly changes the way the module parameters are
      handled. This shouldn't change anything for the most common cases
      though.
      
      For one thing, the function now respects the order of the parameters
      for address probing. It used to always do lower addresses first. The
      new approach gives the user more control.
      
      For another, ignore addresses don't overrule probe addresses anymore.
      This could have been restored the way it was at the cost of a few more
      lines of code, but I don't think it's worth it. Both lists are given
      as module parameters, so a user would be quite silly to specify the
      same addresses in both lists. The normal addresses list is the only
      one that isn't controlled by a module parameter, thus is the only one
      the user may reasonably want to remove an address from.
      
      Another significant change is the fact that i2c_probe() will no more
      stop when a detection function returns -ENODEV. Just because a driver
      found a chip it doesn't support isn't a valid reason to stop all
      probings for this one driver. This closes the long standing lm_sensors
      ticket #1807.
      
        http://www2.lm-sensors.nu/~lm78/readticket.cgi?ticket=1807
      
      I updated the documentation accordingly.
      
      In terms of algorithmic complexity, the new code is way better. If
      I is the ignore address count, P the probe address count, N the
      normal address count and F the force address count, the old code
      was doing 128 * (F + I + P + N) iterations max, while the new code
      does F + P + ((I+1) * N) iterations max. For the most common case
      where F, I and P are empty, this is down from 128 * N to N.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a89ba0bc
    • J
      [PATCH] hwmon: hwmon vs i2c, second round (06/11) · f4b50261
      Jean Delvare 提交于
      The only thing left in i2c-sensor.h are module parameter definition
      macros. It's only an extension of what i2c.h offers, and this extension
      is not sensors-specific. As a matter of fact, a few non-sensors drivers
      use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h
      altogether.
      Signed-off-by: NJean Delvare <khali@linux-fr>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f4b50261
    • J
      [PATCH] hwmon: hwmon vs i2c, second round (04/11) · 2ed2dc3c
      Jean Delvare 提交于
      i2c_probe and i2c_detect now do the exact same thing and operate on
      the same data structure, so we can have everyone call i2c_probe.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2ed2dc3c
    • J
      [PATCH] I2C: refactor message in i2c_detach_client · 7bef5594
      Jean Delvare 提交于
      We could refactor the error message 34 different i2c drivers print if
      i2c_detach_client() fails in this function itself. Saves quite a few
      lines of code. Documentation is updated to reflect that change.
      
      Note that this patch should be applied after Rudolf Marek's w83792d
      patches.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7bef5594
    • J
      [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (8/9) · 02ff982c
      Jean Delvare 提交于
      Kill all uses of i2c_is_isa_adapter except for the hybrid drivers (it87,
      lm78, w83781d). The i2c-isa adapter not being registered with the i2c
      core anymore, drivers don't have to fear being erroneously attached to
      it.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      02ff982c
    • J
      [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9) · 5071860a
      Jean Delvare 提交于
      Kill normal_isa in header files, documentation and all chip drivers, as
      it is no more used.
      
      normal_i2c could be renamed to normal, but I decided not to do so at the
      moment, so as to limit the number of changes. This might be done later
      as part of the i2c_probe/i2c_detect merge.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5071860a
  13. 12 7月, 2005 1 次提交
  14. 22 6月, 2005 1 次提交
    • J
      [PATCH] I2C: Kill address ranges in non-sensors i2c chip drivers · b3d5496e
      Jean Delvare 提交于
      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).
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      Index: gregkh-2.6/Documentation/i2c/writing-clients
      ===================================================================
      b3d5496e
  15. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4