Lines Matching refs:pdata

194 	struct adxl34x_platform_data pdata;  member
258 struct adxl34x_platform_data *pdata = &ac->pdata; in adxl34x_service_ev_fifo() local
263 input_event(ac->input, pdata->ev_type, pdata->ev_code_x, in adxl34x_service_ev_fifo()
265 input_event(ac->input, pdata->ev_type, pdata->ev_code_y, in adxl34x_service_ev_fifo()
267 input_event(ac->input, pdata->ev_type, pdata->ev_code_z, in adxl34x_service_ev_fifo()
279 struct adxl34x_platform_data *pdata, int status, int press) in adxl34x_send_key_events() argument
286 pdata->ev_code_tap[i], press); in adxl34x_send_key_events()
291 struct adxl34x_platform_data *pdata, int status) in adxl34x_do_tap() argument
293 adxl34x_send_key_events(ac, pdata, status, true); in adxl34x_do_tap()
295 adxl34x_send_key_events(ac, pdata, status, false); in adxl34x_do_tap()
301 struct adxl34x_platform_data *pdata = &ac->pdata; in adxl34x_irq() local
309 if (pdata->tap_axis_control & (TAP_X_EN | TAP_Y_EN | TAP_Z_EN)) in adxl34x_irq()
317 adxl34x_report_key_single(ac->input, pdata->ev_code_ff); in adxl34x_irq()
323 adxl34x_do_tap(ac, pdata, tap_stat); in adxl34x_irq()
326 adxl34x_do_tap(ac, pdata, tap_stat); in adxl34x_irq()
329 if (pdata->ev_code_act_inactivity) { in adxl34x_irq()
332 pdata->ev_code_act_inactivity, 1); in adxl34x_irq()
335 pdata->ev_code_act_inactivity, 0); in adxl34x_irq()
341 if (pdata->orientation_enable) { in adxl34x_irq()
343 if ((pdata->orientation_enable & ADXL_EN_ORIENTATION_2D) && in adxl34x_irq()
351 pdata->ev_codes_orient_2d[orient_code]); in adxl34x_irq()
355 if ((pdata->orientation_enable & ADXL_EN_ORIENTATION_3D) && in adxl34x_irq()
363 pdata->ev_codes_orient_3d[orient_code]); in adxl34x_irq()
370 if (pdata->fifo_mode) in adxl34x_irq()
412 AC_WRITE(ac, POWER_CTL, ac->pdata.power_mode | PCTL_MEASURE); in __adxl34x_enable()
535 return sprintf(buf, "%u\n", RATE(ac->pdata.data_rate)); in adxl34x_rate_show()
552 ac->pdata.data_rate = RATE(val); in adxl34x_rate_store()
554 ac->pdata.data_rate | in adxl34x_rate_store()
555 (ac->pdata.low_power_mode ? LOW_POWER : 0)); in adxl34x_rate_store()
570 ac->pdata.power_mode & (PCTL_AUTO_SLEEP | PCTL_LINK) ? 1 : 0); in adxl34x_autosleep_show()
588 ac->pdata.power_mode |= (PCTL_AUTO_SLEEP | PCTL_LINK); in adxl34x_autosleep_store()
590 ac->pdata.power_mode &= ~(PCTL_AUTO_SLEEP | PCTL_LINK); in adxl34x_autosleep_store()
593 AC_WRITE(ac, POWER_CTL, ac->pdata.power_mode | PCTL_MEASURE); in adxl34x_autosleep_store()
697 const struct adxl34x_platform_data *pdata; in adxl34x_probe() local
716 pdata = dev_get_platdata(dev); in adxl34x_probe()
717 if (!pdata) { in adxl34x_probe()
720 pdata = &adxl34x_default_init; in adxl34x_probe()
723 ac->pdata = *pdata; in adxl34x_probe()
724 pdata = &ac->pdata; in adxl34x_probe()
760 __set_bit(ac->pdata.ev_type, input_dev->evbit); in adxl34x_probe()
762 if (ac->pdata.ev_type == EV_REL) { in adxl34x_probe()
772 if (pdata->data_range & FULL_RES) in adxl34x_probe()
783 __set_bit(pdata->ev_code_tap[ADXL_X_AXIS], input_dev->keybit); in adxl34x_probe()
784 __set_bit(pdata->ev_code_tap[ADXL_Y_AXIS], input_dev->keybit); in adxl34x_probe()
785 __set_bit(pdata->ev_code_tap[ADXL_Z_AXIS], input_dev->keybit); in adxl34x_probe()
787 if (pdata->ev_code_ff) { in adxl34x_probe()
789 __set_bit(pdata->ev_code_ff, input_dev->keybit); in adxl34x_probe()
792 if (pdata->ev_code_act_inactivity) in adxl34x_probe()
793 __set_bit(pdata->ev_code_act_inactivity, input_dev->keybit); in adxl34x_probe()
797 if (pdata->watermark) { in adxl34x_probe()
799 if (!FIFO_MODE(pdata->fifo_mode)) in adxl34x_probe()
800 ac->pdata.fifo_mode |= FIFO_STREAM; in adxl34x_probe()
805 if (pdata->tap_axis_control & (TAP_X_EN | TAP_Y_EN | TAP_Z_EN)) in adxl34x_probe()
808 if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS) in adxl34x_probe()
829 AC_WRITE(ac, OFSX, pdata->x_axis_offset); in adxl34x_probe()
830 ac->hwcal.x = pdata->x_axis_offset; in adxl34x_probe()
831 AC_WRITE(ac, OFSY, pdata->y_axis_offset); in adxl34x_probe()
832 ac->hwcal.y = pdata->y_axis_offset; in adxl34x_probe()
833 AC_WRITE(ac, OFSZ, pdata->z_axis_offset); in adxl34x_probe()
834 ac->hwcal.z = pdata->z_axis_offset; in adxl34x_probe()
835 AC_WRITE(ac, THRESH_TAP, pdata->tap_threshold); in adxl34x_probe()
836 AC_WRITE(ac, DUR, pdata->tap_duration); in adxl34x_probe()
837 AC_WRITE(ac, LATENT, pdata->tap_latency); in adxl34x_probe()
838 AC_WRITE(ac, WINDOW, pdata->tap_window); in adxl34x_probe()
839 AC_WRITE(ac, THRESH_ACT, pdata->activity_threshold); in adxl34x_probe()
840 AC_WRITE(ac, THRESH_INACT, pdata->inactivity_threshold); in adxl34x_probe()
841 AC_WRITE(ac, TIME_INACT, pdata->inactivity_time); in adxl34x_probe()
842 AC_WRITE(ac, THRESH_FF, pdata->free_fall_threshold); in adxl34x_probe()
843 AC_WRITE(ac, TIME_FF, pdata->free_fall_time); in adxl34x_probe()
844 AC_WRITE(ac, TAP_AXES, pdata->tap_axis_control); in adxl34x_probe()
845 AC_WRITE(ac, ACT_INACT_CTL, pdata->act_axis_control); in adxl34x_probe()
846 AC_WRITE(ac, BW_RATE, RATE(ac->pdata.data_rate) | in adxl34x_probe()
847 (pdata->low_power_mode ? LOW_POWER : 0)); in adxl34x_probe()
848 AC_WRITE(ac, DATA_FORMAT, pdata->data_range); in adxl34x_probe()
849 AC_WRITE(ac, FIFO_CTL, FIFO_MODE(pdata->fifo_mode) | in adxl34x_probe()
850 SAMPLES(pdata->watermark)); in adxl34x_probe()
852 if (pdata->use_int2) { in adxl34x_probe()
860 if (ac->model == 346 && ac->pdata.orientation_enable) { in adxl34x_probe()
862 ORIENT_DEADZONE(ac->pdata.deadzone_angle) | in adxl34x_probe()
863 ORIENT_DIVISOR(ac->pdata.divisor_length)); in adxl34x_probe()
868 if (pdata->orientation_enable & ADXL_EN_ORIENTATION_3D) in adxl34x_probe()
869 for (i = 0; i < ARRAY_SIZE(pdata->ev_codes_orient_3d); i++) in adxl34x_probe()
870 __set_bit(pdata->ev_codes_orient_3d[i], in adxl34x_probe()
873 if (pdata->orientation_enable & ADXL_EN_ORIENTATION_2D) in adxl34x_probe()
874 for (i = 0; i < ARRAY_SIZE(pdata->ev_codes_orient_2d); i++) in adxl34x_probe()
875 __set_bit(pdata->ev_codes_orient_2d[i], in adxl34x_probe()
878 ac->pdata.orientation_enable = 0; in adxl34x_probe()
883 ac->pdata.power_mode &= (PCTL_AUTO_SLEEP | PCTL_LINK); in adxl34x_probe()