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

Merge tag 'input-for-v6.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

- a set of tweaks to iqs269a touch controller driver

- a fix for ads7846 driver to properly handle 7845 chip

- cap11xx driver will support cap1203, cap1293 and cap1298 models

- xpad driver will support 8BitDo Pro 2 Wired Controller

- input drivers have been switched to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()

- other miscellaneous fixes and tweaks

* tag 'input-for-v6.3-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (113 commits)
dt-bindings: input: iqs626a: Redefine trackpad property types
Input: iqs626a - drop unused device node references
dt-bindings: input: touchscreen: st,stmfts: convert to dtschema
Input: cyttsp5 - fix bitmask for touch buttons
Input: exc3000 - properly stop timer on shutdown
Input: synaptics-rmi4 - fix SPI device ID
Input: cap11xx - add support for cap1203, cap1293 and cap1298
dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298
Input: pmic8xxx-keypad - fix a Kconfig spelling mistake & hyphenation
Input: edt-ft5x06 - fix typo in a comment
Input: tegra-kbc - use devm_platform_get_and_ioremap_resource()
Input: st-keyscan - use devm_platform_get_and_ioremap_resource()
Input: spear-keyboard - use devm_platform_get_and_ioremap_resource()
Input: olpc_apsp - use devm_platform_get_and_ioremap_resource()
Input: arc_ps2 - use devm_platform_get_and_ioremap_resource()
Input: apbps2 - use devm_platform_get_and_ioremap_resource()
Input: altera_ps2 - use devm_platform_get_and_ioremap_resource()
Input: ads7846 - don't check penirq immediately for 7845
Input: ads7846 - always set last command to PWRDOWN
Input: ads7846 - don't report pressure for ads7845
...

+811 -884
+67 -27
Documentation/devicetree/bindings/input/iqs626a.yaml
··· 564 564 2: Partial 565 565 3: Full 566 566 567 - azoteq,ati-base: 568 - $ref: /schemas/types.yaml#/definitions/uint32-array 569 - minItems: 6 570 - maxItems: 9 571 - items: 572 - minimum: 45 573 - maximum: 300 574 - default: [45, 45, 45, 45, 45, 45, 45, 45, 45] 575 - description: Specifies each individual trackpad channel's ATI base. 576 - 577 567 azoteq,ati-target: 578 568 $ref: /schemas/types.yaml#/definitions/uint32 579 569 multipleOf: 32 ··· 609 619 type: boolean 610 620 description: 611 621 Tightens the ATI band from 1/8 to 1/16 of the desired target. 612 - 613 - azoteq,thresh: 614 - $ref: /schemas/types.yaml#/definitions/uint32-array 615 - minItems: 6 616 - maxItems: 9 617 - items: 618 - minimum: 0 619 - maximum: 255 620 - default: [0, 0, 0, 0, 0, 0, 0, 0, 0] 621 - description: 622 - Specifies each individual trackpad channel's touch threshold. 623 622 624 623 azoteq,hyst: 625 624 $ref: /schemas/types.yaml#/definitions/uint32 ··· 699 720 Specifies the number of points across which an axial gesture must 700 721 travel in order to be interpreted as a flick or swipe. 701 722 723 + patternProperties: 724 + "^channel-[0-8]$": 725 + type: object 726 + description: Represents a single trackpad channel. 727 + 728 + properties: 729 + azoteq,thresh: 730 + $ref: /schemas/types.yaml#/definitions/uint32 731 + minimum: 0 732 + maximum: 255 733 + default: 0 734 + description: Specifies the threshold for the channel. 735 + 736 + azoteq,ati-base: 737 + $ref: /schemas/types.yaml#/definitions/uint32 738 + minimum: 45 739 + maximum: 300 740 + default: 45 741 + description: Specifies the channel's ATI base. 742 + 743 + additionalProperties: false 744 + 702 745 dependencies: 703 746 azoteq,gesture-swipe: ["linux,keycodes"] 704 747 azoteq,timeout-tap-ms: ["linux,keycodes"] ··· 781 780 azoteq,filt-str-lp-cnt = <1>; 782 781 783 782 azoteq,hyst = <4>; 784 - azoteq,thresh = <35>, <40>, <40>, 785 - <38>, <33>, <38>, 786 - <35>, <35>, <35>; 787 783 788 784 azoteq,ati-mode = <3>; 789 - azoteq,ati-base = <195>, <195>, <195>, 790 - <195>, <195>, <195>, 791 - <195>, <195>, <195>; 792 785 azoteq,ati-target = <512>; 793 786 794 787 azoteq,proj-bias = <1>; ··· 799 804 azoteq,timeout-swipe-ms = <800>; 800 805 azoteq,timeout-tap-ms = <400>; 801 806 azoteq,thresh-swipe = <40>; 807 + 808 + channel-0 { 809 + azoteq,thresh = <35>; 810 + azoteq,ati-base = <195>; 811 + }; 812 + 813 + channel-1 { 814 + azoteq,thresh = <40>; 815 + azoteq,ati-base = <195>; 816 + }; 817 + 818 + channel-2 { 819 + azoteq,thresh = <40>; 820 + azoteq,ati-base = <195>; 821 + }; 822 + 823 + channel-3 { 824 + azoteq,thresh = <38>; 825 + azoteq,ati-base = <195>; 826 + }; 827 + 828 + channel-4 { 829 + azoteq,thresh = <33>; 830 + azoteq,ati-base = <195>; 831 + }; 832 + 833 + channel-5 { 834 + azoteq,thresh = <38>; 835 + azoteq,ati-base = <195>; 836 + }; 837 + 838 + channel-6 { 839 + azoteq,thresh = <35>; 840 + azoteq,ati-base = <195>; 841 + }; 842 + 843 + channel-7 { 844 + azoteq,thresh = <35>; 845 + azoteq,ati-base = <195>; 846 + }; 847 + 848 + channel-8 { 849 + azoteq,thresh = <35>; 850 + azoteq,ati-base = <195>; 851 + }; 802 852 }; 803 853 804 854 /*
+3
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
··· 19 19 - microchip,cap1106 20 20 - microchip,cap1126 21 21 - microchip,cap1188 22 + - microchip,cap1203 22 23 - microchip,cap1206 24 + - microchip,cap1293 25 + - microchip,cap1298 23 26 24 27 reg: 25 28 maxItems: 1
-41
Documentation/devicetree/bindings/input/touchscreen/st,stmfts.txt
··· 1 - * ST-Microelectronics FingerTip touchscreen controller 2 - 3 - The ST-Microelectronics FingerTip device provides a basic touchscreen 4 - functionality. Along with it the user can enable the touchkey which can work as 5 - a basic HOME and BACK key for phones. 6 - 7 - The driver supports also hovering as an absolute single touch event with x, y, z 8 - coordinates. 9 - 10 - Required properties: 11 - - compatible : must be "st,stmfts" 12 - - reg : I2C slave address, (e.g. 0x49) 13 - - interrupts : interrupt specification 14 - - avdd-supply : analogic power supply 15 - - vdd-supply : power supply 16 - - touchscreen-size-x : see touchscreen.txt 17 - - touchscreen-size-y : see touchscreen.txt 18 - 19 - Optional properties: 20 - - touch-key-connected : specifies whether the touchkey feature is connected 21 - - ledvdd-supply : power supply to the touch key leds 22 - 23 - Example: 24 - 25 - i2c@00000000 { 26 - 27 - /* ... */ 28 - 29 - touchscreen@49 { 30 - compatible = "st,stmfts"; 31 - reg = <0x49>; 32 - interrupt-parent = <&gpa1>; 33 - interrupts = <1 IRQ_TYPE_NONE>; 34 - touchscreen-size-x = <1599>; 35 - touchscreen-size-y = <2559>; 36 - touch-key-connected; 37 - avdd-supply = <&ldo30_reg>; 38 - vdd-supply = <&ldo31_reg>; 39 - ledvdd-supply = <&ldo33_reg>; 40 - }; 41 - };
+72
Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/input/touchscreen/st,stmfts.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ST-Microelectronics FingerTip touchscreen controller 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 11 + 12 + description: 13 + The ST-Microelectronics FingerTip device provides a basic touchscreen 14 + functionality. Along with it the user can enable the touchkey which can work 15 + as a basic HOME and BACK key for phones. 16 + 17 + allOf: 18 + - $ref: touchscreen.yaml# 19 + 20 + properties: 21 + compatible: 22 + const: st,stmfts 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + avdd-supply: 28 + description: Analogic power supply 29 + 30 + interrupts: 31 + maxItems: 1 32 + 33 + ledvdd-supply: 34 + description: Power supply to the touch key leds 35 + 36 + touch-key-connected: 37 + type: boolean 38 + description: The touchkey feature is connected 39 + 40 + vdd-supply: 41 + description: Power supply 42 + 43 + required: 44 + - compatible 45 + - reg 46 + - avdd-supply 47 + - interrupts 48 + - vdd-supply 49 + 50 + unevaluatedProperties: false 51 + 52 + examples: 53 + - | 54 + #include <dt-bindings/interrupt-controller/irq.h> 55 + 56 + i2c { 57 + #address-cells = <1>; 58 + #size-cells = <0>; 59 + 60 + touchscreen@49 { 61 + compatible = "st,stmfts"; 62 + reg = <0x49>; 63 + interrupt-parent = <&gpa1>; 64 + interrupts = <1 IRQ_TYPE_LEVEL_LOW>; 65 + touchscreen-size-x = <1599>; 66 + touchscreen-size-y = <2559>; 67 + touch-key-connected; 68 + avdd-supply = <&ldo30_reg>; 69 + vdd-supply = <&ldo31_reg>; 70 + ledvdd-supply = <&ldo33_reg>; 71 + }; 72 + };
+2 -5
drivers/input/input.c
··· 19 19 #include <linux/proc_fs.h> 20 20 #include <linux/sched.h> 21 21 #include <linux/seq_file.h> 22 + #include <linux/pm.h> 22 23 #include <linux/poll.h> 23 24 #include <linux/device.h> 24 25 #include <linux/kstrtox.h> ··· 1829 1828 return ret; 1830 1829 } 1831 1830 1832 - #ifdef CONFIG_PM_SLEEP 1833 1831 static int input_dev_suspend(struct device *dev) 1834 1832 { 1835 1833 struct input_dev *input_dev = to_input_dev(dev); ··· 1903 1903 .poweroff = input_dev_poweroff, 1904 1904 .restore = input_dev_resume, 1905 1905 }; 1906 - #endif /* CONFIG_PM */ 1907 1906 1908 1907 static const struct device_type input_dev_type = { 1909 1908 .groups = input_dev_attr_groups, 1910 1909 .release = input_dev_release, 1911 1910 .uevent = input_dev_uevent, 1912 - #ifdef CONFIG_PM_SLEEP 1913 - .pm = &input_dev_pm_ops, 1914 - #endif 1911 + .pm = pm_sleep_ptr(&input_dev_pm_ops), 1915 1912 }; 1916 1913 1917 1914 static char *input_devnode(const struct device *dev, umode_t *mode)
+2
drivers/input/joystick/xpad.c
··· 359 359 { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, 360 360 { 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 }, 361 361 { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE }, 362 + { 0x2dc8, 0x3106, "8BitDo Pro 2 Wired Controller", 0, XTYPE_XBOX360 }, 362 363 { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 }, 363 364 { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 }, 364 365 { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 }, ··· 493 492 XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */ 494 493 XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */ 495 494 XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */ 495 + XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller */ 496 496 XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */ 497 497 XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ 498 498 XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
+1 -1
drivers/input/keyboard/Kconfig
··· 557 557 help 558 558 Say Y here if you want to enable the driver for the PMIC8XXX 559 559 keypad provided as a reference design from Qualcomm. This is intended 560 - to support upto 18x8 matrix based keypad design. 560 + to support up to 18x8 matrix-based keypad design. 561 561 562 562 To compile this driver as a module, choose M here: the module will 563 563 be called pmic8xxx-keypad.
+5 -5
drivers/input/keyboard/applespi.c
··· 1876 1876 return 0; 1877 1877 } 1878 1878 1879 - static int __maybe_unused applespi_suspend(struct device *dev) 1879 + static int applespi_suspend(struct device *dev) 1880 1880 { 1881 1881 struct spi_device *spi = to_spi_device(dev); 1882 1882 struct applespi_data *applespi = spi_get_drvdata(spi); ··· 1903 1903 return 0; 1904 1904 } 1905 1905 1906 - static int __maybe_unused applespi_resume(struct device *dev) 1906 + static int applespi_resume(struct device *dev) 1907 1907 { 1908 1908 struct spi_device *spi = to_spi_device(dev); 1909 1909 struct applespi_data *applespi = spi_get_drvdata(spi); ··· 1947 1947 MODULE_DEVICE_TABLE(acpi, applespi_acpi_match); 1948 1948 1949 1949 static const struct dev_pm_ops applespi_pm_ops = { 1950 - SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume) 1951 - .poweroff_late = applespi_poweroff_late, 1950 + SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume) 1951 + .poweroff_late = pm_sleep_ptr(applespi_poweroff_late), 1952 1952 }; 1953 1953 1954 1954 static struct spi_driver applespi_driver = { 1955 1955 .driver = { 1956 1956 .name = "applespi", 1957 1957 .acpi_match_table = applespi_acpi_match, 1958 - .pm = &applespi_pm_ops, 1958 + .pm = pm_sleep_ptr(&applespi_pm_ops), 1959 1959 }, 1960 1960 .probe = applespi_probe, 1961 1961 .remove = applespi_remove,
+17 -2
drivers/input/keyboard/cap11xx.c
··· 98 98 CAP1106, 99 99 CAP1126, 100 100 CAP1188, 101 + CAP1203, 101 102 CAP1206, 103 + CAP1293, 104 + CAP1298 102 105 }; 103 106 104 107 static const struct cap11xx_hw_model cap11xx_devices[] = { 105 108 [CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false }, 106 109 [CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false }, 107 110 [CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false }, 111 + [CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true }, 108 112 [CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true }, 113 + [CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false }, 114 + [CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false }, 109 115 }; 110 116 111 117 static const struct reg_default cap11xx_reg_defaults[] = { ··· 383 377 if (error < 0) 384 378 return error; 385 379 386 - dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev); 380 + dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n", 381 + id->name, rev); 387 382 node = dev->of_node; 388 383 389 384 if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) { ··· 397 390 dev_err(dev, "Invalid sensor-gain value %d\n", gain32); 398 391 } 399 392 400 - if (id->driver_data != CAP1206) { 393 + if (id->driver_data == CAP1106 || 394 + id->driver_data == CAP1126 || 395 + id->driver_data == CAP1188) { 401 396 if (of_property_read_bool(node, "microchip,irq-active-high")) { 402 397 error = regmap_update_bits(priv->regmap, 403 398 CAP11XX_REG_CONFIG2, ··· 492 483 { .compatible = "microchip,cap1106", }, 493 484 { .compatible = "microchip,cap1126", }, 494 485 { .compatible = "microchip,cap1188", }, 486 + { .compatible = "microchip,cap1203", }, 495 487 { .compatible = "microchip,cap1206", }, 488 + { .compatible = "microchip,cap1293", }, 489 + { .compatible = "microchip,cap1298", }, 496 490 {} 497 491 }; 498 492 MODULE_DEVICE_TABLE(of, cap11xx_dt_ids); ··· 504 492 { "cap1106", CAP1106 }, 505 493 { "cap1126", CAP1126 }, 506 494 { "cap1188", CAP1188 }, 495 + { "cap1203", CAP1203 }, 507 496 { "cap1206", CAP1206 }, 497 + { "cap1293", CAP1293 }, 498 + { "cap1298", CAP1298 }, 508 499 {} 509 500 }; 510 501 MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
+15
drivers/input/keyboard/cros_ec_keyb.c
··· 100 100 .code = KEY_VOLUMEDOWN, 101 101 .bit = EC_MKBP_VOL_DOWN, 102 102 }, 103 + { 104 + .ev_type = EV_KEY, 105 + .code = KEY_BRIGHTNESSUP, 106 + .bit = EC_MKBP_BRI_UP, 107 + }, 108 + { 109 + .ev_type = EV_KEY, 110 + .code = KEY_BRIGHTNESSDOWN, 111 + .bit = EC_MKBP_BRI_DOWN, 112 + }, 113 + { 114 + .ev_type = EV_KEY, 115 + .code = KEY_SCREENLOCK, 116 + .bit = EC_MKBP_SCREEN_LOCK, 117 + }, 103 118 104 119 /* Switches */ 105 120 {
+3 -3
drivers/input/keyboard/omap4-keypad.c
··· 310 310 * Interrupt may not happen for key-up events. We must clear stuck 311 311 * key-up events after the keyboard hardware has auto-idled. 312 312 */ 313 - static int __maybe_unused omap4_keypad_runtime_suspend(struct device *dev) 313 + static int omap4_keypad_runtime_suspend(struct device *dev) 314 314 { 315 315 struct platform_device *pdev = to_platform_device(dev); 316 316 struct omap4_keypad *keypad_data = platform_get_drvdata(pdev); ··· 328 328 } 329 329 330 330 static const struct dev_pm_ops omap4_keypad_pm_ops = { 331 - SET_RUNTIME_PM_OPS(omap4_keypad_runtime_suspend, NULL, NULL) 331 + RUNTIME_PM_OPS(omap4_keypad_runtime_suspend, NULL, NULL) 332 332 }; 333 333 334 334 static void omap4_disable_pm(void *d) ··· 488 488 .driver = { 489 489 .name = "omap4-keypad", 490 490 .of_match_table = omap_keypad_dt_match, 491 - .pm = &omap4_keypad_pm_ops, 491 + .pm = pm_ptr(&omap4_keypad_pm_ops), 492 492 }, 493 493 }; 494 494 module_platform_driver(omap4_keypad_driver);
+4 -8
drivers/input/keyboard/samsung-keypad.c
··· 458 458 return 0; 459 459 } 460 460 461 - #ifdef CONFIG_PM 462 461 static int samsung_keypad_runtime_suspend(struct device *dev) 463 462 { 464 463 struct platform_device *pdev = to_platform_device(dev); ··· 502 503 503 504 return 0; 504 505 } 505 - #endif 506 506 507 - #ifdef CONFIG_PM_SLEEP 508 507 static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad, 509 508 bool enable) 510 509 { ··· 560 563 561 564 return 0; 562 565 } 563 - #endif 564 566 565 567 static const struct dev_pm_ops samsung_keypad_pm_ops = { 566 - SET_SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume) 567 - SET_RUNTIME_PM_OPS(samsung_keypad_runtime_suspend, 568 - samsung_keypad_runtime_resume, NULL) 568 + SYSTEM_SLEEP_PM_OPS(samsung_keypad_suspend, samsung_keypad_resume) 569 + RUNTIME_PM_OPS(samsung_keypad_runtime_suspend, 570 + samsung_keypad_runtime_resume, NULL) 569 571 }; 570 572 571 573 #ifdef CONFIG_OF ··· 594 598 .driver = { 595 599 .name = "samsung-keypad", 596 600 .of_match_table = of_match_ptr(samsung_keypad_dt_match), 597 - .pm = &samsung_keypad_pm_ops, 601 + .pm = pm_ptr(&samsung_keypad_pm_ops), 598 602 }, 599 603 .id_table = samsung_keypad_driver_ids, 600 604 };
+1 -3
drivers/input/keyboard/spear-keyboard.c
··· 186 186 const struct matrix_keymap_data *keymap = pdata ? pdata->keymap : NULL; 187 187 struct spear_kbd *kbd; 188 188 struct input_dev *input_dev; 189 - struct resource *res; 190 189 int irq; 191 190 int error; 192 191 ··· 218 219 kbd->suspended_rate = pdata->suspended_rate; 219 220 } 220 221 221 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 222 - kbd->io_base = devm_ioremap_resource(&pdev->dev, res); 222 + kbd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 223 223 if (IS_ERR(kbd->io_base)) 224 224 return PTR_ERR(kbd->io_base); 225 225
+1 -3
drivers/input/keyboard/st-keyscan.c
··· 125 125 { 126 126 struct st_keyscan *keypad_data; 127 127 struct input_dev *input_dev; 128 - struct resource *res; 129 128 int error; 130 129 131 130 if (!pdev->dev.of_node) { ··· 168 169 169 170 input_set_drvdata(input_dev, keypad_data); 170 171 171 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 172 - keypad_data->base = devm_ioremap_resource(&pdev->dev, res); 172 + keypad_data->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 173 173 if (IS_ERR(keypad_data->base)) 174 174 return PTR_ERR(keypad_data->base); 175 175
+1 -3
drivers/input/keyboard/tegra-kbc.c
··· 598 598 static int tegra_kbc_probe(struct platform_device *pdev) 599 599 { 600 600 struct tegra_kbc *kbc; 601 - struct resource *res; 602 601 int err; 603 602 int num_rows = 0; 604 603 unsigned int debounce_cnt; ··· 641 642 642 643 timer_setup(&kbc->timer, tegra_kbc_keypress_timer, 0); 643 644 644 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 645 - kbc->mmio = devm_ioremap_resource(&pdev->dev, res); 645 + kbc->mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 646 646 if (IS_ERR(kbc->mmio)) 647 647 return PTR_ERR(kbc->mmio); 648 648
+5 -4
drivers/input/misc/88pm860x_onkey.c
··· 110 110 return 0; 111 111 } 112 112 113 - static int __maybe_unused pm860x_onkey_suspend(struct device *dev) 113 + static int pm860x_onkey_suspend(struct device *dev) 114 114 { 115 115 struct platform_device *pdev = to_platform_device(dev); 116 116 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); ··· 119 119 chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY; 120 120 return 0; 121 121 } 122 - static int __maybe_unused pm860x_onkey_resume(struct device *dev) 122 + static int pm860x_onkey_resume(struct device *dev) 123 123 { 124 124 struct platform_device *pdev = to_platform_device(dev); 125 125 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); ··· 129 129 return 0; 130 130 } 131 131 132 - static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume); 132 + static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, 133 + pm860x_onkey_suspend, pm860x_onkey_resume); 133 134 134 135 static struct platform_driver pm860x_onkey_driver = { 135 136 .driver = { 136 137 .name = "88pm860x-onkey", 137 - .pm = &pm860x_onkey_pm_ops, 138 + .pm = pm_sleep_ptr(&pm860x_onkey_pm_ops), 138 139 }, 139 140 .probe = pm860x_onkey_probe, 140 141 };
+1 -13
drivers/input/misc/ad714x-i2c.c
··· 12 12 #include <linux/pm.h> 13 13 #include "ad714x.h" 14 14 15 - static int __maybe_unused ad714x_i2c_suspend(struct device *dev) 16 - { 17 - return ad714x_disable(i2c_get_clientdata(to_i2c_client(dev))); 18 - } 19 - 20 - static int __maybe_unused ad714x_i2c_resume(struct device *dev) 21 - { 22 - return ad714x_enable(i2c_get_clientdata(to_i2c_client(dev))); 23 - } 24 - 25 - static SIMPLE_DEV_PM_OPS(ad714x_i2c_pm, ad714x_i2c_suspend, ad714x_i2c_resume); 26 - 27 15 static int ad714x_i2c_write(struct ad714x_chip *chip, 28 16 unsigned short reg, unsigned short data) 29 17 { ··· 84 96 static struct i2c_driver ad714x_i2c_driver = { 85 97 .driver = { 86 98 .name = "ad714x_captouch", 87 - .pm = &ad714x_i2c_pm, 99 + .pm = pm_sleep_ptr(&ad714x_pm), 88 100 }, 89 101 .probe_new = ad714x_i2c_probe, 90 102 .id_table = ad714x_id,
+1 -13
drivers/input/misc/ad714x-spi.c
··· 15 15 #define AD714x_SPI_CMD_PREFIX 0xE000 /* bits 15:11 */ 16 16 #define AD714x_SPI_READ BIT(10) 17 17 18 - static int __maybe_unused ad714x_spi_suspend(struct device *dev) 19 - { 20 - return ad714x_disable(spi_get_drvdata(to_spi_device(dev))); 21 - } 22 - 23 - static int __maybe_unused ad714x_spi_resume(struct device *dev) 24 - { 25 - return ad714x_enable(spi_get_drvdata(to_spi_device(dev))); 26 - } 27 - 28 - static SIMPLE_DEV_PM_OPS(ad714x_spi_pm, ad714x_spi_suspend, ad714x_spi_resume); 29 - 30 18 static int ad714x_spi_read(struct ad714x_chip *chip, 31 19 unsigned short reg, unsigned short *data, size_t len) 32 20 { ··· 91 103 static struct spi_driver ad714x_spi_driver = { 92 104 .driver = { 93 105 .name = "ad714x_captouch", 94 - .pm = &ad714x_spi_pm, 106 + .pm = pm_sleep_ptr(&ad714x_pm), 95 107 }, 96 108 .probe = ad714x_spi_probe, 97 109 };
+6 -6
drivers/input/misc/ad714x.c
··· 1162 1162 } 1163 1163 EXPORT_SYMBOL(ad714x_probe); 1164 1164 1165 - #ifdef CONFIG_PM 1166 - int ad714x_disable(struct ad714x_chip *ad714x) 1165 + static int ad714x_suspend(struct device *dev) 1167 1166 { 1167 + struct ad714x_chip *ad714x = dev_get_drvdata(dev); 1168 1168 unsigned short data; 1169 1169 1170 1170 dev_dbg(ad714x->dev, "%s enter\n", __func__); ··· 1178 1178 1179 1179 return 0; 1180 1180 } 1181 - EXPORT_SYMBOL(ad714x_disable); 1182 1181 1183 - int ad714x_enable(struct ad714x_chip *ad714x) 1182 + static int ad714x_resume(struct device *dev) 1184 1183 { 1184 + struct ad714x_chip *ad714x = dev_get_drvdata(dev); 1185 1185 dev_dbg(ad714x->dev, "%s enter\n", __func__); 1186 1186 1187 1187 mutex_lock(&ad714x->mutex); ··· 1201 1201 1202 1202 return 0; 1203 1203 } 1204 - EXPORT_SYMBOL(ad714x_enable); 1205 - #endif 1204 + 1205 + EXPORT_SIMPLE_DEV_PM_OPS(ad714x_pm, ad714x_suspend, ad714x_resume); 1206 1206 1207 1207 MODULE_DESCRIPTION("Analog Devices AD714X Capacitance Touch Sensor Driver"); 1208 1208 MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
+2 -2
drivers/input/misc/ad714x.h
··· 8 8 #ifndef _AD714X_H_ 9 9 #define _AD714X_H_ 10 10 11 + #include <linux/pm.h> 11 12 #include <linux/types.h> 12 13 13 14 #define STAGE_NUM 12 ··· 46 45 47 46 }; 48 47 49 - int ad714x_disable(struct ad714x_chip *ad714x); 50 - int ad714x_enable(struct ad714x_chip *ad714x); 48 + extern const struct dev_pm_ops ad714x_pm; 51 49 struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, 52 50 ad714x_read_t read, ad714x_write_t write); 53 51
+1 -24
drivers/input/misc/adxl34x-i2c.c
··· 105 105 adxl34x_remove(ac); 106 106 } 107 107 108 - static int __maybe_unused adxl34x_i2c_suspend(struct device *dev) 109 - { 110 - struct i2c_client *client = to_i2c_client(dev); 111 - struct adxl34x *ac = i2c_get_clientdata(client); 112 - 113 - adxl34x_suspend(ac); 114 - 115 - return 0; 116 - } 117 - 118 - static int __maybe_unused adxl34x_i2c_resume(struct device *dev) 119 - { 120 - struct i2c_client *client = to_i2c_client(dev); 121 - struct adxl34x *ac = i2c_get_clientdata(client); 122 - 123 - adxl34x_resume(ac); 124 - 125 - return 0; 126 - } 127 - 128 - static SIMPLE_DEV_PM_OPS(adxl34x_i2c_pm, adxl34x_i2c_suspend, 129 - adxl34x_i2c_resume); 130 - 131 108 static const struct i2c_device_id adxl34x_id[] = { 132 109 { "adxl34x", 0 }, 133 110 { } ··· 132 155 static struct i2c_driver adxl34x_driver = { 133 156 .driver = { 134 157 .name = "adxl34x", 135 - .pm = &adxl34x_i2c_pm, 158 + .pm = pm_sleep_ptr(&adxl34x_pm), 136 159 .of_match_table = adxl34x_of_id, 137 160 }, 138 161 .probe_new = adxl34x_i2c_probe,
+1 -24
drivers/input/misc/adxl34x-spi.c
··· 94 94 adxl34x_remove(ac); 95 95 } 96 96 97 - static int __maybe_unused adxl34x_spi_suspend(struct device *dev) 98 - { 99 - struct spi_device *spi = to_spi_device(dev); 100 - struct adxl34x *ac = spi_get_drvdata(spi); 101 - 102 - adxl34x_suspend(ac); 103 - 104 - return 0; 105 - } 106 - 107 - static int __maybe_unused adxl34x_spi_resume(struct device *dev) 108 - { 109 - struct spi_device *spi = to_spi_device(dev); 110 - struct adxl34x *ac = spi_get_drvdata(spi); 111 - 112 - adxl34x_resume(ac); 113 - 114 - return 0; 115 - } 116 - 117 - static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend, 118 - adxl34x_spi_resume); 119 - 120 97 static struct spi_driver adxl34x_driver = { 121 98 .driver = { 122 99 .name = "adxl34x", 123 - .pm = &adxl34x_spi_pm, 100 + .pm = pm_sleep_ptr(&adxl34x_pm), 124 101 }, 125 102 .probe = adxl34x_spi_probe, 126 103 .remove = adxl34x_spi_remove,
+13 -5
drivers/input/misc/adxl34x.c
··· 412 412 AC_WRITE(ac, POWER_CTL, ac->pdata.power_mode | PCTL_MEASURE); 413 413 } 414 414 415 - void adxl34x_suspend(struct adxl34x *ac) 415 + static int adxl34x_suspend(struct device *dev) 416 416 { 417 + struct adxl34x *ac = dev_get_drvdata(dev); 418 + 417 419 mutex_lock(&ac->mutex); 418 420 419 421 if (!ac->suspended && !ac->disabled && ac->opened) ··· 424 422 ac->suspended = true; 425 423 426 424 mutex_unlock(&ac->mutex); 427 - } 428 - EXPORT_SYMBOL_GPL(adxl34x_suspend); 429 425 430 - void adxl34x_resume(struct adxl34x *ac) 426 + return 0; 427 + } 428 + 429 + static int adxl34x_resume(struct device *dev) 431 430 { 431 + struct adxl34x *ac = dev_get_drvdata(dev); 432 + 432 433 mutex_lock(&ac->mutex); 433 434 434 435 if (ac->suspended && !ac->disabled && ac->opened) ··· 440 435 ac->suspended = false; 441 436 442 437 mutex_unlock(&ac->mutex); 438 + 439 + return 0; 443 440 } 444 - EXPORT_SYMBOL_GPL(adxl34x_resume); 445 441 446 442 static ssize_t adxl34x_disable_show(struct device *dev, 447 443 struct device_attribute *attr, char *buf) ··· 911 905 kfree(ac); 912 906 } 913 907 EXPORT_SYMBOL_GPL(adxl34x_remove); 908 + 909 + EXPORT_GPL_SIMPLE_DEV_PM_OPS(adxl34x_pm, adxl34x_suspend, adxl34x_resume); 914 910 915 911 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 916 912 MODULE_DESCRIPTION("ADXL345/346 Three-Axis Digital Accelerometer Driver");
+2 -2
drivers/input/misc/adxl34x.h
··· 20 20 int (*write)(struct device *, unsigned char, unsigned char); 21 21 }; 22 22 23 - void adxl34x_suspend(struct adxl34x *ac); 24 - void adxl34x_resume(struct adxl34x *ac); 25 23 struct adxl34x *adxl34x_probe(struct device *dev, int irq, 26 24 bool fifo_delay_default, 27 25 const struct adxl34x_bus_ops *bops); 28 26 void adxl34x_remove(struct adxl34x *ac); 27 + 28 + extern const struct dev_pm_ops adxl34x_pm; 29 29 30 30 #endif
+5 -7
drivers/input/misc/axp20x-pek.c
··· 336 336 return 0; 337 337 } 338 338 339 - static int __maybe_unused axp20x_pek_suspend(struct device *dev) 339 + static int axp20x_pek_suspend(struct device *dev) 340 340 { 341 341 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 342 342 ··· 355 355 return 0; 356 356 } 357 357 358 - static int __maybe_unused axp20x_pek_resume(struct device *dev) 358 + static int axp20x_pek_resume(struct device *dev) 359 359 { 360 360 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 361 361 ··· 389 389 } 390 390 391 391 static const struct dev_pm_ops axp20x_pek_pm_ops = { 392 - SET_SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume) 393 - #ifdef CONFIG_PM_SLEEP 394 - .resume_noirq = axp20x_pek_resume_noirq, 395 - #endif 392 + SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume) 393 + .resume_noirq = pm_sleep_ptr(axp20x_pek_resume_noirq), 396 394 }; 397 395 398 396 static const struct platform_device_id axp_pek_id_match[] = { ··· 411 413 .id_table = axp_pek_id_match, 412 414 .driver = { 413 415 .name = "axp20x-pek", 414 - .pm = &axp20x_pek_pm_ops, 416 + .pm = pm_sleep_ptr(&axp20x_pek_pm_ops), 415 417 .dev_groups = axp20x_groups, 416 418 }, 417 419 };
+1 -5
drivers/input/misc/cma3000_d0x_i2c.c
··· 64 64 cma3000_exit(data); 65 65 } 66 66 67 - #ifdef CONFIG_PM 68 67 static int cma3000_i2c_suspend(struct device *dev) 69 68 { 70 69 struct i2c_client *client = to_i2c_client(dev); ··· 88 89 .suspend = cma3000_i2c_suspend, 89 90 .resume = cma3000_i2c_resume, 90 91 }; 91 - #endif 92 92 93 93 static const struct i2c_device_id cma3000_i2c_id[] = { 94 94 { "cma3000_d01", 0 }, ··· 102 104 .id_table = cma3000_i2c_id, 103 105 .driver = { 104 106 .name = "cma3000_i2c_accl", 105 - #ifdef CONFIG_PM 106 - .pm = &cma3000_i2c_pm_ops, 107 - #endif 107 + .pm = pm_sleep_ptr(&cma3000_i2c_pm_ops), 108 108 }, 109 109 }; 110 110
+4 -4
drivers/input/misc/da7280.c
··· 1260 1260 return 0; 1261 1261 } 1262 1262 1263 - static int __maybe_unused da7280_suspend(struct device *dev) 1263 + static int da7280_suspend(struct device *dev) 1264 1264 { 1265 1265 struct da7280_haptic *haptics = dev_get_drvdata(dev); 1266 1266 ··· 1281 1281 return 0; 1282 1282 } 1283 1283 1284 - static int __maybe_unused da7280_resume(struct device *dev) 1284 + static int da7280_resume(struct device *dev) 1285 1285 { 1286 1286 struct da7280_haptic *haptics = dev_get_drvdata(dev); 1287 1287 int retval; ··· 1313 1313 }; 1314 1314 MODULE_DEVICE_TABLE(i2c, da7280_i2c_id); 1315 1315 1316 - static SIMPLE_DEV_PM_OPS(da7280_pm_ops, da7280_suspend, da7280_resume); 1316 + static DEFINE_SIMPLE_DEV_PM_OPS(da7280_pm_ops, da7280_suspend, da7280_resume); 1317 1317 1318 1318 static struct i2c_driver da7280_driver = { 1319 1319 .driver = { 1320 1320 .name = "da7280", 1321 1321 .of_match_table = of_match_ptr(da7280_of_match), 1322 - .pm = &da7280_pm_ops, 1322 + .pm = pm_sleep_ptr(&da7280_pm_ops), 1323 1323 }, 1324 1324 .probe_new = da7280_probe, 1325 1325 .id_table = da7280_i2c_id,
+4 -4
drivers/input/misc/drv260x.c
··· 572 572 return 0; 573 573 } 574 574 575 - static int __maybe_unused drv260x_suspend(struct device *dev) 575 + static int drv260x_suspend(struct device *dev) 576 576 { 577 577 struct drv260x_data *haptics = dev_get_drvdata(dev); 578 578 int ret = 0; ··· 604 604 return ret; 605 605 } 606 606 607 - static int __maybe_unused drv260x_resume(struct device *dev) 607 + static int drv260x_resume(struct device *dev) 608 608 { 609 609 struct drv260x_data *haptics = dev_get_drvdata(dev); 610 610 int ret = 0; ··· 635 635 return ret; 636 636 } 637 637 638 - static SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume); 638 + static DEFINE_SIMPLE_DEV_PM_OPS(drv260x_pm_ops, drv260x_suspend, drv260x_resume); 639 639 640 640 static const struct i2c_device_id drv260x_id[] = { 641 641 { "drv2605l", 0 }, ··· 657 657 .driver = { 658 658 .name = "drv260x-haptics", 659 659 .of_match_table = drv260x_of_match, 660 - .pm = &drv260x_pm_ops, 660 + .pm = pm_sleep_ptr(&drv260x_pm_ops), 661 661 }, 662 662 .id_table = drv260x_id, 663 663 };
+4 -4
drivers/input/misc/drv2665.c
··· 222 222 return 0; 223 223 } 224 224 225 - static int __maybe_unused drv2665_suspend(struct device *dev) 225 + static int drv2665_suspend(struct device *dev) 226 226 { 227 227 struct drv2665_data *haptics = dev_get_drvdata(dev); 228 228 int ret = 0; ··· 251 251 return ret; 252 252 } 253 253 254 - static int __maybe_unused drv2665_resume(struct device *dev) 254 + static int drv2665_resume(struct device *dev) 255 255 { 256 256 struct drv2665_data *haptics = dev_get_drvdata(dev); 257 257 int ret = 0; ··· 280 280 return ret; 281 281 } 282 282 283 - static SIMPLE_DEV_PM_OPS(drv2665_pm_ops, drv2665_suspend, drv2665_resume); 283 + static DEFINE_SIMPLE_DEV_PM_OPS(drv2665_pm_ops, drv2665_suspend, drv2665_resume); 284 284 285 285 static const struct i2c_device_id drv2665_id[] = { 286 286 { "drv2665", 0 }, ··· 301 301 .driver = { 302 302 .name = "drv2665-haptics", 303 303 .of_match_table = of_match_ptr(drv2665_of_match), 304 - .pm = &drv2665_pm_ops, 304 + .pm = pm_sleep_ptr(&drv2665_pm_ops), 305 305 }, 306 306 .id_table = drv2665_id, 307 307 };
+4 -4
drivers/input/misc/drv2667.c
··· 399 399 return 0; 400 400 } 401 401 402 - static int __maybe_unused drv2667_suspend(struct device *dev) 402 + static int drv2667_suspend(struct device *dev) 403 403 { 404 404 struct drv2667_data *haptics = dev_get_drvdata(dev); 405 405 int ret = 0; ··· 428 428 return ret; 429 429 } 430 430 431 - static int __maybe_unused drv2667_resume(struct device *dev) 431 + static int drv2667_resume(struct device *dev) 432 432 { 433 433 struct drv2667_data *haptics = dev_get_drvdata(dev); 434 434 int ret = 0; ··· 457 457 return ret; 458 458 } 459 459 460 - static SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume); 460 + static DEFINE_SIMPLE_DEV_PM_OPS(drv2667_pm_ops, drv2667_suspend, drv2667_resume); 461 461 462 462 static const struct i2c_device_id drv2667_id[] = { 463 463 { "drv2667", 0 }, ··· 478 478 .driver = { 479 479 .name = "drv2667-haptics", 480 480 .of_match_table = of_match_ptr(drv2667_of_match), 481 - .pm = &drv2667_pm_ops, 481 + .pm = pm_sleep_ptr(&drv2667_pm_ops), 482 482 }, 483 483 .id_table = drv2667_id, 484 484 };
+5 -5
drivers/input/misc/e3x0-button.c
··· 35 35 return IRQ_HANDLED; 36 36 } 37 37 38 - static int __maybe_unused e3x0_button_suspend(struct device *dev) 38 + static int e3x0_button_suspend(struct device *dev) 39 39 { 40 40 struct platform_device *pdev = to_platform_device(dev); 41 41 ··· 45 45 return 0; 46 46 } 47 47 48 - static int __maybe_unused e3x0_button_resume(struct device *dev) 48 + static int e3x0_button_resume(struct device *dev) 49 49 { 50 50 struct platform_device *pdev = to_platform_device(dev); 51 51 ··· 55 55 return 0; 56 56 } 57 57 58 - static SIMPLE_DEV_PM_OPS(e3x0_button_pm_ops, 59 - e3x0_button_suspend, e3x0_button_resume); 58 + static DEFINE_SIMPLE_DEV_PM_OPS(e3x0_button_pm_ops, 59 + e3x0_button_suspend, e3x0_button_resume); 60 60 61 61 static int e3x0_button_probe(struct platform_device *pdev) 62 62 { ··· 122 122 .driver = { 123 123 .name = "e3x0-button", 124 124 .of_match_table = of_match_ptr(e3x0_button_match), 125 - .pm = &e3x0_button_pm_ops, 125 + .pm = pm_sleep_ptr(&e3x0_button_pm_ops), 126 126 }, 127 127 .probe = e3x0_button_probe, 128 128 };
+5 -5
drivers/input/misc/gpio-vibra.c
··· 157 157 return 0; 158 158 } 159 159 160 - static int __maybe_unused gpio_vibrator_suspend(struct device *dev) 160 + static int gpio_vibrator_suspend(struct device *dev) 161 161 { 162 162 struct platform_device *pdev = to_platform_device(dev); 163 163 struct gpio_vibrator *vibrator = platform_get_drvdata(pdev); ··· 169 169 return 0; 170 170 } 171 171 172 - static int __maybe_unused gpio_vibrator_resume(struct device *dev) 172 + static int gpio_vibrator_resume(struct device *dev) 173 173 { 174 174 struct platform_device *pdev = to_platform_device(dev); 175 175 struct gpio_vibrator *vibrator = platform_get_drvdata(pdev); ··· 180 180 return 0; 181 181 } 182 182 183 - static SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops, 184 - gpio_vibrator_suspend, gpio_vibrator_resume); 183 + static DEFINE_SIMPLE_DEV_PM_OPS(gpio_vibrator_pm_ops, 184 + gpio_vibrator_suspend, gpio_vibrator_resume); 185 185 186 186 #ifdef CONFIG_OF 187 187 static const struct of_device_id gpio_vibra_dt_match_table[] = { ··· 195 195 .probe = gpio_vibrator_probe, 196 196 .driver = { 197 197 .name = "gpio-vibrator", 198 - .pm = &gpio_vibrator_pm_ops, 198 + .pm = pm_sleep_ptr(&gpio_vibrator_pm_ops), 199 199 .of_match_table = of_match_ptr(gpio_vibra_dt_match_table), 200 200 }, 201 201 };
+132 -203
drivers/input/misc/iqs269a.c
··· 9 9 * axial sliders presented by the device. 10 10 */ 11 11 12 + #include <linux/completion.h> 12 13 #include <linux/delay.h> 13 14 #include <linux/device.h> 14 15 #include <linux/err.h> ··· 97 96 #define IQS269_MISC_B_TRACKING_UI_ENABLE BIT(4) 98 97 #define IQS269_MISC_B_FILT_STR_SLIDER GENMASK(1, 0) 99 98 100 - #define IQS269_CHx_SETTINGS 0x8C 101 - 102 99 #define IQS269_CHx_ENG_A_MEAS_CAP_SIZE BIT(15) 103 100 #define IQS269_CHx_ENG_A_RX_GND_INACTIVE BIT(13) 104 101 #define IQS269_CHx_ENG_A_LOCAL_CAP_SIZE BIT(12) ··· 145 146 #define IQS269_NUM_CH 8 146 147 #define IQS269_NUM_SL 2 147 148 148 - #define IQS269_ATI_POLL_SLEEP_US (iqs269->delay_mult * 10000) 149 - #define IQS269_ATI_POLL_TIMEOUT_US (iqs269->delay_mult * 500000) 150 - #define IQS269_ATI_STABLE_DELAY_MS (iqs269->delay_mult * 150) 151 - 152 - #define IQS269_PWR_MODE_POLL_SLEEP_US IQS269_ATI_POLL_SLEEP_US 153 - #define IQS269_PWR_MODE_POLL_TIMEOUT_US IQS269_ATI_POLL_TIMEOUT_US 154 - 155 - #define iqs269_irq_wait() usleep_range(100, 150) 149 + #define iqs269_irq_wait() usleep_range(200, 250) 156 150 157 151 enum iqs269_local_cap_size { 158 152 IQS269_LOCAL_CAP_SIZE_0, ··· 237 245 u8 padding; 238 246 } __packed; 239 247 248 + struct iqs269_ch_reg { 249 + u8 rx_enable; 250 + u8 tx_enable; 251 + __be16 engine_a; 252 + __be16 engine_b; 253 + __be16 ati_comp; 254 + u8 thresh[3]; 255 + u8 hyst; 256 + u8 assoc_select; 257 + u8 assoc_weight; 258 + } __packed; 259 + 240 260 struct iqs269_sys_reg { 241 261 __be16 general; 242 262 u8 active; ··· 270 266 u8 timeout_swipe; 271 267 u8 thresh_swipe; 272 268 u8 redo_ati; 273 - } __packed; 274 - 275 - struct iqs269_ch_reg { 276 - u8 rx_enable; 277 - u8 tx_enable; 278 - __be16 engine_a; 279 - __be16 engine_b; 280 - __be16 ati_comp; 281 - u8 thresh[3]; 282 - u8 hyst; 283 - u8 assoc_select; 284 - u8 assoc_weight; 269 + struct iqs269_ch_reg ch_reg[IQS269_NUM_CH]; 285 270 } __packed; 286 271 287 272 struct iqs269_flags { ··· 285 292 struct regmap *regmap; 286 293 struct mutex lock; 287 294 struct iqs269_switch_desc switches[ARRAY_SIZE(iqs269_events)]; 288 - struct iqs269_ch_reg ch_reg[IQS269_NUM_CH]; 289 295 struct iqs269_sys_reg sys_reg; 296 + struct completion ati_done; 290 297 struct input_dev *keypad; 291 298 struct input_dev *slider[IQS269_NUM_SL]; 292 299 unsigned int keycode[ARRAY_SIZE(iqs269_events) * IQS269_NUM_CH]; 293 - unsigned int suspend_mode; 294 - unsigned int delay_mult; 295 300 unsigned int ch_num; 296 301 bool hall_enable; 297 302 bool ati_current; ··· 298 307 static int iqs269_ati_mode_set(struct iqs269_private *iqs269, 299 308 unsigned int ch_num, unsigned int mode) 300 309 { 310 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 301 311 u16 engine_a; 302 312 303 313 if (ch_num >= IQS269_NUM_CH) ··· 309 317 310 318 mutex_lock(&iqs269->lock); 311 319 312 - engine_a = be16_to_cpu(iqs269->ch_reg[ch_num].engine_a); 320 + engine_a = be16_to_cpu(ch_reg[ch_num].engine_a); 313 321 314 322 engine_a &= ~IQS269_CHx_ENG_A_ATI_MODE_MASK; 315 323 engine_a |= (mode << IQS269_CHx_ENG_A_ATI_MODE_SHIFT); 316 324 317 - iqs269->ch_reg[ch_num].engine_a = cpu_to_be16(engine_a); 325 + ch_reg[ch_num].engine_a = cpu_to_be16(engine_a); 318 326 iqs269->ati_current = false; 319 327 320 328 mutex_unlock(&iqs269->lock); ··· 325 333 static int iqs269_ati_mode_get(struct iqs269_private *iqs269, 326 334 unsigned int ch_num, unsigned int *mode) 327 335 { 336 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 328 337 u16 engine_a; 329 338 330 339 if (ch_num >= IQS269_NUM_CH) 331 340 return -EINVAL; 332 341 333 342 mutex_lock(&iqs269->lock); 334 - engine_a = be16_to_cpu(iqs269->ch_reg[ch_num].engine_a); 343 + engine_a = be16_to_cpu(ch_reg[ch_num].engine_a); 335 344 mutex_unlock(&iqs269->lock); 336 345 337 346 engine_a &= IQS269_CHx_ENG_A_ATI_MODE_MASK; ··· 344 351 static int iqs269_ati_base_set(struct iqs269_private *iqs269, 345 352 unsigned int ch_num, unsigned int base) 346 353 { 354 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 347 355 u16 engine_b; 348 356 349 357 if (ch_num >= IQS269_NUM_CH) ··· 373 379 374 380 mutex_lock(&iqs269->lock); 375 381 376 - engine_b = be16_to_cpu(iqs269->ch_reg[ch_num].engine_b); 382 + engine_b = be16_to_cpu(ch_reg[ch_num].engine_b); 377 383 378 384 engine_b &= ~IQS269_CHx_ENG_B_ATI_BASE_MASK; 379 385 engine_b |= base; 380 386 381 - iqs269->ch_reg[ch_num].engine_b = cpu_to_be16(engine_b); 387 + ch_reg[ch_num].engine_b = cpu_to_be16(engine_b); 382 388 iqs269->ati_current = false; 383 389 384 390 mutex_unlock(&iqs269->lock); ··· 389 395 static int iqs269_ati_base_get(struct iqs269_private *iqs269, 390 396 unsigned int ch_num, unsigned int *base) 391 397 { 398 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 392 399 u16 engine_b; 393 400 394 401 if (ch_num >= IQS269_NUM_CH) 395 402 return -EINVAL; 396 403 397 404 mutex_lock(&iqs269->lock); 398 - engine_b = be16_to_cpu(iqs269->ch_reg[ch_num].engine_b); 405 + engine_b = be16_to_cpu(ch_reg[ch_num].engine_b); 399 406 mutex_unlock(&iqs269->lock); 400 407 401 408 switch (engine_b & IQS269_CHx_ENG_B_ATI_BASE_MASK) { ··· 424 429 static int iqs269_ati_target_set(struct iqs269_private *iqs269, 425 430 unsigned int ch_num, unsigned int target) 426 431 { 432 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 427 433 u16 engine_b; 428 434 429 435 if (ch_num >= IQS269_NUM_CH) ··· 435 439 436 440 mutex_lock(&iqs269->lock); 437 441 438 - engine_b = be16_to_cpu(iqs269->ch_reg[ch_num].engine_b); 442 + engine_b = be16_to_cpu(ch_reg[ch_num].engine_b); 439 443 440 444 engine_b &= ~IQS269_CHx_ENG_B_ATI_TARGET_MASK; 441 445 engine_b |= target / 32; 442 446 443 - iqs269->ch_reg[ch_num].engine_b = cpu_to_be16(engine_b); 447 + ch_reg[ch_num].engine_b = cpu_to_be16(engine_b); 444 448 iqs269->ati_current = false; 445 449 446 450 mutex_unlock(&iqs269->lock); ··· 451 455 static int iqs269_ati_target_get(struct iqs269_private *iqs269, 452 456 unsigned int ch_num, unsigned int *target) 453 457 { 458 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 454 459 u16 engine_b; 455 460 456 461 if (ch_num >= IQS269_NUM_CH) 457 462 return -EINVAL; 458 463 459 464 mutex_lock(&iqs269->lock); 460 - engine_b = be16_to_cpu(iqs269->ch_reg[ch_num].engine_b); 465 + engine_b = be16_to_cpu(ch_reg[ch_num].engine_b); 461 466 mutex_unlock(&iqs269->lock); 462 467 463 468 *target = (engine_b & IQS269_CHx_ENG_B_ATI_TARGET_MASK) * 32; ··· 528 531 if (fwnode_property_present(ch_node, "azoteq,slider1-select")) 529 532 iqs269->sys_reg.slider_select[1] |= BIT(reg); 530 533 531 - ch_reg = &iqs269->ch_reg[reg]; 532 - 533 - error = regmap_raw_read(iqs269->regmap, 534 - IQS269_CHx_SETTINGS + reg * sizeof(*ch_reg) / 2, 535 - ch_reg, sizeof(*ch_reg)); 536 - if (error) 537 - return error; 534 + ch_reg = &iqs269->sys_reg.ch_reg[reg]; 538 535 539 536 error = iqs269_parse_mask(ch_node, "azoteq,rx-enable", 540 537 &ch_reg->rx_enable); ··· 685 694 dev_err(&client->dev, 686 695 "Invalid channel %u threshold: %u\n", 687 696 reg, val); 697 + fwnode_handle_put(ev_node); 688 698 return -EINVAL; 689 699 } 690 700 ··· 699 707 dev_err(&client->dev, 700 708 "Invalid channel %u hysteresis: %u\n", 701 709 reg, val); 710 + fwnode_handle_put(ev_node); 702 711 return -EINVAL; 703 712 } 704 713 ··· 714 721 } 715 722 } 716 723 717 - if (fwnode_property_read_u32(ev_node, "linux,code", &val)) 724 + error = fwnode_property_read_u32(ev_node, "linux,code", &val); 725 + fwnode_handle_put(ev_node); 726 + if (error == -EINVAL) { 718 727 continue; 728 + } else if (error) { 729 + dev_err(&client->dev, 730 + "Failed to read channel %u code: %d\n", reg, 731 + error); 732 + return error; 733 + } 719 734 720 735 switch (reg) { 721 736 case IQS269_CHx_HALL_ACTIVE: ··· 759 758 760 759 iqs269->hall_enable = device_property_present(&client->dev, 761 760 "azoteq,hall-enable"); 762 - 763 - if (!device_property_read_u32(&client->dev, "azoteq,suspend-mode", 764 - &val)) { 765 - if (val > IQS269_SYS_SETTINGS_PWR_MODE_MAX) { 766 - dev_err(&client->dev, "Invalid suspend mode: %u\n", 767 - val); 768 - return -EINVAL; 769 - } 770 - 771 - iqs269->suspend_mode = val; 772 - } 773 761 774 762 error = regmap_raw_read(iqs269->regmap, IQS269_SYS_SETTINGS, sys_reg, 775 763 sizeof(*sys_reg)); ··· 970 980 971 981 general = be16_to_cpu(sys_reg->general); 972 982 973 - if (device_property_present(&client->dev, "azoteq,clk-div")) { 983 + if (device_property_present(&client->dev, "azoteq,clk-div")) 974 984 general |= IQS269_SYS_SETTINGS_CLK_DIV; 975 - iqs269->delay_mult = 4; 976 - } else { 977 - general &= ~IQS269_SYS_SETTINGS_CLK_DIV; 978 - iqs269->delay_mult = 1; 979 - } 980 985 981 986 /* 982 987 * Configure the device to automatically switch between normal and low- ··· 981 996 general &= ~IQS269_SYS_SETTINGS_ULP_AUTO; 982 997 general &= ~IQS269_SYS_SETTINGS_DIS_AUTO; 983 998 general &= ~IQS269_SYS_SETTINGS_PWR_MODE_MASK; 999 + 1000 + if (!device_property_read_u32(&client->dev, "azoteq,suspend-mode", 1001 + &val)) { 1002 + if (val > IQS269_SYS_SETTINGS_PWR_MODE_MAX) { 1003 + dev_err(&client->dev, "Invalid suspend mode: %u\n", 1004 + val); 1005 + return -EINVAL; 1006 + } 1007 + 1008 + general |= (val << IQS269_SYS_SETTINGS_PWR_MODE_SHIFT); 1009 + } 984 1010 985 1011 if (!device_property_read_u32(&client->dev, "azoteq,ulp-update", 986 1012 &val)) { ··· 1028 1032 1029 1033 static int iqs269_dev_init(struct iqs269_private *iqs269) 1030 1034 { 1031 - struct iqs269_sys_reg *sys_reg = &iqs269->sys_reg; 1032 - struct iqs269_ch_reg *ch_reg; 1033 - unsigned int val; 1034 - int error, i; 1035 + int error; 1035 1036 1036 1037 mutex_lock(&iqs269->lock); 1037 1038 ··· 1038 1045 if (error) 1039 1046 goto err_mutex; 1040 1047 1041 - for (i = 0; i < IQS269_NUM_CH; i++) { 1042 - if (!(sys_reg->active & BIT(i))) 1043 - continue; 1044 - 1045 - ch_reg = &iqs269->ch_reg[i]; 1046 - 1047 - error = regmap_raw_write(iqs269->regmap, 1048 - IQS269_CHx_SETTINGS + i * 1049 - sizeof(*ch_reg) / 2, ch_reg, 1050 - sizeof(*ch_reg)); 1051 - if (error) 1052 - goto err_mutex; 1053 - } 1048 + error = regmap_raw_write(iqs269->regmap, IQS269_SYS_SETTINGS, 1049 + &iqs269->sys_reg, sizeof(iqs269->sys_reg)); 1050 + if (error) 1051 + goto err_mutex; 1054 1052 1055 1053 /* 1056 - * The REDO-ATI and ATI channel selection fields must be written in the 1057 - * same block write, so every field between registers 0x80 through 0x8B 1058 - * (inclusive) must be written as well. 1054 + * The following delay gives the device time to deassert its RDY output 1055 + * so as to prevent an interrupt from being serviced prematurely. 1059 1056 */ 1060 - error = regmap_raw_write(iqs269->regmap, IQS269_SYS_SETTINGS, sys_reg, 1061 - sizeof(*sys_reg)); 1062 - if (error) 1063 - goto err_mutex; 1057 + usleep_range(2000, 2100); 1064 1058 1065 - error = regmap_read_poll_timeout(iqs269->regmap, IQS269_SYS_FLAGS, val, 1066 - !(val & IQS269_SYS_FLAGS_IN_ATI), 1067 - IQS269_ATI_POLL_SLEEP_US, 1068 - IQS269_ATI_POLL_TIMEOUT_US); 1069 - if (error) 1070 - goto err_mutex; 1071 - 1072 - msleep(IQS269_ATI_STABLE_DELAY_MS); 1073 1059 iqs269->ati_current = true; 1074 1060 1075 1061 err_mutex: ··· 1060 1088 static int iqs269_input_init(struct iqs269_private *iqs269) 1061 1089 { 1062 1090 struct i2c_client *client = iqs269->client; 1063 - struct iqs269_flags flags; 1064 1091 unsigned int sw_code, keycode; 1065 1092 int error, i, j; 1066 - u8 dir_mask, state; 1067 1093 1068 1094 iqs269->keypad = devm_input_allocate_device(&client->dev); 1069 1095 if (!iqs269->keypad) ··· 1074 1104 iqs269->keypad->name = "iqs269a_keypad"; 1075 1105 iqs269->keypad->id.bustype = BUS_I2C; 1076 1106 1077 - if (iqs269->hall_enable) { 1078 - error = regmap_raw_read(iqs269->regmap, IQS269_SYS_FLAGS, 1079 - &flags, sizeof(flags)); 1080 - if (error) { 1081 - dev_err(&client->dev, 1082 - "Failed to read initial status: %d\n", error); 1083 - return error; 1084 - } 1085 - } 1086 - 1087 1107 for (i = 0; i < ARRAY_SIZE(iqs269_events); i++) { 1088 - dir_mask = flags.states[IQS269_ST_OFFS_DIR]; 1089 - if (!iqs269_events[i].dir_up) 1090 - dir_mask = ~dir_mask; 1091 - 1092 - state = flags.states[iqs269_events[i].st_offs] & dir_mask; 1093 - 1094 1108 sw_code = iqs269->switches[i].code; 1095 1109 1096 1110 for (j = 0; j < IQS269_NUM_CH; j++) { ··· 1087 1133 switch (j) { 1088 1134 case IQS269_CHx_HALL_ACTIVE: 1089 1135 if (iqs269->hall_enable && 1090 - iqs269->switches[i].enabled) { 1136 + iqs269->switches[i].enabled) 1091 1137 input_set_capability(iqs269->keypad, 1092 1138 EV_SW, sw_code); 1093 - input_report_switch(iqs269->keypad, 1094 - sw_code, 1095 - state & BIT(j)); 1096 - } 1097 1139 fallthrough; 1098 1140 1099 1141 case IQS269_CHx_HALL_INACTIVE: ··· 1103 1153 EV_KEY, keycode); 1104 1154 } 1105 1155 } 1106 - } 1107 - 1108 - input_sync(iqs269->keypad); 1109 - 1110 - error = input_register_device(iqs269->keypad); 1111 - if (error) { 1112 - dev_err(&client->dev, "Failed to register keypad: %d\n", error); 1113 - return error; 1114 1156 } 1115 1157 1116 1158 for (i = 0; i < IQS269_NUM_SL; i++) { ··· 1163 1221 1164 1222 return error; 1165 1223 } 1224 + 1225 + if (be16_to_cpu(flags.system) & IQS269_SYS_FLAGS_IN_ATI) 1226 + return 0; 1166 1227 1167 1228 error = regmap_raw_read(iqs269->regmap, IQS269_SLIDER_X, slider_x, 1168 1229 sizeof(slider_x)); ··· 1229 1284 1230 1285 input_sync(iqs269->keypad); 1231 1286 1287 + /* 1288 + * The following completion signals that ATI has finished, any initial 1289 + * switch states have been reported and the keypad can be registered. 1290 + */ 1291 + complete_all(&iqs269->ati_done); 1292 + 1232 1293 return 0; 1233 1294 } 1234 1295 ··· 1266 1315 if (!iqs269->ati_current || iqs269->hall_enable) 1267 1316 return -EPERM; 1268 1317 1318 + if (!completion_done(&iqs269->ati_done)) 1319 + return -EBUSY; 1320 + 1269 1321 /* 1270 1322 * Unsolicited I2C communication prompts the device to assert its RDY 1271 1323 * pin, so disable the interrupt line until the operation is finished ··· 1293 1339 struct device_attribute *attr, char *buf) 1294 1340 { 1295 1341 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1342 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 1296 1343 struct i2c_client *client = iqs269->client; 1297 1344 unsigned int val; 1298 1345 int error; ··· 1308 1353 if (error) 1309 1354 return error; 1310 1355 1311 - switch (iqs269->ch_reg[IQS269_CHx_HALL_ACTIVE].rx_enable & 1312 - iqs269->ch_reg[IQS269_CHx_HALL_INACTIVE].rx_enable) { 1356 + switch (ch_reg[IQS269_CHx_HALL_ACTIVE].rx_enable & 1357 + ch_reg[IQS269_CHx_HALL_INACTIVE].rx_enable) { 1313 1358 case IQS269_HALL_PAD_R: 1314 1359 val &= IQS269_CAL_DATA_A_HALL_BIN_R_MASK; 1315 1360 val >>= IQS269_CAL_DATA_A_HALL_BIN_R_SHIFT; ··· 1389 1434 struct device_attribute *attr, char *buf) 1390 1435 { 1391 1436 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1437 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 1392 1438 1393 1439 return scnprintf(buf, PAGE_SIZE, "%u\n", 1394 - iqs269->ch_reg[iqs269->ch_num].rx_enable); 1440 + ch_reg[iqs269->ch_num].rx_enable); 1395 1441 } 1396 1442 1397 1443 static ssize_t rx_enable_store(struct device *dev, ··· 1400 1444 size_t count) 1401 1445 { 1402 1446 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1447 + struct iqs269_ch_reg *ch_reg = iqs269->sys_reg.ch_reg; 1403 1448 unsigned int val; 1404 1449 int error; 1405 1450 ··· 1413 1456 1414 1457 mutex_lock(&iqs269->lock); 1415 1458 1416 - iqs269->ch_reg[iqs269->ch_num].rx_enable = val; 1459 + ch_reg[iqs269->ch_num].rx_enable = val; 1417 1460 iqs269->ati_current = false; 1418 1461 1419 1462 mutex_unlock(&iqs269->lock); ··· 1525 1568 { 1526 1569 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1527 1570 1528 - return scnprintf(buf, PAGE_SIZE, "%u\n", iqs269->ati_current); 1571 + return scnprintf(buf, PAGE_SIZE, "%u\n", 1572 + iqs269->ati_current && 1573 + completion_done(&iqs269->ati_done)); 1529 1574 } 1530 1575 1531 1576 static ssize_t ati_trigger_store(struct device *dev, ··· 1547 1588 return count; 1548 1589 1549 1590 disable_irq(client->irq); 1591 + reinit_completion(&iqs269->ati_done); 1550 1592 1551 1593 error = iqs269_dev_init(iqs269); 1552 1594 ··· 1556 1596 1557 1597 if (error) 1558 1598 return error; 1599 + 1600 + if (!wait_for_completion_timeout(&iqs269->ati_done, 1601 + msecs_to_jiffies(2000))) 1602 + return -ETIMEDOUT; 1559 1603 1560 1604 return count; 1561 1605 } ··· 1619 1655 } 1620 1656 1621 1657 mutex_init(&iqs269->lock); 1658 + init_completion(&iqs269->ati_done); 1622 1659 1623 1660 error = regmap_raw_read(iqs269->regmap, IQS269_VER_INFO, &ver_info, 1624 1661 sizeof(ver_info)); ··· 1655 1690 return error; 1656 1691 } 1657 1692 1693 + if (!wait_for_completion_timeout(&iqs269->ati_done, 1694 + msecs_to_jiffies(2000))) { 1695 + dev_err(&client->dev, "Failed to complete ATI\n"); 1696 + return -ETIMEDOUT; 1697 + } 1698 + 1699 + /* 1700 + * The keypad may include one or more switches and is not registered 1701 + * until ATI is complete and the initial switch states are read. 1702 + */ 1703 + error = input_register_device(iqs269->keypad); 1704 + if (error) { 1705 + dev_err(&client->dev, "Failed to register keypad: %d\n", error); 1706 + return error; 1707 + } 1708 + 1658 1709 error = devm_device_add_group(&client->dev, &iqs269_attr_group); 1659 1710 if (error) 1660 1711 dev_err(&client->dev, "Failed to add attributes: %d\n", error); ··· 1678 1697 return error; 1679 1698 } 1680 1699 1681 - static int __maybe_unused iqs269_suspend(struct device *dev) 1700 + static u16 iqs269_general_get(struct iqs269_private *iqs269) 1701 + { 1702 + u16 general = be16_to_cpu(iqs269->sys_reg.general); 1703 + 1704 + general &= ~IQS269_SYS_SETTINGS_REDO_ATI; 1705 + general &= ~IQS269_SYS_SETTINGS_ACK_RESET; 1706 + 1707 + return general | IQS269_SYS_SETTINGS_DIS_AUTO; 1708 + } 1709 + 1710 + static int iqs269_suspend(struct device *dev) 1682 1711 { 1683 1712 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1684 1713 struct i2c_client *client = iqs269->client; 1685 - unsigned int val; 1686 1714 int error; 1715 + u16 general = iqs269_general_get(iqs269); 1687 1716 1688 - if (!iqs269->suspend_mode) 1717 + if (!(general & IQS269_SYS_SETTINGS_PWR_MODE_MASK)) 1689 1718 return 0; 1690 1719 1691 1720 disable_irq(client->irq); 1692 1721 1693 - /* 1694 - * Automatic power mode switching must be disabled before the device is 1695 - * forced into any particular power mode. In this case, the device will 1696 - * transition into normal-power mode. 1697 - */ 1698 - error = regmap_update_bits(iqs269->regmap, IQS269_SYS_SETTINGS, 1699 - IQS269_SYS_SETTINGS_DIS_AUTO, ~0); 1700 - if (error) 1701 - goto err_irq; 1722 + error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, general); 1702 1723 1703 - /* 1704 - * The following check ensures the device has completed its transition 1705 - * into normal-power mode before a manual mode switch is performed. 1706 - */ 1707 - error = regmap_read_poll_timeout(iqs269->regmap, IQS269_SYS_FLAGS, val, 1708 - !(val & IQS269_SYS_FLAGS_PWR_MODE_MASK), 1709 - IQS269_PWR_MODE_POLL_SLEEP_US, 1710 - IQS269_PWR_MODE_POLL_TIMEOUT_US); 1711 - if (error) 1712 - goto err_irq; 1713 - 1714 - error = regmap_update_bits(iqs269->regmap, IQS269_SYS_SETTINGS, 1715 - IQS269_SYS_SETTINGS_PWR_MODE_MASK, 1716 - iqs269->suspend_mode << 1717 - IQS269_SYS_SETTINGS_PWR_MODE_SHIFT); 1718 - if (error) 1719 - goto err_irq; 1720 - 1721 - /* 1722 - * This last check ensures the device has completed its transition into 1723 - * the desired power mode to prevent any spurious interrupts from being 1724 - * triggered after iqs269_suspend has already returned. 1725 - */ 1726 - error = regmap_read_poll_timeout(iqs269->regmap, IQS269_SYS_FLAGS, val, 1727 - (val & IQS269_SYS_FLAGS_PWR_MODE_MASK) 1728 - == (iqs269->suspend_mode << 1729 - IQS269_SYS_FLAGS_PWR_MODE_SHIFT), 1730 - IQS269_PWR_MODE_POLL_SLEEP_US, 1731 - IQS269_PWR_MODE_POLL_TIMEOUT_US); 1732 - 1733 - err_irq: 1734 1724 iqs269_irq_wait(); 1735 1725 enable_irq(client->irq); 1736 1726 1737 1727 return error; 1738 1728 } 1739 1729 1740 - static int __maybe_unused iqs269_resume(struct device *dev) 1730 + static int iqs269_resume(struct device *dev) 1741 1731 { 1742 1732 struct iqs269_private *iqs269 = dev_get_drvdata(dev); 1743 1733 struct i2c_client *client = iqs269->client; 1744 - unsigned int val; 1745 1734 int error; 1735 + u16 general = iqs269_general_get(iqs269); 1746 1736 1747 - if (!iqs269->suspend_mode) 1737 + if (!(general & IQS269_SYS_SETTINGS_PWR_MODE_MASK)) 1748 1738 return 0; 1749 1739 1750 1740 disable_irq(client->irq); 1751 1741 1752 - error = regmap_update_bits(iqs269->regmap, IQS269_SYS_SETTINGS, 1753 - IQS269_SYS_SETTINGS_PWR_MODE_MASK, 0); 1754 - if (error) 1755 - goto err_irq; 1742 + error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, 1743 + general & ~IQS269_SYS_SETTINGS_PWR_MODE_MASK); 1744 + if (!error) 1745 + error = regmap_write(iqs269->regmap, IQS269_SYS_SETTINGS, 1746 + general & ~IQS269_SYS_SETTINGS_DIS_AUTO); 1756 1747 1757 - /* 1758 - * This check ensures the device has returned to normal-power mode 1759 - * before automatic power mode switching is re-enabled. 1760 - */ 1761 - error = regmap_read_poll_timeout(iqs269->regmap, IQS269_SYS_FLAGS, val, 1762 - !(val & IQS269_SYS_FLAGS_PWR_MODE_MASK), 1763 - IQS269_PWR_MODE_POLL_SLEEP_US, 1764 - IQS269_PWR_MODE_POLL_TIMEOUT_US); 1765 - if (error) 1766 - goto err_irq; 1767 - 1768 - error = regmap_update_bits(iqs269->regmap, IQS269_SYS_SETTINGS, 1769 - IQS269_SYS_SETTINGS_DIS_AUTO, 0); 1770 - if (error) 1771 - goto err_irq; 1772 - 1773 - /* 1774 - * This step reports any events that may have been "swallowed" as a 1775 - * result of polling PWR_MODE (which automatically acknowledges any 1776 - * pending interrupts). 1777 - */ 1778 - error = iqs269_report(iqs269); 1779 - 1780 - err_irq: 1781 1748 iqs269_irq_wait(); 1782 1749 enable_irq(client->irq); 1783 1750 1784 1751 return error; 1785 1752 } 1786 1753 1787 - static SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume); 1754 + static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume); 1788 1755 1789 1756 static const struct of_device_id iqs269_of_match[] = { 1790 1757 { .compatible = "azoteq,iqs269a" }, ··· 1744 1815 .driver = { 1745 1816 .name = "iqs269a", 1746 1817 .of_match_table = iqs269_of_match, 1747 - .pm = &iqs269_pm, 1818 + .pm = pm_sleep_ptr(&iqs269_pm), 1748 1819 }, 1749 1820 .probe_new = iqs269_probe, 1750 1821 };
+77 -87
drivers/input/misc/iqs626a.c
··· 458 458 459 459 static noinline_for_stack int 460 460 iqs626_parse_events(struct iqs626_private *iqs626, 461 - const struct fwnode_handle *ch_node, 462 - enum iqs626_ch_id ch_id) 461 + struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id) 463 462 { 464 463 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; 465 464 struct i2c_client *client = iqs626->client; 466 - const struct fwnode_handle *ev_node; 465 + struct fwnode_handle *ev_node; 467 466 const char *ev_name; 468 467 u8 *thresh, *hyst; 469 - unsigned int thresh_tp[IQS626_NUM_CH_TP_3]; 470 468 unsigned int val; 471 - int num_ch = iqs626_channels[ch_id].num_ch; 472 - int error, i, j; 469 + int i; 473 470 474 471 switch (ch_id) { 475 472 case IQS626_CH_ULP_0: ··· 506 509 * Trackpad touch events are simply described under the 507 510 * trackpad child node. 508 511 */ 509 - ev_node = ch_node; 512 + ev_node = fwnode_handle_get(ch_node); 510 513 } else { 511 514 ev_name = iqs626_events[i].name; 512 515 ev_node = fwnode_get_named_child_node(ch_node, ev_name); ··· 530 533 dev_err(&client->dev, 531 534 "Invalid input type: %u\n", 532 535 val); 536 + fwnode_handle_put(ev_node); 533 537 return -EINVAL; 534 538 } 535 539 ··· 545 547 dev_err(&client->dev, 546 548 "Invalid %s channel hysteresis: %u\n", 547 549 fwnode_get_name(ch_node), val); 550 + fwnode_handle_put(ev_node); 548 551 return -EINVAL; 549 552 } 550 553 ··· 566 567 dev_err(&client->dev, 567 568 "Invalid %s channel threshold: %u\n", 568 569 fwnode_get_name(ch_node), val); 570 + fwnode_handle_put(ev_node); 569 571 return -EINVAL; 570 572 } 571 573 ··· 574 574 *thresh = val; 575 575 else 576 576 *(thresh + iqs626_events[i].th_offs) = val; 577 - 578 - continue; 579 577 } 580 578 581 - if (!fwnode_property_present(ev_node, "azoteq,thresh")) 582 - continue; 583 - 584 - error = fwnode_property_read_u32_array(ev_node, "azoteq,thresh", 585 - thresh_tp, num_ch); 586 - if (error) { 587 - dev_err(&client->dev, 588 - "Failed to read %s channel thresholds: %d\n", 589 - fwnode_get_name(ch_node), error); 590 - return error; 591 - } 592 - 593 - for (j = 0; j < num_ch; j++) { 594 - if (thresh_tp[j] > IQS626_CHx_THRESH_MAX) { 595 - dev_err(&client->dev, 596 - "Invalid %s channel threshold: %u\n", 597 - fwnode_get_name(ch_node), thresh_tp[j]); 598 - return -EINVAL; 599 - } 600 - 601 - sys_reg->tp_grp_reg.ch_reg_tp[j].thresh = thresh_tp[j]; 602 - } 579 + fwnode_handle_put(ev_node); 603 580 } 604 581 605 582 return 0; ··· 584 607 585 608 static noinline_for_stack int 586 609 iqs626_parse_ati_target(struct iqs626_private *iqs626, 587 - const struct fwnode_handle *ch_node, 588 - enum iqs626_ch_id ch_id) 610 + struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id) 589 611 { 590 612 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; 591 613 struct i2c_client *client = iqs626->client; 592 - unsigned int ati_base[IQS626_NUM_CH_TP_3]; 593 614 unsigned int val; 594 615 u8 *ati_target; 595 - int num_ch = iqs626_channels[ch_id].num_ch; 596 - int error, i; 616 + int i; 597 617 598 618 switch (ch_id) { 599 619 case IQS626_CH_ULP_0: ··· 657 683 658 684 *ati_target &= ~IQS626_CHx_ATI_BASE_MASK; 659 685 *ati_target |= val; 660 - 661 - return 0; 662 - } 663 - 664 - if (!fwnode_property_present(ch_node, "azoteq,ati-base")) 665 - return 0; 666 - 667 - error = fwnode_property_read_u32_array(ch_node, "azoteq,ati-base", 668 - ati_base, num_ch); 669 - if (error) { 670 - dev_err(&client->dev, 671 - "Failed to read %s channel ATI bases: %d\n", 672 - fwnode_get_name(ch_node), error); 673 - return error; 674 - } 675 - 676 - for (i = 0; i < num_ch; i++) { 677 - if (ati_base[i] < IQS626_TPx_ATI_BASE_MIN || 678 - ati_base[i] > IQS626_TPx_ATI_BASE_MAX) { 679 - dev_err(&client->dev, 680 - "Invalid %s channel ATI base: %u\n", 681 - fwnode_get_name(ch_node), ati_base[i]); 682 - return -EINVAL; 683 - } 684 - 685 - ati_base[i] -= IQS626_TPx_ATI_BASE_MIN; 686 - sys_reg->tp_grp_reg.ch_reg_tp[i].ati_base = ati_base[i]; 687 686 } 688 687 689 688 return 0; 690 689 } 691 690 692 691 static int iqs626_parse_pins(struct iqs626_private *iqs626, 693 - const struct fwnode_handle *ch_node, 692 + struct fwnode_handle *ch_node, 694 693 const char *propname, u8 *enable) 695 694 { 696 695 struct i2c_client *client = iqs626->client; ··· 711 764 } 712 765 713 766 static int iqs626_parse_trackpad(struct iqs626_private *iqs626, 714 - const struct fwnode_handle *ch_node) 767 + struct fwnode_handle *ch_node, 768 + enum iqs626_ch_id ch_id) 715 769 { 716 770 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; 717 771 struct i2c_client *client = iqs626->client; 718 772 u8 *hyst = &sys_reg->tp_grp_reg.hyst; 773 + int error, count, i; 719 774 unsigned int val; 720 - int error, count; 721 775 722 776 if (!fwnode_property_read_u32(ch_node, "azoteq,lta-update", &val)) { 723 777 if (val > IQS626_MISC_A_TPx_LTA_UPDATE_MAX) { ··· 769 821 770 822 *hyst &= ~IQS626_FILT_STR_LP_TPx_MASK; 771 823 *hyst |= (val << IQS626_FILT_STR_LP_TPx_SHIFT); 824 + } 825 + 826 + for (i = 0; i < iqs626_channels[ch_id].num_ch; i++) { 827 + u8 *ati_base = &sys_reg->tp_grp_reg.ch_reg_tp[i].ati_base; 828 + u8 *thresh = &sys_reg->tp_grp_reg.ch_reg_tp[i].thresh; 829 + struct fwnode_handle *tc_node; 830 + char tc_name[10]; 831 + 832 + snprintf(tc_name, sizeof(tc_name), "channel-%d", i); 833 + 834 + tc_node = fwnode_get_named_child_node(ch_node, tc_name); 835 + if (!tc_node) 836 + continue; 837 + 838 + if (!fwnode_property_read_u32(tc_node, "azoteq,ati-base", 839 + &val)) { 840 + if (val < IQS626_TPx_ATI_BASE_MIN || 841 + val > IQS626_TPx_ATI_BASE_MAX) { 842 + dev_err(&client->dev, 843 + "Invalid %s %s ATI base: %u\n", 844 + fwnode_get_name(ch_node), tc_name, val); 845 + fwnode_handle_put(tc_node); 846 + return -EINVAL; 847 + } 848 + 849 + *ati_base = val - IQS626_TPx_ATI_BASE_MIN; 850 + } 851 + 852 + if (!fwnode_property_read_u32(tc_node, "azoteq,thresh", 853 + &val)) { 854 + if (val > IQS626_CHx_THRESH_MAX) { 855 + dev_err(&client->dev, 856 + "Invalid %s %s threshold: %u\n", 857 + fwnode_get_name(ch_node), tc_name, val); 858 + fwnode_handle_put(tc_node); 859 + return -EINVAL; 860 + } 861 + 862 + *thresh = val; 863 + } 864 + 865 + fwnode_handle_put(tc_node); 772 866 } 773 867 774 868 if (!fwnode_property_present(ch_node, "linux,keycodes")) ··· 879 889 880 890 static noinline_for_stack int 881 891 iqs626_parse_channel(struct iqs626_private *iqs626, 882 - const struct fwnode_handle *ch_node, 883 - enum iqs626_ch_id ch_id) 892 + struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id) 884 893 { 885 894 struct iqs626_sys_reg *sys_reg = &iqs626->sys_reg; 886 895 struct i2c_client *client = iqs626->client; ··· 912 923 default: 913 924 return -EINVAL; 914 925 } 926 + 927 + error = iqs626_parse_ati_target(iqs626, ch_node, ch_id); 928 + if (error) 929 + return error; 930 + 931 + error = iqs626_parse_events(iqs626, ch_node, ch_id); 932 + if (error) 933 + return error; 934 + 935 + if (!fwnode_property_present(ch_node, "azoteq,ati-exclude")) 936 + sys_reg->redo_ati |= iqs626_channels[ch_id].active; 937 + 938 + if (!fwnode_property_present(ch_node, "azoteq,reseed-disable")) 939 + sys_reg->reseed |= iqs626_channels[ch_id].active; 915 940 916 941 *engine |= IQS626_CHx_ENG_0_MEAS_CAP_SIZE; 917 942 if (fwnode_property_present(ch_node, "azoteq,meas-cap-decrease")) ··· 1060 1057 *(engine + 1) |= IQS626_CHx_ENG_1_ATI_BAND_TIGHTEN; 1061 1058 1062 1059 if (ch_id == IQS626_CH_TP_2 || ch_id == IQS626_CH_TP_3) 1063 - return iqs626_parse_trackpad(iqs626, ch_node); 1060 + return iqs626_parse_trackpad(iqs626, ch_node, ch_id); 1064 1061 1065 1062 if (ch_id == IQS626_CH_ULP_0) { 1066 1063 sys_reg->ch_reg_ulp.hyst &= ~IQS626_ULP_PROJ_ENABLE; ··· 1381 1378 continue; 1382 1379 1383 1380 error = iqs626_parse_channel(iqs626, ch_node, i); 1381 + fwnode_handle_put(ch_node); 1384 1382 if (error) 1385 1383 return error; 1386 - 1387 - error = iqs626_parse_ati_target(iqs626, ch_node, i); 1388 - if (error) 1389 - return error; 1390 - 1391 - error = iqs626_parse_events(iqs626, ch_node, i); 1392 - if (error) 1393 - return error; 1394 - 1395 - if (!fwnode_property_present(ch_node, "azoteq,ati-exclude")) 1396 - sys_reg->redo_ati |= iqs626_channels[i].active; 1397 - 1398 - if (!fwnode_property_present(ch_node, "azoteq,reseed-disable")) 1399 - sys_reg->reseed |= iqs626_channels[i].active; 1400 1384 1401 1385 sys_reg->active |= iqs626_channels[i].active; 1402 1386 } ··· 1702 1712 return error; 1703 1713 } 1704 1714 1705 - static int __maybe_unused iqs626_suspend(struct device *dev) 1715 + static int iqs626_suspend(struct device *dev) 1706 1716 { 1707 1717 struct iqs626_private *iqs626 = dev_get_drvdata(dev); 1708 1718 struct i2c_client *client = iqs626->client; ··· 1761 1771 return error; 1762 1772 } 1763 1773 1764 - static int __maybe_unused iqs626_resume(struct device *dev) 1774 + static int iqs626_resume(struct device *dev) 1765 1775 { 1766 1776 struct iqs626_private *iqs626 = dev_get_drvdata(dev); 1767 1777 struct i2c_client *client = iqs626->client; ··· 1808 1818 return error; 1809 1819 } 1810 1820 1811 - static SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume); 1821 + static DEFINE_SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume); 1812 1822 1813 1823 static const struct of_device_id iqs626_of_match[] = { 1814 1824 { .compatible = "azoteq,iqs626a" }, ··· 1820 1830 .driver = { 1821 1831 .name = "iqs626a", 1822 1832 .of_match_table = iqs626_of_match, 1823 - .pm = &iqs626_pm, 1833 + .pm = pm_sleep_ptr(&iqs626_pm), 1824 1834 }, 1825 1835 .probe_new = iqs626_probe, 1826 1836 };
+4 -4
drivers/input/misc/kxtj9.c
··· 494 494 return 0; 495 495 } 496 496 497 - static int __maybe_unused kxtj9_suspend(struct device *dev) 497 + static int kxtj9_suspend(struct device *dev) 498 498 { 499 499 struct i2c_client *client = to_i2c_client(dev); 500 500 struct kxtj9_data *tj9 = i2c_get_clientdata(client); ··· 509 509 return 0; 510 510 } 511 511 512 - static int __maybe_unused kxtj9_resume(struct device *dev) 512 + static int kxtj9_resume(struct device *dev) 513 513 { 514 514 struct i2c_client *client = to_i2c_client(dev); 515 515 struct kxtj9_data *tj9 = i2c_get_clientdata(client); ··· 524 524 return 0; 525 525 } 526 526 527 - static SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume); 527 + static DEFINE_SIMPLE_DEV_PM_OPS(kxtj9_pm_ops, kxtj9_suspend, kxtj9_resume); 528 528 529 529 static const struct i2c_device_id kxtj9_id[] = { 530 530 { NAME, 0 }, ··· 536 536 static struct i2c_driver kxtj9_driver = { 537 537 .driver = { 538 538 .name = NAME, 539 - .pm = &kxtj9_pm_ops, 539 + .pm = pm_sleep_ptr(&kxtj9_pm_ops), 540 540 }, 541 541 .probe_new = kxtj9_probe, 542 542 .id_table = kxtj9_id,
+6 -5
drivers/input/misc/max77693-haptic.c
··· 375 375 return 0; 376 376 } 377 377 378 - static int __maybe_unused max77693_haptic_suspend(struct device *dev) 378 + static int max77693_haptic_suspend(struct device *dev) 379 379 { 380 380 struct platform_device *pdev = to_platform_device(dev); 381 381 struct max77693_haptic *haptic = platform_get_drvdata(pdev); ··· 388 388 return 0; 389 389 } 390 390 391 - static int __maybe_unused max77693_haptic_resume(struct device *dev) 391 + static int max77693_haptic_resume(struct device *dev) 392 392 { 393 393 struct platform_device *pdev = to_platform_device(dev); 394 394 struct max77693_haptic *haptic = platform_get_drvdata(pdev); ··· 401 401 return 0; 402 402 } 403 403 404 - static SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, 405 - max77693_haptic_suspend, max77693_haptic_resume); 404 + static DEFINE_SIMPLE_DEV_PM_OPS(max77693_haptic_pm_ops, 405 + max77693_haptic_suspend, 406 + max77693_haptic_resume); 406 407 407 408 static const struct platform_device_id max77693_haptic_id[] = { 408 409 { "max77693-haptic", TYPE_MAX77693 }, ··· 415 414 static struct platform_driver max77693_haptic_driver = { 416 415 .driver = { 417 416 .name = "max77693-haptic", 418 - .pm = &max77693_haptic_pm_ops, 417 + .pm = pm_sleep_ptr(&max77693_haptic_pm_ops), 419 418 }, 420 419 .probe = max77693_haptic_probe, 421 420 .id_table = max77693_haptic_id,
+5 -4
drivers/input/misc/max8925_onkey.c
··· 129 129 return 0; 130 130 } 131 131 132 - static int __maybe_unused max8925_onkey_suspend(struct device *dev) 132 + static int max8925_onkey_suspend(struct device *dev) 133 133 { 134 134 struct platform_device *pdev = to_platform_device(dev); 135 135 struct max8925_onkey_info *info = platform_get_drvdata(pdev); ··· 143 143 return 0; 144 144 } 145 145 146 - static int __maybe_unused max8925_onkey_resume(struct device *dev) 146 + static int max8925_onkey_resume(struct device *dev) 147 147 { 148 148 struct platform_device *pdev = to_platform_device(dev); 149 149 struct max8925_onkey_info *info = platform_get_drvdata(pdev); ··· 157 157 return 0; 158 158 } 159 159 160 - static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume); 160 + static DEFINE_SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, 161 + max8925_onkey_suspend, max8925_onkey_resume); 161 162 162 163 static struct platform_driver max8925_onkey_driver = { 163 164 .driver = { 164 165 .name = "max8925-onkey", 165 - .pm = &max8925_onkey_pm_ops, 166 + .pm = pm_sleep_ptr(&max8925_onkey_pm_ops), 166 167 }, 167 168 .probe = max8925_onkey_probe, 168 169 };
+4 -3
drivers/input/misc/max8997_haptic.c
··· 366 366 return 0; 367 367 } 368 368 369 - static int __maybe_unused max8997_haptic_suspend(struct device *dev) 369 + static int max8997_haptic_suspend(struct device *dev) 370 370 { 371 371 struct platform_device *pdev = to_platform_device(dev); 372 372 struct max8997_haptic *chip = platform_get_drvdata(pdev); ··· 376 376 return 0; 377 377 } 378 378 379 - static SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, max8997_haptic_suspend, NULL); 379 + static DEFINE_SIMPLE_DEV_PM_OPS(max8997_haptic_pm_ops, 380 + max8997_haptic_suspend, NULL); 380 381 381 382 static const struct platform_device_id max8997_haptic_id[] = { 382 383 { "max8997-haptic", 0 }, ··· 388 387 static struct platform_driver max8997_haptic_driver = { 389 388 .driver = { 390 389 .name = "max8997-haptic", 391 - .pm = &max8997_haptic_pm_ops, 390 + .pm = pm_sleep_ptr(&max8997_haptic_pm_ops), 392 391 }, 393 392 .probe = max8997_haptic_probe, 394 393 .remove = max8997_haptic_remove,
+5 -5
drivers/input/misc/palmas-pwrbutton.c
··· 266 266 * 267 267 * Return: 0 268 268 */ 269 - static int __maybe_unused palmas_pwron_suspend(struct device *dev) 269 + static int palmas_pwron_suspend(struct device *dev) 270 270 { 271 271 struct platform_device *pdev = to_platform_device(dev); 272 272 struct palmas_pwron *pwron = platform_get_drvdata(pdev); ··· 287 287 * 288 288 * Return: 0 289 289 */ 290 - static int __maybe_unused palmas_pwron_resume(struct device *dev) 290 + static int palmas_pwron_resume(struct device *dev) 291 291 { 292 292 struct platform_device *pdev = to_platform_device(dev); 293 293 struct palmas_pwron *pwron = platform_get_drvdata(pdev); ··· 298 298 return 0; 299 299 } 300 300 301 - static SIMPLE_DEV_PM_OPS(palmas_pwron_pm, 302 - palmas_pwron_suspend, palmas_pwron_resume); 301 + static DEFINE_SIMPLE_DEV_PM_OPS(palmas_pwron_pm, 302 + palmas_pwron_suspend, palmas_pwron_resume); 303 303 304 304 #ifdef CONFIG_OF 305 305 static const struct of_device_id of_palmas_pwr_match[] = { ··· 316 316 .driver = { 317 317 .name = "palmas_pwrbutton", 318 318 .of_match_table = of_match_ptr(of_palmas_pwr_match), 319 - .pm = &palmas_pwron_pm, 319 + .pm = pm_sleep_ptr(&palmas_pwron_pm), 320 320 }, 321 321 }; 322 322 module_platform_driver(palmas_pwron_driver);
+3 -13
drivers/input/misc/pcf8574_keypad.c
··· 167 167 kfree(lp); 168 168 } 169 169 170 - #ifdef CONFIG_PM 171 170 static int pcf8574_kp_resume(struct device *dev) 172 171 { 173 172 struct i2c_client *client = to_i2c_client(dev); ··· 185 186 return 0; 186 187 } 187 188 188 - static const struct dev_pm_ops pcf8574_kp_pm_ops = { 189 - .suspend = pcf8574_kp_suspend, 190 - .resume = pcf8574_kp_resume, 191 - }; 192 - 193 - #else 194 - # define pcf8574_kp_resume NULL 195 - # define pcf8574_kp_suspend NULL 196 - #endif 189 + static DEFINE_SIMPLE_DEV_PM_OPS(pcf8574_kp_pm_ops, 190 + pcf8574_kp_suspend, pcf8574_kp_resume); 197 191 198 192 static const struct i2c_device_id pcf8574_kp_id[] = { 199 193 { DRV_NAME, 0 }, ··· 197 205 static struct i2c_driver pcf8574_kp_driver = { 198 206 .driver = { 199 207 .name = DRV_NAME, 200 - #ifdef CONFIG_PM 201 - .pm = &pcf8574_kp_pm_ops, 202 - #endif 208 + .pm = pm_sleep_ptr(&pcf8574_kp_pm_ops), 203 209 }, 204 210 .probe_new = pcf8574_kp_probe, 205 211 .remove = pcf8574_kp_remove,
+5 -5
drivers/input/misc/pm8941-pwrkey.c
··· 217 217 return 0; 218 218 } 219 219 220 - static int __maybe_unused pm8941_pwrkey_suspend(struct device *dev) 220 + static int pm8941_pwrkey_suspend(struct device *dev) 221 221 { 222 222 struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev); 223 223 ··· 227 227 return 0; 228 228 } 229 229 230 - static int __maybe_unused pm8941_pwrkey_resume(struct device *dev) 230 + static int pm8941_pwrkey_resume(struct device *dev) 231 231 { 232 232 struct pm8941_pwrkey *pwrkey = dev_get_drvdata(dev); 233 233 ··· 237 237 return 0; 238 238 } 239 239 240 - static SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops, 241 - pm8941_pwrkey_suspend, pm8941_pwrkey_resume); 240 + static DEFINE_SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops, 241 + pm8941_pwrkey_suspend, pm8941_pwrkey_resume); 242 242 243 243 static int pm8941_pwrkey_probe(struct platform_device *pdev) 244 244 { ··· 460 460 .remove = pm8941_pwrkey_remove, 461 461 .driver = { 462 462 .name = "pm8941-pwrkey", 463 - .pm = &pm8941_pwr_key_pm_ops, 463 + .pm = pm_sleep_ptr(&pm8941_pwr_key_pm_ops), 464 464 .of_match_table = of_match_ptr(pm8941_pwr_key_id_table), 465 465 }, 466 466 };
+3 -3
drivers/input/misc/pm8xxx-vibrator.c
··· 226 226 return 0; 227 227 } 228 228 229 - static int __maybe_unused pm8xxx_vib_suspend(struct device *dev) 229 + static int pm8xxx_vib_suspend(struct device *dev) 230 230 { 231 231 struct pm8xxx_vib *vib = dev_get_drvdata(dev); 232 232 ··· 236 236 return 0; 237 237 } 238 238 239 - static SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); 239 + static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_vib_pm_ops, pm8xxx_vib_suspend, NULL); 240 240 241 241 static const struct of_device_id pm8xxx_vib_id_table[] = { 242 242 { .compatible = "qcom,pm8058-vib", .data = &pm8058_regs }, ··· 250 250 .probe = pm8xxx_vib_probe, 251 251 .driver = { 252 252 .name = "pm8xxx-vib", 253 - .pm = &pm8xxx_vib_pm_ops, 253 + .pm = pm_sleep_ptr(&pm8xxx_vib_pm_ops), 254 254 .of_match_table = pm8xxx_vib_id_table, 255 255 }, 256 256 };
+4 -4
drivers/input/misc/pmic8xxx-pwrkey.c
··· 100 100 return IRQ_HANDLED; 101 101 } 102 102 103 - static int __maybe_unused pmic8xxx_pwrkey_suspend(struct device *dev) 103 + static int pmic8xxx_pwrkey_suspend(struct device *dev) 104 104 { 105 105 struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); 106 106 ··· 110 110 return 0; 111 111 } 112 112 113 - static int __maybe_unused pmic8xxx_pwrkey_resume(struct device *dev) 113 + static int pmic8xxx_pwrkey_resume(struct device *dev) 114 114 { 115 115 struct pmic8xxx_pwrkey *pwrkey = dev_get_drvdata(dev); 116 116 ··· 120 120 return 0; 121 121 } 122 122 123 - static SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, 123 + static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops, 124 124 pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume); 125 125 126 126 static void pmic8xxx_pwrkey_shutdown(struct platform_device *pdev) ··· 442 442 .shutdown = pmic8xxx_pwrkey_shutdown, 443 443 .driver = { 444 444 .name = "pm8xxx-pwrkey", 445 - .pm = &pm8xxx_pwr_key_pm_ops, 445 + .pm = pm_sleep_ptr(&pm8xxx_pwr_key_pm_ops), 446 446 .of_match_table = pm8xxx_pwr_key_id_table, 447 447 }, 448 448 };
+5 -5
drivers/input/misc/pwm-beeper.c
··· 203 203 return 0; 204 204 } 205 205 206 - static int __maybe_unused pwm_beeper_suspend(struct device *dev) 206 + static int pwm_beeper_suspend(struct device *dev) 207 207 { 208 208 struct pwm_beeper *beeper = dev_get_drvdata(dev); 209 209 ··· 221 221 return 0; 222 222 } 223 223 224 - static int __maybe_unused pwm_beeper_resume(struct device *dev) 224 + static int pwm_beeper_resume(struct device *dev) 225 225 { 226 226 struct pwm_beeper *beeper = dev_get_drvdata(dev); 227 227 ··· 235 235 return 0; 236 236 } 237 237 238 - static SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops, 239 - pwm_beeper_suspend, pwm_beeper_resume); 238 + static DEFINE_SIMPLE_DEV_PM_OPS(pwm_beeper_pm_ops, 239 + pwm_beeper_suspend, pwm_beeper_resume); 240 240 241 241 #ifdef CONFIG_OF 242 242 static const struct of_device_id pwm_beeper_match[] = { ··· 250 250 .probe = pwm_beeper_probe, 251 251 .driver = { 252 252 .name = "pwm-beeper", 253 - .pm = &pwm_beeper_pm_ops, 253 + .pm = pm_sleep_ptr(&pwm_beeper_pm_ops), 254 254 .of_match_table = of_match_ptr(pwm_beeper_match), 255 255 }, 256 256 };
+5 -5
drivers/input/misc/pwm-vibra.c
··· 222 222 return 0; 223 223 } 224 224 225 - static int __maybe_unused pwm_vibrator_suspend(struct device *dev) 225 + static int pwm_vibrator_suspend(struct device *dev) 226 226 { 227 227 struct pwm_vibrator *vibrator = dev_get_drvdata(dev); 228 228 ··· 233 233 return 0; 234 234 } 235 235 236 - static int __maybe_unused pwm_vibrator_resume(struct device *dev) 236 + static int pwm_vibrator_resume(struct device *dev) 237 237 { 238 238 struct pwm_vibrator *vibrator = dev_get_drvdata(dev); 239 239 ··· 243 243 return 0; 244 244 } 245 245 246 - static SIMPLE_DEV_PM_OPS(pwm_vibrator_pm_ops, 247 - pwm_vibrator_suspend, pwm_vibrator_resume); 246 + static DEFINE_SIMPLE_DEV_PM_OPS(pwm_vibrator_pm_ops, 247 + pwm_vibrator_suspend, pwm_vibrator_resume); 248 248 249 249 #ifdef CONFIG_OF 250 250 static const struct of_device_id pwm_vibra_dt_match_table[] = { ··· 258 258 .probe = pwm_vibrator_probe, 259 259 .driver = { 260 260 .name = "pwm-vibrator", 261 - .pm = &pwm_vibrator_pm_ops, 261 + .pm = pm_sleep_ptr(&pwm_vibrator_pm_ops), 262 262 .of_match_table = of_match_ptr(pwm_vibra_dt_match_table), 263 263 }, 264 264 };
+4 -4
drivers/input/misc/regulator-haptic.c
··· 201 201 return 0; 202 202 } 203 203 204 - static int __maybe_unused regulator_haptic_suspend(struct device *dev) 204 + static int regulator_haptic_suspend(struct device *dev) 205 205 { 206 206 struct platform_device *pdev = to_platform_device(dev); 207 207 struct regulator_haptic *haptic = platform_get_drvdata(pdev); ··· 220 220 return 0; 221 221 } 222 222 223 - static int __maybe_unused regulator_haptic_resume(struct device *dev) 223 + static int regulator_haptic_resume(struct device *dev) 224 224 { 225 225 struct platform_device *pdev = to_platform_device(dev); 226 226 struct regulator_haptic *haptic = platform_get_drvdata(pdev); ··· 239 239 return 0; 240 240 } 241 241 242 - static SIMPLE_DEV_PM_OPS(regulator_haptic_pm_ops, 242 + static DEFINE_SIMPLE_DEV_PM_OPS(regulator_haptic_pm_ops, 243 243 regulator_haptic_suspend, regulator_haptic_resume); 244 244 245 245 static const struct of_device_id regulator_haptic_dt_match[] = { ··· 253 253 .driver = { 254 254 .name = "regulator-haptic", 255 255 .of_match_table = regulator_haptic_dt_match, 256 - .pm = &regulator_haptic_pm_ops, 256 + .pm = pm_sleep_ptr(&regulator_haptic_pm_ops), 257 257 }, 258 258 }; 259 259 module_platform_driver(regulator_haptic_driver);
+5 -5
drivers/input/misc/rotary_encoder.c
··· 317 317 return 0; 318 318 } 319 319 320 - static int __maybe_unused rotary_encoder_suspend(struct device *dev) 320 + static int rotary_encoder_suspend(struct device *dev) 321 321 { 322 322 struct rotary_encoder *encoder = dev_get_drvdata(dev); 323 323 unsigned int i; ··· 330 330 return 0; 331 331 } 332 332 333 - static int __maybe_unused rotary_encoder_resume(struct device *dev) 333 + static int rotary_encoder_resume(struct device *dev) 334 334 { 335 335 struct rotary_encoder *encoder = dev_get_drvdata(dev); 336 336 unsigned int i; ··· 343 343 return 0; 344 344 } 345 345 346 - static SIMPLE_DEV_PM_OPS(rotary_encoder_pm_ops, 347 - rotary_encoder_suspend, rotary_encoder_resume); 346 + static DEFINE_SIMPLE_DEV_PM_OPS(rotary_encoder_pm_ops, 347 + rotary_encoder_suspend, rotary_encoder_resume); 348 348 349 349 #ifdef CONFIG_OF 350 350 static const struct of_device_id rotary_encoder_of_match[] = { ··· 358 358 .probe = rotary_encoder_probe, 359 359 .driver = { 360 360 .name = DRV_NAME, 361 - .pm = &rotary_encoder_pm_ops, 361 + .pm = pm_sleep_ptr(&rotary_encoder_pm_ops), 362 362 .of_match_table = of_match_ptr(rotary_encoder_of_match), 363 363 } 364 364 };
+6 -6
drivers/input/misc/stpmic1_onkey.c
··· 142 142 return 0; 143 143 } 144 144 145 - static int __maybe_unused stpmic1_onkey_suspend(struct device *dev) 145 + static int stpmic1_onkey_suspend(struct device *dev) 146 146 { 147 147 struct platform_device *pdev = to_platform_device(dev); 148 148 struct stpmic1_onkey *onkey = platform_get_drvdata(pdev); ··· 154 154 return 0; 155 155 } 156 156 157 - static int __maybe_unused stpmic1_onkey_resume(struct device *dev) 157 + static int stpmic1_onkey_resume(struct device *dev) 158 158 { 159 159 struct platform_device *pdev = to_platform_device(dev); 160 160 struct stpmic1_onkey *onkey = platform_get_drvdata(pdev); ··· 166 166 return 0; 167 167 } 168 168 169 - static SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm, 170 - stpmic1_onkey_suspend, 171 - stpmic1_onkey_resume); 169 + static DEFINE_SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm, 170 + stpmic1_onkey_suspend, 171 + stpmic1_onkey_resume); 172 172 173 173 static const struct of_device_id of_stpmic1_onkey_match[] = { 174 174 { .compatible = "st,stpmic1-onkey" }, ··· 182 182 .driver = { 183 183 .name = "stpmic1_onkey", 184 184 .of_match_table = of_match_ptr(of_stpmic1_onkey_match), 185 - .pm = &stpmic1_onkey_pm, 185 + .pm = pm_sleep_ptr(&stpmic1_onkey_pm), 186 186 }, 187 187 }; 188 188 module_platform_driver(stpmic1_onkey_driver);
+5 -5
drivers/input/misc/twl4030-vibra.c
··· 143 143 } 144 144 145 145 /*** Module ***/ 146 - static int __maybe_unused twl4030_vibra_suspend(struct device *dev) 146 + static int twl4030_vibra_suspend(struct device *dev) 147 147 { 148 148 struct platform_device *pdev = to_platform_device(dev); 149 149 struct vibra_info *info = platform_get_drvdata(pdev); ··· 154 154 return 0; 155 155 } 156 156 157 - static int __maybe_unused twl4030_vibra_resume(struct device *dev) 157 + static int twl4030_vibra_resume(struct device *dev) 158 158 { 159 159 vibra_disable_leds(); 160 160 return 0; 161 161 } 162 162 163 - static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, 164 - twl4030_vibra_suspend, twl4030_vibra_resume); 163 + static DEFINE_SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, 164 + twl4030_vibra_suspend, twl4030_vibra_resume); 165 165 166 166 static bool twl4030_vibra_check_coexist(struct device_node *parent) 167 167 { ··· 234 234 .probe = twl4030_vibra_probe, 235 235 .driver = { 236 236 .name = "twl4030-vibra", 237 - .pm = &twl4030_vibra_pm_ops, 237 + .pm = pm_sleep_ptr(&twl4030_vibra_pm_ops), 238 238 }, 239 239 }; 240 240 module_platform_driver(twl4030_vibra_driver);
+4 -3
drivers/input/misc/twl6040-vibra.c
··· 210 210 twl6040_vibra_disable(info); 211 211 } 212 212 213 - static int __maybe_unused twl6040_vibra_suspend(struct device *dev) 213 + static int twl6040_vibra_suspend(struct device *dev) 214 214 { 215 215 struct platform_device *pdev = to_platform_device(dev); 216 216 struct vibra_info *info = platform_get_drvdata(pdev); ··· 223 223 return 0; 224 224 } 225 225 226 - static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); 226 + static DEFINE_SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, 227 + twl6040_vibra_suspend, NULL); 227 228 228 229 static int twl6040_vibra_probe(struct platform_device *pdev) 229 230 { ··· 355 354 .probe = twl6040_vibra_probe, 356 355 .driver = { 357 356 .name = "twl6040-vibra", 358 - .pm = &twl6040_vibra_pm_ops, 357 + .pm = pm_sleep_ptr(&twl6040_vibra_pm_ops), 359 358 }, 360 359 }; 361 360 module_platform_driver(twl6040_vibra_driver);
+1 -5
drivers/input/misc/wistron_btns.c
··· 1295 1295 return 0; 1296 1296 } 1297 1297 1298 - #ifdef CONFIG_PM 1299 1298 static int wistron_suspend(struct device *dev) 1300 1299 { 1301 1300 if (have_wifi) ··· 1329 1330 .poweroff = wistron_suspend, 1330 1331 .restore = wistron_resume, 1331 1332 }; 1332 - #endif 1333 1333 1334 1334 static struct platform_driver wistron_driver = { 1335 1335 .driver = { 1336 1336 .name = "wistron-bios", 1337 - #ifdef CONFIG_PM 1338 - .pm = &wistron_pm_ops, 1339 - #endif 1337 + .pm = pm_sleep_ptr(&wistron_pm_ops), 1340 1338 }, 1341 1339 .probe = wistron_probe, 1342 1340 .remove = wistron_remove,
+7 -7
drivers/input/mouse/cyapa.c
··· 1349 1349 return 0; 1350 1350 } 1351 1351 1352 - static int __maybe_unused cyapa_suspend(struct device *dev) 1352 + static int cyapa_suspend(struct device *dev) 1353 1353 { 1354 1354 struct i2c_client *client = to_i2c_client(dev); 1355 1355 struct cyapa *cyapa = i2c_get_clientdata(client); ··· 1397 1397 return 0; 1398 1398 } 1399 1399 1400 - static int __maybe_unused cyapa_resume(struct device *dev) 1400 + static int cyapa_resume(struct device *dev) 1401 1401 { 1402 1402 struct i2c_client *client = to_i2c_client(dev); 1403 1403 struct cyapa *cyapa = i2c_get_clientdata(client); ··· 1424 1424 return 0; 1425 1425 } 1426 1426 1427 - static int __maybe_unused cyapa_runtime_suspend(struct device *dev) 1427 + static int cyapa_runtime_suspend(struct device *dev) 1428 1428 { 1429 1429 struct cyapa *cyapa = dev_get_drvdata(dev); 1430 1430 int error; ··· 1439 1439 return 0; 1440 1440 } 1441 1441 1442 - static int __maybe_unused cyapa_runtime_resume(struct device *dev) 1442 + static int cyapa_runtime_resume(struct device *dev) 1443 1443 { 1444 1444 struct cyapa *cyapa = dev_get_drvdata(dev); 1445 1445 int error; ··· 1453 1453 } 1454 1454 1455 1455 static const struct dev_pm_ops cyapa_pm_ops = { 1456 - SET_SYSTEM_SLEEP_PM_OPS(cyapa_suspend, cyapa_resume) 1457 - SET_RUNTIME_PM_OPS(cyapa_runtime_suspend, cyapa_runtime_resume, NULL) 1456 + SYSTEM_SLEEP_PM_OPS(cyapa_suspend, cyapa_resume) 1457 + RUNTIME_PM_OPS(cyapa_runtime_suspend, cyapa_runtime_resume, NULL) 1458 1458 }; 1459 1459 1460 1460 static const struct i2c_device_id cyapa_id_table[] = { ··· 1484 1484 static struct i2c_driver cyapa_driver = { 1485 1485 .driver = { 1486 1486 .name = "cyapa", 1487 - .pm = &cyapa_pm_ops, 1487 + .pm = pm_ptr(&cyapa_pm_ops), 1488 1488 .acpi_match_table = ACPI_PTR(cyapa_acpi_id), 1489 1489 .of_match_table = of_match_ptr(cyapa_of_match), 1490 1490 },
+4 -4
drivers/input/mouse/elan_i2c_core.c
··· 1328 1328 return 0; 1329 1329 } 1330 1330 1331 - static int __maybe_unused elan_suspend(struct device *dev) 1331 + static int elan_suspend(struct device *dev) 1332 1332 { 1333 1333 struct i2c_client *client = to_i2c_client(dev); 1334 1334 struct elan_tp_data *data = i2c_get_clientdata(client); ··· 1365 1365 return ret; 1366 1366 } 1367 1367 1368 - static int __maybe_unused elan_resume(struct device *dev) 1368 + static int elan_resume(struct device *dev) 1369 1369 { 1370 1370 struct i2c_client *client = to_i2c_client(dev); 1371 1371 struct elan_tp_data *data = i2c_get_clientdata(client); ··· 1394 1394 return error; 1395 1395 } 1396 1396 1397 - static SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume); 1397 + static DEFINE_SIMPLE_DEV_PM_OPS(elan_pm_ops, elan_suspend, elan_resume); 1398 1398 1399 1399 static const struct i2c_device_id elan_id[] = { 1400 1400 { DRIVER_NAME, 0 }, ··· 1418 1418 static struct i2c_driver elan_driver = { 1419 1419 .driver = { 1420 1420 .name = DRIVER_NAME, 1421 - .pm = &elan_pm_ops, 1421 + .pm = pm_sleep_ptr(&elan_pm_ops), 1422 1422 .acpi_match_table = ACPI_PTR(elan_acpi_id), 1423 1423 .of_match_table = of_match_ptr(elan_of_match), 1424 1424 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+5 -4
drivers/input/mouse/navpoint.c
··· 315 315 return 0; 316 316 } 317 317 318 - static int __maybe_unused navpoint_suspend(struct device *dev) 318 + static int navpoint_suspend(struct device *dev) 319 319 { 320 320 struct platform_device *pdev = to_platform_device(dev); 321 321 struct navpoint *navpoint = platform_get_drvdata(pdev); ··· 329 329 return 0; 330 330 } 331 331 332 - static int __maybe_unused navpoint_resume(struct device *dev) 332 + static int navpoint_resume(struct device *dev) 333 333 { 334 334 struct platform_device *pdev = to_platform_device(dev); 335 335 struct navpoint *navpoint = platform_get_drvdata(pdev); ··· 343 343 return 0; 344 344 } 345 345 346 - static SIMPLE_DEV_PM_OPS(navpoint_pm_ops, navpoint_suspend, navpoint_resume); 346 + static DEFINE_SIMPLE_DEV_PM_OPS(navpoint_pm_ops, 347 + navpoint_suspend, navpoint_resume); 347 348 348 349 static struct platform_driver navpoint_driver = { 349 350 .probe = navpoint_probe, 350 351 .remove = navpoint_remove, 351 352 .driver = { 352 353 .name = "navpoint", 353 - .pm = &navpoint_pm_ops, 354 + .pm = pm_sleep_ptr(&navpoint_pm_ops), 354 355 }, 355 356 }; 356 357
+5 -5
drivers/input/mouse/synaptics_i2c.c
··· 597 597 kfree(touch); 598 598 } 599 599 600 - static int __maybe_unused synaptics_i2c_suspend(struct device *dev) 600 + static int synaptics_i2c_suspend(struct device *dev) 601 601 { 602 602 struct i2c_client *client = to_i2c_client(dev); 603 603 struct synaptics_i2c *touch = i2c_get_clientdata(client); ··· 610 610 return 0; 611 611 } 612 612 613 - static int __maybe_unused synaptics_i2c_resume(struct device *dev) 613 + static int synaptics_i2c_resume(struct device *dev) 614 614 { 615 615 int ret; 616 616 struct i2c_client *client = to_i2c_client(dev); ··· 626 626 return 0; 627 627 } 628 628 629 - static SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend, 630 - synaptics_i2c_resume); 629 + static DEFINE_SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend, 630 + synaptics_i2c_resume); 631 631 632 632 static const struct i2c_device_id synaptics_i2c_id_table[] = { 633 633 { "synaptics_i2c", 0 }, ··· 647 647 .driver = { 648 648 .name = DRIVER_NAME, 649 649 .of_match_table = of_match_ptr(synaptics_i2c_of_match), 650 - .pm = &synaptics_i2c_pm, 650 + .pm = pm_sleep_ptr(&synaptics_i2c_pm), 651 651 }, 652 652 653 653 .probe_new = synaptics_i2c_probe,
+3 -8
drivers/input/rmi4/rmi_i2c.c
··· 287 287 return 0; 288 288 } 289 289 290 - #ifdef CONFIG_PM_SLEEP 291 290 static int rmi_i2c_suspend(struct device *dev) 292 291 { 293 292 struct i2c_client *client = to_i2c_client(dev); ··· 322 323 323 324 return ret; 324 325 } 325 - #endif 326 326 327 - #ifdef CONFIG_PM 328 327 static int rmi_i2c_runtime_suspend(struct device *dev) 329 328 { 330 329 struct i2c_client *client = to_i2c_client(dev); ··· 358 361 359 362 return 0; 360 363 } 361 - #endif 362 364 363 365 static const struct dev_pm_ops rmi_i2c_pm = { 364 - SET_SYSTEM_SLEEP_PM_OPS(rmi_i2c_suspend, rmi_i2c_resume) 365 - SET_RUNTIME_PM_OPS(rmi_i2c_runtime_suspend, rmi_i2c_runtime_resume, 366 - NULL) 366 + SYSTEM_SLEEP_PM_OPS(rmi_i2c_suspend, rmi_i2c_resume) 367 + RUNTIME_PM_OPS(rmi_i2c_runtime_suspend, rmi_i2c_runtime_resume, NULL) 367 368 }; 368 369 369 370 static const struct i2c_device_id rmi_id[] = { ··· 373 378 static struct i2c_driver rmi_i2c_driver = { 374 379 .driver = { 375 380 .name = "rmi4_i2c", 376 - .pm = &rmi_i2c_pm, 381 + .pm = pm_ptr(&rmi_i2c_pm), 377 382 .of_match_table = of_match_ptr(rmi_i2c_of_match), 378 383 }, 379 384 .id_table = rmi_id,
+7 -8
drivers/input/rmi4/rmi_smbus.c
··· 344 344 rmi_unregister_transport_device(&rmi_smb->xport); 345 345 } 346 346 347 - static int __maybe_unused rmi_smb_suspend(struct device *dev) 347 + static int rmi_smb_suspend(struct device *dev) 348 348 { 349 349 struct i2c_client *client = to_i2c_client(dev); 350 350 struct rmi_smb_xport *rmi_smb = i2c_get_clientdata(client); ··· 357 357 return ret; 358 358 } 359 359 360 - static int __maybe_unused rmi_smb_runtime_suspend(struct device *dev) 360 + static int rmi_smb_runtime_suspend(struct device *dev) 361 361 { 362 362 struct i2c_client *client = to_i2c_client(dev); 363 363 struct rmi_smb_xport *rmi_smb = i2c_get_clientdata(client); ··· 370 370 return ret; 371 371 } 372 372 373 - static int __maybe_unused rmi_smb_resume(struct device *dev) 373 + static int rmi_smb_resume(struct device *dev) 374 374 { 375 375 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 376 376 struct rmi_smb_xport *rmi_smb = i2c_get_clientdata(client); ··· 388 388 return 0; 389 389 } 390 390 391 - static int __maybe_unused rmi_smb_runtime_resume(struct device *dev) 391 + static int rmi_smb_runtime_resume(struct device *dev) 392 392 { 393 393 struct i2c_client *client = to_i2c_client(dev); 394 394 struct rmi_smb_xport *rmi_smb = i2c_get_clientdata(client); ··· 402 402 } 403 403 404 404 static const struct dev_pm_ops rmi_smb_pm = { 405 - SET_SYSTEM_SLEEP_PM_OPS(rmi_smb_suspend, rmi_smb_resume) 406 - SET_RUNTIME_PM_OPS(rmi_smb_runtime_suspend, rmi_smb_runtime_resume, 407 - NULL) 405 + SYSTEM_SLEEP_PM_OPS(rmi_smb_suspend, rmi_smb_resume) 406 + RUNTIME_PM_OPS(rmi_smb_runtime_suspend, rmi_smb_runtime_resume, NULL) 408 407 }; 409 408 410 409 static const struct i2c_device_id rmi_id[] = { ··· 415 416 static struct i2c_driver rmi_smb_driver = { 416 417 .driver = { 417 418 .name = "rmi4_smbus", 418 - .pm = &rmi_smb_pm, 419 + .pm = pm_ptr(&rmi_smb_pm), 419 420 }, 420 421 .id_table = rmi_id, 421 422 .probe_new = rmi_smb_probe,
+4 -9
drivers/input/rmi4/rmi_spi.c
··· 447 447 return 0; 448 448 } 449 449 450 - #ifdef CONFIG_PM_SLEEP 451 450 static int rmi_spi_suspend(struct device *dev) 452 451 { 453 452 struct spi_device *spi = to_spi_device(dev); ··· 472 473 473 474 return ret; 474 475 } 475 - #endif 476 476 477 - #ifdef CONFIG_PM 478 477 static int rmi_spi_runtime_suspend(struct device *dev) 479 478 { 480 479 struct spi_device *spi = to_spi_device(dev); ··· 498 501 499 502 return 0; 500 503 } 501 - #endif 502 504 503 505 static const struct dev_pm_ops rmi_spi_pm = { 504 - SET_SYSTEM_SLEEP_PM_OPS(rmi_spi_suspend, rmi_spi_resume) 505 - SET_RUNTIME_PM_OPS(rmi_spi_runtime_suspend, rmi_spi_runtime_resume, 506 - NULL) 506 + SYSTEM_SLEEP_PM_OPS(rmi_spi_suspend, rmi_spi_resume) 507 + RUNTIME_PM_OPS(rmi_spi_runtime_suspend, rmi_spi_runtime_resume, NULL) 507 508 }; 508 509 509 510 static const struct spi_device_id rmi_id[] = { 510 - { "rmi4_spi", 0 }, 511 + { "rmi4-spi", 0 }, 511 512 { } 512 513 }; 513 514 MODULE_DEVICE_TABLE(spi, rmi_id); ··· 513 518 static struct spi_driver rmi_spi_driver = { 514 519 .driver = { 515 520 .name = "rmi4_spi", 516 - .pm = &rmi_spi_pm, 521 + .pm = pm_ptr(&rmi_spi_pm), 517 522 .of_match_table = of_match_ptr(rmi_spi_of_match), 518 523 }, 519 524 .id_table = rmi_id,
+1 -3
drivers/input/serio/altera_ps2.c
··· 78 78 static int altera_ps2_probe(struct platform_device *pdev) 79 79 { 80 80 struct ps2if *ps2if; 81 - struct resource *res; 82 81 struct serio *serio; 83 82 int error, irq; 84 83 ··· 85 86 if (!ps2if) 86 87 return -ENOMEM; 87 88 88 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 89 - ps2if->base = devm_ioremap_resource(&pdev->dev, res); 89 + ps2if->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 90 90 if (IS_ERR(ps2if->base)) 91 91 return PTR_ERR(ps2if->base); 92 92
+3 -3
drivers/input/serio/ambakmi.c
··· 170 170 amba_release_regions(dev); 171 171 } 172 172 173 - static int __maybe_unused amba_kmi_resume(struct device *dev) 173 + static int amba_kmi_resume(struct device *dev) 174 174 { 175 175 struct amba_kmi_port *kmi = dev_get_drvdata(dev); 176 176 ··· 180 180 return 0; 181 181 } 182 182 183 - static SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume); 183 + static DEFINE_SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume); 184 184 185 185 static const struct amba_id amba_kmi_idtable[] = { 186 186 { ··· 196 196 .drv = { 197 197 .name = "kmi-pl050", 198 198 .owner = THIS_MODULE, 199 - .pm = &amba_kmi_dev_pm_ops, 199 + .pm = pm_sleep_ptr(&amba_kmi_dev_pm_ops), 200 200 }, 201 201 .id_table = amba_kmi_idtable, 202 202 .probe = amba_kmi_probe,
+1 -3
drivers/input/serio/apbps2.c
··· 132 132 struct apbps2_priv *priv; 133 133 int irq, err; 134 134 u32 freq_hz; 135 - struct resource *res; 136 135 137 136 priv = devm_kzalloc(&ofdev->dev, sizeof(*priv), GFP_KERNEL); 138 137 if (!priv) { ··· 140 141 } 141 142 142 143 /* Find Device Address */ 143 - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); 144 - priv->regs = devm_ioremap_resource(&ofdev->dev, res); 144 + priv->regs = devm_platform_get_and_ioremap_resource(ofdev, 0, NULL); 145 145 if (IS_ERR(priv->regs)) 146 146 return PTR_ERR(priv->regs); 147 147
+1 -3
drivers/input/serio/arc_ps2.c
··· 182 182 static int arc_ps2_probe(struct platform_device *pdev) 183 183 { 184 184 struct arc_ps2_data *arc_ps2; 185 - struct resource *res; 186 185 int irq; 187 186 int error, id, i; 188 187 ··· 196 197 return -ENOMEM; 197 198 } 198 199 199 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 200 - arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res); 200 + arc_ps2->addr = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 201 201 if (IS_ERR(arc_ps2->addr)) 202 202 return PTR_ERR(arc_ps2->addr); 203 203
+1 -3
drivers/input/serio/olpc_apsp.c
··· 169 169 { 170 170 struct serio *kb_serio, *pad_serio; 171 171 struct olpc_apsp *priv; 172 - struct resource *res; 173 172 int error; 174 173 175 174 priv = devm_kzalloc(&pdev->dev, sizeof(struct olpc_apsp), GFP_KERNEL); ··· 177 178 178 179 priv->dev = &pdev->dev; 179 180 180 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 181 - priv->base = devm_ioremap_resource(&pdev->dev, res); 181 + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 182 182 if (IS_ERR(priv->base)) { 183 183 dev_err(&pdev->dev, "Failed to map WTM registers\n"); 184 184 return PTR_ERR(priv->base);
+4 -4
drivers/input/touchscreen/ad7877.c
··· 788 788 return 0; 789 789 } 790 790 791 - static int __maybe_unused ad7877_suspend(struct device *dev) 791 + static int ad7877_suspend(struct device *dev) 792 792 { 793 793 struct ad7877 *ts = dev_get_drvdata(dev); 794 794 ··· 797 797 return 0; 798 798 } 799 799 800 - static int __maybe_unused ad7877_resume(struct device *dev) 800 + static int ad7877_resume(struct device *dev) 801 801 { 802 802 struct ad7877 *ts = dev_get_drvdata(dev); 803 803 ··· 806 806 return 0; 807 807 } 808 808 809 - static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); 809 + static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume); 810 810 811 811 static struct spi_driver ad7877_driver = { 812 812 .driver = { 813 813 .name = "ad7877", 814 - .pm = &ad7877_pm, 814 + .pm = pm_sleep_ptr(&ad7877_pm), 815 815 }, 816 816 .probe = ad7877_probe, 817 817 };
+17 -14
drivers/input/touchscreen/ads7846.c
··· 843 843 if (x == MAX_12BIT) 844 844 x = 0; 845 845 846 - if (ts->model == 7843) { 846 + if (ts->model == 7843 || ts->model == 7845) { 847 847 Rt = ts->pressure_max / 2; 848 - } else if (ts->model == 7845) { 849 - if (get_pendown_state(ts)) 850 - Rt = ts->pressure_max / 2; 851 - else 852 - Rt = 0; 853 - dev_vdbg(&ts->spi->dev, "x/y: %d/%d, PD %d\n", x, y, Rt); 854 848 } else if (likely(x && z1)) { 855 849 /* compute touch pressure resistance using equation #2 */ 856 850 Rt = z2; ··· 938 944 return IRQ_HANDLED; 939 945 } 940 946 941 - static int __maybe_unused ads7846_suspend(struct device *dev) 947 + static int ads7846_suspend(struct device *dev) 942 948 { 943 949 struct ads7846 *ts = dev_get_drvdata(dev); 944 950 ··· 960 966 return 0; 961 967 } 962 968 963 - static int __maybe_unused ads7846_resume(struct device *dev) 969 + static int ads7846_resume(struct device *dev) 964 970 { 965 971 struct ads7846 *ts = dev_get_drvdata(dev); 966 972 ··· 982 988 return 0; 983 989 } 984 990 985 - static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); 991 + static DEFINE_SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume); 986 992 987 993 static int ads7846_setup_pendown(struct spi_device *spi, 988 994 struct ads7846 *ts, ··· 1060 1066 struct ads7846_buf_layout *l = &packet->l[cmd_idx]; 1061 1067 unsigned int max_count; 1062 1068 1069 + if (cmd_idx == packet->cmds - 1) 1070 + cmd_idx = ADS7846_PWDOWN; 1071 + 1063 1072 if (ads7846_cmd_need_settle(cmd_idx)) 1064 1073 max_count = packet->count + packet->count_skip; 1065 1074 else ··· 1099 1102 1100 1103 for (cmd_idx = 0; cmd_idx < packet->cmds; cmd_idx++) { 1101 1104 struct ads7846_buf_layout *l = &packet->l[cmd_idx]; 1102 - u8 cmd = ads7846_get_cmd(cmd_idx, vref); 1105 + u8 cmd; 1106 + 1107 + if (cmd_idx == packet->cmds - 1) 1108 + cmd_idx = ADS7846_PWDOWN; 1109 + 1110 + cmd = ads7846_get_cmd(cmd_idx, vref); 1103 1111 1104 1112 for (b = 0; b < l->count; b++) 1105 1113 packet->tx[l->offset + b].cmd = cmd; ··· 1318 1316 pdata->y_min ? : 0, 1319 1317 pdata->y_max ? : MAX_12BIT, 1320 1318 0, 0); 1321 - input_set_abs_params(input_dev, ABS_PRESSURE, 1322 - pdata->pressure_min, pdata->pressure_max, 0, 0); 1319 + if (ts->model != 7845) 1320 + input_set_abs_params(input_dev, ABS_PRESSURE, 1321 + pdata->pressure_min, pdata->pressure_max, 0, 0); 1323 1322 1324 1323 /* 1325 1324 * Parse common framework properties. Must be done here to ensure the ··· 1424 1421 static struct spi_driver ads7846_driver = { 1425 1422 .driver = { 1426 1423 .name = "ads7846", 1427 - .pm = &ads7846_pm, 1424 + .pm = pm_sleep_ptr(&ads7846_pm), 1428 1425 .of_match_table = of_match_ptr(ads7846_dt_ids), 1429 1426 }, 1430 1427 .probe = ads7846_probe,
+5 -4
drivers/input/touchscreen/ar1021_i2c.c
··· 142 142 return 0; 143 143 } 144 144 145 - static int __maybe_unused ar1021_i2c_suspend(struct device *dev) 145 + static int ar1021_i2c_suspend(struct device *dev) 146 146 { 147 147 struct i2c_client *client = to_i2c_client(dev); 148 148 ··· 151 151 return 0; 152 152 } 153 153 154 - static int __maybe_unused ar1021_i2c_resume(struct device *dev) 154 + static int ar1021_i2c_resume(struct device *dev) 155 155 { 156 156 struct i2c_client *client = to_i2c_client(dev); 157 157 ··· 160 160 return 0; 161 161 } 162 162 163 - static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume); 163 + static DEFINE_SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, 164 + ar1021_i2c_suspend, ar1021_i2c_resume); 164 165 165 166 static const struct i2c_device_id ar1021_i2c_id[] = { 166 167 { "ar1021", 0 }, ··· 178 177 static struct i2c_driver ar1021_i2c_driver = { 179 178 .driver = { 180 179 .name = "ar1021_i2c", 181 - .pm = &ar1021_i2c_pm, 180 + .pm = pm_sleep_ptr(&ar1021_i2c_pm), 182 181 .of_match_table = ar1021_i2c_of_match, 183 182 }, 184 183
+4 -4
drivers/input/touchscreen/atmel_mxt_ts.c
··· 3296 3296 data->regulators); 3297 3297 } 3298 3298 3299 - static int __maybe_unused mxt_suspend(struct device *dev) 3299 + static int mxt_suspend(struct device *dev) 3300 3300 { 3301 3301 struct i2c_client *client = to_i2c_client(dev); 3302 3302 struct mxt_data *data = i2c_get_clientdata(client); ··· 3317 3317 return 0; 3318 3318 } 3319 3319 3320 - static int __maybe_unused mxt_resume(struct device *dev) 3320 + static int mxt_resume(struct device *dev) 3321 3321 { 3322 3322 struct i2c_client *client = to_i2c_client(dev); 3323 3323 struct mxt_data *data = i2c_get_clientdata(client); ··· 3338 3338 return 0; 3339 3339 } 3340 3340 3341 - static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); 3341 + static DEFINE_SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); 3342 3342 3343 3343 static const struct of_device_id mxt_of_match[] = { 3344 3344 { .compatible = "atmel,maxtouch", }, ··· 3375 3375 .name = "atmel_mxt_ts", 3376 3376 .of_match_table = mxt_of_match, 3377 3377 .acpi_match_table = ACPI_PTR(mxt_acpi_id), 3378 - .pm = &mxt_pm_ops, 3378 + .pm = pm_sleep_ptr(&mxt_pm_ops), 3379 3379 }, 3380 3380 .probe_new = mxt_probe, 3381 3381 .remove = mxt_remove,
+5 -5
drivers/input/touchscreen/auo-pixcir-ts.c
··· 410 410 auo_pixcir_stop(ts); 411 411 } 412 412 413 - static int __maybe_unused auo_pixcir_suspend(struct device *dev) 413 + static int auo_pixcir_suspend(struct device *dev) 414 414 { 415 415 struct i2c_client *client = to_i2c_client(dev); 416 416 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); ··· 442 442 return ret; 443 443 } 444 444 445 - static int __maybe_unused auo_pixcir_resume(struct device *dev) 445 + static int auo_pixcir_resume(struct device *dev) 446 446 { 447 447 struct i2c_client *client = to_i2c_client(dev); 448 448 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); ··· 472 472 return ret; 473 473 } 474 474 475 - static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, 476 - auo_pixcir_suspend, auo_pixcir_resume); 475 + static DEFINE_SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, 476 + auo_pixcir_suspend, auo_pixcir_resume); 477 477 478 478 static void auo_pixcir_reset(void *data) 479 479 { ··· 633 633 static struct i2c_driver auo_pixcir_driver = { 634 634 .driver = { 635 635 .name = "auo_pixcir_ts", 636 - .pm = &auo_pixcir_pm_ops, 636 + .pm = pm_sleep_ptr(&auo_pixcir_pm_ops), 637 637 .of_match_table = of_match_ptr(auo_pixcir_ts_dt_idtable), 638 638 }, 639 639 .probe_new = auo_pixcir_probe,
+4 -4
drivers/input/touchscreen/bu21013_ts.c
··· 560 560 /* The resources will be freed by devm */ 561 561 } 562 562 563 - static int __maybe_unused bu21013_suspend(struct device *dev) 563 + static int bu21013_suspend(struct device *dev) 564 564 { 565 565 struct i2c_client *client = to_i2c_client(dev); 566 566 struct bu21013_ts *ts = i2c_get_clientdata(client); ··· 575 575 return 0; 576 576 } 577 577 578 - static int __maybe_unused bu21013_resume(struct device *dev) 578 + static int bu21013_resume(struct device *dev) 579 579 { 580 580 struct i2c_client *client = to_i2c_client(dev); 581 581 struct bu21013_ts *ts = i2c_get_clientdata(client); ··· 604 604 return 0; 605 605 } 606 606 607 - static SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); 607 + static DEFINE_SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume); 608 608 609 609 static const struct i2c_device_id bu21013_id[] = { 610 610 { DRIVER_TP, 0 }, ··· 615 615 static struct i2c_driver bu21013_driver = { 616 616 .driver = { 617 617 .name = DRIVER_TP, 618 - .pm = &bu21013_dev_pm_ops, 618 + .pm = pm_sleep_ptr(&bu21013_dev_pm_ops), 619 619 }, 620 620 .probe_new = bu21013_probe, 621 621 .remove = bu21013_remove,
+4 -4
drivers/input/touchscreen/bu21029_ts.c
··· 422 422 return 0; 423 423 } 424 424 425 - static int __maybe_unused bu21029_suspend(struct device *dev) 425 + static int bu21029_suspend(struct device *dev) 426 426 { 427 427 struct i2c_client *i2c = to_i2c_client(dev); 428 428 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); ··· 437 437 return 0; 438 438 } 439 439 440 - static int __maybe_unused bu21029_resume(struct device *dev) 440 + static int bu21029_resume(struct device *dev) 441 441 { 442 442 struct i2c_client *i2c = to_i2c_client(dev); 443 443 struct bu21029_ts_data *bu21029 = i2c_get_clientdata(i2c); ··· 451 451 452 452 return 0; 453 453 } 454 - static SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume); 454 + static DEFINE_SIMPLE_DEV_PM_OPS(bu21029_pm_ops, bu21029_suspend, bu21029_resume); 455 455 456 456 static const struct i2c_device_id bu21029_ids[] = { 457 457 { DRIVER_NAME, 0 }, ··· 471 471 .driver = { 472 472 .name = DRIVER_NAME, 473 473 .of_match_table = of_match_ptr(bu21029_of_ids), 474 - .pm = &bu21029_pm_ops, 474 + .pm = pm_sleep_ptr(&bu21029_pm_ops), 475 475 }, 476 476 .id_table = bu21029_ids, 477 477 .probe_new = bu21029_probe,
+2 -4
drivers/input/touchscreen/chipone_icn8318.c
··· 148 148 gpiod_set_value_cansleep(data->wake_gpio, 0); 149 149 } 150 150 151 - #ifdef CONFIG_PM_SLEEP 152 151 static int icn8318_suspend(struct device *dev) 153 152 { 154 153 struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev)); ··· 171 172 172 173 return 0; 173 174 } 174 - #endif 175 175 176 - static SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume); 176 + static DEFINE_SIMPLE_DEV_PM_OPS(icn8318_pm_ops, icn8318_suspend, icn8318_resume); 177 177 178 178 static int icn8318_probe(struct i2c_client *client) 179 179 { ··· 261 263 static struct i2c_driver icn8318_driver = { 262 264 .driver = { 263 265 .name = "chipone_icn8318", 264 - .pm = &icn8318_pm_ops, 266 + .pm = pm_sleep_ptr(&icn8318_pm_ops), 265 267 .of_match_table = icn8318_of_match, 266 268 }, 267 269 .probe_new = icn8318_probe,
+4 -4
drivers/input/touchscreen/chipone_icn8505.c
··· 460 460 return 0; 461 461 } 462 462 463 - static int __maybe_unused icn8505_suspend(struct device *dev) 463 + static int icn8505_suspend(struct device *dev) 464 464 { 465 465 struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); 466 466 ··· 471 471 return 0; 472 472 } 473 473 474 - static int __maybe_unused icn8505_resume(struct device *dev) 474 + static int icn8505_resume(struct device *dev) 475 475 { 476 476 struct icn8505_data *icn8505 = i2c_get_clientdata(to_i2c_client(dev)); 477 477 int error; ··· 484 484 return 0; 485 485 } 486 486 487 - static SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); 487 + static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); 488 488 489 489 static const struct acpi_device_id icn8505_acpi_match[] = { 490 490 { "CHPN0001" }, ··· 495 495 static struct i2c_driver icn8505_driver = { 496 496 .driver = { 497 497 .name = "chipone_icn8505", 498 - .pm = &icn8505_pm_ops, 498 + .pm = pm_sleep_ptr(&icn8505_pm_ops), 499 499 .acpi_match_table = icn8505_acpi_match, 500 500 }, 501 501 .probe_new = icn8505_probe,
+5 -4
drivers/input/touchscreen/cy8ctma140.c
··· 296 296 return 0; 297 297 } 298 298 299 - static int __maybe_unused cy8ctma140_suspend(struct device *dev) 299 + static int cy8ctma140_suspend(struct device *dev) 300 300 { 301 301 struct i2c_client *client = to_i2c_client(dev); 302 302 struct cy8ctma140 *ts = i2c_get_clientdata(client); ··· 307 307 return 0; 308 308 } 309 309 310 - static int __maybe_unused cy8ctma140_resume(struct device *dev) 310 + static int cy8ctma140_resume(struct device *dev) 311 311 { 312 312 struct i2c_client *client = to_i2c_client(dev); 313 313 struct cy8ctma140 *ts = i2c_get_clientdata(client); ··· 322 322 return 0; 323 323 } 324 324 325 - static SIMPLE_DEV_PM_OPS(cy8ctma140_pm, cy8ctma140_suspend, cy8ctma140_resume); 325 + static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctma140_pm, 326 + cy8ctma140_suspend, cy8ctma140_resume); 326 327 327 328 static const struct i2c_device_id cy8ctma140_idtable[] = { 328 329 { CY8CTMA140_NAME, 0 }, ··· 340 339 static struct i2c_driver cy8ctma140_driver = { 341 340 .driver = { 342 341 .name = CY8CTMA140_NAME, 343 - .pm = &cy8ctma140_pm, 342 + .pm = pm_sleep_ptr(&cy8ctma140_pm), 344 343 .of_match_table = cy8ctma140_of_match, 345 344 }, 346 345 .id_table = cy8ctma140_idtable,
+5 -4
drivers/input/touchscreen/cy8ctmg110_ts.c
··· 237 237 return 0; 238 238 } 239 239 240 - static int __maybe_unused cy8ctmg110_suspend(struct device *dev) 240 + static int cy8ctmg110_suspend(struct device *dev) 241 241 { 242 242 struct i2c_client *client = to_i2c_client(dev); 243 243 struct cy8ctmg110 *ts = i2c_get_clientdata(client); ··· 250 250 return 0; 251 251 } 252 252 253 - static int __maybe_unused cy8ctmg110_resume(struct device *dev) 253 + static int cy8ctmg110_resume(struct device *dev) 254 254 { 255 255 struct i2c_client *client = to_i2c_client(dev); 256 256 struct cy8ctmg110 *ts = i2c_get_clientdata(client); ··· 263 263 return 0; 264 264 } 265 265 266 - static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); 266 + static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, 267 + cy8ctmg110_suspend, cy8ctmg110_resume); 267 268 268 269 static const struct i2c_device_id cy8ctmg110_idtable[] = { 269 270 { CY8CTMG110_DRIVER_NAME, 1 }, ··· 276 275 static struct i2c_driver cy8ctmg110_driver = { 277 276 .driver = { 278 277 .name = CY8CTMG110_DRIVER_NAME, 279 - .pm = &cy8ctmg110_pm, 278 + .pm = pm_sleep_ptr(&cy8ctmg110_pm), 280 279 }, 281 280 .id_table = cy8ctmg110_idtable, 282 281 .probe_new = cy8ctmg110_probe,
+2 -7
drivers/input/touchscreen/cyttsp4_core.c
··· 1744 1744 kfree(si->btn_rec_data); 1745 1745 } 1746 1746 1747 - #ifdef CONFIG_PM 1748 1747 static int cyttsp4_core_sleep(struct cyttsp4 *cd) 1749 1748 { 1750 1749 int rc; ··· 1876 1877 1877 1878 return 0; 1878 1879 } 1879 - #endif 1880 1880 1881 - const struct dev_pm_ops cyttsp4_pm_ops = { 1882 - SET_SYSTEM_SLEEP_PM_OPS(cyttsp4_core_suspend, cyttsp4_core_resume) 1883 - SET_RUNTIME_PM_OPS(cyttsp4_core_suspend, cyttsp4_core_resume, NULL) 1884 - }; 1885 - EXPORT_SYMBOL_GPL(cyttsp4_pm_ops); 1881 + EXPORT_GPL_RUNTIME_DEV_PM_OPS(cyttsp4_pm_ops, 1882 + cyttsp4_core_suspend, cyttsp4_core_resume, NULL); 1886 1883 1887 1884 static int cyttsp4_mt_open(struct input_dev *input) 1888 1885 {
+1 -1
drivers/input/touchscreen/cyttsp4_i2c.c
··· 58 58 static struct i2c_driver cyttsp4_i2c_driver = { 59 59 .driver = { 60 60 .name = CYTTSP4_I2C_NAME, 61 - .pm = &cyttsp4_pm_ops, 61 + .pm = pm_ptr(&cyttsp4_pm_ops), 62 62 }, 63 63 .probe_new = cyttsp4_i2c_probe, 64 64 .remove = cyttsp4_i2c_remove,
+1 -1
drivers/input/touchscreen/cyttsp4_spi.c
··· 173 173 static struct spi_driver cyttsp4_spi_driver = { 174 174 .driver = { 175 175 .name = CYTTSP4_SPI_NAME, 176 - .pm = &cyttsp4_pm_ops, 176 + .pm = pm_ptr(&cyttsp4_pm_ops), 177 177 }, 178 178 .probe = cyttsp4_spi_probe, 179 179 .remove = cyttsp4_spi_remove,
+1 -1
drivers/input/touchscreen/cyttsp5.c
··· 29 29 #define CY_MAX_INPUT 512 30 30 #define CYTTSP5_PREALLOCATED_CMD_BUFFER 32 31 31 #define CY_BITS_PER_BTN 1 32 - #define CY_NUM_BTN_EVENT_ID GENMASK(CY_BITS_PER_BTN, 0) 32 + #define CY_NUM_BTN_EVENT_ID GENMASK(CY_BITS_PER_BTN - 1, 0) 33 33 34 34 #define MAX_AREA 255 35 35 #define HID_OUTPUT_BL_SOP 0x1
+3 -4
drivers/input/touchscreen/cyttsp_core.c
··· 491 491 return 0; 492 492 } 493 493 494 - static int __maybe_unused cyttsp_suspend(struct device *dev) 494 + static int cyttsp_suspend(struct device *dev) 495 495 { 496 496 struct cyttsp *ts = dev_get_drvdata(dev); 497 497 int retval = 0; ··· 509 509 return retval; 510 510 } 511 511 512 - static int __maybe_unused cyttsp_resume(struct device *dev) 512 + static int cyttsp_resume(struct device *dev) 513 513 { 514 514 struct cyttsp *ts = dev_get_drvdata(dev); 515 515 ··· 525 525 return 0; 526 526 } 527 527 528 - SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume); 529 - EXPORT_SYMBOL_GPL(cyttsp_pm_ops); 528 + EXPORT_GPL_SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume); 530 529 531 530 static int cyttsp_open(struct input_dev *dev) 532 531 {
+1 -1
drivers/input/touchscreen/cyttsp_i2c.c
··· 63 63 static struct i2c_driver cyttsp_i2c_driver = { 64 64 .driver = { 65 65 .name = CY_I2C_NAME, 66 - .pm = &cyttsp_pm_ops, 66 + .pm = pm_sleep_ptr(&cyttsp_pm_ops), 67 67 .of_match_table = cyttsp_of_i2c_match, 68 68 }, 69 69 .probe_new = cyttsp_i2c_probe,
+1 -1
drivers/input/touchscreen/cyttsp_spi.c
··· 172 172 static struct spi_driver cyttsp_spi_driver = { 173 173 .driver = { 174 174 .name = CY_SPI_NAME, 175 - .pm = &cyttsp_pm_ops, 175 + .pm = pm_sleep_ptr(&cyttsp_pm_ops), 176 176 .of_match_table = cyttsp_of_spi_match, 177 177 }, 178 178 .probe = cyttsp_spi_probe,
+6 -6
drivers/input/touchscreen/edt-ft5x06.c
··· 931 931 } else { 932 932 /* If it is not an EDT M06/M12 touchscreen, then the model 933 933 * detection is a bit hairy. The different ft5x06 934 - * firmares around don't reliably implement the 934 + * firmwares around don't reliably implement the 935 935 * identification registers. Well, we'll take a shot. 936 936 * 937 937 * The main difference between generic focaltec based ··· 1353 1353 edt_ft5x06_ts_teardown_debugfs(tsdata); 1354 1354 } 1355 1355 1356 - static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev) 1356 + static int edt_ft5x06_ts_suspend(struct device *dev) 1357 1357 { 1358 1358 struct i2c_client *client = to_i2c_client(dev); 1359 1359 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); ··· 1396 1396 return 0; 1397 1397 } 1398 1398 1399 - static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev) 1399 + static int edt_ft5x06_ts_resume(struct device *dev) 1400 1400 { 1401 1401 struct i2c_client *client = to_i2c_client(dev); 1402 1402 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); ··· 1459 1459 return ret; 1460 1460 } 1461 1461 1462 - static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops, 1463 - edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume); 1462 + static DEFINE_SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops, 1463 + edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume); 1464 1464 1465 1465 static const struct edt_i2c_chip_data edt_ft5x06_data = { 1466 1466 .max_support_points = 5, ··· 1500 1500 .driver = { 1501 1501 .name = "edt_ft5x06", 1502 1502 .of_match_table = edt_ft5x06_of_match, 1503 - .pm = &edt_ft5x06_ts_pm_ops, 1503 + .pm = pm_sleep_ptr(&edt_ft5x06_ts_pm_ops), 1504 1504 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1505 1505 }, 1506 1506 .id_table = edt_ft5x06_ts_id,
+4 -4
drivers/input/touchscreen/eeti_ts.c
··· 232 232 return 0; 233 233 } 234 234 235 - static int __maybe_unused eeti_ts_suspend(struct device *dev) 235 + static int eeti_ts_suspend(struct device *dev) 236 236 { 237 237 struct i2c_client *client = to_i2c_client(dev); 238 238 struct eeti_ts *eeti = i2c_get_clientdata(client); ··· 251 251 return 0; 252 252 } 253 253 254 - static int __maybe_unused eeti_ts_resume(struct device *dev) 254 + static int eeti_ts_resume(struct device *dev) 255 255 { 256 256 struct i2c_client *client = to_i2c_client(dev); 257 257 struct eeti_ts *eeti = i2c_get_clientdata(client); ··· 270 270 return 0; 271 271 } 272 272 273 - static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume); 273 + static DEFINE_SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume); 274 274 275 275 static const struct i2c_device_id eeti_ts_id[] = { 276 276 { "eeti_ts", 0 }, ··· 288 288 static struct i2c_driver eeti_ts_driver = { 289 289 .driver = { 290 290 .name = "eeti_ts", 291 - .pm = &eeti_ts_pm, 291 + .pm = pm_sleep_ptr(&eeti_ts_pm), 292 292 .of_match_table = of_match_ptr(of_eeti_ts_match), 293 293 }, 294 294 .probe_new = eeti_ts_probe,
+5 -4
drivers/input/touchscreen/egalax_ts.c
··· 223 223 }; 224 224 MODULE_DEVICE_TABLE(i2c, egalax_ts_id); 225 225 226 - static int __maybe_unused egalax_ts_suspend(struct device *dev) 226 + static int egalax_ts_suspend(struct device *dev) 227 227 { 228 228 static const u8 suspend_cmd[MAX_I2C_DATA_LEN] = { 229 229 0x3, 0x6, 0xa, 0x3, 0x36, 0x3f, 0x2, 0, 0, 0 ··· 238 238 return ret > 0 ? 0 : ret; 239 239 } 240 240 241 - static int __maybe_unused egalax_ts_resume(struct device *dev) 241 + static int egalax_ts_resume(struct device *dev) 242 242 { 243 243 struct i2c_client *client = to_i2c_client(dev); 244 244 ··· 248 248 return egalax_wake_up_device(client); 249 249 } 250 250 251 - static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume); 251 + static DEFINE_SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, 252 + egalax_ts_suspend, egalax_ts_resume); 252 253 253 254 static const struct of_device_id egalax_ts_dt_ids[] = { 254 255 { .compatible = "eeti,egalax_ts" }, ··· 260 259 static struct i2c_driver egalax_ts_driver = { 261 260 .driver = { 262 261 .name = "egalax_ts", 263 - .pm = &egalax_ts_pm_ops, 262 + .pm = pm_sleep_ptr(&egalax_ts_pm_ops), 264 263 .of_match_table = egalax_ts_dt_ids, 265 264 }, 266 265 .id_table = egalax_ts_id,
+5 -5
drivers/input/touchscreen/ektf2127.c
··· 177 177 gpiod_set_value_cansleep(ts->power_gpios, 0); 178 178 } 179 179 180 - static int __maybe_unused ektf2127_suspend(struct device *dev) 180 + static int ektf2127_suspend(struct device *dev) 181 181 { 182 182 struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev)); 183 183 ··· 189 189 return 0; 190 190 } 191 191 192 - static int __maybe_unused ektf2127_resume(struct device *dev) 192 + static int ektf2127_resume(struct device *dev) 193 193 { 194 194 struct ektf2127_ts *ts = i2c_get_clientdata(to_i2c_client(dev)); 195 195 ··· 201 201 return 0; 202 202 } 203 203 204 - static SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend, 205 - ektf2127_resume); 204 + static DEFINE_SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend, 205 + ektf2127_resume); 206 206 207 207 static int ektf2127_query_dimension(struct i2c_client *client, bool width) 208 208 { ··· 348 348 static struct i2c_driver ektf2127_driver = { 349 349 .driver = { 350 350 .name = "elan_ektf2127", 351 - .pm = &ektf2127_pm_ops, 351 + .pm = pm_sleep_ptr(&ektf2127_pm_ops), 352 352 .of_match_table = of_match_ptr(ektf2127_of_match), 353 353 }, 354 354 .probe_new = ektf2127_probe,
+5 -5
drivers/input/touchscreen/elants_i2c.c
··· 1572 1572 return 0; 1573 1573 } 1574 1574 1575 - static int __maybe_unused elants_i2c_suspend(struct device *dev) 1575 + static int elants_i2c_suspend(struct device *dev) 1576 1576 { 1577 1577 struct i2c_client *client = to_i2c_client(dev); 1578 1578 struct elants_data *ts = i2c_get_clientdata(client); ··· 1611 1611 return 0; 1612 1612 } 1613 1613 1614 - static int __maybe_unused elants_i2c_resume(struct device *dev) 1614 + static int elants_i2c_resume(struct device *dev) 1615 1615 { 1616 1616 struct i2c_client *client = to_i2c_client(dev); 1617 1617 struct elants_data *ts = i2c_get_clientdata(client); ··· 1644 1644 return 0; 1645 1645 } 1646 1646 1647 - static SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops, 1648 - elants_i2c_suspend, elants_i2c_resume); 1647 + static DEFINE_SIMPLE_DEV_PM_OPS(elants_i2c_pm_ops, 1648 + elants_i2c_suspend, elants_i2c_resume); 1649 1649 1650 1650 static const struct i2c_device_id elants_i2c_id[] = { 1651 1651 { DEVICE_NAME, EKTH3500 }, ··· 1677 1677 .id_table = elants_i2c_id, 1678 1678 .driver = { 1679 1679 .name = DEVICE_NAME, 1680 - .pm = &elants_i2c_pm_ops, 1680 + .pm = pm_sleep_ptr(&elants_i2c_pm_ops), 1681 1681 .acpi_match_table = ACPI_PTR(elants_acpi_id), 1682 1682 .of_match_table = of_match_ptr(elants_of_match), 1683 1683 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+10
drivers/input/touchscreen/exc3000.c
··· 109 109 mod_timer(&data->timer, jiffies + msecs_to_jiffies(EXC3000_TIMEOUT_MS)); 110 110 } 111 111 112 + static void exc3000_shutdown_timer(void *timer) 113 + { 114 + timer_shutdown_sync(timer); 115 + } 116 + 112 117 static int exc3000_read_frame(struct exc3000_data *data, u8 *buf) 113 118 { 114 119 struct i2c_client *client = data->client; ··· 388 383 return error; 389 384 390 385 error = input_register_device(input); 386 + if (error) 387 + return error; 388 + 389 + error = devm_add_action_or_reset(&client->dev, exc3000_shutdown_timer, 390 + &data->timer); 391 391 if (error) 392 392 return error; 393 393
+4 -4
drivers/input/touchscreen/goodix.c
··· 1401 1401 wait_for_completion(&ts->firmware_loading_complete); 1402 1402 } 1403 1403 1404 - static int __maybe_unused goodix_suspend(struct device *dev) 1404 + static int goodix_suspend(struct device *dev) 1405 1405 { 1406 1406 struct i2c_client *client = to_i2c_client(dev); 1407 1407 struct goodix_ts_data *ts = i2c_get_clientdata(client); ··· 1448 1448 return 0; 1449 1449 } 1450 1450 1451 - static int __maybe_unused goodix_resume(struct device *dev) 1451 + static int goodix_resume(struct device *dev) 1452 1452 { 1453 1453 struct i2c_client *client = to_i2c_client(dev); 1454 1454 struct goodix_ts_data *ts = i2c_get_clientdata(client); ··· 1497 1497 return 0; 1498 1498 } 1499 1499 1500 - static SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); 1500 + static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume); 1501 1501 1502 1502 static const struct i2c_device_id goodix_ts_id[] = { 1503 1503 { "GDIX1001:00", 0 }, ··· 1543 1543 .name = "Goodix-TS", 1544 1544 .acpi_match_table = ACPI_PTR(goodix_acpi_match), 1545 1545 .of_match_table = of_match_ptr(goodix_of_match), 1546 - .pm = &goodix_pm_ops, 1546 + .pm = pm_sleep_ptr(&goodix_pm_ops), 1547 1547 }, 1548 1548 }; 1549 1549 module_i2c_driver(goodix_ts_driver);
+4 -4
drivers/input/touchscreen/hideep.c
··· 959 959 .attrs = hideep_ts_sysfs_entries, 960 960 }; 961 961 962 - static int __maybe_unused hideep_suspend(struct device *dev) 962 + static int hideep_suspend(struct device *dev) 963 963 { 964 964 struct i2c_client *client = to_i2c_client(dev); 965 965 struct hideep_ts *ts = i2c_get_clientdata(client); ··· 970 970 return 0; 971 971 } 972 972 973 - static int __maybe_unused hideep_resume(struct device *dev) 973 + static int hideep_resume(struct device *dev) 974 974 { 975 975 struct i2c_client *client = to_i2c_client(dev); 976 976 struct hideep_ts *ts = i2c_get_clientdata(client); ··· 987 987 return 0; 988 988 } 989 989 990 - static SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); 990 + static DEFINE_SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); 991 991 992 992 static const struct regmap_config hideep_regmap_config = { 993 993 .reg_bits = 16, ··· 1108 1108 .name = HIDEEP_I2C_NAME, 1109 1109 .of_match_table = of_match_ptr(hideep_match_table), 1110 1110 .acpi_match_table = ACPI_PTR(hideep_acpi_id), 1111 - .pm = &hideep_pm_ops, 1111 + .pm = pm_sleep_ptr(&hideep_pm_ops), 1112 1112 }, 1113 1113 .id_table = hideep_i2c_id, 1114 1114 .probe_new = hideep_probe,
+4 -4
drivers/input/touchscreen/ilitek_ts_i2c.c
··· 604 604 return 0; 605 605 } 606 606 607 - static int __maybe_unused ilitek_suspend(struct device *dev) 607 + static int ilitek_suspend(struct device *dev) 608 608 { 609 609 struct i2c_client *client = to_i2c_client(dev); 610 610 struct ilitek_ts_data *ts = i2c_get_clientdata(client); ··· 621 621 return 0; 622 622 } 623 623 624 - static int __maybe_unused ilitek_resume(struct device *dev) 624 + static int ilitek_resume(struct device *dev) 625 625 { 626 626 struct i2c_client *client = to_i2c_client(dev); 627 627 struct ilitek_ts_data *ts = i2c_get_clientdata(client); ··· 640 640 return 0; 641 641 } 642 642 643 - static SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); 643 + static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); 644 644 645 645 static const struct i2c_device_id ilitek_ts_i2c_id[] = { 646 646 { ILITEK_TS_NAME, 0 }, ··· 675 675 static struct i2c_driver ilitek_ts_i2c_driver = { 676 676 .driver = { 677 677 .name = ILITEK_TS_NAME, 678 - .pm = &ilitek_pm_ops, 678 + .pm = pm_sleep_ptr(&ilitek_pm_ops), 679 679 .of_match_table = of_match_ptr(ilitek_ts_i2c_match), 680 680 .acpi_match_table = ACPI_PTR(ilitekts_acpi_id), 681 681 },
+4 -4
drivers/input/touchscreen/imagis.c
··· 309 309 return 0; 310 310 } 311 311 312 - static int __maybe_unused imagis_suspend(struct device *dev) 312 + static int imagis_suspend(struct device *dev) 313 313 { 314 314 struct i2c_client *client = to_i2c_client(dev); 315 315 struct imagis_ts *ts = i2c_get_clientdata(client); ··· 325 325 return retval; 326 326 } 327 327 328 - static int __maybe_unused imagis_resume(struct device *dev) 328 + static int imagis_resume(struct device *dev) 329 329 { 330 330 struct i2c_client *client = to_i2c_client(dev); 331 331 struct imagis_ts *ts = i2c_get_clientdata(client); ··· 341 341 return retval; 342 342 } 343 343 344 - static SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); 344 + static DEFINE_SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); 345 345 346 346 #ifdef CONFIG_OF 347 347 static const struct of_device_id imagis_of_match[] = { ··· 354 354 static struct i2c_driver imagis_ts_driver = { 355 355 .driver = { 356 356 .name = "imagis-touchscreen", 357 - .pm = &imagis_pm_ops, 357 + .pm = pm_sleep_ptr(&imagis_pm_ops), 358 358 .of_match_table = of_match_ptr(imagis_of_match), 359 359 }, 360 360 .probe_new = imagis_probe,
+5 -5
drivers/input/touchscreen/imx6ul_tsc.c
··· 512 512 return 0; 513 513 } 514 514 515 - static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) 515 + static int imx6ul_tsc_suspend(struct device *dev) 516 516 { 517 517 struct platform_device *pdev = to_platform_device(dev); 518 518 struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); ··· 528 528 return 0; 529 529 } 530 530 531 - static int __maybe_unused imx6ul_tsc_resume(struct device *dev) 531 + static int imx6ul_tsc_resume(struct device *dev) 532 532 { 533 533 struct platform_device *pdev = to_platform_device(dev); 534 534 struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); ··· 545 545 return retval; 546 546 } 547 547 548 - static SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, 549 - imx6ul_tsc_suspend, imx6ul_tsc_resume); 548 + static DEFINE_SIMPLE_DEV_PM_OPS(imx6ul_tsc_pm_ops, 549 + imx6ul_tsc_suspend, imx6ul_tsc_resume); 550 550 551 551 static const struct of_device_id imx6ul_tsc_match[] = { 552 552 { .compatible = "fsl,imx6ul-tsc", }, ··· 558 558 .driver = { 559 559 .name = "imx6ul-tsc", 560 560 .of_match_table = imx6ul_tsc_match, 561 - .pm = &imx6ul_tsc_pm_ops, 561 + .pm = pm_sleep_ptr(&imx6ul_tsc_pm_ops), 562 562 }, 563 563 .probe = imx6ul_tsc_probe, 564 564 };
+5 -6
drivers/input/touchscreen/ipaq-micro-ts.c
··· 119 119 return 0; 120 120 } 121 121 122 - static int __maybe_unused micro_ts_suspend(struct device *dev) 122 + static int micro_ts_suspend(struct device *dev) 123 123 { 124 124 struct touchscreen_data *ts = dev_get_drvdata(dev); 125 125 ··· 128 128 return 0; 129 129 } 130 130 131 - static int __maybe_unused micro_ts_resume(struct device *dev) 131 + static int micro_ts_resume(struct device *dev) 132 132 { 133 133 struct touchscreen_data *ts = dev_get_drvdata(dev); 134 134 struct input_dev *input = ts->input; ··· 143 143 return 0; 144 144 } 145 145 146 - static const struct dev_pm_ops micro_ts_dev_pm_ops = { 147 - SET_SYSTEM_SLEEP_PM_OPS(micro_ts_suspend, micro_ts_resume) 148 - }; 146 + static DEFINE_SIMPLE_DEV_PM_OPS(micro_ts_dev_pm_ops, 147 + micro_ts_suspend, micro_ts_resume); 149 148 150 149 static struct platform_driver micro_ts_device_driver = { 151 150 .driver = { 152 151 .name = "ipaq-micro-ts", 153 - .pm = &micro_ts_dev_pm_ops, 152 + .pm = pm_sleep_ptr(&micro_ts_dev_pm_ops), 154 153 }, 155 154 .probe = micro_ts_probe, 156 155 };
+4 -4
drivers/input/touchscreen/iqs5xx.c
··· 979 979 .attrs = iqs5xx_attrs, 980 980 }; 981 981 982 - static int __maybe_unused iqs5xx_suspend(struct device *dev) 982 + static int iqs5xx_suspend(struct device *dev) 983 983 { 984 984 struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); 985 985 struct input_dev *input = iqs5xx->input; ··· 998 998 return error; 999 999 } 1000 1000 1001 - static int __maybe_unused iqs5xx_resume(struct device *dev) 1001 + static int iqs5xx_resume(struct device *dev) 1002 1002 { 1003 1003 struct iqs5xx_private *iqs5xx = dev_get_drvdata(dev); 1004 1004 struct input_dev *input = iqs5xx->input; ··· 1017 1017 return error; 1018 1018 } 1019 1019 1020 - static SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); 1020 + static DEFINE_SIMPLE_DEV_PM_OPS(iqs5xx_pm, iqs5xx_suspend, iqs5xx_resume); 1021 1021 1022 1022 static int iqs5xx_probe(struct i2c_client *client) 1023 1023 { ··· 1090 1090 .driver = { 1091 1091 .name = "iqs5xx", 1092 1092 .of_match_table = iqs5xx_of_match, 1093 - .pm = &iqs5xx_pm, 1093 + .pm = pm_sleep_ptr(&iqs5xx_pm), 1094 1094 }, 1095 1095 .id_table = iqs5xx_id, 1096 1096 .probe_new = iqs5xx_probe,
+5 -4
drivers/input/touchscreen/mcs5000_ts.c
··· 241 241 return 0; 242 242 } 243 243 244 - static int __maybe_unused mcs5000_ts_suspend(struct device *dev) 244 + static int mcs5000_ts_suspend(struct device *dev) 245 245 { 246 246 struct i2c_client *client = to_i2c_client(dev); 247 247 ··· 251 251 return 0; 252 252 } 253 253 254 - static int __maybe_unused mcs5000_ts_resume(struct device *dev) 254 + static int mcs5000_ts_resume(struct device *dev) 255 255 { 256 256 struct i2c_client *client = to_i2c_client(dev); 257 257 struct mcs5000_ts_data *data = i2c_get_clientdata(client); ··· 262 262 return 0; 263 263 } 264 264 265 - static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume); 265 + static DEFINE_SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, 266 + mcs5000_ts_suspend, mcs5000_ts_resume); 266 267 267 268 static const struct i2c_device_id mcs5000_ts_id[] = { 268 269 { "mcs5000_ts", 0 }, ··· 275 274 .probe_new = mcs5000_ts_probe, 276 275 .driver = { 277 276 .name = "mcs5000_ts", 278 - .pm = &mcs5000_ts_pm, 277 + .pm = pm_sleep_ptr(&mcs5000_ts_pm), 279 278 }, 280 279 .id_table = mcs5000_ts_id, 281 280 };
+4 -4
drivers/input/touchscreen/melfas_mip4.c
··· 1528 1528 return 0; 1529 1529 } 1530 1530 1531 - static int __maybe_unused mip4_suspend(struct device *dev) 1531 + static int mip4_suspend(struct device *dev) 1532 1532 { 1533 1533 struct i2c_client *client = to_i2c_client(dev); 1534 1534 struct mip4_ts *ts = i2c_get_clientdata(client); ··· 1546 1546 return 0; 1547 1547 } 1548 1548 1549 - static int __maybe_unused mip4_resume(struct device *dev) 1549 + static int mip4_resume(struct device *dev) 1550 1550 { 1551 1551 struct i2c_client *client = to_i2c_client(dev); 1552 1552 struct mip4_ts *ts = i2c_get_clientdata(client); ··· 1564 1564 return 0; 1565 1565 } 1566 1566 1567 - static SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume); 1567 + static DEFINE_SIMPLE_DEV_PM_OPS(mip4_pm_ops, mip4_suspend, mip4_resume); 1568 1568 1569 1569 #ifdef CONFIG_OF 1570 1570 static const struct of_device_id mip4_of_match[] = { ··· 1595 1595 .name = MIP4_DEVICE_NAME, 1596 1596 .of_match_table = of_match_ptr(mip4_of_match), 1597 1597 .acpi_match_table = ACPI_PTR(mip4_acpi_match), 1598 - .pm = &mip4_pm_ops, 1598 + .pm = pm_sleep_ptr(&mip4_pm_ops), 1599 1599 }, 1600 1600 }; 1601 1601 module_i2c_driver(mip4_driver);
+4 -4
drivers/input/touchscreen/migor_ts.c
··· 186 186 dev_set_drvdata(&client->dev, NULL); 187 187 } 188 188 189 - static int __maybe_unused migor_ts_suspend(struct device *dev) 189 + static int migor_ts_suspend(struct device *dev) 190 190 { 191 191 struct i2c_client *client = to_i2c_client(dev); 192 192 struct migor_ts_priv *priv = i2c_get_clientdata(client); ··· 197 197 return 0; 198 198 } 199 199 200 - static int __maybe_unused migor_ts_resume(struct device *dev) 200 + static int migor_ts_resume(struct device *dev) 201 201 { 202 202 struct i2c_client *client = to_i2c_client(dev); 203 203 struct migor_ts_priv *priv = i2c_get_clientdata(client); ··· 208 208 return 0; 209 209 } 210 210 211 - static SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); 211 + static DEFINE_SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); 212 212 213 213 static const struct i2c_device_id migor_ts_id[] = { 214 214 { "migor_ts", 0 }, ··· 219 219 static struct i2c_driver migor_ts_driver = { 220 220 .driver = { 221 221 .name = "migor_ts", 222 - .pm = &migor_ts_pm, 222 + .pm = pm_sleep_ptr(&migor_ts_pm), 223 223 }, 224 224 .probe_new = migor_ts_probe, 225 225 .remove = migor_ts_remove,
+4 -4
drivers/input/touchscreen/mms114.c
··· 557 557 return 0; 558 558 } 559 559 560 - static int __maybe_unused mms114_suspend(struct device *dev) 560 + static int mms114_suspend(struct device *dev) 561 561 { 562 562 struct i2c_client *client = to_i2c_client(dev); 563 563 struct mms114_data *data = i2c_get_clientdata(client); ··· 581 581 return 0; 582 582 } 583 583 584 - static int __maybe_unused mms114_resume(struct device *dev) 584 + static int mms114_resume(struct device *dev) 585 585 { 586 586 struct i2c_client *client = to_i2c_client(dev); 587 587 struct mms114_data *data = i2c_get_clientdata(client); ··· 601 601 return 0; 602 602 } 603 603 604 - static SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume); 604 + static DEFINE_SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume); 605 605 606 606 static const struct i2c_device_id mms114_id[] = { 607 607 { "mms114", 0 }, ··· 635 635 static struct i2c_driver mms114_driver = { 636 636 .driver = { 637 637 .name = "mms114", 638 - .pm = &mms114_pm_ops, 638 + .pm = pm_sleep_ptr(&mms114_pm_ops), 639 639 .of_match_table = of_match_ptr(mms114_dt_match), 640 640 }, 641 641 .probe_new = mms114_probe,
+4 -4
drivers/input/touchscreen/msg2638.c
··· 441 441 return 0; 442 442 } 443 443 444 - static int __maybe_unused msg2638_suspend(struct device *dev) 444 + static int msg2638_suspend(struct device *dev) 445 445 { 446 446 struct i2c_client *client = to_i2c_client(dev); 447 447 struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); ··· 456 456 return 0; 457 457 } 458 458 459 - static int __maybe_unused msg2638_resume(struct device *dev) 459 + static int msg2638_resume(struct device *dev) 460 460 { 461 461 struct i2c_client *client = to_i2c_client(dev); 462 462 struct msg2638_ts_data *msg2638 = i2c_get_clientdata(client); ··· 472 472 return ret; 473 473 } 474 474 475 - static SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); 475 + static DEFINE_SIMPLE_DEV_PM_OPS(msg2638_pm_ops, msg2638_suspend, msg2638_resume); 476 476 477 477 static const struct msg_chip_data msg2138_data = { 478 478 .irq_handler = msg2138_ts_irq_handler, ··· 495 495 .probe_new = msg2638_ts_probe, 496 496 .driver = { 497 497 .name = "MStar-TS", 498 - .pm = &msg2638_pm_ops, 498 + .pm = pm_sleep_ptr(&msg2638_pm_ops), 499 499 .of_match_table = msg2638_of_match, 500 500 }, 501 501 };
+5 -5
drivers/input/touchscreen/pixcir_i2c_ts.c
··· 405 405 pixcir_stop(ts); 406 406 } 407 407 408 - static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev) 408 + static int pixcir_i2c_ts_suspend(struct device *dev) 409 409 { 410 410 struct i2c_client *client = to_i2c_client(dev); 411 411 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); ··· 432 432 return ret; 433 433 } 434 434 435 - static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev) 435 + static int pixcir_i2c_ts_resume(struct device *dev) 436 436 { 437 437 struct i2c_client *client = to_i2c_client(dev); 438 438 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); ··· 459 459 return ret; 460 460 } 461 461 462 - static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, 463 - pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); 462 + static DEFINE_SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops, 463 + pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume); 464 464 465 465 static int pixcir_i2c_ts_probe(struct i2c_client *client) 466 466 { ··· 614 614 static struct i2c_driver pixcir_i2c_ts_driver = { 615 615 .driver = { 616 616 .name = "pixcir_ts", 617 - .pm = &pixcir_dev_pm_ops, 617 + .pm = pm_sleep_ptr(&pixcir_dev_pm_ops), 618 618 .of_match_table = of_match_ptr(pixcir_of_match), 619 619 }, 620 620 .probe_new = pixcir_i2c_ts_probe,
+6 -6
drivers/input/touchscreen/raydium_i2c_ts.c
··· 1197 1197 return 0; 1198 1198 } 1199 1199 1200 - static void __maybe_unused raydium_enter_sleep(struct i2c_client *client) 1200 + static void raydium_enter_sleep(struct i2c_client *client) 1201 1201 { 1202 1202 static const u8 sleep_cmd[] = { 0x5A, 0xff, 0x00, 0x0f }; 1203 1203 int error; ··· 1209 1209 "sleep command failed: %d\n", error); 1210 1210 } 1211 1211 1212 - static int __maybe_unused raydium_i2c_suspend(struct device *dev) 1212 + static int raydium_i2c_suspend(struct device *dev) 1213 1213 { 1214 1214 struct i2c_client *client = to_i2c_client(dev); 1215 1215 struct raydium_data *ts = i2c_get_clientdata(client); ··· 1229 1229 return 0; 1230 1230 } 1231 1231 1232 - static int __maybe_unused raydium_i2c_resume(struct device *dev) 1232 + static int raydium_i2c_resume(struct device *dev) 1233 1233 { 1234 1234 struct i2c_client *client = to_i2c_client(dev); 1235 1235 struct raydium_data *ts = i2c_get_clientdata(client); ··· 1246 1246 return 0; 1247 1247 } 1248 1248 1249 - static SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops, 1250 - raydium_i2c_suspend, raydium_i2c_resume); 1249 + static DEFINE_SIMPLE_DEV_PM_OPS(raydium_i2c_pm_ops, 1250 + raydium_i2c_suspend, raydium_i2c_resume); 1251 1251 1252 1252 static const struct i2c_device_id raydium_i2c_id[] = { 1253 1253 { "raydium_i2c", 0 }, ··· 1277 1277 .id_table = raydium_i2c_id, 1278 1278 .driver = { 1279 1279 .name = "raydium_ts", 1280 - .pm = &raydium_i2c_pm_ops, 1280 + .pm = pm_sleep_ptr(&raydium_i2c_pm_ops), 1281 1281 .acpi_match_table = ACPI_PTR(raydium_acpi_id), 1282 1282 .of_match_table = of_match_ptr(raydium_of_match), 1283 1283 },
+7 -8
drivers/input/touchscreen/s6sy761.c
··· 479 479 pm_runtime_disable(&client->dev); 480 480 } 481 481 482 - static int __maybe_unused s6sy761_runtime_suspend(struct device *dev) 482 + static int s6sy761_runtime_suspend(struct device *dev) 483 483 { 484 484 struct s6sy761_data *sdata = dev_get_drvdata(dev); 485 485 ··· 487 487 S6SY761_APPLICATION_MODE, S6SY761_APP_SLEEP); 488 488 } 489 489 490 - static int __maybe_unused s6sy761_runtime_resume(struct device *dev) 490 + static int s6sy761_runtime_resume(struct device *dev) 491 491 { 492 492 struct s6sy761_data *sdata = dev_get_drvdata(dev); 493 493 ··· 495 495 S6SY761_APPLICATION_MODE, S6SY761_APP_NORMAL); 496 496 } 497 497 498 - static int __maybe_unused s6sy761_suspend(struct device *dev) 498 + static int s6sy761_suspend(struct device *dev) 499 499 { 500 500 struct s6sy761_data *sdata = dev_get_drvdata(dev); 501 501 ··· 504 504 return 0; 505 505 } 506 506 507 - static int __maybe_unused s6sy761_resume(struct device *dev) 507 + static int s6sy761_resume(struct device *dev) 508 508 { 509 509 struct s6sy761_data *sdata = dev_get_drvdata(dev); 510 510 ··· 514 514 } 515 515 516 516 static const struct dev_pm_ops s6sy761_pm_ops = { 517 - SET_SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume) 518 - SET_RUNTIME_PM_OPS(s6sy761_runtime_suspend, 519 - s6sy761_runtime_resume, NULL) 517 + SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume) 518 + RUNTIME_PM_OPS(s6sy761_runtime_suspend, s6sy761_runtime_resume, NULL) 520 519 }; 521 520 522 521 #ifdef CONFIG_OF ··· 536 537 .driver = { 537 538 .name = S6SY761_DEV_NAME, 538 539 .of_match_table = of_match_ptr(s6sy761_of_match), 539 - .pm = &s6sy761_pm_ops, 540 + .pm = pm_ptr(&s6sy761_pm_ops), 540 541 }, 541 542 .probe_new = s6sy761_probe, 542 543 .remove = s6sy761_remove,
+4 -4
drivers/input/touchscreen/silead.c
··· 736 736 return 0; 737 737 } 738 738 739 - static int __maybe_unused silead_ts_suspend(struct device *dev) 739 + static int silead_ts_suspend(struct device *dev) 740 740 { 741 741 struct i2c_client *client = to_i2c_client(dev); 742 742 ··· 745 745 return 0; 746 746 } 747 747 748 - static int __maybe_unused silead_ts_resume(struct device *dev) 748 + static int silead_ts_resume(struct device *dev) 749 749 { 750 750 struct i2c_client *client = to_i2c_client(dev); 751 751 bool second_try = false; ··· 784 784 return 0; 785 785 } 786 786 787 - static SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume); 787 + static DEFINE_SIMPLE_DEV_PM_OPS(silead_ts_pm, silead_ts_suspend, silead_ts_resume); 788 788 789 789 static const struct i2c_device_id silead_ts_id[] = { 790 790 { "gsl1680", 0 }, ··· 832 832 .name = SILEAD_TS_NAME, 833 833 .acpi_match_table = ACPI_PTR(silead_ts_acpi_match), 834 834 .of_match_table = of_match_ptr(silead_ts_of_match), 835 - .pm = &silead_ts_pm, 835 + .pm = pm_sleep_ptr(&silead_ts_pm), 836 836 }, 837 837 }; 838 838 module_i2c_driver(silead_ts_driver);
+5 -5
drivers/input/touchscreen/st1232.c
··· 340 340 return 0; 341 341 } 342 342 343 - static int __maybe_unused st1232_ts_suspend(struct device *dev) 343 + static int st1232_ts_suspend(struct device *dev) 344 344 { 345 345 struct i2c_client *client = to_i2c_client(dev); 346 346 struct st1232_ts_data *ts = i2c_get_clientdata(client); ··· 353 353 return 0; 354 354 } 355 355 356 - static int __maybe_unused st1232_ts_resume(struct device *dev) 356 + static int st1232_ts_resume(struct device *dev) 357 357 { 358 358 struct i2c_client *client = to_i2c_client(dev); 359 359 struct st1232_ts_data *ts = i2c_get_clientdata(client); ··· 366 366 return 0; 367 367 } 368 368 369 - static SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops, 370 - st1232_ts_suspend, st1232_ts_resume); 369 + static DEFINE_SIMPLE_DEV_PM_OPS(st1232_ts_pm_ops, 370 + st1232_ts_suspend, st1232_ts_resume); 371 371 372 372 static const struct i2c_device_id st1232_ts_id[] = { 373 373 { ST1232_TS_NAME, (unsigned long)&st1232_chip_info }, ··· 390 390 .name = ST1232_TS_NAME, 391 391 .of_match_table = st1232_ts_dt_ids, 392 392 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 393 - .pm = &st1232_ts_pm_ops, 393 + .pm = pm_sleep_ptr(&st1232_ts_pm_ops), 394 394 }, 395 395 }; 396 396
+7 -7
drivers/input/touchscreen/stmfts.c
··· 742 742 pm_runtime_disable(&client->dev); 743 743 } 744 744 745 - static int __maybe_unused stmfts_runtime_suspend(struct device *dev) 745 + static int stmfts_runtime_suspend(struct device *dev) 746 746 { 747 747 struct stmfts_data *sdata = dev_get_drvdata(dev); 748 748 int ret; ··· 754 754 return ret; 755 755 } 756 756 757 - static int __maybe_unused stmfts_runtime_resume(struct device *dev) 757 + static int stmfts_runtime_resume(struct device *dev) 758 758 { 759 759 struct stmfts_data *sdata = dev_get_drvdata(dev); 760 760 int ret; ··· 766 766 return ret; 767 767 } 768 768 769 - static int __maybe_unused stmfts_suspend(struct device *dev) 769 + static int stmfts_suspend(struct device *dev) 770 770 { 771 771 struct stmfts_data *sdata = dev_get_drvdata(dev); 772 772 ··· 775 775 return 0; 776 776 } 777 777 778 - static int __maybe_unused stmfts_resume(struct device *dev) 778 + static int stmfts_resume(struct device *dev) 779 779 { 780 780 struct stmfts_data *sdata = dev_get_drvdata(dev); 781 781 ··· 783 783 } 784 784 785 785 static const struct dev_pm_ops stmfts_pm_ops = { 786 - SET_SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume) 787 - SET_RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL) 786 + SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume) 787 + RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL) 788 788 }; 789 789 790 790 #ifdef CONFIG_OF ··· 805 805 .driver = { 806 806 .name = STMFTS_DEV_NAME, 807 807 .of_match_table = of_match_ptr(stmfts_of_match), 808 - .pm = &stmfts_pm_ops, 808 + .pm = pm_ptr(&stmfts_pm_ops), 809 809 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 810 810 }, 811 811 .probe_new = stmfts_probe,
+6 -6
drivers/input/touchscreen/surface3_spi.c
··· 369 369 return 0; 370 370 } 371 371 372 - static int __maybe_unused surface3_spi_suspend(struct device *dev) 372 + static int surface3_spi_suspend(struct device *dev) 373 373 { 374 374 struct spi_device *spi = to_spi_device(dev); 375 375 struct surface3_ts_data *data = spi_get_drvdata(spi); ··· 381 381 return 0; 382 382 } 383 383 384 - static int __maybe_unused surface3_spi_resume(struct device *dev) 384 + static int surface3_spi_resume(struct device *dev) 385 385 { 386 386 struct spi_device *spi = to_spi_device(dev); 387 387 struct surface3_ts_data *data = spi_get_drvdata(spi); ··· 393 393 return 0; 394 394 } 395 395 396 - static SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, 397 - surface3_spi_suspend, 398 - surface3_spi_resume); 396 + static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, 397 + surface3_spi_suspend, 398 + surface3_spi_resume); 399 399 400 400 #ifdef CONFIG_ACPI 401 401 static const struct acpi_device_id surface3_spi_acpi_match[] = { ··· 409 409 .driver = { 410 410 .name = "Surface3-spi", 411 411 .acpi_match_table = ACPI_PTR(surface3_spi_acpi_match), 412 - .pm = &surface3_spi_pm_ops, 412 + .pm = pm_sleep_ptr(&surface3_spi_pm_ops), 413 413 }, 414 414 .probe = surface3_spi_probe, 415 415 };
+4 -4
drivers/input/touchscreen/ti_am335x_tsc.c
··· 512 512 return 0; 513 513 } 514 514 515 - static int __maybe_unused titsc_suspend(struct device *dev) 515 + static int titsc_suspend(struct device *dev) 516 516 { 517 517 struct titsc *ts_dev = dev_get_drvdata(dev); 518 518 unsigned int idle; ··· 527 527 return 0; 528 528 } 529 529 530 - static int __maybe_unused titsc_resume(struct device *dev) 530 + static int titsc_resume(struct device *dev) 531 531 { 532 532 struct titsc *ts_dev = dev_get_drvdata(dev); 533 533 ··· 543 543 return 0; 544 544 } 545 545 546 - static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); 546 + static DEFINE_SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); 547 547 548 548 static const struct of_device_id ti_tsc_dt_ids[] = { 549 549 { .compatible = "ti,am3359-tsc", }, ··· 556 556 .remove = titsc_remove, 557 557 .driver = { 558 558 .name = "TI-am335x-tsc", 559 - .pm = &titsc_pm_ops, 559 + .pm = pm_sleep_ptr(&titsc_pm_ops), 560 560 .of_match_table = ti_tsc_dt_ids, 561 561 }, 562 562 };
+1 -1
drivers/input/touchscreen/tsc2004.c
··· 65 65 .driver = { 66 66 .name = "tsc2004", 67 67 .of_match_table = of_match_ptr(tsc2004_of_match), 68 - .pm = &tsc200x_pm_ops, 68 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 69 69 }, 70 70 .id_table = tsc2004_idtable, 71 71 .probe_new = tsc2004_probe,
+1 -1
drivers/input/touchscreen/tsc2005.c
··· 81 81 .driver = { 82 82 .name = "tsc2005", 83 83 .of_match_table = of_match_ptr(tsc2005_of_match), 84 - .pm = &tsc200x_pm_ops, 84 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 85 85 }, 86 86 .probe = tsc2005_probe, 87 87 .remove = tsc2005_remove,
+3 -4
drivers/input/touchscreen/tsc200x-core.c
··· 588 588 } 589 589 EXPORT_SYMBOL_GPL(tsc200x_remove); 590 590 591 - static int __maybe_unused tsc200x_suspend(struct device *dev) 591 + static int tsc200x_suspend(struct device *dev) 592 592 { 593 593 struct tsc200x *ts = dev_get_drvdata(dev); 594 594 ··· 604 604 return 0; 605 605 } 606 606 607 - static int __maybe_unused tsc200x_resume(struct device *dev) 607 + static int tsc200x_resume(struct device *dev) 608 608 { 609 609 struct tsc200x *ts = dev_get_drvdata(dev); 610 610 ··· 620 620 return 0; 621 621 } 622 622 623 - SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); 624 - EXPORT_SYMBOL_GPL(tsc200x_pm_ops); 623 + EXPORT_GPL_SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); 625 624 626 625 MODULE_AUTHOR("Lauri Leukkunen <lauri.leukkunen@nokia.com>"); 627 626 MODULE_DESCRIPTION("TSC200x Touchscreen Driver Core");
+4 -4
drivers/input/touchscreen/wacom_i2c.c
··· 232 232 return 0; 233 233 } 234 234 235 - static int __maybe_unused wacom_i2c_suspend(struct device *dev) 235 + static int wacom_i2c_suspend(struct device *dev) 236 236 { 237 237 struct i2c_client *client = to_i2c_client(dev); 238 238 ··· 241 241 return 0; 242 242 } 243 243 244 - static int __maybe_unused wacom_i2c_resume(struct device *dev) 244 + static int wacom_i2c_resume(struct device *dev) 245 245 { 246 246 struct i2c_client *client = to_i2c_client(dev); 247 247 ··· 250 250 return 0; 251 251 } 252 252 253 - static SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume); 253 + static DEFINE_SIMPLE_DEV_PM_OPS(wacom_i2c_pm, wacom_i2c_suspend, wacom_i2c_resume); 254 254 255 255 static const struct i2c_device_id wacom_i2c_id[] = { 256 256 { "WAC_I2C_EMR", 0 }, ··· 261 261 static struct i2c_driver wacom_i2c_driver = { 262 262 .driver = { 263 263 .name = "wacom_i2c", 264 - .pm = &wacom_i2c_pm, 264 + .pm = pm_sleep_ptr(&wacom_i2c_pm), 265 265 }, 266 266 267 267 .probe_new = wacom_i2c_probe,
+4 -4
drivers/input/touchscreen/wdt87xx_i2c.c
··· 1113 1113 return 0; 1114 1114 } 1115 1115 1116 - static int __maybe_unused wdt87xx_suspend(struct device *dev) 1116 + static int wdt87xx_suspend(struct device *dev) 1117 1117 { 1118 1118 struct i2c_client *client = to_i2c_client(dev); 1119 1119 int error; ··· 1132 1132 return 0; 1133 1133 } 1134 1134 1135 - static int __maybe_unused wdt87xx_resume(struct device *dev) 1135 + static int wdt87xx_resume(struct device *dev) 1136 1136 { 1137 1137 struct i2c_client *client = to_i2c_client(dev); 1138 1138 int error; ··· 1154 1154 return 0; 1155 1155 } 1156 1156 1157 - static SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume); 1157 + static DEFINE_SIMPLE_DEV_PM_OPS(wdt87xx_pm_ops, wdt87xx_suspend, wdt87xx_resume); 1158 1158 1159 1159 static const struct i2c_device_id wdt87xx_dev_id[] = { 1160 1160 { WDT87XX_NAME, 0 }, ··· 1173 1173 .id_table = wdt87xx_dev_id, 1174 1174 .driver = { 1175 1175 .name = WDT87XX_NAME, 1176 - .pm = &wdt87xx_pm_ops, 1176 + .pm = pm_sleep_ptr(&wdt87xx_pm_ops), 1177 1177 .acpi_match_table = ACPI_PTR(wdt87xx_acpi_id), 1178 1178 }, 1179 1179 };
+5 -5
drivers/input/touchscreen/wm97xx-core.c
··· 763 763 return 0; 764 764 } 765 765 766 - static int __maybe_unused wm97xx_suspend(struct device *dev) 766 + static int wm97xx_suspend(struct device *dev) 767 767 { 768 768 struct wm97xx *wm = dev_get_drvdata(dev); 769 769 u16 reg; ··· 797 797 return 0; 798 798 } 799 799 800 - static int __maybe_unused wm97xx_resume(struct device *dev) 800 + static int wm97xx_resume(struct device *dev) 801 801 { 802 802 struct wm97xx *wm = dev_get_drvdata(dev); 803 803 ··· 833 833 return 0; 834 834 } 835 835 836 - static SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume); 836 + static DEFINE_SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume); 837 837 838 838 /* 839 839 * Machine specific operations ··· 869 869 .owner = THIS_MODULE, 870 870 .probe = wm97xx_probe, 871 871 .remove = wm97xx_remove, 872 - .pm = &wm97xx_pm_ops, 872 + .pm = pm_sleep_ptr(&wm97xx_pm_ops), 873 873 }; 874 874 875 875 static struct platform_driver wm97xx_mfd_driver = { 876 876 .driver = { 877 877 .name = "wm97xx-ts", 878 - .pm = &wm97xx_pm_ops, 878 + .pm = pm_sleep_ptr(&wm97xx_pm_ops), 879 879 }, 880 880 .probe = wm97xx_mfd_probe, 881 881 .remove = wm97xx_mfd_remove,
+4 -4
drivers/input/touchscreen/zforce_ts.c
··· 608 608 return; 609 609 } 610 610 611 - static int __maybe_unused zforce_suspend(struct device *dev) 611 + static int zforce_suspend(struct device *dev) 612 612 { 613 613 struct i2c_client *client = to_i2c_client(dev); 614 614 struct zforce_ts *ts = i2c_get_clientdata(client); ··· 653 653 return ret; 654 654 } 655 655 656 - static int __maybe_unused zforce_resume(struct device *dev) 656 + static int zforce_resume(struct device *dev) 657 657 { 658 658 struct i2c_client *client = to_i2c_client(dev); 659 659 struct zforce_ts *ts = i2c_get_clientdata(client); ··· 691 691 return ret; 692 692 } 693 693 694 - static SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume); 694 + static DEFINE_SIMPLE_DEV_PM_OPS(zforce_pm_ops, zforce_suspend, zforce_resume); 695 695 696 696 static void zforce_reset(void *data) 697 697 { ··· 941 941 static struct i2c_driver zforce_driver = { 942 942 .driver = { 943 943 .name = "zforce-ts", 944 - .pm = &zforce_pm_ops, 944 + .pm = pm_sleep_ptr(&zforce_pm_ops), 945 945 .of_match_table = of_match_ptr(zforce_dt_idtable), 946 946 }, 947 947 .probe_new = zforce_probe,
+4 -4
drivers/input/touchscreen/zinitix.c
··· 562 562 return 0; 563 563 } 564 564 565 - static int __maybe_unused zinitix_suspend(struct device *dev) 565 + static int zinitix_suspend(struct device *dev) 566 566 { 567 567 struct i2c_client *client = to_i2c_client(dev); 568 568 struct bt541_ts_data *bt541 = i2c_get_clientdata(client); ··· 577 577 return 0; 578 578 } 579 579 580 - static int __maybe_unused zinitix_resume(struct device *dev) 580 + static int zinitix_resume(struct device *dev) 581 581 { 582 582 struct i2c_client *client = to_i2c_client(dev); 583 583 struct bt541_ts_data *bt541 = i2c_get_clientdata(client); ··· 593 593 return ret; 594 594 } 595 595 596 - static SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume); 596 + static DEFINE_SIMPLE_DEV_PM_OPS(zinitix_pm_ops, zinitix_suspend, zinitix_resume); 597 597 598 598 #ifdef CONFIG_OF 599 599 static const struct of_device_id zinitix_of_match[] = { ··· 620 620 .probe_new = zinitix_ts_probe, 621 621 .driver = { 622 622 .name = "Zinitix-TS", 623 - .pm = &zinitix_pm_ops, 623 + .pm = pm_sleep_ptr(&zinitix_pm_ops), 624 624 .of_match_table = of_match_ptr(zinitix_of_match), 625 625 }, 626 626 };
+3
include/linux/platform_data/cros_ec_commands.h
··· 3481 3481 #define EC_MKBP_VOL_UP 1 3482 3482 #define EC_MKBP_VOL_DOWN 2 3483 3483 #define EC_MKBP_RECOVERY 3 3484 + #define EC_MKBP_BRI_UP 4 3485 + #define EC_MKBP_BRI_DOWN 5 3486 + #define EC_MKBP_SCREEN_LOCK 6 3484 3487 3485 3488 /* Switches */ 3486 3489 #define EC_MKBP_LID_OPEN 0