linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
To: Eduardo Valentin <edubezval@gmail.com>
Cc: 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>,
	Zhang Rui <rui.zhang@intel.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 v3] thermal: Add QPNP PMIC temperature alarm driver
Date: Wed, 29 Oct 2014 17:32:56 +0200	[thread overview]
Message-ID: <1414596776.32383.2.camel@mm-sol.com> (raw)
In-Reply-To: <20141027201602.GC6088@developer>


Hi Eduardo, 

On Mon, 2014-10-27 at 16:16 -0400, Eduardo Valentin wrote:
> Hello Ivan
> 
> 


<snip>

> > 
> > +
> > +static int qpnp_tz_set_mode(struct thermal_zone_device *thermal,
> > +       enum thermal_device_mode mode)
> > +{
> > +       struct qpnp_tm_chip *chip = thermal->devdata;
> > +       int ret;
> > +
> > +       if (mode == chip->mode)
> > +       return 0;
> > +
> > +       if (mode == THERMAL_DEVICE_ENABLED)
> > +       ret = qpnp_tm_shutdown_override(chip, true);
> > +       else
> > +       ret = qpnp_tm_shutdown_override(chip, false);
> 
> 
> Can you please elaborate a little more why you need to switch these when
> mode changes?

My understanding is that PMIC hardware have predefined shutdown sequence in case 
of overheat. In non override mode, hardware itself will take care for shunting
down PMIC, which directly will shutdown also and main CPU's, while when override
is enabled software running on main CPU's, will take care for system shutdown.

> 
> > +
> > +       chip->mode = mode;
> > +
> > +       return ret;
> > +}
> > +
> > 

<snip>

> > +
> > +static int qpnp_tm_probe(struct platform_device *pdev)
> > +{
> > +       struct qpnp_tm_chip *chip;
> > +       struct device_node *node;
> > +       u8 type, subtype;
> > +       int ret, irq, res[2];
> > +
> > 

<snip>

> > +
> > +       chip->tz_dev = thermal_zone_device_register(node->name, TRIP_NUM, 0,
> > +       chip, &qpnp_tz_ops, NULL,
> 
> Have you considered using of-thermal instead of doing your own specific thermal
> zone registration? Having a glance look in this driver, most of the
> operation are covered by of-thermal. Ahy concerns using of-thermal in
> your case?
> 

I just followed implementation found in "armada_thermal", "db8500-thermal", 
"dove_thermal", "imx_thermal", "kirkwood_thermal"...

Will look at of-thermal.

Thank you,
Ivan



  reply	other threads:[~2014-10-29 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 15:53 [PATCH v3] thermal: Add QPNP PMIC temperature alarm driver Ivan T. Ivanov
2014-10-16 14:03 ` Ivan T. Ivanov
2014-10-27 15:32   ` Ivan T. Ivanov
2014-10-27 20:16 ` Eduardo Valentin
2014-10-29 15:32   ` Ivan T. Ivanov [this message]
2014-10-30 13:55     ` Ivan T. Ivanov
2014-11-06 23:48       ` Eduardo Valentin

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=1414596776.32383.2.camel@mm-sol.com \
    --to=iivanov@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).