ARM: dts: Fix missing usb0_reset for sun4i / sun5i

The recent sun4i-usb-phy changes to add (preliminary) support for the otg phy,
cause the ehci/ohci controllers to no longer work on sun4i / sun5i, because
the phy driver refuses to load due to a missing usb0_reset reset controller
in the dts files for sun4i / sun5i:

[    0.094293] sun4i-usb-phy 1c13400.phy: failed to get reset usb0_reset
[    0.094326] sun4i-usb-phy: probe of 1c13400.phy failed with error -22

This fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun6i: ippo-q8h-v5: Fix serial0 alias

The Ippo q8h has its serial console connected to the r-uart. Adjust the
serial0 alias to match.

This fixes the kernel serial console no longer working since 3.19-rc1, because
8250_dw.c now honors dt aliases, causing the serial console to be ttyS5 rather
then being ttyS0, as it was in 3.18 and before.

Note that adjusting bootargs instead is not an acceptable fix, because
console=ttyS0,115200 is used by a lot of bootscripts, etc. and this should
continue to work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sunxi: Add simplefb nodes for de_be0-lcd0, de_be0-lcd0-tve0 pipelines

Add simplefb nodes for "de_be0-lcd0" and "de_be0-lcd0-tve0" display pipeline
for when u-boot has set up a pipeline to drive a LCD panel / VGA output rather
then the HDMI output.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
mfd-core: Don't register supplies from add_device, add register_supply_aliases()

We cannot register supply alias in mfd_add_device before calling
platform_add_device because platform-dev's name must be set before registering
the aliases which happens from platform_add_device.

So stop registering supply aliases from mfd_add_device, and add a
mfd_register_supply_aliases helper functions for the cell's plaform driver
probe method to use.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
regulator/axp20x: Call mfd_register_supply_aliases

The mfd-core no longer registers the supply aliases, instead the platform
driver probe method must now call mfd_register_supply_aliases().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
arizona-mfd-codecs: Add mfd_register_supply_aliases() calls

The mfd-core no longer registers the supply aliases, instead the platform
driver probe method must now call mfd_register_supply_aliases().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
net: rfkill: gpio: use clk_prepare_enable/clk_disable_unprepare

rfkill-gpio calls clk_enable() without first calling clk_prepare(),
resulting in a warning and no effect. Switch to clk_prepare_enable()
and clk_disable_unprepare.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
net: rfkill: gpio: add device tree support

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
net: rfkill: gpio: add clock-frequency device tree property

Some devices, such as Broadcom Bluetooth devices, require a specific
clock rate for the clock tied to the rfkill device. Add clock-frequency
property so we can specify this from the device tree.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
ARM: dts: sun5i: Add new auxtek-t004 board file

The auxtek-t004:
http://www.fasttech.com/products/1110/10004200/1318603-auxtek-t004-allwinner-a10s-single-core-android-ics

Is an Allwinner A10s based hdmi tv stick with with 512M RAM, 4G nand flash,
toc9002 (bcm43362) sdio wifi, 1 USB host ports using an USB-A receptacle and
a 2 micro-usb receptacles, one for power and one for USB OTG.

The sdio wifi appears to not have an oob irq hooked up, so we rely on sdio-irq
support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
dt: bindings: mmc: Add sdio function subnode documentation

While SDIO devices are runtime probable they sometimes need nonprobable
additional information on embedded systems, like an additional gpio
interrupt or a clock. This binding describes how to add child nodes to the
devicetree to supply this information.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[hdegoede@redhat.com: Documented the need for #address- and #size-cells]
[hdegoede@redhat.com: Added a real world example]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
mmc: Add SDIO function devicetree subnode parsing

This adds SDIO devicetree subnode parsing to the mmc core. While
SDIO devices are runtime probable they sometimes need nonprobable
additional information on embedded systems, like an additional gpio
interrupt or a clock. This patch makes it possible to supply this
information from the devicetree. SDIO drivers will find a pointer
to the devicenode in their devices of_node pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[hdegoede@redhat.com: Misc. cleanups]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
touchscreen: sun4i-ts: A10 (sun4i) has a different temperature curve

Testing has revealed that the temperature in the rtp controller of the A10
(sun4i) SoC has a different curve then on the A13 (sun5i) and later models.

Add a new sun5i-a13-ts compatible to differentiate the newer models and
set the curve based on the compatible string.

This fixes the temperature reported on the A10 being much higher then
expected.

Note the new curve is still not ideal on all A10-s, that seems to have to
do with there being a large spread between different A10-s out there.

Reported-by: Tong Zhang <lovewilliam@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sunxi: Adjust touchscreen compatible for sun5i and later

The touchscreen controller in the A13 and later has a different temperature
curve than the one in the original A10, change the compatible for the A13 and
later so that the kernel will use the correct curve.

Reported-by: Tong Zhang <lovewilliam@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: Add OOB irq support to boards with broadcom sdio wifi

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: add bluetooth module to CubieTruck DTS

The CubieTruck has an AMPAK AP6210 WiFi+Bluetooth module. The
Bluetooth part is a BCM20710 IC connected to UART2 in the A20
SoC. The IC also takes a 32.768 KHz low power clock input, a power
enable signal and a wake signal via GPIO.

The Bluetooth module supports out-of-band interrupt signaling via
GPIO, but this is not supported in this patch.
pinctrl: sun6i: Add some missing functions

While working on pinctrl for the A31s, I noticed that function 4 of
PA15 - PA18 was missing, add these.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
Changes in v2:
-Drop the changes to the muxing of i2c3 this was based on
 "A31s Datasheet v1.40.pdf", but all other A31 related info puts them at the
 pins where we already have them, so leave this as is
pinctrl: sun6i: Add A31s pinctrl support

The A31s is a stripped down version of the A31, as such it is missing some
pins and some functions on some pins.

The new pinctrl-sun6i-a31s.c this commit adds is a copy of pinctrl-sun6i-a31.c
with the missing pins and functions removed.

Note there is no a31s specific version of pinctrl-sun6i-a31-r.c, as the
prcm pins are identical between the A31 and the A31s.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
Changes in v2:
-Sync i2c3 muxing with v2 of "pinctrl: sun6i: Add some missing functions"
-Add myself to the copyright header
ARM: sunxi: Add "allwinner,sun6i-a31s" to mach-sunxi

So far the A31s is 100% compatible with the A31, still lets do the same
as what we've done for the A13 / A10s and give it its own compatible string,
in case we need to differentiate later.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
rc: sunxi-cir: Add support for an optional reset controller

On sun6i the cir block is attached to the reset controller, add support
for de-asserting the reset if a reset controller is specified in dt.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>