28 Jul, 2016

5 commits


27 Jul, 2016

30 commits


26 Jul, 2016

5 commits

  • Tom Rini
     
  • Add full documentation to all driver functions.

    Signed-off-by: Mario Six
    Reviewed-by: Stefan Roese

    mario.six@gdsys.cc
     
  • Some devices using the MVTWSI driver have the option to run at speeds
    faster than Standard Mode (100kHZ). On the Armada 38x controllers, this
    is actually necessary, since due to erratum FE-8471889, a timing
    violation concerning repeated starts prevents the controller from
    working correctly in Standard Mode. One of the workarounds recommended
    in the erratum is to set the bus to Fast Mode (400kHZ) operation and
    ensure all connected devices are set to Fast Mode.

    In the current version of the driver, however, the delay times are
    hard-coded to 10ms, corresponding to Standard Mode operation. To take
    full advantage of the faster modes, we would need to either keep the
    currently configured I2C speed in a globally accessible variable, or
    pass it to the necessary functions as a parameter. For DM, the first
    option is not a problem, and we can simply keep the speed in the private
    data of the driver. For the legacy interface, however, we would need to
    introduce a static variable, which would cause problems with boots from
    NOR flashes; see commit d6b7757 "i2c: mvtwsi: Eliminate
    twsi_control_flags."

    As to not clutter the interface with yet another parameter, we therefore
    keep the default 10ms delays for the legacy functions.

    In DM mode, we make the delay time dependant on the frequency to allow
    taking full advantage of faster modes of operation (tested with up to
    1MHZ frequency on Armada MV88F6820).

    Signed-off-by: Mario Six
    Reviewed-by: Stefan Roese

    mario.six@gdsys.cc
     
  • Zero-length offsets are not properly handled by the driver. When a read
    operation with a zero-length offset is started, a START condition is
    asserted, and since no offset bytes are transferred, a repeated START is
    issued immediately after, which confuses the controller.

    To fix this, we send the first START only if any address bytes need to
    be sent, and keep track of the expected start status accordingly.

    Signed-off-by: Mario Six
    Reviewed-by: Stefan Roese

    mario.six@gdsys.cc
     
  • This patch adds the necessary functions and Kconfig entry to make the
    MVTWSI I2C driver compatible with the driver model.

    A possible device tree entry might look like this:

    i2c@11100 {
    compatible = "marvell,mv64xxx-i2c";
    reg = ;
    clock-frequency = ;
    u-boot,i2c-slave-addr = ;
    };

    Signed-off-by: Mario Six
    Reviewed-by: Stefan Roese

    mario.six@gdsys.cc