Lines Matching +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()
88 return size < 0 ? size : -EINVAL; in matrix_keypad_parse_keymap()
94 return -EINVAL; in matrix_keypad_parse_keymap()
99 return -ENOMEM; in matrix_keypad_parse_keymap()
111 retval = -EINVAL; in matrix_keypad_parse_keymap()
124 * matrix_keypad_build_keymap - convert platform keymap into matrix keymap
147 * Callers are expected to set up input_dev->dev.parent before calling this
161 if (WARN_ON(!input_dev->dev.parent)) in matrix_keypad_build_keymap()
162 return -EINVAL; in matrix_keypad_build_keymap()
165 keymap = devm_kcalloc(input_dev->dev.parent, in matrix_keypad_build_keymap()
169 dev_err(input_dev->dev.parent, in matrix_keypad_build_keymap()
171 return -ENOMEM; in matrix_keypad_build_keymap()
175 input_dev->keycode = keymap; in matrix_keypad_build_keymap()
176 input_dev->keycodesize = sizeof(*keymap); in matrix_keypad_build_keymap()
177 input_dev->keycodemax = max_keys; in matrix_keypad_build_keymap()
179 __set_bit(EV_KEY, input_dev->evbit); in matrix_keypad_build_keymap()
182 for (i = 0; i < keymap_data->keymap_size; i++) { in matrix_keypad_build_keymap()
183 unsigned int key = keymap_data->keymap[i]; in matrix_keypad_build_keymap()
187 return -EINVAL; in matrix_keypad_build_keymap()
196 __clear_bit(KEY_RESERVED, input_dev->keybit); in matrix_keypad_build_keymap()