21 Feb, 2014

1 commit


20 Feb, 2014

10 commits

  • As soon as all boards have their CONFIG_SYS_I2C_BASE defined in
    configuration files instead of "asm/arch/hardware.h" it's safe to remove
    the inclusion in question and make driver platform-independent.

    Cc: Tom Rini
    Cc: Heiko Schocher
    Cc: Stefan Roese
    Cc: Vipin Kumar
    Cc: Armando Visconti

    Signed-off-by: Alexey Brodkin

    Alexey Brodkin
     
  • Adds support for set-speed on the OMAP24xx I2C Adapter.

    Changes to omap24_i2c_write(...) for polling ARDY Bit from IRQ-Status.
    Otherwise on a subsequent call the transfer of last byte from the
    predecessor is aborted and therefore lost. For exmaple when
    i2c_write(...) is followed by a i2c_setspeed(...) (which has to
    deactivate and activate master for changing psc,...).

    Minor cosmetical changes.

    Signed-off-by: Hannes Petermaier
    Cc: Heiko Schocher

    Hannes Petermaier
     
  • Make sure the I2C write queue is empty before leaving the mxs_i2c_write().
    If we start and I2C write and only wait for ACK, the MXS I2C IP block may
    enter next operation while still processing the write aftermath internally.
    This will in turn disrupt one or more subsequent transfer(s).

    A testcase for this issue is as such. This testcase is also interesting because
    the first I2C_WRITE which becomes disruptive happens in the 'i2c read' command.
    The 'i2c read' command first uses I2C_WRITE to send I2C address of the chip and
    then uses I2C_READ to read data from the chip. After this command completes, the
    'i2c probe' will use sequence of I2C_WRITE commands to probe the I2C bus. The
    problem is that the first I2C_WRITE disrupted the I2C IP block operation and
    this sideeffect propagates all the way to this next I2C_WRITE used by the 'i2c
    probe' call. The result is the 'i2c probe' receives an ACK on I2C address 0x00,
    even if this ACK was owned by the previous I2C_WRITE operation. Note that the
    'i2c read' command must read from a valid I2C chip address.

    Wrong:
    > i2c probe
    Valid chip addresses: 50 51
    > i2c read 0x50 0x0.2 0x10 0x42000000
    > i2c probe
    Valid chip addresses: 00 50 51

    With this patch
    > i2c probe
    Valid chip addresses: 50 51
    > i2c read 0x50 0x0.2 0x10 0x42000000
    > i2c probe
    Valid chip addresses: 50 51

    Signed-off-by: Marek Vasut
    Cc: Heiko Schocher
    Cc: Fabio Estevam

    Marek Vasut
     
  • Enhance the DesignWare I2C driver to support address length more
    than 1 byte. This enhancement is required as some I2C slave
    device such as EEPROM chip might have 16 bit address byte.

    Signed-off-by: Chin Liang See
    Acked-by: Alexey Brodkin
    Cc: Tom Rini
    cc: Armando Visconti
    Cc: Stefan Roese
    Cc: Albert ARIBAUD
    Cc: Heiko Schocher

    Chin Liang See
     
  • The ADI twi peripheral is not binding to Blackfin processor only.
    Access i2c registers by standard io functions.
    Fix coding style.

    Signed-off-by: Scott Jiang
    Signed-off-by: Sonic Zhang

    Scott Jiang
     
  • The ADI twi peripheral is not binding to Blackfin processor only.
    Change to a generic name.

    Signed-off-by: Sonic Zhang

    Sonic Zhang
     
  • Signed-off-by: Sonic Zhang

    Sonic Zhang
     
  • Signed-off-by: Sonic Zhang

    Sonic Zhang
     
  • Initialize the second i2c controller.

    Signed-off-by: Michael Burr
    Signed-off-by: Michal Simek

    Michael Burr
     
  • Fixed bug with alen == 0 in 'i2c_write', 'i2c_read'
    Further minor corrections:
    - Write 'address' register before 'data' register.
    - Write 'transfer_size' register before 'address' register.

    Signed-off-by: Michael Burr
    Signed-off-by: Michal Simek

    Michael Burr
     

06 Feb, 2014

1 commit


13 Jan, 2014

5 commits


19 Dec, 2013

1 commit


11 Dec, 2013

2 commits


06 Dec, 2013

1 commit


05 Dec, 2013

6 commits

  • Writing zero into I2Ci.I2C_CNT register causes random I2C failures in OMAP3
    based devices. This seems to be related to the following advisory which
    apears in multiple erratas for OMAP3 SoCs (OMAP35xx, DM37xx), as well as
    OMAP4430 TRM:

    Advisory:
    I2C Module Does Not Allow 0-Byte Data Requests
    Details:
    When configured as the master, the I2C module does not allow 0-byte data
    transfers. Note: Programming I2Ci.I2C_CNT[15:0]: DCOUNT = 0 will cause
    undefined behavior.
    Workaround(s):
    No workaround. Do not use 0-byte data requests.

    The writes in question are unnecessary from a functional point of view.
    Most of them are done after I/O has finished, and the only one that preceds
    I/O (in i2c_probe()) is also unnecessary because a stop bit is sent before
    actual data transmission takes place.

    Therefore, remove all writes that zero the cnt register.

    Cc: Heiko Schocher
    Cc: Thomas Petazzoni
    Cc: Tom Rini
    Cc: Lubomir Popov
    Cc: Enric Balletbo Serra
    Signed-off-by: Nikita Kiryanov
    Tested-by: Thomas Petazzoni
    Tested-by: Lubomir Popov

    Nikita Kiryanov
     
  • For a eeprom with a 2-bytes address (e.g., Ateml AT24C1024B),
    the r/w address should be serial out in MSB order.

    Signed-off-by: Kuo-Jung Su
    Cc: Heiko Schocher

    Kuo-Jung Su
     
  • Replace the legacy i2c model with the new one.

    Signed-off-by: Kuo-Jung Su
    Cc: Heiko Schocher

    Kuo-Jung Su
     
  • Coding style cleanup

    Signed-off-by: Kuo-Jung Su
    Cc: Heiko Schocher

    Kuo-Jung Su
     
  • Fix clock value initialisation for Exynos other than Exynos5 for hsi2c.

    Signed-off-by: Piotr Wilczek
    Signed-off-by: Kyungmin Park
    Cc: Minkyu Kang
    Cc: Heiko Schocher

    Piotr Wilczek
     
  • This patch adapts the s3c24x0 driver to the new i2c framework.
    Config file is modified for all the boards that use the driver.

    Signed-off-by: Piotr Wilczek
    Signed-off-by: Kyungmin Park
    CC: Minkyu Kang
    CC: Heiko Schocher
    CC: Inderpal Singh
    CC: David Müller
    CC: Chander Kashyap
    CC: Lukasz Majewski
    Tested-by: Naveen Krishna Chatradhi
    Reviewed-by: Naveen Krishna Chatradhi

    Piotr Wilczek
     

14 Nov, 2013

1 commit


13 Nov, 2013

7 commits

  • This delay applies to any data transfer on I2C bus.

    For example 1kB data read with per-byte access (which happens if
    environment is stored in I2C EEPROM) takes more than 10 seconds.

    Moreover data bus driver has to care about bus state and data transfer,
    but not about internal states of attached devices.

    Signed-off-by: Alexey Brodkin

    Cc: Tom Rini
    cc: Armando Visconti
    Cc: Stefan Roese
    Cc: Albert ARIBAUD
    Cc: Heiko Schocher
    Cc: Vipin KUMAR
    Cc: Tom Rix
    Cc: Mischa Jonker

    Alexey Brodkin
     
  • As it is stated in DesignWare I2C databook: writes to IC_TAR (0x4)
    register succeed only when IC_ENABLE[0] is set to 0.

    Signed-off-by: Alexey Brodkin

    Cc: Tom Rini
    cc: Armando Visconti
    Cc: Stefan Roese
    Cc: Albert ARIBAUD
    Cc: Heiko Schocher
    Cc: Vipin KUMAR
    Cc: Tom Rix
    Cc: Mischa Jonker

    Alexey Brodkin
     
  • remove omap1510 i2c driver, as there is no board which uses it

    Signed-off-by: Heiko Schocher
    Cc: Tom Rini
    Cc: Jian Zhang

    Heiko Schocher
     
  • - add zync i2c driver to new multibus/multiadpater support
    - adapted all config files, which uses this driver

    Signed-off-by: Heiko Schocher
    Cc: Joe Hershberger
    Cc: Michal Simek

    Heiko Schocher
     
  • - add omap24xx driver to new multibus/multiadpater support
    - adapted all config files, which uses this driver

    Tested on the am335x based siemens boards rut, dxr2 and pxm2
    posted here:
    http://patchwork.ozlabs.org/patch/263211/

    Signed-off-by: Heiko Schocher
    Tested-by: Tom Rini
    Cc: Lars Poeschel
    Cc: Steve Sakoman
    Cc: Thomas Weber
    Cc: Tom Rix
    Cc: Grazvydas Ignotas
    Cc: Enric Balletbo i Serra
    Cc: Luca Ceresoli
    Cc: Igor Grinberg
    Cc: Ilya Yanok
    Cc: Stefano Babic
    Cc: Nishanth Menon
    Cc: Pali Rohár
    Cc: Peter Barada
    Cc: Nagendra T S
    Cc: Michael Jones
    Cc: Raphael Assenat
    Acked-by: Igor Grinberg
    Acked-by: Stefano Babic

    Heiko Schocher
     
  • The endless waiting for a bit to be set can cause a hang, add a timeout
    so we prevent such situation. A testcase for such a hang is below. The
    testcase assumes a device to be present at address 0x50 and a device to
    NOT be present at address 0x42 . Also note that the "sleep 1" induced
    delays are imperative for this bug to manifest .

    i2c read 0x42 0x0.2 0x10 0x42000000 ; sleep 1 ; \
    i2c read 0x50 0x0.2 0x10 0x42000000 ; sleep 1 ; \
    i2c read 0x42 0x0.2 0x10 0x42000000

    The expected result of the above command is:

    Error reading the chip.
    Error reading the chip.

    While without this patch, we observe a hang in the last read from 0x42
    precisely when waiting for this bit to be set.

    Signed-off-by: Marek Vasut
    Cc: Fabio Estevam
    Cc: Heiko Schocher
    Cc: Stefano Babic

    Marek Vasut
     
  • This updates to new I2C framwwork on sh_i2c.
    And this also updates boards(kzm9g and ecovec) that using sh_i2c.

    Signed-off-by: Nobuhiro Iwamatsu
    Signed-off-by: Nobuhiro Iwamatsu

    Nobuhiro Iwamatsu
     

01 Nov, 2013

1 commit


17 Oct, 2013

4 commits

  • The prototype of handlers had changed.
    This commit uses cast with (void *) rather than
    the handler-specific prototype.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Add support for hsi2c controller available on exynos5420.

    Note: driver currently supports only fast speed mode 100kbps

    Change-Id: I02555b1dc8f4ac21c50aa5158179768563c92f43
    Signed-off-by: Naveen Krishna Chatradhi
    Signed-off-by: Vadim Bendebury
    Signed-off-by: R. Chandrasekar

    Naveen Krishna Ch
     
  • At present the i2c ports are enumerated in a strange way - the
    fdtdec_find_aliases_for_id() function is used, but then the ID returned
    is ignored and the ports are renumbered. The effect is the same provided
    that the device tree has the ports in the same order, or uses aliases,
    and has no gaps, but it is not correct.

    Adjust the code to use the function as intended. This will allows device
    tree aliases to change the device order if required.

    As a result, the i2c_busses variable is dropped. We can't be sure that
    there are no 'holes' in the list of buses, so must check the whole
    array.

    Note: it seems that non-FDT operation is now broken in this drive and
    will need to be reinstated for upstream.

    Signed-off-by: Simon Glass
    Reviewed-on: https://gerrit.chromium.org/gerrit/59369
    Signed-off-by: Naveen Krishna Chatradhi

    Simon Glass
     
  • The Exynos5 i2c driver does not handle NACKs properly. This change:

    - fixes the NACK processing problem (do not continue transaction if
    address cycle was NACKed)

    - eliminates a fair amount of duplicate code

    Signed-off-by: Vadim Bendebury
    Reviewed-by: Simon Glass
    Signed-off-by: Naveen Krishna Chatradhi

    Naveen Krishna Ch