Georgi Djakov [Fri, 11 Sep 2015 13:26:31 +0000 (16:26 +0300)]
power: avs: cpr: Fix Duplicate OPPs warning
Change the sequence to get the regulators first
and then add OPPs as regulators can defer probe
in the middle and leave us with only partially
added OPPs.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Stephen Boyd [Tue, 2 Jun 2015 01:47:59 +0000 (18:47 -0700)]
power: avs: Add support for CPR (Core Power Reduction)
RBCPR (RapidBridge Core Power Reduction) is a technology to reduce
core power on a CPU or other device. It reads voltage settings in
efuse from product test process as initial settings and populates OPPs
for the device being "monitored". Each OPP corresponds to a "corner"
that has a range of valid voltages for a particular frequency. While
the device is running at a particular frequency, CPR monitors dynamic
factors such as temperature, etc. and adjusts the voltage for that
frequency accordingly to save power and meet silicon characteristic
requirements.
This driver is based on work by others on codeaurora.org[1].
Stephen Boyd [Tue, 2 Jun 2015 01:47:58 +0000 (18:47 -0700)]
cpufreq-dt: Handle OPP voltage adjust events
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention.
In the former case, an AVS driver will call
dev_pm_opp_modify_voltage() and update the voltage for the
particular OPP the CPUs are using. Add an OPP notifier to
cpufreq-dt so that we can adjust the voltage of the CPU when AVS
updates the OPP.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Stephen Boyd [Tue, 2 Jun 2015 01:47:57 +0000 (18:47 -0700)]
OPP: Allow notifiers to call dev_pm_opp_get_{voltage, freq} RCU-free
We pass the dev_pm_opp structure to OPP notifiers but the users
of the notifier need to surround calls to dev_pm_opp_get_*() with
RCU read locks to avoid lockdep warnings. The notifier is already
called with the dev_opp's srcu lock held, so it should be safe to
assume the devm_pm_opp structure is already protected inside the
notifier. Update the lockdep check for this.
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Stephen Boyd [Tue, 2 Jun 2015 01:47:56 +0000 (18:47 -0700)]
PM / OPP: Support adjusting OPP voltages at runtime
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.
Bjorn Andersson [Wed, 10 Dec 2014 19:27:51 +0000 (11:27 -0800)]
soc: qcom: Stub IPCRTR client driver
The IPCRTR channel needs to come up for the pronto block to be happy and
continue communication, so this driver does just that (and dumps
incoming data in the log).
Bjorn Andersson [Tue, 20 Oct 2015 02:46:15 +0000 (10:46 +0800)]
soc: qcom: smd: Support opening additional channels
With the qcom_smd_open_channel() API we allow SMD devices to open
additional SMD channels, to allow implementation of multi-channel SMD
devices - like Bluetooth.
Channels are opened from the same edge as the calling SMD device is tied
to.
Bjorn Andersson [Tue, 20 Oct 2015 02:43:44 +0000 (10:43 +0800)]
soc: qcom: smd: Split discovery and state change work
Split the two steps of channel discovery and state change handling into
two different workers. This allows for new channels to be found while
we're are probing, which is required as we introduce multi-channel
support.
If built as module would throw up with
drivers/regulator/qcom_smd-regulator.c:67:5: error: redefinition of 'qcom_rpm_set_floor'
drivers/regulator/qcom_smd-regulator.c:89:5: error: redefinition of 'qcom_rpm_set_corner'
Courtney Cavin [Mon, 5 Jan 2015 18:07:57 +0000 (10:07 -0800)]
remoteproc: Support loading firmware from lately mounted fs (HACK)
If the firmware isn't available during boot then table_ptr will be NULL
and subsequent attempts to load the firmware will fail. Move things
around and reattempt the load upon trying to boot the rproc.
Bjorn Andersson [Wed, 10 Dec 2014 19:42:18 +0000 (11:42 -0800)]
remoteproc: qcom-tz: Finish shutdown on timeout
When the remote processor have hit an fatal error, it will not perform
the stop-ack handshake. So we have to finish the shutdown process to not
leave the remote processor in a dangling state (stopping us from
bringing it up again).
Bjorn Andersson [Wed, 10 Dec 2014 19:41:12 +0000 (11:41 -0800)]
remoteproc: qcom-tz: Inform SMD about crashing remotes
When a remote processor crashes there is no indication in SMD, so we
need to inform the SMD driver that it should reset all open channels
associated with the remote processor.
Bjorn Andersson [Thu, 27 Feb 2014 23:52:47 +0000 (15:52 -0800)]
remoteproc: qcom-pil: Implementation of Qualcomm TZ backed PIL
This implements the TrustZone based Peripheral Image Loader used in
Qualcomm platforms for loading and boot audio, video and wifi/bt remote
processors.
Bjorn Andersson [Tue, 11 Nov 2014 01:25:53 +0000 (17:25 -0800)]
remoteproc: core: Make the loaded resource table optional
Remote processors like the ones found in the Qualcomm SoCs does not have
a resource table passed to them, so make it optional and only populate
it if it exists.
Andy Gross [Tue, 15 Dec 2015 05:30:45 +0000 (23:30 -0600)]
regulator: qcom-smd: Add support for PMA8084
This patch adds support and documentation for the PMA8084 regulators
found on APQ8084 platforms.
Signed-off-by: Andy Gross <agross@codeaurora.org> Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Andy Gross [Tue, 15 Dec 2015 05:30:44 +0000 (23:30 -0600)]
regulator: qcom-smd: Add PM8916 support
This patch adds support and documentation for the PM8916 regulators
found on MSM8916 platforms.
Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Andy Gross <agross@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
ARM: 8485/1: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook
The suspend() hook in the cpuidle_ops struct is always called on
the cpu entering idle, which means that the cpu parameter passed
to the suspend hook always corresponds to the local cpu, making
it somewhat redundant.
This patch removes the logical cpu parameter from the ARM
cpuidle_ops.suspend hook and updates all the existing kernel
implementations to reflect this change.
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Lina Iyer <lina.iyer@linaro.org> Tested-by: Lina Iyer <lina.iyer@linaro.org> Tested-by: Jisheng Zhang <jszhang@marvell.com> [psci] Cc: Lina Iyer <lina.iyer@linaro.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Arnd Bergmann [Tue, 24 Nov 2015 22:13:09 +0000 (23:13 +0100)]
ARM: qcom: select ARM_CPU_SUSPEND for power management
The qcom spm driver uses cpu_resume_arm(), which is not included
in the kernel in all configurations:
drivers/built-in.o: In function `qcom_cpu_spc':
:(.text+0xbc022): undefined reference to `cpu_suspend'
drivers/built-in.o: In function `qcom_cpuidle_init':
:(.init.text+0x610c): undefined reference to `cpu_resume_arm'
This adds a 'select' Kconfig statement to ensure it's always
enabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Andy Gross <agross@codeaurora.org>
Arnd Bergmann [Fri, 20 Nov 2015 10:32:21 +0000 (11:32 +0100)]
soc: qcom: enable smsm/smp2p modular build
The newly added smp2p and smsm drivers cannot be loadable modules
but depend on smem, which can be, and that causes a link error:
drivers/built-in.o: In function `qcom_smp2p_intr':
:(.text+0xa6e68): undefined reference to `qcom_smem_get'
drivers/built-in.o: In function `qcom_smp2p_probe':
:(.text+0xa7320): undefined reference to `qcom_smem_alloc'
:(.text+0xa736c): undefined reference to `qcom_smem_get'
drivers/built-in.o: In function `qcom_smsm_probe':
:(.text+0xa7b34): undefined reference to `qcom_smem_get'
This marks all the drivers as 'tristate' to make the Kconfig
dependency resolution work properly.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: dbb04bd7122f ("soc: qcom: smp2p: Qualcomm Shared Memory Point to Point") Fixes: d7387fc6add4 ("soc: qcom: smsm: Add driver for Qualcomm SMSM") Signed-off-by: Andy Gross <agross@codeaurora.org>
Ivan T. Ivanov [Mon, 8 Jun 2015 07:22:08 +0000 (10:22 +0300)]
mmc: sdhci: let GPIO based card detection have higher precedence
Controller could have BROKEN_CARD_DETECTION quirk set, but drivers
could use GPIO to detect card present state. Let, when defined, GPIO
take precedence, so drivers could properly detect card state and not
use polling.
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Archit Taneja [Thu, 10 Dec 2015 05:19:31 +0000 (10:49 +0530)]
drm/msm/dsi: Update the "vdd" voltage range
The min and max voltage levels for the VDD input to DSI were initially set
to 2.85V (as suggested by the spec).
We have a platform (db410c) where the same regulator supply is also needed
by another consumer at a higher voltage. Bump up the max voltage level to
3.3V. No regressions are seen with this.
The drm msm driver isn't pm_runtime adapted yet. Since gdsc is now associated
with pm_runtime, we need to make sure we don't do a pm_runtime_put() when we
are using the hardware.
HACK: drm/msm/mdp5: Make sure mdp5 clocks aren't disbaled when we need them
mdp5_hw_init configures registers but may not have clocks enabled. Add
calls to enable/disable clocks in this func.
Comment out a mdp5_disable() call in mdp5_kms_init. For now, this makes
sure we have clocks all the time. This will be removed when runtime
pm is added, and we identify all paths where we risk clocks being
disabled when they shouldn't.
Currently, msm dsi_host's attach/detach ops call drm_helper_hpd_irq_event
unconditionally. Calling it makes sense if we have a drm_panel
connected (in this case, we created the connector), but not when we have
a bridge chip connected. For bridges, the driver (or someone else in the
encoder chain) should call the hpd handler.
Call it in the attach/detach ops only if we're connected to a panel.
drm/msm/dsi: Remove incorrect warning on host attach
With the implementation of of_graph parsing, it isn't any longer
necessary for msm_host->device node to be same as dsi->dev.of_node. This
only holds true when the connected device is also a child of the dsi_host.
In the case of external bridge chips belonging to a different control
bus, these are guaranteed to be different.
Hai Li [Thu, 3 Sep 2015 18:30:49 +0000 (14:30 -0400)]
drm/msm/dsi: Parse lane swap information from DT
Lane swap configuration is based on the board design.
This change allows the DSI host to get this information
from device tree, instead of hardcoding in driver.
This patch moves some of the dev_err messages to dev_dgb as these are
very normal messages, nothing unusual. Without this patch the messages
on console are very distracting when we run programs like i2cdetect.
Sricharan R [Mon, 18 May 2015 14:40:55 +0000 (20:10 +0530)]
i2c: qup: Add bam dma capabilities
QUP cores can be attached to a BAM module, which acts as a dma engine for the
QUP core. When DMA with BAM is enabled, the BAM consumer pipe transmitted data
is written to the output FIFO and the BAM producer pipe received data is read
from the input FIFO.
With BAM capabilities, qup-i2c core can transfer more than 256 bytes, without a
'stop' which is not possible otherwise.
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Sricharan R [Mon, 18 May 2015 11:40:05 +0000 (17:10 +0530)]
i2c: qup: Transfer each i2c_msg in i2c_msgs without a stop bit
The definition of i2c_msg says that
"If this is the last message in a group, it is followed by a STOP.
Otherwise it is followed by the next @i2c_msg transaction segment,
beginning with a (repeated) START"
So the expectation is that there is no 'STOP' bit inbetween individual
i2c_msg segments with repeated 'START'. The QUP i2c hardware has no way
to inform that there should not be a 'STOP' at the end of transaction.
The only way to implement this is to coalesce all the i2c_msg in i2c_msgs
in to one transaction and transfer them. Adding the support for the same.
This is required for some clients like touchscreen which keeps
incrementing counts across individual transfers and 'STOP' bit inbetween
resets the counter, which is not required.
This patch adds the support in non-dma mode.
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Sricharan R [Mon, 18 May 2015 10:31:36 +0000 (16:01 +0530)]
i2c: qup: Add V2 tags support
QUP from version 2.1.1 onwards, supports a new format of
i2c command tags. Tag codes instructs the controller to
perform a operation like read/write. This new tagging version
supports bam dma and transfers of more than 256 bytes without 'stop'
in between. Adding the support for the same.
For each block a data_write/read tag and data_len tag is added to
the output fifo. For the final block of data write_stop/read_stop
tag is used.
Signed-off-by: Andy Gross <agross@codeaurora.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Sricharan R [Mon, 18 May 2015 09:23:08 +0000 (14:53 +0530)]
qup: i2c: factor out common code for reuse
The qup_i2c_write/read_one functions can be split to have
the common initialization code and function to loop around
the data bytes separately. This way the initialization code
can be reused while adding v2 tags functionality.
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Sricharan R [Thu, 12 Mar 2015 09:15:19 +0000 (14:45 +0530)]
i2c: qup: Change qup_wait_writeready function to use for all timeouts
qup_wait_writeready waits only on a output fifo empty event.
Change the same function to accept the event and data length
to wait as parameters. This way the same function can be used for
timeouts in otherplaces as well.
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Ivan T. Ivanov [Fri, 15 May 2015 08:07:00 +0000 (11:07 +0300)]
amba: Defer device peripheral ID read
To be able to read peripheral ID during device create time
bus code have turn on device interface clock, but this
clock could be unavailable at this time. Fix this by defer
device ID read until driver match time.
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org> Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Rajendra Nayak [Fri, 9 Oct 2015 09:41:06 +0000 (15:11 +0530)]
thermal: qcom: tsens-8960: Add support for 8960 family of SoCs
8960 family of SoCs have the TSENS device as part of GCC, hence
the driver probes the virtual child device created by GCC and
uses the parent to extract all DT properties and reuses the GCC
regmap.
Also GCC/TSENS are part of a domain thats not always ON.
Hence add .suspend and .resume hooks to save and restore some of
the inited register context.
Also 8960 family have some of the TSENS init sequence thats
required to be done by the HLOS driver (some later versions of TSENS
do not export these registers to non-secure world, and hence need
these initializations to be done by secure bootloaders)
8660 from the same family has just one sensor and hence some register
offset/layout differences which need special handling in the driver.
Based on the original code from Siddartha Mohanadoss, Stephen Boyd and
Narendran Rajan.
Rajendra Nayak [Fri, 9 Oct 2015 09:41:04 +0000 (15:11 +0530)]
thermal: qcom: tsens-8916: Add support for 8916 family of SoCs
Add support to calibrate sensors on 8916 family and also add common
functions to read temperature from sensors (This can be reused on
other SoCs having similar TSENS device)
The calibration data is read from eeprom using the generic nvmem
framework apis.
Based on the original code by Siddartha Mohanadoss and Stephen Boyd.
Rajendra Nayak [Fri, 9 Oct 2015 09:41:03 +0000 (15:11 +0530)]
thermal: qcom: tsens: Add a skeletal TSENS drivers
TSENS is Qualcomms' thermal temperature sensor device. It
supports reading temperatures from multiple thermal sensors
present on various QCOM SoCs.
Calibration data is generally read from a non-volatile memory
(eeprom) device.
Add a skeleton driver with all the necessary abstractions so
a variety of qcom device families which support TSENS can
add driver extensions.
Also add the required device tree bindings which can be used
to describe the TSENS device in DT.
Georgi Djakov [Tue, 11 Aug 2015 13:35:59 +0000 (16:35 +0300)]
soc: qcom: Add support for SAW2 regulators
The SAW2 (Subsystem Power Manager and Adaptive Voltage Scalling Wrapper)
is part of the SPM subsystem. It is a hardware block in the Qualcomm
chipsets that regulates the power to the cores.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>