lkml.org 
[lkml]   [2014]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] thermal: Add QPNP PMIC temperature alarm driver
From
Date

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




\
 
 \ /
  Last update: 2014-10-29 17:01    [W:0.056 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site