Lines Matching refs:as5011
116 struct as5011_device *as5011 = dev_id; in as5011_button_interrupt() local
117 int val = gpio_get_value_cansleep(as5011->button_gpio); in as5011_button_interrupt()
119 input_report_key(as5011->input_dev, BTN_JOYSTICK, !val); in as5011_button_interrupt()
120 input_sync(as5011->input_dev); in as5011_button_interrupt()
127 struct as5011_device *as5011 = dev_id; in as5011_axis_interrupt() local
131 error = as5011_i2c_read(as5011->i2c_client, AS5011_X_RES_INT, &x); in as5011_axis_interrupt()
135 error = as5011_i2c_read(as5011->i2c_client, AS5011_Y_RES_INT, &y); in as5011_axis_interrupt()
139 input_report_abs(as5011->input_dev, ABS_X, x); in as5011_axis_interrupt()
140 input_report_abs(as5011->input_dev, ABS_Y, y); in as5011_axis_interrupt()
141 input_sync(as5011->input_dev); in as5011_axis_interrupt()
147 static int as5011_configure_chip(struct as5011_device *as5011, in as5011_configure_chip() argument
150 struct i2c_client *client = as5011->i2c_client; in as5011_configure_chip()
218 struct as5011_device *as5011; in as5011_probe() local
240 as5011 = kmalloc(sizeof(struct as5011_device), GFP_KERNEL); in as5011_probe()
242 if (!as5011 || !input_dev) { in as5011_probe()
249 as5011->i2c_client = client; in as5011_probe()
250 as5011->input_dev = input_dev; in as5011_probe()
251 as5011->button_gpio = plat_data->button_gpio; in as5011_probe()
252 as5011->axis_irq = plat_data->axis_irq; in as5011_probe()
262 input_set_abs_params(as5011->input_dev, ABS_Y, in as5011_probe()
265 error = gpio_request(as5011->button_gpio, "AS5011 button"); in as5011_probe()
271 irq = gpio_to_irq(as5011->button_gpio); in as5011_probe()
279 as5011->button_irq = irq; in as5011_probe()
281 error = request_threaded_irq(as5011->button_irq, in as5011_probe()
285 "as5011_button", as5011); in as5011_probe()
288 "Can't allocate button irq %d\n", as5011->button_irq); in as5011_probe()
292 error = as5011_configure_chip(as5011, plat_data); in as5011_probe()
296 error = request_threaded_irq(as5011->axis_irq, NULL, in as5011_probe()
299 "as5011_joystick", as5011); in as5011_probe()
306 error = input_register_device(as5011->input_dev); in as5011_probe()
312 i2c_set_clientdata(client, as5011); in as5011_probe()
317 free_irq(as5011->axis_irq, as5011); in as5011_probe()
319 free_irq(as5011->button_irq, as5011); in as5011_probe()
321 gpio_free(as5011->button_gpio); in as5011_probe()
324 kfree(as5011); in as5011_probe()
331 struct as5011_device *as5011 = i2c_get_clientdata(client); in as5011_remove() local
333 free_irq(as5011->axis_irq, as5011); in as5011_remove()
334 free_irq(as5011->button_irq, as5011); in as5011_remove()
335 gpio_free(as5011->button_gpio); in as5011_remove()
337 input_unregister_device(as5011->input_dev); in as5011_remove()
338 kfree(as5011); in as5011_remove()