Commit 06a42a74 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: oxfw: don't add MIDI/PCM interface when packet streaming is unavailable

Stanton SCS.1d doesn't support packet streaming even if it has plugs for
isochronous communication.

This commit is a preparation for this case. The 'has_input' member is
added to specific structure, and MIDI/PCM interfaces are not added when
the member is false.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20200113073418.24622-3-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 03be63b2
...@@ -772,6 +772,8 @@ int snd_oxfw_stream_discover(struct snd_oxfw *oxfw) ...@@ -772,6 +772,8 @@ int snd_oxfw_stream_discover(struct snd_oxfw *oxfw)
if (formation.midi > 0) if (formation.midi > 0)
oxfw->midi_output_ports = 1; oxfw->midi_output_ports = 1;
} }
oxfw->has_input = true;
} }
end: end:
return err; return err;
......
...@@ -118,6 +118,7 @@ static void oxfw_card_free(struct snd_card *card) ...@@ -118,6 +118,7 @@ static void oxfw_card_free(struct snd_card *card)
{ {
struct snd_oxfw *oxfw = card->private_data; struct snd_oxfw *oxfw = card->private_data;
if (oxfw->has_output || oxfw->has_input)
snd_oxfw_stream_destroy_duplex(oxfw); snd_oxfw_stream_destroy_duplex(oxfw);
} }
...@@ -206,6 +207,7 @@ static void do_registration(struct work_struct *work) ...@@ -206,6 +207,7 @@ static void do_registration(struct work_struct *work)
if (err < 0) if (err < 0)
goto error; goto error;
if (oxfw->has_output || oxfw->has_input) {
err = snd_oxfw_stream_init_duplex(oxfw); err = snd_oxfw_stream_init_duplex(oxfw);
if (err < 0) if (err < 0)
goto error; goto error;
...@@ -223,6 +225,7 @@ static void do_registration(struct work_struct *work) ...@@ -223,6 +225,7 @@ static void do_registration(struct work_struct *work)
err = snd_oxfw_create_hwdep(oxfw); err = snd_oxfw_create_hwdep(oxfw);
if (err < 0) if (err < 0)
goto error; goto error;
}
err = snd_card_register(oxfw->card); err = snd_card_register(oxfw->card);
if (err < 0) if (err < 0)
...@@ -274,9 +277,11 @@ static void oxfw_bus_reset(struct fw_unit *unit) ...@@ -274,9 +277,11 @@ static void oxfw_bus_reset(struct fw_unit *unit)
fcp_bus_reset(oxfw->unit); fcp_bus_reset(oxfw->unit);
if (oxfw->registered) { if (oxfw->registered) {
if (oxfw->has_output || oxfw->has_input) {
mutex_lock(&oxfw->mutex); mutex_lock(&oxfw->mutex);
snd_oxfw_stream_update_duplex(oxfw); snd_oxfw_stream_update_duplex(oxfw);
mutex_unlock(&oxfw->mutex); mutex_unlock(&oxfw->mutex);
}
if (oxfw->entry->vendor_id == OUI_STANTON) if (oxfw->entry->vendor_id == OUI_STANTON)
snd_oxfw_scs1x_update(oxfw); snd_oxfw_scs1x_update(oxfw);
......
...@@ -45,6 +45,7 @@ struct snd_oxfw { ...@@ -45,6 +45,7 @@ struct snd_oxfw {
bool wrong_dbs; bool wrong_dbs;
bool has_output; bool has_output;
bool has_input;
u8 *tx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES]; u8 *tx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES];
u8 *rx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES]; u8 *rx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES];
bool assumed; bool assumed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment