diff options
Diffstat (limited to 'drivers/input/misc')
23 files changed, 710 insertions, 247 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 7b46781c30c9..d62827271802 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
| @@ -134,6 +134,18 @@ config INPUT_MAX8925_ONKEY | |||
| 134 | To compile this driver as a module, choose M here: the module | 134 | To compile this driver as a module, choose M here: the module |
| 135 | will be called max8925_onkey. | 135 | will be called max8925_onkey. |
| 136 | 136 | ||
| 137 | config INPUT_MAX8997_HAPTIC | ||
| 138 | tristate "MAXIM MAX8997 haptic controller support" | ||
| 139 | depends on HAVE_PWM && MFD_MAX8997 | ||
| 140 | select INPUT_FF_MEMLESS | ||
| 141 | help | ||
| 142 | This option enables device driver support for the haptic controller | ||
| 143 | on MAXIM MAX8997 chip. This driver supports ff-memless interface | ||
| 144 | from input framework. | ||
| 145 | |||
| 146 | To compile this driver as module, choose M here: the | ||
| 147 | module will be called max8997-haptic. | ||
| 148 | |||
| 137 | config INPUT_MC13783_PWRBUTTON | 149 | config INPUT_MC13783_PWRBUTTON |
| 138 | tristate "MC13783 ON buttons" | 150 | tristate "MC13783 ON buttons" |
| 139 | depends on MFD_MC13783 | 151 | depends on MFD_MC13783 |
| @@ -415,7 +427,7 @@ config INPUT_PCF8574 | |||
| 415 | tristate "PCF8574 Keypad input device" | 427 | tristate "PCF8574 Keypad input device" |
| 416 | depends on I2C && EXPERIMENTAL | 428 | depends on I2C && EXPERIMENTAL |
| 417 | help | 429 | help |
| 418 | Say Y here if you want to support a keypad connetced via I2C | 430 | Say Y here if you want to support a keypad connected via I2C |
| 419 | with a PCF8574. | 431 | with a PCF8574. |
| 420 | 432 | ||
| 421 | To compile this driver as a module, choose M here: the | 433 | To compile this driver as a module, choose M here: the |
| @@ -455,6 +467,16 @@ config INPUT_RB532_BUTTON | |||
| 455 | To compile this driver as a module, choose M here: the | 467 | To compile this driver as a module, choose M here: the |
| 456 | module will be called rb532_button. | 468 | module will be called rb532_button. |
| 457 | 469 | ||
| 470 | config INPUT_DA9052_ONKEY | ||
| 471 | tristate "Dialog DA9052/DA9053 Onkey" | ||
| 472 | depends on PMIC_DA9052 | ||
| 473 | help | ||
| 474 | Support the ONKEY of Dialog DA9052 PMICs as an input device | ||
| 475 | reporting power button status. | ||
| 476 | |||
| 477 | To compile this driver as a module, choose M here: the | ||
| 478 | module will be called da9052_onkey. | ||
| 479 | |||
| 458 | config INPUT_DM355EVM | 480 | config INPUT_DM355EVM |
| 459 | tristate "TI DaVinci DM355 EVM Keypad and IR Remote" | 481 | tristate "TI DaVinci DM355 EVM Keypad and IR Remote" |
| 460 | depends on MFD_DM355EVM_MSP | 482 | depends on MFD_DM355EVM_MSP |
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile index 46671a875b91..f55cdf4916fa 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile | |||
| @@ -21,6 +21,7 @@ obj-$(CONFIG_INPUT_CM109) += cm109.o | |||
| 21 | obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o | 21 | obj-$(CONFIG_INPUT_CMA3000) += cma3000_d0x.o |
| 22 | obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o | 22 | obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o |
| 23 | obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o | 23 | obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o |
| 24 | obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o | ||
| 24 | obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o | 25 | obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o |
| 25 | obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o | 26 | obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o |
| 26 | obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o | 27 | obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o |
| @@ -30,6 +31,7 @@ obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o | |||
| 30 | obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o | 31 | obj-$(CONFIG_INPUT_KXTJ9) += kxtj9.o |
| 31 | obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o | 32 | obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o |
| 32 | obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o | 33 | obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o |
| 34 | obj-$(CONFIG_INPUT_MAX8997_HAPTIC) += max8997_haptic.o | ||
| 33 | obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o | 35 | obj-$(CONFIG_INPUT_MC13783_PWRBUTTON) += mc13783-pwrbutton.o |
| 34 | obj-$(CONFIG_INPUT_MMA8450) += mma8450.o | 36 | obj-$(CONFIG_INPUT_MMA8450) += mma8450.o |
| 35 | obj-$(CONFIG_INPUT_MPU3050) += mpu3050.o | 37 | obj-$(CONFIG_INPUT_MPU3050) += mpu3050.o |
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 79d901633635..350fd0c385d2 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
| 13 | #include <linux/input.h> | 13 | #include <linux/input.h> |
| 14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/mfd/ab8500.h> | 15 | #include <linux/mfd/abx500/ab8500.h> |
| 16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c index 56810fb4eadd..c8a79015472a 100644 --- a/drivers/input/misc/ad714x-i2c.c +++ b/drivers/input/misc/ad714x-i2c.c | |||
| @@ -116,17 +116,7 @@ static struct i2c_driver ad714x_i2c_driver = { | |||
| 116 | .id_table = ad714x_id, | 116 | .id_table = ad714x_id, |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | static int __init ad714x_i2c_init(void) | 119 | module_i2c_driver(ad714x_i2c_driver); |
| 120 | { | ||
| 121 | return i2c_add_driver(&ad714x_i2c_driver); | ||
| 122 | } | ||
| 123 | module_init(ad714x_i2c_init); | ||
| 124 | |||
| 125 | static void __exit ad714x_i2c_exit(void) | ||
| 126 | { | ||
| 127 | i2c_del_driver(&ad714x_i2c_driver); | ||
| 128 | } | ||
| 129 | module_exit(ad714x_i2c_exit); | ||
| 130 | 120 | ||
| 131 | MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor I2C Bus Driver"); | 121 | MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor I2C Bus Driver"); |
| 132 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 122 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c index 875b50811361..75f6136d608e 100644 --- a/drivers/input/misc/ad714x-spi.c +++ b/drivers/input/misc/ad714x-spi.c | |||
| @@ -123,17 +123,7 @@ static struct spi_driver ad714x_spi_driver = { | |||
| 123 | .remove = __devexit_p(ad714x_spi_remove), | 123 | .remove = __devexit_p(ad714x_spi_remove), |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | static __init int ad714x_spi_init(void) | 126 | module_spi_driver(ad714x_spi_driver); |
| 127 | { | ||
| 128 | return spi_register_driver(&ad714x_spi_driver); | ||
| 129 | } | ||
| 130 | module_init(ad714x_spi_init); | ||
| 131 | |||
| 132 | static __exit void ad714x_spi_exit(void) | ||
| 133 | { | ||
| 134 | spi_unregister_driver(&ad714x_spi_driver); | ||
| 135 | } | ||
| 136 | module_exit(ad714x_spi_exit); | ||
| 137 | 127 | ||
| 138 | MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor SPI Bus Driver"); | 128 | MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor SPI Bus Driver"); |
| 139 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 129 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c index ccacf2bb06a4..dd1d1c145a7f 100644 --- a/drivers/input/misc/adxl34x-i2c.c +++ b/drivers/input/misc/adxl34x-i2c.c | |||
| @@ -148,17 +148,7 @@ static struct i2c_driver adxl34x_driver = { | |||
| 148 | .id_table = adxl34x_id, | 148 | .id_table = adxl34x_id, |
| 149 | }; | 149 | }; |
| 150 | 150 | ||
| 151 | static int __init adxl34x_i2c_init(void) | 151 | module_i2c_driver(adxl34x_driver); |
| 152 | { | ||
| 153 | return i2c_add_driver(&adxl34x_driver); | ||
| 154 | } | ||
| 155 | module_init(adxl34x_i2c_init); | ||
| 156 | |||
| 157 | static void __exit adxl34x_i2c_exit(void) | ||
| 158 | { | ||
| 159 | i2c_del_driver(&adxl34x_driver); | ||
| 160 | } | ||
| 161 | module_exit(adxl34x_i2c_exit); | ||
| 162 | 152 | ||
| 163 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 153 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
| 164 | MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer I2C Bus Driver"); | 154 | MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer I2C Bus Driver"); |
diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c index 34d401efd4a1..820a802a1e6e 100644 --- a/drivers/input/misc/adxl34x-spi.c +++ b/drivers/input/misc/adxl34x-spi.c | |||
| @@ -129,17 +129,7 @@ static struct spi_driver adxl34x_driver = { | |||
| 129 | .remove = __devexit_p(adxl34x_spi_remove), | 129 | .remove = __devexit_p(adxl34x_spi_remove), |
| 130 | }; | 130 | }; |
| 131 | 131 | ||
| 132 | static int __init adxl34x_spi_init(void) | 132 | module_spi_driver(adxl34x_driver); |
| 133 | { | ||
| 134 | return spi_register_driver(&adxl34x_driver); | ||
| 135 | } | ||
| 136 | module_init(adxl34x_spi_init); | ||
| 137 | |||
| 138 | static void __exit adxl34x_spi_exit(void) | ||
| 139 | { | ||
| 140 | spi_unregister_driver(&adxl34x_driver); | ||
| 141 | } | ||
| 142 | module_exit(adxl34x_spi_exit); | ||
| 143 | 133 | ||
| 144 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 134 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
| 145 | MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer SPI Bus Driver"); | 135 | MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer SPI Bus Driver"); |
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index a34896ed7ed3..f63341f20b91 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
| @@ -1013,23 +1013,4 @@ static int ati_remote2_post_reset(struct usb_interface *interface) | |||
| 1013 | return r; | 1013 | return r; |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | static int __init ati_remote2_init(void) | 1016 | module_usb_driver(ati_remote2_driver); |
| 1017 | { | ||
| 1018 | int r; | ||
| 1019 | |||
| 1020 | r = usb_register(&ati_remote2_driver); | ||
| 1021 | if (r) | ||
| 1022 | printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r); | ||
| 1023 | else | ||
| 1024 | printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n"); | ||
| 1025 | |||
| 1026 | return r; | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | static void __exit ati_remote2_exit(void) | ||
| 1030 | { | ||
| 1031 | usb_deregister(&ati_remote2_driver); | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | module_init(ati_remote2_init); | ||
| 1035 | module_exit(ati_remote2_exit); | ||
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c index 8f55b54352b6..e2f1e9f952b1 100644 --- a/drivers/input/misc/bma150.c +++ b/drivers/input/misc/bma150.c | |||
| @@ -673,19 +673,8 @@ static struct i2c_driver bma150_driver = { | |||
| 673 | .remove = __devexit_p(bma150_remove), | 673 | .remove = __devexit_p(bma150_remove), |
| 674 | }; | 674 | }; |
| 675 | 675 | ||
| 676 | static int __init BMA150_init(void) | 676 | module_i2c_driver(bma150_driver); |
| 677 | { | ||
| 678 | return i2c_add_driver(&bma150_driver); | ||
| 679 | } | ||
| 680 | |||
| 681 | static void __exit BMA150_exit(void) | ||
| 682 | { | ||
| 683 | i2c_del_driver(&bma150_driver); | ||
| 684 | } | ||
| 685 | 677 | ||
| 686 | MODULE_AUTHOR("Albert Zhang <xu.zhang@bosch-sensortec.com>"); | 678 | MODULE_AUTHOR("Albert Zhang <xu.zhang@bosch-sensortec.com>"); |
| 687 | MODULE_DESCRIPTION("BMA150 driver"); | 679 | MODULE_DESCRIPTION("BMA150 driver"); |
| 688 | MODULE_LICENSE("GPL"); | 680 | MODULE_LICENSE("GPL"); |
| 689 | |||
| 690 | module_init(BMA150_init); | ||
| 691 | module_exit(BMA150_exit); | ||
diff --git a/drivers/input/misc/cma3000_d0x_i2c.c b/drivers/input/misc/cma3000_d0x_i2c.c index d100cc5c5783..fe9b85f07792 100644 --- a/drivers/input/misc/cma3000_d0x_i2c.c +++ b/drivers/input/misc/cma3000_d0x_i2c.c | |||
| @@ -125,18 +125,7 @@ static struct i2c_driver cma3000_i2c_driver = { | |||
| 125 | }, | 125 | }, |
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | static int __init cma3000_i2c_init(void) | 128 | module_i2c_driver(cma3000_i2c_driver); |
| 129 | { | ||
| 130 | return i2c_add_driver(&cma3000_i2c_driver); | ||
| 131 | } | ||
| 132 | |||
| 133 | static void __exit cma3000_i2c_exit(void) | ||
| 134 | { | ||
| 135 | i2c_del_driver(&cma3000_i2c_driver); | ||
| 136 | } | ||
| 137 | |||
| 138 | module_init(cma3000_i2c_init); | ||
| 139 | module_exit(cma3000_i2c_exit); | ||
| 140 | 129 | ||
| 141 | MODULE_DESCRIPTION("CMA3000-D0x Accelerometer I2C Driver"); | 130 | MODULE_DESCRIPTION("CMA3000-D0x Accelerometer I2C Driver"); |
| 142 | MODULE_LICENSE("GPL"); | 131 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c new file mode 100644 index 000000000000..34aebb8cd080 --- /dev/null +++ b/drivers/input/misc/da9052_onkey.c | |||
| @@ -0,0 +1,169 @@ | |||
| 1 | /* | ||
| 2 | * ON pin driver for Dialog DA9052 PMICs | ||
| 3 | * | ||
| 4 | * Copyright(c) 2012 Dialog Semiconductor Ltd. | ||
| 5 | * | ||
| 6 | * Author: David Dajun Chen <dchen@diasemi.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms of the GNU General Public License as published by the | ||
| 10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 11 | * option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/input.h> | ||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/platform_device.h> | ||
| 18 | #include <linux/workqueue.h> | ||
| 19 | |||
| 20 | #include <linux/mfd/da9052/da9052.h> | ||
| 21 | #include <linux/mfd/da9052/reg.h> | ||
| 22 | |||
| 23 | struct da9052_onkey { | ||
| 24 | struct da9052 *da9052; | ||
| 25 | struct input_dev *input; | ||
| 26 | struct delayed_work work; | ||
| 27 | unsigned int irq; | ||
| 28 | }; | ||
| 29 | |||
| 30 | static void da9052_onkey_query(struct da9052_onkey *onkey) | ||
| 31 | { | ||
| 32 | int key_stat; | ||
| 33 | |||
| 34 | key_stat = da9052_reg_read(onkey->da9052, DA9052_EVENT_B_REG); | ||
| 35 | if (key_stat < 0) { | ||
| 36 | dev_err(onkey->da9052->dev, | ||
| 37 | "Failed to read onkey event %d\n", key_stat); | ||
| 38 | } else { | ||
| 39 | /* | ||
| 40 | * Since interrupt for deassertion of ONKEY pin is not | ||
| 41 | * generated, onkey event state determines the onkey | ||
| 42 | * button state. | ||
| 43 | */ | ||
| 44 | key_stat &= DA9052_EVENTB_ENONKEY; | ||
| 45 | input_report_key(onkey->input, KEY_POWER, key_stat); | ||
| 46 | input_sync(onkey->input); | ||
| 47 | } | ||
| 48 | |||
| 49 | /* | ||
| 50 | * Interrupt is generated only when the ONKEY pin is asserted. | ||
| 51 | * Hence the deassertion of the pin is simulated through work queue. | ||
| 52 | */ | ||
| 53 | if (key_stat) | ||
| 54 | schedule_delayed_work(&onkey->work, msecs_to_jiffies(50)); | ||
| 55 | } | ||
| 56 | |||
| 57 | static void da9052_onkey_work(struct work_struct *work) | ||
| 58 | { | ||
| 59 | struct da9052_onkey *onkey = container_of(work, struct da9052_onkey, | ||
| 60 | work.work); | ||
| 61 | |||
| 62 | da9052_onkey_query(onkey); | ||
| 63 | } | ||
| 64 | |||
| 65 | static irqreturn_t da9052_onkey_irq(int irq, void *data) | ||
| 66 | { | ||
| 67 | struct da9052_onkey *onkey = data; | ||
| 68 | |||
| 69 | da9052_onkey_query(onkey); | ||
| 70 | |||
| 71 | return IRQ_HANDLED; | ||
| 72 | } | ||
| 73 | |||
| 74 | static int __devinit da9052_onkey_probe(struct platform_device *pdev) | ||
| 75 | { | ||
| 76 | struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent); | ||
| 77 | struct da9052_onkey *onkey; | ||
| 78 | struct input_dev *input_dev; | ||
| 79 | int irq; | ||
| 80 | int error; | ||
| 81 | |||
| 82 | if (!da9052) { | ||
| 83 | dev_err(&pdev->dev, "Failed to get the driver's data\n"); | ||
| 84 | return -EINVAL; | ||
| 85 | } | ||
| 86 | |||
| 87 | irq = platform_get_irq_byname(pdev, "ONKEY"); | ||
| 88 | if (irq < 0) { | ||
| 89 | dev_err(&pdev->dev, | ||
| 90 | "Failed to get an IRQ for input device, %d\n", irq); | ||
| 91 | return -EINVAL; | ||
| 92 | } | ||
| 93 | |||
| 94 | onkey = kzalloc(sizeof(*onkey), GFP_KERNEL); | ||
| 95 | input_dev = input_allocate_device(); | ||
| 96 | if (!onkey || !input_dev) { | ||
| 97 | dev_err(&pdev->dev, "Failed to allocate memory\n"); | ||
| 98 | return -ENOMEM; | ||
| 99 | } | ||
| 100 | |||
| 101 | onkey->input = input_dev; | ||
| 102 | onkey->da9052 = da9052; | ||
| 103 | onkey->irq = irq; | ||
| 104 | INIT_DELAYED_WORK(&onkey->work, da9052_onkey_work); | ||
| 105 | |||
| 106 | input_dev->name = "da9052-onkey"; | ||
| 107 | input_dev->phys = "da9052-onkey/input0"; | ||
| 108 | input_dev->dev.parent = &pdev->dev; | ||
| 109 | |||
| 110 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | ||
| 111 | __set_bit(KEY_POWER, input_dev->keybit); | ||
| 112 | |||
| 113 | error = request_threaded_irq(onkey->irq, NULL, da9052_onkey_irq, | ||
| 114 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, | ||
| 115 | "ONKEY", onkey); | ||
| 116 | if (error < 0) { | ||
| 117 | dev_err(onkey->da9052->dev, | ||
| 118 | "Failed to register ONKEY IRQ %d, error = %d\n", | ||
| 119 | onkey->irq, error); | ||
| 120 | goto err_free_mem; | ||
| 121 | } | ||
| 122 | |||
| 123 | error = input_register_device(onkey->input); | ||
| 124 | if (error) { | ||
| 125 | dev_err(&pdev->dev, "Unable to register input device, %d\n", | ||
| 126 | error); | ||
| 127 | goto err_free_irq; | ||
| 128 | } | ||
| 129 | |||
| 130 | platform_set_drvdata(pdev, onkey); | ||
| 131 | return 0; | ||
| 132 | |||
| 133 | err_free_irq: | ||
| 134 | free_irq(onkey->irq, onkey); | ||
| 135 | cancel_delayed_work_sync(&onkey->work); | ||
| 136 | err_free_mem: | ||
| 137 | input_free_device(input_dev); | ||
| 138 | kfree(onkey); | ||
| 139 | |||
| 140 | return error; | ||
| 141 | } | ||
| 142 | |||
| 143 | static int __devexit da9052_onkey_remove(struct platform_device *pdev) | ||
| 144 | { | ||
| 145 | struct da9052_onkey *onkey = platform_get_drvdata(pdev); | ||
| 146 | |||
| 147 | free_irq(onkey->irq, onkey); | ||
| 148 | cancel_delayed_work_sync(&onkey->work); | ||
| 149 | |||
| 150 | input_unregister_device(onkey->input); | ||
| 151 | kfree(onkey); | ||
| 152 | |||
| 153 | return 0; | ||
| 154 | } | ||
| 155 | |||
| 156 | static struct platform_driver da9052_onkey_driver = { | ||
| 157 | .probe = da9052_onkey_probe, | ||
| 158 | .remove = __devexit_p(da9052_onkey_remove), | ||
| 159 | .driver = { | ||
| 160 | .name = "da9052-onkey", | ||
| 161 | .owner = THIS_MODULE, | ||
| 162 | }, | ||
| 163 | }; | ||
| 164 | module_platform_driver(da9052_onkey_driver); | ||
| 165 | |||
| 166 | MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>"); | ||
| 167 | MODULE_DESCRIPTION("Onkey driver for DA9052"); | ||
| 168 | MODULE_LICENSE("GPL"); | ||
| 169 | MODULE_ALIAS("platform:da9052-onkey"); | ||
diff --git a/drivers/input/misc/gp2ap002a00f.c b/drivers/input/misc/gp2ap002a00f.c index 71fba8c2fc66..b6664cfa340a 100644 --- a/drivers/input/misc/gp2ap002a00f.c +++ b/drivers/input/misc/gp2ap002a00f.c | |||
| @@ -281,18 +281,7 @@ static struct i2c_driver gp2a_i2c_driver = { | |||
| 281 | .id_table = gp2a_i2c_id, | 281 | .id_table = gp2a_i2c_id, |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
| 284 | static int __init gp2a_init(void) | 284 | module_i2c_driver(gp2a_i2c_driver); |
| 285 | { | ||
| 286 | return i2c_add_driver(&gp2a_i2c_driver); | ||
| 287 | } | ||
| 288 | |||
| 289 | static void __exit gp2a_exit(void) | ||
| 290 | { | ||
| 291 | i2c_del_driver(&gp2a_i2c_driver); | ||
| 292 | } | ||
| 293 | |||
| 294 | module_init(gp2a_init); | ||
| 295 | module_exit(gp2a_exit); | ||
| 296 | 285 | ||
| 297 | MODULE_AUTHOR("Courtney Cavin <courtney.cavin@sonyericsson.com>"); | 286 | MODULE_AUTHOR("Courtney Cavin <courtney.cavin@sonyericsson.com>"); |
| 298 | MODULE_DESCRIPTION("Sharp GP2AP002A00F I2C Proximity/Opto sensor driver"); | 287 | MODULE_DESCRIPTION("Sharp GP2AP002A00F I2C Proximity/Opto sensor driver"); |
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index fc62256c963f..d99151a8bf10 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c | |||
| @@ -580,26 +580,7 @@ static struct usb_driver keyspan_driver = | |||
| 580 | .id_table = keyspan_table | 580 | .id_table = keyspan_table |
| 581 | }; | 581 | }; |
| 582 | 582 | ||
| 583 | static int __init usb_keyspan_init(void) | 583 | module_usb_driver(keyspan_driver); |
| 584 | { | ||
| 585 | int result; | ||
| 586 | |||
| 587 | /* register this driver with the USB subsystem */ | ||
| 588 | result = usb_register(&keyspan_driver); | ||
| 589 | if (result) | ||
| 590 | err("usb_register failed. Error number %d\n", result); | ||
| 591 | |||
| 592 | return result; | ||
| 593 | } | ||
| 594 | |||
| 595 | static void __exit usb_keyspan_exit(void) | ||
| 596 | { | ||
| 597 | /* deregister this driver with the USB subsystem */ | ||
| 598 | usb_deregister(&keyspan_driver); | ||
| 599 | } | ||
| 600 | |||
| 601 | module_init(usb_keyspan_init); | ||
| 602 | module_exit(usb_keyspan_exit); | ||
| 603 | 584 | ||
| 604 | MODULE_DEVICE_TABLE(usb, keyspan_table); | 585 | MODULE_DEVICE_TABLE(usb, keyspan_table); |
| 605 | MODULE_AUTHOR(DRIVER_AUTHOR); | 586 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c index 783597a9a64a..f46139f19ff1 100644 --- a/drivers/input/misc/kxtj9.c +++ b/drivers/input/misc/kxtj9.c | |||
| @@ -41,6 +41,14 @@ | |||
| 41 | #define PC1_ON (1 << 7) | 41 | #define PC1_ON (1 << 7) |
| 42 | /* Data ready funtion enable bit: set during probe if using irq mode */ | 42 | /* Data ready funtion enable bit: set during probe if using irq mode */ |
| 43 | #define DRDYE (1 << 5) | 43 | #define DRDYE (1 << 5) |
| 44 | /* DATA CONTROL REGISTER BITS */ | ||
| 45 | #define ODR12_5F 0 | ||
| 46 | #define ODR25F 1 | ||
| 47 | #define ODR50F 2 | ||
| 48 | #define ODR100F 3 | ||
| 49 | #define ODR200F 4 | ||
| 50 | #define ODR400F 5 | ||
| 51 | #define ODR800F 6 | ||
| 44 | /* INTERRUPT CONTROL REGISTER 1 BITS */ | 52 | /* INTERRUPT CONTROL REGISTER 1 BITS */ |
| 45 | /* Set these during probe if using irq mode */ | 53 | /* Set these during probe if using irq mode */ |
| 46 | #define KXTJ9_IEL (1 << 3) | 54 | #define KXTJ9_IEL (1 << 3) |
| @@ -116,9 +124,13 @@ static void kxtj9_report_acceleration_data(struct kxtj9_data *tj9) | |||
| 116 | if (err < 0) | 124 | if (err < 0) |
| 117 | dev_err(&tj9->client->dev, "accelerometer data read failed\n"); | 125 | dev_err(&tj9->client->dev, "accelerometer data read failed\n"); |
| 118 | 126 | ||
| 119 | x = le16_to_cpu(acc_data[tj9->pdata.axis_map_x]) >> tj9->shift; | 127 | x = le16_to_cpu(acc_data[tj9->pdata.axis_map_x]); |
| 120 | y = le16_to_cpu(acc_data[tj9->pdata.axis_map_y]) >> tj9->shift; | 128 | y = le16_to_cpu(acc_data[tj9->pdata.axis_map_y]); |
| 121 | z = le16_to_cpu(acc_data[tj9->pdata.axis_map_z]) >> tj9->shift; | 129 | z = le16_to_cpu(acc_data[tj9->pdata.axis_map_z]); |
| 130 | |||
| 131 | x >>= tj9->shift; | ||
| 132 | y >>= tj9->shift; | ||
| 133 | z >>= tj9->shift; | ||
| 122 | 134 | ||
| 123 | input_report_abs(tj9->input_dev, ABS_X, tj9->pdata.negate_x ? -x : x); | 135 | input_report_abs(tj9->input_dev, ABS_X, tj9->pdata.negate_x ? -x : x); |
| 124 | input_report_abs(tj9->input_dev, ABS_Y, tj9->pdata.negate_y ? -y : y); | 136 | input_report_abs(tj9->input_dev, ABS_Y, tj9->pdata.negate_y ? -y : y); |
| @@ -487,7 +499,7 @@ static int __devinit kxtj9_verify(struct kxtj9_data *tj9) | |||
| 487 | goto out; | 499 | goto out; |
| 488 | } | 500 | } |
| 489 | 501 | ||
| 490 | retval = retval != 0x06 ? -EIO : 0; | 502 | retval = (retval != 0x07 && retval != 0x08) ? -EIO : 0; |
| 491 | 503 | ||
| 492 | out: | 504 | out: |
| 493 | kxtj9_device_power_off(tj9); | 505 | kxtj9_device_power_off(tj9); |
| @@ -537,7 +549,7 @@ static int __devinit kxtj9_probe(struct i2c_client *client, | |||
| 537 | i2c_set_clientdata(client, tj9); | 549 | i2c_set_clientdata(client, tj9); |
| 538 | 550 | ||
| 539 | tj9->ctrl_reg1 = tj9->pdata.res_12bit | tj9->pdata.g_range; | 551 | tj9->ctrl_reg1 = tj9->pdata.res_12bit | tj9->pdata.g_range; |
| 540 | tj9->data_ctrl = tj9->pdata.data_odr_init; | 552 | tj9->last_poll_interval = tj9->pdata.init_interval; |
| 541 | 553 | ||
| 542 | if (client->irq) { | 554 | if (client->irq) { |
| 543 | /* If in irq mode, populate INT_CTRL_REG1 and enable DRDY. */ | 555 | /* If in irq mode, populate INT_CTRL_REG1 and enable DRDY. */ |
| @@ -655,17 +667,7 @@ static struct i2c_driver kxtj9_driver = { | |||
| 655 | .id_table = kxtj9_id, | 667 | .id_table = kxtj9_id, |
| 656 | }; | 668 | }; |
| 657 | 669 | ||
| 658 | static int __init kxtj9_init(void) | 670 | module_i2c_driver(kxtj9_driver); |
| 659 | { | ||
| 660 | return i2c_add_driver(&kxtj9_driver); | ||
| 661 | } | ||
| 662 | module_init(kxtj9_init); | ||
| 663 | |||
| 664 | static void __exit kxtj9_exit(void) | ||
| 665 | { | ||
| 666 | i2c_del_driver(&kxtj9_driver); | ||
| 667 | } | ||
| 668 | module_exit(kxtj9_exit); | ||
| 669 | 671 | ||
| 670 | MODULE_DESCRIPTION("KXTJ9 accelerometer driver"); | 672 | MODULE_DESCRIPTION("KXTJ9 accelerometer driver"); |
| 671 | MODULE_AUTHOR("Chris Hudson <chudson@kionix.com>"); | 673 | MODULE_AUTHOR("Chris Hudson <chudson@kionix.com>"); |
diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c index 23cf08271049..0a12b74140d3 100644 --- a/drivers/input/misc/max8925_onkey.c +++ b/drivers/input/misc/max8925_onkey.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * max8925_onkey.c - MAX8925 ONKEY driver | 2 | * MAX8925 ONKEY driver |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009 Marvell International Ltd. | 4 | * Copyright (C) 2009 Marvell International Ltd. |
| 5 | * Haojian Zhuang <haojian.zhuang@marvell.com> | 5 | * Haojian Zhuang <haojian.zhuang@marvell.com> |
| @@ -35,7 +35,7 @@ struct max8925_onkey_info { | |||
| 35 | struct input_dev *idev; | 35 | struct input_dev *idev; |
| 36 | struct i2c_client *i2c; | 36 | struct i2c_client *i2c; |
| 37 | struct device *dev; | 37 | struct device *dev; |
| 38 | int irq[2]; | 38 | unsigned int irq[2]; |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | /* | 41 | /* |
| @@ -46,17 +46,14 @@ struct max8925_onkey_info { | |||
| 46 | static irqreturn_t max8925_onkey_handler(int irq, void *data) | 46 | static irqreturn_t max8925_onkey_handler(int irq, void *data) |
| 47 | { | 47 | { |
| 48 | struct max8925_onkey_info *info = data; | 48 | struct max8925_onkey_info *info = data; |
| 49 | int ret, event; | 49 | int state; |
| 50 | 50 | ||
| 51 | ret = max8925_reg_read(info->i2c, MAX8925_ON_OFF_STATUS); | 51 | state = max8925_reg_read(info->i2c, MAX8925_ON_OFF_STATUS); |
| 52 | if (ret & SW_INPUT) | 52 | |
| 53 | event = 1; | 53 | input_report_key(info->idev, KEY_POWER, state & SW_INPUT); |
| 54 | else | ||
| 55 | event = 0; | ||
| 56 | input_report_key(info->idev, KEY_POWER, event); | ||
| 57 | input_sync(info->idev); | 54 | input_sync(info->idev); |
| 58 | 55 | ||
| 59 | dev_dbg(info->dev, "onkey event:%d\n", event); | 56 | dev_dbg(info->dev, "onkey state:%d\n", state); |
| 60 | 57 | ||
| 61 | /* Enable hardreset to halt if system isn't shutdown on time */ | 58 | /* Enable hardreset to halt if system isn't shutdown on time */ |
| 62 | max8925_set_bits(info->i2c, MAX8925_SYSENSEL, | 59 | max8925_set_bits(info->i2c, MAX8925_SYSENSEL, |
| @@ -69,6 +66,7 @@ static int __devinit max8925_onkey_probe(struct platform_device *pdev) | |||
| 69 | { | 66 | { |
| 70 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 67 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
| 71 | struct max8925_onkey_info *info; | 68 | struct max8925_onkey_info *info; |
| 69 | struct input_dev *input; | ||
| 72 | int irq[2], error; | 70 | int irq[2], error; |
| 73 | 71 | ||
| 74 | irq[0] = platform_get_irq(pdev, 0); | 72 | irq[0] = platform_get_irq(pdev, 0); |
| @@ -76,6 +74,7 @@ static int __devinit max8925_onkey_probe(struct platform_device *pdev) | |||
| 76 | dev_err(&pdev->dev, "No IRQ resource!\n"); | 74 | dev_err(&pdev->dev, "No IRQ resource!\n"); |
| 77 | return -EINVAL; | 75 | return -EINVAL; |
| 78 | } | 76 | } |
| 77 | |||
| 79 | irq[1] = platform_get_irq(pdev, 1); | 78 | irq[1] = platform_get_irq(pdev, 1); |
| 80 | if (irq[1] < 0) { | 79 | if (irq[1] < 0) { |
| 81 | dev_err(&pdev->dev, "No IRQ resource!\n"); | 80 | dev_err(&pdev->dev, "No IRQ resource!\n"); |
| @@ -83,11 +82,24 @@ static int __devinit max8925_onkey_probe(struct platform_device *pdev) | |||
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | info = kzalloc(sizeof(struct max8925_onkey_info), GFP_KERNEL); | 84 | info = kzalloc(sizeof(struct max8925_onkey_info), GFP_KERNEL); |
| 86 | if (!info) | 85 | input = input_allocate_device(); |
| 87 | return -ENOMEM; | 86 | if (!info || !input) { |
| 87 | error = -ENOMEM; | ||
| 88 | goto err_free_mem; | ||
| 89 | } | ||
| 88 | 90 | ||
| 91 | info->idev = input; | ||
| 89 | info->i2c = chip->i2c; | 92 | info->i2c = chip->i2c; |
| 90 | info->dev = &pdev->dev; | 93 | info->dev = &pdev->dev; |
| 94 | info->irq[0] = irq[0]; | ||
| 95 | info->irq[1] = irq[1]; | ||
| 96 | |||
| 97 | input->name = "max8925_on"; | ||
| 98 | input->phys = "max8925_on/input0"; | ||
| 99 | input->id.bustype = BUS_I2C; | ||
| 100 | input->dev.parent = &pdev->dev; | ||
| 101 | input_set_capability(input, EV_KEY, KEY_POWER); | ||
| 102 | |||
| 91 | irq[0] += chip->irq_base; | 103 | irq[0] += chip->irq_base; |
| 92 | irq[1] += chip->irq_base; | 104 | irq[1] += chip->irq_base; |
| 93 | 105 | ||
| @@ -96,60 +108,46 @@ static int __devinit max8925_onkey_probe(struct platform_device *pdev) | |||
| 96 | if (error < 0) { | 108 | if (error < 0) { |
| 97 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", | 109 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", |
| 98 | irq[0], error); | 110 | irq[0], error); |
| 99 | goto out; | 111 | goto err_free_mem; |
| 100 | } | 112 | } |
| 113 | |||
| 101 | error = request_threaded_irq(irq[1], NULL, max8925_onkey_handler, | 114 | error = request_threaded_irq(irq[1], NULL, max8925_onkey_handler, |
| 102 | IRQF_ONESHOT, "onkey-up", info); | 115 | IRQF_ONESHOT, "onkey-up", info); |
| 103 | if (error < 0) { | 116 | if (error < 0) { |
| 104 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", | 117 | dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n", |
| 105 | irq[1], error); | 118 | irq[1], error); |
| 106 | goto out_irq; | 119 | goto err_free_irq0; |
| 107 | } | 120 | } |
| 108 | 121 | ||
| 109 | info->idev = input_allocate_device(); | ||
| 110 | if (!info->idev) { | ||
| 111 | dev_err(chip->dev, "Failed to allocate input dev\n"); | ||
| 112 | error = -ENOMEM; | ||
| 113 | goto out_input; | ||
| 114 | } | ||
| 115 | |||
| 116 | info->idev->name = "max8925_on"; | ||
| 117 | info->idev->phys = "max8925_on/input0"; | ||
| 118 | info->idev->id.bustype = BUS_I2C; | ||
| 119 | info->idev->dev.parent = &pdev->dev; | ||
| 120 | info->irq[0] = irq[0]; | ||
| 121 | info->irq[1] = irq[1]; | ||
| 122 | info->idev->evbit[0] = BIT_MASK(EV_KEY); | ||
| 123 | info->idev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER); | ||
| 124 | |||
| 125 | |||
| 126 | error = input_register_device(info->idev); | 122 | error = input_register_device(info->idev); |
| 127 | if (error) { | 123 | if (error) { |
| 128 | dev_err(chip->dev, "Can't register input device: %d\n", error); | 124 | dev_err(chip->dev, "Can't register input device: %d\n", error); |
| 129 | goto out_reg; | 125 | goto err_free_irq1; |
| 130 | } | 126 | } |
| 131 | 127 | ||
| 132 | platform_set_drvdata(pdev, info); | 128 | platform_set_drvdata(pdev, info); |
| 129 | device_init_wakeup(&pdev->dev, 1); | ||
| 133 | 130 | ||
| 134 | return 0; | 131 | return 0; |
| 135 | 132 | ||
| 136 | out_reg: | 133 | err_free_irq1: |
| 137 | input_free_device(info->idev); | 134 | free_irq(irq[1], info); |
| 138 | out_input: | 135 | err_free_irq0: |
| 139 | free_irq(info->irq[1], info); | 136 | free_irq(irq[0], info); |
| 140 | out_irq: | 137 | err_free_mem: |
| 141 | free_irq(info->irq[0], info); | 138 | input_free_device(input); |
| 142 | out: | ||
| 143 | kfree(info); | 139 | kfree(info); |
| 140 | |||
| 144 | return error; | 141 | return error; |
| 145 | } | 142 | } |
| 146 | 143 | ||
| 147 | static int __devexit max8925_onkey_remove(struct platform_device *pdev) | 144 | static int __devexit max8925_onkey_remove(struct platform_device *pdev) |
| 148 | { | 145 | { |
| 149 | struct max8925_onkey_info *info = platform_get_drvdata(pdev); | 146 | struct max8925_onkey_info *info = platform_get_drvdata(pdev); |
| 147 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
| 150 | 148 | ||
| 151 | free_irq(info->irq[0], info); | 149 | free_irq(info->irq[0] + chip->irq_base, info); |
| 152 | free_irq(info->irq[1], info); | 150 | free_irq(info->irq[1] + chip->irq_base, info); |
| 153 | input_unregister_device(info->idev); | 151 | input_unregister_device(info->idev); |
| 154 | kfree(info); | 152 | kfree(info); |
| 155 | 153 | ||
| @@ -158,10 +156,43 @@ static int __devexit max8925_onkey_remove(struct platform_device *pdev) | |||
| 158 | return 0; | 156 | return 0; |
| 159 | } | 157 | } |
| 160 | 158 | ||
| 159 | #ifdef CONFIG_PM_SLEEP | ||
| 160 | static int max8925_onkey_suspend(struct device *dev) | ||
| 161 | { | ||
| 162 | struct platform_device *pdev = to_platform_device(dev); | ||
| 163 | struct max8925_onkey_info *info = platform_get_drvdata(pdev); | ||
| 164 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
| 165 | |||
| 166 | if (device_may_wakeup(dev)) { | ||
| 167 | chip->wakeup_flag |= 1 << info->irq[0]; | ||
| 168 | chip->wakeup_flag |= 1 << info->irq[1]; | ||
| 169 | } | ||
| 170 | |||
| 171 | return 0; | ||
| 172 | } | ||
| 173 | |||
| 174 | static int max8925_onkey_resume(struct device *dev) | ||
| 175 | { | ||
| 176 | struct platform_device *pdev = to_platform_device(dev); | ||
| 177 | struct max8925_onkey_info *info = platform_get_drvdata(pdev); | ||
| 178 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
| 179 | |||
| 180 | if (device_may_wakeup(dev)) { | ||
| 181 | chip->wakeup_flag &= ~(1 << info->irq[0]); | ||
| 182 | chip->wakeup_flag &= ~(1 << info->irq[1]); | ||
| 183 | } | ||
| 184 | |||
| 185 | return 0; | ||
| 186 | } | ||
| 187 | #endif | ||
| 188 | |||
| 189 | static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume); | ||
| 190 | |||
| 161 | static struct platform_driver max8925_onkey_driver = { | 191 | static struct platform_driver max8925_onkey_driver = { |
| 162 | .driver = { | 192 | .driver = { |
| 163 | .name = "max8925-onkey", | 193 | .name = "max8925-onkey", |
| 164 | .owner = THIS_MODULE, | 194 | .owner = THIS_MODULE, |
| 195 | .pm = &max8925_onkey_pm_ops, | ||
| 165 | }, | 196 | }, |
| 166 | .probe = max8925_onkey_probe, | 197 | .probe = max8925_onkey_probe, |
| 167 | .remove = __devexit_p(max8925_onkey_remove), | 198 | .remove = __devexit_p(max8925_onkey_remove), |
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c new file mode 100644 index 000000000000..05b7b8bfaf0a --- /dev/null +++ b/drivers/input/misc/max8997_haptic.c | |||
| @@ -0,0 +1,407 @@ | |||
| 1 | /* | ||
| 2 | * MAX8997-haptic controller driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Samsung Electronics | ||
| 5 | * Donggeun Kim <dg77.kim@samsung.com> | ||
| 6 | * | ||
| 7 | * This program is not provided / owned by Maxim Integrated Products. | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include <linux/module.h> | ||
| 26 | #include <linux/init.h> | ||
| 27 | #include <linux/slab.h> | ||
| 28 | #include <linux/platform_device.h> | ||
| 29 | #include <linux/err.h> | ||
| 30 | #include <linux/pwm.h> | ||
| 31 | #include <linux/input.h> | ||
| 32 | #include <linux/mfd/max8997-private.h> | ||
| 33 | #include <linux/mfd/max8997.h> | ||
| 34 | #include <linux/regulator/consumer.h> | ||
| 35 | |||
| 36 | /* Haptic configuration 2 register */ | ||
| 37 | #define MAX8997_MOTOR_TYPE_SHIFT 7 | ||
| 38 | #define MAX8997_ENABLE_SHIFT 6 | ||
| 39 | #define MAX8997_MODE_SHIFT 5 | ||
| 40 | |||
| 41 | /* Haptic driver configuration register */ | ||
| 42 | #define MAX8997_CYCLE_SHIFT 6 | ||
| 43 | #define MAX8997_SIG_PERIOD_SHIFT 4 | ||
| 44 | #define MAX8997_SIG_DUTY_SHIFT 2 | ||
| 45 | #define MAX8997_PWM_DUTY_SHIFT 0 | ||
| 46 | |||
| 47 | struct max8997_haptic { | ||
| 48 | struct device *dev; | ||
| 49 | struct i2c_client *client; | ||
| 50 | struct input_dev *input_dev; | ||
| 51 | struct regulator *regulator; | ||
| 52 | |||
| 53 | struct work_struct work; | ||
| 54 | struct mutex mutex; | ||
| 55 | |||
| 56 | bool enabled; | ||
| 57 | unsigned int level; | ||
| 58 | |||
| 59 | struct pwm_device *pwm; | ||
| 60 | unsigned int pwm_period; | ||
| 61 | enum max8997_haptic_pwm_divisor pwm_divisor; | ||
| 62 | |||
| 63 | enum max8997_haptic_motor_type type; | ||
| 64 | enum max8997_haptic_pulse_mode mode; | ||
| 65 | |||
| 66 | unsigned int internal_mode_pattern; | ||
| 67 | unsigned int pattern_cycle; | ||
| 68 | unsigned int pattern_signal_period; | ||
| 69 | }; | ||
| 70 | |||
| 71 | static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip) | ||
| 72 | { | ||
| 73 | int ret = 0; | ||
| 74 | |||
| 75 | if (chip->mode == MAX8997_EXTERNAL_MODE) { | ||
| 76 | unsigned int duty = chip->pwm_period * chip->level / 100; | ||
| 77 | ret = pwm_config(chip->pwm, duty, chip->pwm_period); | ||
| 78 | } else { | ||
| 79 | int i; | ||
| 80 | u8 duty_index = 0; | ||
| 81 | |||
| 82 | for (i = 0; i <= 64; i++) { | ||
| 83 | if (chip->level <= i * 100 / 64) { | ||
| 84 | duty_index = i; | ||
| 85 | break; | ||
| 86 | } | ||
| 87 | } | ||
| 88 | switch (chip->internal_mode_pattern) { | ||
| 89 | case 0: | ||
| 90 | max8997_write_reg(chip->client, | ||
| 91 | MAX8997_HAPTIC_REG_SIGPWMDC1, duty_index); | ||
| 92 | break; | ||
| 93 | case 1: | ||
| 94 | max8997_write_reg(chip->client, | ||
| 95 | MAX8997_HAPTIC_REG_SIGPWMDC2, duty_index); | ||
| 96 | break; | ||
| 97 | case 2: | ||
| 98 | max8997_write_reg(chip->client, | ||
| 99 | MAX8997_HAPTIC_REG_SIGPWMDC3, duty_index); | ||
| 100 | break; | ||
| 101 | case 3: | ||
| 102 | max8997_write_reg(chip->client, | ||
| 103 | MAX8997_HAPTIC_REG_SIGPWMDC4, duty_index); | ||
| 104 | break; | ||
| 105 | default: | ||
| 106 | break; | ||
| 107 | } | ||
| 108 | } | ||
| 109 | return ret; | ||
| 110 | } | ||
| 111 | |||
| 112 | static void max8997_haptic_configure(struct max8997_haptic *chip) | ||
| 113 | { | ||
| 114 | u8 value; | ||
| 115 | |||
| 116 | value = chip->type << MAX8997_MOTOR_TYPE_SHIFT | | ||
| 117 | chip->enabled << MAX8997_ENABLE_SHIFT | | ||
| 118 | chip->mode << MAX8997_MODE_SHIFT | chip->pwm_divisor; | ||
| 119 | max8997_write_reg(chip->client, MAX8997_HAPTIC_REG_CONF2, value); | ||
| 120 | |||
| 121 | if (chip->mode == MAX8997_INTERNAL_MODE && chip->enabled) { | ||
| 122 | value = chip->internal_mode_pattern << MAX8997_CYCLE_SHIFT | | ||
| 123 | chip->internal_mode_pattern << MAX8997_SIG_PERIOD_SHIFT | | ||
| 124 | chip->internal_mode_pattern << MAX8997_SIG_DUTY_SHIFT | | ||
| 125 | chip->internal_mode_pattern << MAX8997_PWM_DUTY_SHIFT; | ||
| 126 | max8997_write_reg(chip->client, | ||
| 127 | MAX8997_HAPTIC_REG_DRVCONF, value); | ||
| 128 | |||
| 129 | switch (chip->internal_mode_pattern) { | ||
| 130 | case 0: | ||
| 131 | value = chip->pattern_cycle << 4; | ||
| 132 | max8997_write_reg(chip->client, | ||
| 133 | MAX8997_HAPTIC_REG_CYCLECONF1, value); | ||
| 134 | value = chip->pattern_signal_period; | ||
| 135 | max8997_write_reg(chip->client, | ||
| 136 | MAX8997_HAPTIC_REG_SIGCONF1, value); | ||
| 137 | break; | ||
| 138 | |||
| 139 | case 1: | ||
| 140 | value = chip->pattern_cycle; | ||
| 141 | max8997_write_reg(chip->client, | ||
| 142 | MAX8997_HAPTIC_REG_CYCLECONF1, value); | ||
| 143 | value = chip->pattern_signal_period; | ||
| 144 | max8997_write_reg(chip->client, | ||
| 145 | MAX8997_HAPTIC_REG_SIGCONF2, value); | ||
| 146 | break; | ||
| 147 | |||
| 148 | case 2: | ||
| 149 | value = chip->pattern_cycle << 4; | ||
| 150 | max8997_write_reg(chip->client, | ||
| 151 | MAX8997_HAPTIC_REG_CYCLECONF2, value); | ||
| 152 | value = chip->pattern_signal_period; | ||
| 153 | max8997_write_reg(chip->client, | ||
| 154 | MAX8997_HAPTIC_REG_SIGCONF3, value); | ||
| 155 | break; | ||
| 156 | |||
| 157 | case 3: | ||
| 158 | value = chip->pattern_cycle; | ||
| 159 | max8997_write_reg(chip->client, | ||
| 160 | MAX8997_HAPTIC_REG_CYCLECONF2, value); | ||
| 161 | value = chip->pattern_signal_period; | ||
| 162 | max8997_write_reg(chip->client, | ||
| 163 | MAX8997_HAPTIC_REG_SIGCONF4, value); | ||
| 164 | break; | ||
| 165 | |||
| 166 | default: | ||
| 167 | break; | ||
| 168 | } | ||
| 169 | } | ||
| 170 | } | ||
| 171 | |||
| 172 | static void max8997_haptic_enable(struct max8997_haptic *chip) | ||
| 173 | { | ||
| 174 | int error; | ||
| 175 | |||
| 176 | mutex_lock(&chip->mutex); | ||
| 177 | |||
| 178 | error = max8997_haptic_set_duty_cycle(chip); | ||
| 179 | if (error) { | ||
| 180 | dev_err(chip->dev, "set_pwm_cycle failed, error: %d\n", error); | ||
| 181 | goto out; | ||
| 182 | } | ||
| 183 | |||
| 184 | if (!chip->enabled) { | ||
| 185 | chip->enabled = true; | ||
| 186 | regulator_enable(chip->regulator); | ||
| 187 | max8997_haptic_configure(chip); | ||
| 188 | if (chip->mode == MAX8997_EXTERNAL_MODE) | ||
| 189 | pwm_enable(chip->pwm); | ||
| 190 | } | ||
| 191 | |||
| 192 | out: | ||
| 193 | mutex_unlock(&chip->mutex); | ||
| 194 | } | ||
| 195 | |||
| 196 | static void max8997_haptic_disable(struct max8997_haptic *chip) | ||
| 197 | { | ||
| 198 | mutex_lock(&chip->mutex); | ||
| 199 | |||
| 200 | if (chip->enabled) { | ||
| 201 | chip->enabled = false; | ||
| 202 | max8997_haptic_configure(chip); | ||
| 203 | if (chip->mode == MAX8997_EXTERNAL_MODE) | ||
| 204 | pwm_disable(chip->pwm); | ||
| 205 | regulator_disable(chip->regulator); | ||
| 206 | } | ||
| 207 | |||
| 208 | mutex_unlock(&chip->mutex); | ||
| 209 | } | ||
| 210 | |||
| 211 | static void max8997_haptic_play_effect_work(struct work_struct *work) | ||
| 212 | { | ||
| 213 | struct max8997_haptic *chip = | ||
| 214 | container_of(work, struct max8997_haptic, work); | ||
| 215 | |||
| 216 | if (chip->level) | ||
| 217 | max8997_haptic_enable(chip); | ||
| 218 | else | ||
| 219 | max8997_haptic_disable(chip); | ||
| 220 | } | ||
| 221 | |||
| 222 | static int max8997_haptic_play_effect(struct input_dev *dev, void *data, | ||
| 223 | struct ff_effect *effect) | ||
| 224 | { | ||
| 225 | struct max8997_haptic *chip = input_get_drvdata(dev); | ||
| 226 | |||
| 227 | chip->level = effect->u.rumble.strong_magnitude; | ||
| 228 | if (!chip->level) | ||
| 229 | chip->level = effect->u.rumble.weak_magnitude; | ||
| 230 | |||
| 231 | schedule_work(&chip->work); | ||
| 232 | |||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | |||
| 236 | static void max8997_haptic_close(struct input_dev *dev) | ||
| 237 | { | ||
| 238 | struct max8997_haptic *chip = input_get_drvdata(dev); | ||
| 239 | |||
| 240 | cancel_work_sync(&chip->work); | ||
| 241 | max8997_haptic_disable(chip); | ||
| 242 | } | ||
| 243 | |||
| 244 | static int __devinit max8997_haptic_probe(struct platform_device *pdev) | ||
| 245 | { | ||
| 246 | struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); | ||
| 247 | const struct max8997_platform_data *pdata = | ||
| 248 | dev_get_platdata(iodev->dev); | ||
| 249 | const struct max8997_haptic_platform_data *haptic_pdata = | ||
| 250 | pdata->haptic_pdata; | ||
| 251 | struct max8997_haptic *chip; | ||
| 252 | struct input_dev *input_dev; | ||
| 253 | int error; | ||
| 254 | |||
| 255 | if (!haptic_pdata) { | ||
| 256 | dev_err(&pdev->dev, "no haptic platform data\n"); | ||
| 257 | return -EINVAL; | ||
| 258 | } | ||
| 259 | |||
| 260 | chip = kzalloc(sizeof(struct max8997_haptic), GFP_KERNEL); | ||
| 261 | input_dev = input_allocate_device(); | ||
| 262 | if (!chip || !input_dev) { | ||
| 263 | dev_err(&pdev->dev, "unable to allocate memory\n"); | ||
| 264 | error = -ENOMEM; | ||
| 265 | goto err_free_mem; | ||
| 266 | } | ||
| 267 | |||
| 268 | INIT_WORK(&chip->work, max8997_haptic_play_effect_work); | ||
| 269 | mutex_init(&chip->mutex); | ||
| 270 | |||
| 271 | chip->client = iodev->haptic; | ||
| 272 | chip->dev = &pdev->dev; | ||
| 273 | chip->input_dev = input_dev; | ||
| 274 | chip->pwm_period = haptic_pdata->pwm_period; | ||
| 275 | chip->type = haptic_pdata->type; | ||
| 276 | chip->mode = haptic_pdata->mode; | ||
| 277 | chip->pwm_divisor = haptic_pdata->pwm_divisor; | ||
| 278 | |||
| 279 | switch (chip->mode) { | ||
| 280 | case MAX8997_INTERNAL_MODE: | ||
| 281 | chip->internal_mode_pattern = | ||
| 282 | haptic_pdata->internal_mode_pattern; | ||
| 283 | chip->pattern_cycle = haptic_pdata->pattern_cycle; | ||
| 284 | chip->pattern_signal_period = | ||
| 285 | haptic_pdata->pattern_signal_period; | ||
| 286 | break; | ||
| 287 | |||
| 288 | case MAX8997_EXTERNAL_MODE: | ||
| 289 | chip->pwm = pwm_request(haptic_pdata->pwm_channel_id, | ||
| 290 | "max8997-haptic"); | ||
| 291 | if (IS_ERR(chip->pwm)) { | ||
| 292 | error = PTR_ERR(chip->pwm); | ||
| 293 | dev_err(&pdev->dev, | ||
| 294 | "unable to request PWM for haptic, error: %d\n", | ||
| 295 | error); | ||
| 296 | goto err_free_mem; | ||
| 297 | } | ||
| 298 | break; | ||
| 299 | |||
| 300 | default: | ||
| 301 | dev_err(&pdev->dev, | ||
| 302 | "Invalid chip mode specified (%d)\n", chip->mode); | ||
| 303 | error = -EINVAL; | ||
| 304 | goto err_free_mem; | ||
| 305 | } | ||
| 306 | |||
| 307 | chip->regulator = regulator_get(&pdev->dev, "inmotor"); | ||
| 308 | if (IS_ERR(chip->regulator)) { | ||
| 309 | error = PTR_ERR(chip->regulator); | ||
| 310 | dev_err(&pdev->dev, | ||
| 311 | "unable to get regulator, error: %d\n", | ||
| 312 | error); | ||
| 313 | goto err_free_pwm; | ||
| 314 | } | ||
| 315 | |||
| 316 | input_dev->name = "max8997-haptic"; | ||
| 317 | input_dev->id.version = 1; | ||
| 318 | input_dev->dev.parent = &pdev->dev; | ||
| 319 | input_dev->close = max8997_haptic_close; | ||
| 320 | input_set_drvdata(input_dev, chip); | ||
| 321 | input_set_capability(input_dev, EV_FF, FF_RUMBLE); | ||
| 322 | |||
| 323 | error = input_ff_create_memless(input_dev, NULL, | ||
| 324 | max8997_haptic_play_effect); | ||
| 325 | if (error) { | ||
| 326 | dev_err(&pdev->dev, | ||
| 327 | "unable to create FF device, error: %d\n", | ||
| 328 | error); | ||
| 329 | goto err_put_regulator; | ||
| 330 | } | ||
| 331 | |||
| 332 | error = input_register_device(input_dev); | ||
| 333 | if (error) { | ||
| 334 | dev_err(&pdev->dev, | ||
| 335 | "unable to register input device, error: %d\n", | ||
| 336 | error); | ||
| 337 | goto err_destroy_ff; | ||
| 338 | } | ||
| 339 | |||
| 340 | platform_set_drvdata(pdev, chip); | ||
| 341 | return 0; | ||
| 342 | |||
| 343 | err_destroy_ff: | ||
| 344 | input_ff_destroy(input_dev); | ||
| 345 | err_put_regulator: | ||
| 346 | regulator_put(chip->regulator); | ||
| 347 | err_free_pwm: | ||
| 348 | if (chip->mode == MAX8997_EXTERNAL_MODE) | ||
| 349 | pwm_free(chip->pwm); | ||
| 350 | err_free_mem: | ||
| 351 | input_free_device(input_dev); | ||
| 352 | kfree(chip); | ||
| 353 | |||
| 354 | return error; | ||
| 355 | } | ||
| 356 | |||
| 357 | static int __devexit max8997_haptic_remove(struct platform_device *pdev) | ||
| 358 | { | ||
| 359 | struct max8997_haptic *chip = platform_get_drvdata(pdev); | ||
| 360 | |||
| 361 | input_unregister_device(chip->input_dev); | ||
| 362 | regulator_put(chip->regulator); | ||
| 363 | |||
| 364 | if (chip->mode == MAX8997_EXTERNAL_MODE) | ||
| 365 | pwm_free(chip->pwm); | ||
| 366 | |||
| 367 | kfree(chip); | ||
| 368 | |||
| 369 | return 0; | ||
| 370 | } | ||
| 371 | |||
| 372 | #ifdef CONFIG_PM_SLEEP | ||
| 373 | static int max8997_haptic_suspend(struct device *dev) | ||
| 374 | { | ||
| 375 | struct platform_device *pdev = to_platform_device(dev); | ||
| 376 | struct max8997_haptic *chip = platform_get_drvdata(pdev); | ||
| 377 | |||
| 378 | max8997_haptic_disable(chip); | ||
| 379 | |||
| 380 | return 0; | ||
| 381 | } | ||
| 382 | #endif | ||
| 383 | |||
| 384 | static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL); | ||
| 385 | |||
| 386 | static const struct platform_device_id max8997_haptic_id[] = { | ||
| 387 | { "max8997-haptic", 0 }, | ||
| 388 | { }, | ||
| 389 | }; | ||
| 390 | MODULE_DEVICE_TABLE(i2c, max8997_haptic_id); | ||
| 391 | |||
| 392 | static struct platform_driver max8997_haptic_driver = { | ||
| 393 | .driver = { | ||
| 394 | .name = "max8997-haptic", | ||
| 395 | .owner = THIS_MODULE, | ||
| 396 | .pm = &max8997_haptic_pm_ops, | ||
| 397 | }, | ||
| 398 | .probe = max8997_haptic_probe, | ||
| 399 | .remove = __devexit_p(max8997_haptic_remove), | ||
| 400 | .id_table = max8997_haptic_id, | ||
| 401 | }; | ||
| 402 | module_platform_driver(max8997_haptic_driver); | ||
| 403 | |||
| 404 | MODULE_ALIAS("platform:max8997-haptic"); | ||
| 405 | MODULE_AUTHOR("Donggeun Kim <dg77.kim@samsung.com>"); | ||
| 406 | MODULE_DESCRIPTION("max8997_haptic driver"); | ||
| 407 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c index 4d60080bb5d5..873ebced544e 100644 --- a/drivers/input/misc/mma8450.c +++ b/drivers/input/misc/mma8450.c | |||
| @@ -247,17 +247,7 @@ static struct i2c_driver mma8450_driver = { | |||
| 247 | .id_table = mma8450_id, | 247 | .id_table = mma8450_id, |
| 248 | }; | 248 | }; |
| 249 | 249 | ||
| 250 | static int __init mma8450_init(void) | 250 | module_i2c_driver(mma8450_driver); |
| 251 | { | ||
| 252 | return i2c_add_driver(&mma8450_driver); | ||
| 253 | } | ||
| 254 | module_init(mma8450_init); | ||
| 255 | |||
| 256 | static void __exit mma8450_exit(void) | ||
| 257 | { | ||
| 258 | i2c_del_driver(&mma8450_driver); | ||
| 259 | } | ||
| 260 | module_exit(mma8450_exit); | ||
| 261 | 251 | ||
| 262 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); | 252 | MODULE_AUTHOR("Freescale Semiconductor, Inc."); |
| 263 | MODULE_DESCRIPTION("MMA8450 3-Axis Accelerometer Driver"); | 253 | MODULE_DESCRIPTION("MMA8450 3-Axis Accelerometer Driver"); |
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c index 208d1a1cc7f3..5403c571b6a5 100644 --- a/drivers/input/misc/mpu3050.c +++ b/drivers/input/misc/mpu3050.c | |||
| @@ -475,17 +475,7 @@ static struct i2c_driver mpu3050_i2c_driver = { | |||
| 475 | .id_table = mpu3050_ids, | 475 | .id_table = mpu3050_ids, |
| 476 | }; | 476 | }; |
| 477 | 477 | ||
| 478 | static int __init mpu3050_init(void) | 478 | module_i2c_driver(mpu3050_i2c_driver); |
| 479 | { | ||
| 480 | return i2c_add_driver(&mpu3050_i2c_driver); | ||
| 481 | } | ||
| 482 | module_init(mpu3050_init); | ||
| 483 | |||
| 484 | static void __exit mpu3050_exit(void) | ||
| 485 | { | ||
| 486 | i2c_del_driver(&mpu3050_i2c_driver); | ||
| 487 | } | ||
| 488 | module_exit(mpu3050_exit); | ||
| 489 | 479 | ||
| 490 | MODULE_AUTHOR("Wistron Corp."); | 480 | MODULE_AUTHOR("Wistron Corp."); |
| 491 | MODULE_DESCRIPTION("MPU3050 Tri-axis gyroscope driver"); | 481 | MODULE_DESCRIPTION("MPU3050 Tri-axis gyroscope driver"); |
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index 08be1a355956..544c6635abe9 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c | |||
| @@ -216,17 +216,7 @@ static struct i2c_driver pcf8574_kp_driver = { | |||
| 216 | .id_table = pcf8574_kp_id, | 216 | .id_table = pcf8574_kp_id, |
| 217 | }; | 217 | }; |
| 218 | 218 | ||
| 219 | static int __init pcf8574_kp_init(void) | 219 | module_i2c_driver(pcf8574_kp_driver); |
| 220 | { | ||
| 221 | return i2c_add_driver(&pcf8574_kp_driver); | ||
| 222 | } | ||
| 223 | module_init(pcf8574_kp_init); | ||
| 224 | |||
| 225 | static void __exit pcf8574_kp_exit(void) | ||
| 226 | { | ||
| 227 | i2c_del_driver(&pcf8574_kp_driver); | ||
| 228 | } | ||
| 229 | module_exit(pcf8574_kp_exit); | ||
| 230 | 220 | ||
| 231 | MODULE_AUTHOR("Michael Hennerich"); | 221 | MODULE_AUTHOR("Michael Hennerich"); |
| 232 | MODULE_DESCRIPTION("Keypad input driver for 16 keys connected to PCF8574"); | 222 | MODULE_DESCRIPTION("Keypad input driver for 16 keys connected to PCF8574"); |
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index f45947190e4f..538f7049ec64 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c | |||
| @@ -441,18 +441,7 @@ static struct usb_driver powermate_driver = { | |||
| 441 | .id_table = powermate_devices, | 441 | .id_table = powermate_devices, |
| 442 | }; | 442 | }; |
| 443 | 443 | ||
| 444 | static int __init powermate_init(void) | 444 | module_usb_driver(powermate_driver); |
| 445 | { | ||
| 446 | return usb_register(&powermate_driver); | ||
| 447 | } | ||
| 448 | |||
| 449 | static void __exit powermate_cleanup(void) | ||
| 450 | { | ||
| 451 | usb_deregister(&powermate_driver); | ||
| 452 | } | ||
| 453 | |||
| 454 | module_init(powermate_init); | ||
| 455 | module_exit(powermate_cleanup); | ||
| 456 | 445 | ||
| 457 | MODULE_AUTHOR( "William R Sowerbutts" ); | 446 | MODULE_AUTHOR( "William R Sowerbutts" ); |
| 458 | MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" ); | 447 | MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" ); |
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 52b419348983..e2bdfd4bea70 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
| @@ -48,7 +48,7 @@ MODULE_DESCRIPTION("Wistron laptop button driver"); | |||
| 48 | MODULE_LICENSE("GPL v2"); | 48 | MODULE_LICENSE("GPL v2"); |
| 49 | MODULE_VERSION("0.3"); | 49 | MODULE_VERSION("0.3"); |
| 50 | 50 | ||
| 51 | static int force; /* = 0; */ | 51 | static bool force; /* = 0; */ |
| 52 | module_param(force, bool, 0); | 52 | module_param(force, bool, 0); |
| 53 | MODULE_PARM_DESC(force, "Load even if computer is not in database"); | 53 | MODULE_PARM_DESC(force, "Load even if computer is not in database"); |
| 54 | 54 | ||
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index ad2e51c04db8..02ca8680ea5b 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c | |||
| @@ -361,15 +361,12 @@ static const struct xenbus_device_id xenkbd_ids[] = { | |||
| 361 | { "" } | 361 | { "" } |
| 362 | }; | 362 | }; |
| 363 | 363 | ||
| 364 | static struct xenbus_driver xenkbd_driver = { | 364 | static DEFINE_XENBUS_DRIVER(xenkbd, , |
| 365 | .name = "vkbd", | ||
| 366 | .owner = THIS_MODULE, | ||
| 367 | .ids = xenkbd_ids, | ||
| 368 | .probe = xenkbd_probe, | 365 | .probe = xenkbd_probe, |
| 369 | .remove = xenkbd_remove, | 366 | .remove = xenkbd_remove, |
| 370 | .resume = xenkbd_resume, | 367 | .resume = xenkbd_resume, |
| 371 | .otherend_changed = xenkbd_backend_changed, | 368 | .otherend_changed = xenkbd_backend_changed, |
| 372 | }; | 369 | ); |
| 373 | 370 | ||
| 374 | static int __init xenkbd_init(void) | 371 | static int __init xenkbd_init(void) |
| 375 | { | 372 | { |
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 41201c6b5e68..f4776e7f8c15 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c | |||
| @@ -988,22 +988,7 @@ static struct usb_driver yealink_driver = { | |||
| 988 | .id_table = usb_table, | 988 | .id_table = usb_table, |
| 989 | }; | 989 | }; |
| 990 | 990 | ||
| 991 | static int __init yealink_dev_init(void) | 991 | module_usb_driver(yealink_driver); |
| 992 | { | ||
| 993 | int ret = usb_register(&yealink_driver); | ||
| 994 | if (ret == 0) | ||
| 995 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
| 996 | DRIVER_DESC "\n"); | ||
| 997 | return ret; | ||
| 998 | } | ||
| 999 | |||
| 1000 | static void __exit yealink_dev_exit(void) | ||
| 1001 | { | ||
| 1002 | usb_deregister(&yealink_driver); | ||
| 1003 | } | ||
| 1004 | |||
| 1005 | module_init(yealink_dev_init); | ||
| 1006 | module_exit(yealink_dev_exit); | ||
| 1007 | 992 | ||
| 1008 | MODULE_DEVICE_TABLE (usb, usb_table); | 993 | MODULE_DEVICE_TABLE (usb, usb_table); |
| 1009 | 994 | ||
