PM / devfreq: Export helper functions for drivers

These functions are indended for use by drivers and should be available
also when the driver is built as a module.

Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Ørjan Eide <orjan.eide@arm.com>
[nm@ti.com: just a simple backport]
Signed-off-by: Nishanth Menon <nm@ti.com>
thermal: DRA7: fallback to restarting the system in case poweroff fails

Systems that do not support poweroff (for instance, DRA7), cannot
recover from a software triggered thermal shutdown. In such cases
fall back to restarting the system, and leave it to the bootloader
to handle the scenario.

[j-keerthy@ti.com] ported to 3.14 and tested
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
ARM: dts: am335x-evm: Fix backlight sleep pin config

On the newest AM335x GP EVM boards, backlight remains on during suspend.
According to "General Purpose Daughterboard SKU1 Modifications" document
version 1.05, CPLD code has been modified to add an inverter for
LCD_ENBKL signal so the EVM does not have to keep a GPIO high during
suspend to power off the backlight. Solution for this is to use a pulldown
during suspend to make sure the signal is low and the backlight gets
powered off.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree into ti-linux-3.14.y

TI-Feature: power_management_base
TI-Tree: git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree.git
TI-Branch: pm-ti-linux-3.14.y

* 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree:
  thermal: DRA7: fallback to restarting the system in case poweroff fails
  PM / devfreq: Export helper functions for drivers

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ARM: OMAP: DRA7: hwmod: Make gpmc software supervised as the smart idle is broken

This patch fixes: 'omap_hwmod: gpmc: _wait_target_disable failed'
error.

This is because smart idle is not working.
Tested in dra7-evm D1 board.

Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: OMAP2+: clock: add support for specifying max rate for DPLLs

DPLLs typically have a maximum rate they can support, and this varies
from DPLL to DPLL. Add support of the maximum rate value to the DPLL
data struct, and also add check for this in the DPLL round_rate function.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
clk: ti: amx3xx: limit the maximum frequency of DPLLs based on spec

AM33xx/AM43xx devices use the same DPLL IP blocks, which only support
maximum rate of 1GHz [1] for the default and 2GHz for the low-jitter type
DPLLs [2]. Reflect this limitation in the DPLL init code by adding the
max-rate parameter based on the DPLL types.

[1] Functional, integration & test specification for GS70 ADPLLS, Rev 1.0-01
[2] Functional, integration & test specification for GS70 ADPLLLJ, Rev 0.8-02

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
ARM: DRA: hwmod: RTC: Add reset function for RTC

RTC IP have kicker feature which prevents spurious writes to its registers.
In order to write into any of the RTC registers, KICK values has te be
written to KICK registers. Currently hwmod is updating the IDLEMODE in rtc
sysconfig register without writing into any kick register which is a noop.
When autoidle is allowed for rtc, interruts are not received until IDLEMODE
is set to SIDLE_SMART_WKUP.
Adding a reset function to unlock RTC registers so that IDLEMODE is
updated.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Merge branch 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-3.14.y

TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-3.14.y

* 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  clk: ti: amx3xx: limit the maximum frequency of DPLLs based on spec
  ARM: OMAP2+: clock: add support for specifying max rate for DPLLs
  ARM: OMAP: DRA7: hwmod: Make gpmc software supervised as the smart idle is broken

Signed-off-by: Dan Murphy <DMurphy@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ARM: dts: am335x-evm: Fix backlight sleep pin config

Signed-off-by: Dan Murphy <DMurphy@ti.com>
Merge branch 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-3.14.y

TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-3.14.y

* 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  ARM: DRA: hwmod: RTC: Add reset function for RTC

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ARM: OMAP2+: DRA7XX: OPP: Add encoding for "All OPP" configuration

Value 23 indicates all OPPs. Add that to the configuration.

Based on Vayu Speed grade document revision 0.2 (May 30, 2014).

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Dave Gerlach <d-gerlach@ti.com>
Merge branch 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree into ti-linux-3.14.y

TI-Feature: power_management_base
TI-Tree: git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree.git
TI-Branch: pm-ti-linux-3.14.y

* 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree:
  ARM: OMAP2+: DRA7XX: OPP: Add encoding for "All OPP" configuration

Signed-off-by: Dan Murphy <DMurphy@ti.com>
bus: omap_l3_noc: Add resume hook to restore context

On certain SoCs such as AM437x SoC, L3_noc error registers are
maintained in power domain such as per domain which looses context as part
of low power state such as RTC+DDR mode. On these platforms when we
mask interrupts which we cannot handle, the source of these interrupts
still remain on resume, however, the flag mux registers now contain
thier reset value (unmasked) - this breaks the system with infinite
interrupts since we do not these interrupts to take place ever again.

To handle this: restore the masking of interrupts which we have
already recorded in the system as ones we cannot handle.

Fixes: 654fa7979b5db9a44b8 ("bus: omap_l3_noc: ignore masked out unclearable targets")
Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler

Correct returning IRQ_HANDLED unconditionally in the irq handler.
Return IRQ_NONE for some interrupt which we do not expect to be
handled in this handler. This prevents kernel stalling with back
to back spurious interrupts.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Merge branch 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree into ti-linux-3.14.y

TI-Feature: power_management_base
TI-Tree: git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree.git
TI-Branch: pm-ti-linux-3.14.y

* 'pm-ti-linux-3.14.y' of git://git.ti.com/~kristo/ti-linux-kernel/pm-linux-feature-tree:
  bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler
  bus: omap_l3_noc: Add resume hook to restore context

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ti_config_fragments: systest: Enable Devfreq

Enable Devfreq to allow for system test coprocessor driver based testing
for various domains.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Carlos Hernandez <ceh@ti.com>
OMAPDSS: hdmi5: Fix OMAP5 and J6 HDMI audio quality

Enabling idle mode during audio playback causes the glitches on OMAP5
and J6. This patch turnes HDMI warppers idle mode to no-idle for the
duration of the playback.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
ASoC: davinci: Enable menuconfig entry for McASP

[ Upstream commit 37119dd791f3195ab35cb3b9cccec94bdc709c57 ]

In order to be able to use simple-card with McASP on TI SoC based boards we
need to be able to select the McASP via menuconfig.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
ASoC: codecs: Make OF supported CODECs visible in Kconfig

[ Upstream commit 1291e14175e6b83efe1464f32189acb21bc4be09 ]

Now that we have a generic card driver we can't rely on the card driver
selecting the CODECs for us so make the CODECs that can be enabled with
OF directly selectable in Kconfig. For the platforms not using OF it's
not clear that we don't still want to have some board specific selection
since the kernel needs to contain code to register the devices; ACPI could
provide this from firmware does not yet support any kind of generic card.

It may also be desirable to hide these if OF is not enabled to reduce
noise.

Signed-off-by: Mark Brown <broonie@linaro.org>