GeezerVison is showing github.com — poweroff working · frank-w/BPI-Router-Linux@fc6285a
File treeExpand file treeCollapse file tree Open diff view settings Documentation/devicetree/bindings
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +General Keys Properties: | | 2 | + | | 3 | +Optional properties for Keys: | | 4 | +- power-off-time-sec: Duration in seconds which the key should be kept | | 5 | + pressed for device to power off automatically. Device with key pressed | | 6 | + shutdown feature can specify this property. | | 7 | +- linux,keycodes: Specifies the numeric keycode values to be used for | | 8 | + reporting key presses. |
Collapse file Copy file name to clipboard +43Lines changed: 43 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +MediaTek MT6397/MT6323 PMIC Keys Device Driver | | 2 | + | | 3 | +There are two key functions provided by MT6397/MT6323 PMIC, pwrkey | | 4 | +and homekey. The key functions are defined as the subnode of the function | | 5 | +node provided by MT6397/MT6323 PMIC that is being defined as one kind | | 6 | +of Muti-Function Device (MFD) | | 7 | + | | 8 | +For MT6397/MT6323 MFD bindings see: | | 9 | +Documentation/devicetree/bindings/mfd/mt6397.txt | | 10 | + | | 11 | +Required properties: | | 12 | +- compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" | | 13 | +- linux,keycodes: See Documentation/devicetree/bindings/input/keys.txt | | 14 | + | | 15 | +Optional Properties: | | 16 | +- wakeup-source: See Documentation/devicetree/bindings/power/wakeup-source.txt | | 17 | +- mediatek,long-press-mode: Long press key shutdown setting, 1 for | | 18 | + pwrkey only, 2 for pwrkey/homekey together, others for disabled. | | 19 | +- power-off-time-sec: See Documentation/devicetree/bindings/input/keys.txt | | 20 | + | | 21 | +Example: | | 22 | + | | 23 | + pmic: mt6397 { | | 24 | + compatible = "mediatek,mt6397"; | | 25 | + | | 26 | + ... | | 27 | + | | 28 | + mt6397keys: mt6397keys { | | 29 | + compatible = "mediatek,mt6397-keys"; | | 30 | + mediatek,long-press-mode = <1>; | | 31 | + power-off-time-sec = <0>; | | 32 | + | | 33 | + power { | | 34 | + linux,keycodes = <116>; | | 35 | + wakeup-source; | | 36 | + }; | | 37 | + | | 38 | + home { | | 39 | + linux,keycodes = <114>; | | 40 | + }; | | 41 | + }; | | 42 | + | | 43 | + }; |
Collapse file Copy file name to clipboardExpand all lines: Documentation/devicetree/bindings/mfd/mt6397.txt +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,8 @@ MT6397/MT6323 is a multifunction device with the following sub modules: | 7 | 7 | - GPIO | 8 | 8 | - Clock | 9 | 9 | - LED | | 10 | +- Keys | | 11 | +- Power controller | 10 | 12 |
| 11 | 13 | It is interfaced to host controller using SPI interface by a proprietary hardware | 12 | 14 | called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap. | @@ -42,6 +44,16 @@ Optional subnodes: | 42 | 44 | - compatible: "mediatek,mt6323-led" | 43 | 45 | see Documentation/devicetree/bindings/leds/leds-mt6323.txt | 44 | 46 |
| | 47 | +- keys | | 48 | + Required properties: | | 49 | + - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys" | | 50 | + see Documentation/devicetree/bindings/input/mtk-pmic-keys.txt | | 51 | + | | 52 | +- power-controller | | 53 | + Required properties: | | 54 | + - compatible: "mediatek,mt6323-pwrc" | | 55 | + For details, see Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt | | 56 | + | 45 | 57 | Example: | 46 | 58 | pwrap: pwrap@1000f000 { | 47 | 59 | compatible = "mediatek,mt8135-pwrap"; | |
Collapse file Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Device Tree Bindings for Power Controller on MediaTek PMIC | | 2 | + | | 3 | +The power controller which could be found on PMIC is responsible for externally | | 4 | +powering off or on the remote MediaTek SoC through the circuit BBPU. | | 5 | + | | 6 | +Required properties: | | 7 | +- compatible: Should be one of follows | | 8 | + "mediatek,mt6323-pwrc": for MT6323 PMIC | | 9 | + | | 10 | +Example: | | 11 | + | | 12 | + pmic { | | 13 | + compatible = "mediatek,mt6323"; | | 14 | + | | 15 | + ... | | 16 | + | | 17 | + power-controller { | | 18 | + compatible = "mediatek,mt6323-pwrc"; | | 19 | + }; | | 20 | + } |
Collapse file Copy file name to clipboardExpand all lines: Documentation/devicetree/bindings/power/reset/mt6397-rtc-poweroff.txt -24Lines changed: 0 additions & 24 deletions Collapse file Copy file name to clipboard +9-19Lines changed: 9 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | Device-Tree bindings for MediaTek PMIC based RTC | 2 | 2 |
| 3 | | -MediaTek PMIC based RTC is an independent function of MediaTek PMIC which | 4 | | -is working as a multi-function device (MFD). And the RTC can be configured and | 5 | | -set up via PMIC wrapper bus. Which is also common resource shared among the | 6 | | -other functions present on the PMIC. | | 3 | +MediaTek PMIC based RTC is an independent function of MediaTek PMIC that works | | 4 | +as a type of multi-function device (MFD). The RTC can be configured and set up | | 5 | +with PMIC wrapper bus which is a common resource shared with the other | | 6 | +functions found on the same PMIC. | | 7 | + | | 8 | +For MediaTek PMIC MFD bindings, see: | | 9 | +Documentation/devicetree/bindings/mfd/mt6397.txt | 7 | 10 |
| 8 | 11 | For MediaTek PMIC wrapper bus bindings, see: | 9 | 12 | Documentation/devicetree/bindings/soc/mediatek/pwrap.txt | 10 | 13 |
| 11 | | -Required parent node: | 12 | | -- pmic | 13 | | - For MediaTek PMIC MFD bindings, see: | 14 | | - Documentation/devicetree/bindings/mfd/mt6397.txt | 15 | | - | 16 | 14 | Required properties: | 17 | 15 | - compatible: Should be one of follows | 18 | 16 | "mediatek,mt6323-rtc": for MT6323 PMIC | 19 | 17 | "mediatek,mt6397-rtc": for MT6397 PMIC | 20 | 18 |
| 21 | | -Optional child node: | 22 | | -- power-off | 23 | | - For Power-Off Device for MediaTek PMIC RTC bindings, see: | 24 | | - Documentation/devicetree/bindings/power/reset/mt6397-rtc-poweroff.txt | 25 | | - | 26 | 19 | Example: | 27 | 20 |
| 28 | 21 | pmic { | 29 | 22 | compatible = "mediatek,mt6323"; | 30 | 23 |
| 31 | 24 | ... | | 25 | + | 32 | 26 | rtc { | 33 | 27 | compatible = "mediatek,mt6323-rtc"; | 34 | | - | 35 | | - power-off { | 36 | | - compatible = "mediatek,mt6323-rtc-poweroff"; | 37 | | - }; | 38 | 28 | }; | 39 | | -}; | | 29 | + }; |
Collapse file Copy file name to clipboardExpand all lines: MAINTAINERS +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1594 | 1594 | | 1595 | 1595 | | 1596 | 1596 | S: Maintained | | 1597 | +F: Documentation/devicetree/bindings/rtc/rtc-mt6397.txt | 1597 | 1598 | F: drivers/rtc/rtc-mt6397.c | | 1599 | +F: include/linux/mfd/mt6397/rtc.h | 1598 | 1600 |
| 1599 | 1601 | ARM/Mediatek SoC support | 1600 | 1602 | | | 8614 | 8616 | S: Maintained | 8615 | 8617 | F: drivers/net/ethernet/mediatek/ | 8616 | 8618 |
| | 8619 | +MEDIATEK BOARD LEVEL SHUTDOWN DRIVERS | | 8620 | + | | 8621 | + | | 8622 | +S: Maintained | | 8623 | +F: Documentation/devicetree/bindings/power/reset/mt6323-poweroff.txt | | 8624 | +F: drivers/power/reset/mt6323-poweroff.c | | 8625 | + | 8617 | 8626 | MEDIATEK JPEG DRIVER | 8618 | 8627 | | 8619 | 8628 | | |
Collapse file Copy file name to clipboardExpand all lines: arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +25-7Lines changed: 25 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 871 | 871 | }; | 872 | 872 | }; | 873 | 873 |
| 874 | | - mt6323rtc: rtc { | 875 | | - compatible = "mediatek,mt6323-rtc"; | | 874 | + mt6323keys: mt6323keys { | | 875 | + compatible = "mediatek,mt6323-keys"; | | 876 | + mediatek,long-press-mode = <1>; | | 877 | + power-off-time-sec = <0>; | 876 | 878 |
| 877 | | - power-off { | 878 | | - compatible = "mediatek,mt6323-rtc-poweroff"; | 879 | | - }; | 880 | | - }; | 881 | | - }; | | 879 | + power { | | 880 | + linux,keycodes = <116>; | | 881 | + wakeup-source; | | 882 | + }; | | 883 | + | | 884 | + home { | | 885 | + linux,keycodes = <114>; | | 886 | + }; | | 887 | + }; | 882 | 888 |
| | 889 | + codec: mt6397codec { | | 890 | + compatible = "mediatek,mt6397-codec"; | | 891 | + }; | | 892 | + | | 893 | + power-controller { | | 894 | + compatible = "mediatek,mt6323-pwrc"; | | 895 | + }; | | 896 | + | | 897 | + rtc { | | 898 | + compatible = "mediatek,mt6323-rtc"; | | 899 | + }; | | 900 | + }; | 883 | 901 | }; | 884 | 902 |
| 885 | 903 | &consys { | |
Collapse file Copy file name to clipboardExpand all lines: arch/arm/configs/mt7623n_evb_fwu_defconfig +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -193,6 +193,7 @@ CONFIG_INPUT_EVDEV=y | 193 | 193 | CONFIG_INPUT_EVBUG=y | 194 | 194 | CONFIG_KEYBOARD_MATRIX=y | 195 | 195 | CONFIG_KEYBOARD_SAMSUNG=y | | 196 | +CONFIG_KEYBOARD_MTK_PMIC=m | 196 | 197 | CONFIG_MOUSE_PS2_ELANTECH=y | 197 | 198 | CONFIG_MOUSE_PS2_SENTELIC=y | 198 | 199 | CONFIG_INPUT_MOUSEDEV=y | @@ -376,6 +377,7 @@ CONFIG_I2C_CHARDEV=m | 376 | 377 | CONFIG_RTC_CLASS=y | 377 | 378 | CONFIG_RTC_DRV_DS1307=m | 378 | 379 | CONFIG_RTC_DRV_DS1307_CENTURY=y | | 380 | +CONFIG_RTC_DRV_MT6397=m | 379 | 381 |
| 380 | 382 | CONFIG_SPI=y | 381 | 383 | CONFIG_SPI_MASTER=y | @@ -385,6 +387,10 @@ CONFIG_SPI_MT65XX=m | 385 | 387 | CONFIG_PWM=y | 386 | 388 | CONFIG_PWM_MEDIATEK=m | 387 | 389 |
| | 390 | +#reset | | 391 | +CONFIG_POWER_RESET=y | | 392 | +CONFIG_POWER_RESET_MT6323=y | | 393 | + | 388 | 394 | #Temperature sensor driver for mediatek SoCs | 389 | 395 | CONFIG_MEDIATEK_MT6577_AUXADC=m | 390 | 396 | CONFIG_THERMAL=m | @@ -570,7 +576,3 @@ CONFIG_NFS_COMMON=y | 570 | 576 | #xfs | 571 | 577 | CONFIG_XFS_FS=m | 572 | 578 |
| 573 | | -#RTC/POWER | 574 | | -CONFIG_POWER_RESET=y | 575 | | -CONFIG_POWER_RESET_MT6397_RTC=y | 576 | | - | |
Collapse file Copy file name to clipboardExpand all lines: drivers/input/keyboard/Kconfig +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -756,4 +756,13 @@ config KEYBOARD_BCM | 756 | 756 | To compile this driver as a module, choose M here: the | 757 | 757 | module will be called bcm-keypad. | 758 | 758 |
| | 759 | +config KEYBOARD_MTK_PMIC | | 760 | + tristate "MediaTek PMIC keys support" | | 761 | + depends on MFD_MT6397 | | 762 | + help | | 763 | + Say Y here if you want to use the pmic keys (powerkey/homekey). | | 764 | + | | 765 | + To compile this driver as a module, choose M here: the | | 766 | + module will be called pmic-keys. | | 767 | + | 759 | 768 | endif |
|