Input: standardize on "wakeup-source" property
Subsystems (5)
Dmitry Torokhov
maintainercover Input: standardize on "wakeup-source" property
Hi,
Currently input drivers use many forms of annotating devices that should be set up as wakeup sources for the system. This patch series converts them all to use "wakeup-source" name (to match what i2c devices are using) while keeping old names as fallback to keep compatibility with existing DTSes.
Maybe in the future we could move parsing of "wakeup-source" into device core.
Thanks.
Signature · 6 lines
Dmitry -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov
maintainerPATCH 1/6 Input: matrix_keypad - change name of wakeup property to "wakeup-source"
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt | 2 +- drivers/input/keyboard/matrix_keypad.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt +1 -1
@@ -19,7 +19,7 @@ Required Properties: Optional Properties: - linux,no-autorepeat: do no enable autorepeat feature. -- linux,wakeup: use any event on keypad as wakeup event. +- wakeup-source: use any event on keypad as wakeup event. - debounce-delay-ms: debounce interval in milliseconds - col-scan-delay-us: delay, measured in microseconds, that is needed before we can scan keypad after activating column gpio
drivers/input/keyboard/matrix_keypad.c +4 -2
@@ -425,8 +425,10 @@ matrix_keypad_parse_dt(struct device *dev)if (of_get_property (np,"linux,no-autorepeat" ,NULL )) pdata->no_autorepeat = true; -if (of_get_property (np,"linux,wakeup" ,NULL )) - pdata->wakeup = true; + + pdata->wakeup =of_property_read_bool (np,"wakeup-source" ) || +of_property_read_bool (np,"linux,wakeup" );/* legacy */ +if (of_get_property (np,"gpio-activelow" ,NULL )) pdata->active_low = true;
Signature · 1 line
2.4.3.573.g4eafbef
Dmitry Torokhov
maintainerPATCH 2/6 Input: ads7846 - change name of wakeup property to "wakeup-source"
In reply to Dmitry TorokhovWakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/input/ads7846.txt | 2 +- drivers/input/touchscreen/ads7846.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/input/ads7846.txt +1 -1
@@ -64,7 +64,7 @@ Optional properties: pendown-gpio (u32). pendown-gpio GPIO handle describing the pin the !PENIRQ line is connected to. - linux,wakeup use any event on touchscreen as wakeup event. + wakeup-source use any event on touchscreen as wakeup event. Example for a TSC2046 chip connected to an McSPI controller of an OMAP SoC::
drivers/input/touchscreen/ads7846.c +2 -1
@@ -1234,7 +1234,8 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)of_property_read_u32 (node,"ti,pendown-gpio-debounce" , &pdata->gpio_pendown_debounce); - pdata->wakeup =of_property_read_bool (node,"linux,wakeup" ); + pdata->wakeup =of_property_read_bool (node,"wakeup-source" ) || +of_property_read_bool (node,"linux,wakeup" ); pdata->gpio_pendown =of_get_named_gpio (dev->of_node,"pendown-gpio" ,0 );
Signature · 1 line
2.4.3.573.g4eafbef
Dmitry Torokhov
maintainerPATCH 3/6 Input: pmic8xxx-keypad - change name of wakeup property
In reply to Dmitry TorokhovWakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt | 2 +- drivers/input/keyboard/pmic8xxx-keypad.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt +1 -1
@@ -33,7 +33,7 @@ PROPERTIES Value type: <bool> Definition: don't enable autorepeat feature. -- linux,keypad-wakeup: +- wakeup-source: Usage: optional Value type: <bool> Definition: use any event on keypad as wakeup event.
drivers/input/keyboard/pmic8xxx-keypad.c +6 -4
@@ -507,6 +507,7 @@ static void pmic8xxx_kp_close(struct input_dev *dev)*/ static int pmic8xxx_kp_probe (struct platform_device *pdev) { +struct device_node *np = pdev->dev.of_node;unsigned int rows, cols;bool repeat;bool wakeup;
@@ -524,10 +525,11 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)return -EINVAL ; } - repeat = !of_property_read_bool (pdev->dev.of_node, -"linux,input-no-autorepeat" ); - wakeup =of_property_read_bool (pdev->dev.of_node, -"linux,keypad-wakeup" ); + repeat = !of_property_read_bool (np,"linux,input-no-autorepeat" ); + + wakeup =of_property_read_bool (np,"wakeup-source" ) || +/* legacy name */ +of_property_read_bool (np,"linux,keypad-wakeup" ); kp =devm_kzalloc (&pdev->dev,sizeof (*kp),GFP_KERNEL );if (!kp)
Signature · 6 lines
2.4.3.573.g4eafbef -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/6] Input: pmic8xxx-keypad - change name of wakeup property
Quoted 8 lines · Dmitry Torokhov
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".We keep parsing old name to keep compatibility with old DTSes.
Signed-off-by Dmitry Torokhov <[email protected]>
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Dmitry Torokhov
maintainerPATCH 4/6 Input: gpio_keys[_polled] - change name of wakeup property
In reply to Dmitry TorokhovWakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/input/gpio-keys-polled.txt | 2 +- Documentation/devicetree/bindings/input/gpio-keys.txt | 2 +- drivers/input/keyboard/gpio_keys.c | 4 +++- drivers/input/keyboard/gpio_keys_polled.c | 5 ++++- 4 files changed, 9 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/input/gpio-keys-polled.txt +1 -1
@@ -20,7 +20,7 @@ Optional subnode-properties: If not specified defaults to <1> == EV_KEY. - debounce-interval: Debouncing interval time in milliseconds. If not specified defaults to 5. - - gpio-key,wakeup: Boolean, button can wake-up the system. + - wakeup-source: Boolean, button can wake-up the system. Example nodes:
Documentation/devicetree/bindings/input/gpio-keys.txt +1 -1
@@ -23,7 +23,7 @@ Optional subnode-properties: If not specified defaults to <1> == EV_KEY. - debounce-interval: Debouncing interval time in milliseconds. If not specified defaults to 5. - - gpio-key,wakeup: Boolean, button can wake-up the system. + - wakeup-source: Boolean, button can wake-up the system. - linux,can-disable: Boolean, indicates that button is connected to dedicated (not shared) interrupt which can be disabled to suppress events from the button.
drivers/input/keyboard/gpio_keys.c +3 -1
@@ -655,7 +655,9 @@ gpio_keys_get_devtree_pdata(struct device *dev)if (of_property_read_u32 (pp,"linux,input-type" , &button->type)) button->type =EV_KEY ; - button->wakeup = !!of_get_property (pp,"gpio-key,wakeup" ,NULL ); + button->wakeup =of_property_read_bool (pp,"wakeup-source" ) || +/* legacy name */ +of_property_read_bool (pp,"gpio-key,wakeup" ); button->can_disable = !!of_get_property (pp,"linux,can-disable" ,NULL );
drivers/input/keyboard/gpio_keys_polled.c +4 -1
@@ -152,7 +152,10 @@ static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct &button->type)) button->type =EV_KEY ; - button->wakeup =fwnode_property_present (child,"gpio-key,wakeup" ); + button->wakeup = +fwnode_property_read_bool (child,"wakeup-source" ) || +/* legacy name */ +fwnode_property_read_bool (child,"gpio-key,wakeup" );if (fwnode_property_read_u32 (child,"debounce-interval" , &button->debounce_interval))
Signature · 1 line
2.4.3.573.g4eafbef
Re: [PATCH 4/6] Input: gpio_keys[_polled] - change name of wakeup property
Quoted 8 lines · Dmitry Torokhov
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".We keep parsing old name to keep compatibility with old DTSes.
Signed-off-by Dmitry Torokhov <[email protected]>
This looks good.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov
maintainerPATCH 5/6 Input: samsung-keypad - change name of wakeup property
In reply to Dmitry TorokhovWakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/input/samsung-keypad.txt | 4 +++- drivers/input/keyboard/samsung-keypad.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/input/samsung-keypad.txt +3 -1
@@ -36,9 +36,11 @@ Required Board Specific Properties: - pinctrl-0: Should specify pin control groups used for this controller. - pinctrl-names: Should contain only one value - "default". +Optional Properties: +- wakeup-source: use any event on keypad as wakeup event. + Optional Properties specific to linux: - linux,keypad-no-autorepeat: do no enable autorepeat feature. -- linux,keypad-wakeup: use any event on keypad as wakeup event. Example:
drivers/input/keyboard/samsung-keypad.c +4 -2
@@ -299,8 +299,10 @@ samsung_keypad_parse_dt(struct device *dev)if (of_get_property (np,"linux,input-no-autorepeat" ,NULL )) pdata->no_autorepeat = true; -if (of_get_property (np,"linux,input-wakeup" ,NULL )) - pdata->wakeup = true; + pdata->wakeup =of_property_read_bool (pp,"wakeup-source" ) || +/* legacy name */ +of_property_read_bool (pp,"linux,input-wakeup" ); +return pdata; }
Signature · 1 line
2.4.3.573.g4eafbef
Dmitry Torokhov
maintainerPATCH 6/6 Input: tc3589x-keypad - change name of wakeup property
In reply to Dmitry TorokhovWakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".
We keep parsing old name to keep compatibility with old DTSes.
--- Documentation/devicetree/bindings/mfd/tc3589x.txt | 4 ++-- drivers/input/keyboard/tc3589x-keypad.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/mfd/tc3589x.txt +2 -2
@@ -55,7 +55,7 @@ Optional nodes: - linux,keymap: the definition can be found in bindings/input/matrix-keymap.txt - linux,no-autorepeat: do no enable autorepeat feature. - - linux,wakeup: use any event on keypad as wakeup event. + - wakeup-source: use any event on keypad as wakeup event. Example:
@@ -84,7 +84,6 @@ tc35893@44 { keypad,num-columns = <8>; keypad,num-rows = <8>; linux,no-autorepeat; - linux,wakeup; linux,keymap = <0x0301006b 0x04010066 0x06040072
@@ -103,5 +102,6 @@ tc35893@44 { 0x01030039 0x07060069 0x050500d9>; + wakeup-source; }; };
drivers/input/keyboard/tc3589x-keypad.c +4 -1
@@ -352,7 +352,10 @@ tc3589x_keypad_of_probe(struct device *dev) } plat->no_autorepeat =of_property_read_bool (np,"linux,no-autorepeat" ); - plat->enable_wakeup =of_property_read_bool (np,"linux,wakeup" ); + + plat->enable_wakeup =of_property_read_bool (np,"wakeup-source" ) || +/* legacy name */ +of_property_read_bool (np,"linux,wakeup" );/* The custom delay format is ms/16 */ of_property_read_u32 (np,"debounce-delay-ms" , &debounce_ms);
Signature · 6 lines
2.4.3.573.g4eafbef -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 6/6] Input: tc3589x-keypad - change name of wakeup property
Quoted 8 lines · Dmitry Torokhov
Wakeup property of device is not Linux-specific, it describes intended system behavior regardless of the OS being used. Therefore let's drop "linux," prefix, and, while at it, use the same name as I2C bus does:
"wakeup-source".We keep parsing old name to keep compatibility with old DTSes.
Signed-off-by Dmitry Torokhov <[email protected]>
Yours,
Linus Walleij