Re: [PATCH v1] arm64: dts: sdm845: enable tsens thermal zones

2018-08-29 Thread Amit Kucheria
On Wed, Aug 29, 2018 at 3:09 PM Daniel Lezcano wrote: > > On 18/07/2018 09:49, Amit Kucheria wrote: > > One thermal zone per cpu is defined > > The thermal zones are very close, especially when the CPUs belong to the > same 'cluster'. Very likely the temperature wi

Re: [PATCH v1] arm64: dts: sdm845: enable tsens thermal zones

2018-08-28 Thread Amit Kucheria
Andy, Do you have any feedback for this patch? Regards, Amit On Wed, Jul 18, 2018 at 1:19 PM, Amit Kucheria wrote: > One thermal zone per cpu is defined > > Signed-off-by: Amit Kucheria > --- > arch/arm64/boot/dts/qcom/sdm845.dtsi | 170 > +++

[PATCH v2 11/11] MAINTAINERS: Add entry for Qualcomm TSENS thermal drivers

2018-08-28 Thread Amit Kucheria
Create an entry for the TSENS drivers and mark them as maintained Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Acked-by: Rajendra Nayak --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a5b256b25905..b8c96e0699c9 100644

[PATCH v2 08/11] thermal: tsens: Check if the IP is correctly enabled by firmware

2018-08-28 Thread Amit Kucheria
The SROT registers are initialised by the secure firmware at boot. We don't have write access to the registers. Check if the block is enabled before continuing. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-common.c | 17 + 1

[PATCH v2 04/11] thermal: tsens: Add SPDX license identifiers

2018-08-28 Thread Amit Kucheria
The TSENS drivers use a GPL-2.0 license. Replace with equivalent SPDX tags and delete the full license text. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-8916.c | 11 +-- drivers/thermal/qcom/tsens-8960.c | 11 +-- drivers

[PATCH v2 09/11] thermal: tsens: Get rid of 'id' field

2018-08-28 Thread Amit Kucheria
ld instead of the id field consistently across the tsens code. While we're at it, document the fields of struct tsens_sensor. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens.c | 5 ++--- drivers/thermal/qcom/tsens.h | 10 +- 2 files changed

[PATCH v2 03/11] dt-bindings: thermal: Fix a typo in documentation

2018-08-28 Thread Amit Kucheria
c(1) + x(1) was actually meant to be c(1) * x(1). Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Acked-by: Rob Herring --- Documentation/devicetree/bindings/thermal/thermal.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings

[PATCH v2 10/11] arm64: dts: qcom: Add reg-names for all tsens nodes

2018-08-28 Thread Amit Kucheria
-0c2651fe : thermal-sensor@c265000 becomes 0c222000-0c2221fe : tsens0_srot 0c223000-0c2231fe : tsens1_srot 0c263000-0c2631fe : tsens0_tm 0c265000-0c2651fe : tsens1_tm Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- arch/arm/boot/dts/qcom-msm8974.dtsi | 1 + arch/arm64/boot/dts/qcom

[PATCH v2 07/11] thermal: tsens: Add the SROT address map

2018-08-28 Thread Amit Kucheria
On platforms whose device trees specify two address spaces for TSENS, the second one points to the SROT registers. Initialise the SROT map on those platforms. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-common.c | 14 -- drivers

[PATCH v2 06/11] thermal: tsens: Rename map field in order to add a second address map

2018-08-28 Thread Amit Kucheria
more appropriate "tm_map". The 8960 doesn't have a clear split between TM and SROT registers. To avoid complicating the data structure, it will switchover to using tm_map for its maps. There is no functional change with this patch. Signed-off-by: Amit Kucheria Reviewed-by: Matthias K

[PATCH v2 05/11] thermal: tsens: Get rid of dead code

2018-08-28 Thread Amit Kucheria
hw_id is dynamically allocated but not used anywhere. Get rid of dead code. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index

[PATCH v2 02/11] arm/arm64: dts: msm8974/msm8916: thermal: Add "qcom,sensors" property

2018-08-28 Thread Amit Kucheria
This new property allows the number of sensors to be configured from DT instead of being hardcoded in platform data. Use it. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- arch/arm/boot/dts/qcom-msm8974.dtsi | 1 + arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + 2 files changed

[PATCH v2 01/11] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two

2018-08-28 Thread Amit Kucheria
Since tsens-common.c/init_common() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- arch/arm/boot/dts/qcom-msm8974.

[PATCH v2 00/11] Another round of tsens cleanups

2018-08-28 Thread Amit Kucheria
added qcom,sensors property into two separate patches - Remove brackets in typo correction patch Amit Kucheria (11): arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two arm/arm64: dts: msm8974/msm8916: thermal: Add "qcom,sensors" property dt-bindings: thermal:

Re: [PATCH v1 07/10] thermal: tsens: Check if the IP is correctly enabled by firmware

2018-08-27 Thread Amit Kucheria
On Sat, Aug 25, 2018 at 5:00 AM Eduardo Valentin wrote: > > On Thu, Aug 09, 2018 at 06:02:39PM +0530, Amit Kucheria wrote: > > The SROT registers are initialised by the secure firmware at boot. We > > don't have write access to the registers. Check if the block is enable

Re: [PATCH v1 01/10] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two

2018-08-27 Thread Amit Kucheria
On Sat, Aug 25, 2018 at 4:58 AM Eduardo Valentin wrote: > > On Thu, Aug 09, 2018 at 06:02:33PM +0530, Amit Kucheria wrote: > > We've earlier added support to split the register address space into TM > > and SROT regions. > > > > Split up the regmap addre

Re: [PATCH] arm64: dts: Fix various entry-method properties to reflect documentation

2018-08-23 Thread Amit Kucheria
(Adding arm-soc folks) On Thu, Aug 23, 2018 at 9:01 PM, Sudeep Holla wrote: > Hi Amit, > > Thanks for fixing this. > > On Thu, Aug 23, 2018 at 02:23:29PM +0530, Amit Kucheria wrote: >> The idle-states binding documentation[1] mentions that the >> 'entry-method

[PATCH] arm64: dts: Fix various entry-method properties to reflect documentation

2018-08-23 Thread Amit Kucheria
f various boards to reflect current documentation. [1] Documentation/devicetree/bindings/arm/idle-states.txt (see idle-states node) Signed-off-by: Amit Kucheria --- Documentation/devicetree/bindings/arm/cpu-capacity.txt | 2 +- Documentation/devicetree/bindings/arm/idle-states.txt | 4 ++--

Re: [PATCH v1 01/10] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two

2018-08-09 Thread Amit Kucheria
On Fri, Aug 10, 2018 at 12:41 AM Matthias Kaehlcke wrote: > > On Thu, Aug 09, 2018 at 06:02:33PM +0530, Amit Kucheria wrote: > > We've earlier added support to split the register address space into TM > > and SROT regions. > > > > Split up the regmap addre

[PATCH v1 09/10] arm64: dts: qcom: Add reg-names for all tsens nodes

2018-08-09 Thread Amit Kucheria
-0c2651fe : thermal-sensor@c265000 becomes 0c222000-0c2221fe : tsens0_srot 0c223000-0c2231fe : tsens1_srot 0c263000-0c2631fe : tsens0_tm 0c265000-0c2651fe : tsens1_tm Signed-off-by: Amit Kucheria --- arch/arm/boot/dts/qcom-msm8974.dtsi | 1 + arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + arch/arm64

[PATCH v1 08/10] thermal: tsens: Get rid of 'id' field

2018-08-09 Thread Amit Kucheria
ld instead of the id field consistently across the tsens code. While, we're at it, document the fields of struct tsens_sensor. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens.c | 5 ++--- drivers/thermal/qcom/tsens.h | 10 +- 2 files changed, 11 insertions(+), 4 deletions

[PATCH v1 10/10] MAINTAINERS: Add entry for Qualcomm TSENS thermal drivers

2018-08-09 Thread Amit Kucheria
Create an entry for the TSENS drivers and mark them as maintained Signed-off-by: Amit Kucheria --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 68b4ff8ed205..ca6183d6d545 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11862,6 +11862,13

[PATCH v1 06/10] thermal: tsens: Add the SROT address map

2018-08-09 Thread Amit Kucheria
On platforms whose device trees specify two address spaces for TSENS, the second one points to the SROT registers. Initialise the SROT map on those platforms. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 14 -- drivers/thermal/qcom/tsens.h| 1 + 2

[PATCH v1 07/10] thermal: tsens: Check if the IP is correctly enabled by firmware

2018-08-09 Thread Amit Kucheria
The SROT registers are initialised by the secure firmware at boot. We don't have write access to the registers. Check if the block is enabled before continuing. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 17 + 1 file changed, 17 insertions(+)

[PATCH v1 05/10] thermal: tsens: Rename map field in order to add a second address map

2018-08-09 Thread Amit Kucheria
more appropriate "tm_map". The 8960 doesn't have a clear split between TM and SROT registers. To avoid complicating the data structure, it will switchover to using tm_map for its maps. There is no functional change with this patch. Signed-off-by: Amit Kucheria ---

[PATCH v1 01/10] arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two

2018-08-09 Thread Amit Kucheria
Since tsens-common.c/init_common() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria --- arch/arm/boot/dts/qcom-msm8974.dtsi | 6 -- arch/arm64/boo

[PATCH v1 04/10] thermal: tsens: Get rid of dead code

2018-08-09 Thread Amit Kucheria
hw_id is dynamically allocated but not used anywhere. Get rid of dead code. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 90bb431cf740..9a8e8f7b4ae1 100644

[PATCH v1 03/10] thermal: tsens: Add SPDX license identifiers

2018-08-09 Thread Amit Kucheria
The TSENS drivers use a GPL-2.0 license. Replace with equivalent SPDX tags and delete the full license text. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-8916.c | 11 +-- drivers/thermal/qcom/tsens-8960.c | 11 +-- drivers/thermal/qcom/tsens-8974.c | 11

[PATCH v1 02/10] dt-bindings: thermal: Fix a typo in documentation

2018-08-09 Thread Amit Kucheria
c(1) + x(1) was actually meant to be c(1) * x(1). While we're at it, add some brackets to make it nicer to read. Signed-off-by: Amit Kucheria --- Documentation/devicetree/bindings/thermal/thermal.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devic

[PATCH v1 00/10] Another round of tsens cleanups

2018-08-09 Thread Amit Kucheria
, Amit [1] https://lore.kernel.org/lkml/cover.1531895128.git.amit.kuche...@linaro.org/ [2] https://lore.kernel.org/lkml/cover.1532600791.git.amit.kuche...@linaro.org/ Amit Kucheria (10): arm/arm64: dts: msm8974/msm8916: thermal: Split address space into two dt-bindings: thermal: Fix a typo in

Re: [PATCH v2 0/3] thermal: tsens: bugfixes, cleanups

2018-07-26 Thread Amit Kucheria
On Fri, Jul 27, 2018 at 2:38 AM Eduardo Valentin wrote: > > Hey Amit, > > > On Thu, Jul 26, 2018 at 04:03:07PM +0530, Amit Kucheria wrote: > > Here is another series of tsens-related bugfixes and cleanups to prepare > > for IRQ support, among other things. It applies

[PATCH v2 2/3] thermal: tsens: switch from of_iomap() to devm_ioremap_resource()

2018-07-26 Thread Amit Kucheria
devm_ioremap_resources() automatically requests resources (so that the I/O region shows up in /proc/iomem) and devm_ wrappers do better error handling and unmapping of the I/O region when needed. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens

[PATCH v2 1/3] thermal: tsens: Rename variable

2018-07-26 Thread Amit Kucheria
We're actually reading the temperature from the status register. Fix the variable name to reflect that. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-common.c | 6 +++--- drivers/thermal/qcom/tsens-v2.c | 10 +- 2 files chang

[PATCH v2 3/3] thermal: tsens: Fix negative temperature reporting

2018-07-26 Thread Amit Kucheria
The current code will always return 0x in case of negative temperatures due to a bug in how the binary sign extension is being done. Use sign_extend32() instead. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-v2.c | 13 + 1 file

[PATCH v2 0/3] thermal: tsens: bugfixes, cleanups

2018-07-26 Thread Amit Kucheria
Changes since v1: - Fixup a couple of typos - Add review tag Amit Kucheria (3): thermal: tsens: Rename variable thermal: tsens: switch from of_iomap() to devm_ioremap_resource() thermal: tsens: Fix negative temperature reporting drivers/thermal/qcom/tsens-common.c | 19

Re: [PATCH v1 3/3] thermal: tsens: Fix negative temperature reporting

2018-07-26 Thread Amit Kucheria
On Thu, Jul 26, 2018 at 5:19 AM, Matthias Kaehlcke wrote: > On Wed, Jul 18, 2018 at 12:55:03PM +0530, Amit Kucheria wrote: >> The current code will always return 0x in case of negative >> temperatures due to a bug in how the binary sign extension is being done. >>

Re: [PATCH v1] arm64: dts: sdm845: enable tsens thermal zones

2018-07-26 Thread Amit Kucheria
On Thu, Jul 26, 2018 at 6:17 AM, Matthias Kaehlcke wrote: > Hi Amit, > > On Wed, Jul 18, 2018 at 01:19:17PM +0530, Amit Kucheria wrote: >> One thermal zone per cpu is defined >> >> Signed-off-by: Amit Kucheria >> --- >> arc

Re: [PATCH v8 0/7] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-21 Thread Amit Kucheria
Andy, Eduardo: Please consider this a gentle ping to understand how this will get merged. Andy, I guess you'll take the DT patches 2,4 and 7 and the rest will go through Eduardo's thermal tree? Regards, Amit On Wed, Jul 18, 2018 at 12:13 PM, Amit Kucheria wrote: > Here is a

Re: [PATCH 14/15] arm: dts: qcom: Add missing OPP properties for CPUs

2018-07-18 Thread Amit Kucheria
property (clock latency) as well to make it all > work. > > Signed-off-by: Viresh Kumar FWIW, Reviewed-by: Amit Kucheria > --- > arch/arm/boot/dts/qcom-ipq4019.dtsi | 24 > 1 file changed, 24 insertions(+) > > diff --git a/arch/arm/boot/dts

Re: [PATCH] cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER

2018-07-18 Thread Amit Kucheria
On Wed, Jul 18, 2018 at 2:18 AM, Niklas Cassel wrote: > If of_nvmem_cell_get() fails due to probe deferal, we shouldn't print an > error message. Just be silent in this case. > > Signed-off-by: Niklas Cassel Reviewed-by: Amit Kucheria > --- > drivers/cpufreq/

[PATCH v1] arm64: dts: sdm845: enable tsens thermal zones

2018-07-18 Thread Amit Kucheria
One thermal zone per cpu is defined Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 170 +++ 1 file changed, 170 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi index 01ff146

[PATCH v1 3/3] thermal: tsens: Fix negative temperature reporting

2018-07-18 Thread Amit Kucheria
The current code will always return 0x in case of negative temperatures due to a bug in how the binary sign extension is being done. Use sign_extend32() instead. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-v2.c | 13 + 1 file changed, 5 insertions(+), 8

[PATCH v1 2/3] thermal: tsens: switch from of_iomap() to devm_ioremap_resource()

2018-07-18 Thread Amit Kucheria
devm_ioremap_resources() automatically requests resources (so that the I/O region shows up in /proc/iomem) and devm_ wrappers do better error handling and unmapping of the I/O region when needed. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 13 +++-- 1 file

[PATCH v1 0/3] thermal: tsens: bugfixes, cleanups

2018-07-18 Thread Amit Kucheria
Amit Kucheria (3): thermal: tsens: Rename variable thermal: tsens: switch from of_iomap() to devm_ioremap_resource() thermal: tsens: Fix negative temperature reporting drivers/thermal/qcom/tsens-common.c | 19 ++- drivers/thermal/qcom/tsens-v2.c | 23

[PATCH v1 1/3] thermal: tsens: Rename variable

2018-07-18 Thread Amit Kucheria
We're actually reading the temperature from the status register. Fix the variable name to reflect that. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 6 +++--- drivers/thermal/qcom/tsens-v2.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-)

[PATCH v8 5/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-17 Thread Amit Kucheria
The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by

[PATCH v8 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-17 Thread Amit Kucheria
SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. It uses version 2 of the TSENS IP, so use the fallback property to allow more common code. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke

[PATCH v8 6/7] thermal: tsens: Add generic support for TSENS v2 IP

2018-07-17 Thread Amit Kucheria
SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed

[PATCH v8 4/7] arm64: dts: msm8996: thermal: Initialise via DT and add second controller

2018-07-17 Thread Amit Kucheria
() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Review

[PATCH v8 2/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-17 Thread Amit Kucheria
M and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- .../devicetree/bindings/th

[PATCH v8 3/7] thermal: tsens: Add support to split up register address space into two

2018-07-17 Thread Amit Kucheria
DTs and adjust associated offsets for the TM register bank so that the old DTs will continue to function correctly. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- drivers/thermal/qcom

[PATCH v8 0/7] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-17 Thread Amit Kucheria
river on sdm845, now that 4.18-rc1 will contain an sdm845.dtsi Changes since v1: - Move get_temp() from tsens-8996 to tsens-common and rename - Change 8996 DT entry to allow init_common() to work across sdm845 and 8996 due to different offsets Amit Kucheria (7): thermal: tsens: Get rid of u

Re: [PATCH v7 5/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-17 Thread Amit Kucheria
On Wed, Jul 18, 2018 at 5:39 AM, Matthias Kaehlcke wrote: > On Thu, Jul 12, 2018 at 02:09:06PM +0530, Amit Kucheria wrote: >> We want to create common code for v2 of the TSENS IP block that is used in >> a large number of Qualcomm SoCs. "qcom,tsens-v2" should be able

[PATCH v8 1/7] thermal: tsens: Get rid of unused fields in structure

2018-07-17 Thread Amit Kucheria
status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak Tested-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/thermal

Re: [PATCH v7 2/7] thermal: tsens: Add support to split up register address space into two

2018-07-17 Thread Amit Kucheria
On Wed, Jul 18, 2018 at 4:59 AM Matthias Kaehlcke wrote: > > On Thu, Jul 12, 2018 at 02:09:03PM +0530, Amit Kucheria wrote: > > There are two banks of registers for v2 TSENS IPs: SROT and TM. On older > > SoCs these were contiguous, leading to DTs mapping them as one register &g

[PATCH v7 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-12 Thread Amit Kucheria
SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. It uses version 2 of the TSENS IP, so use the fallback property to allow more common code. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke --- arch/arm64/boot/dts/qcom/sdm845

[PATCH v7 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-12 Thread Amit Kucheria
The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by

[PATCH v7 5/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-12 Thread Amit Kucheria
M and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke --- .../devicetree/bindings/thermal/qcom-tsens.txt | 31 +- 1 file c

[PATCH v7 0/7] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-12 Thread Amit Kucheria
a DT patch to initialize tsens driver on sdm845, now that 4.18-rc1 will contain an sdm845.dtsi Changes since v1: - Move get_temp() from tsens-8996 to tsens-common and rename - Change 8996 DT entry to allow init_common() to work across sdm845 and 8996 due to different offsets Amit Kucheria (7):

[PATCH v7 6/7] thermal: tsens: Add generic support for TSENS v2 IP

2018-07-12 Thread Amit Kucheria
SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke

[PATCH v7 3/7] arm64: dts: msm8996: thermal: Initialise via DT and add second controller

2018-07-12 Thread Amit Kucheria
() currently only registers one address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke --- arch/arm64/boot/dts/qcom/msm8996.dtsi

[PATCH v7 2/7] thermal: tsens: Add support to split up register address space into two

2018-07-12 Thread Amit Kucheria
DTs and adjust associated offsets for the TM register bank so that the old DTs will continue to function correctly. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-8996.c | 4 ++-- drivers/thermal/qcom/tsens-common.c | 12

[PATCH v7 1/7] thermal: tsens: Get rid of unused fields in structure

2018-07-12 Thread Amit Kucheria
status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak Tested-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/thermal

Re: [PATCH v6 6/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-11 Thread Amit Kucheria
On Thu, Jul 12, 2018 at 12:12 AM Doug Anderson wrote: > > Hi, > > On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria > wrote: > > We want to create common code for v2 of the TSENS IP block that is used in > > a large number of Qualcomm SoCs. "qcom,tsens-v2" sho

Re: [PATCH v6 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-11 Thread Amit Kucheria
On Thu, Jul 12, 2018 at 3:30 AM Doug Anderson wrote: > > Hi Matthias, > > On Wed, Jul 11, 2018 at 2:51 PM, Matthias Kaehlcke wrote: > > On Wed, Jul 11, 2018 at 11:44:13AM -0700, Doug Anderson wrote: > >> Hi, > >> > >> On Mon, Jul 9, 2018 at 4:43 AM,

Re: [PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP

2018-07-11 Thread Amit Kucheria
On Thu, Jul 12, 2018 at 12:10 AM Doug Anderson wrote: > > Hi, > > On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria > wrote: > > SDM845 uses v2 of the TSENS IP block but the get_temp() function > > appears to be identical across v2.x.y in code seen so far. We use the >

Re: [PATCH v6 3/7] dt: qcom: 8996: thermal: Move to DT initialisation

2018-07-11 Thread Amit Kucheria
On Thu, Jul 12, 2018 at 12:09 AM Doug Anderson wrote: > > Hi, > > On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria > wrote: > > We also split up the regmap address space into two, one for the TM > > registers, the other for the SROT registers. This was required to deal

Re: [PATCH v6 2/7] thermal: tsens: Add support to split up register address space into two

2018-07-11 Thread Amit Kucheria
On Thu, Jul 12, 2018 at 12:07 AM, Doug Anderson wrote: > Hi, > > On Mon, Jul 9, 2018 at 4:43 AM, Amit Kucheria > wrote: >> There are two banks of registers for v2 TSENS IPs: SROT and TM. On older >> SoCs these were contiguous, leading to DTs mapping them as one register

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
On Mon, Jul 9, 2018 at 9:31 PM, Matthias Kaehlcke wrote: > On Mon, Jul 09, 2018 at 04:56:51PM +0530, Amit Kucheria wrote: >> On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke wrote: >> > Hi, >> > >> > On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucher

[PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP

2018-07-09 Thread Amit Kucheria
SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-v2.c | 6 +- drivers/thermal/qcom

[PATCH v6 3/7] dt: qcom: 8996: thermal: Move to DT initialisation

2018-07-09 Thread Amit Kucheria
address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boo

[PATCH v6 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. It uses version 2 of the TSENS IP, so use the fallback property to allow more common code. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 1 file changed, 16 insertions

[PATCH v6 6/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-09 Thread Amit Kucheria
M and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria --- .../devicetree/bindings/thermal/qcom-tsens.txt | 25 +- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/th

[PATCH v6 1/7] thermal: tsens: Get rid of unused fields in structure

2018-07-09 Thread Amit Kucheria
status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal

[PATCH v6 2/7] thermal: tsens: Add support to split up register address space into two

2018-07-09 Thread Amit Kucheria
have cleaner common code e.g. get_temp() that is shared across new and old platforms. But we need to add logic to init_common() to differentiate between old and new DTs and adjust associated offsets for the TM register bank so that the old DTs will continue to function correctly. Signed-off-by: Amit

[PATCH v6 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-09 Thread Amit Kucheria
The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/Makefile

[PATCH v6 0/7] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-09 Thread Amit Kucheria
to tsens-common and rename - Change 8996 DT entry to allow init_common() to work across sdm845 and 8996 due to different offsets Amit Kucheria (7): thermal: tsens: Get rid of unused fields in structure thermal: tsens: Add support to split up register address space into two dt: qcom: 89

Re: [PATCH v5 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
On Mon, Jul 9, 2018 at 4:57 PM, Amit Kucheria wrote: > SDM845 has two tsens blocks, one with 13 sensors and the other with 8 > sensors. It uses version 2 of the TSENS IP, so use the fallback property to > allow more common code. > > Signed-off-by: Amit Kucheria > --- > arc

Re: [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-09 Thread Amit Kucheria
On Mon, Jul 2, 2018 at 11:23 PM, Eduardo Valentin wrote: > On Mon, Jul 02, 2018 at 06:14:03PM +0530, Amit Kucheria wrote: >> This series is a mixed bag: >> - Some code moves to allow code sharing between various v2.x.y versions of >> the TSENS IP, >> - new qcom,t

[PATCH v5 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-09 Thread Amit Kucheria
The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/Makefile

[PATCH v5 6/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP

2018-07-09 Thread Amit Kucheria
M and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria --- .../devicetree/bindings/thermal/qcom-tsens.txt | 25 +- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/th

[PATCH v5 3/7] dt: qcom: 8996: thermal: Move to DT initialisation

2018-07-09 Thread Amit Kucheria
address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boo

[PATCH v5 7/7] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. It uses version 2 of the TSENS IP, so use the fallback property to allow more common code. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 1 file changed, 16 insertions

[PATCH v5 5/7] thermal: tsens: Add generic support for TSENS v2 IP

2018-07-09 Thread Amit Kucheria
SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-v2.c | 6 +- drivers/thermal/qcom

[PATCH v5 2/7] thermal: tsens: Add support to split up register address space into two

2018-07-09 Thread Amit Kucheria
have cleaner common code e.g. get_temp() that is shared across new and old platforms. But we need to add logic to init_common() to differentiate between old and new DTs and adjust associated offsets for the TM register bank so that the old DTs will continue to function correctly. Signed-off-by: Amit

[PATCH v5 1/7] thermal: tsens: Get rid of unused fields in structure

2018-07-09 Thread Amit Kucheria
status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal

[PATCH v5 0/7] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-09 Thread Amit Kucheria
and 8996 due to different offsets Amit Kucheria (7): thermal: tsens: Get rid of unused fields in structure thermal: tsens: Add support to split up register address space into two dt: qcom: 8996: thermal: Move to DT initialisation thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse ther

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
On Fri, Jul 6, 2018 at 11:01 PM, Stephen Boyd wrote: > Quoting Amit Kucheria (2018-07-02 05:44:09) >> SDM845 has two tsens blocks, one with 13 sensors and the other with 8 >> sensors. >> >> Signed-off-by: Amit Kucheria >> --- >> arch/arm64/boot/dts/qcom/

Re: [PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

2018-07-09 Thread Amit Kucheria
On Wed, Jul 4, 2018 at 3:18 AM, Matthias Kaehlcke wrote: > Hi, > > On Mon, Jul 02, 2018 at 06:14:09PM +0530, Amit Kucheria wrote: >> SDM845 has two tsens blocks, one with 13 sensors and the other with 8 >> sensors. >> >> Signed-off-by: Amit Kucheria >>

Re: [PATCH v2 1/1] dts: qcom: db820c: Add gpio-line-names property

2018-07-08 Thread Amit Kucheria
re derived from 96Boards CE Specification 1.0, Appendix > "Expansion Connector Signal Description". Line names for PMI8994 MPP > pins are not added due to the absence of the gpio-controller support. > > Signed-off-by: Manivannan Sadhasivam FWIW, Reviewed-by: Amit Kucheria >

Re: [PATCH v4 4/6] thermal: tsens: Add support for SDM845

2018-07-05 Thread Amit Kucheria
On Fri, Jul 6, 2018 at 2:07 AM Rob Herring wrote: > > On Wed, Jul 04, 2018 at 10:56:26PM +0530, Amit Kucheria wrote: > > On Tue, Jul 3, 2018 at 9:56 PM, Rob Herring wrote: > > > On Mon, Jul 02, 2018 at 06:14:07PM +0530, Amit Kucheria wrote: > > >> SDM845 uses v2.

Re: [PATCH v4 4/6] thermal: tsens: Add support for SDM845

2018-07-04 Thread Amit Kucheria
On Tue, Jul 3, 2018 at 9:56 PM, Rob Herring wrote: > On Mon, Jul 02, 2018 at 06:14:07PM +0530, Amit Kucheria wrote: >> SDM845 uses v2.4.0 of the TSENS IP block but the get_temp() function >> appears to be identical across v2.x.y in code seen so far. We use the >> generi

Re: [PATCH v4 3/6] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-04 Thread Amit Kucheria
On Tue, Jul 3, 2018 at 12:23 AM Bjorn Andersson wrote: > > On Mon 02 Jul 05:44 PDT 2018, Amit Kucheria wrote: > > > The TSENS block inside the 8996 is internally classified as version 2 of > > the IP. Several other SoC families use this block and can share this code. >

Re: [PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-02 Thread Amit Kucheria
On Mon, Jul 2, 2018 at 6:14 PM, Amit Kucheria wrote: > This series is a mixed bag: > - Some code moves to allow code sharing between various v2.x.y versions of > the TSENS IP, > - new qcom,tsens-v2.4.0 DT property for SDM845 and a generic qcom,tsens-v2 > property as a fallback

[PATCH v4 0/6] thermal: tsens: Refactoring for TSENSv2 IP

2018-07-02 Thread Amit Kucheria
compatible. I hope patch 4 does what you were looking for. Regards, Amit Amit Kucheria (6): thermal: tsens: Get rid of unused fields in structure dt: qcom: 8996: thermal: Move to DT initialisation thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse thermal: tsens: Add support for SDM845

[PATCH v4 3/6] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse

2018-07-02 Thread Amit Kucheria
The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/Makefile

[PATCH v4 6/6] arm64: dts: sdm845: Add tsens nodes

2018-07-02 Thread Amit Kucheria
SDM845 has two tsens blocks, one with 13 sensors and the other with 8 sensors. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi

[PATCH v4 4/6] thermal: tsens: Add support for SDM845

2018-07-02 Thread Amit Kucheria
SDM845 uses v2.4.0 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function. Signed-off-by: Amit Kucheria --- Documentation/devicetree/bindings/thermal/qcom-tsens.txt | 2 ++ drivers/thermal/qcom/tsens-v2

[PATCH v4 5/6] thermal: tsens: Check if we have valid data before reading

2018-07-02 Thread Amit Kucheria
Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-v2.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index 1871945..0473f33 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b

[PATCH v4 2/6] dt: qcom: 8996: thermal: Move to DT initialisation

2018-07-02 Thread Amit Kucheria
address space, the order is important (TM before SROT). This is OK since the code doesn't really use the SROT functionality yet. Signed-off-by: Amit Kucheria --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boo

<    3   4   5   6   7   8   9   10   >