Lines Matching refs:bigben
190 struct bigben_device *bigben = container_of(work, in bigben_worker() local
192 struct hid_field *report_field = bigben->report->field[0]; in bigben_worker()
194 if (bigben->removed || !report_field) in bigben_worker()
197 if (bigben->work_led) { in bigben_worker()
198 bigben->work_led = false; in bigben_worker()
201 report_field->value[2] = bigben->led_state; in bigben_worker()
207 hid_hw_request(bigben->hid, bigben->report, HID_REQ_SET_REPORT); in bigben_worker()
210 if (bigben->work_ff) { in bigben_worker()
211 bigben->work_ff = false; in bigben_worker()
214 report_field->value[2] = bigben->right_motor_on; in bigben_worker()
215 report_field->value[3] = bigben->left_motor_force; in bigben_worker()
220 hid_hw_request(bigben->hid, bigben->report, HID_REQ_SET_REPORT); in bigben_worker()
228 struct bigben_device *bigben = hid_get_drvdata(hid); in hid_bigben_play_effect() local
232 if (!bigben) { in hid_bigben_play_effect()
243 if (right_motor_on != bigben->right_motor_on || in hid_bigben_play_effect()
244 left_motor_force != bigben->left_motor_force) { in hid_bigben_play_effect()
245 bigben->right_motor_on = right_motor_on; in hid_bigben_play_effect()
246 bigben->left_motor_force = left_motor_force; in hid_bigben_play_effect()
247 bigben->work_ff = true; in hid_bigben_play_effect()
248 schedule_work(&bigben->worker); in hid_bigben_play_effect()
259 struct bigben_device *bigben = hid_get_drvdata(hid); in bigben_set_led() local
263 if (!bigben) { in bigben_set_led()
269 if (led == bigben->leds[n]) { in bigben_set_led()
271 work = (bigben->led_state & BIT(n)); in bigben_set_led()
272 bigben->led_state &= ~BIT(n); in bigben_set_led()
274 work = !(bigben->led_state & BIT(n)); in bigben_set_led()
275 bigben->led_state |= BIT(n); in bigben_set_led()
279 bigben->work_led = true; in bigben_set_led()
280 schedule_work(&bigben->worker); in bigben_set_led()
291 struct bigben_device *bigben = hid_get_drvdata(hid); in bigben_get_led() local
294 if (!bigben) { in bigben_get_led()
300 if (led == bigben->leds[n]) in bigben_get_led()
301 return (bigben->led_state & BIT(n)) ? LED_ON : LED_OFF; in bigben_get_led()
309 struct bigben_device *bigben = hid_get_drvdata(hid); in bigben_remove() local
311 bigben->removed = true; in bigben_remove()
312 cancel_work_sync(&bigben->worker); in bigben_remove()
319 struct bigben_device *bigben; in bigben_probe() local
327 bigben = devm_kzalloc(&hid->dev, sizeof(*bigben), GFP_KERNEL); in bigben_probe()
328 if (!bigben) in bigben_probe()
330 hid_set_drvdata(hid, bigben); in bigben_probe()
331 bigben->hid = hid; in bigben_probe()
332 bigben->removed = false; in bigben_probe()
347 bigben->report = list_entry(report_list->next, in bigben_probe()
359 INIT_WORK(&bigben->worker, bigben_worker); in bigben_probe()
388 bigben->leds[n] = led; in bigben_probe()
395 bigben->led_state = BIT(0); in bigben_probe()
396 bigben->right_motor_on = 0; in bigben_probe()
397 bigben->left_motor_force = 0; in bigben_probe()
398 bigben->work_led = true; in bigben_probe()
399 bigben->work_ff = true; in bigben_probe()
400 schedule_work(&bigben->worker); in bigben_probe()