ARM: msm: introduce CM-QS600 module

Add initial support for CompuLab CM-QS600 module
based on Qualcomm APQ8064 reference board:
board-8064.c            ->  board-cm-qs600.c
board-8064.h            ->  board-cm-qs600.h
board-8064-gpiomux.c    ->  board-cm-qs600-gpiomux.c
board-8064-pmic.c       ->  board-cm-qs600-pmic.c
board-8064-regulator.c  ->  board-cm-qs600-regulator.c
msm8960_defconfig       ->  cm_qs600_android_defconfig

Change-Id: Ib6394d8f2464767cd4935445d19a3fbdf0fa7684
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: clean up the board file

1. Clean up the board file by removing code irrelevant to CM-QS600
   module, and slightly refactoring it.
2. Add 'machine_is_cm_qs600' test to files being linked with
   CM-QS600.

Change-Id: I28776dd353fa09e42c57771e4df7cd68c52eadfe
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: rename board file symbols

Rename board file functions and variables in order to maintain
CM-QS600 name space.

Change-Id: I3b67295e4f30e71c33a60adfd0e25bf632609a0d
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
keep charging enable in battery-less configuration for uPC

Without this patch, the kernel would get stuck on this line:
 pm8921_chg_hw_init()
 |
 -- pm_chg_charge_dis()

Change-Id: I2dc8b2b7d5c79d1f5479c5c9a548a2349edef339
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: usb: cm-qs600: enable USB host

Enable USB host functionality.
This commit stems from commit "enable USB1 and USB2" by
Richard Zhuang of Qualcomm.

Change-Id: I09d16aac88e9f107f7063c1abc068fe372fdd0f8
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: hdmi: code cleanup

Change-Id: I4af43703fd8cfdb7c136d8dbe41a96e5f78d17cd
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: hdmi: fix bug in HPD debouncing logic

HPD interrupt was not re-enabled, after being disabled for debouncing
purpose.
In this patch, after debouncing delay, we
1) re-enable HPD interrupt
2) set polarity for the next HPD event

Change-Id: I2f671f7219d294326cc596eb3b669f2147d38e0e
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: pcie: make pcie gpios optional

Make PCIe pwr_en and rst GPIOs optional, allowing setting GPIO number
to -1 or -EINVAL.
Rationale:
E.g. enable boards where PCIe is always on - no pwr_en.

Change-Id: I82a263c8b75d2cd3949b75f3812e125360668e01
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: enable Ethernet over PCIe

Enable Ethernet over PCIe.

Change-Id: Idf4fefec7835686e29f65a4bb491f754db03e7f3
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm_qs600_defconfig: enable eth controller

Enable (Atheros) ATL1C ethernet controller.

Change-Id: I7bbc7ab0120f60269089b17655a0f000a4a89093
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
net: ipv6: print status more comprehensively

Change-Id: I42037d17b9907875181da0cfd97072b1375003b3
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: pcie eth: workaround HW bug

CM-QS600, rev. 1.0:
Provide one-time reset to the Ethernet controller, working around a
bug in PCIe reset signal wiring.

Change-Id: Id9f53a381a94a960140ccd96f4dd863fa0d40f71
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ata: ahci: Add SATA support for Qualcomm MSM chipsets

Add a glue driver for AHCI platform driver to support SATA
controller and PHY on Qualcomm's MSM platforms. The SATA
controller on MSM adheres to AHCI 1.3 specification and SATA
PHY is based on SATA 3.0 specification.

The glue driver acts as a device driver for msm_sata device and
registers AHCI device in its probe, AHCI platform driver then
acts as a device driver for created AHCI device. All the necessary
msm platform specific initialization is handled by msm_sata driver
while keeping ahci_platform generic enough.

Following are done during controller initialization:
 - SATA clocks initialization.
 - SATA regulator initialization.
 - SATA PHY calibration.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
(cherry picked from commit 933df54a634b59419a1a974262f47edc81a2b92b)

Change-Id: I6bdbd8d09a4152ab07474ff70225fe4da073ed5a
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ata: fix compilation warning

Change-Id: I03ab530c6cfe5d7bc78187dcd246999f161fb88a
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ata: ahci_platform: Register as hot-pluggable module

Even though AHCI controller is part of SoC in most chipsets
it is not safe to assume that AHCI device is registered before
AHCI module init is called. Register AHCI platform driver as
hot-pluggable module so that the device, driver match
can happen in any order.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit 021bf99560d056b97612551d4abf1bdabbbfadef)

Change-Id: I82c01d9eab00c86b16d10a964bdfaccd21586c01
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ata: ahci_platform: Enable runtime power management

Provide runtime power management callbacks for AHCI device.
The runtime power management will be disabled by default
due to regressions in hot plug functionality, but userspace
can enable it by echo'ing into following sysfs entry:

echo auto > /sys/devices/platform/ahci.X/power/control

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit db4b5d055809f80b8ac8fc312aaab12613f08460)

Change-Id: I3452efce0e447e5ad07a9c1ecb56b5c9b4111597
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
board-8064: Add necessary board support for SATA

Following changes are required in board files to
support SATA on APQ8064 CDP and MPQ8064 HRD.

1) Clocks:
    - SATA controller and PHY needs following clocks
    for correct operation:
      - AHB and AXI interface clocks
      - RX out-of-band signalling clock
      - PHY reference clock
      - PHY configuration clock

2) Regulators:
    - SATA clock generator block is powered by an external
    3.3V supply which is controlled by a PMIC MPP4 pin.
    - MPQ8064 HRD supports port multiplier (PMP) which is
    powered by PM8921 S4 regulator.

3) Platform device:
    - The MSM SATA device is added as a platform device
    with necessary resources - memory mapped i/o and irq number.

Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit b0d51e7de7120e51e0bae4a81fe6ec8bce600392)

Change-Id: I217ead32cbc1f0033ef04f9e0777e2986e86a2eb
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: Add necessary support for SATA

Add SATA suport to CM-QS600 board file.
(This commit extends the previous commit.)

Change-Id: I4ca0ce07461fe2c00a68d16eebf29a2e4dd1a401
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm_qs600_defconfig: enable SATA_AHCI_MSM

Change-Id: I5790720cb9d91ac06b1f5ba444db7352184a66dc
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>
ARM: msm: cm-qs600: rtc: enable setting hwclock

Make RTC writable, enabling setting hwclock.

Change-Id: I146cff26a297847c7a8d5b725bd90262968511fc
Signed-off-by: Andrey Gelman <andrey.gelman@compulab.co.il>