1. 07 8月, 2013 1 次提交
  2. 02 4月, 2013 2 次提交
    • L
      i2c: Make return type of i2c_del_adapter() void · 71546300
      Lars-Peter Clausen 提交于
      i2c_del_adapter() is usually called from a drivers remove callback. The Linux
      device driver model does not allow the remove callback to fail and all resources
      allocated in the probe callback need to be freed, as well as all resources which
      have been provided to the rest of the kernel(for example a I2C adapter) need to
      be revoked. So any function revoking such resources isn't allowed to fail
      either. i2c_del_adapter() adheres to this requirement and will never fail. But
      i2c_del_adapter()'s return type is int, which may cause driver authors to think
      that it can fail. This led to code constructs like:
      
      	ret = i2c_del_adapter(...);
      	BUG_ON(ret);
      
      Since i2c_del_adapter() always returns 0 the BUG_ON is never hit and essentially
      becomes dead code, which means it can be removed. Making the return type of
      i2c_del_adapter() void makes it explicit that the function will never fail and
      should prevent constructs like the above from re-appearing in the kernel code.
      
      All callers of i2c_del_adapter() have already been updated in a previous patch
      to ignore the return value, so the conversion of the return type from int to
      void can be done without causing any build failures.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Reviewed-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      71546300
    • L
      i2c: Remove detach_adapter · 19baba4c
      Lars-Peter Clausen 提交于
      The detach_adapter callback has been deprecated for quite some time and has no
      user left. Keeping it alive blocks other cleanups, so remove it.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Reviewed-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      19baba4c
  3. 24 3月, 2013 1 次提交
    • V
      i2c: Add bus recovery infrastructure · 5f9296ba
      Viresh Kumar 提交于
      Add i2c bus recovery infrastructure to i2c adapters as specified in the i2c
      protocol Rev. 03 section 3.1.16 titled "Bus clear".
      
      http://www.nxp.com/documents/user_manual/UM10204.pdf
      
      Sometimes during operation i2c bus hangs and we need to give dummy clocks to
      slave device to start the transfer again. Now we may have capability in the bus
      controller to generate these clocks or platform may have gpio pins which can be
      toggled to generate dummy clocks. This patch supports both.
      
      This patch also adds in generic bus recovery routines gpio or scl line based
      which can be used by bus controller. In addition controller driver may provide
      its own version of the bus recovery routine.
      
      This doesn't support multi-master recovery for now.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      [wsa: changed gpio type to int and minor reformatting]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      5f9296ba
  4. 23 11月, 2012 1 次提交
  5. 13 10月, 2012 1 次提交
  6. 06 10月, 2012 1 次提交
  7. 24 7月, 2012 1 次提交
  8. 30 6月, 2012 1 次提交
    • J
      [media] i2c: Export an unlocked flavor of i2c_transfer · b37d2a3a
      Jean Delvare 提交于
      Some drivers (in particular for TV cards) need exclusive access to
      their I2C buses for specific operations. Export an unlocked flavor
      of i2c_transfer to give them full control.
      
      The unlocked flavor has the following limitations:
      * Obviously, caller must hold the i2c adapter lock.
      * No debug messages are logged. We don't want to log messages while
        holding a rt_mutex.
      * No check is done on the existence of adap->algo->master_xfer. It
        is thus the caller's responsibility to ensure that the function is
        OK to call.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      b37d2a3a
  9. 30 5月, 2012 1 次提交
  10. 12 5月, 2012 1 次提交
  11. 27 3月, 2012 1 次提交
  12. 23 11月, 2011 1 次提交
  13. 18 11月, 2011 1 次提交
  14. 01 11月, 2011 2 次提交
    • P
      include: replace linux/module.h with "struct module" wherever possible · de477254
      Paul Gortmaker 提交于
      The <linux/module.h> pretty much brings in the kitchen sink along
      with it, so it should be avoided wherever reasonably possible in
      terms of being included from other commonly used <linux/something.h>
      files, as it results in a measureable increase on compile times.
      
      The worst culprit was probably device.h since it is used everywhere.
      This file also had an implicit dependency/usage of mutex.h which was
      masked by module.h, and is also fixed here at the same time.
      
      There are over a dozen other headers that simply declare the
      struct instead of pulling in the whole file, so follow their lead
      and simply make it a few more.
      
      Most of the implicit dependencies on module.h being present by
      these headers pulling it in have been now weeded out, so we can
      finally make this change with hopefully minimal breakage.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      de477254
    • P
      include: convert various register fcns to macros to avoid include chaining · eb5589a8
      Paul Gortmaker 提交于
      The original implementations reference THIS_MODULE in an inline.
      We could include <linux/export.h>, but it is better to avoid chaining.
      
      Fortunately someone else already thought of this, and made a similar
      inline into a #define in <linux/device.h> for device_schedule_callback(),
      [see commit 523ded71] so follow that precedent here.
      
      Also bubble up any __must_check that were used on the prev. wrapper inline
      functions up one to the real __register functions, to preserve any prev.
      sanity checks that were used in those instances.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      eb5589a8
  15. 30 10月, 2011 1 次提交
  16. 26 5月, 2011 1 次提交
  17. 20 3月, 2011 5 次提交
  18. 22 1月, 2011 1 次提交
  19. 11 1月, 2011 1 次提交
  20. 16 11月, 2010 1 次提交
  21. 01 11月, 2010 1 次提交
  22. 25 10月, 2010 2 次提交
  23. 12 8月, 2010 5 次提交
  24. 11 8月, 2010 1 次提交
  25. 04 5月, 2010 1 次提交
  26. 29 4月, 2010 1 次提交
    • G
      i2c/of: Allow device node to be passed via i2c_board_info · d12d42f7
      Grant Likely 提交于
      The struct device_node *of_node pointer is moving out of dev->archdata
      and into the struct device proper.  of_i2c.c needs to set the of_node
      pointer before the device is registered.  Since the i2c subsystem
      doesn't allow 2 stage allocation and registration of i2c devices, the
      of_node pointer needs to be passed via the i2c_board_info structure
      so that it is set prior to registration.
      
      This patch adds of_node to struct i2c_board_info (conditional on
      CONFIG_OF), sets of_node in i2c_new_device(), and modifies of_i2c.c
      to use the new parameter.  The calling of dev_archdata_set_node()
      from of_i2c will be removed in a subsequent patch when of_node is
      removed from archdata and all users are converted over.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      d12d42f7
  27. 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
  28. 15 12月, 2009 1 次提交