Lines Matching refs:smo8800

32 	struct smo8800_device *smo8800 = data;  in smo8800_interrupt_quick()  local
34 atomic_inc(&smo8800->counter); in smo8800_interrupt_quick()
35 wake_up_interruptible(&smo8800->misc_wait); in smo8800_interrupt_quick()
41 struct smo8800_device *smo8800 = data; in smo8800_interrupt_thread() local
43 dev_info(smo8800->dev, "detected free fall\n"); in smo8800_interrupt_thread()
81 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_read() local
91 atomic_set(&smo8800->counter, 0); in smo8800_misc_read()
92 retval = wait_event_interruptible(smo8800->misc_wait, in smo8800_misc_read()
93 (data = atomic_xchg(&smo8800->counter, 0))); in smo8800_misc_read()
113 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_open() local
116 if (test_and_set_bit(0, &smo8800->misc_opened)) in smo8800_misc_open()
119 atomic_set(&smo8800->counter, 0); in smo8800_misc_open()
125 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_release() local
128 clear_bit(0, &smo8800->misc_opened); /* release the device */ in smo8800_misc_release()
142 struct smo8800_device *smo8800; in smo8800_add() local
144 smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL); in smo8800_add()
145 if (!smo8800) { in smo8800_add()
150 smo8800->dev = &device->dev; in smo8800_add()
151 smo8800->miscdev.minor = MISC_DYNAMIC_MINOR; in smo8800_add()
152 smo8800->miscdev.name = "freefall"; in smo8800_add()
153 smo8800->miscdev.fops = &smo8800_misc_fops; in smo8800_add()
155 init_waitqueue_head(&smo8800->misc_wait); in smo8800_add()
157 err = misc_register(&smo8800->miscdev); in smo8800_add()
163 device->driver_data = smo8800; in smo8800_add()
165 smo8800->irq = smo8800_get_irq(device); in smo8800_add()
166 if (!smo8800->irq) { in smo8800_add()
172 err = request_threaded_irq(smo8800->irq, smo8800_interrupt_quick, in smo8800_add()
175 DRIVER_NAME, smo8800); in smo8800_add()
179 smo8800->irq, err); in smo8800_add()
184 smo8800->irq); in smo8800_add()
188 misc_deregister(&smo8800->miscdev); in smo8800_add()
194 struct smo8800_device *smo8800 = device->driver_data; in smo8800_remove() local
196 free_irq(smo8800->irq, smo8800); in smo8800_remove()
197 misc_deregister(&smo8800->miscdev); in smo8800_remove()