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()
83 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_open() local
86 if (test_and_set_bit(0, &smo8800->misc_opened)) in smo8800_misc_open()
89 atomic_set(&smo8800->counter, 0); in smo8800_misc_open()
95 struct smo8800_device *smo8800 = container_of(file->private_data, in smo8800_misc_release() local
98 clear_bit(0, &smo8800->misc_opened); /* release the device */ in smo8800_misc_release()
112 struct smo8800_device *smo8800; in smo8800_probe() local
114 smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL); in smo8800_probe()
115 if (!smo8800) { in smo8800_probe()
120 smo8800->dev = &device->dev; in smo8800_probe()
121 smo8800->miscdev.minor = MISC_DYNAMIC_MINOR; in smo8800_probe()
122 smo8800->miscdev.name = "freefall"; in smo8800_probe()
123 smo8800->miscdev.fops = &smo8800_misc_fops; in smo8800_probe()
125 init_waitqueue_head(&smo8800->misc_wait); in smo8800_probe()
127 err = misc_register(&smo8800->miscdev); in smo8800_probe()
133 platform_set_drvdata(device, smo8800); in smo8800_probe()
138 smo8800->irq = err; in smo8800_probe()
140 err = request_threaded_irq(smo8800->irq, smo8800_interrupt_quick, in smo8800_probe()
143 DRIVER_NAME, smo8800); in smo8800_probe()
147 smo8800->irq, err); in smo8800_probe()
152 smo8800->irq); in smo8800_probe()
156 misc_deregister(&smo8800->miscdev); in smo8800_probe()
162 struct smo8800_device *smo8800 = platform_get_drvdata(device); in smo8800_remove() local
164 free_irq(smo8800->irq, smo8800); in smo8800_remove()
165 misc_deregister(&smo8800->miscdev); in smo8800_remove()