Lines Matching refs:fn
67 struct rmi_function *fn = sensor->fn; in rmi_f12_read_sensor_tuning() local
68 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f12_read_sensor_tuning()
79 dev_err(&fn->dev, in rmi_f12_read_sensor_tuning()
87 dev_err(&fn->dev, in rmi_f12_read_sensor_tuning()
93 ret = rmi_read_block(rmi_dev, fn->fd.control_base_addr + offset, buf, in rmi_f12_read_sensor_tuning()
105 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: max_x: %d max_y: %d\n", __func__, in rmi_f12_read_sensor_tuning()
116 rmi_dbg(RMI_DEBUG_FN, &fn->dev, in rmi_f12_read_sensor_tuning()
138 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: x_mm: %d y_mm: %d\n", __func__, in rmi_f12_read_sensor_tuning()
201 struct rmi_function *fn = ctx; in rmi_f12_attention() local
202 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f12_attention()
204 struct f12_data *f12 = dev_get_drvdata(&fn->dev); in rmi_f12_attention()
221 dev_err(&fn->dev, "Failed to read object data. Code: %d.\n", in rmi_f12_attention()
236 static int rmi_f12_write_control_regs(struct rmi_function *fn) in rmi_f12_write_control_regs() argument
240 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f12_write_control_regs()
241 struct f12_data *f12 = dev_get_drvdata(&fn->dev); in rmi_f12_write_control_regs()
262 ret = rmi_read_block(rmi_dev, fn->fd.control_base_addr in rmi_f12_write_control_regs()
283 fn->fd.control_base_addr + control_offset, in rmi_f12_write_control_regs()
294 static int rmi_f12_config(struct rmi_function *fn) in rmi_f12_config() argument
296 struct rmi_driver *drv = fn->rmi_dev->driver; in rmi_f12_config()
297 struct f12_data *f12 = dev_get_drvdata(&fn->dev); in rmi_f12_config()
304 drv->clear_irq_bits(fn->rmi_dev, f12->abs_mask); in rmi_f12_config()
306 drv->set_irq_bits(fn->rmi_dev, f12->abs_mask); in rmi_f12_config()
308 drv->clear_irq_bits(fn->rmi_dev, f12->rel_mask); in rmi_f12_config()
310 ret = rmi_f12_write_control_regs(fn); in rmi_f12_config()
312 dev_warn(&fn->dev, in rmi_f12_config()
318 static int rmi_f12_probe(struct rmi_function *fn) in rmi_f12_probe() argument
322 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_f12_probe()
324 u16 query_addr = fn->fd.query_base_addr; in rmi_f12_probe()
332 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s\n", __func__); in rmi_f12_probe()
336 ret = rmi_read(fn->rmi_dev, query_addr, &buf); in rmi_f12_probe()
338 dev_err(&fn->dev, "Failed to read general info register: %d\n", in rmi_f12_probe()
345 dev_err(&fn->dev, in rmi_f12_probe()
350 f12 = devm_kzalloc(&fn->dev, sizeof(struct f12_data) + mask_size * 2, in rmi_f12_probe()
360 set_bit(fn->irq_pos, f12->abs_mask); in rmi_f12_probe()
361 set_bit(fn->irq_pos + 1, f12->rel_mask); in rmi_f12_probe()
365 if (fn->dev.of_node) { in rmi_f12_probe()
366 ret = rmi_2d_sensor_of_probe(&fn->dev, &f12->sensor_pdata); in rmi_f12_probe()
376 dev_err(&fn->dev, in rmi_f12_probe()
386 dev_err(&fn->dev, in rmi_f12_probe()
396 dev_err(&fn->dev, in rmi_f12_probe()
404 sensor->fn = fn; in rmi_f12_probe()
405 f12->data_addr = fn->fd.data_base_addr; in rmi_f12_probe()
419 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: data packet size: %d\n", __func__, in rmi_f12_probe()
421 sensor->data_pkt = devm_kzalloc(&fn->dev, sensor->pkt_size, GFP_KERNEL); in rmi_f12_probe()
425 dev_set_drvdata(&fn->dev, f12); in rmi_f12_probe()
524 sensor->tracking_pos = devm_kcalloc(&fn->dev, in rmi_f12_probe()
527 sensor->tracking_slots = devm_kcalloc(&fn->dev, in rmi_f12_probe()
529 sensor->objs = devm_kcalloc(&fn->dev, in rmi_f12_probe()
536 ret = rmi_2d_sensor_configure_input(fn, sensor); in rmi_f12_probe()