1. 13 5月, 2015 1 次提交
  2. 24 4月, 2015 1 次提交
  3. 16 4月, 2015 1 次提交
    • M
      i2c: core: Export bus recovery functions · c1c21f4e
      Mark Brown 提交于
      Current -next fails to link an ARM allmodconfig because drivers that use
      the core recovery functions can be built as modules but those functions
      are not exported:
      
      ERROR: "i2c_generic_gpio_recovery" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      ERROR: "i2c_generic_scl_recovery" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      ERROR: "i2c_recover_bus" [drivers/i2c/busses/i2c-davinci.ko] undefined!
      
      Add exports to fix this.
      
      Fixes: 5f9296ba (i2c: Add bus recovery infrastructure)
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      c1c21f4e
  4. 10 4月, 2015 1 次提交
  5. 18 3月, 2015 1 次提交
  6. 17 3月, 2015 1 次提交
  7. 13 3月, 2015 1 次提交
  8. 12 3月, 2015 1 次提交
  9. 06 2月, 2015 1 次提交
  10. 27 1月, 2015 1 次提交
  11. 26 1月, 2015 1 次提交
    • D
      i2c: do not try to load modules for of-registered devices · c680eed5
      Dmitry Torokhov 提交于
      Trying to register an I2C device asynchronously (via async_schedule() call)
      results in an ugly warning from request_module() warning about potential
      deadlock (because request_module tries to wait for async works to
      complete). While we could try to switch to request_module_nowait(), other
      buses, as well as I2C itself when not using device tree, do not try to load
      modules, but rather rely on the standard infrastructure (udev) to execute
      module loading, and we should be doing the same.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      c680eed5
  12. 22 1月, 2015 1 次提交
  13. 14 1月, 2015 1 次提交
  14. 23 12月, 2014 1 次提交
    • L
      i2c: Remove support for legacy PM · 523c5b89
      Lars-Peter Clausen 提交于
      There haven't been any I2C driver that use the legacy suspend/resume
      callbacks for a while now and new drivers are supposed to use PM ops. So
      remove support for legacy suspend/resume for I2C drivers.
      
      Since there aren't any special bus specific things to do during
      suspend/resume and since the PM core will automatically fallback directly to
      using the device's PM ops if no bus PM ops are specified there is no need to
      have any I2C bus PM ops.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      523c5b89
  15. 12 12月, 2014 1 次提交
  16. 25 11月, 2014 2 次提交
  17. 24 11月, 2014 1 次提交
  18. 18 11月, 2014 2 次提交
  19. 10 11月, 2014 1 次提交
  20. 08 11月, 2014 2 次提交
  21. 30 9月, 2014 1 次提交
  22. 25 9月, 2014 2 次提交
  23. 22 9月, 2014 1 次提交
  24. 26 7月, 2014 1 次提交
  25. 17 7月, 2014 1 次提交
    • W
      i2c: add debug info when class instantiation was dropped · 45552272
      Wolfram Sang 提交于
      We have a warning already when support for old-fashioned class based
      instantiation is about to be dropped somewhen soon from a driver. Let's
      have another one when it was actually dropped. This allows to remove the
      cruft a little earlier and still let users know what happened in the
      rare case they are missing devices after the change. However, there is
      enough interest to get rid of class based instantiation rather sooner
      than later because it improves boot up time.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      45552272
  26. 27 6月, 2014 2 次提交
    • L
      I2C/ACPI: Clean up I2C ACPI code and Add CONFIG_I2C_ACPI config · da3c6647
      Lan Tianyu 提交于
      Clean up ACPI related code in the i2c core and add CONFIG_I2C_ACPI
      to enable I2C ACPI code.
      
      Current there is a race between removing I2C ACPI operation region
      and ACPI AML code accessing. So make i2c core built-in if CONFIG_I2C_ACPI
      is set.
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      da3c6647
    • L
      I2C/ACPI: Add i2c ACPI operation region support · 5d98e61d
      Lan Tianyu 提交于
      ACPI 5.0 spec(5.5.2.4.5) defines GenericSerialBus(i2c, spi, uart) operation region.
      It allows ACPI aml code able to access such kind of devices to implement
      some ACPI standard method.
      
      ACPI Spec defines some access attribute to associate with i2c protocol.
      AttribQuick 	       	       		Read/Write Quick Protocol
      AttribSendReceive			Send/Receive Byte Protocol
      AttribByte 			 	Read/Write Byte Protocol
      AttribWord				Read/Write Word Protocol
      AttribBlock				Read/Write Block Protocol
      AttribBytes				Read/Write N-Bytes Protocol
      AttribProcessCall			Process Call Protocol
      AttribBlockProcessCall			Write Block-Read Block Process Call Protocol
      AttribRawBytes 				Raw Read/Write N-BytesProtocol
      AttribRawProcessBytes			Raw Process Call Protocol
      
      On the Asus T100TA, Bios use GenericSerialBus operation region to access
      i2c device to get battery info.
      
      Sample code From Asus T100TA
      
          Scope (_SB.I2C1)
          {
              Name (UMPC, ResourceTemplate ()
              {
                  I2cSerialBus (0x0066, ControllerInitiated, 0x00061A80,
                      AddressingMode7Bit, "\\_SB.I2C1",
                      0x00, ResourceConsumer, ,
                      )
              })
      
      	...
      
              OperationRegion (DVUM, GenericSerialBus, Zero, 0x0100)
              Field (DVUM, BufferAcc, NoLock, Preserve)
              {
                  Connection (UMPC),
                  Offset (0x81),
                  AccessAs (BufferAcc, AttribBytes (0x3E)),
                  FGC0,   8
              }
      	...
           }
      
           Device (BATC)
           {
               Name (_HID, EisaId ("PNP0C0A"))  // _HID: Hardware ID
               Name (_UID, One)  // _UID: Unique ID
      	 ...
      
                  Method (_BST, 0, NotSerialized)  // _BST: Battery Status
                  {
                      If (LEqual (AVBL, One))
                      {
                          Store (FGC0, BFFG)
                          If (LNotEqual (STAT, One))
                          {
                              ShiftRight (CHST, 0x04, Local0)
                              And (Local0, 0x03, Local0)
                              If (LOr (LEqual (Local0, One), LEqual (Local0, 0x02)))
                              {
                                  Store (0x02, Local1)
                              }
      	...
      
          }
      
      The i2c operation region is defined under I2C1 scope. _BST method under
      battery device BATC read battery status from the field "FCG0". The request
      would be sent to i2c operation region handler.
      
      This patch is to add i2c ACPI operation region support. Due to there are
      only "Byte" and "Bytes" protocol access on the Asus T100TA, other protocols
      have not been tested.
      
      About RawBytes and RawProcessBytes protocol, they needs specific drivers to interpret
      reference data from AML code according ACPI 5.0 SPEC(5.5.2.4.5.3.9 and 5.5.2.4.5.3.10).
      So far, not found such case and will add when find real case.
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      5d98e61d
  27. 14 3月, 2014 2 次提交
    • D
      i2c: Add message transfer tracepoints for SMBUS [ver #2] · 8a325997
      David Howells 提交于
      The SMBUS tracepoints can be enabled thusly:
      
      	echo 1 >/sys/kernel/debug/tracing/events/i2c/enable
      
      and will dump messages that can be viewed in /sys/kernel/debug/tracing/trace
      that look like:
      
               ... smbus_read: i2c-0 a=051 f=0000 c=fa BYTE_DATA
               ... smbus_reply: i2c-0 a=051 f=0000 c=fa BYTE_DATA l=1 [39]
               ... smbus_result: i2c-0 a=051 f=0000 c=fa BYTE_DATA rd res=0
      
      formatted as:
      
      	i2c-<adapter-nr>
      	a=<addr>
      	f=<flags>
      	c=<command>
      	<protocol-name>
      	<rd|wr>
      	res=<result>
      	l=<data-len>
      	[<data-block>]
      
      The adapters to be traced can be selected by something like:
      
      	echo adapter_nr==1 >/sys/kernel/debug/tracing/events/i2c/filter
      
      Note that this shares the same filter and enablement as i2c.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      8a325997
    • D
      i2c: Add message transfer tracepoints for I2C · d9a83d62
      David Howells 提交于
      Add tracepoints into the I2C message transfer function to retrieve the message
      sent or received.  The following config options must be turned on to make use
      of the facility:
      
      	CONFIG_FTRACE
      	CONFIG_ENABLE_DEFAULT_TRACERS
      
      The I2C tracepoint can be enabled thusly:
      
      	echo 1 >/sys/kernel/debug/tracing/events/i2c/enable
      
      and will dump messages that can be viewed in /sys/kernel/debug/tracing/trace
      that look like:
      
      	... i2c_write: i2c-5 #0 a=044 f=0000 l=2 [02-14]
      	... i2c_read: i2c-5 #1 a=044 f=0001 l=4
      	... i2c_reply: i2c-5 #1 a=044 f=0001 l=4 [33-00-00-00]
      	... i2c_result: i2c-5 n=2 ret=2
      
      formatted as:
      
      	i2c-<adapter-nr>
      	#<message-array-index>
      	a=<addr>
      	f=<flags>
      	l=<datalen>
      	n=<message-array-size>
      	ret=<result>
      	[<data>]
      
      The operation is done between the i2c_write/i2c_read lines and the i2c_reply
      and i2c_result lines so that if the hardware hangs, the trace buffer can be
      consulted to determine the problematic operation.
      
      The adapters to be traced can be selected by something like:
      
      	echo adapter_nr==1 >/sys/kernel/debug/tracing/events/i2c/filter
      
      These changes are based on code from Steven Rostedt.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      [wsa: adapted path for 'enable' in the commit msg]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      d9a83d62
  28. 06 3月, 2014 1 次提交
    • W
      i2c: add deprecation warning for class based instantiation · 0c176170
      Wolfram Sang 提交于
      Class based instantiation can cause noticeable delays when booting. This
      mechanism is used when it is not possible to describe slaves on I2C
      busses. As we do have other mechanisms, most embedded I2C will not need
      classes and for embedded it is explicitly not recommended to use them. Add
      a deprecation warning for drivers which want to disable class based
      instantiation in the near future to gain boot-up time, so users relying
      on this technique can switch to something better. They really should.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      0c176170
  29. 30 1月, 2014 1 次提交
  30. 25 1月, 2014 1 次提交
  31. 17 1月, 2014 1 次提交
    • Z
      ACPI: fix module autoloading for ACPI enumerated devices · 8c4ff6d0
      Zhang Rui 提交于
      ACPI enumerated devices has ACPI style _HID and _CID strings,
      all of these strings can be used for both driver loading and matching.
      
      Currently, in Platform, I2C and SPI bus, the ACPI style driver matching
      is supported by invoking acpi_driver_match_device() in bus .match() callback.
      But, the module autoloading is still broken.
      
      For example, there is any ACPI device with _HID "INTABCD" that is
      enumerated to platform bus, and we have a driver that can probe it.
      
      The driver exports its module_alias as "acpi:INTABCD" use the following code
      static const struct acpi_device_id xxx_acpi_match[] = {
              { "INTABCD", 0 },
              { }
      };
      MODULE_DEVICE_TABLE(acpi, xxx_acpi_match);
      
      But, unfortunately, the device' modalias is shown as "platform:INTABCD:00",
      please refer to modalias_show() and platform_uevent() in
      drivers/base/platform.c.
      This results in that the driver will not be loaded automatically when the
      device node is created, because their modalias do not match.
      
      This also applies to I2C and SPI bus.
      
      With this patch, the device' modalias will be shown as "acpi:INTABCD" as well.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Acked-by: NMark Brown <broonie@linaro.org>
      Acked-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8c4ff6d0
  32. 15 11月, 2013 2 次提交
    • J
      i2c: Use stable dev_name for ACPI enumerated I2C slaves · 70762abb
      Jarkko Nikula 提交于
      Current I2C adapter id - client address "x-00yy" based device naming scheme
      is not always stable enough to be used in name based matching, for instance
      within ALSA SoC subsystem.
      
      This is problematic in PC kind of platforms where I2C adapter numbers can
      change due variable amount of bus controllers, probe order, add-on cards or
      just because of BIOS settings.
      
      This patch addresses the problem by using the ACPI device name with
      "i2c-" prefix for ACPI enumerated I2C slaves. For them device name
      "x-00yz" becomes "i2c-INTABCD:ij" after this patch.
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      70762abb
    • R
      ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node · 7b199811
      Rafael J. Wysocki 提交于
      Modify struct acpi_dev_node to contain a pointer to struct acpi_device
      associated with the given device object (that is, its ACPI companion
      device) instead of an ACPI handle corresponding to it.  Introduce two
      new macros for manipulating that pointer in a CONFIG_ACPI-safe way,
      ACPI_COMPANION() and ACPI_COMPANION_SET(), and rework the
      ACPI_HANDLE() macro to take the above changes into account.
      Drop the ACPI_HANDLE_SET() macro entirely and rework its users to
      use ACPI_COMPANION_SET() instead.  For some of them who used to
      pass the result of acpi_get_child() directly to ACPI_HANDLE_SET()
      introduce a helper routine acpi_preset_companion() doing an
      equivalent thing.
      
      The main motivation for doing this is that there are things
      represented by struct acpi_device objects that don't have valid
      ACPI handles (so called fixed ACPI hardware features, such as
      power and sleep buttons) and we would like to create platform
      device objects for them and "glue" them to their ACPI companions
      in the usual way (which currently is impossible due to the
      lack of valid ACPI handles).  However, there are more reasons
      why it may be useful.
      
      First, struct acpi_device pointers allow of much better type checking
      than void pointers which are ACPI handles, so it should be more
      difficult to write buggy code using modified struct acpi_dev_node
      and the new macros.  Second, the change should help to reduce (over
      time) the number of places in which the result of ACPI_HANDLE() is
      passed to acpi_bus_get_device() in order to obtain a pointer to the
      struct acpi_device associated with the given "physical" device,
      because now that pointer is returned by ACPI_COMPANION() directly.
      Finally, the change should make it easier to write generic code that
      will build both for CONFIG_ACPI set and unset without adding explicit
      compiler directives to it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
      7b199811
  33. 11 10月, 2013 1 次提交