Lines Matching refs:ams_info
19 struct ams ams_info; variable
28 u32 orient = ams_info.vflag? ams_info.orient1 : ams_info.orient2; in ams_sensors()
32 ams_info.get_xyz(y, x, z); in ams_sensors()
34 ams_info.get_xyz(x, y, z); in ams_sensors()
49 mutex_lock(&ams_info.lock); in ams_show_current()
51 mutex_unlock(&ams_info.lock); in ams_show_current()
62 spin_lock(&ams_info.irq_lock); in ams_handle_irq()
64 ams_info.worker_irqs |= irq; in ams_handle_irq()
65 schedule_work(&ams_info.worker); in ams_handle_irq()
67 spin_unlock(&ams_info.irq_lock); in ams_handle_irq()
92 mutex_lock(&ams_info.lock); in ams_worker()
94 spin_lock_irqsave(&ams_info.irq_lock, flags); in ams_worker()
95 irqs_to_clear = ams_info.worker_irqs; in ams_worker()
97 if (ams_info.worker_irqs & AMS_IRQ_FREEFALL) { in ams_worker()
101 ams_info.worker_irqs &= ~AMS_IRQ_FREEFALL; in ams_worker()
104 if (ams_info.worker_irqs & AMS_IRQ_SHOCK) { in ams_worker()
108 ams_info.worker_irqs &= ~AMS_IRQ_SHOCK; in ams_worker()
111 spin_unlock_irqrestore(&ams_info.irq_lock, flags); in ams_worker()
113 ams_info.clear_irq(irqs_to_clear); in ams_worker()
115 mutex_unlock(&ams_info.lock); in ams_worker()
125 prop = of_get_property(ams_info.of_node, "orientation", NULL); in ams_sensor_attach()
128 ams_info.orient1 = *prop; in ams_sensor_attach()
129 ams_info.orient2 = *(prop + 1); in ams_sensor_attach()
132 result = pmf_register_irq_client(ams_info.of_node, in ams_sensor_attach()
139 ams_info.worker_irqs = 0; in ams_sensor_attach()
142 result = pmf_register_irq_client(ams_info.of_node, in ams_sensor_attach()
149 ams_info.of_dev = of_platform_device_create(ams_info.of_node, "ams", NULL); in ams_sensor_attach()
150 if (!ams_info.of_dev) { in ams_sensor_attach()
156 result = device_create_file(&ams_info.of_dev->dev, &dev_attr_current); in ams_sensor_attach()
160 ams_info.vflag = !!(ams_info.get_vendor() & 0x10); in ams_sensor_attach()
169 device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); in ams_sensor_attach()
171 of_device_unregister(ams_info.of_dev); in ams_sensor_attach()
183 spin_lock_init(&ams_info.irq_lock); in ams_init()
184 mutex_init(&ams_info.lock); in ams_init()
185 INIT_WORK(&ams_info.worker, ams_worker); in ams_init()
209 device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); in ams_sensor_detach()
216 flush_work(&ams_info.worker); in ams_sensor_detach()
219 of_device_unregister(ams_info.of_dev); in ams_sensor_detach()
229 ams_info.exit(); in ams_exit()