as5011 116 drivers/input/joystick/as5011.c struct as5011_device *as5011 = dev_id; as5011 117 drivers/input/joystick/as5011.c int val = gpio_get_value_cansleep(as5011->button_gpio); as5011 119 drivers/input/joystick/as5011.c input_report_key(as5011->input_dev, BTN_JOYSTICK, !val); as5011 120 drivers/input/joystick/as5011.c input_sync(as5011->input_dev); as5011 127 drivers/input/joystick/as5011.c struct as5011_device *as5011 = dev_id; as5011 131 drivers/input/joystick/as5011.c error = as5011_i2c_read(as5011->i2c_client, AS5011_X_RES_INT, &x); as5011 135 drivers/input/joystick/as5011.c error = as5011_i2c_read(as5011->i2c_client, AS5011_Y_RES_INT, &y); as5011 139 drivers/input/joystick/as5011.c input_report_abs(as5011->input_dev, ABS_X, x); as5011 140 drivers/input/joystick/as5011.c input_report_abs(as5011->input_dev, ABS_Y, y); as5011 141 drivers/input/joystick/as5011.c input_sync(as5011->input_dev); as5011 147 drivers/input/joystick/as5011.c static int as5011_configure_chip(struct as5011_device *as5011, as5011 150 drivers/input/joystick/as5011.c struct i2c_client *client = as5011->i2c_client; as5011 219 drivers/input/joystick/as5011.c struct as5011_device *as5011; as5011 241 drivers/input/joystick/as5011.c as5011 = kmalloc(sizeof(struct as5011_device), GFP_KERNEL); as5011 243 drivers/input/joystick/as5011.c if (!as5011 || !input_dev) { as5011 250 drivers/input/joystick/as5011.c as5011->i2c_client = client; as5011 251 drivers/input/joystick/as5011.c as5011->input_dev = input_dev; as5011 252 drivers/input/joystick/as5011.c as5011->button_gpio = plat_data->button_gpio; as5011 253 drivers/input/joystick/as5011.c as5011->axis_irq = plat_data->axis_irq; as5011 263 drivers/input/joystick/as5011.c input_set_abs_params(as5011->input_dev, ABS_Y, as5011 266 drivers/input/joystick/as5011.c error = gpio_request(as5011->button_gpio, "AS5011 button"); as5011 272 drivers/input/joystick/as5011.c irq = gpio_to_irq(as5011->button_gpio); as5011 280 drivers/input/joystick/as5011.c as5011->button_irq = irq; as5011 282 drivers/input/joystick/as5011.c error = request_threaded_irq(as5011->button_irq, as5011 286 drivers/input/joystick/as5011.c "as5011_button", as5011); as5011 289 drivers/input/joystick/as5011.c "Can't allocate button irq %d\n", as5011->button_irq); as5011 293 drivers/input/joystick/as5011.c error = as5011_configure_chip(as5011, plat_data); as5011 297 drivers/input/joystick/as5011.c error = request_threaded_irq(as5011->axis_irq, NULL, as5011 300 drivers/input/joystick/as5011.c "as5011_joystick", as5011); as5011 307 drivers/input/joystick/as5011.c error = input_register_device(as5011->input_dev); as5011 313 drivers/input/joystick/as5011.c i2c_set_clientdata(client, as5011); as5011 318 drivers/input/joystick/as5011.c free_irq(as5011->axis_irq, as5011); as5011 320 drivers/input/joystick/as5011.c free_irq(as5011->button_irq, as5011); as5011 322 drivers/input/joystick/as5011.c gpio_free(as5011->button_gpio); as5011 325 drivers/input/joystick/as5011.c kfree(as5011); as5011 332 drivers/input/joystick/as5011.c struct as5011_device *as5011 = i2c_get_clientdata(client); as5011 334 drivers/input/joystick/as5011.c free_irq(as5011->axis_irq, as5011); as5011 335 drivers/input/joystick/as5011.c free_irq(as5011->button_irq, as5011); as5011 336 drivers/input/joystick/as5011.c gpio_free(as5011->button_gpio); as5011 338 drivers/input/joystick/as5011.c input_unregister_device(as5011->input_dev); as5011 339 drivers/input/joystick/as5011.c kfree(as5011);