aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/hp_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/hp_accel.c')
-rw-r--r--drivers/hwmon/hp_accel.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c
index abf4dfc8ec22..dcefe1d2adbd 100644
--- a/drivers/hwmon/hp_accel.c
+++ b/drivers/hwmon/hp_accel.c
@@ -213,6 +213,30 @@ static struct delayed_led_classdev hpled_led = {
213 .set_brightness = hpled_set, 213 .set_brightness = hpled_set,
214}; 214};
215 215
216static acpi_status
217lis3lv02d_get_resource(struct acpi_resource *resource, void *context)
218{
219 if (resource->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
220 struct acpi_resource_extended_irq *irq;
221 u32 *device_irq = context;
222
223 irq = &resource->data.extended_irq;
224 *device_irq = irq->interrupts[0];
225 }
226
227 return AE_OK;
228}
229
230static void lis3lv02d_enum_resources(struct acpi_device *device)
231{
232 acpi_status status;
233
234 status = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
235 lis3lv02d_get_resource, &adev.irq);
236 if (ACPI_FAILURE(status))
237 printk(KERN_DEBUG DRIVER_NAME ": Error getting resources\n");
238}
239
216static int lis3lv02d_add(struct acpi_device *device) 240static int lis3lv02d_add(struct acpi_device *device)
217{ 241{
218 u8 val; 242 u8 val;
@@ -247,6 +271,9 @@ static int lis3lv02d_add(struct acpi_device *device)
247 if (ret) 271 if (ret)
248 return ret; 272 return ret;
249 273
274 /* obtain IRQ number of our device from ACPI */
275 lis3lv02d_enum_resources(adev.device);
276
250 ret = lis3lv02d_init_device(&adev); 277 ret = lis3lv02d_init_device(&adev);
251 if (ret) { 278 if (ret) {
252 flush_work(&hpled_led.work); 279 flush_work(&hpled_led.work);