Lines Matching +full:fn +full:- +full:keymap
1 // SPDX-License-Identifier: GPL-2.0+
32 if (!config->ghost_filter || valid < 3) in has_ghosting()
38 * and the other is in the same column as the i-th key. in has_ghosting()
57 const u8 *keymap; in key_matrix_decode() local
62 keymap = config->plain_keycode; in key_matrix_decode()
66 debug(" valid=%d, row=%d, col=%d\n", key->valid, key->row, in key_matrix_decode()
67 key->col); in key_matrix_decode()
68 if (!key->valid) in key_matrix_decode()
70 pos = key->row * config->num_cols + key->col; in key_matrix_decode()
71 if (config->fn_keycode && pos == config->fn_pos) in key_matrix_decode()
72 keymap = config->fn_keycode; in key_matrix_decode()
76 keycode[valid++] = keymap[pos]; in key_matrix_decode()
77 debug(" keycode=%d\n", keymap[pos]); in key_matrix_decode()
98 * its position if found (this is used for finding the Fn key).
104 * @param pos Returns position of map_keycode, if found, else -1
113 *pos = -1; in create_keymap()
114 map = (uchar *)calloc(1, config->key_count); in create_keymap()
117 config->key_count); in create_keymap()
121 for (; len >= sizeof(u32); data++, len -= 4) { in create_keymap()
129 entry = row * config->num_cols + col; in create_keymap()
146 prop = dev_read_prop(dev, "linux,keymap", &proplen); in key_matrix_decode_fdt()
147 /* Basic keymap is required */ in key_matrix_decode_fdt()
149 debug("%s: cannot find keycode-plain map\n", __func__); in key_matrix_decode_fdt()
150 return -1; in key_matrix_decode_fdt()
154 &config->fn_pos); in key_matrix_decode_fdt()
155 config->plain_keycode = plain_keycode; in key_matrix_decode_fdt()
156 /* Conversion error -> fail */ in key_matrix_decode_fdt()
157 if (!config->plain_keycode) in key_matrix_decode_fdt()
158 return -1; in key_matrix_decode_fdt()
160 prop = dev_read_prop(dev, "linux,fn-keymap", &proplen); in key_matrix_decode_fdt()
161 /* fn keymap is optional */ in key_matrix_decode_fdt()
165 config->fn_keycode = create_keymap(config, prop, proplen, -1, NULL); in key_matrix_decode_fdt()
166 /* Conversion error -> fail */ in key_matrix_decode_fdt()
167 if (!config->fn_keycode) { in key_matrix_decode_fdt()
169 return -1; in key_matrix_decode_fdt()
174 config->plain_keycode, config->fn_keycode); in key_matrix_decode_fdt()
182 config->num_rows = rows; in key_matrix_init()
183 config->num_cols = cols; in key_matrix_init()
184 config->key_count = rows * cols; in key_matrix_init()
185 config->ghost_filter = ghost_filter; in key_matrix_init()
186 assert(config->key_count > 0); in key_matrix_init()