• Home
  • Raw
  • Download

Lines Matching refs:f30

85 						struct f30_data *f30)  in rmi_f30_read_control_parameters()  argument
90 f30->ctrl_regs, f30->ctrl_regs_size); in rmi_f30_read_control_parameters()
102 struct f30_data *f30, unsigned int button) in rmi_f30_report_button() argument
106 u16 key_code = f30->gpioled_key_map[button]; in rmi_f30_report_button()
107 bool key_down = !(f30->data_regs[reg_num] & BIT(bit_num)); in rmi_f30_report_button()
109 if (f30->trackstick_buttons && in rmi_f30_report_button()
112 rmi_f03_overwrite_button(f30->f03, key_code, key_down); in rmi_f30_report_button()
118 input_report_key(f30->input, key_code, key_down); in rmi_f30_report_button()
125 struct f30_data *f30 = dev_get_drvdata(&fn->dev); in rmi_f30_attention() local
132 if (drvdata->attn_data.size < f30->register_count) { in rmi_f30_attention()
137 memcpy(f30->data_regs, drvdata->attn_data.data, in rmi_f30_attention()
138 f30->register_count); in rmi_f30_attention()
139 drvdata->attn_data.data += f30->register_count; in rmi_f30_attention()
140 drvdata->attn_data.size -= f30->register_count; in rmi_f30_attention()
143 f30->data_regs, f30->register_count); in rmi_f30_attention()
152 if (f30->has_gpio) { in rmi_f30_attention()
153 for (i = 0; i < f30->gpioled_count; i++) in rmi_f30_attention()
154 if (f30->gpioled_key_map[i] != KEY_RESERVED) in rmi_f30_attention()
155 rmi_f30_report_button(fn, f30, i); in rmi_f30_attention()
156 if (f30->trackstick_buttons) in rmi_f30_attention()
157 rmi_f03_commit_buttons(f30->f03); in rmi_f30_attention()
165 struct f30_data *f30 = dev_get_drvdata(&fn->dev); in rmi_f30_config() local
172 if (!f30) in rmi_f30_config()
177 f30->f03 = rmi_find_function(fn->rmi_dev, 0x03); in rmi_f30_config()
178 f30->trackstick_buttons = f30->f03 != NULL; in rmi_f30_config()
186 f30->ctrl_regs, f30->ctrl_regs_size); in rmi_f30_config()
224 struct f30_data *f30) in rmi_f30_map_gpios() argument
228 struct input_dev *input = f30->input; in rmi_f30_map_gpios()
233 int button_count = min_t(u8, f30->gpioled_count, TRACKSTICK_RANGE_END); in rmi_f30_map_gpios()
235 f30->gpioled_key_map = devm_kcalloc(&fn->dev, in rmi_f30_map_gpios()
237 sizeof(f30->gpioled_key_map[0]), in rmi_f30_map_gpios()
239 if (!f30->gpioled_key_map) { in rmi_f30_map_gpios()
245 if (!rmi_f30_is_valid_button(i, f30->ctrl)) in rmi_f30_map_gpios()
250 f30->gpioled_key_map[i] = trackstick_button++; in rmi_f30_map_gpios()
252 f30->gpioled_key_map[i] = button; in rmi_f30_map_gpios()
258 input->keycode = f30->gpioled_key_map; in rmi_f30_map_gpios()
259 input->keycodesize = sizeof(f30->gpioled_key_map[0]); in rmi_f30_map_gpios()
260 input->keycodemax = f30->gpioled_count; in rmi_f30_map_gpios()
273 static int rmi_f30_initialize(struct rmi_function *fn, struct f30_data *f30) in rmi_f30_initialize() argument
275 u8 *ctrl_reg = f30->ctrl_regs; in rmi_f30_initialize()
287 f30->has_extended_pattern = buf[0] & RMI_F30_EXTENDED_PATTERNS; in rmi_f30_initialize()
288 f30->has_mappable_buttons = buf[0] & RMI_F30_HAS_MAPPABLE_BUTTONS; in rmi_f30_initialize()
289 f30->has_led = buf[0] & RMI_F30_HAS_LED; in rmi_f30_initialize()
290 f30->has_gpio = buf[0] & RMI_F30_HAS_GPIO; in rmi_f30_initialize()
291 f30->has_haptic = buf[0] & RMI_F30_HAS_HAPTIC; in rmi_f30_initialize()
292 f30->has_gpio_driver_control = buf[0] & RMI_F30_HAS_GPIO_DRV_CTL; in rmi_f30_initialize()
293 f30->has_mech_mouse_btns = buf[0] & RMI_F30_HAS_MECH_MOUSE_BTNS; in rmi_f30_initialize()
294 f30->gpioled_count = buf[1] & RMI_F30_GPIO_LED_COUNT; in rmi_f30_initialize()
296 f30->register_count = DIV_ROUND_UP(f30->gpioled_count, 8); in rmi_f30_initialize()
298 if (f30->has_gpio && f30->has_led) in rmi_f30_initialize()
299 rmi_f30_set_ctrl_data(&f30->ctrl[0], &control_address, in rmi_f30_initialize()
300 f30->register_count, &ctrl_reg); in rmi_f30_initialize()
302 rmi_f30_set_ctrl_data(&f30->ctrl[1], &control_address, in rmi_f30_initialize()
305 if (f30->has_gpio) { in rmi_f30_initialize()
306 rmi_f30_set_ctrl_data(&f30->ctrl[2], &control_address, in rmi_f30_initialize()
307 f30->register_count, &ctrl_reg); in rmi_f30_initialize()
309 rmi_f30_set_ctrl_data(&f30->ctrl[3], &control_address, in rmi_f30_initialize()
310 f30->register_count, &ctrl_reg); in rmi_f30_initialize()
313 if (f30->has_led) { in rmi_f30_initialize()
314 rmi_f30_set_ctrl_data(&f30->ctrl[4], &control_address, in rmi_f30_initialize()
315 f30->register_count, &ctrl_reg); in rmi_f30_initialize()
317 rmi_f30_set_ctrl_data(&f30->ctrl[5], &control_address, in rmi_f30_initialize()
318 f30->has_extended_pattern ? 6 : 2, in rmi_f30_initialize()
322 if (f30->has_led || f30->has_gpio_driver_control) { in rmi_f30_initialize()
324 rmi_f30_set_ctrl_data(&f30->ctrl[6], &control_address, in rmi_f30_initialize()
325 f30->gpioled_count, &ctrl_reg); in rmi_f30_initialize()
328 if (f30->has_mappable_buttons) { in rmi_f30_initialize()
330 rmi_f30_set_ctrl_data(&f30->ctrl[7], &control_address, in rmi_f30_initialize()
331 f30->gpioled_count, &ctrl_reg); in rmi_f30_initialize()
334 if (f30->has_haptic) { in rmi_f30_initialize()
335 rmi_f30_set_ctrl_data(&f30->ctrl[8], &control_address, in rmi_f30_initialize()
336 f30->register_count, &ctrl_reg); in rmi_f30_initialize()
338 rmi_f30_set_ctrl_data(&f30->ctrl[9], &control_address, in rmi_f30_initialize()
342 if (f30->has_mech_mouse_btns) in rmi_f30_initialize()
343 rmi_f30_set_ctrl_data(&f30->ctrl[10], &control_address, in rmi_f30_initialize()
346 f30->ctrl_regs_size = ctrl_reg - in rmi_f30_initialize()
347 f30->ctrl_regs ?: RMI_F30_CTRL_REGS_MAX_SIZE; in rmi_f30_initialize()
349 error = rmi_f30_read_control_parameters(fn, f30); in rmi_f30_initialize()
357 if (f30->has_gpio) { in rmi_f30_initialize()
358 error = rmi_f30_map_gpios(fn, f30); in rmi_f30_initialize()
372 struct f30_data *f30; in rmi_f30_probe() local
383 f30 = devm_kzalloc(&fn->dev, sizeof(*f30), GFP_KERNEL); in rmi_f30_probe()
384 if (!f30) in rmi_f30_probe()
387 f30->input = drv_data->input; in rmi_f30_probe()
389 error = rmi_f30_initialize(fn, f30); in rmi_f30_probe()
393 dev_set_drvdata(&fn->dev, f30); in rmi_f30_probe()