diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2014-12-08 18:10:41 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-10 12:47:09 +0300 |
commit | 5b59d8098d2a3fa8ea4ad07b96f62c00c3b3e8d3 (patch) | |
tree | e4a7965027428a918ffcd11e44a35079873ce52c /sound/firewire/oxfw/oxfw.h | |
parent | fec7b7536207897693e708411dcb95909d56c431 (diff) | |
download | linux-5b59d8098d2a3fa8ea4ad07b96f62c00c3b3e8d3.tar.xz |
ALSA: oxfw: Add support for AV/C stream format command to get/set supported stream formation
OXFW970/971 may supports AV/C Stream Format Information Specification 1.1
Working Draft (Apr 2005, 1394TA). By using this command, drivers can get to know
stream formations which device supports.
This commit adds 'EXTENDED STREAM FORMAT INFORMATION' command. This command
has two subfunctions, 'SINGLE' and 'LIST'. Drivers can use 'SINGLE' subfunction
to know/set current formation of AMDTP stream, Drivers can use 'LIST'
subfunction to know an available formation of AMDTP stream in a certain sampling
rate.
But some devices don't implement the 'LIST' subfunction. So this commit uses
an assumption that 'if they don't implement it, they don't change stream
formation depending on current each sampling rate'. With this assumption, this
driver generates formations for such devices by:
1.getting current formation by SINGLE subfunction
2.getting supported sampling rates
3.applying current formation for all of supported sampling rates
Followed commit implements a parser of this format information.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/oxfw/oxfw.h')
-rw-r--r-- | sound/firewire/oxfw/oxfw.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h index a61c75cbaba8..a7031d414441 100644 --- a/sound/firewire/oxfw/oxfw.h +++ b/sound/firewire/oxfw/oxfw.h @@ -49,6 +49,39 @@ struct snd_oxfw { s16 volume_max; }; +/* + * AV/C Stream Format Information Specification 1.1 Working Draft + * (Apr 2005, 1394TA) + */ +int avc_stream_set_format(struct fw_unit *unit, enum avc_general_plug_dir dir, + unsigned int pid, u8 *format, unsigned int len); +int avc_stream_get_format(struct fw_unit *unit, + enum avc_general_plug_dir dir, unsigned int pid, + u8 *buf, unsigned int *len, unsigned int eid); +static inline int +avc_stream_get_format_single(struct fw_unit *unit, + enum avc_general_plug_dir dir, unsigned int pid, + u8 *buf, unsigned int *len) +{ + return avc_stream_get_format(unit, dir, pid, buf, len, 0xff); +} +static inline int +avc_stream_get_format_list(struct fw_unit *unit, + enum avc_general_plug_dir dir, unsigned int pid, + u8 *buf, unsigned int *len, + unsigned int eid) +{ + return avc_stream_get_format(unit, dir, pid, buf, len, eid); +} + +/* + * AV/C Digital Interface Command Set General Specification 4.2 + * (Sep 2004, 1394TA) + */ +int avc_general_inquiry_sig_fmt(struct fw_unit *unit, unsigned int rate, + enum avc_general_plug_dir dir, + unsigned short pid); + int snd_oxfw_stream_init_simplex(struct snd_oxfw *oxfw); int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw); void snd_oxfw_stream_stop_simplex(struct snd_oxfw *oxfw); |