요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Marvell PXA Keypad controller
Required Properties
- compatible : should be "marvell,pxa27x-keypad"
- reg : Address and length of the register set for the device
- interrupts : The interrupt for the keypad controller
- marvell,debounce-interval : How long time the key will be
recognized when it is pressed. It is a u32 value, and bit[31:16]
is debounce interval for direct key and bit[15:0] is debounce
interval for matrix key. The value is in binary number of 2ms
Optional Properties For Matrix Keyes
Please refer to matrix-keymap.txt
Optional Properties for Direct Keyes
- marvell,direct-key-count : How many direct keyes are used.
- marvell,direct-key-mask : The mask indicates which keyes
are used. If bit[X] of the mask is set, the direct key X
is used.
- marvell,direct-key-low-active : Direct key status register
tells the level of pins that connects to the direct keyes.
When this property is set, it means that when the pin level
is low, the key is pressed(active).
- marvell,direct-key-map : It is a u16 array. Each item indicates
the linux key-code for the direct key.
Optional Properties For Rotary
- marvell,rotary0 : It is a u32 value. Bit[31:16] is the
linux key-code for rotary up. Bit[15:0] is the linux key-code
for rotary down. It is for rotary 0.
- marvell,rotary1 : Same as marvell,rotary0. It is for rotary 1.
- marvell,rotary-rel-key : When rotary is used for relative axes
in the device, the value indicates the key-code for relative
axes measurement in the device. It is a u32 value. Bit[31:16]
is for rotary 1, and Bit[15:0] is for rotary 0.
Examples:
keypad: keypad@d4012000 {
keypad,num-rows = <3>;
keypad,num-columns = <5>;
linux,keymap = <0x0000000e /* KEY_BACKSPACE */
0x0001006b /* KEY_END */
0x00020061 /* KEY_RIGHTCTRL */
0x0003000b /* KEY_0 */
0x00040002 /* KEY_1 */
0x0100008b /* KEY_MENU */
0x01010066 /* KEY_HOME */
0x010200e7 /* KEY_SEND */
0x01030009 /* KEY_8 */
0x0104000a /* KEY_9 */
0x02000160 /* KEY_OK */
0x02010003 /* KEY_2 */
0x02020004 /* KEY_3 */
0x02030005 /* KEY_4 */
0x02040006>; /* KEY_5 */
marvell,rotary0 = <0x006c0067>; /* KEY_UP & KEY_DOWN */
marvell,direct-key-count = <1>;
marvell,direct-key-map = <0x001c>;
marvell,debounce-interval = <0x001e001e>;
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
PXA matrix/direct/rotary key 속성
1-36Marvell PXA keypad controller의 필수 `compatible`은 `marvell,pxa27x-keypad`, `reg`는 register set address와 length, `interrupts`는 keypad controller interrupt입니다.
`marvell,debounce-interval`은 key press를 인식할 시간입니다. U32의 bit[31:16]은 direct key, bit[15:0]은 matrix key debounce interval이며 값은 2 ms 단위의 binary number입니다. Matrix key 선택 property는 `matrix-keymap.txt`를 참조합니다.
Direct key의 `marvell,direct-key-count`는 사용 key 수, `marvell,direct-key-mask`는 bit X가 direct key X 사용 여부를 나타내는 mask입니다. `marvell,direct-key-low-active`가 있으면 direct-key pin level이 low일 때 pressed(active)입니다. `marvell,direct-key-map`은 각 direct key의 Linux keycode를 담은 u16 array입니다.
Rotary의 `marvell,rotary0` u32는 bit[31:16]에 rotary-up, bit[15:0]에 rotary-down Linux keycode를 넣으며 rotary 0에 적용합니다. `marvell,rotary1`은 rotary 1에 같은 형식을 씁니다. `marvell,rotary-rel-key`는 rotary를 relative axis로 사용할 때 measurement keycode를 지정하며 상위 16 bit는 rotary 1, 하위 16 bit는 rotary 0입니다.
32-bit property의 상위/하위 field 의미를 정리합니다.
3x5 matrix와 rotary 예제
37-60예제는 3 row x 5 column matrix에 15개 Linux keycode를 mapping합니다. Rotary 0의 up/down을 `KEY_UP`/`KEY_DOWN`으로 지정하고 direct key 하나를 keycode `0x001c`에 mapping하며 direct와 matrix debounce interval을 모두 `0x001e`로 설정합니다.
keypad: keypad@d4012000 {
keypad,num-rows = <3>;
keypad,num-columns = <5>;
linux,keymap = <0x0000000e /* KEY_BACKSPACE */
0x0001006b /* KEY_END */
0x00020061 /* KEY_RIGHTCTRL */
0x0003000b /* KEY_0 */
0x00040002 /* KEY_1 */
0x0100008b /* KEY_MENU */
0x01010066 /* KEY_HOME */
0x010200e7 /* KEY_SEND */
0x01030009 /* KEY_8 */
0x0104000a /* KEY_9 */
0x02000160 /* KEY_OK */
0x02010003 /* KEY_2 */
0x02020004 /* KEY_3 */
0x02030005 /* KEY_4 */
0x02040006>; /* KEY_5 */
marvell,rotary0 = <0x006c0067>; /* KEY_UP & KEY_DOWN */
marvell,direct-key-count = <1>;
marvell,direct-key-map = <0x001c>;
marvell,debounce-interval = <0x001e001e>;
};
요약과 해설
pxa27x-keypad.txt:1-60Packed debounce/keycode field와 3x5 matrix 예제를 설명합니다.