1. 02 5月, 2007 13 次提交
    • J
      i2c: Make i2c_del_driver a void function · b3e82096
      Jean Delvare 提交于
      Make i2c_del_driver a void function, like all other driver removal
      functions. It always returned 0 even when errors occured, and nobody
      ever actually checked the return value anyway. And we cannot fail
      a module removal anyway.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      b3e82096
    • J
      i2c: Add i2c_new_probed_device() · 12b5053a
      Jean Delvare 提交于
      Add a new helper function to instantiate an i2c device. It is meant as a
      replacement for i2c_new_device() when you don't know for sure at which
      address your I2C/SMBus device lives. This happens frequently on TV
      adapters for example, you know there is a tuner chip on the bus, but
      depending on the exact board model and revision, it can live at different
      addresses. So, the new i2c_new_probed_device() function will probe the bus
      according to a list of addresses, and as soon as one of these addresses
      responds, it will call i2c_new_device() on that one address.
      
      This function will make it possible to port the old i2c drivers to the
      new model quickly.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      12b5053a
    • D
      i2c: i2c EXPORT_SYMBOL cleanup · c0564606
      David Brownell 提交于
      Make i2c-core.c obey Documentation/CodingStyle better by snugging
      the EXPORT_SYMBOL declarations next to the relevant definitions.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      c0564606
    • D
      i2c: Add i2c_add_numbered_adapter() · 6e13e641
      David Brownell 提交于
      This adds a call, i2c_add_numbered_adapter(), registering an I2C adapter
      with a specific bus number and then creating I2C device nodes for any
      pre-declared devices on that bus.  It builds on previous patches adding
      I2C probe() and remove() support, and that pre-declaration of devices.
      
      This completes the core support for "new style" I2C device drivers.
      Those follow the standard driver model for binding devices to drivers
      (using probe and remove methods) rather than a legacy model (where the
      driver tries to autoconfigure each bus, and registers devices itself).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      6e13e641
    • D
      i2c: Add i2c_board_info and i2c_new_device() · 9c1600ed
      David Brownell 提交于
      This provides partial support for new-style I2C driver binding.  It builds
      on "struct i2c_board_info" declarations that identify I2C devices on a given
      board.  This is needed on systems with I2C devices that can't be fully probed
      and/or autoconfigured, such as many embedded Linux configurations where the
      way a given I2C device is wired may affect how it must be used.
      
      There are two models for declaring such devices:
      
       * LATE -- using a public function i2c_new_device().  This lets modules
         declare I2C devices found *AFTER* a given I2C adapter becomes available.
         
         For example, a PCI card could create adapters giving access to utility
         chips on that card, and this would be used to associate those chips with
         those adapters.
      
       * EARLY -- from arch_initcall() level code, using a non-exported function
         i2c_register_board_info().  This copies the declarations *BEFORE* such
         an i2c_adapter becomes available, arranging that i2c_new_device() will
         be called later when i2c-core registers the relevant i2c_adapter.
      
         For example, arch/.../.../board-*.c files would declare the I2C devices
         along with their platform data, and I2C devices would behave much like
         PNPACPI devices.  (That is, both enumerate from board-specific tables.)
      
      To match the exported i2c_new_device(), the previously-private function
      i2c_unregister_device() is now exported.
      
      Pending later patches using these new APIs, this is effectively a NOP.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      9c1600ed
    • D
      i2c: i2c stack can remove() · a1d9e6e4
      David Brownell 提交于
      More update for new style driver support:  add a remove() method, and
      use it in the relevant code paths.
      
      Again, nothing will use this yet since there's nothing to create devices
      feeding this infrastructure.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      a1d9e6e4
    • D
      i2c: i2c stack can probe() · 7b4fbc50
      David Brownell 提交于
      One of a series of I2C infrastructure updates to support enumeration using
      the standard Linux driver model.
      
      This patch updates probe() and associated hotplug/coldplug support, but
      not remove().  Nothing yet _uses_ it to create I2C devices, so those
      hotplug/coldplug mechanisms will be the only externally visible change.
      This patch will be an overall NOP since the I2C stack doesn't yet create
      clients/devices except as part of binding them to legacy drivers.
      
      Some code is moved earlier in the source code, helping group more of the
      per-device infrastructure in one place and simplifying handling per-device
      attributes.
      
      Terminology being adopted:  "legacy drivers" create devices (i2c_client)
      themselves, while "new style" ones follow the driver model (the i2c_client
      is handed to the probe routine).  It's an either/or thing; the two models
      don't mix, and drivers that try mixing them won't even be registered.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      7b4fbc50
    • J
      i2c: Emulate SMBus block read over I2C · 209d27c3
      Jean Delvare 提交于
      Let the I2C bus drivers emulate the SMBus Block Read and Block Process
      Call transactions if they wish. This requires to define a new message
      flag, which i2c-core will use to let the underlying I2C bus driver
      know that the first received byte will specify the length of the read
      message.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      209d27c3
    • D
      i2c: Rename dev_to_i2c_adapter() · ef2c8321
      David Brownell 提交于
      Rename dev_to_i2c_adapter() as to_i2c_adapter(), since the previous
      syntax was a surprising and needless difference from normal naming
      conventions in Linux.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      ef2c8321
    • D
      i2c: Class attribute cleanup · 16ffadfc
      David Brownell 提交于
      This patch is a minor cleanup/code shrink, using class infrastructure
      in i2c-core to manage the i2c_adapter attribute.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      16ffadfc
    • D
      i2c: i2c_register_driver() cleanup · 4ad4eac6
      David Brownell 提交于
      Minor cleanup in i2c_register_driver():  use list_for_each_entry().
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      4ad4eac6
    • J
      i2c: i2c_adapter devices need no driver · b31366f4
      Jean Delvare 提交于
      Kill i2c_adapter_driver as it doesn't make sense and it prevents
      further i2c-core cleanups. i2c_adapter devices are virtual devices
      (ex-class devices) and as such they don't need a driver.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      b31366f4
    • J
      i2c: Kill i2c_adapter.class_dev · fccb56e4
      Jean Delvare 提交于
      Kill i2c_adapter.class_dev. Instead, set the class of i2c_adapter.dev
      to i2c_adapter_class, so that a symlink will be created for every
      i2c_adapter in /sys/class/i2c-adapter.
      
      The same change must be mirrored to i2c-isa as it duplicates some
      of the i2c-core functionalities.
      
      User-space tools and libraries might need some adjustments. In
      particular, libsensors from lm_sensors 2.10.3 or later is required for
      proper discovery of i2c adapter names after this change.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      fccb56e4
  2. 14 2月, 2007 3 次提交
  3. 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
  4. 11 12月, 2006 3 次提交
  5. 01 10月, 2006 1 次提交
  6. 27 9月, 2006 3 次提交
  7. 13 7月, 2006 1 次提交
  8. 23 6月, 2006 1 次提交
  9. 24 3月, 2006 4 次提交
  10. 07 2月, 2006 1 次提交
  11. 14 1月, 2006 1 次提交
  12. 06 1月, 2006 7 次提交
  13. 30 10月, 2005 1 次提交