Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input subsystem updates from Dmitry Torokhov:
"Just a swath of driver fixes and cleanups, no new drivers this time
(although ALPS now supports one of the newer protocols, more to come)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits)
Input: wacom - add support for DTU-1031
Input: wacom - fix wacom->shared guards for dual input devices
Input: edt_ft5x06 - use devm_* functions where appropriate
Input: hyperv-keyboard - pass through 0xE1 prefix
Input: logips2pp - fix spelling s/reciver/receiver/
Input: delete non-required instances of include <linux/init.h>
Input: twl4030-keypad - convert to using managed resources
Input: twl6040-vibra - remove unneeded check for CONFIG_OF
Input: twl4030-keypad - add device tree support
Input: twl6040-vibra - add missing of_node_put
Input: twl4030-vibra - add missing of_node_put
Input: i8042 - cleanup SERIO_I8042 dependencies
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on x86
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on unicore32
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on sparc
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO for SH_CAYMAN
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on powerpc
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on mips
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on IA64
Input: i8042 - select ARCH_MIGHT_HAVE_PC_SERIO on ARM/Footbridge
...

+1248 -771
+13
Documentation/devicetree/bindings/input/gpio-beeper.txt
··· 1 + * GPIO beeper device tree bindings 2 + 3 + Register a beeper connected to GPIO pin. 4 + 5 + Required properties: 6 + - compatible: Should be "gpio-beeper". 7 + - gpios: From common gpio binding; gpio connection to beeper enable pin. 8 + 9 + Example: 10 + beeper: beeper { 11 + compatible = "gpio-beeper"; 12 + gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; 13 + };
+41
Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
··· 1 + * Texas Instruments tsc2007 touchscreen controller 2 + 3 + Required properties: 4 + - compatible: must be "ti,tsc2007". 5 + - reg: I2C address of the chip. 6 + - ti,x-plate-ohms: X-plate resistance in ohms. 7 + 8 + Optional properties: 9 + - gpios: the interrupt gpio the chip is connected to (trough the penirq pin). 10 + The penirq pin goes to low when the panel is touched. 11 + (see GPIO binding[1] for more details). 12 + - interrupt-parent: the phandle for the gpio controller 13 + (see interrupt binding[0]). 14 + - interrupts: (gpio) interrupt to which the chip is connected 15 + (see interrupt binding[0]). 16 + - ti,max-rt: maximum pressure. 17 + - ti,fuzzx: specifies the absolute input fuzz x value. 18 + If set, it will permit noise in the data up to +- the value given to the fuzz 19 + parameter, that is used to filter noise from the event stream. 20 + - ti,fuzzy: specifies the absolute input fuzz y value. 21 + - ti,fuzzz: specifies the absolute input fuzz z value. 22 + - ti,poll-period: how much time to wait (in milliseconds) before reading again the 23 + values from the tsc2007. 24 + 25 + [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 26 + [1]: Documentation/devicetree/bindings/gpio/gpio.txt 27 + 28 + Example: 29 + &i2c1 { 30 + /* ... */ 31 + tsc2007@49 { 32 + compatible = "ti,tsc2007"; 33 + reg = <0x49>; 34 + interrupt-parent = <&gpio4>; 35 + interrupts = <0x0 0x8>; 36 + gpios = <&gpio4 0 0>; 37 + ti,x-plate-ohms = <180>; 38 + }; 39 + 40 + /* ... */ 41 + };
+27
Documentation/devicetree/bindings/input/twl4030-keypad.txt
··· 1 + * TWL4030's Keypad Controller device tree bindings 2 + 3 + TWL4030's Keypad controller is used to interface a SoC with a matrix-type 4 + keypad device. The keypad controller supports multiple row and column lines. 5 + A key can be placed at each intersection of a unique row and a unique column. 6 + The keypad controller can sense a key-press and key-release and report the 7 + event using a interrupt to the cpu. 8 + 9 + This binding is based on the matrix-keymap binding with the following 10 + changes: 11 + 12 + * keypad,num-rows and keypad,num-columns are required. 13 + 14 + Required SoC Specific Properties: 15 + - compatible: should be one of the following 16 + - "ti,twl4030-keypad": For controllers compatible with twl4030 keypad 17 + controller. 18 + - interrupt: should be one of the following 19 + - <1>: For controllers compatible with twl4030 keypad controller. 20 + 21 + Example: 22 + twl_keypad: keypad { 23 + compatible = "ti,twl4030-keypad"; 24 + interrupts = <1>; 25 + keypad,num-rows = <8>; 26 + keypad,num-columns = <8>; 27 + };
+21
Documentation/devicetree/bindings/input/twl4030-pwrbutton.txt
··· 1 + Texas Instruments TWL family (twl4030) pwrbutton module 2 + 3 + This module is part of the TWL4030. For more details about the whole 4 + chip see Documentation/devicetree/bindings/mfd/twl-familly.txt. 5 + 6 + This module provides a simple power button event via an Interrupt. 7 + 8 + Required properties: 9 + - compatible: should be one of the following 10 + - "ti,twl4030-pwrbutton": For controllers compatible with twl4030 11 + - interrupts: should be one of the following 12 + - <8>: For controllers compatible with twl4030 13 + 14 + Example: 15 + 16 + &twl { 17 + twl_pwrbutton: pwrbutton { 18 + compatible = "ti,twl4030-pwrbutton"; 19 + interrupts = <8>; 20 + }; 21 + };
+3 -3
Documentation/input/gamepad.txt
··· 68 68 Legacy drivers often don't comply to these rules. As we cannot change them 69 69 for backwards-compatibility reasons, you need to provide fixup mappings in 70 70 user-space yourself. Some of them might also provide module-options that 71 - change the mappings so you can adivce users to set these. 71 + change the mappings so you can advise users to set these. 72 72 73 73 All new gamepads are supposed to comply with this mapping. Please report any 74 74 bugs, if they don't. ··· 150 150 BTN_START 151 151 Many pads also have a third button which is branded or has a special symbol 152 152 and meaning. Such buttons are mapped as BTN_MODE. Examples are the Nintendo 153 - "HOME" button, the XBox "X"-button or Sony "P" button. 153 + "HOME" button, the XBox "X"-button or Sony "PS" button. 154 154 155 155 Rumble: 156 - Rumble is adverticed as FF_RUMBLE. 156 + Rumble is advertised as FF_RUMBLE. 157 157 158 158 ---------------------------------------------------------------------------- 159 159 Written 2013 by David Herrmann <dh.herrmann@gmail.com>
+19 -19
Documentation/input/joystick-api.txt
··· 16 16 17 17 By default, the device is opened in blocking mode. 18 18 19 - int fd = open ("/dev/js0", O_RDONLY); 19 + int fd = open ("/dev/input/js0", O_RDONLY); 20 20 21 21 22 22 2. Event Reading 23 23 ~~~~~~~~~~~~~~~~ 24 24 25 25 struct js_event e; 26 - read (fd, &e, sizeof(struct js_event)); 26 + read (fd, &e, sizeof(e)); 27 27 28 28 where js_event is defined as 29 29 ··· 34 34 __u8 number; /* axis/button number */ 35 35 }; 36 36 37 - If the read is successful, it will return sizeof(struct js_event), unless 38 - you wanted to read more than one event per read as described in section 3.1. 37 + If the read is successful, it will return sizeof(e), unless you wanted to read 38 + more than one event per read as described in section 3.1. 39 39 40 40 41 41 2.1 js_event.type ··· 99 99 100 100 if ((js_event.type & ~JS_EVENT_INIT) == JS_EVENT_BUTTON) { 101 101 if (js_event.value) 102 - buttons_state |= (1 << js_event.number); 103 - else 104 - buttons_state &= ~(1 << js_event.number); 102 + buttons_state |= (1 << js_event.number); 103 + else 104 + buttons_state &= ~(1 << js_event.number); 105 105 } 106 106 107 107 is much safer since it can't lose sync with the driver. As you would ··· 144 144 For example, 145 145 146 146 while (1) { 147 - while (read (fd, &e, sizeof(struct js_event)) > 0) { 148 - process_event (e); 149 - } 150 - /* EAGAIN is returned when the queue is empty */ 151 - if (errno != EAGAIN) { 152 - /* error */ 153 - } 154 - /* do something interesting with processed events */ 147 + while (read (fd, &e, sizeof(e)) > 0) { 148 + process_event (e); 149 + } 150 + /* EAGAIN is returned when the queue is empty */ 151 + if (errno != EAGAIN) { 152 + /* error */ 153 + } 154 + /* do something interesting with processed events */ 155 155 } 156 156 157 157 One reason for emptying the queue is that if it gets full you'll start ··· 181 181 replace the read above with something like 182 182 183 183 struct js_event mybuffer[0xff]; 184 - int i = read (fd, mybuffer, sizeof(struct mybuffer)); 184 + int i = read (fd, mybuffer, sizeof(mybuffer)); 185 185 186 186 In this case, read would return -1 if the queue was empty, or some 187 187 other value in which the number of events read would be i / ··· 269 269 struct JS_DATA_TYPE js; 270 270 while (1) { 271 271 if (read (fd, &js, JS_RETURN) != JS_RETURN) { 272 - /* error */ 273 - } 274 - usleep (1000); 272 + /* error */ 273 + } 274 + usleep (1000); 275 275 } 276 276 277 277 As you can figure out from the example, the read returns immediately,
+4 -4
Documentation/input/joystick.txt
··· 116 116 For testing the joystick driver functionality, there is the jstest 117 117 program in the utilities package. You run it by typing: 118 118 119 - jstest /dev/js0 119 + jstest /dev/input/js0 120 120 121 121 And it should show a line with the joystick values, which update as you 122 122 move the stick, and press its buttons. The axes should all be zero when the ··· 136 136 some analog joysticks, that either do not use linear resistors, or if you 137 137 want better precision, you can use the jscal program 138 138 139 - jscal -c /dev/js0 139 + jscal -c /dev/input/js0 140 140 141 141 included in the joystick package to set better correction coefficients than 142 142 what the driver would choose itself. ··· 145 145 calibration using the jstest command, and if you do, you then can save the 146 146 correction coefficients into a file 147 147 148 - jscal -p /dev/js0 > /etc/joystick.cal 148 + jscal -p /dev/input/js0 > /etc/joystick.cal 149 149 150 150 And add a line to your rc script executing that file 151 151 ··· 556 556 557 557 5. FAQ 558 558 ~~~~~~ 559 - Q: Running 'jstest /dev/js0' results in "File not found" error. What's the 559 + Q: Running 'jstest /dev/input/js0' results in "File not found" error. What's the 560 560 cause? 561 561 A: The device files don't exist. Create them (see section 2.2). 562 562
+1
arch/alpha/Kconfig
··· 2 2 bool 3 3 default y 4 4 select ARCH_MIGHT_HAVE_PC_PARPORT 5 + select ARCH_MIGHT_HAVE_PC_SERIO 5 6 select HAVE_AOUT 6 7 select HAVE_IDE 7 8 select HAVE_OPROFILE
+1
arch/arm/mach-footbridge/Kconfig
··· 85 85 # Footbridge in host mode 86 86 config FOOTBRIDGE_HOST 87 87 bool 88 + select ARCH_MIGHT_HAVE_PC_SERIO 88 89 89 90 # Footbridge in addin mode 90 91 config FOOTBRIDGE_ADDIN
+1 -1
arch/arm/mach-imx/mach-cpuimx35.c
··· 53 53 }; 54 54 55 55 #define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2) 56 - static int tsc2007_get_pendown_state(void) 56 + static int tsc2007_get_pendown_state(struct device *dev) 57 57 { 58 58 return !gpio_get_value(TSC2007_IRQGPIO); 59 59 }
+1 -1
arch/arm/mach-imx/mach-cpuimx51sd.c
··· 121 121 .flags = IMXUART_HAVE_RTSCTS, 122 122 }; 123 123 124 - static int tsc2007_get_pendown_state(void) 124 + static int tsc2007_get_pendown_state(struct device *dev) 125 125 { 126 126 if (mx51_revision() < IMX_CHIP_REVISION_3_0) 127 127 return !gpio_get_value(TSC2007_IRQGPIO_REV2);
+1
arch/ia64/Kconfig
··· 7 7 config IA64 8 8 bool 9 9 select ARCH_MIGHT_HAVE_PC_PARPORT 10 + select ARCH_MIGHT_HAVE_PC_SERIO 10 11 select PCI if (!IA64_HP_SIM) 11 12 select ACPI if (!IA64_HP_SIM) 12 13 select PM if (!IA64_HP_SIM)
+1
arch/mips/Kconfig
··· 2 2 bool 3 3 default y 4 4 select ARCH_MIGHT_HAVE_PC_PARPORT 5 + select ARCH_MIGHT_HAVE_PC_SERIO 5 6 select HAVE_CONTEXT_TRACKING 6 7 select HAVE_GENERIC_DMA_COHERENT 7 8 select HAVE_IDE
+1
arch/powerpc/Kconfig
··· 86 86 bool 87 87 default y 88 88 select ARCH_MIGHT_HAVE_PC_PARPORT 89 + select ARCH_MIGHT_HAVE_PC_SERIO 89 90 select BINFMT_ELF 90 91 select OF 91 92 select OF_EARLY_FLATTREE
+1
arch/sh/boards/Kconfig
··· 321 321 bool "Hitachi Cayman" 322 322 depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103 323 323 select SYS_SUPPORTS_PCI 324 + select ARCH_MIGHT_HAVE_PC_SERIO 324 325 325 326 config SH_POLARIS 326 327 bool "SMSC Polaris"
+1 -1
arch/sh/boards/mach-ecovec24/setup.c
··· 502 502 /* TouchScreen */ 503 503 #define IRQ0 evt2irq(0x600) 504 504 505 - static int ts_get_pendown_state(void) 505 + static int ts_get_pendown_state(struct device *dev) 506 506 { 507 507 int val = 0; 508 508 gpio_free(GPIO_FN_INTC_IRQ0);
+1
arch/sparc/Kconfig
··· 13 13 bool 14 14 default y 15 15 select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI 16 + select ARCH_MIGHT_HAVE_PC_SERIO 16 17 select OF 17 18 select OF_PROMTREE 18 19 select HAVE_IDE
+1
arch/unicore32/Kconfig
··· 1 1 config UNICORE32 2 2 def_bool y 3 3 select ARCH_MIGHT_HAVE_PC_PARPORT 4 + select ARCH_MIGHT_HAVE_PC_SERIO 4 5 select HAVE_MEMBLOCK 5 6 select HAVE_GENERIC_DMA_COHERENT 6 7 select HAVE_DMA_ATTRS
+1
arch/x86/Kconfig
··· 23 23 def_bool y 24 24 select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS 25 25 select ARCH_MIGHT_HAVE_PC_PARPORT 26 + select ARCH_MIGHT_HAVE_PC_SERIO 26 27 select HAVE_AOUT if X86_32 27 28 select HAVE_UNSTABLE_SCHED_CLOCK 28 29 select ARCH_SUPPORTS_NUMA_BALANCING
-1
drivers/input/gameport/emu10k1-gp.c
··· 30 30 31 31 #include <linux/module.h> 32 32 #include <linux/ioport.h> 33 - #include <linux/init.h> 34 33 #include <linux/gameport.h> 35 34 #include <linux/slab.h> 36 35 #include <linux/pci.h>
-1
drivers/input/gameport/fm801-gp.c
··· 27 27 #include <linux/kernel.h> 28 28 #include <linux/module.h> 29 29 #include <linux/pci.h> 30 - #include <linux/init.h> 31 30 #include <linux/slab.h> 32 31 #include <linux/gameport.h> 33 32
+57 -19
drivers/input/input.c
··· 1653 1653 */ 1654 1654 void input_reset_device(struct input_dev *dev) 1655 1655 { 1656 + unsigned long flags; 1657 + 1656 1658 mutex_lock(&dev->mutex); 1659 + spin_lock_irqsave(&dev->event_lock, flags); 1657 1660 1658 - if (dev->users) { 1659 - input_dev_toggle(dev, true); 1661 + input_dev_toggle(dev, true); 1662 + input_dev_release_keys(dev); 1660 1663 1661 - /* 1662 - * Keys that have been pressed at suspend time are unlikely 1663 - * to be still pressed when we resume. 1664 - */ 1665 - spin_lock_irq(&dev->event_lock); 1666 - input_dev_release_keys(dev); 1667 - spin_unlock_irq(&dev->event_lock); 1668 - } 1669 - 1664 + spin_unlock_irqrestore(&dev->event_lock, flags); 1670 1665 mutex_unlock(&dev->mutex); 1671 1666 } 1672 1667 EXPORT_SYMBOL(input_reset_device); 1673 1668 1674 - #ifdef CONFIG_PM 1669 + #ifdef CONFIG_PM_SLEEP 1675 1670 static int input_dev_suspend(struct device *dev) 1676 1671 { 1677 1672 struct input_dev *input_dev = to_input_dev(dev); 1678 1673 1679 - mutex_lock(&input_dev->mutex); 1674 + spin_lock_irq(&input_dev->event_lock); 1680 1675 1681 - if (input_dev->users) 1682 - input_dev_toggle(input_dev, false); 1676 + /* 1677 + * Keys that are pressed now are unlikely to be 1678 + * still pressed when we resume. 1679 + */ 1680 + input_dev_release_keys(input_dev); 1683 1681 1684 - mutex_unlock(&input_dev->mutex); 1682 + /* Turn off LEDs and sounds, if any are active. */ 1683 + input_dev_toggle(input_dev, false); 1684 + 1685 + spin_unlock_irq(&input_dev->event_lock); 1685 1686 1686 1687 return 0; 1687 1688 } ··· 1691 1690 { 1692 1691 struct input_dev *input_dev = to_input_dev(dev); 1693 1692 1694 - input_reset_device(input_dev); 1693 + spin_lock_irq(&input_dev->event_lock); 1694 + 1695 + /* Restore state of LEDs and sounds, if any were active. */ 1696 + input_dev_toggle(input_dev, true); 1697 + 1698 + spin_unlock_irq(&input_dev->event_lock); 1699 + 1700 + return 0; 1701 + } 1702 + 1703 + static int input_dev_freeze(struct device *dev) 1704 + { 1705 + struct input_dev *input_dev = to_input_dev(dev); 1706 + 1707 + spin_lock_irq(&input_dev->event_lock); 1708 + 1709 + /* 1710 + * Keys that are pressed now are unlikely to be 1711 + * still pressed when we resume. 1712 + */ 1713 + input_dev_release_keys(input_dev); 1714 + 1715 + spin_unlock_irq(&input_dev->event_lock); 1716 + 1717 + return 0; 1718 + } 1719 + 1720 + static int input_dev_poweroff(struct device *dev) 1721 + { 1722 + struct input_dev *input_dev = to_input_dev(dev); 1723 + 1724 + spin_lock_irq(&input_dev->event_lock); 1725 + 1726 + /* Turn off LEDs and sounds, if any are active. */ 1727 + input_dev_toggle(input_dev, false); 1728 + 1729 + spin_unlock_irq(&input_dev->event_lock); 1695 1730 1696 1731 return 0; 1697 1732 } ··· 1735 1698 static const struct dev_pm_ops input_dev_pm_ops = { 1736 1699 .suspend = input_dev_suspend, 1737 1700 .resume = input_dev_resume, 1738 - .poweroff = input_dev_suspend, 1701 + .freeze = input_dev_freeze, 1702 + .poweroff = input_dev_poweroff, 1739 1703 .restore = input_dev_resume, 1740 1704 }; 1741 1705 #endif /* CONFIG_PM */ ··· 1745 1707 .groups = input_dev_attr_groups, 1746 1708 .release = input_dev_release, 1747 1709 .uevent = input_dev_uevent, 1748 - #ifdef CONFIG_PM 1710 + #ifdef CONFIG_PM_SLEEP 1749 1711 .pm = &input_dev_pm_ops, 1750 1712 #endif 1751 1713 };
-1
drivers/input/joystick/a3d.c
··· 29 29 #include <linux/kernel.h> 30 30 #include <linux/module.h> 31 31 #include <linux/slab.h> 32 - #include <linux/init.h> 33 32 #include <linux/gameport.h> 34 33 #include <linux/input.h> 35 34 #include <linux/jiffies.h>
-1
drivers/input/joystick/adi.c
··· 33 33 #include <linux/slab.h> 34 34 #include <linux/input.h> 35 35 #include <linux/gameport.h> 36 - #include <linux/init.h> 37 36 #include <linux/jiffies.h> 38 37 39 38 #define DRIVER_DESC "Logitech ADI joystick family driver"
-1
drivers/input/joystick/cobra.c
··· 29 29 #include <linux/kernel.h> 30 30 #include <linux/module.h> 31 31 #include <linux/slab.h> 32 - #include <linux/init.h> 33 32 #include <linux/gameport.h> 34 33 #include <linux/input.h> 35 34 #include <linux/jiffies.h>
-1
drivers/input/joystick/gf2k.c
··· 30 30 #include <linux/kernel.h> 31 31 #include <linux/slab.h> 32 32 #include <linux/module.h> 33 - #include <linux/init.h> 34 33 #include <linux/input.h> 35 34 #include <linux/gameport.h> 36 35 #include <linux/jiffies.h>
-1
drivers/input/joystick/grip.c
··· 28 28 29 29 #include <linux/kernel.h> 30 30 #include <linux/module.h> 31 - #include <linux/init.h> 32 31 #include <linux/slab.h> 33 32 #include <linux/gameport.h> 34 33 #include <linux/input.h>
-1
drivers/input/joystick/grip_mp.c
··· 11 11 12 12 #include <linux/kernel.h> 13 13 #include <linux/module.h> 14 - #include <linux/init.h> 15 14 #include <linux/slab.h> 16 15 #include <linux/gameport.h> 17 16 #include <linux/input.h>
-1
drivers/input/joystick/guillemot.c
··· 30 30 #include <linux/slab.h> 31 31 #include <linux/module.h> 32 32 #include <linux/delay.h> 33 - #include <linux/init.h> 34 33 #include <linux/gameport.h> 35 34 #include <linux/input.h> 36 35 #include <linux/jiffies.h>
-1
drivers/input/joystick/iforce/iforce.h
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/input.h> 31 31 #include <linux/module.h> 32 - #include <linux/init.h> 33 32 #include <linux/spinlock.h> 34 33 #include <linux/usb.h> 35 34 #include <linux/serio.h>
-1
drivers/input/joystick/interact.c
··· 33 33 #include <linux/slab.h> 34 34 #include <linux/module.h> 35 35 #include <linux/delay.h> 36 - #include <linux/init.h> 37 36 #include <linux/gameport.h> 38 37 #include <linux/input.h> 39 38 #include <linux/jiffies.h>
-1
drivers/input/joystick/joydump.c
··· 31 31 #include <linux/gameport.h> 32 32 #include <linux/kernel.h> 33 33 #include <linux/delay.h> 34 - #include <linux/init.h> 35 34 #include <linux/slab.h> 36 35 37 36 #define DRIVER_DESC "Gameport data dumper module"
-1
drivers/input/joystick/magellan.c
··· 31 31 #include <linux/slab.h> 32 32 #include <linux/input.h> 33 33 #include <linux/serio.h> 34 - #include <linux/init.h> 35 34 36 35 #define DRIVER_DESC "Magellan and SpaceMouse 6dof controller driver" 37 36
-1
drivers/input/joystick/sidewinder.c
··· 30 30 #include <linux/kernel.h> 31 31 #include <linux/module.h> 32 32 #include <linux/slab.h> 33 - #include <linux/init.h> 34 33 #include <linux/input.h> 35 34 #include <linux/gameport.h> 36 35 #include <linux/jiffies.h>
-1
drivers/input/joystick/spaceball.c
··· 33 33 #include <linux/kernel.h> 34 34 #include <linux/slab.h> 35 35 #include <linux/module.h> 36 - #include <linux/init.h> 37 36 #include <linux/input.h> 38 37 #include <linux/serio.h> 39 38
-1
drivers/input/joystick/spaceorb.c
··· 32 32 #include <linux/kernel.h> 33 33 #include <linux/slab.h> 34 34 #include <linux/module.h> 35 - #include <linux/init.h> 36 35 #include <linux/input.h> 37 36 #include <linux/serio.h> 38 37
-1
drivers/input/joystick/stinger.c
··· 32 32 #include <linux/slab.h> 33 33 #include <linux/input.h> 34 34 #include <linux/serio.h> 35 - #include <linux/init.h> 36 35 37 36 #define DRIVER_DESC "Gravis Stinger gamepad driver" 38 37
-1
drivers/input/joystick/tmdc.c
··· 33 33 #include <linux/kernel.h> 34 34 #include <linux/slab.h> 35 35 #include <linux/module.h> 36 - #include <linux/init.h> 37 36 #include <linux/gameport.h> 38 37 #include <linux/input.h> 39 38 #include <linux/jiffies.h>
-1
drivers/input/joystick/twidjoy.c
··· 52 52 #include <linux/slab.h> 53 53 #include <linux/input.h> 54 54 #include <linux/serio.h> 55 - #include <linux/init.h> 56 55 57 56 #define DRIVER_DESC "Handykey Twiddler keyboard as a joystick driver" 58 57
-1
drivers/input/joystick/warrior.c
··· 31 31 #include <linux/slab.h> 32 32 #include <linux/input.h> 33 33 #include <linux/serio.h> 34 - #include <linux/init.h> 35 34 36 35 #define DRIVER_DESC "Logitech WingMan Warrior joystick driver" 37 36
+4 -3
drivers/input/joystick/xpad.c
··· 74 74 */ 75 75 76 76 #include <linux/kernel.h> 77 - #include <linux/init.h> 78 77 #include <linux/slab.h> 79 78 #include <linux/stat.h> 80 79 #include <linux/module.h> ··· 124 125 { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 125 126 { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 126 127 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, 128 + { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 }, 129 + { 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 }, 127 130 { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, XTYPE_XBOX360 }, 128 131 { 0x046d, 0xca84, "Logitech Xbox Cordless Controller", 0, XTYPE_XBOX }, 129 132 { 0x046d, 0xca88, "Logitech Compact Controller for Xbox", 0, XTYPE_XBOX }, ··· 167 166 { 0x1430, 0x4748, "RedOctane Guitar Hero X-plorer", 0, XTYPE_XBOX360 }, 168 167 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 169 168 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 }, 170 - { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 171 - { 0x1689, 0xfd01, "Razer Onza Classic Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 169 + { 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 }, 170 + { 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 }, 172 171 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 }, 173 172 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 174 173 { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
-1
drivers/input/joystick/zhenhua.c
··· 49 49 #include <linux/slab.h> 50 50 #include <linux/input.h> 51 51 #include <linux/serio.h> 52 - #include <linux/init.h> 53 52 54 53 #define DRIVER_DESC "RC transmitter with 5-byte Zhen Hua protocol joystick driver" 55 54
+1 -1
drivers/input/keyboard/Kconfig
··· 525 525 526 526 config KEYBOARD_SH_KEYSC 527 527 tristate "SuperH KEYSC keypad support" 528 - depends on SUPERH || ARM || COMPILE_TEST 528 + depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST 529 529 help 530 530 Say Y here if you want to use a keypad attached to the KEYSC block 531 531 on SuperH processors such as sh7722 and sh7343.
+1 -2
drivers/input/keyboard/adp5520-keys.c
··· 8 8 9 9 #include <linux/module.h> 10 10 #include <linux/kernel.h> 11 - #include <linux/init.h> 12 11 #include <linux/platform_device.h> 13 12 #include <linux/input.h> 14 13 #include <linux/mfd/adp5520.h> ··· 70 71 71 72 static int adp5520_keys_probe(struct platform_device *pdev) 72 73 { 73 - struct adp5520_keys_platform_data *pdata = pdev->dev.platform_data; 74 + struct adp5520_keys_platform_data *pdata = dev_get_platdata(&pdev->dev); 74 75 struct input_dev *input; 75 76 struct adp5520_keys *dev; 76 77 int ret, i;
+6 -5
drivers/input/keyboard/adp5588-keys.c
··· 9 9 */ 10 10 11 11 #include <linux/module.h> 12 - #include <linux/init.h> 13 12 #include <linux/interrupt.h> 14 13 #include <linux/irq.h> 15 14 #include <linux/workqueue.h> ··· 172 173 static int adp5588_gpio_add(struct adp5588_kpad *kpad) 173 174 { 174 175 struct device *dev = &kpad->client->dev; 175 - const struct adp5588_kpad_platform_data *pdata = dev->platform_data; 176 + const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev); 176 177 const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 177 178 int i, error; 178 179 ··· 226 227 static void adp5588_gpio_remove(struct adp5588_kpad *kpad) 227 228 { 228 229 struct device *dev = &kpad->client->dev; 229 - const struct adp5588_kpad_platform_data *pdata = dev->platform_data; 230 + const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev); 230 231 const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 231 232 int error; 232 233 ··· 320 321 321 322 static int adp5588_setup(struct i2c_client *client) 322 323 { 323 - const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; 324 + const struct adp5588_kpad_platform_data *pdata = 325 + dev_get_platdata(&client->dev); 324 326 const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; 325 327 int i, ret; 326 328 unsigned char evt_mode1 = 0, evt_mode2 = 0, evt_mode3 = 0; ··· 424 424 const struct i2c_device_id *id) 425 425 { 426 426 struct adp5588_kpad *kpad; 427 - const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; 427 + const struct adp5588_kpad_platform_data *pdata = 428 + dev_get_platdata(&client->dev); 428 429 struct input_dev *input; 429 430 unsigned int revid; 430 431 int ret, i;
+4 -5
drivers/input/keyboard/adp5589-keys.c
··· 8 8 */ 9 9 10 10 #include <linux/module.h> 11 - #include <linux/init.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/irq.h> 14 13 #include <linux/workqueue.h> ··· 498 499 static int adp5589_gpio_add(struct adp5589_kpad *kpad) 499 500 { 500 501 struct device *dev = &kpad->client->dev; 501 - const struct adp5589_kpad_platform_data *pdata = dev->platform_data; 502 + const struct adp5589_kpad_platform_data *pdata = dev_get_platdata(dev); 502 503 const struct adp5589_gpio_platform_data *gpio_data = pdata->gpio_data; 503 504 int i, error; 504 505 ··· 552 553 static void adp5589_gpio_remove(struct adp5589_kpad *kpad) 553 554 { 554 555 struct device *dev = &kpad->client->dev; 555 - const struct adp5589_kpad_platform_data *pdata = dev->platform_data; 556 + const struct adp5589_kpad_platform_data *pdata = dev_get_platdata(dev); 556 557 const struct adp5589_gpio_platform_data *gpio_data = pdata->gpio_data; 557 558 int error; 558 559 ··· 657 658 { 658 659 struct i2c_client *client = kpad->client; 659 660 const struct adp5589_kpad_platform_data *pdata = 660 - client->dev.platform_data; 661 + dev_get_platdata(&client->dev); 661 662 u8 (*reg) (u8) = kpad->var->reg; 662 663 unsigned char evt_mode1 = 0, evt_mode2 = 0, evt_mode3 = 0; 663 664 unsigned char pull_mask = 0; ··· 863 864 { 864 865 struct adp5589_kpad *kpad; 865 866 const struct adp5589_kpad_platform_data *pdata = 866 - client->dev.platform_data; 867 + dev_get_platdata(&client->dev); 867 868 struct input_dev *input; 868 869 unsigned int revid; 869 870 int ret, i;
+2 -3
drivers/input/keyboard/bf54x-keys.c
··· 30 30 31 31 #include <linux/module.h> 32 32 33 - #include <linux/init.h> 34 33 #include <linux/fs.h> 35 34 #include <linux/interrupt.h> 36 35 #include <linux/irq.h> ··· 179 180 static int bfin_kpad_probe(struct platform_device *pdev) 180 181 { 181 182 struct bf54x_kpad *bf54x_kpad; 182 - struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; 183 + struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev); 183 184 struct input_dev *input; 184 185 int i, error; 185 186 ··· 332 333 333 334 static int bfin_kpad_remove(struct platform_device *pdev) 334 335 { 335 - struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; 336 + struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev); 336 337 struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); 337 338 338 339 del_timer_sync(&bf54x_kpad->timer);
+11 -4
drivers/input/keyboard/cros_ec_keyb.c
··· 38 38 * @row_shift: log2 or number of rows, rounded up 39 39 * @keymap_data: Matrix keymap data used to convert to keyscan values 40 40 * @ghost_filter: true to enable the matrix key-ghosting filter 41 + * @old_kb_state: bitmap of keys pressed last scan 41 42 * @dev: Device pointer 42 43 * @idev: Input device 43 44 * @ec: Top level ChromeOS device to use to talk to EC ··· 50 49 int row_shift; 51 50 const struct matrix_keymap_data *keymap_data; 52 51 bool ghost_filter; 52 + uint8_t *old_kb_state; 53 53 54 54 struct device *dev; 55 55 struct input_dev *idev; ··· 137 135 struct input_dev *idev = ckdev->idev; 138 136 int col, row; 139 137 int new_state; 138 + int old_state; 140 139 int num_cols; 141 140 142 141 num_cols = len; ··· 156 153 for (row = 0; row < ckdev->rows; row++) { 157 154 int pos = MATRIX_SCAN_CODE(row, col, ckdev->row_shift); 158 155 const unsigned short *keycodes = idev->keycode; 159 - int code; 160 156 161 - code = keycodes[pos]; 162 157 new_state = kb_state[col] & (1 << row); 163 - if (!!new_state != test_bit(code, idev->key)) { 158 + old_state = ckdev->old_kb_state[col] & (1 << row); 159 + if (new_state != old_state) { 164 160 dev_dbg(ckdev->dev, 165 161 "changed: [r%d c%d]: byte %02x\n", 166 162 row, col, new_state); 167 163 168 - input_report_key(idev, code, new_state); 164 + input_report_key(idev, keycodes[pos], 165 + new_state); 169 166 } 170 167 } 168 + ckdev->old_kb_state[col] = kb_state[col]; 171 169 } 172 170 input_sync(ckdev->idev); 173 171 } ··· 230 226 &ckdev->cols); 231 227 if (err) 232 228 return err; 229 + ckdev->old_kb_state = devm_kzalloc(&pdev->dev, ckdev->cols, GFP_KERNEL); 230 + if (!ckdev->old_kb_state) 231 + return -ENOMEM; 233 232 234 233 idev = devm_input_allocate_device(&pdev->dev); 235 234 if (!idev)
+1 -1
drivers/input/keyboard/davinci_keyscan.c
··· 172 172 struct input_dev *key_dev; 173 173 struct resource *res, *mem; 174 174 struct device *dev = &pdev->dev; 175 - struct davinci_ks_platform_data *pdata = pdev->dev.platform_data; 175 + struct davinci_ks_platform_data *pdata = dev_get_platdata(&pdev->dev); 176 176 int error, i; 177 177 178 178 if (pdata->device_enable) {
+1 -1
drivers/input/keyboard/ep93xx_keypad.c
··· 244 244 if (!keypad) 245 245 return -ENOMEM; 246 246 247 - keypad->pdata = pdev->dev.platform_data; 247 + keypad->pdata = dev_get_platdata(&pdev->dev); 248 248 if (!keypad->pdata) { 249 249 err = -EINVAL; 250 250 goto failed_free;
-1
drivers/input/keyboard/goldfish_events.c
··· 14 14 */ 15 15 16 16 #include <linux/module.h> 17 - #include <linux/init.h> 18 17 #include <linux/interrupt.h> 19 18 #include <linux/types.h> 20 19 #include <linux/input.h>
-1
drivers/input/keyboard/gpio_keys_polled.c
··· 17 17 18 18 #include <linux/kernel.h> 19 19 #include <linux/module.h> 20 - #include <linux/init.h> 21 20 #include <linux/slab.h> 22 21 #include <linux/input.h> 23 22 #include <linux/input-polldev.h>
-1
drivers/input/keyboard/hil_kbd.c
··· 36 36 #include <linux/serio.h> 37 37 #include <linux/kernel.h> 38 38 #include <linux/module.h> 39 - #include <linux/init.h> 40 39 #include <linux/completion.h> 41 40 #include <linux/slab.h> 42 41 #include <linux/pci_ids.h>
+2 -2
drivers/input/keyboard/imx_keypad.c
··· 13 13 #include <linux/delay.h> 14 14 #include <linux/device.h> 15 15 #include <linux/err.h> 16 - #include <linux/init.h> 17 16 #include <linux/input/matrix_keypad.h> 18 17 #include <linux/interrupt.h> 19 18 #include <linux/io.h> ··· 424 425 425 426 static int imx_keypad_probe(struct platform_device *pdev) 426 427 { 427 - const struct matrix_keymap_data *keymap_data = pdev->dev.platform_data; 428 + const struct matrix_keymap_data *keymap_data = 429 + dev_get_platdata(&pdev->dev); 428 430 struct imx_keypad *keypad; 429 431 struct input_dev *input_dev; 430 432 struct resource *res;
-1
drivers/input/keyboard/jornada680_kbd.c
··· 16 16 * published by the Free Software Foundation. 17 17 */ 18 18 19 - #include <linux/init.h> 20 19 #include <linux/input.h> 21 20 #include <linux/input-polldev.h> 22 21 #include <linux/interrupt.h>
-1
drivers/input/keyboard/jornada720_kbd.c
··· 18 18 #include <linux/device.h> 19 19 #include <linux/errno.h> 20 20 #include <linux/interrupt.h> 21 - #include <linux/init.h> 22 21 #include <linux/input.h> 23 22 #include <linux/kernel.h> 24 23 #include <linux/module.h>
-1
drivers/input/keyboard/lkkbd.c
··· 65 65 #include <linux/slab.h> 66 66 #include <linux/module.h> 67 67 #include <linux/interrupt.h> 68 - #include <linux/init.h> 69 68 #include <linux/input.h> 70 69 #include <linux/serio.h> 71 70 #include <linux/workqueue.h>
+1 -1
drivers/input/keyboard/lm8323.c
··· 627 627 static int lm8323_probe(struct i2c_client *client, 628 628 const struct i2c_device_id *id) 629 629 { 630 - struct lm8323_platform_data *pdata = client->dev.platform_data; 630 + struct lm8323_platform_data *pdata = dev_get_platdata(&client->dev); 631 631 struct input_dev *idev; 632 632 struct lm8323_chip *lm; 633 633 int pwm;
+2 -1
drivers/input/keyboard/lm8333.c
··· 131 131 static int lm8333_probe(struct i2c_client *client, 132 132 const struct i2c_device_id *id) 133 133 { 134 - const struct lm8333_platform_data *pdata = client->dev.platform_data; 134 + const struct lm8333_platform_data *pdata = 135 + dev_get_platdata(&client->dev); 135 136 struct lm8333 *lm8333; 136 137 struct input_dev *input; 137 138 int err, active_time;
-1
drivers/input/keyboard/matrix_keypad.c
··· 14 14 #include <linux/types.h> 15 15 #include <linux/delay.h> 16 16 #include <linux/platform_device.h> 17 - #include <linux/init.h> 18 17 #include <linux/input.h> 19 18 #include <linux/irq.h> 20 19 #include <linux/interrupt.h>
+2 -1
drivers/input/keyboard/max7359_keypad.c
··· 182 182 static int max7359_probe(struct i2c_client *client, 183 183 const struct i2c_device_id *id) 184 184 { 185 - const struct matrix_keymap_data *keymap_data = client->dev.platform_data; 185 + const struct matrix_keymap_data *keymap_data = 186 + dev_get_platdata(&client->dev); 186 187 struct max7359_keypad *keypad; 187 188 struct input_dev *input_dev; 188 189 int ret;
+1 -2
drivers/input/keyboard/mcs_touchkey.c
··· 12 12 */ 13 13 14 14 #include <linux/module.h> 15 - #include <linux/init.h> 16 15 #include <linux/i2c.h> 17 16 #include <linux/i2c/mcs.h> 18 17 #include <linux/interrupt.h> ··· 107 108 int error; 108 109 int i; 109 110 110 - pdata = client->dev.platform_data; 111 + pdata = dev_get_platdata(&client->dev); 111 112 if (!pdata) { 112 113 dev_err(&client->dev, "no platform data defined\n"); 113 114 return -EINVAL;
+2 -2
drivers/input/keyboard/mpr121_touchkey.c
··· 13 13 */ 14 14 15 15 #include <linux/module.h> 16 - #include <linux/init.h> 17 16 #include <linux/input.h> 18 17 #include <linux/i2c.h> 19 18 #include <linux/slab.h> ··· 187 188 static int mpr_touchkey_probe(struct i2c_client *client, 188 189 const struct i2c_device_id *id) 189 190 { 190 - const struct mpr121_platform_data *pdata = client->dev.platform_data; 191 + const struct mpr121_platform_data *pdata = 192 + dev_get_platdata(&client->dev); 191 193 struct mpr121_touchkey *mpr121; 192 194 struct input_dev *input_dev; 193 195 int error;
-1
drivers/input/keyboard/newtonkbd.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/module.h> 31 31 #include <linux/input.h> 32 - #include <linux/init.h> 33 32 #include <linux/serio.h> 34 33 35 34 #define DRIVER_DESC "Newton keyboard driver"
+2 -1
drivers/input/keyboard/nomadik-ske-keypad.c
··· 222 222 223 223 static int __init ske_keypad_probe(struct platform_device *pdev) 224 224 { 225 - const struct ske_keypad_platform_data *plat = pdev->dev.platform_data; 225 + const struct ske_keypad_platform_data *plat = 226 + dev_get_platdata(&pdev->dev); 226 227 struct ske_keypad *keypad; 227 228 struct input_dev *input; 228 229 struct resource *res;
+1 -2
drivers/input/keyboard/omap-keypad.c
··· 25 25 */ 26 26 27 27 #include <linux/module.h> 28 - #include <linux/init.h> 29 28 #include <linux/interrupt.h> 30 29 #include <linux/types.h> 31 30 #include <linux/input.h> ··· 247 248 { 248 249 struct omap_kp *omap_kp; 249 250 struct input_dev *input_dev; 250 - struct omap_kp_platform_data *pdata = pdev->dev.platform_data; 251 + struct omap_kp_platform_data *pdata = dev_get_platdata(&pdev->dev); 251 252 int i, col_idx, row_idx, ret; 252 253 unsigned int row_shift, keycodemax; 253 254
-1
drivers/input/keyboard/omap4-keypad.c
··· 22 22 */ 23 23 24 24 #include <linux/module.h> 25 - #include <linux/init.h> 26 25 #include <linux/interrupt.h> 27 26 #include <linux/platform_device.h> 28 27 #include <linux/errno.h>
-1
drivers/input/keyboard/pxa27x_keypad.c
··· 18 18 19 19 #include <linux/kernel.h> 20 20 #include <linux/module.h> 21 - #include <linux/init.h> 22 21 #include <linux/interrupt.h> 23 22 #include <linux/input.h> 24 23 #include <linux/device.h>
+2 -2
drivers/input/keyboard/pxa930_rotary.c
··· 8 8 9 9 #include <linux/kernel.h> 10 10 #include <linux/module.h> 11 - #include <linux/init.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/input.h> 14 13 #include <linux/platform_device.h> ··· 83 84 84 85 static int pxa930_rotary_probe(struct platform_device *pdev) 85 86 { 86 - struct pxa930_rotary_platform_data *pdata = pdev->dev.platform_data; 87 + struct pxa930_rotary_platform_data *pdata = 88 + dev_get_platdata(&pdev->dev); 87 89 struct pxa930_rotary *r; 88 90 struct input_dev *input_dev; 89 91 struct resource *res;
-1
drivers/input/keyboard/qt1070.c
··· 25 25 */ 26 26 #include <linux/kernel.h> 27 27 #include <linux/module.h> 28 - #include <linux/init.h> 29 28 #include <linux/i2c.h> 30 29 #include <linux/input.h> 31 30 #include <linux/slab.h>
-1
drivers/input/keyboard/qt2160.c
··· 19 19 */ 20 20 21 21 #include <linux/kernel.h> 22 - #include <linux/init.h> 23 22 #include <linux/leds.h> 24 23 #include <linux/module.h> 25 24 #include <linux/slab.h>
+21 -16
drivers/input/keyboard/samsung-keypad.c
··· 14 14 #include <linux/clk.h> 15 15 #include <linux/delay.h> 16 16 #include <linux/err.h> 17 - #include <linux/init.h> 18 17 #include <linux/input.h> 19 18 #include <linux/interrupt.h> 20 19 #include <linux/io.h> ··· 243 244 } 244 245 245 246 #ifdef CONFIG_OF 246 - static struct samsung_keypad_platdata *samsung_keypad_parse_dt( 247 - struct device *dev) 247 + static struct samsung_keypad_platdata * 248 + samsung_keypad_parse_dt(struct device *dev) 248 249 { 249 250 struct samsung_keypad_platdata *pdata; 250 251 struct matrix_keymap_data *keymap_data; ··· 252 253 struct device_node *np = dev->of_node, *key_np; 253 254 unsigned int key_count; 254 255 256 + if (!np) { 257 + dev_err(dev, "missing device tree data\n"); 258 + return ERR_PTR(-EINVAL); 259 + } 260 + 255 261 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); 256 262 if (!pdata) { 257 263 dev_err(dev, "could not allocate memory for platform data\n"); 258 - return NULL; 264 + return ERR_PTR(-ENOMEM); 259 265 } 260 266 261 267 of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows); 262 268 of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols); 263 269 if (!num_rows || !num_cols) { 264 270 dev_err(dev, "number of keypad rows/columns not specified\n"); 265 - return NULL; 271 + return ERR_PTR(-EINVAL); 266 272 } 267 273 pdata->rows = num_rows; 268 274 pdata->cols = num_cols; ··· 275 271 keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL); 276 272 if (!keymap_data) { 277 273 dev_err(dev, "could not allocate memory for keymap data\n"); 278 - return NULL; 274 + return ERR_PTR(-ENOMEM); 279 275 } 280 276 pdata->keymap_data = keymap_data; 281 277 ··· 284 280 keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL); 285 281 if (!keymap) { 286 282 dev_err(dev, "could not allocate memory for keymap\n"); 287 - return NULL; 283 + return ERR_PTR(-ENOMEM); 288 284 } 289 285 keymap_data->keymap = keymap; 290 286 ··· 298 294 299 295 if (of_get_property(np, "linux,input-no-autorepeat", NULL)) 300 296 pdata->no_autorepeat = true; 297 + 301 298 if (of_get_property(np, "linux,input-wakeup", NULL)) 302 299 pdata->wakeup = true; 303 300 304 301 return pdata; 305 302 } 306 303 #else 307 - static 308 - struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev) 304 + static struct samsung_keypad_platdata * 305 + samsung_keypad_parse_dt(struct device *dev) 309 306 { 310 - return NULL; 307 + dev_err(dev, "no platform data defined\n"); 308 + 309 + return ERR_PTR(-EINVAL); 311 310 } 312 311 #endif 313 312 ··· 325 318 unsigned int keymap_size; 326 319 int error; 327 320 328 - if (pdev->dev.of_node) 329 - pdata = samsung_keypad_parse_dt(&pdev->dev); 330 - else 331 - pdata = pdev->dev.platform_data; 321 + pdata = dev_get_platdata(&pdev->dev); 332 322 if (!pdata) { 333 - dev_err(&pdev->dev, "no platform data defined\n"); 334 - return -EINVAL; 323 + pdata = samsung_keypad_parse_dt(&pdev->dev); 324 + if (IS_ERR(pdata)) 325 + return PTR_ERR(pdata); 335 326 } 336 327 337 328 keymap_data = pdata->keymap_data;
+2 -3
drivers/input/keyboard/sh_keysc.c
··· 12 12 13 13 #include <linux/kernel.h> 14 14 #include <linux/module.h> 15 - #include <linux/init.h> 16 15 #include <linux/interrupt.h> 17 16 #include <linux/irq.h> 18 17 #include <linux/delay.h> ··· 170 171 int i; 171 172 int irq, error; 172 173 173 - if (!pdev->dev.platform_data) { 174 + if (!dev_get_platdata(&pdev->dev)) { 174 175 dev_err(&pdev->dev, "no platform data defined\n"); 175 176 error = -EINVAL; 176 177 goto err0; ··· 197 198 } 198 199 199 200 platform_set_drvdata(pdev, priv); 200 - memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata)); 201 + memcpy(&priv->pdata, dev_get_platdata(&pdev->dev), sizeof(priv->pdata)); 201 202 pdata = &priv->pdata; 202 203 203 204 priv->iomem_base = ioremap_nocache(res->start, resource_size(res));
-1
drivers/input/keyboard/spear-keyboard.c
··· 12 12 13 13 #include <linux/clk.h> 14 14 #include <linux/errno.h> 15 - #include <linux/init.h> 16 15 #include <linux/interrupt.h> 17 16 #include <linux/input.h> 18 17 #include <linux/io.h>
-1
drivers/input/keyboard/stmpe-keypad.c
··· 6 6 */ 7 7 8 8 #include <linux/module.h> 9 - #include <linux/init.h> 10 9 #include <linux/slab.h> 11 10 #include <linux/input.h> 12 11 #include <linux/interrupt.h>
-1
drivers/input/keyboard/stowaway.c
··· 32 32 #include <linux/slab.h> 33 33 #include <linux/module.h> 34 34 #include <linux/input.h> 35 - #include <linux/init.h> 36 35 #include <linux/serio.h> 37 36 38 37 #define DRIVER_DESC "Stowaway keyboard driver"
-1
drivers/input/keyboard/sunkbd.c
··· 31 31 #include <linux/slab.h> 32 32 #include <linux/module.h> 33 33 #include <linux/interrupt.h> 34 - #include <linux/init.h> 35 34 #include <linux/input.h> 36 35 #include <linux/serio.h> 37 36 #include <linux/workqueue.h>
-1
drivers/input/keyboard/tc3589x-keypad.c
··· 10 10 */ 11 11 12 12 #include <linux/module.h> 13 - #include <linux/init.h> 14 13 #include <linux/interrupt.h> 15 14 #include <linux/input.h> 16 15 #include <linux/platform_device.h>
+1 -1
drivers/input/keyboard/tca6416-keypad.c
··· 213 213 return -ENODEV; 214 214 } 215 215 216 - pdata = client->dev.platform_data; 216 + pdata = dev_get_platdata(&client->dev); 217 217 if (!pdata) { 218 218 dev_dbg(&client->dev, "no platform data\n"); 219 219 return -EINVAL;
+1 -1
drivers/input/keyboard/tnetv107x-keypad.c
··· 162 162 int error = 0, sz, row_shift; 163 163 u32 rev = 0; 164 164 165 - pdata = pdev->dev.platform_data; 165 + pdata = dev_get_platdata(&pdev->dev); 166 166 if (!pdata) { 167 167 dev_err(dev, "cannot find device data\n"); 168 168 return -EINVAL;
+64 -58
drivers/input/keyboard/twl4030_keypad.c
··· 27 27 28 28 #include <linux/kernel.h> 29 29 #include <linux/module.h> 30 - #include <linux/init.h> 31 30 #include <linux/interrupt.h> 32 31 #include <linux/input.h> 33 32 #include <linux/platform_device.h> 34 33 #include <linux/i2c/twl.h> 35 34 #include <linux/slab.h> 35 + #include <linux/of.h> 36 36 37 37 /* 38 38 * The TWL4030 family chips include a keypad controller that supports ··· 60 60 struct twl4030_keypad { 61 61 unsigned short keymap[TWL4030_KEYMAP_SIZE]; 62 62 u16 kp_state[TWL4030_MAX_ROWS]; 63 + bool autorepeat; 63 64 unsigned n_rows; 64 65 unsigned n_cols; 65 66 unsigned irq; ··· 331 330 */ 332 331 static int twl4030_kp_probe(struct platform_device *pdev) 333 332 { 334 - struct twl4030_keypad_data *pdata = pdev->dev.platform_data; 335 - const struct matrix_keymap_data *keymap_data; 333 + struct twl4030_keypad_data *pdata = dev_get_platdata(&pdev->dev); 334 + const struct matrix_keymap_data *keymap_data = NULL; 336 335 struct twl4030_keypad *kp; 337 336 struct input_dev *input; 338 337 u8 reg; 339 338 int error; 340 339 341 - if (!pdata || !pdata->rows || !pdata->cols || !pdata->keymap_data || 342 - pdata->rows > TWL4030_MAX_ROWS || pdata->cols > TWL4030_MAX_COLS) { 343 - dev_err(&pdev->dev, "Invalid platform_data\n"); 344 - return -EINVAL; 345 - } 340 + kp = devm_kzalloc(&pdev->dev, sizeof(*kp), GFP_KERNEL); 341 + if (!kp) 342 + return -ENOMEM; 346 343 347 - keymap_data = pdata->keymap_data; 344 + input = devm_input_allocate_device(&pdev->dev); 345 + if (!input) 346 + return -ENOMEM; 348 347 349 - kp = kzalloc(sizeof(*kp), GFP_KERNEL); 350 - input = input_allocate_device(); 351 - if (!kp || !input) { 352 - error = -ENOMEM; 353 - goto err1; 354 - } 355 - 356 - /* Get the debug Device */ 357 - kp->dbg_dev = &pdev->dev; 358 - kp->input = input; 359 - 360 - kp->n_rows = pdata->rows; 361 - kp->n_cols = pdata->cols; 362 - kp->irq = platform_get_irq(pdev, 0); 348 + /* get the debug device */ 349 + kp->dbg_dev = &pdev->dev; 350 + kp->input = input; 363 351 364 352 /* setup input device */ 365 353 input->name = "TWL4030 Keypad"; 366 354 input->phys = "twl4030_keypad/input0"; 367 - input->dev.parent = &pdev->dev; 368 355 369 356 input->id.bustype = BUS_HOST; 370 357 input->id.vendor = 0x0001; 371 358 input->id.product = 0x0001; 372 359 input->id.version = 0x0003; 360 + 361 + if (pdata) { 362 + if (!pdata->rows || !pdata->cols || !pdata->keymap_data) { 363 + dev_err(&pdev->dev, "Missing platform_data\n"); 364 + return -EINVAL; 365 + } 366 + 367 + kp->n_rows = pdata->rows; 368 + kp->n_cols = pdata->cols; 369 + kp->autorepeat = pdata->rep; 370 + keymap_data = pdata->keymap_data; 371 + } else { 372 + error = matrix_keypad_parse_of_params(&pdev->dev, &kp->n_rows, 373 + &kp->n_cols); 374 + if (error) 375 + return error; 376 + 377 + kp->autorepeat = true; 378 + } 379 + 380 + if (kp->n_rows > TWL4030_MAX_ROWS || kp->n_cols > TWL4030_MAX_COLS) { 381 + dev_err(&pdev->dev, 382 + "Invalid rows/cols amount specified in platform/devicetree data\n"); 383 + return -EINVAL; 384 + } 385 + 386 + kp->irq = platform_get_irq(pdev, 0); 387 + if (!kp->irq) { 388 + dev_err(&pdev->dev, "no keyboard irq assigned\n"); 389 + return -EINVAL; 390 + } 373 391 374 392 error = matrix_keypad_build_keymap(keymap_data, NULL, 375 393 TWL4030_MAX_ROWS, ··· 396 376 kp->keymap, input); 397 377 if (error) { 398 378 dev_err(kp->dbg_dev, "Failed to build keymap\n"); 399 - goto err1; 379 + return error; 400 380 } 401 381 402 382 input_set_capability(input, EV_MSC, MSC_SCAN); 403 383 /* Enable auto repeat feature of Linux input subsystem */ 404 - if (pdata->rep) 384 + if (kp->autorepeat) 405 385 __set_bit(EV_REP, input->evbit); 406 386 407 387 error = input_register_device(input); 408 388 if (error) { 409 389 dev_err(kp->dbg_dev, 410 390 "Unable to register twl4030 keypad device\n"); 411 - goto err1; 391 + return error; 412 392 } 413 393 414 394 error = twl4030_kp_program(kp); 415 395 if (error) 416 - goto err2; 396 + return error; 417 397 418 398 /* 419 399 * This ISR will always execute in kernel thread context because of ··· 421 401 * 422 402 * NOTE: we assume this host is wired to TWL4040 INT1, not INT2 ... 423 403 */ 424 - error = request_threaded_irq(kp->irq, NULL, do_kp_irq, 425 - 0, pdev->name, kp); 404 + error = devm_request_threaded_irq(&pdev->dev, kp->irq, NULL, do_kp_irq, 405 + 0, pdev->name, kp); 426 406 if (error) { 427 - dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n", 428 - kp->irq); 429 - goto err2; 407 + dev_info(kp->dbg_dev, "request_irq failed for irq no=%d: %d\n", 408 + kp->irq, error); 409 + return error; 430 410 } 431 411 432 412 /* Enable KP and TO interrupts now. */ 433 413 reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO); 434 414 if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) { 435 - error = -EIO; 436 - goto err3; 415 + /* mask all events - we don't care about the result */ 416 + (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1); 417 + return -EIO; 437 418 } 438 419 439 420 platform_set_drvdata(pdev, kp); 440 421 return 0; 441 - 442 - err3: 443 - /* mask all events - we don't care about the result */ 444 - (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1); 445 - free_irq(kp->irq, kp); 446 - err2: 447 - input_unregister_device(input); 448 - input = NULL; 449 - err1: 450 - input_free_device(input); 451 - kfree(kp); 452 - return error; 453 422 } 454 423 455 - static int twl4030_kp_remove(struct platform_device *pdev) 456 - { 457 - struct twl4030_keypad *kp = platform_get_drvdata(pdev); 458 - 459 - free_irq(kp->irq, kp); 460 - input_unregister_device(kp->input); 461 - kfree(kp); 462 - 463 - return 0; 464 - } 424 + #ifdef CONFIG_OF 425 + static const struct of_device_id twl4030_keypad_dt_match_table[] = { 426 + { .compatible = "ti,twl4030-keypad" }, 427 + {}, 428 + }; 429 + MODULE_DEVICE_TABLE(of, twl4030_keypad_dt_match_table); 430 + #endif 465 431 466 432 /* 467 433 * NOTE: twl4030 are multi-function devices connected via I2C. ··· 457 451 458 452 static struct platform_driver twl4030_kp_driver = { 459 453 .probe = twl4030_kp_probe, 460 - .remove = twl4030_kp_remove, 461 454 .driver = { 462 455 .name = "twl4030_keypad", 463 456 .owner = THIS_MODULE, 457 + .of_match_table = of_match_ptr(twl4030_keypad_dt_match_table), 464 458 }, 465 459 }; 466 460 module_platform_driver(twl4030_kp_driver);
+1 -2
drivers/input/keyboard/w90p910_keypad.c
··· 11 11 12 12 #include <linux/kernel.h> 13 13 #include <linux/module.h> 14 - #include <linux/init.h> 15 14 #include <linux/interrupt.h> 16 15 #include <linux/input.h> 17 16 #include <linux/device.h> ··· 120 121 static int w90p910_keypad_probe(struct platform_device *pdev) 121 122 { 122 123 const struct w90p910_keypad_platform_data *pdata = 123 - pdev->dev.platform_data; 124 + dev_get_platdata(&pdev->dev); 124 125 const struct matrix_keymap_data *keymap_data; 125 126 struct w90p910_keypad *keypad; 126 127 struct input_dev *input_dev;
-1
drivers/input/keyboard/xtkbd.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/module.h> 31 31 #include <linux/input.h> 32 - #include <linux/init.h> 33 32 #include <linux/serio.h> 34 33 35 34 #define DRIVER_DESC "XT keyboard driver"
+9
drivers/input/misc/Kconfig
··· 222 222 To compile this driver as a module, choose M here: the 223 223 module will be called gp2ap002a00f. 224 224 225 + config INPUT_GPIO_BEEPER 226 + tristate "Generic GPIO Beeper support" 227 + depends on OF_GPIO 228 + help 229 + Say Y here if you have a beeper connected to a GPIO pin. 230 + 231 + To compile this driver as a module, choose M here: the 232 + module will be called gpio-beeper. 233 + 225 234 config INPUT_GPIO_TILT_POLLED 226 235 tristate "Polled GPIO tilt switch" 227 236 depends on GPIOLIB
+1
drivers/input/misc/Makefile
··· 27 27 obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o 28 28 obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o 29 29 obj-$(CONFIG_INPUT_GP2A) += gp2ap002a00f.o 30 + obj-$(CONFIG_INPUT_GPIO_BEEPER) += gpio-beeper.o 30 31 obj-$(CONFIG_INPUT_GPIO_TILT_POLLED) += gpio_tilt_polled.o 31 32 obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o 32 33 obj-$(CONFIG_INPUT_IMS_PCU) += ims-pcu.o
+2 -3
drivers/input/misc/ad714x.c
··· 7 7 */ 8 8 9 9 #include <linux/device.h> 10 - #include <linux/init.h> 11 10 #include <linux/input.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/slab.h> ··· 968 969 int error; 969 970 struct input_dev *input[MAX_DEVICE_NUM]; 970 971 971 - struct ad714x_platform_data *plat_data = dev->platform_data; 972 + struct ad714x_platform_data *plat_data = dev_get_platdata(dev); 972 973 struct ad714x_chip *ad714x; 973 974 void *drv_mem; 974 975 unsigned long irqflags; ··· 985 986 goto err_out; 986 987 } 987 988 988 - if (dev->platform_data == NULL) { 989 + if (dev_get_platdata(dev) == NULL) { 989 990 dev_err(dev, "platform data for ad714x doesn't exist\n"); 990 991 error = -EINVAL; 991 992 goto err_out;
+1 -2
drivers/input/misc/adxl34x.c
··· 8 8 */ 9 9 10 10 #include <linux/device.h> 11 - #include <linux/init.h> 12 11 #include <linux/delay.h> 13 12 #include <linux/input.h> 14 13 #include <linux/interrupt.h> ··· 713 714 714 715 ac->fifo_delay = fifo_delay_default; 715 716 716 - pdata = dev->platform_data; 717 + pdata = dev_get_platdata(dev); 717 718 if (!pdata) { 718 719 dev_dbg(dev, 719 720 "No platform data: Using default initialization\n");
-1
drivers/input/misc/atlas_btns.c
··· 25 25 26 26 #include <linux/kernel.h> 27 27 #include <linux/module.h> 28 - #include <linux/init.h> 29 28 #include <linux/input.h> 30 29 #include <linux/types.h> 31 30 #include <linux/acpi.h>
+1 -2
drivers/input/misc/bfin_rotary.c
··· 6 6 */ 7 7 8 8 #include <linux/module.h> 9 - #include <linux/init.h> 10 9 #include <linux/interrupt.h> 11 10 #include <linux/irq.h> 12 11 #include <linux/pm.h> ··· 91 92 92 93 static int bfin_rotary_probe(struct platform_device *pdev) 93 94 { 94 - struct bfin_rotary_platform_data *pdata = pdev->dev.platform_data; 95 + struct bfin_rotary_platform_data *pdata = dev_get_platdata(&pdev->dev); 95 96 struct bfin_rot *rotary; 96 97 struct input_dev *input; 97 98 int error;
+2 -1
drivers/input/misc/bma150.c
··· 526 526 static int bma150_probe(struct i2c_client *client, 527 527 const struct i2c_device_id *id) 528 528 { 529 - const struct bma150_platform_data *pdata = client->dev.platform_data; 529 + const struct bma150_platform_data *pdata = 530 + dev_get_platdata(&client->dev); 530 531 const struct bma150_cfg *cfg; 531 532 struct bma150_data *bma150; 532 533 int chip_id;
+1 -1
drivers/input/misc/cma3000_d0x.c
··· 284 284 struct cma3000_accl_data *cma3000_init(struct device *dev, int irq, 285 285 const struct cma3000_bus_ops *bops) 286 286 { 287 - const struct cma3000_platform_data *pdata = dev->platform_data; 287 + const struct cma3000_platform_data *pdata = dev_get_platdata(dev); 288 288 struct cma3000_accl_data *data; 289 289 struct input_dev *input_dev; 290 290 int rev;
-1
drivers/input/misc/cobalt_btns.c
··· 17 17 * along with this program; if not, write to the Free Software 18 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 19 */ 20 - #include <linux/init.h> 21 20 #include <linux/input-polldev.h> 22 21 #include <linux/ioport.h> 23 22 #include <linux/module.h>
-1
drivers/input/misc/da9052_onkey.c
··· 11 11 * option) any later version. 12 12 */ 13 13 14 - #include <linux/init.h> 15 14 #include <linux/input.h> 16 15 #include <linux/module.h> 17 16 #include <linux/platform_device.h>
-1
drivers/input/misc/da9055_onkey.c
··· 11 11 * option) any later version. 12 12 */ 13 13 14 - #include <linux/init.h> 15 14 #include <linux/input.h> 16 15 #include <linux/module.h> 17 16 #include <linux/platform_device.h>
-1
drivers/input/misc/dm355evm_keys.c
··· 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 11 #include <linux/kernel.h> 12 - #include <linux/init.h> 13 12 #include <linux/slab.h> 14 13 #include <linux/input.h> 15 14 #include <linux/input/sparse-keymap.h>
+1 -1
drivers/input/misc/gp2ap002a00f.c
··· 125 125 static int gp2a_probe(struct i2c_client *client, 126 126 const struct i2c_device_id *id) 127 127 { 128 - const struct gp2a_platform_data *pdata = client->dev.platform_data; 128 + const struct gp2a_platform_data *pdata = dev_get_platdata(&client->dev); 129 129 struct gp2a_data *dt; 130 130 int error; 131 131
+127
drivers/input/misc/gpio-beeper.c
··· 1 + /* 2 + * Generic GPIO beeper driver 3 + * 4 + * Copyright (C) 2013 Alexander Shiyan <shc_work@mail.ru> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + */ 11 + 12 + #include <linux/input.h> 13 + #include <linux/module.h> 14 + #include <linux/of_gpio.h> 15 + #include <linux/workqueue.h> 16 + #include <linux/platform_device.h> 17 + 18 + #define BEEPER_MODNAME "gpio-beeper" 19 + 20 + struct gpio_beeper { 21 + struct work_struct work; 22 + int gpio; 23 + bool active_low; 24 + bool beeping; 25 + }; 26 + 27 + static void gpio_beeper_toggle(struct gpio_beeper *beep, bool on) 28 + { 29 + gpio_set_value_cansleep(beep->gpio, on ^ beep->active_low); 30 + } 31 + 32 + static void gpio_beeper_work(struct work_struct *work) 33 + { 34 + struct gpio_beeper *beep = container_of(work, struct gpio_beeper, work); 35 + 36 + gpio_beeper_toggle(beep, beep->beeping); 37 + } 38 + 39 + static int gpio_beeper_event(struct input_dev *dev, unsigned int type, 40 + unsigned int code, int value) 41 + { 42 + struct gpio_beeper *beep = input_get_drvdata(dev); 43 + 44 + if (type != EV_SND || code != SND_BELL) 45 + return -ENOTSUPP; 46 + 47 + if (value < 0) 48 + return -EINVAL; 49 + 50 + beep->beeping = value; 51 + /* Schedule work to actually turn the beeper on or off */ 52 + schedule_work(&beep->work); 53 + 54 + return 0; 55 + } 56 + 57 + static void gpio_beeper_close(struct input_dev *input) 58 + { 59 + struct gpio_beeper *beep = input_get_drvdata(input); 60 + 61 + cancel_work_sync(&beep->work); 62 + gpio_beeper_toggle(beep, false); 63 + } 64 + 65 + static int gpio_beeper_probe(struct platform_device *pdev) 66 + { 67 + struct gpio_beeper *beep; 68 + enum of_gpio_flags flags; 69 + struct input_dev *input; 70 + unsigned long gflags; 71 + int err; 72 + 73 + beep = devm_kzalloc(&pdev->dev, sizeof(*beep), GFP_KERNEL); 74 + if (!beep) 75 + return -ENOMEM; 76 + 77 + beep->gpio = of_get_gpio_flags(pdev->dev.of_node, 0, &flags); 78 + if (!gpio_is_valid(beep->gpio)) 79 + return beep->gpio; 80 + 81 + input = devm_input_allocate_device(&pdev->dev); 82 + if (!input) 83 + return -ENOMEM; 84 + 85 + INIT_WORK(&beep->work, gpio_beeper_work); 86 + 87 + input->name = pdev->name; 88 + input->id.bustype = BUS_HOST; 89 + input->id.vendor = 0x0001; 90 + input->id.product = 0x0001; 91 + input->id.version = 0x0100; 92 + input->close = gpio_beeper_close; 93 + input->event = gpio_beeper_event; 94 + 95 + input_set_capability(input, EV_SND, SND_BELL); 96 + 97 + beep->active_low = flags & OF_GPIO_ACTIVE_LOW; 98 + gflags = beep->active_low ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; 99 + 100 + err = devm_gpio_request_one(&pdev->dev, beep->gpio, gflags, pdev->name); 101 + if (err) 102 + return err; 103 + 104 + input_set_drvdata(input, beep); 105 + 106 + return input_register_device(input); 107 + } 108 + 109 + static struct of_device_id gpio_beeper_of_match[] = { 110 + { .compatible = BEEPER_MODNAME, }, 111 + { } 112 + }; 113 + MODULE_DEVICE_TABLE(of, gpio_beeper_of_match); 114 + 115 + static struct platform_driver gpio_beeper_platform_driver = { 116 + .driver = { 117 + .name = BEEPER_MODNAME, 118 + .owner = THIS_MODULE, 119 + .of_match_table = gpio_beeper_of_match, 120 + }, 121 + .probe = gpio_beeper_probe, 122 + }; 123 + module_platform_driver(gpio_beeper_platform_driver); 124 + 125 + MODULE_LICENSE("GPL"); 126 + MODULE_AUTHOR("Alexander Shiyan <shc_work@mail.ru>"); 127 + MODULE_DESCRIPTION("Generic GPIO beeper driver");
+2 -2
drivers/input/misc/gpio_tilt_polled.c
··· 16 16 17 17 #include <linux/kernel.h> 18 18 #include <linux/module.h> 19 - #include <linux/init.h> 20 19 #include <linux/slab.h> 21 20 #include <linux/input.h> 22 21 #include <linux/input-polldev.h> ··· 97 98 98 99 static int gpio_tilt_polled_probe(struct platform_device *pdev) 99 100 { 100 - const struct gpio_tilt_platform_data *pdata = pdev->dev.platform_data; 101 + const struct gpio_tilt_platform_data *pdata = 102 + dev_get_platdata(&pdev->dev); 101 103 struct device *dev = &pdev->dev; 102 104 struct gpio_tilt_polled_dev *tdev; 103 105 struct input_polled_dev *poll_dev;
-1
drivers/input/misc/keyspan_remote.c
··· 13 13 14 14 #include <linux/kernel.h> 15 15 #include <linux/errno.h> 16 - #include <linux/init.h> 17 16 #include <linux/slab.h> 18 17 #include <linux/module.h> 19 18 #include <linux/usb/input.h>
+2 -1
drivers/input/misc/kxtj9.c
··· 509 509 static int kxtj9_probe(struct i2c_client *client, 510 510 const struct i2c_device_id *id) 511 511 { 512 - const struct kxtj9_platform_data *pdata = client->dev.platform_data; 512 + const struct kxtj9_platform_data *pdata = 513 + dev_get_platdata(&client->dev); 513 514 struct kxtj9_data *tj9; 514 515 int err; 515 516
-1
drivers/input/misc/max8997_haptic.c
··· 23 23 */ 24 24 25 25 #include <linux/module.h> 26 - #include <linux/init.h> 27 26 #include <linux/slab.h> 28 27 #include <linux/platform_device.h> 29 28 #include <linux/err.h>
-1
drivers/input/misc/mc13783-pwrbutton.c
··· 20 20 */ 21 21 22 22 #include <linux/module.h> 23 - #include <linux/init.h> 24 23 #include <linux/kernel.h> 25 24 #include <linux/errno.h> 26 25 #include <linux/input.h>
-1
drivers/input/misc/mpu3050.c
··· 30 30 */ 31 31 32 32 #include <linux/module.h> 33 - #include <linux/init.h> 34 33 #include <linux/interrupt.h> 35 34 #include <linux/platform_device.h> 36 35 #include <linux/mutex.h>
-1
drivers/input/misc/pcap_keys.c
··· 12 12 */ 13 13 14 14 #include <linux/module.h> 15 - #include <linux/init.h> 16 15 #include <linux/interrupt.h> 17 16 #include <linux/platform_device.h> 18 17 #include <linux/input.h>
-1
drivers/input/misc/pcf50633-input.c
··· 16 16 17 17 #include <linux/kernel.h> 18 18 #include <linux/module.h> 19 - #include <linux/init.h> 20 19 #include <linux/device.h> 21 20 #include <linux/platform_device.h> 22 21 #include <linux/input.h>
-1
drivers/input/misc/pcf8574_keypad.c
··· 7 7 */ 8 8 9 9 #include <linux/module.h> 10 - #include <linux/init.h> 11 10 #include <linux/input.h> 12 11 #include <linux/interrupt.h> 13 12 #include <linux/i2c.h>
-1
drivers/input/misc/pcspkr.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/module.h> 17 17 #include <linux/i8253.h> 18 - #include <linux/init.h> 19 18 #include <linux/input.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/timex.h>
+26 -79
drivers/input/misc/pm8xxx-vibrator.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/init.h> 15 14 #include <linux/kernel.h> 16 15 #include <linux/errno.h> 17 16 #include <linux/platform_device.h> 18 17 #include <linux/input.h> 19 18 #include <linux/slab.h> 20 - #include <linux/mfd/pm8xxx/core.h> 19 + #include <linux/regmap.h> 21 20 22 21 #define VIB_DRV 0x4A 23 22 ··· 34 35 * struct pm8xxx_vib - structure to hold vibrator data 35 36 * @vib_input_dev: input device supporting force feedback 36 37 * @work: work structure to set the vibration parameters 37 - * @dev: device supporting force feedback 38 + * @regmap: regmap for register read/write 38 39 * @speed: speed of vibration set from userland 39 40 * @active: state of vibrator 40 41 * @level: level of vibration to set in the chip ··· 43 44 struct pm8xxx_vib { 44 45 struct input_dev *vib_input_dev; 45 46 struct work_struct work; 46 - struct device *dev; 47 + struct regmap *regmap; 47 48 int speed; 48 49 int level; 49 50 bool active; 50 51 u8 reg_vib_drv; 51 52 }; 52 - 53 - /** 54 - * pm8xxx_vib_read_u8 - helper to read a byte from pmic chip 55 - * @vib: pointer to vibrator structure 56 - * @data: placeholder for data to be read 57 - * @reg: register address 58 - */ 59 - static int pm8xxx_vib_read_u8(struct pm8xxx_vib *vib, 60 - u8 *data, u16 reg) 61 - { 62 - int rc; 63 - 64 - rc = pm8xxx_readb(vib->dev->parent, reg, data); 65 - if (rc < 0) 66 - dev_warn(vib->dev, "Error reading pm8xxx reg 0x%x(0x%x)\n", 67 - reg, rc); 68 - return rc; 69 - } 70 - 71 - /** 72 - * pm8xxx_vib_write_u8 - helper to write a byte to pmic chip 73 - * @vib: pointer to vibrator structure 74 - * @data: data to write 75 - * @reg: register address 76 - */ 77 - static int pm8xxx_vib_write_u8(struct pm8xxx_vib *vib, 78 - u8 data, u16 reg) 79 - { 80 - int rc; 81 - 82 - rc = pm8xxx_writeb(vib->dev->parent, reg, data); 83 - if (rc < 0) 84 - dev_warn(vib->dev, "Error writing pm8xxx reg 0x%x(0x%x)\n", 85 - reg, rc); 86 - return rc; 87 - } 88 53 89 54 /** 90 55 * pm8xxx_vib_set - handler to start/stop vibration ··· 58 95 static int pm8xxx_vib_set(struct pm8xxx_vib *vib, bool on) 59 96 { 60 97 int rc; 61 - u8 val = vib->reg_vib_drv; 98 + unsigned int val = vib->reg_vib_drv; 62 99 63 100 if (on) 64 101 val |= ((vib->level << VIB_DRV_SEL_SHIFT) & VIB_DRV_SEL_MASK); 65 102 else 66 103 val &= ~VIB_DRV_SEL_MASK; 67 104 68 - rc = pm8xxx_vib_write_u8(vib, val, VIB_DRV); 105 + rc = regmap_write(vib->regmap, VIB_DRV, val); 69 106 if (rc < 0) 70 107 return rc; 71 108 ··· 81 118 { 82 119 struct pm8xxx_vib *vib = container_of(work, struct pm8xxx_vib, work); 83 120 int rc; 84 - u8 val; 121 + unsigned int val; 85 122 86 - rc = pm8xxx_vib_read_u8(vib, &val, VIB_DRV); 123 + rc = regmap_read(vib->regmap, VIB_DRV, &val); 87 124 if (rc < 0) 88 125 return; 89 126 ··· 147 184 struct pm8xxx_vib *vib; 148 185 struct input_dev *input_dev; 149 186 int error; 150 - u8 val; 187 + unsigned int val; 151 188 152 - vib = kzalloc(sizeof(*vib), GFP_KERNEL); 153 - input_dev = input_allocate_device(); 154 - if (!vib || !input_dev) { 155 - dev_err(&pdev->dev, "couldn't allocate memory\n"); 156 - error = -ENOMEM; 157 - goto err_free_mem; 158 - } 189 + vib = devm_kzalloc(&pdev->dev, sizeof(*vib), GFP_KERNEL); 190 + if (!vib) 191 + return -ENOMEM; 192 + 193 + vib->regmap = dev_get_regmap(pdev->dev.parent, NULL); 194 + if (!vib->regmap) 195 + return -ENODEV; 196 + 197 + input_dev = devm_input_allocate_device(&pdev->dev); 198 + if (!input_dev) 199 + return -ENOMEM; 159 200 160 201 INIT_WORK(&vib->work, pm8xxx_work_handler); 161 - vib->dev = &pdev->dev; 162 202 vib->vib_input_dev = input_dev; 163 203 164 204 /* operate in manual mode */ 165 - error = pm8xxx_vib_read_u8(vib, &val, VIB_DRV); 205 + error = regmap_read(vib->regmap, VIB_DRV, &val); 166 206 if (error < 0) 167 - goto err_free_mem; 207 + return error; 208 + 168 209 val &= ~VIB_DRV_EN_MANUAL_MASK; 169 - error = pm8xxx_vib_write_u8(vib, val, VIB_DRV); 210 + error = regmap_write(vib->regmap, VIB_DRV, val); 170 211 if (error < 0) 171 - goto err_free_mem; 212 + return error; 172 213 173 214 vib->reg_vib_drv = val; 174 215 175 216 input_dev->name = "pm8xxx_vib_ffmemless"; 176 217 input_dev->id.version = 1; 177 - input_dev->dev.parent = &pdev->dev; 178 218 input_dev->close = pm8xxx_vib_close; 179 219 input_set_drvdata(input_dev, vib); 180 220 input_set_capability(vib->vib_input_dev, EV_FF, FF_RUMBLE); ··· 187 221 if (error) { 188 222 dev_err(&pdev->dev, 189 223 "couldn't register vibrator as FF device\n"); 190 - goto err_free_mem; 224 + return error; 191 225 } 192 226 193 227 error = input_register_device(input_dev); 194 228 if (error) { 195 229 dev_err(&pdev->dev, "couldn't register input device\n"); 196 - goto err_destroy_memless; 230 + return error; 197 231 } 198 232 199 233 platform_set_drvdata(pdev, vib); 200 - return 0; 201 - 202 - err_destroy_memless: 203 - input_ff_destroy(input_dev); 204 - err_free_mem: 205 - input_free_device(input_dev); 206 - kfree(vib); 207 - 208 - return error; 209 - } 210 - 211 - static int pm8xxx_vib_remove(struct platform_device *pdev) 212 - { 213 - struct pm8xxx_vib *vib = platform_get_drvdata(pdev); 214 - 215 - input_unregister_device(vib->vib_input_dev); 216 - kfree(vib); 217 - 218 234 return 0; 219 235 } 220 236 ··· 216 268 217 269 static struct platform_driver pm8xxx_vib_driver = { 218 270 .probe = pm8xxx_vib_probe, 219 - .remove = pm8xxx_vib_remove, 220 271 .driver = { 221 272 .name = "pm8xxx-vib", 222 273 .owner = THIS_MODULE,
+46 -64
drivers/input/misc/pmic8xxx-pwrkey.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/init.h> 15 14 #include <linux/kernel.h> 16 15 #include <linux/errno.h> 17 16 #include <linux/slab.h> 18 17 #include <linux/input.h> 19 18 #include <linux/interrupt.h> 20 19 #include <linux/platform_device.h> 20 + #include <linux/regmap.h> 21 21 #include <linux/log2.h> 22 22 23 - #include <linux/mfd/pm8xxx/core.h> 24 23 #include <linux/input/pmic8xxx-pwrkey.h> 25 24 26 25 #define PON_CNTL_1 0x1C ··· 31 32 * @key_press_irq: key press irq number 32 33 */ 33 34 struct pmic8xxx_pwrkey { 34 - struct input_dev *pwr; 35 35 int key_press_irq; 36 36 }; 37 37 38 - static irqreturn_t pwrkey_press_irq(int irq, void *_pwrkey) 38 + static irqreturn_t pwrkey_press_irq(int irq, void *_pwr) 39 39 { 40 - struct pmic8xxx_pwrkey *pwrkey = _pwrkey; 40 + struct input_dev *pwr = _pwr; 41 41 42 - input_report_key(pwrkey->pwr, KEY_POWER, 1); 43 - input_sync(pwrkey->pwr); 42 + input_report_key(pwr, KEY_POWER, 1); 43 + input_sync(pwr); 44 44 45 45 return IRQ_HANDLED; 46 46 } 47 47 48 - static irqreturn_t pwrkey_release_irq(int irq, void *_pwrkey) 48 + static irqreturn_t pwrkey_release_irq(int irq, void *_pwr) 49 49 { 50 - struct pmic8xxx_pwrkey *pwrkey = _pwrkey; 50 + struct input_dev *pwr = _pwr; 51 51 52 - input_report_key(pwrkey->pwr, KEY_POWER, 0); 53 - input_sync(pwrkey->pwr); 52 + input_report_key(pwr, KEY_POWER, 0); 53 + input_sync(pwr); 54 54 55 55 return IRQ_HANDLED; 56 56 } ··· 86 88 int key_press_irq = platform_get_irq(pdev, 1); 87 89 int err; 88 90 unsigned int delay; 89 - u8 pon_cntl; 91 + unsigned int pon_cntl; 92 + struct regmap *regmap; 90 93 struct pmic8xxx_pwrkey *pwrkey; 91 94 const struct pm8xxx_pwrkey_platform_data *pdata = 92 95 dev_get_platdata(&pdev->dev); ··· 102 103 return -EINVAL; 103 104 } 104 105 105 - pwrkey = kzalloc(sizeof(*pwrkey), GFP_KERNEL); 106 + regmap = dev_get_regmap(pdev->dev.parent, NULL); 107 + if (!regmap) { 108 + dev_err(&pdev->dev, "failed to locate regmap for the device\n"); 109 + return -ENODEV; 110 + } 111 + 112 + pwrkey = devm_kzalloc(&pdev->dev, sizeof(*pwrkey), GFP_KERNEL); 106 113 if (!pwrkey) 107 114 return -ENOMEM; 108 115 109 - pwr = input_allocate_device(); 116 + pwrkey->key_press_irq = key_press_irq; 117 + 118 + pwr = devm_input_allocate_device(&pdev->dev); 110 119 if (!pwr) { 111 120 dev_dbg(&pdev->dev, "Can't allocate power button\n"); 112 - err = -ENOMEM; 113 - goto free_pwrkey; 121 + return -ENOMEM; 114 122 } 115 123 116 124 input_set_capability(pwr, EV_KEY, KEY_POWER); 117 125 118 126 pwr->name = "pmic8xxx_pwrkey"; 119 127 pwr->phys = "pmic8xxx_pwrkey/input0"; 120 - pwr->dev.parent = &pdev->dev; 121 128 122 129 delay = (pdata->kpd_trigger_delay_us << 10) / USEC_PER_SEC; 123 130 delay = 1 + ilog2(delay); 124 131 125 - err = pm8xxx_readb(pdev->dev.parent, PON_CNTL_1, &pon_cntl); 132 + err = regmap_read(regmap, PON_CNTL_1, &pon_cntl); 126 133 if (err < 0) { 127 134 dev_err(&pdev->dev, "failed reading PON_CNTL_1 err=%d\n", err); 128 - goto free_input_dev; 135 + return err; 129 136 } 130 137 131 138 pon_cntl &= ~PON_CNTL_TRIG_DELAY_MASK; ··· 141 136 else 142 137 pon_cntl &= ~PON_CNTL_PULL_UP; 143 138 144 - err = pm8xxx_writeb(pdev->dev.parent, PON_CNTL_1, pon_cntl); 139 + err = regmap_write(regmap, PON_CNTL_1, pon_cntl); 145 140 if (err < 0) { 146 141 dev_err(&pdev->dev, "failed writing PON_CNTL_1 err=%d\n", err); 147 - goto free_input_dev; 142 + return err; 143 + } 144 + 145 + err = devm_request_irq(&pdev->dev, key_press_irq, pwrkey_press_irq, 146 + IRQF_TRIGGER_RISING, 147 + "pmic8xxx_pwrkey_press", pwr); 148 + if (err) { 149 + dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", 150 + key_press_irq, err); 151 + return err; 152 + } 153 + 154 + err = devm_request_irq(&pdev->dev, key_release_irq, pwrkey_release_irq, 155 + IRQF_TRIGGER_RISING, 156 + "pmic8xxx_pwrkey_release", pwr); 157 + if (err) { 158 + dev_err(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", 159 + key_release_irq, err); 160 + return err; 148 161 } 149 162 150 163 err = input_register_device(pwr); 151 164 if (err) { 152 - dev_dbg(&pdev->dev, "Can't register power key: %d\n", err); 153 - goto free_input_dev; 165 + dev_err(&pdev->dev, "Can't register power key: %d\n", err); 166 + return err; 154 167 } 155 - 156 - pwrkey->key_press_irq = key_press_irq; 157 - pwrkey->pwr = pwr; 158 168 159 169 platform_set_drvdata(pdev, pwrkey); 160 - 161 - err = request_irq(key_press_irq, pwrkey_press_irq, 162 - IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwrkey); 163 - if (err < 0) { 164 - dev_dbg(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", 165 - key_press_irq, err); 166 - goto unreg_input_dev; 167 - } 168 - 169 - err = request_irq(key_release_irq, pwrkey_release_irq, 170 - IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_release", pwrkey); 171 - if (err < 0) { 172 - dev_dbg(&pdev->dev, "Can't get %d IRQ for pwrkey: %d\n", 173 - key_release_irq, err); 174 - 175 - goto free_press_irq; 176 - } 177 - 178 170 device_init_wakeup(&pdev->dev, pdata->wakeup); 179 171 180 172 return 0; 181 - 182 - free_press_irq: 183 - free_irq(key_press_irq, pwrkey); 184 - unreg_input_dev: 185 - input_unregister_device(pwr); 186 - pwr = NULL; 187 - free_input_dev: 188 - input_free_device(pwr); 189 - free_pwrkey: 190 - kfree(pwrkey); 191 - return err; 192 173 } 193 174 194 175 static int pmic8xxx_pwrkey_remove(struct platform_device *pdev) 195 176 { 196 - struct pmic8xxx_pwrkey *pwrkey = platform_get_drvdata(pdev); 197 - int key_release_irq = platform_get_irq(pdev, 0); 198 - int key_press_irq = platform_get_irq(pdev, 1); 199 - 200 177 device_init_wakeup(&pdev->dev, 0); 201 - 202 - free_irq(key_press_irq, pwrkey); 203 - free_irq(key_release_irq, pwrkey); 204 - input_unregister_device(pwrkey->pwr); 205 - kfree(pwrkey); 206 178 207 179 return 0; 208 180 }
-1
drivers/input/misc/powermate.c
··· 31 31 #include <linux/kernel.h> 32 32 #include <linux/slab.h> 33 33 #include <linux/module.h> 34 - #include <linux/init.h> 35 34 #include <linux/spinlock.h> 36 35 #include <linux/usb/input.h> 37 36
+1 -1
drivers/input/misc/pwm-beeper.c
··· 68 68 69 69 static int pwm_beeper_probe(struct platform_device *pdev) 70 70 { 71 - unsigned long pwm_id = (unsigned long)pdev->dev.platform_data; 71 + unsigned long pwm_id = (unsigned long)dev_get_platdata(&pdev->dev); 72 72 struct pwm_beeper *beeper; 73 73 int error; 74 74
-1
drivers/input/misc/retu-pwrbutton.c
··· 17 17 */ 18 18 19 19 #include <linux/irq.h> 20 - #include <linux/init.h> 21 20 #include <linux/slab.h> 22 21 #include <linux/errno.h> 23 22 #include <linux/input.h>
-1
drivers/input/misc/rotary_encoder.c
··· 16 16 17 17 #include <linux/kernel.h> 18 18 #include <linux/module.h> 19 - #include <linux/init.h> 20 19 #include <linux/interrupt.h> 21 20 #include <linux/input.h> 22 21 #include <linux/device.h>
-1
drivers/input/misc/sgi_btns.c
··· 17 17 * along with this program; if not, write to the Free Software 18 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 19 */ 20 - #include <linux/init.h> 21 20 #include <linux/input-polldev.h> 22 21 #include <linux/ioport.h> 23 22 #include <linux/module.h>
-1
drivers/input/misc/sirfsoc-onkey.c
··· 7 7 */ 8 8 9 9 #include <linux/module.h> 10 - #include <linux/init.h> 11 10 #include <linux/interrupt.h> 12 11 #include <linux/delay.h> 13 12 #include <linux/platform_device.h>
+18 -28
drivers/input/misc/twl4030-pwrbutton.c
··· 52 52 return IRQ_HANDLED; 53 53 } 54 54 55 - static int __init twl4030_pwrbutton_probe(struct platform_device *pdev) 55 + static int twl4030_pwrbutton_probe(struct platform_device *pdev) 56 56 { 57 57 struct input_dev *pwr; 58 58 int irq = platform_get_irq(pdev, 0); 59 59 int err; 60 60 61 - pwr = input_allocate_device(); 61 + pwr = devm_input_allocate_device(&pdev->dev); 62 62 if (!pwr) { 63 - dev_dbg(&pdev->dev, "Can't allocate power button\n"); 63 + dev_err(&pdev->dev, "Can't allocate power button\n"); 64 64 return -ENOMEM; 65 65 } 66 66 ··· 70 70 pwr->phys = "twl4030_pwrbutton/input0"; 71 71 pwr->dev.parent = &pdev->dev; 72 72 73 - err = request_threaded_irq(irq, NULL, powerbutton_irq, 73 + err = devm_request_threaded_irq(&pwr->dev, irq, NULL, powerbutton_irq, 74 74 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, 75 75 "twl4030_pwrbutton", pwr); 76 76 if (err < 0) { 77 - dev_dbg(&pdev->dev, "Can't get IRQ for pwrbutton: %d\n", err); 78 - goto free_input_dev; 77 + dev_err(&pdev->dev, "Can't get IRQ for pwrbutton: %d\n", err); 78 + return err; 79 79 } 80 80 81 81 err = input_register_device(pwr); 82 82 if (err) { 83 - dev_dbg(&pdev->dev, "Can't register power button: %d\n", err); 84 - goto free_irq; 83 + dev_err(&pdev->dev, "Can't register power button: %d\n", err); 84 + return err; 85 85 } 86 86 87 87 platform_set_drvdata(pdev, pwr); 88 88 89 89 return 0; 90 - 91 - free_irq: 92 - free_irq(irq, pwr); 93 - free_input_dev: 94 - input_free_device(pwr); 95 - return err; 96 90 } 97 91 98 - static int __exit twl4030_pwrbutton_remove(struct platform_device *pdev) 99 - { 100 - struct input_dev *pwr = platform_get_drvdata(pdev); 101 - int irq = platform_get_irq(pdev, 0); 102 - 103 - free_irq(irq, pwr); 104 - input_unregister_device(pwr); 105 - 106 - return 0; 107 - } 92 + #ifdef CONFIG_OF 93 + static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = { 94 + { .compatible = "ti,twl4030-pwrbutton" }, 95 + {}, 96 + }; 97 + MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table); 98 + #endif 108 99 109 100 static struct platform_driver twl4030_pwrbutton_driver = { 110 - .remove = __exit_p(twl4030_pwrbutton_remove), 101 + .probe = twl4030_pwrbutton_probe, 111 102 .driver = { 112 103 .name = "twl4030_pwrbutton", 113 104 .owner = THIS_MODULE, 105 + .of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table), 114 106 }, 115 107 }; 116 - 117 - module_platform_driver_probe(twl4030_pwrbutton_driver, 118 - twl4030_pwrbutton_probe); 108 + module_platform_driver(twl4030_pwrbutton_driver); 119 109 120 110 MODULE_ALIAS("platform:twl4030_pwrbutton"); 121 111 MODULE_DESCRIPTION("Triton2 Power Button");
+4 -2
drivers/input/misc/twl4030-vibra.c
··· 185 185 if (pdata && pdata->coexist) 186 186 return true; 187 187 188 - if (of_find_node_by_name(node, "codec")) 188 + if (of_find_node_by_name(node, "codec")) { 189 + of_node_put(node); 189 190 return true; 191 + } 190 192 191 193 return false; 192 194 } 193 195 194 196 static int twl4030_vibra_probe(struct platform_device *pdev) 195 197 { 196 - struct twl4030_vibra_data *pdata = pdev->dev.platform_data; 198 + struct twl4030_vibra_data *pdata = dev_get_platdata(&pdev->dev); 197 199 struct device_node *twl4030_core_node = pdev->dev.parent->of_node; 198 200 struct vibra_info *info; 199 201 int ret;
+4 -4
drivers/input/misc/twl6040-vibra.c
··· 258 258 static int twl6040_vibra_probe(struct platform_device *pdev) 259 259 { 260 260 struct device *twl6040_core_dev = pdev->dev.parent; 261 - struct device_node *twl6040_core_node = NULL; 261 + struct device_node *twl6040_core_node; 262 262 struct vibra_info *info; 263 263 int vddvibl_uV = 0; 264 264 int vddvibr_uV = 0; 265 265 int ret; 266 266 267 - #ifdef CONFIG_OF 268 267 twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node, 269 268 "vibra"); 270 - #endif 271 - 272 269 if (!twl6040_core_node) { 273 270 dev_err(&pdev->dev, "parent of node is missing?\n"); 274 271 return -EINVAL; ··· 273 276 274 277 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 275 278 if (!info) { 279 + of_node_put(twl6040_core_node); 276 280 dev_err(&pdev->dev, "couldn't allocate memory\n"); 277 281 return -ENOMEM; 278 282 } ··· 292 294 &info->vibrmotor_res); 293 295 of_property_read_u32(twl6040_core_node, "ti,vddvibl-uV", &vddvibl_uV); 294 296 of_property_read_u32(twl6040_core_node, "ti,vddvibr-uV", &vddvibr_uV); 297 + 298 + of_node_put(twl6040_core_node); 295 299 296 300 if ((!info->vibldrv_res && !info->viblmotor_res) || 297 301 (!info->vibrdrv_res && !info->vibrmotor_res)) {
-1
drivers/input/misc/wm831x-on.c
··· 18 18 */ 19 19 20 20 #include <linux/module.h> 21 - #include <linux/init.h> 22 21 #include <linux/slab.h> 23 22 #include <linux/kernel.h> 24 23 #include <linux/errno.h>
-1
drivers/input/misc/yealink.c
··· 47 47 */ 48 48 49 49 #include <linux/kernel.h> 50 - #include <linux/init.h> 51 50 #include <linux/slab.h> 52 51 #include <linux/module.h> 53 52 #include <linux/rwsem.h>
+170 -38
drivers/input/mouse/alps.c
··· 277 277 } 278 278 279 279 /* 280 + * Process bitmap data for V5 protocols. Return value is null. 281 + * 282 + * The bitmaps don't have enough data to track fingers, so this function 283 + * only generates points representing a bounding box of at most two contacts. 284 + * These two points are returned in x1, y1, x2, and y2. 285 + */ 286 + static void alps_process_bitmap_dolphin(struct alps_data *priv, 287 + struct alps_fields *fields, 288 + int *x1, int *y1, int *x2, int *y2) 289 + { 290 + int box_middle_x, box_middle_y; 291 + unsigned int x_map, y_map; 292 + unsigned char start_bit, end_bit; 293 + unsigned char x_msb, x_lsb, y_msb, y_lsb; 294 + 295 + x_map = fields->x_map; 296 + y_map = fields->y_map; 297 + 298 + if (!x_map || !y_map) 299 + return; 300 + 301 + /* Get Most-significant and Least-significant bit */ 302 + x_msb = fls(x_map); 303 + x_lsb = ffs(x_map); 304 + y_msb = fls(y_map); 305 + y_lsb = ffs(y_map); 306 + 307 + /* Most-significant bit should never exceed max sensor line number */ 308 + if (x_msb > priv->x_bits || y_msb > priv->y_bits) 309 + return; 310 + 311 + *x1 = *y1 = *x2 = *y2 = 0; 312 + 313 + if (fields->fingers > 1) { 314 + start_bit = priv->x_bits - x_msb; 315 + end_bit = priv->x_bits - x_lsb; 316 + box_middle_x = (priv->x_max * (start_bit + end_bit)) / 317 + (2 * (priv->x_bits - 1)); 318 + 319 + start_bit = y_lsb - 1; 320 + end_bit = y_msb - 1; 321 + box_middle_y = (priv->y_max * (start_bit + end_bit)) / 322 + (2 * (priv->y_bits - 1)); 323 + *x1 = fields->x; 324 + *y1 = fields->y; 325 + *x2 = 2 * box_middle_x - *x1; 326 + *y2 = 2 * box_middle_y - *y1; 327 + } 328 + } 329 + 330 + /* 280 331 * Process bitmap data from v3 and v4 protocols. Returns the number of 281 332 * fingers detected. A return value of 0 means at least one of the 282 333 * bitmaps was empty. ··· 532 481 f->ts_middle = !!(p[3] & 0x40); 533 482 } 534 483 535 - static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p) 484 + static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p, 485 + struct psmouse *psmouse) 536 486 { 537 487 f->first_mp = !!(p[4] & 0x40); 538 488 f->is_mp = !!(p[0] & 0x40); ··· 554 502 alps_decode_buttons_v3(f, p); 555 503 } 556 504 557 - static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p) 505 + static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p, 506 + struct psmouse *psmouse) 558 507 { 559 - alps_decode_pinnacle(f, p); 508 + alps_decode_pinnacle(f, p, psmouse); 560 509 561 510 f->x_map |= (p[5] & 0x10) << 11; 562 511 f->y_map |= (p[5] & 0x20) << 6; 563 512 } 564 513 565 - static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p) 514 + static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p, 515 + struct psmouse *psmouse) 566 516 { 517 + u64 palm_data = 0; 518 + struct alps_data *priv = psmouse->private; 519 + 567 520 f->first_mp = !!(p[0] & 0x02); 568 521 f->is_mp = !!(p[0] & 0x20); 569 522 570 - f->fingers = ((p[0] & 0x6) >> 1 | 523 + if (!f->is_mp) { 524 + f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); 525 + f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); 526 + f->z = (p[0] & 4) ? 0 : p[5] & 0x7f; 527 + alps_decode_buttons_v3(f, p); 528 + } else { 529 + f->fingers = ((p[0] & 0x6) >> 1 | 571 530 (p[0] & 0x10) >> 2); 572 - f->x_map = ((p[2] & 0x60) >> 5) | 573 - ((p[4] & 0x7f) << 2) | 574 - ((p[5] & 0x7f) << 9) | 575 - ((p[3] & 0x07) << 16) | 576 - ((p[3] & 0x70) << 15) | 577 - ((p[0] & 0x01) << 22); 578 - f->y_map = (p[1] & 0x7f) | 579 - ((p[2] & 0x1f) << 7); 580 531 581 - f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); 582 - f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); 583 - f->z = (p[0] & 4) ? 0 : p[5] & 0x7f; 532 + palm_data = (p[1] & 0x7f) | 533 + ((p[2] & 0x7f) << 7) | 534 + ((p[4] & 0x7f) << 14) | 535 + ((p[5] & 0x7f) << 21) | 536 + ((p[3] & 0x07) << 28) | 537 + (((u64)p[3] & 0x70) << 27) | 538 + (((u64)p[0] & 0x01) << 34); 584 539 585 - alps_decode_buttons_v3(f, p); 540 + /* Y-profile is stored in P(0) to p(n-1), n = y_bits; */ 541 + f->y_map = palm_data & (BIT(priv->y_bits) - 1); 542 + 543 + /* X-profile is stored in p(n) to p(n+m-1), m = x_bits; */ 544 + f->x_map = (palm_data >> priv->y_bits) & 545 + (BIT(priv->x_bits) - 1); 546 + } 586 547 } 587 548 588 - static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) 549 + static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse) 589 550 { 590 551 struct alps_data *priv = psmouse->private; 591 552 unsigned char *packet = psmouse->packet; 592 553 struct input_dev *dev = psmouse->dev; 593 554 struct input_dev *dev2 = priv->dev2; 594 555 int x1 = 0, y1 = 0, x2 = 0, y2 = 0; 595 - int fingers = 0, bmap_fingers; 596 - struct alps_fields f; 556 + int fingers = 0, bmap_fn; 557 + struct alps_fields f = {0}; 597 558 598 - priv->decode_fields(&f, packet); 559 + priv->decode_fields(&f, packet, psmouse); 599 560 600 561 /* 601 562 * There's no single feature of touchpad position and bitmap packets ··· 625 560 */ 626 561 if (f.is_mp) { 627 562 fingers = f.fingers; 628 - bmap_fingers = alps_process_bitmap(priv, 629 - f.x_map, f.y_map, 630 - &x1, &y1, &x2, &y2); 563 + if (priv->proto_version == ALPS_PROTO_V3) { 564 + bmap_fn = alps_process_bitmap(priv, f.x_map, 565 + f.y_map, &x1, &y1, 566 + &x2, &y2); 631 567 632 - /* 633 - * We shouldn't report more than one finger if 634 - * we don't have two coordinates. 635 - */ 636 - if (fingers > 1 && bmap_fingers < 2) 637 - fingers = bmap_fingers; 568 + /* 569 + * We shouldn't report more than one finger if 570 + * we don't have two coordinates. 571 + */ 572 + if (fingers > 1 && bmap_fn < 2) 573 + fingers = bmap_fn; 638 574 639 - /* Now process position packet */ 640 - priv->decode_fields(&f, priv->multi_data); 575 + /* Now process position packet */ 576 + priv->decode_fields(&f, priv->multi_data, 577 + psmouse); 578 + } else { 579 + /* 580 + * Because Dolphin uses position packet's 581 + * coordinate data as Pt1 and uses it to 582 + * calculate Pt2, so we need to do position 583 + * packet decode first. 584 + */ 585 + priv->decode_fields(&f, priv->multi_data, 586 + psmouse); 587 + 588 + /* 589 + * Since Dolphin's finger number is reliable, 590 + * there is no need to compare with bmap_fn. 591 + */ 592 + alps_process_bitmap_dolphin(priv, &f, &x1, &y1, 593 + &x2, &y2); 594 + } 641 595 } else { 642 596 priv->multi_packet = 0; 643 597 } ··· 746 662 return; 747 663 } 748 664 749 - alps_process_touchpad_packet_v3(psmouse); 665 + alps_process_touchpad_packet_v3_v5(psmouse); 750 666 } 751 667 752 668 static void alps_process_packet_v6(struct psmouse *psmouse) ··· 1793 1709 return -1; 1794 1710 } 1795 1711 1712 + static int alps_dolphin_get_device_area(struct psmouse *psmouse, 1713 + struct alps_data *priv) 1714 + { 1715 + struct ps2dev *ps2dev = &psmouse->ps2dev; 1716 + unsigned char param[4] = {0}; 1717 + int num_x_electrode, num_y_electrode; 1718 + 1719 + if (alps_enter_command_mode(psmouse)) 1720 + return -1; 1721 + 1722 + param[0] = 0x0a; 1723 + if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) || 1724 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETPOLL) || 1725 + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETPOLL) || 1726 + ps2_command(ps2dev, &param[0], PSMOUSE_CMD_SETRATE) || 1727 + ps2_command(ps2dev, &param[0], PSMOUSE_CMD_SETRATE)) 1728 + return -1; 1729 + 1730 + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) 1731 + return -1; 1732 + 1733 + /* 1734 + * Dolphin's sensor line number is not fixed. It can be calculated 1735 + * by adding the device's register value with DOLPHIN_PROFILE_X/YOFFSET. 1736 + * Further more, we can get device's x_max and y_max by multiplying 1737 + * sensor line number with DOLPHIN_COUNT_PER_ELECTRODE. 1738 + * 1739 + * e.g. When we get register's sensor_x = 11 & sensor_y = 8, 1740 + * real sensor line number X = 11 + 8 = 19, and 1741 + * real sensor line number Y = 8 + 1 = 9. 1742 + * So, x_max = (19 - 1) * 64 = 1152, and 1743 + * y_max = (9 - 1) * 64 = 512. 1744 + */ 1745 + num_x_electrode = DOLPHIN_PROFILE_XOFFSET + (param[2] & 0x0F); 1746 + num_y_electrode = DOLPHIN_PROFILE_YOFFSET + ((param[2] >> 4) & 0x0F); 1747 + priv->x_bits = num_x_electrode; 1748 + priv->y_bits = num_y_electrode; 1749 + priv->x_max = (num_x_electrode - 1) * DOLPHIN_COUNT_PER_ELECTRODE; 1750 + priv->y_max = (num_y_electrode - 1) * DOLPHIN_COUNT_PER_ELECTRODE; 1751 + 1752 + if (alps_exit_command_mode(psmouse)) 1753 + return -1; 1754 + 1755 + return 0; 1756 + } 1757 + 1796 1758 static int alps_hw_init_dolphin_v1(struct psmouse *psmouse) 1797 1759 { 1798 1760 struct ps2dev *ps2dev = &psmouse->ps2dev; ··· 1893 1763 break; 1894 1764 case ALPS_PROTO_V5: 1895 1765 priv->hw_init = alps_hw_init_dolphin_v1; 1896 - priv->process_packet = alps_process_packet_v3; 1766 + priv->process_packet = alps_process_touchpad_packet_v3_v5; 1897 1767 priv->decode_fields = alps_decode_dolphin; 1898 1768 priv->set_abs_params = alps_set_abs_params_mt; 1899 1769 priv->nibble_commands = alps_v3_nibble_commands; 1900 1770 priv->addr_command = PSMOUSE_CMD_RESET_WRAP; 1901 1771 priv->byte0 = 0xc8; 1902 - priv->mask0 = 0xc8; 1772 + priv->mask0 = 0xd8; 1903 1773 priv->flags = 0; 1904 1774 priv->x_max = 1360; 1905 1775 priv->y_max = 660; ··· 1975 1845 if (alps_match_table(psmouse, priv, e7, ec) == 0) { 1976 1846 return 0; 1977 1847 } else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0x50 && 1978 - ec[0] == 0x73 && ec[1] == 0x01) { 1848 + ec[0] == 0x73 && (ec[1] == 0x01 || ec[1] == 0x02)) { 1979 1849 priv->proto_version = ALPS_PROTO_V5; 1980 1850 alps_set_defaults(priv); 1981 - 1982 - return 0; 1851 + if (alps_dolphin_get_device_area(psmouse, priv)) 1852 + return -EIO; 1853 + else 1854 + return 0; 1983 1855 } else if (ec[0] == 0x88 && ec[1] == 0x08) { 1984 1856 priv->proto_version = ALPS_PROTO_V3; 1985 1857 alps_set_defaults(priv);
+6 -1
drivers/input/mouse/alps.h
··· 19 19 #define ALPS_PROTO_V5 5 20 20 #define ALPS_PROTO_V6 6 21 21 22 + #define DOLPHIN_COUNT_PER_ELECTRODE 64 23 + #define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */ 24 + #define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */ 25 + 22 26 /** 23 27 * struct alps_model_info - touchpad ID table 24 28 * @signature: E7 response string to match. ··· 150 146 151 147 int (*hw_init)(struct psmouse *psmouse); 152 148 void (*process_packet)(struct psmouse *psmouse); 153 - void (*decode_fields)(struct alps_fields *f, unsigned char *p); 149 + void (*decode_fields)(struct alps_fields *f, unsigned char *p, 150 + struct psmouse *psmouse); 154 151 void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); 155 152 156 153 int prev_fin;
-1
drivers/input/mouse/appletouch.c
··· 30 30 31 31 #include <linux/kernel.h> 32 32 #include <linux/errno.h> 33 - #include <linux/init.h> 34 33 #include <linux/slab.h> 35 34 #include <linux/module.h> 36 35 #include <linux/usb/input.h>
-1
drivers/input/mouse/bcm5974.c
··· 34 34 35 35 #include <linux/kernel.h> 36 36 #include <linux/errno.h> 37 - #include <linux/init.h> 38 37 #include <linux/slab.h> 39 38 #include <linux/module.h> 40 39 #include <linux/usb/input.h>
-1
drivers/input/mouse/cypress_ps2.c
··· 15 15 * the Free Software Foundation. 16 16 */ 17 17 18 - #include <linux/init.h> 19 18 #include <linux/module.h> 20 19 #include <linux/kernel.h> 21 20 #include <linux/slab.h>
+42 -3
drivers/input/mouse/elantech.c
··· 486 486 unsigned char *packet = psmouse->packet; 487 487 488 488 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); 489 + input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); 489 490 input_mt_report_pointer_emulation(dev, true); 490 491 input_sync(dev); 491 492 } ··· 985 984 } 986 985 987 986 /* 987 + * Advertise INPUT_PROP_BUTTONPAD for clickpads. The testing of bit 12 in 988 + * fw_version for this is based on the following fw_version & caps table: 989 + * 990 + * Laptop-model: fw_version: caps: buttons: 991 + * Acer S3 0x461f00 10, 13, 0e clickpad 992 + * Acer S7-392 0x581f01 50, 17, 0d clickpad 993 + * Acer V5-131 0x461f02 01, 16, 0c clickpad 994 + * Acer V5-551 0x461f00 ? clickpad 995 + * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons 996 + * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons 997 + * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons 998 + * Asus UX31 0x361f00 20, 15, 0e clickpad 999 + * Asus UX32VD 0x361f02 00, 15, 0e clickpad 1000 + * Avatar AVIU-145A2 0x361f00 ? clickpad 1001 + * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons 1002 + * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*) 1003 + * Samsung NF210 0x150b00 78, 14, 0a 2 hw buttons 1004 + * Samsung NP770Z5E 0x575f01 10, 15, 0f clickpad 1005 + * Samsung NP700Z5B 0x361f06 21, 15, 0f clickpad 1006 + * Samsung NP900X3E-A02 0x575f03 ? clickpad 1007 + * Samsung NP-QX410 0x851b00 19, 14, 0c clickpad 1008 + * Samsung RC512 0x450f00 08, 15, 0c 2 hw buttons 1009 + * Samsung RF710 0x450f00 ? 2 hw buttons 1010 + * System76 Pangolin 0x250f01 ? 2 hw buttons 1011 + * (*) + 3 trackpoint buttons 1012 + */ 1013 + static void elantech_set_buttonpad_prop(struct psmouse *psmouse) 1014 + { 1015 + struct input_dev *dev = psmouse->dev; 1016 + struct elantech_data *etd = psmouse->private; 1017 + 1018 + if (etd->fw_version & 0x001000) { 1019 + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); 1020 + __clear_bit(BTN_RIGHT, dev->keybit); 1021 + } 1022 + } 1023 + 1024 + /* 988 1025 * Set the appropriate event bits for the input subsystem 989 1026 */ 990 1027 static int elantech_set_input_params(struct psmouse *psmouse) ··· 1065 1026 __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); 1066 1027 /* fall through */ 1067 1028 case 3: 1029 + if (etd->hw_version == 3) 1030 + elantech_set_buttonpad_prop(psmouse); 1068 1031 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); 1069 1032 input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0); 1070 1033 if (etd->reports_pressure) { ··· 1088 1047 */ 1089 1048 psmouse_warn(psmouse, "couldn't query resolution data.\n"); 1090 1049 } 1091 - /* v4 is clickpad, with only one button. */ 1092 - __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); 1093 - __clear_bit(BTN_RIGHT, dev->keybit); 1050 + elantech_set_buttonpad_prop(psmouse); 1094 1051 __set_bit(BTN_TOOL_QUADTAP, dev->keybit); 1095 1052 /* For X to recognize me as touchpad. */ 1096 1053 input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
+1 -2
drivers/input/mouse/gpio_mouse.c
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 - #include <linux/init.h> 12 11 #include <linux/module.h> 13 12 #include <linux/platform_device.h> 14 13 #include <linux/input-polldev.h> ··· 47 48 48 49 static int gpio_mouse_probe(struct platform_device *pdev) 49 50 { 50 - struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; 51 + struct gpio_mouse_platform_data *pdata = dev_get_platdata(&pdev->dev); 51 52 struct input_polled_dev *input_poll; 52 53 struct input_dev *input; 53 54 int pin, i;
+1 -1
drivers/input/mouse/logips2pp.c
··· 220 220 { 61, PS2PP_KIND_MX, /* MX700 */ 221 221 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 222 222 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN }, 223 - { 66, PS2PP_KIND_MX, /* MX3100 reciver */ 223 + { 66, PS2PP_KIND_MX, /* MX3100 receiver */ 224 224 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 225 225 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, 226 226 { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */
-1
drivers/input/mouse/navpoint.c
··· 9 9 */ 10 10 11 11 #include <linux/kernel.h> 12 - #include <linux/init.h> 13 12 #include <linux/module.h> 14 13 #include <linux/platform_device.h> 15 14 #include <linux/clk.h>
+1 -2
drivers/input/mouse/pxa930_trkball.c
··· 10 10 * published by the Free Software Foundation. 11 11 */ 12 12 13 - #include <linux/init.h> 14 13 #include <linux/input.h> 15 14 #include <linux/interrupt.h> 16 15 #include <linux/module.h> ··· 165 166 if (!trkball) 166 167 return -ENOMEM; 167 168 168 - trkball->pdata = pdev->dev.platform_data; 169 + trkball->pdata = dev_get_platdata(&pdev->dev); 169 170 if (!trkball->pdata) { 170 171 dev_err(&pdev->dev, "no platform data defined\n"); 171 172 error = -EINVAL;
-1
drivers/input/mouse/sermouse.c
··· 32 32 #include <linux/interrupt.h> 33 33 #include <linux/input.h> 34 34 #include <linux/serio.h> 35 - #include <linux/init.h> 36 35 37 36 #define DRIVER_DESC "Serial mouse driver" 38 37
-1
drivers/input/mouse/synaptics_usb.c
··· 39 39 */ 40 40 41 41 #include <linux/kernel.h> 42 - #include <linux/init.h> 43 42 #include <linux/slab.h> 44 43 #include <linux/module.h> 45 44 #include <linux/moduleparam.h>
-1
drivers/input/mouse/vsxxxaa.c
··· 82 82 #include <linux/interrupt.h> 83 83 #include <linux/input.h> 84 84 #include <linux/serio.h> 85 - #include <linux/init.h> 86 85 87 86 #define DRIVER_DESC "Driver for DEC VSXXX-AA and -GA mice and VSXXX-AB tablet" 88 87
+8 -3
drivers/input/serio/Kconfig
··· 16 16 To compile this driver as a module, choose M here: the 17 17 module will be called serio. 18 18 19 + config ARCH_MIGHT_HAVE_PC_SERIO 20 + bool 21 + help 22 + Select this config option from the architecture Kconfig if 23 + the architecture might use a PC serio device (i8042) to 24 + communicate with keyboard, mouse, etc. 25 + 19 26 if SERIO 20 27 21 28 config SERIO_I8042 22 29 tristate "i8042 PC Keyboard controller" 23 30 default y 24 - depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \ 25 - (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \ 26 - !ARC 31 + depends on ARCH_MIGHT_HAVE_PC_SERIO 27 32 help 28 33 i8042 is the chip over which the standard AT keyboard and PS/2 29 34 mouse are connected to the computer. If you use these devices,
-1
drivers/input/serio/altera_ps2.c
··· 12 12 */ 13 13 14 14 #include <linux/module.h> 15 - #include <linux/init.h> 16 15 #include <linux/input.h> 17 16 #include <linux/serio.h> 18 17 #include <linux/interrupt.h>
-1
drivers/input/serio/ambakmi.c
··· 10 10 * (at your option) any later version. 11 11 */ 12 12 #include <linux/module.h> 13 - #include <linux/init.h> 14 13 #include <linux/serio.h> 15 14 #include <linux/errno.h> 16 15 #include <linux/interrupt.h>
+3 -1
drivers/input/serio/hyperv-keyboard.c
··· 160 160 if (info & IS_E0) 161 161 serio_interrupt(kbd_dev->hv_serio, 162 162 XTKBD_EMUL0, 0); 163 - 163 + if (info & IS_E1) 164 + serio_interrupt(kbd_dev->hv_serio, 165 + XTKBD_EMUL1, 0); 164 166 scan_code = __le16_to_cpu(ks_msg->make_code); 165 167 if (info & IS_BREAK) 166 168 scan_code |= XTKBD_RELEASE;
-1
drivers/input/serio/libps2.c
··· 18 18 #include <linux/input.h> 19 19 #include <linux/serio.h> 20 20 #include <linux/i8042.h> 21 - #include <linux/init.h> 22 21 #include <linux/libps2.h> 23 22 24 23 #define DRIVER_DESC "PS/2 driver library"
-1
drivers/input/serio/olpc_apsp.c
··· 16 16 17 17 #include <linux/module.h> 18 18 #include <linux/interrupt.h> 19 - #include <linux/init.h> 20 19 #include <linux/serio.h> 21 20 #include <linux/err.h> 22 21 #include <linux/platform_device.h>
-2
drivers/input/serio/pcips2.c
··· 16 16 #include <linux/input.h> 17 17 #include <linux/pci.h> 18 18 #include <linux/slab.h> 19 - #include <linux/init.h> 20 19 #include <linux/serio.h> 21 20 #include <linux/delay.h> 22 21 #include <asm/io.h> ··· 180 181 struct pcips2_data *ps2if = pci_get_drvdata(dev); 181 182 182 183 serio_unregister_port(ps2if->io); 183 - pci_set_drvdata(dev, NULL); 184 184 kfree(ps2if); 185 185 pci_release_regions(dev); 186 186 pci_disable_device(dev);
-1
drivers/input/serio/q40kbd.c
··· 30 30 */ 31 31 32 32 #include <linux/module.h> 33 - #include <linux/init.h> 34 33 #include <linux/serio.h> 35 34 #include <linux/interrupt.h> 36 35 #include <linux/err.h>
-1
drivers/input/serio/rpckbd.c
··· 29 29 30 30 #include <linux/module.h> 31 31 #include <linux/interrupt.h> 32 - #include <linux/init.h> 33 32 #include <linux/serio.h> 34 33 #include <linux/err.h> 35 34 #include <linux/platform_device.h>
-1
drivers/input/serio/serio_raw.c
··· 15 15 #include <linux/poll.h> 16 16 #include <linux/module.h> 17 17 #include <linux/serio.h> 18 - #include <linux/init.h> 19 18 #include <linux/major.h> 20 19 #include <linux/device.h> 21 20 #include <linux/miscdevice.h>
-1
drivers/input/serio/xilinx_ps2.c
··· 20 20 #include <linux/interrupt.h> 21 21 #include <linux/errno.h> 22 22 #include <linux/slab.h> 23 - #include <linux/init.h> 24 23 #include <linux/list.h> 25 24 #include <linux/io.h> 26 25 #include <linux/of_address.h>
-1
drivers/input/tablet/acecad.c
··· 28 28 #include <linux/kernel.h> 29 29 #include <linux/slab.h> 30 30 #include <linux/module.h> 31 - #include <linux/init.h> 32 31 #include <linux/usb/input.h> 33 32 34 33 /*
-1
drivers/input/tablet/aiptek.c
··· 74 74 #include <linux/kernel.h> 75 75 #include <linux/slab.h> 76 76 #include <linux/module.h> 77 - #include <linux/init.h> 78 77 #include <linux/usb/input.h> 79 78 #include <asm/uaccess.h> 80 79 #include <asm/unaligned.h>
-1
drivers/input/tablet/gtco.c
··· 53 53 #include <linux/kernel.h> 54 54 #include <linux/module.h> 55 55 #include <linux/errno.h> 56 - #include <linux/init.h> 57 56 #include <linux/slab.h> 58 57 #include <linux/input.h> 59 58 #include <linux/usb.h>
-1
drivers/input/tablet/hanwang.c
··· 26 26 #include <linux/kernel.h> 27 27 #include <linux/slab.h> 28 28 #include <linux/module.h> 29 - #include <linux/init.h> 30 29 #include <linux/usb/input.h> 31 30 32 31 #define DRIVER_AUTHOR "Xing Wei <weixing@hanwang.com.cn>"
-1
drivers/input/tablet/kbtab.c
··· 1 1 #include <linux/kernel.h> 2 2 #include <linux/slab.h> 3 3 #include <linux/module.h> 4 - #include <linux/init.h> 5 4 #include <linux/usb/input.h> 6 5 #include <asm/unaligned.h> 7 6
-1
drivers/input/tablet/wacom.h
··· 86 86 #include <linux/slab.h> 87 87 #include <linux/module.h> 88 88 #include <linux/mod_devicetable.h> 89 - #include <linux/init.h> 90 89 #include <linux/usb/input.h> 91 90 #include <linux/power_supply.h> 92 91 #include <asm/unaligned.h>
+19 -4
drivers/input/tablet/wacom_sys.c
··· 304 304 struct usb_device *dev = interface_to_usbdev(intf); 305 305 char limit = 0; 306 306 /* result has to be defined as int for some devices */ 307 - int result = 0; 307 + int result = 0, touch_max = 0; 308 308 int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0; 309 309 unsigned char *report; 310 310 ··· 351 351 if (usage == WCM_DESKTOP) { 352 352 if (finger) { 353 353 features->device_type = BTN_TOOL_FINGER; 354 - 354 + /* touch device at least supports one touch point */ 355 + touch_max = 1; 355 356 switch (features->type) { 356 357 case TABLETPC2FG: 357 358 features->pktlen = WACOM_PKGLEN_TPC2FG; ··· 505 504 } 506 505 507 506 out: 507 + if (!features->touch_max && touch_max) 508 + features->touch_max = touch_max; 508 509 result = 0; 509 510 kfree(report); 510 511 return result; ··· 1197 1194 wacom_wac1->features.device_type = BTN_TOOL_PEN; 1198 1195 snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen", 1199 1196 wacom_wac1->features.name); 1197 + wacom_wac1->shared->touch_max = wacom_wac1->features.touch_max; 1198 + wacom_wac1->shared->type = wacom_wac1->features.type; 1200 1199 error = wacom_register_input(wacom1); 1201 1200 if (error) 1202 1201 goto fail; 1203 1202 1204 1203 /* Touch interface */ 1205 - if (wacom_wac1->features.touch_max) { 1204 + if (wacom_wac1->features.touch_max || 1205 + wacom_wac1->features.type == INTUOSHT) { 1206 1206 wacom_wac2->features = 1207 1207 *((struct wacom_features *)id->driver_info); 1208 1208 wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3; ··· 1220 1214 error = wacom_register_input(wacom2); 1221 1215 if (error) 1222 1216 goto fail; 1217 + 1218 + if (wacom_wac1->features.type == INTUOSHT && 1219 + wacom_wac1->features.touch_max) 1220 + wacom_wac->shared->touch_input = wacom_wac2->input; 1223 1221 } 1224 1222 1225 1223 error = wacom_initialize_battery(wacom); ··· 1332 1322 * HID descriptor. If this is the touch interface (wMaxPacketSize 1333 1323 * of WACOM_PKGLEN_BBTOUCH3), override the table values. 1334 1324 */ 1335 - if (features->type >= INTUOS5S && features->type <= INTUOSPL) { 1325 + if (features->type >= INTUOS5S && features->type <= INTUOSHT) { 1336 1326 if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) { 1337 1327 features->device_type = BTN_TOOL_FINGER; 1338 1328 features->pktlen = WACOM_PKGLEN_BBTOUCH3; ··· 1401 1391 error = -EIO; 1402 1392 goto fail5; 1403 1393 } 1394 + } 1395 + 1396 + if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) { 1397 + if (wacom_wac->features.device_type == BTN_TOOL_FINGER) 1398 + wacom_wac->shared->touch_input = wacom_wac->input; 1404 1399 } 1405 1400 1406 1401 return 0;
+147 -22
drivers/input/tablet/wacom_wac.c
··· 210 210 return 1; 211 211 } 212 212 213 + static int wacom_dtus_irq(struct wacom_wac *wacom) 214 + { 215 + char *data = wacom->data; 216 + struct input_dev *input = wacom->input; 217 + unsigned short prox, pressure = 0; 218 + 219 + if (data[0] != WACOM_REPORT_DTUS && data[0] != WACOM_REPORT_DTUSPAD) { 220 + dev_dbg(input->dev.parent, 221 + "%s: received unknown report #%d", __func__, data[0]); 222 + return 0; 223 + } else if (data[0] == WACOM_REPORT_DTUSPAD) { 224 + input_report_key(input, BTN_0, (data[1] & 0x01)); 225 + input_report_key(input, BTN_1, (data[1] & 0x02)); 226 + input_report_key(input, BTN_2, (data[1] & 0x04)); 227 + input_report_key(input, BTN_3, (data[1] & 0x08)); 228 + input_report_abs(input, ABS_MISC, 229 + data[1] & 0x0f ? PAD_DEVICE_ID : 0); 230 + /* 231 + * Serial number is required when expresskeys are 232 + * reported through pen interface. 233 + */ 234 + input_event(input, EV_MSC, MSC_SERIAL, 0xf0); 235 + return 1; 236 + } else { 237 + prox = data[1] & 0x80; 238 + if (prox) { 239 + switch ((data[1] >> 3) & 3) { 240 + case 1: /* Rubber */ 241 + wacom->tool[0] = BTN_TOOL_RUBBER; 242 + wacom->id[0] = ERASER_DEVICE_ID; 243 + break; 244 + 245 + case 2: /* Pen */ 246 + wacom->tool[0] = BTN_TOOL_PEN; 247 + wacom->id[0] = STYLUS_DEVICE_ID; 248 + break; 249 + } 250 + } 251 + 252 + input_report_key(input, BTN_STYLUS, data[1] & 0x20); 253 + input_report_key(input, BTN_STYLUS2, data[1] & 0x40); 254 + input_report_abs(input, ABS_X, get_unaligned_be16(&data[3])); 255 + input_report_abs(input, ABS_Y, get_unaligned_be16(&data[5])); 256 + pressure = ((data[1] & 0x03) << 8) | (data[2] & 0xff); 257 + input_report_abs(input, ABS_PRESSURE, pressure); 258 + input_report_key(input, BTN_TOUCH, pressure > 10); 259 + 260 + if (!prox) /* out-prox */ 261 + wacom->id[0] = 0; 262 + input_report_key(input, wacom->tool[0], prox); 263 + input_report_abs(input, ABS_MISC, wacom->id[0]); 264 + input_event(input, EV_MSC, MSC_SERIAL, 1); 265 + return 1; 266 + } 267 + } 268 + 213 269 static int wacom_graphire_irq(struct wacom_wac *wacom) 214 270 { 215 271 struct wacom_features *features = &wacom->features; ··· 387 331 388 332 /* Enter report */ 389 333 if ((data[1] & 0xfc) == 0xc0) { 390 - if (features->quirks == WACOM_QUIRK_MULTI_INPUT) 334 + if (features->quirks & WACOM_QUIRK_MULTI_INPUT) 391 335 wacom->shared->stylus_in_proximity = true; 392 336 393 337 /* serial number of the tool */ ··· 492 436 493 437 /* Exit report */ 494 438 if ((data[1] & 0xfe) == 0x80) { 495 - if (features->quirks == WACOM_QUIRK_MULTI_INPUT) 439 + if (features->quirks & WACOM_QUIRK_MULTI_INPUT) 496 440 wacom->shared->stylus_in_proximity = false; 497 441 498 442 /* ··· 1207 1151 int width, height; 1208 1152 1209 1153 if (features->type >= INTUOSPS && features->type <= INTUOSPL) { 1210 - width = data[5]; 1211 - height = data[6]; 1154 + width = data[5] * 100; 1155 + height = data[6] * 100; 1212 1156 } else { 1213 1157 /* 1214 1158 * "a" is a scaled-down area which we assume is ··· 1232 1176 static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) 1233 1177 { 1234 1178 struct input_dev *input = wacom->input; 1179 + struct wacom_features *features = &wacom->features; 1235 1180 1236 - input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); 1181 + if (features->type == INTUOSHT) { 1182 + input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0); 1183 + input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0); 1184 + } else { 1185 + input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); 1186 + input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); 1187 + } 1237 1188 input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); 1238 - input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); 1239 1189 input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); 1240 1190 } 1241 1191 ··· 1275 1213 1276 1214 static int wacom_bpt_pen(struct wacom_wac *wacom) 1277 1215 { 1216 + struct wacom_features *features = &wacom->features; 1278 1217 struct input_dev *input = wacom->input; 1279 1218 unsigned char *data = wacom->data; 1280 1219 int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; 1281 1220 1282 - if (data[0] != 0x02) 1221 + if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB) 1283 1222 return 0; 1223 + 1224 + if (data[0] == WACOM_REPORT_USB) { 1225 + if (features->type == INTUOSHT && features->touch_max) { 1226 + input_report_switch(wacom->shared->touch_input, 1227 + SW_MUTE_DEVICE, data[8] & 0x40); 1228 + input_sync(wacom->shared->touch_input); 1229 + } 1230 + return 0; 1231 + } 1284 1232 1285 1233 prox = (data[1] & 0x20) == 0x20; 1286 1234 ··· 1324 1252 * touching and applying pressure; do not report negative 1325 1253 * distance. 1326 1254 */ 1327 - if (data[8] <= wacom->features.distance_max) 1328 - d = wacom->features.distance_max - data[8]; 1255 + if (data[8] <= features->distance_max) 1256 + d = features->distance_max - data[8]; 1329 1257 1330 1258 pen = data[1] & 0x01; 1331 1259 btn1 = data[1] & 0x02; ··· 1369 1297 unsigned char *data = wacom->data; 1370 1298 int connected; 1371 1299 1372 - if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80) 1300 + if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL) 1373 1301 return 0; 1374 1302 1375 1303 connected = data[1] & 0x01; 1376 1304 if (connected) { 1377 1305 int pid, battery; 1306 + 1307 + if ((wacom->shared->type == INTUOSHT) && 1308 + wacom->shared->touch_max) { 1309 + input_report_switch(wacom->shared->touch_input, 1310 + SW_MUTE_DEVICE, data[5] & 0x40); 1311 + input_sync(wacom->shared->touch_input); 1312 + } 1378 1313 1379 1314 pid = get_unaligned_be16(&data[6]); 1380 1315 battery = data[5] & 0x3f; ··· 1427 1348 sync = wacom_dtu_irq(wacom_wac); 1428 1349 break; 1429 1350 1351 + case DTUS: 1352 + sync = wacom_dtus_irq(wacom_wac); 1353 + break; 1354 + 1430 1355 case INTUOS: 1431 1356 case INTUOS3S: 1432 1357 case INTUOS3: ··· 1474 1391 break; 1475 1392 1476 1393 case BAMBOO_PT: 1394 + case INTUOSHT: 1477 1395 sync = wacom_bpt_irq(wacom_wac, len); 1478 1396 break; 1479 1397 ··· 1543 1459 1544 1460 /* these device have multiple inputs */ 1545 1461 if (features->type >= WIRELESS || 1546 - (features->type >= INTUOS5S && features->type <= INTUOSPL) || 1462 + (features->type >= INTUOS5S && features->type <= INTUOSHT) || 1547 1463 (features->oVid && features->oPid)) 1548 1464 features->quirks |= WACOM_QUIRK_MULTI_INPUT; 1549 1465 ··· 1622 1538 1623 1539 wacom_abs_set_axis(input_dev, wacom_wac); 1624 1540 1625 - switch (wacom_wac->features.type) { 1541 + switch (features->type) { 1626 1542 case WACOM_MO: 1627 1543 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); 1628 1544 /* fall through */ ··· 1833 1749 1834 1750 /* fall through */ 1835 1751 1752 + case DTUS: 1836 1753 case PL: 1837 1754 case DTU: 1755 + if (features->type == DTUS) { 1756 + input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1757 + for (i = 0; i < 3; i++) 1758 + __set_bit(BTN_0 + i, input_dev->keybit); 1759 + } 1838 1760 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1839 1761 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1840 1762 __set_bit(BTN_STYLUS, input_dev->keybit); ··· 1861 1771 __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1862 1772 break; 1863 1773 1774 + case INTUOSHT: 1775 + if (features->touch_max && 1776 + features->device_type == BTN_TOOL_FINGER) { 1777 + input_dev->evbit[0] |= BIT_MASK(EV_SW); 1778 + __set_bit(SW_MUTE_DEVICE, input_dev->swbit); 1779 + } 1780 + /* fall through */ 1781 + 1864 1782 case BAMBOO_PT: 1865 1783 __clear_bit(ABS_MISC, input_dev->absbit); 1866 1784 1867 - __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1868 - 1869 1785 if (features->device_type == BTN_TOOL_FINGER) { 1870 - unsigned int flags = INPUT_MT_POINTER; 1871 1786 1872 1787 __set_bit(BTN_LEFT, input_dev->keybit); 1873 1788 __set_bit(BTN_FORWARD, input_dev->keybit); 1874 1789 __set_bit(BTN_BACK, input_dev->keybit); 1875 1790 __set_bit(BTN_RIGHT, input_dev->keybit); 1876 1791 1877 - if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { 1878 - input_set_abs_params(input_dev, 1792 + if (features->touch_max) { 1793 + /* touch interface */ 1794 + unsigned int flags = INPUT_MT_POINTER; 1795 + 1796 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1797 + if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { 1798 + input_set_abs_params(input_dev, 1879 1799 ABS_MT_TOUCH_MAJOR, 1880 1800 0, features->x_max, 0, 0); 1881 - input_set_abs_params(input_dev, 1801 + input_set_abs_params(input_dev, 1882 1802 ABS_MT_TOUCH_MINOR, 1883 1803 0, features->y_max, 0, 0); 1804 + } else { 1805 + __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1806 + __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); 1807 + flags = 0; 1808 + } 1809 + input_mt_init_slots(input_dev, features->touch_max, flags); 1884 1810 } else { 1885 - __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1886 - __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); 1887 - flags = 0; 1811 + /* buttons/keys only interface */ 1812 + __clear_bit(ABS_X, input_dev->absbit); 1813 + __clear_bit(ABS_Y, input_dev->absbit); 1814 + __clear_bit(BTN_TOUCH, input_dev->keybit); 1888 1815 } 1889 - input_mt_init_slots(input_dev, features->touch_max, flags); 1890 1816 } else if (features->device_type == BTN_TOOL_PEN) { 1817 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1891 1818 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1892 1819 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1893 1820 __set_bit(BTN_STYLUS, input_dev->keybit); ··· 2162 2055 static const struct wacom_features wacom_features_0xF0 = 2163 2056 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 2164 2057 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2058 + static const struct wacom_features wacom_features_0xFB = 2059 + { "Wacom DTU1031", WACOM_PKGLEN_DTUS, 22096, 13960, 511, 2060 + 0, DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2165 2061 static const struct wacom_features wacom_features_0x57 = 2166 2062 { "Wacom DTK2241", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 2167 2063 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES}; ··· 2310 2200 static const struct wacom_features wacom_features_0x301 = 2311 2201 { "Wacom Bamboo One M", WACOM_PKGLEN_BBPEN, 21648, 13530, 1023, 2312 2202 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2203 + static const struct wacom_features wacom_features_0x302 = 2204 + { "Wacom Intuos PT S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2205 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2206 + .touch_max = 16 }; 2207 + static const struct wacom_features wacom_features_0x303 = 2208 + { "Wacom Intuos PT M", WACOM_PKGLEN_BBPEN, 21600, 13500, 1023, 2209 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2210 + .touch_max = 16 }; 2211 + static const struct wacom_features wacom_features_0x30E = 2212 + { "Wacom Intuos S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2213 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2313 2214 static const struct wacom_features wacom_features_0x6004 = 2314 2215 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 2315 2216 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; ··· 2458 2337 { USB_DEVICE_WACOM(0x10F) }, 2459 2338 { USB_DEVICE_WACOM(0x300) }, 2460 2339 { USB_DEVICE_WACOM(0x301) }, 2340 + { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) }, 2341 + { USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) }, 2342 + { USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) }, 2461 2343 { USB_DEVICE_WACOM(0x304) }, 2462 2344 { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) }, 2463 2345 { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) }, ··· 2471 2347 { USB_DEVICE_WACOM(0xF8) }, 2472 2348 { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) }, 2473 2349 { USB_DEVICE_WACOM(0xFA) }, 2350 + { USB_DEVICE_WACOM(0xFB) }, 2474 2351 { USB_DEVICE_WACOM(0x0307) }, 2475 2352 { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) }, 2476 2353 { USB_DEVICE_LENOVO(0x6004) },
+12 -1
drivers/input/tablet/wacom_wac.h
··· 12 12 #include <linux/types.h> 13 13 14 14 /* maximum packet length for USB devices */ 15 - #define WACOM_PKGLEN_MAX 64 15 + #define WACOM_PKGLEN_MAX 68 16 16 17 17 #define WACOM_NAME_MAX 64 18 18 ··· 29 29 #define WACOM_PKGLEN_WIRELESS 32 30 30 #define WACOM_PKGLEN_MTOUCH 62 31 31 #define WACOM_PKGLEN_MTTPC 40 32 + #define WACOM_PKGLEN_DTUS 68 32 33 33 34 /* wacom data size per MT contact */ 34 35 #define WACOM_BYTES_PER_MT_PACKET 11 ··· 48 47 #define WACOM_REPORT_INTUOSWRITE 6 49 48 #define WACOM_REPORT_INTUOSPAD 12 50 49 #define WACOM_REPORT_INTUOS5PAD 3 50 + #define WACOM_REPORT_DTUSPAD 21 51 51 #define WACOM_REPORT_TPC1FG 6 52 52 #define WACOM_REPORT_TPC2FG 13 53 53 #define WACOM_REPORT_TPCMT 13 54 54 #define WACOM_REPORT_TPCHID 15 55 55 #define WACOM_REPORT_TPCST 16 56 + #define WACOM_REPORT_DTUS 17 56 57 #define WACOM_REPORT_TPC1FGE 18 57 58 #define WACOM_REPORT_24HDT 1 59 + #define WACOM_REPORT_WL 128 60 + #define WACOM_REPORT_USB 192 58 61 59 62 /* device quirks */ 60 63 #define WACOM_QUIRK_MULTI_INPUT 0x0001 ··· 73 68 PTU, 74 69 PL, 75 70 DTU, 71 + DTUS, 76 72 INTUOS, 77 73 INTUOS3S, 78 74 INTUOS3, ··· 87 81 INTUOSPS, 88 82 INTUOSPM, 89 83 INTUOSPL, 84 + INTUOSHT, 90 85 WACOM_21UX2, 91 86 WACOM_22HD, 92 87 DTK, ··· 136 129 struct wacom_shared { 137 130 bool stylus_in_proximity; 138 131 bool touch_down; 132 + /* for wireless device to access USB interfaces */ 133 + unsigned touch_max; 134 + int type; 135 + struct input_dev *touch_input; 139 136 }; 140 137 141 138 struct wacom_wac {
+1 -1
drivers/input/touchscreen/88pm860x-ts.c
··· 172 172 static int pm860x_touch_probe(struct platform_device *pdev) 173 173 { 174 174 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 175 - struct pm860x_touch_pdata *pdata = pdev->dev.platform_data; 175 + struct pm860x_touch_pdata *pdata = dev_get_platdata(&pdev->dev); 176 176 struct pm860x_touch *touch; 177 177 struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \ 178 178 : chip->companion;
+1 -2
drivers/input/touchscreen/ad7877.c
··· 37 37 38 38 39 39 #include <linux/device.h> 40 - #include <linux/init.h> 41 40 #include <linux/delay.h> 42 41 #include <linux/input.h> 43 42 #include <linux/interrupt.h> ··· 685 686 { 686 687 struct ad7877 *ts; 687 688 struct input_dev *input_dev; 688 - struct ad7877_platform_data *pdata = spi->dev.platform_data; 689 + struct ad7877_platform_data *pdata = dev_get_platdata(&spi->dev); 689 690 int err; 690 691 u16 verify; 691 692
+2 -3
drivers/input/touchscreen/ad7879.c
··· 22 22 */ 23 23 24 24 #include <linux/device.h> 25 - #include <linux/init.h> 26 25 #include <linux/delay.h> 27 26 #include <linux/input.h> 28 27 #include <linux/interrupt.h> ··· 469 470 470 471 static void ad7879_gpio_remove(struct ad7879 *ts) 471 472 { 472 - const struct ad7879_platform_data *pdata = ts->dev->platform_data; 473 + const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev); 473 474 int ret; 474 475 475 476 if (pdata->gpio_export) { ··· 494 495 struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, 495 496 const struct ad7879_bus_ops *bops) 496 497 { 497 - struct ad7879_platform_data *pdata = dev->platform_data; 498 + struct ad7879_platform_data *pdata = dev_get_platdata(dev); 498 499 struct ad7879 *ts; 499 500 struct input_dev *input_dev; 500 501 int err;
+27 -59
drivers/input/touchscreen/ads7846.c
··· 19 19 */ 20 20 #include <linux/types.h> 21 21 #include <linux/hwmon.h> 22 - #include <linux/init.h> 23 22 #include <linux/err.h> 24 23 #include <linux/sched.h> 25 24 #include <linux/delay.h> ··· 100 101 struct spi_device *spi; 101 102 struct regulator *reg; 102 103 103 - #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 104 - struct attribute_group *attr_group; 104 + #if IS_ENABLED(CONFIG_HWMON) 105 105 struct device *hwmon; 106 106 #endif 107 107 ··· 419 421 return status; 420 422 } 421 423 422 - #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 424 + #if IS_ENABLED(CONFIG_HWMON) 423 425 424 426 #define SHOW(name, var, adjust) static ssize_t \ 425 427 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \ ··· 477 479 SHOW(in0_input, vaux, vaux_adjust) 478 480 SHOW(in1_input, vbatt, vbatt_adjust) 479 481 482 + static umode_t ads7846_is_visible(struct kobject *kobj, struct attribute *attr, 483 + int index) 484 + { 485 + struct device *dev = container_of(kobj, struct device, kobj); 486 + struct ads7846 *ts = dev_get_drvdata(dev); 487 + 488 + if (ts->model == 7843 && index < 2) /* in0, in1 */ 489 + return 0; 490 + if (ts->model == 7845 && index != 2) /* in0 */ 491 + return 0; 492 + 493 + return attr->mode; 494 + } 495 + 480 496 static struct attribute *ads7846_attributes[] = { 481 - &dev_attr_temp0.attr, 482 - &dev_attr_temp1.attr, 483 - &dev_attr_in0_input.attr, 484 - &dev_attr_in1_input.attr, 497 + &dev_attr_temp0.attr, /* 0 */ 498 + &dev_attr_temp1.attr, /* 1 */ 499 + &dev_attr_in0_input.attr, /* 2 */ 500 + &dev_attr_in1_input.attr, /* 3 */ 485 501 NULL, 486 502 }; 487 503 488 504 static struct attribute_group ads7846_attr_group = { 489 505 .attrs = ads7846_attributes, 506 + .is_visible = ads7846_is_visible, 490 507 }; 491 - 492 - static struct attribute *ads7843_attributes[] = { 493 - &dev_attr_in0_input.attr, 494 - &dev_attr_in1_input.attr, 495 - NULL, 496 - }; 497 - 498 - static struct attribute_group ads7843_attr_group = { 499 - .attrs = ads7843_attributes, 500 - }; 501 - 502 - static struct attribute *ads7845_attributes[] = { 503 - &dev_attr_in0_input.attr, 504 - NULL, 505 - }; 506 - 507 - static struct attribute_group ads7845_attr_group = { 508 - .attrs = ads7845_attributes, 509 - }; 508 + __ATTRIBUTE_GROUPS(ads7846_attr); 510 509 511 510 static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) 512 511 { 513 - struct device *hwmon; 514 - int err; 515 - 516 512 /* hwmon sensors need a reference voltage */ 517 513 switch (ts->model) { 518 514 case 7846: ··· 527 535 break; 528 536 } 529 537 530 - /* different chips have different sensor groups */ 531 - switch (ts->model) { 532 - case 7846: 533 - ts->attr_group = &ads7846_attr_group; 534 - break; 535 - case 7845: 536 - ts->attr_group = &ads7845_attr_group; 537 - break; 538 - case 7843: 539 - ts->attr_group = &ads7843_attr_group; 540 - break; 541 - default: 542 - dev_dbg(&spi->dev, "ADS%d not recognized\n", ts->model); 543 - return 0; 544 - } 538 + ts->hwmon = hwmon_device_register_with_groups(&spi->dev, spi->modalias, 539 + ts, ads7846_attr_groups); 540 + if (IS_ERR(ts->hwmon)) 541 + return PTR_ERR(ts->hwmon); 545 542 546 - err = sysfs_create_group(&spi->dev.kobj, ts->attr_group); 547 - if (err) 548 - return err; 549 - 550 - hwmon = hwmon_device_register(&spi->dev); 551 - if (IS_ERR(hwmon)) { 552 - sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 553 - return PTR_ERR(hwmon); 554 - } 555 - 556 - ts->hwmon = hwmon; 557 543 return 0; 558 544 } 559 545 560 546 static void ads784x_hwmon_unregister(struct spi_device *spi, 561 547 struct ads7846 *ts) 562 548 { 563 - if (ts->hwmon) { 564 - sysfs_remove_group(&spi->dev.kobj, ts->attr_group); 549 + if (ts->hwmon) 565 550 hwmon_device_unregister(ts->hwmon); 566 - } 567 551 } 568 552 569 553 #else
+1 -2
drivers/input/touchscreen/atmel_mxt_ts.c
··· 12 12 */ 13 13 14 14 #include <linux/module.h> 15 - #include <linux/init.h> 16 15 #include <linux/delay.h> 17 16 #include <linux/firmware.h> 18 17 #include <linux/i2c.h> ··· 1129 1130 static int mxt_probe(struct i2c_client *client, 1130 1131 const struct i2c_device_id *id) 1131 1132 { 1132 - const struct mxt_platform_data *pdata = client->dev.platform_data; 1133 + const struct mxt_platform_data *pdata = dev_get_platdata(&client->dev); 1133 1134 struct mxt_data *data; 1134 1135 struct input_dev *input_dev; 1135 1136 int error;
+1 -2
drivers/input/touchscreen/atmel_tsadcc.c
··· 12 12 * it under the terms of the GNU General Public License version 2 as 13 13 * published by the Free Software Foundation. 14 14 */ 15 - #include <linux/init.h> 16 15 #include <linux/err.h> 17 16 #include <linux/kernel.h> 18 17 #include <linux/module.h> ··· 181 182 struct atmel_tsadcc *ts_dev; 182 183 struct input_dev *input_dev; 183 184 struct resource *res; 184 - struct at91_tsadcc_data *pdata = pdev->dev.platform_data; 185 + struct at91_tsadcc_data *pdata = dev_get_platdata(&pdev->dev); 185 186 int err; 186 187 unsigned int prsc; 187 188 unsigned int reg;
+1 -1
drivers/input/touchscreen/cy8ctmg110_ts.c
··· 178 178 static int cy8ctmg110_probe(struct i2c_client *client, 179 179 const struct i2c_device_id *id) 180 180 { 181 - const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; 181 + const struct cy8ctmg110_pdata *pdata = dev_get_platdata(&client->dev); 182 182 struct cy8ctmg110 *ts; 183 183 struct input_dev *input_dev; 184 184 int err;
+2 -2
drivers/input/touchscreen/cyttsp_core.c
··· 534 534 struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, 535 535 struct device *dev, int irq, size_t xfer_buf_size) 536 536 { 537 - const struct cyttsp_platform_data *pdata = dev->platform_data; 537 + const struct cyttsp_platform_data *pdata = dev_get_platdata(dev); 538 538 struct cyttsp *ts; 539 539 struct input_dev *input_dev; 540 540 int error; ··· 553 553 554 554 ts->dev = dev; 555 555 ts->input = input_dev; 556 - ts->pdata = dev->platform_data; 556 + ts->pdata = dev_get_platdata(dev); 557 557 ts->bus_ops = bus_ops; 558 558 ts->irq = irq; 559 559
+2
drivers/input/touchscreen/cyttsp_i2c_common.c
··· 31 31 #include <linux/module.h> 32 32 #include <linux/types.h> 33 33 34 + #include "cyttsp4_core.h" 35 + 34 36 int cyttsp_i2c_read_block_data(struct device *dev, u8 *xfer_buf, 35 37 u16 addr, u8 length, void *values) 36 38 {
+1 -2
drivers/input/touchscreen/da9034-ts.c
··· 13 13 14 14 #include <linux/module.h> 15 15 #include <linux/kernel.h> 16 - #include <linux/init.h> 17 16 #include <linux/delay.h> 18 17 #include <linux/platform_device.h> 19 18 #include <linux/input.h> ··· 298 299 299 300 static int da9034_touch_probe(struct platform_device *pdev) 300 301 { 301 - struct da9034_touch_pdata *pdata = pdev->dev.platform_data; 302 + struct da9034_touch_pdata *pdata = dev_get_platdata(&pdev->dev); 302 303 struct da9034_touch *touch; 303 304 struct input_dev *input_dev; 304 305 int ret;
-1
drivers/input/touchscreen/dynapro.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/input.h> 26 26 #include <linux/serio.h> 27 - #include <linux/init.h> 28 27 29 28 #define DRIVER_DESC "Dynapro serial touchscreen driver" 30 29
+27 -44
drivers/input/touchscreen/edt-ft5x06.c
··· 623 623 624 624 if (gpio_is_valid(reset_pin)) { 625 625 /* this pulls reset down, enabling the low active reset */ 626 - error = gpio_request_one(reset_pin, GPIOF_OUT_INIT_LOW, 627 - "edt-ft5x06 reset"); 626 + error = devm_gpio_request_one(&client->dev, reset_pin, 627 + GPIOF_OUT_INIT_LOW, 628 + "edt-ft5x06 reset"); 628 629 if (error) { 629 630 dev_err(&client->dev, 630 631 "Failed to request GPIO %d as reset pin, error %d\n", ··· 706 705 const struct i2c_device_id *id) 707 706 { 708 707 const struct edt_ft5x06_platform_data *pdata = 709 - client->dev.platform_data; 708 + dev_get_platdata(&client->dev); 710 709 struct edt_ft5x06_ts_data *tsdata; 711 710 struct input_dev *input; 712 711 int error; ··· 724 723 return error; 725 724 726 725 if (gpio_is_valid(pdata->irq_pin)) { 727 - error = gpio_request_one(pdata->irq_pin, 728 - GPIOF_IN, "edt-ft5x06 irq"); 726 + error = devm_gpio_request_one(&client->dev, pdata->irq_pin, 727 + GPIOF_IN, "edt-ft5x06 irq"); 729 728 if (error) { 730 729 dev_err(&client->dev, 731 730 "Failed to request GPIO %d, error %d\n", ··· 734 733 } 735 734 } 736 735 737 - tsdata = kzalloc(sizeof(*tsdata), GFP_KERNEL); 738 - input = input_allocate_device(); 739 - if (!tsdata || !input) { 736 + tsdata = devm_kzalloc(&client->dev, sizeof(*tsdata), GFP_KERNEL); 737 + if (!tsdata) { 740 738 dev_err(&client->dev, "failed to allocate driver data.\n"); 741 - error = -ENOMEM; 742 - goto err_free_mem; 739 + return -ENOMEM; 740 + } 741 + 742 + input = devm_input_allocate_device(&client->dev); 743 + if (!input) { 744 + dev_err(&client->dev, "failed to allocate input device.\n"); 745 + return -ENOMEM; 743 746 } 744 747 745 748 mutex_init(&tsdata->mutex); ··· 754 749 error = edt_ft5x06_ts_identify(client, tsdata->name, fw_version); 755 750 if (error) { 756 751 dev_err(&client->dev, "touchscreen probe failed\n"); 757 - goto err_free_mem; 752 + return error; 758 753 } 759 754 760 755 edt_ft5x06_ts_get_defaults(tsdata, pdata); ··· 781 776 error = input_mt_init_slots(input, MAX_SUPPORT_POINTS, 0); 782 777 if (error) { 783 778 dev_err(&client->dev, "Unable to init MT slots.\n"); 784 - goto err_free_mem; 779 + return error; 785 780 } 786 781 787 782 input_set_drvdata(input, tsdata); 788 783 i2c_set_clientdata(client, tsdata); 789 784 790 - error = request_threaded_irq(client->irq, NULL, edt_ft5x06_ts_isr, 791 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 792 - client->name, tsdata); 785 + error = devm_request_threaded_irq(&client->dev, client->irq, 786 + NULL, edt_ft5x06_ts_isr, 787 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 788 + client->name, tsdata); 793 789 if (error) { 794 790 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); 795 - goto err_free_mem; 791 + return error; 796 792 } 797 793 798 794 error = sysfs_create_group(&client->dev.kobj, &edt_ft5x06_attr_group); 799 795 if (error) 800 - goto err_free_irq; 796 + return error; 801 797 802 798 error = input_register_device(input); 803 - if (error) 804 - goto err_remove_attrs; 799 + if (error) { 800 + sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group); 801 + return error; 802 + } 805 803 806 804 edt_ft5x06_ts_prepare_debugfs(tsdata, dev_driver_string(&client->dev)); 807 805 device_init_wakeup(&client->dev, 1); ··· 814 806 pdata->irq_pin, pdata->reset_pin); 815 807 816 808 return 0; 817 - 818 - err_remove_attrs: 819 - sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group); 820 - err_free_irq: 821 - free_irq(client->irq, tsdata); 822 - err_free_mem: 823 - input_free_device(input); 824 - kfree(tsdata); 825 - 826 - if (gpio_is_valid(pdata->irq_pin)) 827 - gpio_free(pdata->irq_pin); 828 - 829 - return error; 830 809 } 831 810 832 811 static int edt_ft5x06_ts_remove(struct i2c_client *client) 833 812 { 834 - const struct edt_ft5x06_platform_data *pdata = 835 - dev_get_platdata(&client->dev); 836 813 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 837 814 838 815 edt_ft5x06_ts_teardown_debugfs(tsdata); 839 816 sysfs_remove_group(&client->dev.kobj, &edt_ft5x06_attr_group); 840 - 841 - free_irq(client->irq, tsdata); 842 - input_unregister_device(tsdata->input); 843 - 844 - if (gpio_is_valid(pdata->irq_pin)) 845 - gpio_free(pdata->irq_pin); 846 - if (gpio_is_valid(pdata->reset_pin)) 847 - gpio_free(pdata->reset_pin); 848 - 849 - kfree(tsdata); 850 817 851 818 return 0; 852 819 }
+1 -1
drivers/input/touchscreen/eeti_ts.c
··· 157 157 static int eeti_ts_probe(struct i2c_client *client, 158 158 const struct i2c_device_id *idp) 159 159 { 160 - struct eeti_ts_platform_data *pdata = client->dev.platform_data; 160 + struct eeti_ts_platform_data *pdata = dev_get_platdata(&client->dev); 161 161 struct eeti_ts_priv *priv; 162 162 struct input_dev *input; 163 163 unsigned int irq_flags;
-1
drivers/input/touchscreen/egalax_ts.c
··· 18 18 */ 19 19 20 20 #include <linux/module.h> 21 - #include <linux/init.h> 22 21 #include <linux/i2c.h> 23 22 #include <linux/interrupt.h> 24 23 #include <linux/input.h>
-1
drivers/input/touchscreen/elo.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/input.h> 24 24 #include <linux/serio.h> 25 - #include <linux/init.h> 26 25 #include <linux/ctype.h> 27 26 28 27 #define DRIVER_DESC "Elo serial touchscreen driver"
-1
drivers/input/touchscreen/fujitsu_ts.c
··· 16 16 #include <linux/slab.h> 17 17 #include <linux/input.h> 18 18 #include <linux/serio.h> 19 - #include <linux/init.h> 20 19 21 20 #define DRIVER_DESC "Fujitsu serial touchscreen driver" 22 21
-1
drivers/input/touchscreen/gunze.c
··· 32 32 #include <linux/slab.h> 33 33 #include <linux/input.h> 34 34 #include <linux/serio.h> 35 - #include <linux/init.h> 36 35 37 36 #define DRIVER_DESC "Gunze AHL-51S touchscreen driver" 38 37
-1
drivers/input/touchscreen/hampshire.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/input.h> 25 25 #include <linux/serio.h> 26 - #include <linux/init.h> 27 26 28 27 #define DRIVER_DESC "Hampshire serial touchscreen driver" 29 28
+1 -1
drivers/input/touchscreen/ili210x.c
··· 184 184 const struct i2c_device_id *id) 185 185 { 186 186 struct device *dev = &client->dev; 187 - const struct ili210x_platform_data *pdata = dev->platform_data; 187 + const struct ili210x_platform_data *pdata = dev_get_platdata(dev); 188 188 struct ili210x *priv; 189 189 struct input_dev *input; 190 190 struct panel_info panel;
-1
drivers/input/touchscreen/inexio.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/input.h> 25 25 #include <linux/serio.h> 26 - #include <linux/init.h> 27 26 28 27 #define DRIVER_DESC "iNexio serial touchscreen driver" 29 28
-1
drivers/input/touchscreen/intel-mid-touch.c
··· 27 27 */ 28 28 29 29 #include <linux/module.h> 30 - #include <linux/init.h> 31 30 #include <linux/input.h> 32 31 #include <linux/interrupt.h> 33 32 #include <linux/err.h>
-1
drivers/input/touchscreen/jornada720_ts.c
··· 14 14 */ 15 15 16 16 #include <linux/platform_device.h> 17 - #include <linux/init.h> 18 17 #include <linux/input.h> 19 18 #include <linux/interrupt.h> 20 19 #include <linux/module.h>
-1
drivers/input/touchscreen/lpc32xx_ts.c
··· 15 15 */ 16 16 17 17 #include <linux/platform_device.h> 18 - #include <linux/init.h> 19 18 #include <linux/input.h> 20 19 #include <linux/interrupt.h> 21 20 #include <linux/module.h>
-1
drivers/input/touchscreen/mainstone-wm97xx.c
··· 25 25 #include <linux/module.h> 26 26 #include <linux/moduleparam.h> 27 27 #include <linux/kernel.h> 28 - #include <linux/init.h> 29 28 #include <linux/delay.h> 30 29 #include <linux/irq.h> 31 30 #include <linux/interrupt.h>
-1
drivers/input/touchscreen/max11801_ts.c
··· 33 33 */ 34 34 35 35 #include <linux/module.h> 36 - #include <linux/init.h> 37 36 #include <linux/i2c.h> 38 37 #include <linux/interrupt.h> 39 38 #include <linux/input.h>
+2 -3
drivers/input/touchscreen/mcs5000_ts.c
··· 14 14 */ 15 15 16 16 #include <linux/module.h> 17 - #include <linux/init.h> 18 17 #include <linux/i2c.h> 19 18 #include <linux/i2c/mcs.h> 20 19 #include <linux/interrupt.h> ··· 193 194 struct input_dev *input_dev; 194 195 int ret; 195 196 196 - if (!client->dev.platform_data) 197 + if (!dev_get_platdata(&client->dev)) 197 198 return -EINVAL; 198 199 199 200 data = kzalloc(sizeof(struct mcs5000_ts_data), GFP_KERNEL); ··· 206 207 207 208 data->client = client; 208 209 data->input_dev = input_dev; 209 - data->platform_data = client->dev.platform_data; 210 + data->platform_data = dev_get_platdata(&client->dev); 210 211 211 212 input_dev->name = "MELPAS MCS-5000 Touchscreen"; 212 213 input_dev->id.bustype = BUS_I2C;
-1
drivers/input/touchscreen/mms114.c
··· 8 8 */ 9 9 10 10 #include <linux/module.h> 11 - #include <linux/init.h> 12 11 #include <linux/delay.h> 13 12 #include <linux/of.h> 14 13 #include <linux/i2c.h>
-1
drivers/input/touchscreen/mtouch.c
··· 21 21 #include <linux/slab.h> 22 22 #include <linux/input.h> 23 23 #include <linux/serio.h> 24 - #include <linux/init.h> 25 24 26 25 #define DRIVER_DESC "MicroTouch serial touchscreen driver" 27 26
-1
drivers/input/touchscreen/pcap_ts.c
··· 11 11 */ 12 12 13 13 #include <linux/module.h> 14 - #include <linux/init.h> 15 14 #include <linux/fs.h> 16 15 #include <linux/string.h> 17 16 #include <linux/slab.h>
-1
drivers/input/touchscreen/penmount.c
··· 21 21 #include <linux/input.h> 22 22 #include <linux/input/mt.h> 23 23 #include <linux/serio.h> 24 - #include <linux/init.h> 25 24 26 25 #define DRIVER_DESC "PenMount serial touchscreen driver" 27 26
+2 -1
drivers/input/touchscreen/pixcir_i2c_ts.c
··· 128 128 static int pixcir_i2c_ts_probe(struct i2c_client *client, 129 129 const struct i2c_device_id *id) 130 130 { 131 - const struct pixcir_ts_platform_data *pdata = client->dev.platform_data; 131 + const struct pixcir_ts_platform_data *pdata = 132 + dev_get_platdata(&client->dev); 132 133 struct pixcir_i2c_ts_data *tsdata; 133 134 struct input_dev *input; 134 135 int error;
+2 -3
drivers/input/touchscreen/s3c2410_ts.c
··· 28 28 #include <linux/module.h> 29 29 #include <linux/gpio.h> 30 30 #include <linux/input.h> 31 - #include <linux/init.h> 32 31 #include <linux/delay.h> 33 32 #include <linux/interrupt.h> 34 33 #include <linux/platform_device.h> ··· 250 251 251 252 ts.dev = dev; 252 253 253 - info = pdev->dev.platform_data; 254 + info = dev_get_platdata(&pdev->dev); 254 255 if (!info) { 255 256 dev_err(dev, "no platform data, cannot attach\n"); 256 257 return -EINVAL; ··· 391 392 static int s3c2410ts_resume(struct device *dev) 392 393 { 393 394 struct platform_device *pdev = to_platform_device(dev); 394 - struct s3c2410_ts_mach_info *info = pdev->dev.platform_data; 395 + struct s3c2410_ts_mach_info *info = dev_get_platdata(&pdev->dev); 395 396 396 397 clk_enable(ts.clock); 397 398 enable_irq(ts.irq_tc);
+1 -1
drivers/input/touchscreen/st1232.c
··· 154 154 const struct i2c_device_id *id) 155 155 { 156 156 struct st1232_ts_data *ts; 157 - struct st1232_pdata *pdata = client->dev.platform_data; 157 + struct st1232_pdata *pdata = dev_get_platdata(&client->dev); 158 158 struct input_dev *input_dev; 159 159 int error; 160 160
-1
drivers/input/touchscreen/stmpe-ts.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/sched.h> 17 17 #include <linux/interrupt.h> 18 - #include <linux/init.h> 19 18 #include <linux/device.h> 20 19 #include <linux/of.h> 21 20 #include <linux/platform_device.h>
-1
drivers/input/touchscreen/ti_am335x_tsc.c
··· 14 14 */ 15 15 16 16 17 - #include <linux/init.h> 18 17 #include <linux/kernel.h> 19 18 #include <linux/err.h> 20 19 #include <linux/module.h>
-1
drivers/input/touchscreen/touchit213.c
··· 21 21 #include <linux/slab.h> 22 22 #include <linux/input.h> 23 23 #include <linux/serio.h> 24 - #include <linux/init.h> 25 24 26 25 #define DRIVER_DESC "Sahara TouchIT-213 serial touchscreen driver" 27 26
-1
drivers/input/touchscreen/touchright.c
··· 20 20 #include <linux/slab.h> 21 21 #include <linux/input.h> 22 22 #include <linux/serio.h> 23 - #include <linux/init.h> 24 23 25 24 #define DRIVER_DESC "Touchright serial touchscreen driver" 26 25
-1
drivers/input/touchscreen/touchwin.c
··· 27 27 #include <linux/slab.h> 28 28 #include <linux/input.h> 29 29 #include <linux/serio.h> 30 - #include <linux/init.h> 31 30 32 31 #define DRIVER_DESC "Touchwindow serial touchscreen driver" 33 32
+1 -1
drivers/input/touchscreen/tsc2005.c
··· 571 571 572 572 static int tsc2005_probe(struct spi_device *spi) 573 573 { 574 - const struct tsc2005_platform_data *pdata = spi->dev.platform_data; 574 + const struct tsc2005_platform_data *pdata = dev_get_platdata(&spi->dev); 575 575 struct tsc2005 *ts; 576 576 struct input_dev *input_dev; 577 577 unsigned int max_x, max_y, max_p;
+166 -74
drivers/input/touchscreen/tsc2007.c
··· 26 26 #include <linux/interrupt.h> 27 27 #include <linux/i2c.h> 28 28 #include <linux/i2c/tsc2007.h> 29 + #include <linux/of_device.h> 30 + #include <linux/of.h> 31 + #include <linux/of_gpio.h> 29 32 30 33 #define TSC2007_MEASURE_TEMP0 (0x0 << 4) 31 34 #define TSC2007_MEASURE_AUX (0x2 << 4) ··· 75 72 u16 model; 76 73 u16 x_plate_ohms; 77 74 u16 max_rt; 78 - unsigned long poll_delay; 79 75 unsigned long poll_period; 76 + int fuzzx; 77 + int fuzzy; 78 + int fuzzz; 80 79 80 + unsigned gpio; 81 81 int irq; 82 82 83 83 wait_queue_head_t wait; 84 84 bool stopped; 85 85 86 - int (*get_pendown_state)(void); 86 + int (*get_pendown_state)(struct device *); 87 87 void (*clear_penirq)(void); 88 88 }; 89 89 ··· 167 161 if (!ts->get_pendown_state) 168 162 return true; 169 163 170 - return ts->get_pendown_state(); 164 + return ts->get_pendown_state(&ts->client->dev); 171 165 } 172 166 173 167 static irqreturn_t tsc2007_soft_irq(int irq, void *handle) ··· 184 178 185 179 rt = tsc2007_calculate_pressure(ts, &tc); 186 180 187 - if (rt == 0 && !ts->get_pendown_state) { 181 + if (!rt && !ts->get_pendown_state) { 188 182 /* 189 183 * If pressure reported is 0 and we don't have 190 184 * callback to check pendown state, we have to ··· 234 228 { 235 229 struct tsc2007 *ts = handle; 236 230 237 - if (!ts->get_pendown_state || likely(ts->get_pendown_state())) 231 + if (tsc2007_is_pen_down(ts)) 238 232 return IRQ_WAKE_THREAD; 239 233 240 234 if (ts->clear_penirq) ··· 279 273 tsc2007_stop(ts); 280 274 } 281 275 282 - static int tsc2007_probe(struct i2c_client *client, 283 - const struct i2c_device_id *id) 276 + #ifdef CONFIG_OF 277 + static int tsc2007_get_pendown_state_gpio(struct device *dev) 284 278 { 285 - struct tsc2007 *ts; 286 - struct tsc2007_platform_data *pdata = client->dev.platform_data; 287 - struct input_dev *input_dev; 288 - int err; 279 + struct i2c_client *client = to_i2c_client(dev); 280 + struct tsc2007 *ts = i2c_get_clientdata(client); 289 281 290 - if (!pdata) { 291 - dev_err(&client->dev, "platform data is required!\n"); 282 + return !gpio_get_value(ts->gpio); 283 + } 284 + 285 + static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts) 286 + { 287 + struct device_node *np = client->dev.of_node; 288 + u32 val32; 289 + u64 val64; 290 + 291 + if (!np) { 292 + dev_err(&client->dev, "missing device tree data\n"); 292 293 return -EINVAL; 293 294 } 295 + 296 + if (!of_property_read_u32(np, "ti,max-rt", &val32)) 297 + ts->max_rt = val32; 298 + else 299 + ts->max_rt = MAX_12BIT; 300 + 301 + if (!of_property_read_u32(np, "ti,fuzzx", &val32)) 302 + ts->fuzzx = val32; 303 + 304 + if (!of_property_read_u32(np, "ti,fuzzy", &val32)) 305 + ts->fuzzy = val32; 306 + 307 + if (!of_property_read_u32(np, "ti,fuzzz", &val32)) 308 + ts->fuzzz = val32; 309 + 310 + if (!of_property_read_u64(np, "ti,poll-period", &val64)) 311 + ts->poll_period = val64; 312 + else 313 + ts->poll_period = 1; 314 + 315 + if (!of_property_read_u32(np, "ti,x-plate-ohms", &val32)) { 316 + ts->x_plate_ohms = val32; 317 + } else { 318 + dev_err(&client->dev, "missing ti,x-plate-ohms devicetree property."); 319 + return -EINVAL; 320 + } 321 + 322 + ts->gpio = of_get_gpio(np, 0); 323 + if (gpio_is_valid(ts->gpio)) 324 + ts->get_pendown_state = tsc2007_get_pendown_state_gpio; 325 + else 326 + dev_warn(&client->dev, 327 + "GPIO not specified in DT (of_get_gpio returned %d)\n", 328 + ts->gpio); 329 + 330 + return 0; 331 + } 332 + #else 333 + static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts) 334 + { 335 + dev_err(&client->dev, "platform data is required!\n"); 336 + return -EINVAL; 337 + } 338 + #endif 339 + 340 + static int tsc2007_probe_pdev(struct i2c_client *client, struct tsc2007 *ts, 341 + const struct tsc2007_platform_data *pdata, 342 + const struct i2c_device_id *id) 343 + { 344 + ts->model = pdata->model; 345 + ts->x_plate_ohms = pdata->x_plate_ohms; 346 + ts->max_rt = pdata->max_rt ? : MAX_12BIT; 347 + ts->poll_period = pdata->poll_period ? : 1; 348 + ts->get_pendown_state = pdata->get_pendown_state; 349 + ts->clear_penirq = pdata->clear_penirq; 350 + ts->fuzzx = pdata->fuzzx; 351 + ts->fuzzy = pdata->fuzzy; 352 + ts->fuzzz = pdata->fuzzz; 353 + 354 + if (pdata->x_plate_ohms == 0) { 355 + dev_err(&client->dev, "x_plate_ohms is not set up in platform data"); 356 + return -EINVAL; 357 + } 358 + 359 + return 0; 360 + } 361 + 362 + static void tsc2007_call_exit_platform_hw(void *data) 363 + { 364 + struct device *dev = data; 365 + const struct tsc2007_platform_data *pdata = dev_get_platdata(dev); 366 + 367 + pdata->exit_platform_hw(); 368 + } 369 + 370 + static int tsc2007_probe(struct i2c_client *client, 371 + const struct i2c_device_id *id) 372 + { 373 + const struct tsc2007_platform_data *pdata = dev_get_platdata(&client->dev); 374 + struct tsc2007 *ts; 375 + struct input_dev *input_dev; 376 + int err; 294 377 295 378 if (!i2c_check_functionality(client->adapter, 296 379 I2C_FUNC_SMBUS_READ_WORD_DATA)) 297 380 return -EIO; 298 381 299 - ts = kzalloc(sizeof(struct tsc2007), GFP_KERNEL); 300 - input_dev = input_allocate_device(); 301 - if (!ts || !input_dev) { 302 - err = -ENOMEM; 303 - goto err_free_mem; 304 - } 382 + ts = devm_kzalloc(&client->dev, sizeof(struct tsc2007), GFP_KERNEL); 383 + if (!ts) 384 + return -ENOMEM; 385 + 386 + if (pdata) 387 + err = tsc2007_probe_pdev(client, ts, pdata, id); 388 + else 389 + err = tsc2007_probe_dt(client, ts); 390 + if (err) 391 + return err; 392 + 393 + input_dev = devm_input_allocate_device(&client->dev); 394 + if (!input_dev) 395 + return -ENOMEM; 396 + 397 + i2c_set_clientdata(client, ts); 305 398 306 399 ts->client = client; 307 400 ts->irq = client->irq; 308 401 ts->input = input_dev; 309 402 init_waitqueue_head(&ts->wait); 310 - 311 - ts->model = pdata->model; 312 - ts->x_plate_ohms = pdata->x_plate_ohms; 313 - ts->max_rt = pdata->max_rt ? : MAX_12BIT; 314 - ts->poll_delay = pdata->poll_delay ? : 1; 315 - ts->poll_period = pdata->poll_period ? : 1; 316 - ts->get_pendown_state = pdata->get_pendown_state; 317 - ts->clear_penirq = pdata->clear_penirq; 318 - 319 - if (pdata->x_plate_ohms == 0) { 320 - dev_err(&client->dev, "x_plate_ohms is not set up in platform data"); 321 - err = -EINVAL; 322 - goto err_free_mem; 323 - } 324 403 325 404 snprintf(ts->phys, sizeof(ts->phys), 326 405 "%s/input0", dev_name(&client->dev)); ··· 422 331 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 423 332 input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 424 333 425 - input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, pdata->fuzzx, 0); 426 - input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, pdata->fuzzy, 0); 334 + input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, ts->fuzzx, 0); 335 + input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, ts->fuzzy, 0); 427 336 input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, 428 - pdata->fuzzz, 0); 337 + ts->fuzzz, 0); 429 338 430 - if (pdata->init_platform_hw) 431 - pdata->init_platform_hw(); 339 + if (pdata) { 340 + if (pdata->exit_platform_hw) { 341 + err = devm_add_action(&client->dev, 342 + tsc2007_call_exit_platform_hw, 343 + &client->dev); 344 + if (err) { 345 + dev_err(&client->dev, 346 + "Failed to register exit_platform_hw action, %d\n", 347 + err); 348 + return err; 349 + } 350 + } 432 351 433 - err = request_threaded_irq(ts->irq, tsc2007_hard_irq, tsc2007_soft_irq, 434 - IRQF_ONESHOT, client->dev.driver->name, ts); 435 - if (err < 0) { 436 - dev_err(&client->dev, "irq %d busy?\n", ts->irq); 437 - goto err_free_mem; 352 + if (pdata->init_platform_hw) 353 + pdata->init_platform_hw(); 354 + } 355 + 356 + err = devm_request_threaded_irq(&client->dev, ts->irq, 357 + tsc2007_hard_irq, tsc2007_soft_irq, 358 + IRQF_ONESHOT, 359 + client->dev.driver->name, ts); 360 + if (err) { 361 + dev_err(&client->dev, "Failed to request irq %d: %d\n", 362 + ts->irq, err); 363 + return err; 438 364 } 439 365 440 366 tsc2007_stop(ts); 441 367 442 368 err = input_register_device(input_dev); 443 - if (err) 444 - goto err_free_irq; 445 - 446 - i2c_set_clientdata(client, ts); 447 - 448 - return 0; 449 - 450 - err_free_irq: 451 - free_irq(ts->irq, ts); 452 - if (pdata->exit_platform_hw) 453 - pdata->exit_platform_hw(); 454 - err_free_mem: 455 - input_free_device(input_dev); 456 - kfree(ts); 457 - return err; 458 - } 459 - 460 - static int tsc2007_remove(struct i2c_client *client) 461 - { 462 - struct tsc2007 *ts = i2c_get_clientdata(client); 463 - struct tsc2007_platform_data *pdata = client->dev.platform_data; 464 - 465 - free_irq(ts->irq, ts); 466 - 467 - if (pdata->exit_platform_hw) 468 - pdata->exit_platform_hw(); 469 - 470 - input_unregister_device(ts->input); 471 - kfree(ts); 369 + if (err) { 370 + dev_err(&client->dev, 371 + "Failed to register input device: %d\n", err); 372 + return err; 373 + } 472 374 473 375 return 0; 474 376 } ··· 473 389 474 390 MODULE_DEVICE_TABLE(i2c, tsc2007_idtable); 475 391 392 + #ifdef CONFIG_OF 393 + static const struct of_device_id tsc2007_of_match[] = { 394 + { .compatible = "ti,tsc2007" }, 395 + { /* sentinel */ } 396 + }; 397 + MODULE_DEVICE_TABLE(of, tsc2007_of_match); 398 + #endif 399 + 476 400 static struct i2c_driver tsc2007_driver = { 477 401 .driver = { 478 402 .owner = THIS_MODULE, 479 - .name = "tsc2007" 403 + .name = "tsc2007", 404 + .of_match_table = of_match_ptr(tsc2007_of_match), 480 405 }, 481 406 .id_table = tsc2007_idtable, 482 407 .probe = tsc2007_probe, 483 - .remove = tsc2007_remove, 484 408 }; 485 409 486 410 module_i2c_driver(tsc2007_driver);
-1
drivers/input/touchscreen/tsc40.c
··· 11 11 #include <linux/slab.h> 12 12 #include <linux/input.h> 13 13 #include <linux/serio.h> 14 - #include <linux/init.h> 15 14 16 15 #define PACKET_LENGTH 5 17 16 struct tsc_ser {
+4 -5
drivers/input/touchscreen/ucb1400_ts.c
··· 19 19 */ 20 20 21 21 #include <linux/module.h> 22 - #include <linux/init.h> 23 22 #include <linux/delay.h> 24 23 #include <linux/sched.h> 25 24 #include <linux/wait.h> ··· 319 320 320 321 static int ucb1400_ts_probe(struct platform_device *pdev) 321 322 { 322 - struct ucb1400_ts *ucb = pdev->dev.platform_data; 323 + struct ucb1400_ts *ucb = dev_get_platdata(&pdev->dev); 323 324 int error, x_res, y_res; 324 325 u16 fcsr; 325 326 ··· 398 399 399 400 static int ucb1400_ts_remove(struct platform_device *pdev) 400 401 { 401 - struct ucb1400_ts *ucb = pdev->dev.platform_data; 402 + struct ucb1400_ts *ucb = dev_get_platdata(&pdev->dev); 402 403 403 404 free_irq(ucb->irq, ucb); 404 405 input_unregister_device(ucb->ts_idev); ··· 409 410 #ifdef CONFIG_PM_SLEEP 410 411 static int ucb1400_ts_suspend(struct device *dev) 411 412 { 412 - struct ucb1400_ts *ucb = dev->platform_data; 413 + struct ucb1400_ts *ucb = dev_get_platdata(dev); 413 414 struct input_dev *idev = ucb->ts_idev; 414 415 415 416 mutex_lock(&idev->mutex); ··· 423 424 424 425 static int ucb1400_ts_resume(struct device *dev) 425 426 { 426 - struct ucb1400_ts *ucb = dev->platform_data; 427 + struct ucb1400_ts *ucb = dev_get_platdata(dev); 427 428 struct input_dev *idev = ucb->ts_idev; 428 429 429 430 mutex_lock(&idev->mutex);
-1
drivers/input/touchscreen/usbtouchscreen.c
··· 51 51 #include <linux/slab.h> 52 52 #include <linux/input.h> 53 53 #include <linux/module.h> 54 - #include <linux/init.h> 55 54 #include <linux/usb.h> 56 55 #include <linux/usb/input.h> 57 56 #include <linux/hid.h>
-1
drivers/input/touchscreen/wacom_w8001.c
··· 18 18 #include <linux/slab.h> 19 19 #include <linux/input/mt.h> 20 20 #include <linux/serio.h> 21 - #include <linux/init.h> 22 21 #include <linux/ctype.h> 23 22 #include <linux/delay.h> 24 23
-1
drivers/input/touchscreen/wm831x-ts.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/moduleparam.h> 15 15 #include <linux/kernel.h> 16 - #include <linux/init.h> 17 16 #include <linux/string.h> 18 17 #include <linux/pm.h> 19 18 #include <linux/input.h>
+1 -1
drivers/input/touchscreen/wm97xx-core.c
··· 584 584 static int wm97xx_probe(struct device *dev) 585 585 { 586 586 struct wm97xx *wm; 587 - struct wm97xx_pdata *pdata = dev->platform_data; 587 + struct wm97xx_pdata *pdata = dev_get_platdata(dev); 588 588 int ret = 0, id = 0; 589 589 590 590 wm = kzalloc(sizeof(struct wm97xx), GFP_KERNEL);
+2 -1
drivers/input/touchscreen/zforce_ts.c
··· 279 279 goto error; 280 280 } 281 281 282 - if (zforce_setconfig(ts, SETCONFIG_DUALTOUCH)) { 282 + ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH); 283 + if (ret) { 283 284 dev_err(&client->dev, "Unable to set config\n"); 284 285 goto error; 285 286 }
-1
drivers/input/touchscreen/zylonite-wm97xx.c
··· 20 20 #include <linux/module.h> 21 21 #include <linux/moduleparam.h> 22 22 #include <linux/kernel.h> 23 - #include <linux/init.h> 24 23 #include <linux/delay.h> 25 24 #include <linux/gpio.h> 26 25 #include <linux/irq.h>
+3 -5
include/linux/i2c/tsc2007.h
··· 7 7 u16 model; /* 2007. */ 8 8 u16 x_plate_ohms; /* must be non-zero value */ 9 9 u16 max_rt; /* max. resistance above which samples are ignored */ 10 - unsigned long poll_delay; /* delay (in ms) after pen-down event 11 - before polling starts */ 12 10 unsigned long poll_period; /* time (in ms) between samples */ 13 11 int fuzzx; /* fuzz factor for X, Y and pressure axes */ 14 12 int fuzzy; 15 13 int fuzzz; 16 14 17 - int (*get_pendown_state)(void); 18 - void (*clear_penirq)(void); /* If needed, clear 2nd level 19 - interrupt source */ 15 + int (*get_pendown_state)(struct device *); 16 + /* If needed, clear 2nd level interrupt source */ 17 + void (*clear_penirq)(void); 20 18 int (*init_platform_hw)(void); 21 19 void (*exit_platform_hw)(void); 22 20 };
+3 -7
include/linux/platform_data/keypad-ep93xx.h
··· 1 - /* 2 - * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h 3 - */ 4 - 5 - #ifndef __ASM_ARCH_EP93XX_KEYPAD_H 6 - #define __ASM_ARCH_EP93XX_KEYPAD_H 1 + #ifndef __KEYPAD_EP93XX_H 2 + #define __KEYPAD_EP93XX_H 7 3 8 4 struct matrix_keymap_data; 9 5 ··· 28 32 #define EP93XX_MATRIX_ROWS (8) 29 33 #define EP93XX_MATRIX_COLS (8) 30 34 31 - #endif /* __ASM_ARCH_EP93XX_KEYPAD_H */ 35 + #endif /* __KEYPAD_EP93XX_H */
+2 -4
include/linux/platform_data/keypad-omap.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/mach/keypad.h 3 - * 4 2 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> 5 3 * 6 4 * This program is free software; you can redistribute it and/or modify 7 5 * it under the terms of the GNU General Public License version 2 as 8 6 * published by the Free Software Foundation. 9 7 */ 10 - #ifndef ASMARM_ARCH_KEYPAD_H 11 - #define ASMARM_ARCH_KEYPAD_H 8 + #ifndef __KEYPAD_OMAP_H 9 + #define __KEYPAD_OMAP_H 12 10 13 11 #ifndef CONFIG_ARCH_OMAP1 14 12 #warning Please update the board to use matrix-keypad driver