summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-18 22:16:51 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-30 15:37:20 +1000
commit33e6820b767a5bfa4a0d579da6ee4568a2b1e730 (patch)
tree341a29222e9fb18fe4ce6f9c9346bbc4190584e3 /drivers/macintosh/windfarm.h
parentea5c64b06743b505e0eb4e6caa1810fe685c9559 (diff)
downloadlinux-33e6820b767a5bfa4a0d579da6ee4568a2b1e730.tar.gz
linux-33e6820b767a5bfa4a0d579da6ee4568a2b1e730.tar.bz2
linux-33e6820b767a5bfa4a0d579da6ee4568a2b1e730.zip
powerpc/windfarm: Add useful accessors
Makes the code more readable Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/macintosh/windfarm.h')
-rw-r--r--drivers/macintosh/windfarm.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/macintosh/windfarm.h b/drivers/macintosh/windfarm.h
index 3ef192a1fca0..a9e385ee359e 100644
--- a/drivers/macintosh/windfarm.h
+++ b/drivers/macintosh/windfarm.h
@@ -72,6 +72,26 @@ static inline int wf_control_set_min(struct wf_control *ct)
return ct->ops->set_value(ct, vmin);
}
+static inline int wf_control_set(struct wf_control *ct, s32 val)
+{
+ return ct->ops->set_value(ct, val);
+}
+
+static inline int wf_control_get(struct wf_control *ct, s32 *val)
+{
+ return ct->ops->get_value(ct, val);
+}
+
+static inline s32 wf_control_get_min(struct wf_control *ct)
+{
+ return ct->ops->get_min(ct);
+}
+
+static inline s32 wf_control_get_max(struct wf_control *ct)
+{
+ return ct->ops->get_max(ct);
+}
+
/*
* Sensor objects
*/
@@ -100,6 +120,11 @@ extern struct wf_sensor * wf_find_sensor(const char *name);
extern int wf_get_sensor(struct wf_sensor *sr);
extern void wf_put_sensor(struct wf_sensor *sr);
+static inline int wf_sensor_get(struct wf_sensor *sr, s32 *val)
+{
+ return sr->ops->get_value(sr, val);
+}
+
/* For use by clients. Note that we are a bit racy here since
* notifier_block doesn't have a module owner field. I may fix
* it one day ...