Commit e65e2cb9 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: firewire-tascam: Turn on/off FireWire LED

TASCAM FireWire series has some LEDs on its surface. These LEDs can be
turned on/off by receiving asynchronous transactions to a certain
address. One of the LEDs is labels as 'FireWire'. It's better to light it
up when this driver starts to work. Besides, the LED for 'FireWire' is
turned off at bus reset.

This commit implements this idea.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0db18e7e
...@@ -252,6 +252,14 @@ int snd_tscm_transaction_reregister(struct snd_tscm *tscm) ...@@ -252,6 +252,14 @@ int snd_tscm_transaction_reregister(struct snd_tscm *tscm)
return snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST, return snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST,
TSCM_ADDR_BASE + TSCM_OFFSET_MIDI_TX_ON, TSCM_ADDR_BASE + TSCM_OFFSET_MIDI_TX_ON,
&reg, sizeof(reg), 0); &reg, sizeof(reg), 0);
if (err < 0)
return err;
/* Turn on FireWire LED. */
reg = cpu_to_be32(0x0001008e);
return snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST,
TSCM_ADDR_BASE + TSCM_OFFSET_LED_POWER,
&reg, sizeof(reg), 0);
} }
void snd_tscm_transaction_unregister(struct snd_tscm *tscm) void snd_tscm_transaction_unregister(struct snd_tscm *tscm)
...@@ -259,6 +267,12 @@ void snd_tscm_transaction_unregister(struct snd_tscm *tscm) ...@@ -259,6 +267,12 @@ void snd_tscm_transaction_unregister(struct snd_tscm *tscm)
__be32 reg; __be32 reg;
unsigned int i; unsigned int i;
/* Turn off FireWire LED. */
reg = cpu_to_be32(0x0000008e);
snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST,
TSCM_ADDR_BASE + TSCM_OFFSET_LED_POWER,
&reg, sizeof(reg), 0);
/* Turn off messaging. */ /* Turn off messaging. */
reg = cpu_to_be32(0x00000000); reg = cpu_to_be32(0x00000000);
snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST, snd_fw_transaction(tscm->unit, TCODE_WRITE_QUADLET_REQUEST,
......
...@@ -101,6 +101,8 @@ struct snd_tscm { ...@@ -101,6 +101,8 @@ struct snd_tscm {
#define TSCM_OFFSET_MIDI_TX_ADDR_HI 0x0304 #define TSCM_OFFSET_MIDI_TX_ADDR_HI 0x0304
#define TSCM_OFFSET_MIDI_TX_ADDR_LO 0x0308 #define TSCM_OFFSET_MIDI_TX_ADDR_LO 0x0308
#define TSCM_OFFSET_LED_POWER 0x0404
#define TSCM_OFFSET_MIDI_RX_QUAD 0x4000 #define TSCM_OFFSET_MIDI_RX_QUAD 0x4000
enum snd_tscm_clock { enum snd_tscm_clock {
......
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