1. 14 Dec, 2009 4 commits
  2. 06 Dec, 2009 2 commits
  3. 07 Nov, 2009 1 commit
  4. 18 Sep, 2009 1 commit
  5. 19 Jun, 2009 8 commits
    • Hans Verkuil's avatar
      i2c: New macro to initialize i2c address lists on the fly · c7036673
      Hans Verkuil authored
      For video4linux we sometimes need to probe for a single i2c address.
      Normally you would do it like this:
      
      static const unsigned short addrs[] = {
      	addr, I2C_CLIENT_END
      };
      
      client = i2c_new_probed_device(adapter, &info, addrs);
      
      This is a bit awkward and I came up with this macro:
      
      #define V4L2_I2C_ADDRS(addr, addrs...) \
      	((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })
      
      This can construct a list of one or more i2c addresses on the fly. But
      this is something that really belongs in i2c.h, renamed to I2C_ADDRS.
      
      With this macro we can just do:
      
      client = i2c_new_probed_device(adapter, &info, I2C_ADDRS(addr));
      
      Note that this can also be used to initialize an array:
      
      static const unsigned short addrs[] = I2C_ADDRS(0x2a, 0x2c);
      
      Whether you want to is another matter, but it works. This functionality is 
      also available in the oldest supported gcc (3.2).
      Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      c7036673
    • Jean Delvare's avatar
      i2c: Don't advertise i2c functions when not available · 23af8400
      Jean Delvare authored
      Surround i2c function declarations with ifdefs, so that they aren't
      advertised when i2c-core isn't actually built. That way, drivers using
      these functions unconditionally will result in an immediate build
      failure, rather than a late linking failure which is harder to figure
      out.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      23af8400
    • Jean Delvare's avatar
      i2c: Add a sysfs interface to instantiate devices · 99cd8e25
      Jean Delvare authored
      Add a sysfs interface to instantiate and delete I2C devices. This is
      primarily a replacement of the force_* module parameters implemented
      by some i2c drivers. These module parameters were implemented
      internally by the I2C_CLIENT_INSMOD* macros, which don't scale well.
      
      This can also be used when developing a driver on a self-soldered
      board which doesn't yet have proper I2C device declaration at the
      platform level, and presumably for various debugging situations.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      99cd8e25
    • Jean Delvare's avatar
      i2c: Kill the redundant client list · e549c2b5
      Jean Delvare authored
      We used to maintain our own per-adapter list of i2c clients, but this
      is redundant with what the driver core does, and no longer needed.
      Just drop the redundant list.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      e549c2b5
    • Jean Delvare's avatar
      i2c: Kill is_newstyle_driver · 1e40ac12
      Jean Delvare authored
      Legacy i2c drivers are gone, all drivers are new-style now, so there
      is no point to check.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      1e40ac12
    • Jean Delvare's avatar
      i2c: Drop i2c_probe function · 36789b5e
      Jean Delvare authored
      The legacy i2c_probe() function has no users left, get rid of it.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      36789b5e
    • Jean Delvare's avatar
      i2c: Get rid of the legacy binding model · 729d6dd5
      Jean Delvare authored
      We converted all the legacy i2c drivers so we can finally get rid of
      the legacy binding model. Hooray!
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      729d6dd5
    • Jean Delvare's avatar
      i2c: Kill client_register and client_unregister methods · 352da982
      Jean Delvare authored
      These methods were useful in the legacy binding model but no longer in
      the new (standard) binding model. There are no users left so we can
      drop them.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      352da982
  6. 13 Apr, 2009 1 commit
  7. 06 Apr, 2009 1 commit
  8. 24 Feb, 2009 1 commit
  9. 26 Jan, 2009 1 commit
  10. 07 Jan, 2009 3 commits
  11. 22 Oct, 2008 5 commits
  12. 28 Aug, 2008 1 commit
  13. 14 Jul, 2008 6 commits
    • Jean Delvare's avatar
      i2c: Add detection capability to new-style drivers · 4735c98f
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      4735c98f
    • Jon Smirl's avatar
      i2c: Export the i2c_bus_type symbol · e9ca9eb9
      Jon Smirl authored
      Export the root of the i2c bus so that PowerPC device tree code can
      iterate over devices on the i2c bus.
      Signed-off-by: default avatarJon Smirl <jonsmirl@gmail.com>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      e9ca9eb9
    • Jean Delvare's avatar
      i2c: Let bus drivers add SPD to their class · 3401b2ff
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      3401b2ff
    • Jean Delvare's avatar
      i2c: Let framebuffer drivers set their I2C bus class to DDC · c1b6b4f2
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      c1b6b4f2
    • Jean Delvare's avatar
      i2c: Update stray references to smbus_access · ae7193f7
      Jean Delvare authored
      That function is actually named i2c_smbus_xfer.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      ae7193f7
    • Jean Delvare's avatar
      i2c: Delete unused function i2c_smbus_write_quick · 67c2e665
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      67c2e665
  14. 01 Jul, 2008 1 commit
  15. 18 May, 2008 1 commit
  16. 11 May, 2008 1 commit
    • Jean Delvare's avatar
      i2c: Match dummy devices by type · 60b129d7
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      60b129d7
  17. 29 Apr, 2008 2 commits
    • Jean Delvare's avatar
      i2c: Convert most new-style drivers to use module aliasing · 3760f736
      Jean Delvare authored
      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: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Jon Smirl <jonsmirl@gmail.com>
      Cc: Jochen Friedrich <jochen@scram.de>
      3760f736
    • Jean Delvare's avatar
      i2c: Add support for device alias names · d2653e92
      Jean Delvare authored
      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: default avatarJean 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