Lines Matching refs:smo8800
33 struct smo8800_device *smo8800 = data; in smo8800_interrupt_quick() local
35 atomic_inc(&smo8800->counter); in smo8800_interrupt_quick()
36 wake_up_interruptible(&smo8800->misc_wait); in smo8800_interrupt_quick()
42 struct smo8800_device *smo8800 = data; in smo8800_interrupt_thread() local
44 dev_info(smo8800->dev, "detected free fall\n"); in smo8800_interrupt_thread()
51 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_read() local
61 atomic_set(&smo8800->counter, 0); in smo8800_misc_read()
62 retval = wait_event_interruptible(smo8800->misc_wait, in smo8800_misc_read()
63 (data = atomic_xchg(&smo8800->counter, 0))); in smo8800_misc_read()
80 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_open() local
83 if (test_and_set_bit(0, &smo8800->misc_opened)) in smo8800_misc_open()
86 atomic_set(&smo8800->counter, 0); in smo8800_misc_open()
92 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_release() local
95 clear_bit(0, &smo8800->misc_opened); /* release the device */ in smo8800_misc_release()
109 struct smo8800_device *smo8800; in smo8800_probe() local
111 smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL); in smo8800_probe()
112 if (!smo8800) { in smo8800_probe()
117 smo8800->dev = &device->dev; in smo8800_probe()
118 smo8800->miscdev.minor = MISC_DYNAMIC_MINOR; in smo8800_probe()
119 smo8800->miscdev.name = "freefall"; in smo8800_probe()
120 smo8800->miscdev.fops = &smo8800_misc_fops; in smo8800_probe()
122 init_waitqueue_head(&smo8800->misc_wait); in smo8800_probe()
124 err = misc_register(&smo8800->miscdev); in smo8800_probe()
130 platform_set_drvdata(device, smo8800); in smo8800_probe()
135 smo8800->irq = err; in smo8800_probe()
137 err = request_threaded_irq(smo8800->irq, smo8800_interrupt_quick, in smo8800_probe()
140 DRIVER_NAME, smo8800); in smo8800_probe()
144 smo8800->irq, err); in smo8800_probe()
149 smo8800->irq); in smo8800_probe()
153 misc_deregister(&smo8800->miscdev); in smo8800_probe()
159 struct smo8800_device *smo8800 = platform_get_drvdata(device); in smo8800_remove() local
161 free_irq(smo8800->irq, smo8800); in smo8800_remove()
162 misc_deregister(&smo8800->miscdev); in smo8800_remove()