All of lore.kernel.org
 help / color / mirror / Atom feed
From: Georgi Djakov <gdjakov@mm-sol.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Grant Likely <grant.likely@linaro.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	David Collins <collinsd@codeaurora.org>
Subject: Re: [PATCH RESEND] thermal: Add QPNP PMIC temperature alarm driver
Date: Mon, 15 Sep 2014 19:02:46 +0300	[thread overview]
Message-ID: <54170DA6.6050001@mm-sol.com> (raw)
In-Reply-To: <1410793383-30097-1-git-send-email-iivanov@mm-sol.com>

Hi,

On 09/15/2014 06:03 PM, Ivan T. Ivanov wrote:
> Add support for the temperature alarm peripheral found inside
> Qualcomm plug-and-play (QPNP) PMIC chips.  The temperature alarm
> peripheral outputs a pulse on an interrupt line whenever the
> thermal over temperature stage value changes.  Implement an ISR
> to manage this interrupt.
> 
> Register a thermal zone device in sysfs with mulitple trip points

s/mulitple/multiple/

> corresponding to the physical threshold temperatures between over
> temperature stages.  The temperature reported by this thermal
> zone device should reflect the actual PMIC die temperature if an
> ADC is present on the given PMIC.  If no ADC is present, then the
> reported temperature should be estimated from the over
> temperature stage value.
> 
> Send a notification to userspace via sysfs_notify() whenever the
> over temperature stage value changes.
> 
> Cc: David Collins <collinsd@codeaurora.org>
> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> ---
>  .../bindings/thermal/qpnp-temp-alarm.txt           |  27 ++
>  drivers/thermal/Kconfig                            |  12 +
>  drivers/thermal/Makefile                           |   1 +
>  drivers/thermal/qpnp-temp-alarm.c                  | 519 +++++++++++++++++++++
>  4 files changed, 559 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/qpnp-temp-alarm.txt
>  create mode 100644 drivers/thermal/qpnp-temp-alarm.c
> 
> diff --git a/Documentation/devicetree/bindings/thermal/qpnp-temp-alarm.txt b/Documentation/devicetree/bindings/thermal/qpnp-temp-alarm.txt
> new file mode 100644
> index 0000000..7eecb74
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/qpnp-temp-alarm.txt
> @@ -0,0 +1,27 @@
> +Qualcomm QPNP PMIC Temperature Alarm
> +
> +QPNP temperature alarm peripherals are found inside of Qualcomm PMIC chips
> +that utilize the Qualcomm SPMI implementation. These peripherals provide an
> +interrupt signal and status register to identify high PMIC die temperature.
> +
> +Required properties:
> +- compatible:      Should contain "qcom,qpnp-temp-alarm".
> +- reg:             Specifies the SPMI address temperature alarm device.

SPMI address _of_ the temperature alarm device?

> +- interrupts:      PMIC temperature alarm interrupt
> +
> +Optional properties:
> +- label:           A string used as a descriptive name for this thermal
> +                   device. This name should be 19 characters or less.
> +- io-channels:     Should contain IIO channel specifier
> +- io-channel-names: "thermal". The ADC channel for temperature reading.

Maybe can be rephrased better such as:
- io-channel-names: should contain "thermal" for the temperature reading ADC channel

> +
> +Example:
> +
> +	thermal-alarm@2400 {
> +		compatible = "qcom,qpnp-temp-alarm";
> +		reg = <0x2400>;
> +		interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
> +		label = "pm8941_tz";
> +		io-channels = <&pm8941_vadc VADC_DIE_TEMP>;
> +		io-channel-names = "thermal";
> +	};

Maybe describe the trip points in the DT?

> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 693208e..7371cf9 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -248,4 +248,16 @@ depends on ARCH_STI && OF
>  source "drivers/thermal/st/Kconfig"
>  endmenu
>  
> +config QPNP_TEMP_ALARM
> +	tristate "Qualcomm QPNP Temperature Alarm"
> +	depends on OF && REGMAP_SPMI

Seems to depend on IIO too.

> +	help
> +	  This enables a thermal sysfs driver for Qualcomm plug-and-play (QPNP)
> +	  PMIC devices. It shows up in sysfs as a thermal zone with multiple
> +	  trip points. The temperature reported by the thermal zone reflects the
> +	  real time die temperature if an ADC is present or an estimate of the
> +	  temperature based upon the over temperature stage value. Enabling the
> +	  thermal zone device via the mode file results in shifting PMIC over
> +	  temperature shutdown control from hardware to software.
> +
[..]

BR,
Georgi

  parent reply	other threads:[~2014-09-15 16:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 15:03 [PATCH RESEND] thermal: Add QPNP PMIC temperature alarm driver Ivan T. Ivanov
2014-09-15 15:30 ` Eduardo Valentin
2014-09-16  7:46   ` Ivan T. Ivanov
2014-09-24 14:56   ` Ivan T. Ivanov
2014-09-24 18:24     ` Eduardo Valentin
2014-09-24 20:30       ` Ivan T. Ivanov
2014-09-24 20:30         ` Ivan T. Ivanov
2014-09-15 16:02 ` Georgi Djakov [this message]
2014-09-16  7:53   ` Ivan T. Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54170DA6.6050001@mm-sol.com \
    --to=gdjakov@mm-sol.com \
    --cc=collinsd@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=iivanov@mm-sol.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.