diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-12-15 09:56:20 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-12-15 10:30:04 -0500 |
commit | 27e66635016fc5bd3d36355daedf741f0a7329bb (patch) | |
tree | 809c8a52fe38d95a0c178a224a879b3cff95df53 /sound/firewire | |
parent | eab8e4e4619643f49167c2089749acc40ad7f95d (diff) |
ALSA: oxfw: reuse driver entry to detect quirks
Currently, assignment to model-dependent quirk is corresponding to
asynchronous transactions on IEEE 1394 bus. This is also achieved with
device entry.
This commit changes the processing of model-dependent quirk with the
entry. As a result, the transactions are sent only for Loud models.
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/oxfw/oxfw.c | 38 | ||||
-rw-r--r-- | sound/firewire/oxfw/oxfw.h | 2 |
2 files changed, 24 insertions, 16 deletions
diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 0304d4549f44..836d75777973 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c | |||
@@ -59,6 +59,7 @@ static bool detect_loud_models(struct fw_unit *unit) | |||
59 | static int name_card(struct snd_oxfw *oxfw) | 59 | static int name_card(struct snd_oxfw *oxfw) |
60 | { | 60 | { |
61 | struct fw_device *fw_dev = fw_parent_device(oxfw->unit); | 61 | struct fw_device *fw_dev = fw_parent_device(oxfw->unit); |
62 | const struct device_info *info; | ||
62 | char vendor[24]; | 63 | char vendor[24]; |
63 | char model[32]; | 64 | char model[32]; |
64 | const char *d, *v, *m; | 65 | const char *d, *v, *m; |
@@ -84,10 +85,12 @@ static int name_card(struct snd_oxfw *oxfw) | |||
84 | be32_to_cpus(&firmware); | 85 | be32_to_cpus(&firmware); |
85 | 86 | ||
86 | /* to apply card definitions */ | 87 | /* to apply card definitions */ |
87 | if (oxfw->device_info) { | 88 | if (oxfw->entry->vendor_id == VENDOR_GRIFFIN || |
88 | d = oxfw->device_info->driver_name; | 89 | oxfw->entry->vendor_id == VENDOR_LACIE) { |
89 | v = oxfw->device_info->vendor_name; | 90 | info = (const struct device_info *)oxfw->entry->driver_data; |
90 | m = oxfw->device_info->model_name; | 91 | d = info->driver_name; |
92 | v = info->vendor_name; | ||
93 | m = info->model_name; | ||
91 | } else { | 94 | } else { |
92 | d = "OXFW"; | 95 | d = "OXFW"; |
93 | v = vendor; | 96 | v = vendor; |
@@ -139,6 +142,16 @@ static void detect_quirks(struct snd_oxfw *oxfw) | |||
139 | int key, val; | 142 | int key, val; |
140 | int vendor, model; | 143 | int vendor, model; |
141 | 144 | ||
145 | /* | ||
146 | * TASCAM FireOne has physical control and requires a pair of additional | ||
147 | * MIDI ports. | ||
148 | */ | ||
149 | if (oxfw->entry->vendor_id == VENDOR_TASCAM) { | ||
150 | oxfw->midi_input_ports++; | ||
151 | oxfw->midi_output_ports++; | ||
152 | return; | ||
153 | } | ||
154 | |||
142 | /* Seek from Root Directory of Config ROM. */ | 155 | /* Seek from Root Directory of Config ROM. */ |
143 | vendor = model = 0; | 156 | vendor = model = 0; |
144 | fw_csr_iterator_init(&it, fw_dev->config_rom + 5); | 157 | fw_csr_iterator_init(&it, fw_dev->config_rom + 5); |
@@ -155,25 +168,16 @@ static void detect_quirks(struct snd_oxfw *oxfw) | |||
155 | */ | 168 | */ |
156 | if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE) | 169 | if (vendor == VENDOR_LOUD && model == MODEL_SATELLITE) |
157 | oxfw->wrong_dbs = true; | 170 | oxfw->wrong_dbs = true; |
158 | |||
159 | /* | ||
160 | * TASCAM FireOne has physical control and requires a pair of additional | ||
161 | * MIDI ports. | ||
162 | */ | ||
163 | if (vendor == VENDOR_TASCAM) { | ||
164 | oxfw->midi_input_ports++; | ||
165 | oxfw->midi_output_ports++; | ||
166 | } | ||
167 | } | 171 | } |
168 | 172 | ||
169 | static int oxfw_probe(struct fw_unit *unit, | 173 | static int oxfw_probe(struct fw_unit *unit, |
170 | const struct ieee1394_device_id *id) | 174 | const struct ieee1394_device_id *entry) |
171 | { | 175 | { |
172 | struct snd_card *card; | 176 | struct snd_card *card; |
173 | struct snd_oxfw *oxfw; | 177 | struct snd_oxfw *oxfw; |
174 | int err; | 178 | int err; |
175 | 179 | ||
176 | if ((id->vendor_id == VENDOR_LOUD) && !detect_loud_models(unit)) | 180 | if (entry->vendor_id == VENDOR_LOUD && !detect_loud_models(unit)) |
177 | return -ENODEV; | 181 | return -ENODEV; |
178 | 182 | ||
179 | err = snd_card_new(&unit->device, -1, NULL, THIS_MODULE, | 183 | err = snd_card_new(&unit->device, -1, NULL, THIS_MODULE, |
@@ -186,7 +190,7 @@ static int oxfw_probe(struct fw_unit *unit, | |||
186 | oxfw->card = card; | 190 | oxfw->card = card; |
187 | mutex_init(&oxfw->mutex); | 191 | mutex_init(&oxfw->mutex); |
188 | oxfw->unit = fw_unit_get(unit); | 192 | oxfw->unit = fw_unit_get(unit); |
189 | oxfw->device_info = (const struct device_info *)id->driver_data; | 193 | oxfw->entry = entry; |
190 | spin_lock_init(&oxfw->lock); | 194 | spin_lock_init(&oxfw->lock); |
191 | init_waitqueue_head(&oxfw->hwdep_wait); | 195 | init_waitqueue_head(&oxfw->hwdep_wait); |
192 | 196 | ||
@@ -205,6 +209,8 @@ static int oxfw_probe(struct fw_unit *unit, | |||
205 | goto error; | 209 | goto error; |
206 | 210 | ||
207 | if (oxfw->device_info) { | 211 | if (oxfw->device_info) { |
212 | oxfw->device_info = | ||
213 | (const struct device_info *)entry->driver_data; | ||
208 | err = snd_oxfw_add_spkr(oxfw); | 214 | err = snd_oxfw_add_spkr(oxfw); |
209 | if (err < 0) | 215 | if (err < 0) |
210 | goto error; | 216 | goto error; |
diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h index 9efdc026fdad..f3e14fff4ba0 100644 --- a/sound/firewire/oxfw/oxfw.h +++ b/sound/firewire/oxfw/oxfw.h | |||
@@ -72,6 +72,8 @@ struct snd_oxfw { | |||
72 | int dev_lock_count; | 72 | int dev_lock_count; |
73 | bool dev_lock_changed; | 73 | bool dev_lock_changed; |
74 | wait_queue_head_t hwdep_wait; | 74 | wait_queue_head_t hwdep_wait; |
75 | |||
76 | const struct ieee1394_device_id *entry; | ||
75 | }; | 77 | }; |
76 | 78 | ||
77 | /* | 79 | /* |