1. 23 10月, 2008 4 次提交
  2. 28 8月, 2008 1 次提交
  3. 15 7月, 2008 6 次提交
    • 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: Export the i2c_bus_type symbol · e9ca9eb9
      Jon Smirl 提交于
      Export the root of the i2c bus so that PowerPC device tree code can
      iterate over devices on the i2c bus.
      Signed-off-by: NJon Smirl <jonsmirl@gmail.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      e9ca9eb9
    • J
      i2c: Let bus drivers add SPD to their class · 3401b2ff
      Jean Delvare 提交于
      Let general purpose I2C/SMBus bus drivers add SPD to their class. Once
      this is done, we will be able to tell the eeprom driver to only probe
      for SPD EEPROMs and similar on these buses.
      
      Note that I took a conservative approach here, adding I2C_CLASS_SPD to
      many drivers that have no idea whether they can host SPD EEPROMs or not.
      This is to make sure that the eeprom driver doesn't stop probing buses
      where SPD EEPROMs or equivalent live.
      
      So, bus driver maintainers and users should feel free to remove the SPD
      class from drivers those buses never have SPD EEPROMs or they don't
      want the eeprom driver to bind to them. Likewise, feel free to add the
      SPD class to any bus driver I might have missed.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      3401b2ff
    • J
      i2c: Let framebuffer drivers set their I2C bus class to DDC · c1b6b4f2
      Jean Delvare 提交于
      Let framebuffer drivers set their I2C bus class to DDC. Once this is
      done, we will be able to tell the eeprom driver to only probe for
      EDID EEPROMs on these buses.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      c1b6b4f2
    • J
      i2c: Update stray references to smbus_access · ae7193f7
      Jean Delvare 提交于
      That function is actually named i2c_smbus_xfer.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      ae7193f7
    • 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
  4. 02 7月, 2008 1 次提交
  5. 19 5月, 2008 1 次提交
  6. 12 5月, 2008 1 次提交
    • J
      i2c: Match dummy devices by type · 60b129d7
      Jean Delvare 提交于
      As the old driver_name/type matching scheme is going away soon, change
      the dummy device mechanism to use the new matching scheme.
      
      This has the downside that dummy i2c clients can no longer choose
      their name, they'll all appear as "dummy" in sysfs and in log
      messages. I don't think it is a problem in practice though, as there
      is little reason to use these i2c clients to log messages.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      60b129d7
  7. 30 4月, 2008 2 次提交
    • J
      i2c: Convert most new-style drivers to use module aliasing · 3760f736
      Jean Delvare 提交于
      Based on earlier work by Jon Smirl and Jochen Friedrich.
      
      Update most new-style i2c drivers to use standard module aliasing
      instead of the old driver_name/type driver matching scheme. I've
      left the video drivers apart (except for SoC camera drivers) as
      they're a bit more diffcult to deal with, they'll have their own
      patch later.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Cc: Jochen Friedrich <jochen@scram.de>
      3760f736
    • 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
  8. 25 2月, 2008 2 次提交
  9. 28 1月, 2008 7 次提交
  10. 16 11月, 2007 1 次提交
  11. 14 10月, 2007 6 次提交
  12. 01 8月, 2007 1 次提交
  13. 20 7月, 2007 1 次提交
  14. 12 7月, 2007 3 次提交
    • 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
    • M
      i2c: Fix sparse warning in i2c.h · d75d53cd
      Mark M. Hoffman 提交于
      Kill a sparse warning by un-nesting two container_of() calls.
      Signed-off-by: NMark M. Hoffman <mhoffman@lightlink.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      d75d53cd
    • D
      i2c: Add kernel documentation · d64f73be
      David Brownell 提交于
      Generate I2C kerneldoc; fix various glitches and add "context" sections to
      that documentation.  Most I2C and SMBus functions still have no kerneldoc.
      
      Let me suggest providing kerneldoc for all the i2c_smbus_*() functions as
      a small and mostly self-contained project for anyone so inclined.  :)
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      d64f73be
  15. 02 5月, 2007 3 次提交