1. 02 3月, 2010 2 次提交
    • Z
      i2c: Document the message size limit · 0c43ea54
      Zhangfei Gao 提交于
      i2c_master_send & i2c_master_recv do not support more than 64 kb
      transfer, since msg.len is u16.
      Signed-off-by: NZhangfei Gao <zgao6@marvell.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      0c43ea54
    • J
      i2c: Add SMBus alert support · b5527a77
      Jean Delvare 提交于
      SMBus alert support. The SMBus alert protocol allows several SMBus
      slave devices to share a single interrupt pin on the SMBus master,
      while still allowing the master to know which slave triggered the
      interrupt.
      
      This is based on preliminary work by David Brownell. The key
      difference between David's implementation and mine is that his was
      part of i2c-core, while mine is split into a separate, standalone
      module named i2c-smbus. The i2c-smbus module is meant to include
      support for all SMBus extensions to the I2C protocol in the future.
      
      The benefit of this approach is a zero cost for I2C bus segments which
      do not need SMBus alert support. Where David's implementation
      increased the size of struct i2c_adapter by 7% (40 bytes on i386),
      mine doesn't touch it. Where David's implementation added over 150
      lines of code to i2c-core (+10%), mine doesn't touch it. The only
      change that touches all the users of the i2c subsystem is a new
      callback in struct i2c_driver (common to both implementations.) I seem
      to remember Trent was worried about the footprint of David'd
      implementation, hopefully mine addresses the issue.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Acked-by: NJonathan Cameron <jic23@cam.ac.uk>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Trent Piepho <tpiepho@freescale.com>
      b5527a77
  2. 15 12月, 2009 5 次提交
  3. 07 12月, 2009 2 次提交
  4. 07 11月, 2009 1 次提交
  5. 19 9月, 2009 1 次提交
  6. 19 6月, 2009 8 次提交
    • H
      i2c: New macro to initialize i2c address lists on the fly · c7036673
      Hans Verkuil 提交于
      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: NHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      c7036673
    • J
      i2c: Don't advertise i2c functions when not available · 23af8400
      Jean Delvare 提交于
      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: NJean Delvare <khali@linux-fr.org>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      23af8400
    • J
      i2c: Add a sysfs interface to instantiate devices · 99cd8e25
      Jean Delvare 提交于
      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: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      99cd8e25
    • J
      i2c: Kill the redundant client list · e549c2b5
      Jean Delvare 提交于
      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: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      e549c2b5
    • J
      i2c: Kill is_newstyle_driver · 1e40ac12
      Jean Delvare 提交于
      Legacy i2c drivers are gone, all drivers are new-style now, so there
      is no point to check.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      1e40ac12
    • J
      i2c: Drop i2c_probe function · 36789b5e
      Jean Delvare 提交于
      The legacy i2c_probe() function has no users left, get rid of it.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      36789b5e
    • J
      i2c: Get rid of the legacy binding model · 729d6dd5
      Jean Delvare 提交于
      We converted all the legacy i2c drivers so we can finally get rid of
      the legacy binding model. Hooray!
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      729d6dd5
    • J
      i2c: Kill client_register and client_unregister methods · 352da982
      Jean Delvare 提交于
      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: NJean Delvare <khali@linux-fr.org>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      352da982
  7. 13 4月, 2009 1 次提交
  8. 07 4月, 2009 1 次提交
  9. 25 2月, 2009 1 次提交
  10. 27 1月, 2009 1 次提交
  11. 07 1月, 2009 3 次提交
  12. 23 10月, 2008 5 次提交
  13. 28 8月, 2008 1 次提交
  14. 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
  15. 02 7月, 2008 1 次提交
  16. 19 5月, 2008 1 次提交