i2c: designware-pci: add 10-bit addressing mode functionality for BYT I2C

All the I2C controllers on Intel BayTrail LPSS subsystem able
to support 10-bit addressing mode functionality.

Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com>
Signed-off-by: Ong, Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: mv64xxx: refactor send_start

For start and restart, we are doing the same thing. Let's consolidate
that.

Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: mv64xxx: directly call send_start when initializing transfer

Calling the state machine with a definite state which is only used in
this context is superfluous. Do it directly.

Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: mv64xxx: refactor initialization for new msgs

We now have a central place to put this code to.

Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: s3c2410: Trivial cleanup in header file

Commit 436d42c61c3e ("ARM: samsung: move platform_data definitions")
moved the files to the current location but forgot to remove the pointer
to its previous location. Clean it up. While at it also change the header
file protection macros appropriately.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: st: Fix return in case of arbitration lost

This patch fixes the error returned to the i2c_transfer function
to -EAGAIN in case of arbitratin lost, so that the retry mechanism
can be used.

Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
dmaengine: s3c24xx-dma: make phy->irq signed for error handling

There is a bug in s3c24xx_dma_probe() where we do:

		phy->irq = platform_get_irq(pdev, i);
		if (phy->irq < 0) {

The problem is that "phy->irq" is unsigned so the error handling doesn't
work.  I have changed it to signed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
usb: musb: musb_cppi41: Dont reprogram DMA if tear down is initiated

Reprogramming the DMA after tear down is initiated leads to warning.
This is mainly seen with ISOCH since we do a delayed completion for
ISOCH transfers. In ISOCH transfers dma_completion should not reprogram
if the channel tear down is initiated.

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
dma: cppi41: start tear down only if channel is busy

Start the channel tear down only if the channel is busy, else just
bail out. In some cases its seen that by the time the tear down is
initiated the cppi completes the DMA, especially in ISOCH transfers.

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
leds-ot200: Fix dependencies

The Bachmann OT200 is a Geode-based device, so OT200-specific drivers
are only useful on X86_32, except for build testing.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
i2c: designware-pci: set ideal HCNT, LCNT and SDA hold time value

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 <chiau.ee.chew@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: Spelling s/than/that/

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
i2c: at91: Add device tree property to set clock-frequency

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 <mark.roszko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
microblaze: Rename global function heartbeat()

microblaze:allmodconfig complains for some configurations that 'heartbeat'
is redefined as different kind of symbol. This is seen in test compiles
of watchdog drivers, which often use 'heartbeat' as ststic variable.

Since 'heartbeat' is an unfortunate name for a global function,
rename it to microblaze_heartbeat. Also rename the setup function
to microblaze_setup_heartbeat.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
microblaze: Drop architecture-specific declaration of early_printk

miceroblaze:allmodconfig fails to build, complaining that
early_printk is redeclared.

include/linux/printk.h:114:6: error: static declaration of 'early_printk'
		follows non-static declaration
 void early_printk(const char *s, ...) { }
      ^
In file included from arch/microblaze/include/asm/page.h:19:0,
                 from arch/microblaze/include/asm/io.h:15,
                 from include/linux/io.h:22,
                 from kernel/irq/generic-chip.c:6:
arch/microblaze/include/asm/setup.h:22:6:
		note: previous declaration of 'early_printk' was here
 void early_printk(const char *fmt, ...);

This happens because CONFIG_EARLY_PRINTK is not enabled in this
configuration.

The architecture-specific declaration is not needed; drop it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
microblaze: Enable pselect6 syscall

Enable this syscall and cleanup comments.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
microblaze: Wire-up preadv/pwritev in syscall table

Enable these two syscalls.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
microblaze: Wire-up new system calls sched_setattr/getattr

Wire-up sched_setattr/getattr syscalls.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
i2c: i2c-s3c2410: deprecate class based instantiation

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 <wsa@the-dreams.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
i2c: s3c2410: Leave the bus disabled unless it is in use

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 <sjg@chromium.org>
Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>