linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kapileshwar Singh <kapileshwar.singh@arm.com>
To: linux-pm@vger.kernel.org
Cc: edubezval@gmail.com, rui.zhang@intel.com, javi.merino@arm.com,
	punit.agrawal@arm.com
Subject: [PATCH 1/2] thermal: of: Match function to pass bindparam index
Date: Tue, 13 Jan 2015 17:51:21 +0000	[thread overview]
Message-ID: <1421171482-16101-2-git-send-email-kapileshwar.singh@arm.com> (raw)
In-Reply-To: <1421171482-16101-1-git-send-email-kapileshwar.singh@arm.com>

From: KP Singh <kapileshwar.singh@arm.com>

The match function should pass the index of the binding parameters
which the cooling device needs to be matched against. There are currently
no implementations of match function within the kernel. A successful
match requires:

	trip_mask == expected_trip_mask;
	weight == expected_weight;
	binding_limits == expected_binding_limits;
	thermal_zone == expected_thermal_zone;

Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
---
 drivers/thermal/thermal_core.c |    4 ++--
 include/linux/thermal.h        |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 87e0b0782023..db4d6407c1ec 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -276,7 +276,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
 		for (i = 0; i < tzp->num_tbps; i++) {
 			if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
 				continue;
-			if (tzp->tbp[i].match(pos, cdev))
+			if (tzp->tbp[i].match(pos, cdev, i))
 				continue;
 			tzp->tbp[i].cdev = cdev;
 			__bind(pos, tzp->tbp[i].trip_mask, cdev,
@@ -315,7 +315,7 @@ static void bind_tz(struct thermal_zone_device *tz)
 		for (i = 0; i < tzp->num_tbps; i++) {
 			if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
 				continue;
-			if (tzp->tbp[i].match(tz, pos))
+			if (tzp->tbp[i].match(tz, pos, i))
 				continue;
 			tzp->tbp[i].cdev = pos;
 			__bind(tz, tzp->tbp[i].trip_mask, pos,
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index fc52e307efab..dc8cf6dc59e5 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -237,7 +237,7 @@ struct thermal_bind_params {
 	 */
 	unsigned long *binding_limits;
 	int (*match) (struct thermal_zone_device *tz,
-			struct thermal_cooling_device *cdev);
+		      struct thermal_cooling_device *cdev, int index);
 };
 
 /* Structure to define Thermal Zone parameters */
-- 
1.7.9.5



  reply	other threads:[~2015-01-13 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 17:51 [PATCH 0/2] thermal: of: Fix for cooling devices Kapileshwar Singh
2015-01-13 17:51 ` Kapileshwar Singh [this message]
2015-01-20 13:44   ` [PATCH 1/2] thermal: of: Match function to pass bindparam index Eduardo Valentin
2015-01-13 17:51 ` [PATCH 2/2] thermal: of: Match function for of-thermal Kapileshwar Singh
2015-01-20 13:57   ` 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=1421171482-16101-2-git-send-email-kapileshwar.singh@arm.com \
    --to=kapileshwar.singh@arm.com \
    --cc=edubezval@gmail.com \
    --cc=javi.merino@arm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=punit.agrawal@arm.com \
    --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).