Lines Matching refs:smo8800

39 	struct smo8800_device *smo8800 = data;  in smo8800_interrupt_quick()  local
41 atomic_inc(&smo8800->counter); in smo8800_interrupt_quick()
42 wake_up_interruptible(&smo8800->misc_wait); in smo8800_interrupt_quick()
48 struct smo8800_device *smo8800 = data; in smo8800_interrupt_thread() local
50 dev_info(smo8800->dev, "detected free fall\n"); in smo8800_interrupt_thread()
88 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_read() local
98 atomic_set(&smo8800->counter, 0); in smo8800_misc_read()
99 retval = wait_event_interruptible(smo8800->misc_wait, in smo8800_misc_read()
100 (data = atomic_xchg(&smo8800->counter, 0))); in smo8800_misc_read()
121 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_open() local
124 if (test_and_set_bit(0, &smo8800->misc_opened)) in smo8800_misc_open()
127 atomic_set(&smo8800->counter, 0); in smo8800_misc_open()
133 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_release() local
136 clear_bit(0, &smo8800->misc_opened); /* release the device */ in smo8800_misc_release()
150 struct smo8800_device *smo8800; in smo8800_add() local
152 smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL); in smo8800_add()
153 if (!smo8800) { in smo8800_add()
158 smo8800->dev = &device->dev; in smo8800_add()
159 smo8800->miscdev.minor = MISC_DYNAMIC_MINOR; in smo8800_add()
160 smo8800->miscdev.name = "freefall"; in smo8800_add()
161 smo8800->miscdev.fops = &smo8800_misc_fops; in smo8800_add()
163 init_waitqueue_head(&smo8800->misc_wait); in smo8800_add()
165 err = misc_register(&smo8800->miscdev); in smo8800_add()
171 device->driver_data = smo8800; in smo8800_add()
173 smo8800->irq = smo8800_get_irq(device); in smo8800_add()
174 if (!smo8800->irq) { in smo8800_add()
180 err = request_threaded_irq(smo8800->irq, smo8800_interrupt_quick, in smo8800_add()
183 DRIVER_NAME, smo8800); in smo8800_add()
187 smo8800->irq, err); in smo8800_add()
192 smo8800->irq); in smo8800_add()
196 misc_deregister(&smo8800->miscdev); in smo8800_add()
202 struct smo8800_device *smo8800 = device->driver_data; in smo8800_remove() local
204 free_irq(smo8800->irq, smo8800); in smo8800_remove()
205 misc_deregister(&smo8800->miscdev); in smo8800_remove()