09 Apr, 2014

1 commit

  • Pull i2c updates from Wolfram Sang:
    "Here is the pull request from the i2c subsystem. It got a little
    delayed because I needed to wait for a dependency to be included
    (commit b424080a9e08: "reset: Add optional resets and stubs"). Plus,
    I had some email problems. All done now, the highlights are:

    - drivers can now deprecate their use of i2c classes. That shouldn't
    be used on embedded platforms anyhow and was often blindly
    copy&pasted. This mechanism gives users time to switch away and
    ultimately boot faster once the use of classes for those drivers is
    gone for good.

    - new drivers for QUP, Cadence, efm32

    - tracepoint support for I2C and SMBus

    - bigger cleanups for the mv64xxx, nomadik, and designware drivers

    And the usual bugfixes, cleanups, feature additions. Most stuff has
    been in linux-next for a while. Just some hot fixes and new drivers
    were added a bit more recently."

    * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (63 commits)
    i2c: cadence: fix Kconfig dependency
    i2c: Add driver for Cadence I2C controller
    i2c: cadence: Document device tree bindings
    Documentation: i2c: improve section about flags mangling the protocol
    i2c: qup: use proper type fro clk_freq
    i2c: qup: off by ones in qup_i2c_probe()
    i2c: efm32: fix binding doc
    MAINTAINERS: update I2C web resources
    i2c: qup: New bus driver for the Qualcomm QUP I2C controller
    i2c: qup: Add device tree bindings information
    i2c: i2c-xiic: deprecate class based instantiation
    i2c: i2c-sirf: deprecate class based instantiation
    i2c: i2c-mv64xxx: deprecate class based instantiation
    i2c: i2c-designware-platdrv: deprecate class based instantiation
    i2c: i2c-davinci: deprecate class based instantiation
    i2c: i2c-bcm2835: deprecate class based instantiation
    i2c: mv64xxx: Fix reset controller handling
    i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync
    i2c: efm32: new bus driver
    i2c: exynos5: remove unnecessary cast of void pointer
    ...

    Linus Torvalds
     

08 Apr, 2014

1 commit

  • If the renamed symbol is defined lib/iomap.c implements ioport_map and
    ioport_unmap and currently (nearly) all platforms define the port
    accessor functions outb/inb and friend unconditionally. So
    HAS_IOPORT_MAP is the better name for this.

    Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.

    The motivation for this change is to reintroduce a symbol HAS_IOPORT
    that signals if outb/int et al are available. I will address that at
    least one merge window later though to keep surprises to a minimum and
    catch new introductions of (HAS|NO)_IOPORT.

    The changes in this commit were done using:

    $ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'

    Signed-off-by: Uwe Kleine-König
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     

07 Apr, 2014

1 commit

  • During development, the driver first really needed to depend on
    COMMON_CLK only. Later, it was switched to writel_relaxed, but it was
    forgotten to update the dependencies, so build errors occured:

    config: make ARCH=i386 allyesconfig

    All error/warnings:

    drivers/i2c/busses/i2c-cadence.c: In function 'cdns_i2c_clear_bus_hold':
    >> drivers/i2c/busses/i2c-cadence.c:168:3: error: implicit declaration
    >> of function 'writel_relaxed' [-Werror=implicit-function-declaration]

    Use a very safe dependency for now.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     

06 Apr, 2014

2 commits


03 Apr, 2014

1 commit


29 Mar, 2014

1 commit

  • This bus driver supports the QUP i2c hardware controller in the Qualcomm SOCs.
    The Qualcomm Universal Peripheral Engine (QUP) is a general purpose data path
    engine with input/output FIFOs and an embedded i2c mini-core. The driver
    supports FIFO mode (for low bandwidth applications) and block mode (interrupt
    generated for each block-size data transfer).

    Signed-off-by: Ivan T. Ivanov
    Signed-off-by: Bjorn Andersson
    Reviewed-by: Andy Gross
    Tested-by: Philip Elcan
    [wsa: removed needless IS_ERR_VALUE]
    Signed-off-by: Wolfram Sang

    Bjorn Andersson
     

28 Mar, 2014

9 commits

  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang
    Cc: Barry Song

    Wolfram Sang
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang
    Cc: Sekhar Nori
    Cc: Kevin Hilman

    Wolfram Sang
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang

    Wolfram Sang
     
  • The reset framework recently gained optional stubs when CONFIG_RESET_CONTROLLER
    is not selected. It also introduced a function reset_get_optional, that is also
    dummy-defined whenever the framework isn't enabled, for drivers that needs an
    optional reset controller.

    Switch to this function, since the mv64xxx driver is in this case. This also
    fixes a compilation breakage whenever the reset framework wasn't selected:

    drivers/i2c/busses/i2c-mv64xxx.c:771:2: error: implicit declaration of function 'devm_reset_control_get'

    While we're at it, remove the redundant test on dev.of_node surrounding the
    calls to reset framework functions, since it will either be a valid pointer, an
    error pointer in the case where we called reset_get_optional without an of_node
    pointer or if it failed, or NULL if we're not loaded through DT.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Wolfram Sang

    Maxime Ripard
     
  • we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync,
    when the value can only be < 0 in the case of err. Replace the
    check with a simpler < 0 check.

    This fixes the coccicheck warnings:
    linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24:
    pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
    line 1158
    linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26:
    pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
    line 1279
    drivers/i2c/busses/i2c-omap.c:638:5-24:
    pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
    line 639

    Signed-off-by: Nishanth Menon
    Reviewed-by: Felipe Balbi
    Signed-off-by: Wolfram Sang

    Nishanth Menon
     
  • This was tested on a EFM32GG-DK3750 devboard that has a temperature
    sensor and an eeprom on its i2c bus.

    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Wolfram Sang

    Uwe Kleine-König
     

24 Mar, 2014

1 commit

  • Fixes a build break due to the undeclared use of irq_of_parse_and_map()
    and of_iomap(). This build break was apparently introduced while the
    driver was unbuildable due to the bug fixed by
    62c19c9d29e65086e5ae76df371ed2e6b23f00cd ("i2c: Remove usage of
    orphaned symbol OF_I2C"). When 62c19c was added in v3.14-rc7,
    the driver was enabled again, breaking the powerpc mpc85xx_defconfig
    and mpc85xx_smp_defconfig.

    62c19c is marked for stable, so this should go there as well.

    Reported-by: Geert Uytterhoeven
    Signed-off-by: Scott Wood
    Signed-off-by: Wolfram Sang
    Cc: stable@kernel.org

    Scott Wood
     

14 Mar, 2014

6 commits

  • The symbol is an orphan, don't depend on it anymore.

    Signed-off-by: Richard Weinberger
    [wsa: enhanced commit message]
    Signed-off-by: Wolfram Sang
    Fixes: 687b81d083c0 (i2c: move OF helpers into the core)
    Cc: stable@kernel.org

    Richard Weinberger
     
  • Remove unnecessary cast of void pointer, because 'algo_data' of
    'struct i2c_adapter' is a void pointer. Casting the void pointer
    is redundant. The conversion from void pointer to any other
    pointer type is guaranteed by the C programming language.

    Signed-off-by: Jingoo Han
    Reviewed-by: Naveen Krishna Chatradhi
    Signed-off-by: Wolfram Sang

    Jingoo Han
     
  • Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
    build warning when CONFIG_PM_SLEEP is not selected. This is because
    sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
    the CONFIG_PM_SLEEP is enabled.

    warning: 'exynos5_i2c_suspend_noirq' defined but not used [-Wunused-function]
    warning: 'exynos5_i2c_resume_noirq' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Signed-off-by: Wolfram Sang

    Jingoo Han
     
  • When using device-tree and the i2c-gpio driver is called before the
    GPIO node has been probed then it needs to correctly defer the probe
    instead of returning a permanent error that the gpio numbers are not
    valid.

    This fixes the following error:
    /i2c@2: invalid GPIO pins, sda=-517/scl=-517

    Signed-off-by: Ben Dooks
    Signed-off-by: Wolfram Sang

    Ben Dooks
     
  • 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-
    a=
    f=
    c=


    res=
    l=
    []

    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: David Howells
    Reviewed-by: Steven Rostedt
    Signed-off-by: Wolfram Sang

    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-
    #
    a=
    f=
    l=
    n=
    ret=
    []

    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: Steven Rostedt
    Signed-off-by: David Howells
    Reviewed-by: Steven Rostedt
    [wsa: adapted path for 'enable' in the commit msg]
    Signed-off-by: Wolfram Sang

    David Howells
     

13 Mar, 2014

3 commits

  • Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
    is not preferred.

    Signed-off-by: Jingoo Han
    Signed-off-by: Wolfram Sang

    Jingoo Han
     
  • There is a rather odd feature of the exynos i2c controller that if it
    is left enabled, it can lock itself up with the clk line held low.
    This makes the bus unusable.

    Unfortunately, the s3c24xx_i2c_set_master() function does not notice
    this, and reports a timeout. From then on the bus cannot be used until
    the AP is rebooted.

    The problem happens when any sort of interrupt occurs (e.g. due to a
    bus transition) when we are not in the middle of a transaction. We
    have seen many instances of this when U-Boot leaves the bus apparently
    happy, but Linux cannot access it.

    The current code is therefore pretty fragile.

    This fixes things by leaving the bus disabled unless we are actually
    in a transaction. We enable the bus at the start of the transaction and
    disable it at the end. That way we won't get interrupts and will not
    lock up the bus.

    It might be possible to clear pending interrupts on start-up, but this
    seems to be a more robust solution. We can't service interrupts when
    we are not in a transaction, and anyway would rather not lock up the
    bus while we try.

    Signed-off-by: Simon Glass
    Signed-off-by: Naveen Krishna Chatradhi
    Acked-by: Kyungmin Park
    Signed-off-by: Wolfram Sang

    Simon Glass
     
  • Warn users that class based instantiation is going away soon in favour
    of more robust probing and faster bootup times.

    Signed-off-by: Wolfram Sang
    Cc: Ben Dooks
    Cc: Kukjin Kim

    Wolfram Sang
     

12 Mar, 2014

2 commits

  • This adds the ability to set "clock-frequency" in the device tree for the at91
    i2cbus following the naming of other i2c bus implementations. If the property
    is not set,the clock frequency will default to the previously used define
    of 100KHz.

    Signed-off-by: Marek Roszko
    Signed-off-by: Wolfram Sang

    Marek Roszko
     
  • On Intel BayTrail, there was case whereby the resulting fast mode
    bus speed becomes slower (~20% slower compared to expected speed)
    if using the HCNT/LCNT calculated in the core layer. Thus, this
    patch is added to allow pci glue layer to pass in optimal
    HCNT/LCNT/SDA hold time values to core layer since the core
    layer supports cofigurable HCNT/LCNT/SDA hold time values now.

    Signed-off-by: Chew, Chiau Ee
    Acked-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Chew, Chiau Ee
     

11 Mar, 2014

4 commits


10 Mar, 2014

4 commits


09 Mar, 2014

4 commits

  • Intel Baytrail I2C controllers can be enumerated from PCI as well as from
    ACPI. In order to support this add the Baytrail PCI IDs to the driver.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Mika Westerberg
     
  • The PCI part of the DesignWare I2C driver does a lot of things that are not
    required anymore. For example drivers aren't supposed to handle PCI state
    transitions themselves. This is all provided by the PCI bus core already.

    In addition to that there is no point scheduling RPM suspend on driver's
    idle hook but instead we can use RPM autosuspend for this (which is enabled
    in the driver already).

    As a bonus, this patch also fixes following compile warning which is
    emitted when the driver was compiled without CONFIG_PM_RUNTIME set:

    drivers/i2c/busses/i2c-designware-pcidrv.c:245:12: warning: ‘i2c_dw_pci_runtime_idle’ defined but not used [-Wunused-function]

    Reported-by: xinhui.pan
    Reported-by: Jingoo Han
    Signed-off-by: Mika Westerberg
    Signed-off-by: Wolfram Sang

    Mika Westerberg
     
  • This patch allows to set independantly SCL and SDA falling times.
    The tLOW period is computed by taking into account the SCL falling time.
    The tHIGH period is computed by taking into account the SDA falling time.

    For instance in case the margin on tLOW is considered too small, it can
    be increased by increasing the SCL falling time which is by default set
    at 300ns.

    The same applies for tHIGH period with the help of SDA falling time.

    Signed-off-by: Romain Baeriswyl
    Reviewed-by: Christian Ruppert
    Acked-by: Shinya Kuribayashi
    Signed-off-by: Wolfram Sang

    Romain Baeriswyl
     
  • Put necessary SSYNC code into blackfin twi arch header. The generic TWI
    driver should not contain any architecture specific code.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Wolfram Sang

    Sonic Zhang