Lines Matching defs:dice

9 #include "dice.h"
14 struct snd_dice *dice = hwdep->private_data;
18 spin_lock_irq(&dice->lock);
20 while (!dice->dev_lock_changed && dice->notification_bits == 0) {
21 prepare_to_wait(&dice->hwdep_wait, &wait, TASK_INTERRUPTIBLE);
22 spin_unlock_irq(&dice->lock);
24 finish_wait(&dice->hwdep_wait, &wait);
27 spin_lock_irq(&dice->lock);
31 if (dice->dev_lock_changed) {
33 event.lock_status.status = dice->dev_lock_count > 0;
34 dice->dev_lock_changed = false;
40 event.dice_notification.notification = dice->notification_bits;
41 dice->notification_bits = 0;
46 spin_unlock_irq(&dice->lock);
57 struct snd_dice *dice = hwdep->private_data;
60 poll_wait(file, &dice->hwdep_wait, wait);
62 spin_lock_irq(&dice->lock);
63 if (dice->dev_lock_changed || dice->notification_bits != 0)
67 spin_unlock_irq(&dice->lock);
72 static int hwdep_get_info(struct snd_dice *dice, void __user *arg)
74 struct fw_device *dev = fw_parent_device(dice->unit);
91 static int hwdep_lock(struct snd_dice *dice)
95 spin_lock_irq(&dice->lock);
97 if (dice->dev_lock_count == 0) {
98 dice->dev_lock_count = -1;
104 spin_unlock_irq(&dice->lock);
109 static int hwdep_unlock(struct snd_dice *dice)
113 spin_lock_irq(&dice->lock);
115 if (dice->dev_lock_count == -1) {
116 dice->dev_lock_count = 0;
122 spin_unlock_irq(&dice->lock);
129 struct snd_dice *dice = hwdep->private_data;
131 spin_lock_irq(&dice->lock);
132 if (dice->dev_lock_count == -1)
133 dice->dev_lock_count = 0;
134 spin_unlock_irq(&dice->lock);
142 struct snd_dice *dice = hwdep->private_data;
146 return hwdep_get_info(dice, (void __user *)arg);
148 return hwdep_lock(dice);
150 return hwdep_unlock(dice);
167 int snd_dice_create_hwdep(struct snd_dice *dice)
179 err = snd_hwdep_new(dice->card, "DICE", 0, &hwdep);
185 hwdep->private_data = dice;