diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2017-03-22 21:30:19 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-03-28 12:33:32 +0200 |
commit | 2e76701bbb1fbe55f7d8538ae7f6869070eb3446 (patch) | |
tree | 32857eb7553612105d0a9e96098b2897ae37bf9f /sound/firewire/motu/motu.c | |
parent | 4641c939401076c0ab7faba024827069723f719c (diff) |
ALSA: firewire-motu: handle transactions specific for MOTU FireWire models
All models of MOTU FireWire series can be controlled by write transaction
to addresses in a range from 0x'ffff'f0000'0b00 to 0x'ffff'f000'0cff.
The models support asynchronous notification. This notification has 32 bit
field data, and is transferred when status of clock changes. Meaning of
the value is not enough clear yet.
Drivers can register its address to receive the notification. Write
transaction to 0x'ffff'f000'0b04 registers higher 16 bits of the address.
Write transaction to 0x'ffff'f0000'0b08 registers the rest of bits. The
address includes node ID, thus it should be registered every time of bus
reset.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu.c')
-rw-r--r-- | sound/firewire/motu/motu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c index 1e6fc74a6458..db6014c2f16d 100644 --- a/sound/firewire/motu/motu.c +++ b/sound/firewire/motu/motu.c @@ -54,6 +54,8 @@ static void name_card(struct snd_motu *motu) static void motu_free(struct snd_motu *motu) { + snd_motu_transaction_unregister(motu); + fw_unit_put(motu->unit); mutex_destroy(&motu->mutex); @@ -86,6 +88,10 @@ static void do_registration(struct work_struct *work) name_card(motu); + err = snd_motu_transaction_register(motu); + if (err < 0) + goto error; + err = snd_card_register(motu->card); if (err < 0) goto error; @@ -100,6 +106,7 @@ static void do_registration(struct work_struct *work) return; error: + snd_motu_transaction_unregister(motu); snd_card_free(motu->card); dev_info(&motu->unit->device, "Sound card registration failed: %d\n", err); @@ -155,6 +162,9 @@ static void motu_bus_update(struct fw_unit *unit) /* Postpone a workqueue for deferred registration. */ if (!motu->registered) snd_fw_schedule_registration(unit, &motu->dwork); + + /* The handler address register becomes initialized. */ + snd_motu_transaction_reregister(motu); } #define SND_MOTU_DEV_ENTRY(model, data) \ |