bma150 181 drivers/input/misc/bma150.c static int bma150_set_mode(struct bma150_data *bma150, u8 mode) bma150 185 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, mode, BMA150_WAKE_UP_POS, bma150 190 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, mode, BMA150_SLEEP_POS, bma150 198 drivers/input/misc/bma150.c bma150->mode = mode; bma150 202 drivers/input/misc/bma150.c static int bma150_soft_reset(struct bma150_data *bma150) bma150 206 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, 1, BMA150_SW_RES_POS, bma150 215 drivers/input/misc/bma150.c static int bma150_set_range(struct bma150_data *bma150, u8 range) bma150 217 drivers/input/misc/bma150.c return bma150_set_reg_bits(bma150->client, range, BMA150_RANGE_POS, bma150 221 drivers/input/misc/bma150.c static int bma150_set_bandwidth(struct bma150_data *bma150, u8 bw) bma150 223 drivers/input/misc/bma150.c return bma150_set_reg_bits(bma150->client, bw, BMA150_BANDWIDTH_POS, bma150 227 drivers/input/misc/bma150.c static int bma150_set_low_g_interrupt(struct bma150_data *bma150, bma150 232 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, hyst, bma150 238 drivers/input/misc/bma150.c error = bma150_write_byte(bma150->client, BMA150_LOW_G_DUR_REG, dur); bma150 242 drivers/input/misc/bma150.c error = bma150_write_byte(bma150->client, BMA150_LOW_G_THRES_REG, thres); bma150 246 drivers/input/misc/bma150.c return bma150_set_reg_bits(bma150->client, !!enable, bma150 251 drivers/input/misc/bma150.c static int bma150_set_high_g_interrupt(struct bma150_data *bma150, bma150 256 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, hyst, bma150 262 drivers/input/misc/bma150.c error = bma150_write_byte(bma150->client, bma150 267 drivers/input/misc/bma150.c error = bma150_write_byte(bma150->client, bma150 272 drivers/input/misc/bma150.c return bma150_set_reg_bits(bma150->client, !!enable, bma150 278 drivers/input/misc/bma150.c static int bma150_set_any_motion_interrupt(struct bma150_data *bma150, bma150 283 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, dur, bma150 290 drivers/input/misc/bma150.c error = bma150_write_byte(bma150->client, bma150 295 drivers/input/misc/bma150.c error = bma150_set_reg_bits(bma150->client, !!enable, bma150 301 drivers/input/misc/bma150.c return bma150_set_reg_bits(bma150->client, !!enable, bma150 307 drivers/input/misc/bma150.c static void bma150_report_xyz(struct bma150_data *bma150) bma150 313 drivers/input/misc/bma150.c ret = i2c_smbus_read_i2c_block_data(bma150->client, bma150 326 drivers/input/misc/bma150.c input_report_abs(bma150->input, ABS_X, x); bma150 327 drivers/input/misc/bma150.c input_report_abs(bma150->input, ABS_Y, y); bma150 328 drivers/input/misc/bma150.c input_report_abs(bma150->input, ABS_Z, z); bma150 329 drivers/input/misc/bma150.c input_sync(bma150->input); bma150 344 drivers/input/misc/bma150.c static int bma150_open(struct bma150_data *bma150) bma150 348 drivers/input/misc/bma150.c error = pm_runtime_get_sync(&bma150->client->dev); bma150 356 drivers/input/misc/bma150.c if (bma150->mode != BMA150_MODE_NORMAL) { bma150 357 drivers/input/misc/bma150.c error = bma150_set_mode(bma150, BMA150_MODE_NORMAL); bma150 365 drivers/input/misc/bma150.c static void bma150_close(struct bma150_data *bma150) bma150 367 drivers/input/misc/bma150.c pm_runtime_put_sync(&bma150->client->dev); bma150 369 drivers/input/misc/bma150.c if (bma150->mode != BMA150_MODE_SLEEP) bma150 370 drivers/input/misc/bma150.c bma150_set_mode(bma150, BMA150_MODE_SLEEP); bma150 375 drivers/input/misc/bma150.c struct bma150_data *bma150 = input_get_drvdata(input); bma150 377 drivers/input/misc/bma150.c return bma150_open(bma150); bma150 382 drivers/input/misc/bma150.c struct bma150_data *bma150 = input_get_drvdata(input); bma150 384 drivers/input/misc/bma150.c bma150_close(bma150); bma150 389 drivers/input/misc/bma150.c struct bma150_data *bma150 = ipoll_dev->private; bma150 391 drivers/input/misc/bma150.c bma150_open(bma150); bma150 396 drivers/input/misc/bma150.c struct bma150_data *bma150 = ipoll_dev->private; bma150 398 drivers/input/misc/bma150.c bma150_close(bma150); bma150 401 drivers/input/misc/bma150.c static int bma150_initialize(struct bma150_data *bma150, bma150 406 drivers/input/misc/bma150.c error = bma150_soft_reset(bma150); bma150 410 drivers/input/misc/bma150.c error = bma150_set_bandwidth(bma150, cfg->bandwidth); bma150 414 drivers/input/misc/bma150.c error = bma150_set_range(bma150, cfg->range); bma150 418 drivers/input/misc/bma150.c if (bma150->client->irq) { bma150 419 drivers/input/misc/bma150.c error = bma150_set_any_motion_interrupt(bma150, bma150 426 drivers/input/misc/bma150.c error = bma150_set_high_g_interrupt(bma150, bma150 432 drivers/input/misc/bma150.c error = bma150_set_low_g_interrupt(bma150, bma150 439 drivers/input/misc/bma150.c return bma150_set_mode(bma150, BMA150_MODE_SLEEP); bma150 442 drivers/input/misc/bma150.c static void bma150_init_input_device(struct bma150_data *bma150, bma150 448 drivers/input/misc/bma150.c idev->dev.parent = &bma150->client->dev; bma150 456 drivers/input/misc/bma150.c static int bma150_register_input_device(struct bma150_data *bma150) bma150 465 drivers/input/misc/bma150.c bma150_init_input_device(bma150, idev); bma150 469 drivers/input/misc/bma150.c input_set_drvdata(idev, bma150); bma150 471 drivers/input/misc/bma150.c bma150->input = idev; bma150 482 drivers/input/misc/bma150.c static int bma150_register_polled_device(struct bma150_data *bma150) bma150 491 drivers/input/misc/bma150.c ipoll_dev->private = bma150; bma150 499 drivers/input/misc/bma150.c bma150_init_input_device(bma150, ipoll_dev->input); bma150 501 drivers/input/misc/bma150.c bma150->input_polled = ipoll_dev; bma150 502 drivers/input/misc/bma150.c bma150->input = ipoll_dev->input; bma150 519 drivers/input/misc/bma150.c struct bma150_data *bma150; bma150 534 drivers/input/misc/bma150.c bma150 = kzalloc(sizeof(struct bma150_data), GFP_KERNEL); bma150 535 drivers/input/misc/bma150.c if (!bma150) bma150 538 drivers/input/misc/bma150.c bma150->client = client; bma150 555 drivers/input/misc/bma150.c error = bma150_initialize(bma150, cfg); bma150 560 drivers/input/misc/bma150.c error = bma150_register_input_device(bma150); bma150 567 drivers/input/misc/bma150.c BMA150_DRIVER, bma150); bma150 572 drivers/input/misc/bma150.c input_unregister_device(bma150->input); bma150 576 drivers/input/misc/bma150.c error = bma150_register_polled_device(bma150); bma150 581 drivers/input/misc/bma150.c i2c_set_clientdata(client, bma150); bma150 588 drivers/input/misc/bma150.c kfree(bma150); bma150 594 drivers/input/misc/bma150.c struct bma150_data *bma150 = i2c_get_clientdata(client); bma150 599 drivers/input/misc/bma150.c free_irq(client->irq, bma150); bma150 600 drivers/input/misc/bma150.c input_unregister_device(bma150->input); bma150 602 drivers/input/misc/bma150.c input_unregister_polled_device(bma150->input_polled); bma150 603 drivers/input/misc/bma150.c input_free_polled_device(bma150->input_polled); bma150 606 drivers/input/misc/bma150.c kfree(bma150); bma150 615 drivers/input/misc/bma150.c struct bma150_data *bma150 = i2c_get_clientdata(client); bma150 617 drivers/input/misc/bma150.c return bma150_set_mode(bma150, BMA150_MODE_SLEEP); bma150 623 drivers/input/misc/bma150.c struct bma150_data *bma150 = i2c_get_clientdata(client); bma150 625 drivers/input/misc/bma150.c return bma150_set_mode(bma150, BMA150_MODE_NORMAL);