Mainline:Broadcom Kona/BCM590xx/PONKEY: Difference between revisions

Created page with "The BCM590XX PMU can handle a power-on key (the responsible section is nicknamed PONKEY). == Key press detection == When a key is pressed, the internal IRQ for a key press is raised; when it is released, the internal IRQ for a key release is raised. A driver can interpret these IRQs to toggle a key on/off (in downstream, it's wired up to <code>KEY_POWER</code> by default. === Debounce interval === A debounce interval can be configured independently for button press a..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{hatnote|Downstream driver: {{downstream|baffinlite|drivers/input/misc/bcmpmu59xxx_ponkey.c}}}}
The BCM590XX PMU can handle a power-on key (the responsible section is nicknamed PONKEY).
The BCM590XX PMU can handle a power-on key (the responsible section is nicknamed PONKEY).


== Key press detection ==
== Key press detection ==


When a key is pressed, the internal IRQ for a key press is raised; when it is released, the internal IRQ for a key release is raised. A driver can interpret these IRQs to toggle a key on/off (in downstream, it's wired up to <code>KEY_POWER</code> by default.
When a key is pressed, the internal IRQ for a key press (BCM59054_IRQ_POK_PRESSED/BCM59056_IRQ_PONKEYB_F) is raised; when it is released, the internal IRQ for a key release (BCM59054_IRQ_POK_RELEASED/BCM59056_IRQ_PONKEYB_R) is raised. A driver can interpret these IRQs to toggle a key on/off (in downstream, it's wired up to <code>KEY_POWER</code> by default.


=== Debounce interval ===
=== Debounce interval ===
Line 14: Line 16:


TODO. Seems like it might be possible to control long-press function using a timer (one of "poweroff", "restart" or "smart reset"). [https://github.com/knuxdroid/android_kernel_samsung_baffinlite/blob/cm-12.1/drivers/input/misc/bcmpmu59xxx_ponkey.c#L204-L277 Relevant kernel sources], notably commented out.
TODO. Seems like it might be possible to control long-press function using a timer (one of "poweroff", "restart" or "smart reset"). [https://github.com/knuxdroid/android_kernel_samsung_baffinlite/blob/cm-12.1/drivers/input/misc/bcmpmu59xxx_ponkey.c#L204-L277 Relevant kernel sources], notably commented out.
== Registers (BCM59054) ==
{{hatnote|See {{downstream|baffinlite|include/linux/mfd/bcmpmu59054_reg.h}}.}}
All of them are on MAP0.
=== PONKEYCTRL1 (0x08) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| Reserved/unknown
| 7
| Reserved/unknown
|-
| <code>RELEASE_DEB</code>
| 5:3
| Represents the release debounce.
|-
| <code>PRESS_DEB</code>
| 2:0
| Represents the press debounce.
|}
=== PONKEYCTRL2 (0x09) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| <code>TX1_ACTION</code>
| 7:6
| TODO
|-
| <code>TX1_DLY</code>
| 5:3
| TODO
|-
| <code>TX1_DEB</code>
| 2:0
| TODO
|}
=== PONKEYCTRL3 (0x0A) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| <code>TX2_ACTION</code>
| 7:6
| TODO
|-
| <code>TX2_DLY</code>
| 5:3
| TODO
|-
| <code>TX2_DEB</code>
| 2:0
| TODO
|}
=== PONKEYCTRL4 (0x0B) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| Reserved/unknown
| 7
| Reserved/unknown
|-
| <code>KEY_PAD_LOCK_MODE</code>
| 6
| TODO
|-
| <code>KEY_PAD_LOCK</code>
| 5
| TODO
|-
| <code>POK_RESTART_EN</code>
| 4
| TODO
|-
| Reserved/unknown
| 3
| Reserved/unknown
|-
| <code>POK_WAKUP_DEB</code>
| 2:0
| TODO
|}
=== PONKEYCTRL5 (0x0C) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| Reserved/unknown
| 7:0
| Reserved/unknown
|}
=== PONKEYCTRL6 (0x0D) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| Reserved/unknown
| 7:5
| Reserved/unknown
|-
| <code>SMART_RST_DLY</code>
| 4:3
| TODO
|-
| <code>SMART_RST_STATUS</code>
| 2
| TODO
|-
| <code>SMART_RST_PWR_EN</code>
| 1
| TODO
|-
| <code>SMART_RST_EN</code>
| 0
| TODO
|}
=== PONKEYCTRL7 (0x0E) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| Reserved/unknown
| 7:0
| Reserved/unknown
|}
=== PONKEYCTRL8 (0x0F) ===
{|class="wikitable bittable"
!Name
!Bit
!Description
|-
| <code>TX3_ACTION</code>
| 7:6
| TODO
|-
| <code>TX3_DLY</code>
| 5:3
| TODO
|-
| <code>TX3_DEB</code>
| 2:0
| TODO
|}