From 25784ec2d0347b715e354d92151734afe1296f02 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Fri, 25 Apr 2014 22:45:24 +0900 Subject: ALSA: bebob: Add support for Focusrite Saffire/SaffirePro series This commit allows this driver to support all of models which Focusrite produces with DM1000/BeBoB. They are: - Saffire - Saffire LE - SaffirePro 10 I/O - SaffirePro 26 I/O This commit adds Focusrite specific operations: 1. Get source of clock 2. Get/Set sampling frequency 3. Get metering information The driver uses these functionalities to read/write specific address by async transaction. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/bebob/bebob.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'sound/firewire/bebob/bebob.c') diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 6a6350466fd4..6d23e44e635b 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -54,6 +54,9 @@ static DECLARE_BITMAP(devices_used, SNDRV_CARDS); #define VEN_PRISMSOUND 0x00001198 #define VEN_TERRATEC 0x00000aac #define VEN_YAMAHA 0x0000a0de +#define VEN_FOCUSRITE 0x0000130e + +#define MODEL_FOCUSRITE_SAFFIRE_BOTH 0x00000000 static int name_device(struct snd_bebob *bebob, unsigned int vendor_id) @@ -122,6 +125,20 @@ bebob_card_free(struct snd_card *card) mutex_destroy(&bebob->mutex); } +static const struct snd_bebob_spec * +get_saffire_spec(struct fw_unit *unit) +{ + char name[24] = {0}; + + if (fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)) < 0) + return NULL; + + if (strcmp(name, "SaffireLE") == 0) + return &saffire_le_spec; + else + return &saffire_spec; +} + static int bebob_probe(struct fw_unit *unit, const struct ieee1394_device_id *entry) @@ -143,7 +160,11 @@ bebob_probe(struct fw_unit *unit, goto end; } - spec = (const struct snd_bebob_spec *)entry->driver_data; + if ((entry->vendor_id == VEN_FOCUSRITE) && + (entry->model_id == MODEL_FOCUSRITE_SAFFIRE_BOTH)) + spec = get_saffire_spec(unit); + else + spec = (const struct snd_bebob_spec *)entry->driver_data; if (spec == NULL) { err = -ENOSYS; goto end; @@ -306,6 +327,13 @@ static const struct ieee1394_device_id bebob_id_table[] = { SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000b, &yamaha_go_spec), /* YAMAHA, GO46 */ SND_BEBOB_DEV_ENTRY(VEN_YAMAHA, 0x0010000c, &yamaha_go_spec), + /* Focusrite, SaffirePro 26 I/O */ + SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000003, &saffirepro_26_spec), + /* Focusrite, SaffirePro 10 I/O */ + SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, 0x00000006, &saffirepro_10_spec), + /* Focusrite, Saffire(no label and LE) */ + SND_BEBOB_DEV_ENTRY(VEN_FOCUSRITE, MODEL_FOCUSRITE_SAFFIRE_BOTH, + &saffire_spec), /* IDs are unknown but able to be supported */ /* Apogee, Mini-ME Firewire */ /* Apogee, Mini-DAC Firewire */ -- cgit v1.2.3