From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] thermal: hisilicon: add new hisilicon thermal sensor driver
Date: Fri, 20 Mar 2015 15:55:27 +0000 [thread overview]
Message-ID: <20150320155527.GJ14766@leverpostej> (raw)
In-Reply-To: <20150320145353.GA20461@leoy-linaro>
> > That may be the case in the code as it stands today, but per the binding
> > the trip points are the temperatures at which an action is to be taken.
> >
> > The thermal-zone has poilling-delay and polling-delay-passive, but
> > there's no reason you couldn't also use the interrupt to handle the
> > "hot" trip-point, adn the reset at the "critical" trip-point. All that's
> > missing is the plumbing in order to do so.
> >
> > So please co-ordinate with the thermal framework to do that.
>
> Let's dig further more for this point, so that we can get more specific
> gudiance and have a good preparation for next version's patch set.
>
> After i reviewed the thermal framework code, currently have one smooth
> way to co-ordinate the trip points w/t thermal framework: use the function
> *thermal_zone_device_register()* to register sensor, and can use the
> callback function .get_trip_temp to tell thermal framework for the
> trip points' temperature.
>
> For hisi thermal case, now the driver is using the function
> *thermal_zone_of_sensor_register* to register sensor, but use this way
> i have not found there have standard APIs which can be used by sensor
> driver to get the trip points info from thermal framework.
>
> I may miss something for thermal framework, so if have existed APIs to
> get the trip points, could pls point out?
I am only familiar with the binding, not the Linux implementation -- The
latter can change to accomodate your hardware without requiring binding
changes. Please co-ordinate with the thermal maintainers.
> > > > > + if (of_property_read_bool(np, "hisilicon,tsensor-bind-irq")) {
> > > > > +
> > > > > + if (data->irq_bind_sensor != -1)
> > > > > + dev_warn(&pdev->dev, "irq has bound to index %d\n",
> > > > > + data->irq_bind_sensor);
> > > > > +
> > > > > + /* bind irq to this sensor */
> > > > > + data->irq_bind_sensor = index;
> > > > > + }
> > > >
> > > > I don't see why this should be specified in the DT. Why do you believe
> > > > it should?
> > >
> > > The thermal sensor module has four sensors, but have only one
> > > interrupt signal; This interrupt can only be used by one sensor;
> > > So want to use dts to bind the interrupt with one selected sensor.
> >
> > That's not all that great, though I'm not exactly sure how the kernel
> > would select the best sensor to measure with. It would be good if you
> > could talk to the thermal maintainers w.r.t. this.
>
> This will be decided by the silicon, right? Every soc has different
> combination with cpu/gpu/vpu, so which part is hottest, this maybe
> highly dependent on individual SoC.
>
> S/W just need provide the flexibility so that later can choose
> the interrupt to bind with the sensor within the hottest part.
Then the property you care about is which sensor is closest to what is
likely to be the hottest component. Given that, the kernel can decide
how to use the interrupt.
Thanks,
Mark.
next prev parent reply other threads:[~2015-03-20 15:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 7:57 [PATCH 0/3] 96boards: add thermal senor support to hikey board kongxinwei
2015-03-19 7:57 ` [PATCH 1/3] thermal: hisilicon: add new hisilicon thermal sensor driver kongxinwei
2015-03-19 14:17 ` Mark Rutland
2015-03-20 6:06 ` Leo Yan
2015-03-20 11:24 ` Mark Rutland
2015-03-20 14:53 ` Leo Yan
2015-03-20 15:55 ` Mark Rutland [this message]
2015-03-23 4:46 ` Leo Yan
2015-03-23 8:30 ` kongxinwei
2015-03-20 15:27 ` Xinwei Kong
2015-03-20 7:37 ` kongxinwei
2015-03-19 7:57 ` [PATCH 2/3] dts: hi6220: enable thermal sensor for hisilicon SoC kongxinwei
2015-03-19 7:57 ` [PATCH 3/3] dt-bindings: Document the hi6220 thermal sensor bindings kongxinwei
2015-03-19 14:08 ` Mark Rutland
2015-03-19 13:59 ` [PATCH 0/3] 96boards: add thermal senor support to hikey board Mark Rutland
2015-03-20 3:10 ` kongxinwei
2015-03-20 6:13 ` Leo Yan
2015-03-20 7:41 ` kongxinwei
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=20150320155527.GJ14766@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).