Lines Matching +full:keypad +full:- +full:num +full:- +full:columns
1 // SPDX-License-Identifier: GPL-2.0-only
26 unsigned short *keymap = input_dev->keycode; in matrix_keypad_map_key()
32 dev_err(input_dev->dev.parent, in matrix_keypad_map_key()
39 __set_bit(code, input_dev->keybit); in matrix_keypad_map_key()
45 * matrix_keypad_parse_properties() - Read properties of matrix keypad
49 * @cols: Returns number of matrix columns
57 device_property_read_u32(dev, "keypad,num-rows", rows); in matrix_keypad_parse_properties()
58 device_property_read_u32(dev, "keypad,num-columns", cols); in matrix_keypad_parse_properties()
61 dev_err(dev, "number of keypad rows/columns not specified\n"); in matrix_keypad_parse_properties()
62 return -EINVAL; in matrix_keypad_parse_properties()
73 struct device *dev = input_dev->dev.parent; in matrix_keypad_parse_keymap()
87 return size < 0 ? size : -EINVAL; in matrix_keypad_parse_keymap()
93 return -EINVAL; in matrix_keypad_parse_keymap()
98 return -ENOMEM; in matrix_keypad_parse_keymap()
110 return -EINVAL; in matrix_keypad_parse_keymap()
117 * matrix_keypad_build_keymap - convert platform keymap into matrix keymap
140 * Callers are expected to set up input_dev->dev.parent before calling this
154 if (WARN_ON(!input_dev->dev.parent)) in matrix_keypad_build_keymap()
155 return -EINVAL; in matrix_keypad_build_keymap()
158 keymap = devm_kcalloc(input_dev->dev.parent, in matrix_keypad_build_keymap()
162 dev_err(input_dev->dev.parent, in matrix_keypad_build_keymap()
164 return -ENOMEM; in matrix_keypad_build_keymap()
168 input_dev->keycode = keymap; in matrix_keypad_build_keymap()
169 input_dev->keycodesize = sizeof(*keymap); in matrix_keypad_build_keymap()
170 input_dev->keycodemax = max_keys; in matrix_keypad_build_keymap()
172 __set_bit(EV_KEY, input_dev->evbit); in matrix_keypad_build_keymap()
175 for (i = 0; i < keymap_data->keymap_size; i++) { in matrix_keypad_build_keymap()
176 unsigned int key = keymap_data->keymap[i]; in matrix_keypad_build_keymap()
180 return -EINVAL; in matrix_keypad_build_keymap()
189 __clear_bit(KEY_RESERVED, input_dev->keybit); in matrix_keypad_build_keymap()