提交 7b4d7dcf 编写于 作者: T Takashi Sakamoto 提交者: Takashi Iwai

ALSA: bebob: add 'version' member for BeBoB protocol version

BeBoB installed devices have BeBoB register area. This area stores
basic information about its firmware. A register has its protocol
version.

This commit adds 'version' member and store the device's protocol
version to handle v3 quirks in following commits.
Tested-by: NKim Tore Jensen <kim@incendio.no>
Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 05773792
...@@ -33,6 +33,7 @@ static DEFINE_MUTEX(devices_mutex); ...@@ -33,6 +33,7 @@ static DEFINE_MUTEX(devices_mutex);
static DECLARE_BITMAP(devices_used, SNDRV_CARDS); static DECLARE_BITMAP(devices_used, SNDRV_CARDS);
/* Offsets from information register. */ /* Offsets from information register. */
#define INFO_OFFSET_BEBOB_VERSION 0x08
#define INFO_OFFSET_GUID 0x10 #define INFO_OFFSET_GUID 0x10
#define INFO_OFFSET_HW_MODEL_ID 0x18 #define INFO_OFFSET_HW_MODEL_ID 0x18
#define INFO_OFFSET_HW_MODEL_REVISION 0x1c #define INFO_OFFSET_HW_MODEL_REVISION 0x1c
...@@ -73,6 +74,7 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id) ...@@ -73,6 +74,7 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id)
u32 hw_id; u32 hw_id;
u32 data[2] = {0}; u32 data[2] = {0};
u32 revision; u32 revision;
u32 version;
int err; int err;
/* get vendor name from root directory */ /* get vendor name from root directory */
...@@ -105,6 +107,12 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id) ...@@ -105,6 +107,12 @@ name_device(struct snd_bebob *bebob, unsigned int vendor_id)
if (err < 0) if (err < 0)
goto end; goto end;
err = snd_bebob_read_quad(bebob->unit, INFO_OFFSET_BEBOB_VERSION,
&version);
if (err < 0)
goto end;
bebob->version = version;
strcpy(bebob->card->driver, "BeBoB"); strcpy(bebob->card->driver, "BeBoB");
strcpy(bebob->card->shortname, model); strcpy(bebob->card->shortname, model);
strcpy(bebob->card->mixername, model); strcpy(bebob->card->mixername, model);
......
...@@ -115,6 +115,9 @@ struct snd_bebob { ...@@ -115,6 +115,9 @@ struct snd_bebob {
/* for M-Audio special devices */ /* for M-Audio special devices */
void *maudio_special_quirk; void *maudio_special_quirk;
bool deferred_registration; bool deferred_registration;
/* For BeBoB version quirk. */
unsigned int version;
}; };
static inline int static inline int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册