aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 01:39:12 -0400
commit4f3bff70a64b105921dac8630bc4381567b21ebd (patch)
tree2601d581e21c4ca9392bbf85dfb981a2181ecba6 /drivers/platform
parent2ddb9f17ba026122b53b34fb4182ece91e24cf92 (diff)
parent03a971a2899886006f19f3495973bbd646d8bdae (diff)
Merge branch 'thermal' into release
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_menlow.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c
index 27b7662955bb..29432a50be45 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -57,8 +57,8 @@ MODULE_LICENSE("GPL");
57 * In that case max_cstate would be n-1 57 * In that case max_cstate would be n-1
58 * GTHS returning '0' would mean that no bandwidth control states are supported 58 * GTHS returning '0' would mean that no bandwidth control states are supported
59 */ 59 */
60static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev, 60static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev,
61 unsigned long *max_state) 61 unsigned long *max_state)
62{ 62{
63 struct acpi_device *device = cdev->devdata; 63 struct acpi_device *device = cdev->devdata;
64 acpi_handle handle = device->handle; 64 acpi_handle handle = device->handle;
@@ -83,22 +83,12 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev,
83 return 0; 83 return 0;
84} 84}
85 85
86static int memory_get_max_bandwidth(struct thermal_cooling_device *cdev,
87 char *buf)
88{
89 unsigned long value;
90 if (memory_get_int_max_bandwidth(cdev, &value))
91 return -EINVAL;
92
93 return sprintf(buf, "%ld\n", value);
94}
95
96static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev, 86static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
97 char *buf) 87 unsigned long *value)
98{ 88{
99 struct acpi_device *device = cdev->devdata; 89 struct acpi_device *device = cdev->devdata;
100 acpi_handle handle = device->handle; 90 acpi_handle handle = device->handle;
101 unsigned long long value; 91 unsigned long long result;
102 struct acpi_object_list arg_list; 92 struct acpi_object_list arg_list;
103 union acpi_object arg; 93 union acpi_object arg;
104 acpi_status status = AE_OK; 94 acpi_status status = AE_OK;
@@ -108,15 +98,16 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
108 arg.type = ACPI_TYPE_INTEGER; 98 arg.type = ACPI_TYPE_INTEGER;
109 arg.integer.value = MEMORY_ARG_CUR_BANDWIDTH; 99 arg.integer.value = MEMORY_ARG_CUR_BANDWIDTH;
110 status = acpi_evaluate_integer(handle, MEMORY_GET_BANDWIDTH, 100 status = acpi_evaluate_integer(handle, MEMORY_GET_BANDWIDTH,
111 &arg_list, &value); 101 &arg_list, &result);
112 if (ACPI_FAILURE(status)) 102 if (ACPI_FAILURE(status))
113 return -EFAULT; 103 return -EFAULT;
114 104
115 return sprintf(buf, "%llu\n", value); 105 *value = result;
106 return 0;
116} 107}
117 108
118static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, 109static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
119 unsigned int state) 110 unsigned long state)
120{ 111{
121 struct acpi_device *device = cdev->devdata; 112 struct acpi_device *device = cdev->devdata;
122 acpi_handle handle = device->handle; 113 acpi_handle handle = device->handle;
@@ -126,7 +117,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
126 unsigned long long temp; 117 unsigned long long temp;
127 unsigned long max_state; 118 unsigned long max_state;
128 119
129 if (memory_get_int_max_bandwidth(cdev, &max_state)) 120 if (memory_get_max_bandwidth(cdev, &max_state))
130 return -EFAULT; 121 return -EFAULT;
131 122
132 if (state > max_state) 123 if (state > max_state)
@@ -142,7 +133,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
142 &temp); 133 &temp);
143 134
144 printk(KERN_INFO 135 printk(KERN_INFO
145 "Bandwidth value was %d: status is %d\n", state, status); 136 "Bandwidth value was %ld: status is %d\n", state, status);
146 if (ACPI_FAILURE(status)) 137 if (ACPI_FAILURE(status))
147 return -EFAULT; 138 return -EFAULT;
148 139