clk: sunxi: Implement MMC phase control

HdG: add header exporting clk_sunxi_mmc_phase_control

Signed-off-by: Emilio López <emilio@elopez.com.ar>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs

The Allwinner sunxi mmc host uses dma in bus-master mode using a built-in
designware idmac controller, which is identical to the one found in the mmc-dw
hosts. However the rest of the host is not identical to mmc-dw, it deals with
sending stop commands in hardware which makes it significantly different
from the mmc-dw devices.

HdG: Various cleanups and fixes.

Signed-off-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-mmc: Drop cap MMC_CAP_SDIO_IRQ

Testing the wifi on my cubietruck has shown that sometimes sdio-irqs get
missed, I've tried several approaches to fixing this, but all to no avail.

So remove MMC_CAP_SDIO_IRQ from the claimed caps. We keep the rest of
the sdio_irq code, so that it still can be enabled by setting "cap-sdio-irq"
in devicetree on boards where, unlike on the cubietruck, it does work
properly.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun4i: Add mmc controller nodes

Add nodes for the 4 mmc controllers found on A10 SoCs to
arch/arm/boot/dts/sun4i-a10.dtsi.

Signed-off-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun4i: Add pin-muxing info for the mmc0 controller

mmc0 is the only controller actually being used on boards, so limit the
pin-muxing options to that.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun4i: Enable mmc controller on various A10 boards

Tested on a subset of these boards, for the others boards the settings match
the ones of the tested boards according to the original firmware fex files.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun5i: Add mmc controller nodes

Add nodes for the 3 mmc controllers found on A10s SoCs and for the 2 mmc
controllers found on A13 SoCs.

Signed-off-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun5i: Add pin-muxing info for the mmc controllers

This adds  pin-muxing info for the mmc controller / port combinations which
are known to be used on actual boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun5i: Enable mmc controller on various A10s and A13 boards

The cd pin settings have been taken from the original firmware fex files,
and have been confirmed to work on the actual boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun6i: Add mmc clocks

Add clk-nodes for the mmc clocks.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun6i: Add mmc controller nodes

Add nodes for the 4 mmc controllers found on A31 SoCs to
arch/arm/boot/dts/sun6i-a31.dtsi.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun6i: Add pin-muxing info for the mmc controllers

This adds  pin-muxing info for the mmc controller / port combinations which
are known to be used on actual boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun6i: Add new sun6i-a31-m9 dts file for Mele M9

Add a new sun6i-a31-m9 dts file for the Mele M9 / Mele A1000G Quad. These
HTPCs use the same board in a different case, for more details see:
http://linux-sunxi.org/Mele_M9

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: Add mmc controller nodes

Add nodes for the 4 mmc controllers found on A20 SoCs to
arch/arm/boot/dts/sun7i-a20.dtsi.

Signed-off-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: Add pin-muxing info for the mmc controllers

This adds  pin-muxing info for the mmc controller / port combinations which
are known to be used on actual boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: Enable mmc controller on various A20 boards

The cd pin settings have been taken from the original firmware fex files,
and have been confirmed to work on the actual boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ARM: dts: sun7i: Add basic support for the Cubietruck WiFi module

The CubieTruck has an AMPAK AP6210 WiFi+Bluetooth module. The WiFi
part is a BCM43362 IC connected to MMC3 in the A20 SoC via SDIO.
The IC also takes a power enable signal via GPIO.

The WiFi module supports out-of-band interrupt signaling via GPIO,
but this is not supported in this patch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
input: Add new sun4i-ts driver for Allwinner sunxi SoC's rtp controller

Note the sun4i-ts controller is capable of detecting a second touch, but when
a second touch is present then the accuracy becomes so bad the reported touch
location is not useable.

The original android driver contains some complicated heuristics using the
aprox. distance between the 2 touches to see if the user is making a pinch
open / close movement, and then reports emulated multi-touch events around
the last touch coordinate (as the dual-touch coordinates are worthless).

These kinds of heuristics are just asking for trouble (and don't belong
in the kernel). So this driver offers straight forward, reliable single
touch functionality only.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
input: sun4i-ts: Add support for temperature sensor

The sun4i resisitive touchscreen controller also comes with a built-in
temperature sensor. This commit adds support for it.

This commit also introduces a new "ts-attached" device-tree property,
when this is not set, the input part of the driver won't register. This way
the internal temperature sensor can be used to measure the SoC temperature
independent of there actually being a touchscreen attached to the controller.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
input: Add new sun4i-lradc-keys driver

Allwinnner sunxi SoCs have a low resolution adc (called lradc) which is
specifically designed to have various (tablet) keys (ie home, back, search,
etc). attached to it using a resistor network. This adds a driver for this.

There are 2 channels, currently this driver only supports chan0 since there
are no boards known to use chan1. The devicetree properties are already
prefixed with chan0 as preparation for chan1 support in the future.

This has been tested on an olimex a10s-olinuxino-micro, a13-olinuxino, and
a20-olinuxino-micro.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>