30 May, 2018

3 commits

  • The I2C spec UM10204 Rev. 6 specifies the following timings.

    Standard Fast Mode Fast Mode Plus
    SCL low 4.7us 1.3us 0.5us
    SCL high 4.0us 0.6us 0.26us

    This results in a 33%/66% duty cycle as opposed to the 50%/50% duty cycle
    used for Standard-mode.

    Add High Time Divider settings to correct duty cycle for FM(400kHz) and
    FM+(1MHz).

    Signed-off-by: Austin Christ
    Reviewed-by: Sricharan R
    Reviewed-by: Andy Gross
    Signed-off-by: Wolfram Sang

    Austin Christ
     
  • Previously the QUP driver limited operation mode to I2C Fast Mode. Add
    Fast Mode Plus functionality by raising SCL limit from 400kHz to 1MHz.

    Signed-off-by: Austin Christ
    Reviewed-by: Sricharan R
    Reviewed-by: Andy Gross
    Signed-off-by: Wolfram Sang

    Austin Christ
     
  • Add support for Qualcomm Centriq devices that are qup-v2 compatible but
    do not support DMA, so nodma needs to be set.

    Signed-off-by: Austin Christ
    Reviewed-by: Sricharan R
    Reviewed-by: Andy Gross
    Signed-off-by: Wolfram Sang

    Austin Christ
     

25 May, 2018

6 commits


22 May, 2018

6 commits

  • For SMBus transactions the max permissible transfer size is
    I2C_SMBUS_BLOCK_SIZE. It is possible that some clients might
    not follow it strictly occasionally.
    This would lead to stack corruption if the driver copies more than
    I2C_SMBUS_BLOCK_SIZE bytes. Add a check to avoid such conditions.

    Signed-off-by: Jayachandran C
    Signed-off-by: George Cherian
    Signed-off-by: Wolfram Sang

    George Cherian
     
  • The hardware does not handle updates to the length register gracefully
    if the new value is less than the number of bytes received so far. If
    this happens, the i2c controller will not stop the receive transaction
    properly.

    Fix this by ensuring that the updated length is ok. This is done by
    making sure that the new length written to hardware is at least few
    bytes more than the bytes received so far.

    While at that refactor the length updation to a new function.

    Signed-off-by: Jayachandran C
    Signed-off-by: George Cherian
    Signed-off-by: Wolfram Sang

    George Cherian
     
  • Add support for SMBus alert mechanism to i2c-xlp9xx driver.
    The second interrupt is parsed to use for SMBus alert.
    The first interrupt is the i2c controller main interrupt.

    Signed-off-by: Kamlakant Patel
    Signed-off-by: George Cherian
    Reviewed-by: Jan Glauber
    Signed-off-by: Wolfram Sang

    George Cherian
     
  • …kernel/git/brgl/linux into i2c/for-4.18

    Minor improvements to the at24 driver:

    - use devm_nvmem_register()
    - provide and use a helper for releasing dummy i2c clients
    - provide a separate routine for creating dummy i2c clients

    Wolfram Sang
     
  • I3C busses have to know about all I2C devices connected on the I3C bus
    to properly initialize the I3C master, and I2C frames can't be sent on
    the bus until this initialization is done.

    We can't let the I2C core parse the DT and instantiate I2C devices as
    part of its i2c_add_adapter() procedure because, when done this way,
    I2C devices are directly registered to the device-model and might be
    attached to drivers which could in turn start sending frames on the bus,
    which won't work since, as said above, the bus is not yet initialized.

    Export of_i2c_register_device() in order to let the I3C core parse the
    I2C device nodes by itself and initialize the bus.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Wolfram Sang

    Boris Brezillon
     
  • Currently, of_i2c_register_devices() is responsible for retaining
    info->of_node, but we're about to expose a function to parse I2C board
    info without registering the I2C device.

    We could possibly let this function retain ->of_node, but this approach
    is prone to reference leak since people will have to remember to call
    of_node_put() if something goes wrong between the OF node parsing and
    the registration step.
    Let's just retain the ->of_node in i2c_new_register() instead.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Wolfram Sang

    Boris Brezillon
     

17 May, 2018

13 commits


16 May, 2018

4 commits


15 May, 2018

8 commits

  • The else branch cannot be taken as i will always equal num.
    Get rid of the whole construct.

    Signed-off-by: Peter Rosin
    Signed-off-by: Wolfram Sang

    Peter Rosin
     
  • exynos5_i2c_xfer contains lots of dead code, let's remove it and simplify
    the rest. The patch should not introduce functional changes.

    Signed-off-by: Andrzej Hajda
    Suggested-by: Peter Rosin
    Reviewed-by: Andi Shyti
    Reviewed-by: Peter Rosin
    Signed-off-by: Wolfram Sang

    Andrzej Hajda
     
  • The only user of i2c_board_info->archdata is the OF parsing code and it
    just pass a zero-initialized object which has the same effect as leaving
    ->archdata to NULL since the client object is allocated with kzalloc().

    Get rid of this useless field.

    Signed-off-by: Boris Brezillon
    Signed-off-by: Wolfram Sang

    Boris Brezillon
     
  • Signed-off-by: Wolfram Sang
    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Low-level controller enable function __i2c_dw_enable is overloaded to
    also handle disabling. What's worse, even though the documentation
    requires polling the IC_ENABLE_STATUS register when disabling, this
    is not done: polling needs to be requested specifically by calling
    __i2c_dw_enable_and_wait, which can also poll on enabling, but that
    doesn't work if the IC_ENABLE_STATUS register is not implemented.
    This is quite confusing if not in fact backwards.

    Especially since the documentation says that disabling should be
    followed by polling, the driver should be using a separate function
    where it does one-shot disables to make the optimization stand out.

    This refactors the two functions so that requested status is given
    in the name rather than in a boolean argument. Specifically:

    - __i2c_dw_enable: enable without polling (in accordance with docs)
    - __i2c_dw_disable: disable and do poll (also as suggested by docs)
    - __i2c_dw_disable_nowait: disable without polling (Linux-specific)

    No functional change.

    Signed-off-by: Alexander Monakov
    Acked-by: Jarkko Nikula
    [wsa: fixed blank lines in header file]
    Signed-off-by: Wolfram Sang

    Alexander Monakov
     
  • Wolfram Sang
     
  • Returning zero is wrong in this case.

    Signed-off-by: Peter Rosin
    Signed-off-by: Wolfram Sang
    Fixes: 174a13aa8669 ("i2c: Add viperboard i2c master driver")

    Peter Rosin
     
  • Returning -1 (-EPERM) is not appropriate here, go with -EIO.

    Signed-off-by: Peter Rosin
    Signed-off-by: Wolfram Sang
    Fixes: 1b144df1d7d6 ("i2c: New PMC MSP71xx TWI bus driver")

    Peter Rosin