Lines Matching refs:config

27 static int has_ghosting(struct key_matrix *config, struct key_matrix_key *keys,  in has_ghosting()  argument
33 if (!config->ghost_filter || valid < 3) in has_ghosting()
55 int key_matrix_decode(struct key_matrix *config, struct key_matrix_key keys[], in key_matrix_decode() argument
63 keymap = config->plain_keycode; in key_matrix_decode()
71 pos = key->row * config->num_cols + key->col; in key_matrix_decode()
72 if (config->fn_keycode && pos == config->fn_pos) in key_matrix_decode()
73 keymap = config->fn_keycode; in key_matrix_decode()
82 if (has_ghosting(config, keys, valid)) { in key_matrix_decode()
108 static uchar *create_keymap(struct key_matrix *config, const u32 *data, int len, in create_keymap() argument
115 map = (uchar *)calloc(1, config->key_count); in create_keymap()
118 config->key_count); in create_keymap()
130 entry = row * config->num_cols + col; in create_keymap()
141 int key_matrix_decode_fdt(struct udevice *dev, struct key_matrix *config) in key_matrix_decode_fdt() argument
154 plain_keycode = create_keymap(config, prop, proplen, KEY_FN, in key_matrix_decode_fdt()
155 &config->fn_pos); in key_matrix_decode_fdt()
156 config->plain_keycode = plain_keycode; in key_matrix_decode_fdt()
158 if (!config->plain_keycode) in key_matrix_decode_fdt()
166 config->fn_keycode = create_keymap(config, prop, proplen, -1, NULL); in key_matrix_decode_fdt()
168 if (!config->fn_keycode) { in key_matrix_decode_fdt()
175 config->plain_keycode, config->fn_keycode); in key_matrix_decode_fdt()
179 int key_matrix_init(struct key_matrix *config, int rows, int cols, in key_matrix_init() argument
182 memset(config, '\0', sizeof(*config)); in key_matrix_init()
183 config->num_rows = rows; in key_matrix_init()
184 config->num_cols = cols; in key_matrix_init()
185 config->key_count = rows * cols; in key_matrix_init()
186 config->ghost_filter = ghost_filter; in key_matrix_init()
187 assert(config->key_count > 0); in key_matrix_init()