Skip to content
Snippets Groups Projects
  1. Mar 13, 2014
  2. Mar 09, 2014
  3. Jan 29, 2014
  4. Nov 14, 2013
  5. Aug 23, 2013
    • Wolfram Sang's avatar
      i2c: move OF helpers into the core · 687b81d0
      Wolfram Sang authored
      
      I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
      that it is much cleaner to have this in the core. This also removes a
      circular dependency between the helpers and the core, and so we can
      finally register child nodes in the core instead of doing this manually
      in each driver. So, fix the drivers and documentation, too.
      
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      687b81d0
  6. Jun 20, 2013
  7. May 17, 2013
  8. Feb 21, 2013
  9. Feb 15, 2013
  10. Feb 08, 2013
  11. Dec 22, 2012
  12. Dec 16, 2012
  13. Oct 28, 2012
  14. Oct 05, 2012
    • Jean Delvare's avatar
      i2c-i801: Let i2c-mux-gpio find the GPIO chip · f82b8626
      Jean Delvare authored
      
      Now that i2c-mux-gpio is able to find the GPIO chip by itself, we can
      delegate this task. The great thing here is that i2c-mux-gpio can
      defer device probing until the gpio chip is available, so we no longer
      depend on the module loading order.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      f82b8626
    • Jean Delvare's avatar
      i2c-i801: Support SMBus multiplexing on Asus Z8 series · 3ad7ea18
      Jean Delvare authored
      
      Add support for SMBus multiplexing on Asus Z8 motherboard series. On
      these boards, the memory slots are behind a GPIO-controlled I2C
      multiplexer. Models with 6 or 12 memory slots have 2 segments behind
      the multiplexer, while models with 18 memory slots have 3 such
      segments.
      
      On these boards, only the memory slots are behind the multiplexer,
      so it is possible to keep the autodetection mechanism.
      
      The code is generic enough so it could work on other boards as long as
      the multiplexer is controlled by GPIO pins. For other forms of
      multiplexing (for example using an I2C device) additional code will be
      needed.
      
      Thanks to Asus for providing a board to develop and test this feature,
      as well as all the technical information required.
      
      At the moment, the GPIO driver must be loaded before the i2c-i801
      driver, but I hope to solve this soon, using deferred probing on
      the i2c-mux-gpio side.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      3ad7ea18
  15. Sep 10, 2012
  16. Jul 24, 2012
    • Daniel Kurtz's avatar
      i2c-i801: Enable IRQ for byte_by_byte transactions · d3ff6ce4
      Daniel Kurtz authored
      
      Byte-by-byte transactions are used primarily for accessing I2C devices
      with an SMBus controller.  For these transactions, for each byte that is
      read or written, the SMBus controller generates a BYTE_DONE IRQ.  The isr
      reads/writes the next byte, and clears the IRQ flag to start the next byte.
      On the penultimate IRQ, the isr also sets the LAST_BYTE flag.
      
      There is no locking around the cmd/len/count/data variables, since the
      I2C adapter lock ensures there is never multiple simultaneous transactions
      for the same device, and the driver thread never accesses these variables
      while interrupts might be occurring.
      
      The end result is faster I2C block read and write transactions.
      
      Note: This patch has only been tested and verified by doing I2C read and
      write block transfers on Cougar Point 6 Series PCH, as well as I2C read
      block transfers on ICH5.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      d3ff6ce4
    • Jean Delvare's avatar
      i2c-i801: Enable interrupts on ICH5/7/8/9/10 · 29b60854
      Jean Delvare authored
      
      Enable interrupts on more devices. ICH5, ICH7(-M) and ICH10 have been
      tested to work OK. ICH8 and ICH9 are expected to work just fine as
      they are very close to ICH7 and ICH10.
      
      Ultimately we want to enable this feature on at least every device
      since the ICH5, but for now we limit the exposure. We'll enable it for
      other devices if we don't get negative feedback.
      
      As a bonus, let the user know when interrupts are used.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Daniel Kurtz <djkurtz@chromium.org>
      29b60854
    • Daniel Kurtz's avatar
      i2c-i801: Enable IRQ for SMBus transactions · 636752bc
      Daniel Kurtz authored
      
      Add a new 'feature' to i2c-i801 to enable using PCI interrupts.
      When the feature is enabled, then an isr is installed for the device's
      PCI IRQ.
      
      An I2C/SMBus transaction is always terminated by one of the following
      interrupt sources: FAILED, BUS_ERR, DEV_ERR, or on success: INTR.
      
      When the isr fires for one of these cases, it sets the ->status variable
      and wakes up the waitq.  The waitq then saves off the status code, and
      clears ->status (in preparation for some future transaction).
      The SMBus controller generates an INTR irq at the end of each
      transaction where INTREN was set in the HST_CNT register.
      
      No locking is needed around accesses to priv->status since all writes to
      it are serialized: it is only ever set once in the isr at the end of a
      transaction, and cleared while no interrupts can occur.  In addition, the
      I2C adapter lock guarantees that entire I2C transactions for a single
      adapter are always serialized.
      
      For this patch, the INTREN bit is set only for SMBus block, byte and word
      transactions, but not for I2C reads or writes.  The use of the DS
      (BYTE_DONE) interrupt with byte-by-byte I2C transactions is implemented in
      a subsequent patch.
      
      The interrupt feature has only been enabled for COUGARPOINT hardware.
      In addition, it is disabled if SMBus is using the SMI# interrupt.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      636752bc
    • Jean Delvare's avatar
      i2c-i801: Consolidate polling · 6cad93c4
      Jean Delvare authored
      
      (Based on earlier work by Daniel Kurtz.)
      
      Come up with a consistent, driver-wide strategy for event polling. For
      intermediate steps of byte-by-byte block transactions, check for
      BYTE_DONE or any error flag being set. At the end of every transaction
      (regardless of PEC being used), check for both BUSY being cleared and
      INTR or any error flag being set. This ensures proper action for all
      transaction types.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Daniel Kurtz <djkurtz@chromium.org>
      6cad93c4
    • Daniel Kurtz's avatar
      i2c-i801: Drop ENABLE_INT9 · 37af8711
      Daniel Kurtz authored
      
      Later patches enable interrupts.  This preliminary patch removes the older
      unsupported ENABLE_INT9 flag.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      37af8711
    • Daniel Kurtz's avatar
      i2c-i801: Rename some SMBHSTCNT bit constants · edbeea63
      Daniel Kurtz authored
      
      Rename the SMBHSTCNT register bit access constants to match the style of
      other register bits.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      edbeea63
    • Daniel Kurtz's avatar
      i2c-i801: Check and return errors during byte-by-byte transfers · 70a1cc19
      Daniel Kurtz authored
      
      If an error is detected in the polling loop, abort the transaction and
      return an error code.
      
       * DEV_ERR is set if the device does not respond with an acknowledge, and
      the SMBus controller times out (minimum 25ms).
       * BUS_ERR is set if a bus arbitration collision is detected.  In other
      words, when the SMBus controller tries to generate a START condition, but
      detects that the SMBDATA is being held low, usually by another SMBus/I2C
      master.
       * FAILED is only set if a transaction is stopped by software (using
      the SMBHSTCNT KILL bit).
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      70a1cc19
    • Daniel Kurtz's avatar
      i2c-i801: Clear only status bits in HST_STS · 0ba8b8bf
      Daniel Kurtz authored
      
      Writing back the whole status register could clear unwanted bits.
      In particular, it could clear the "INUSE_STS" bit, which is a
      'hardware semaphore', that might be useful to use some day.
      To prepare for this, let's ban writing back the whole status to register
      HST_STS, of which this is the only instance.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      0ba8b8bf
    • Daniel Kurtz's avatar
      i2c-i801: Refactor use of LAST_BYTE in i801_block_transaction_byte_by_byte · efa3cb15
      Daniel Kurtz authored
      
      As a slight optimization, pull some logic out of the polling loop during
      byte-by-byte transactions by just setting the I801_LAST_BYTE bit, as
      defined in the i801 (PCH) datasheet, when reading the last byte of a
      byte-by-byte I2C_SMBUS_READ.
      
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      efa3cb15
  17. Mar 26, 2012
  18. Jan 12, 2012
  19. May 24, 2011
  20. May 01, 2011
    • Jean Delvare's avatar
      i2c-i801: Move device ID definitions to driver · a6e5e2be
      Jean Delvare authored
      
      Move the SMBus device ID definitions of recent devices from pci_ids.h
      to the i2c-i801.c driver file. They don't have to be shared, as they
      are clearly identified and only used in this driver. In the future,
      such IDs will go to i2c-i801 directly. This will make adding support
      for new devices much faster and easier, as it will avoid cross-
      subsystem patch sets and merge conflicts.
      
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Seth Heasley <seth.heasley@intel.com>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      a6e5e2be
  21. Mar 31, 2011
  22. Mar 20, 2011
  23. Jan 10, 2011
  24. Oct 31, 2010
Loading