APPLIED: spi: add ability to validate xfer->bits_per_word in SPI core

Allow SPI masters to define the set of bits_per_word values they support.
If they do this, then the SPI core will reject transfers that attempt to
use an unsupported bits_per_word value. This eliminates the need for each
SPI driver to implement this checking in most cases.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
APPLIED: spi: bcm2835: make use of new bits_per_word_mask core feature

This driver only supports bits_per_word==8, so inform the SPI core of
this. Remove all the open-coded validation that's no longer needed.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
sched: Fix update_group_power() prototype placement to fix build warning when !CONFIG_SMP

All warnings:

   In file included from kernel/sched/core.c:85:0:
   kernel/sched/sched.h:1036:39: warning: 'struct sched_domain' declared inside parameter list
   kernel/sched/sched.h:1036:39: warning: its scope is only this definition or declaration, which is probably not what you want

It's because struct sched_domain is defined inside #if CONFIG_SMP,
while update_group_power() is declared unconditionally.

Fix this warning by declaring update_group_power() only if
CONFIG_SMP=n.

Build tested with CONFIG_SMP enabled and then disabled.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/5137F4BA.2060101@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
LOCAL HACK: ARM: bcm2835: enable enc28j60 SPI device

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
ARM: use Kconfig to select uncompress.h

Following the approach handling DEBUG_LL inclusion, the patch creates
a Kconfig symbol CONFIG_UNCOMPRESS_INCLUDE for choosing the correct
uncompress header.  For traditional build, mach/uncompress.h will be
included in arch/arm/boot/compressed/misc.c.  For multiplatform build,
debug/uncompress.h which contains a suite of empty functions will be
used.  In this way, a platform with particular uncompress.h
implementation could choose its own uncompress.h with this Kconfig
option.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
ARM: uncompress debug support for multiplatform build

Instead of giving zero support of uncompress debug for multiplatform
build, the patch turns uncompress debug into one part of DEBUG_LL
support.  When DEBUG_LL is turned on for a particular platform,
uncompress debug works too for that platform.

OMAP and Tegra are exceptions here.  OMAP low-level debug code places
data in the .data section, and that is not allowed in decompressor.
And Tegra code has reference to variable that's unavailable in
decompressor but only in kernel.  That's why Kconfig symbol
DEBUG_UNCOMPRESS controlling multiplatform uncompress debug support is
defined with !DEBUG_OMAP2PLUS_UART && !DEBUG_TEGRA_UART.

It creates arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE
included there, implements a generic putc() using those macros, which
will be built when DEBUG_UNCOMPRESS is defined.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
WIP: dwc2 cleanup and fixes

FIXME: Needs to be split into separate patches

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
staging: dwc2: platform device wrapper

FIXME: write a patch description. Describe the changes I made.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
[swarren: many changes, described above]
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
HACK: enable DWC2 OTG on RPi

Turn on USB power first in U-Boot:

// msg with 2 parameters, up to 2 responses
setenv prop-2-2 'mw.l 0x00001000 0x00000020 ; mw.l 0x00001004 0x00000000 ; mw.l 0x00001008 \$tag ; mw.l 0x0000100c 0x00000008 ; mw.l 0x00001010 0x00000008 ; mw.l 0x00001014 \$p1 ; mw.l 0x00001018 \$p2 ; mw.l 0x0000101c 0x00000000 ; md.l 0x1000 8'

// send msg, read/dump response
setenv send-rec 'mw 0x2000b8a0 0x00001008 ; md 0x2000b880 1 ; md.l 0x00001000 8'

// set power, devid==p1 (3==USB), state,wait==p2 (3==ON/WAIT)
setenv tag 0x28001 ; setenv p1 3 ; setenv p2 3; run prop-2-2 ; run send-rec

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
of: Add support for reading a u32 from a multi-value property.

This patch adds an of_property_read_u32_index() function to allow
reading a single indexed u32 value from a property containing multiple
u32 values.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
pinctrl: bcm2835: make use of of_property_read_u32_index()

Use the new standard API of_property_read_u32_index() instead of open-
coding it.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
Note: This depends on the proposed patch "of: Add support for reading
a u32 from a multi-value property" by Tony Prisk.

BTW, I realized why I didn't create that standard API, but wrote custom
prop_u32() instead; the code has already looked up the properties, and
validated their length, so prop_u32() can simply index into the property
data, whereas of_property_read_u32_index() needs to go search for the
property and re-validate it every time, so there's a bunch more overhead.
It also means duplicating the property name, although I could use a
define for that. I'm not entirely convinced that using this standard API
is a win in this case. LinusW, Tony, what do you think?