summaryrefslogtreecommitdiffstats
path: root/sound/firewire
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2018-11-22 23:13:04 -0500
committerTakashi Iwai <tiwai@suse.de>2018-11-23 09:31:10 -0500
commit90e8ac5c9d446124a5b43a6f135bf67e060c0c9d (patch)
treee2d794e24286fb5df93e98c3ae1772ed662d57d0 /sound/firewire
parent33b2e1442aeaacabb4e29f8adb31469e87599b16 (diff)
ALSA: firewire-tascam: add new hwdep ioctl command to get state image
In a previous commit, ALSA firewire-tascam driver stores state image from tx isochronous packets. This image includes states of knob, fader, button of control surface, level of gain/volume of each physical inputs/outputs, and so on. It's useful for userspace applications to read whole of the image. This commit adds a unique ioctl command for ALSA hwdep interface for the purpose. For actual meaning of each bits in this image, please refer to discussion in alsa-devel[1]. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2018-October/140785.html Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r--sound/firewire/tascam/tascam-hwdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/firewire/tascam/tascam-hwdep.c b/sound/firewire/tascam/tascam-hwdep.c
index 4e4c1e9020e8..a80397116c48 100644
--- a/sound/firewire/tascam/tascam-hwdep.c
+++ b/sound/firewire/tascam/tascam-hwdep.c
@@ -123,6 +123,14 @@ static int hwdep_unlock(struct snd_tscm *tscm)
123 return err; 123 return err;
124} 124}
125 125
126static int tscm_hwdep_state(struct snd_tscm *tscm, void __user *arg)
127{
128 if (copy_to_user(arg, tscm->state, sizeof(tscm->state)))
129 return -EFAULT;
130
131 return 0;
132}
133
126static int hwdep_release(struct snd_hwdep *hwdep, struct file *file) 134static int hwdep_release(struct snd_hwdep *hwdep, struct file *file)
127{ 135{
128 struct snd_tscm *tscm = hwdep->private_data; 136 struct snd_tscm *tscm = hwdep->private_data;
@@ -147,6 +155,8 @@ static int hwdep_ioctl(struct snd_hwdep *hwdep, struct file *file,
147 return hwdep_lock(tscm); 155 return hwdep_lock(tscm);
148 case SNDRV_FIREWIRE_IOCTL_UNLOCK: 156 case SNDRV_FIREWIRE_IOCTL_UNLOCK:
149 return hwdep_unlock(tscm); 157 return hwdep_unlock(tscm);
158 case SNDRV_FIREWIRE_IOCTL_TASCAM_STATE:
159 return tscm_hwdep_state(tscm, (void __user *)arg);
150 default: 160 default:
151 return -ENOIOCTLCMD; 161 return -ENOIOCTLCMD;
152 } 162 }