diff options
Diffstat (limited to 'drivers/hwmon/lis3lv02d.c')
-rw-r--r-- | drivers/hwmon/lis3lv02d.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c index 366190609c73..271338bdb6be 100644 --- a/drivers/hwmon/lis3lv02d.c +++ b/drivers/hwmon/lis3lv02d.c | |||
@@ -438,6 +438,26 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) | |||
438 | if (lis3lv02d_joystick_enable()) | 438 | if (lis3lv02d_joystick_enable()) |
439 | printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); | 439 | printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); |
440 | 440 | ||
441 | /* passing in platform specific data is purely optional and only | ||
442 | * used by the SPI transport layer at the moment */ | ||
443 | if (dev->pdata) { | ||
444 | struct lis3lv02d_platform_data *p = dev->pdata; | ||
445 | |||
446 | if (p->click_flags && (dev->whoami == LIS_SINGLE_ID)) { | ||
447 | dev->write(dev, CLICK_CFG, p->click_flags); | ||
448 | dev->write(dev, CLICK_TIMELIMIT, p->click_time_limit); | ||
449 | dev->write(dev, CLICK_LATENCY, p->click_latency); | ||
450 | dev->write(dev, CLICK_WINDOW, p->click_window); | ||
451 | dev->write(dev, CLICK_THSZ, p->click_thresh_z & 0xf); | ||
452 | dev->write(dev, CLICK_THSY_X, | ||
453 | (p->click_thresh_x & 0xf) | | ||
454 | (p->click_thresh_y << 4)); | ||
455 | } | ||
456 | |||
457 | if (p->irq_cfg) | ||
458 | dev->write(dev, CTRL_REG3, p->irq_cfg); | ||
459 | } | ||
460 | |||
441 | /* bail if we did not get an IRQ from the bus layer */ | 461 | /* bail if we did not get an IRQ from the bus layer */ |
442 | if (!dev->irq) { | 462 | if (!dev->irq) { |
443 | printk(KERN_ERR DRIVER_NAME | 463 | printk(KERN_ERR DRIVER_NAME |