1. 14 2月, 2007 3 次提交
  2. 04 1月, 2007 1 次提交
    • D
      i2c: Migration aids for i2c_adapter.dev removal · b119dc3f
      David Brownell 提交于
      Flag i2c_adapter.dev for removal after userspace tools get upgraded, and
      include a near-term code migration aid to facilitate this:
      
       - The class device gets the name attribute it should have had.  This
         was previously (wrongly) associated with the i2c_adapter.dev node.
         Sysfs based tools and libraries can start converting right away.
      
       - Issue a warning for legacy adapter drivers that don't provide any
         physical device node; so systems with those drivers will know to
         fix this problem earlier.
      
      This is one of a series of patches to help the I2C stack become a better
      citizen of the Linux Driver Model world.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      b119dc3f
  3. 11 12月, 2006 3 次提交
  4. 01 10月, 2006 1 次提交
  5. 27 9月, 2006 3 次提交
  6. 13 7月, 2006 1 次提交
  7. 23 6月, 2006 1 次提交
  8. 24 3月, 2006 4 次提交
  9. 07 2月, 2006 1 次提交
  10. 14 1月, 2006 1 次提交
  11. 06 1月, 2006 7 次提交
  12. 30 10月, 2005 1 次提交
  13. 29 10月, 2005 6 次提交
    • J
      [PATCH] i2c: SMBus PEC support rewrite, 2 of 3 · 421ef47b
      Jean Delvare 提交于
      This is my rewrite of the SMBus PEC support. The original
      implementation was known to have bugs (credits go to Hideki Iwamoto
      for reporting many of them recently), and was incomplete due to a
      conceptual limitation.
      
      The rewrite affects only software PEC. Hardware PEC needs very little
      code and is mostly untouched.
      
      Technically, both implementations differ in that the original one
      was emulating PEC in software by modifying the contents of an
      i2c_smbus_data union (changing the transaction to a different type),
      while the new one works one level lower, on i2c_msg structures (working
      on message contents). Due to the definition of the i2c_smbus_data union,
      not all SMBus transactions could be handled (at least not without
      changing the definition of this union, which would break user-space
      compatibility), and those which could had to be implemented
      individually. At the opposite, adding PEC to an i2c_msg structure
      can be done on any SMBus transaction with common code.
      
      Advantages of the new implementation:
      
      * It's about twice as small (from ~136 lines before to ~70 now, only
        counting i2c-core, including blank and comment lines). The memory
        used by i2c-core is down by ~640 bytes (~3.5%).
      
      * Easier to validate, less tricky code. The code being common to all
        transactions by design, the risk that a bug can stay uncovered is
        lower.
      
      * All SMBus transactions have PEC support in I2C emulation mode
        (providing the non-PEC transaction is also implemented). Transactions
        which have no emulation code right now will get PEC support for free
        when they finally get implemented.
      
      * Allows for code simplifications in header files and bus drivers
        (patch follows).
      
      Drawbacks (I guess there had to be at least one):
      
      * PEC emulation for non-PEC capable non-I2C SMBus masters was dropped.
        It was based on SMBus tricks and doesn't quite fit in the new design.
        I don't think it's really a problem, as the benefit was certainly
        not worth the additional complexity, but it's only fair that I at
        least mention it.
      
      Lastly, let's note that the new implementation does slightly affect
      compatibility (both in kernel and user-space), but doesn't actually
      break it. Some defines will be dropped, but the code can always be
      changed in a way that will work with both the old and the new
      implementations. It shouldn't be a problem as there doesn't seem to be
      many users of SMBus PEC to date anyway.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      421ef47b
    • L
      [PATCH] Owner field additions to many i2c drivers, 4 of 5 · 6586bcd7
      Laurent Riffard 提交于
      This patch updates the .owner field for the i2c core struct xxxx_driver
      variables.
      Signed-off-by: NLaurent Riffard <laurent.riffard@free.fr>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6586bcd7
    • J
      [PATCH] i2c: Drop I2C_SMBUS_I2C_BLOCK_MAX · 30dac746
      Jean Delvare 提交于
      Drop I2C_SMBUS_I2C_BLOCK_MAX, use I2C_SMBUS_BLOCK_MAX instead.
      
      I2C_SMBUS_I2C_BLOCK_MAX has always been defined to the same value as
      I2C_SMBUS_BLOCK_MAX, and this will never change: setting it to a lower
      value would make no sense, setting it to a higher value would break
      i2c_smbus_data compatibility. There is no point in changing
      i2c_smbus_data to support larger block transactions in SMBus mode, as
      no SMBus hardware supports more than 32 byte blocks. Thus, for larger
      transactions, direct I2C transfers are the way to go.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      30dac746
    • H
      [PATCH] i2c: Several PEC-related fixes in software SMBus emulation · 5c50d188
      Hideki Iwamoto 提交于
      Fix several errors in I2C SMBus emulation when PEC is used:
      * Weird logic error in SMBus Write Word transactions.
      * Wrong buffer size, affecting SMBus Block Write transactions.
      * Potential buffer overrun in SMBus Block Write transactions.
      
      From: Hideki Iwamoto <h-iwamoto@kit.hi-ho.ne.jp>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/i2c/i2c-core.c |    8 ++++----
       1 file changed, 4 insertions(+), 4 deletions(-)
      5c50d188
    • J
      [PATCH] i2c: Adjust i2c_probe() for busses without SMBUS_QUICK · 4366dc94
      Jean Delvare 提交于
      Move the check for SMBUS_QUICK in i2c_probe() after the forced
      addresses have been handled. This makes it possible for a driver to
      leave the probed address lists empty, only providing forced addresses,
      and get i2c_probe to work even if the bus doesn't support SMBUS_QUICK.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
       drivers/i2c/i2c-core.c |   15 +++++++++++----
       1 file changed, 11 insertions(+), 4 deletions(-)
      4366dc94
    • R
      [PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks · 9480e307
      Russell King 提交于
      In PM v1, all devices were called at SUSPEND_DISABLE level.  Then
      all devices were called at SUSPEND_SAVE_STATE level, and finally
      SUSPEND_POWER_DOWN level.  However, with PM v2, to maintain
      compatibility for platform devices, I arranged for the PM v2
      suspend/resume callbacks to call the old PM v1 suspend/resume
      callbacks three times with each level in order so that existing
      drivers continued to work.
      
      Since this is obsolete infrastructure which is no longer necessary,
      we can remove it.  Here's an (untested) patch to do exactly that.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9480e307
  14. 06 9月, 2005 7 次提交
    • J
      [PATCH] I2C: Centralize 24RF08 corruption prevention · 4c9337da
      Jean Delvare 提交于
      The 24RF08 corruption would better be prevented at i2c-core level than
      at chip driver level, for several reasons:
      * The second quick write should happen as soon as possible after the
        first one, so as to limit the risk that another command is issued on
        the bus inbetween, causing the corruption.
      * As a matter of fact, the protection code at driver level was reworked
        at least three times already, which proves how hard it is to get it
        right there, while it's straightforward at i2c-core level.
      * It's easy to add a new driver that would need the protection, and
        forget to add it. This did happen already.
      * As additional probing addresses can be passed to most i2c chip drivers
        as module parameters, virtually every i2c chip driver would need the
        protection if we want to be really safe.
      * Why duplicate code when we can easily avoid it?
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4c9337da
    • 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 (01/11) · 9fc6adfa
      Jean Delvare 提交于
      Add support for kind-forced addresses to i2c_probe, like i2c_detect
      has for (essentially) hardware monitoring drivers.
      
      Note that this change will slightly increase the size of the drivers
      using I2C_CLIENT_INSMOD, with no immediate benefit. This is a
      requirement if we want to merge i2c_probe and i2c_detect though, and
      seems a reasonable price to pay in comparison with the previous
      cleanups which saved much more than that (such as the i2c-isa cleanup
      or the i2c address ranges removal.)
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9fc6adfa
    • J
      [PATCH] I2C: Improve core debugging messages · b6d7b3d1
      Jean Delvare 提交于
      The debugging messages in i2c-core are more confusing than helpful. Some
      lack their trailing newline, some lack a prefix, some are redundant,
      some lack precious information. Here is my attempt to introduce some
      standardization in there.
      
      I also changed two messages in i2c-dev to make it clear they come from
      i2c-dev.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b6d7b3d1
    • J
      [PATCH] I2C: inline i2c_adapter_id · cdcb1921
      Jean Delvare 提交于
      We could inline i2c_adapter_id, as it is really, really short. Doing
      so saves a few bytes both in i2c-core and in the drivers using this
      function.
      
                                                  before     after      diff
      drivers/hwmon/adm1026.ko                     41344     41305       -39
      drivers/hwmon/asb100.ko                      27325     27246       -79
      drivers/hwmon/gl518sm.ko                     20824     20785       -39
      drivers/hwmon/it87.ko                        26419     26380       -39
      drivers/hwmon/lm78.ko                        21424     21385       -39
      drivers/hwmon/lm85.ko                        41034     40939       -95
      drivers/hwmon/w83781d.ko                     39561     39514       -47
      drivers/hwmon/w83792d.ko                     32979     32932       -47
      drivers/i2c/i2c-core.ko                      24708     24531      -177
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cdcb1921
    • 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 (1/9) · efde723f
      Jean Delvare 提交于
      Temporarily export a few structures and functions from i2c-core, because we
      will soon need them in i2c-isa.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      efde723f