Skip to content

Commit 0021b53

Browse files
committed
Merge tag 'sound-fix-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes for rc1. The only (LOC-wise) dominant change was ASoC Qualcomm fix, but most of it was merely a code shuffling. Another significant change here is for ALSA PCM core; it received a revert and a series of fixes for PCM auto-silencing where it caused a regression in the previous PR for rc1. Others are all small: ASoC Intel fixes, various quirks for ASoC AMD, HD-audio and USB-audio, the continued legacy emu10k1 code cleanup, and some documentation updates" * tag 'sound-fix-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits) ALSA: pcm: use exit controlled loop in snd_pcm_playback_silence() ALSA: pcm: simplify top-up mode init in snd_pcm_playback_silence() ALSA: pcm: playback silence - move silence variable updates to separate function ALSA: pcm: playback silence - remove extra code ALSA: pcm: fix playback silence - correct incremental silencing ALSA: pcm: fix playback silence - use the actual new_hw_ptr for the threshold mode ALSA: pcm: Revert "ALSA: pcm: rewrite snd_pcm_playback_silence()" ALSA: hda/realtek: Fix mute and micmute LEDs for an HP laptop ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init` ALSA: usb-audio: Add quirk for Pioneer DDJ-800 ALSA: hda/realtek: support HP Pavilion Aero 13-be0xxx Mute LED ASoC: Intel: soc-acpi-cht: Add quirk for Nextbook Ares 8A tablet ASoC: amd: yc: Add Asus VivoBook Pro 14 OLED M6400RC to the quirks list for acp6x ASoC: codecs: wcd938x: fix accessing regmap on unattached devices ALSA: docs: Fix code block indentation in ALSA driver example ALSA: docs: Extend module parameters description ALSA: hda/realtek: Add quirk for ASUS UM3402YAR using CS35L41 ALSA: emu10k1: use more existing defines instead of open-coded numbers ASoC: amd: yc: Add ASUS M3402RA into DMI table ALSA: hda/realtek: Add quirk for ThinkPad P1 Gen 6 ...
2 parents 27e0c84 + ee2dd70 commit 0021b53

24 files changed

+1349
-1126
lines changed

Documentation/sound/alsa-configuration.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ enable
133133
enable card;
134134
Default: enabled, for PCI and ISA PnP cards
135135

136+
These options are used for either specifying the order of instances or
137+
controlling enabling and disabling of each one of the devices if there
138+
are multiple devices bound with the same driver. For example, there are
139+
many machines which have two HD-audio controllers (one for HDMI/DP
140+
audio and another for onboard analog). In most cases, the second one is
141+
in primary usage, and people would like to assign it as the first
142+
appearing card. They can do it by specifying "index=1,0" module
143+
parameter, which will swap the assignment slots.
144+
145+
Today, with the sound backend like PulseAudio and PipeWire which
146+
supports dynamic configuration, it's of little use, but that was a
147+
help for static configuration in the past.
148+
136149
Module snd-adlib
137150
----------------
138151

Documentation/sound/kernel-api/writing-an-alsa-driver.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,21 +3994,21 @@ Driver with A Single Source File
39943994

39953995
Suppose you have a file xyz.c. Add the following two lines::
39963996

3997-
snd-xyz-objs := xyz.o
3998-
obj-$(CONFIG_SND_XYZ) += snd-xyz.o
3997+
snd-xyz-objs := xyz.o
3998+
obj-$(CONFIG_SND_XYZ) += snd-xyz.o
39993999

40004000
2. Create the Kconfig entry
40014001

40024002
Add the new entry of Kconfig for your xyz driver::
40034003

4004-
config SND_XYZ
4005-
tristate "Foobar XYZ"
4006-
depends on SND
4007-
select SND_PCM
4008-
help
4009-
Say Y here to include support for Foobar XYZ soundcard.
4010-
To compile this driver as a module, choose M here:
4011-
the module will be called snd-xyz.
4004+
config SND_XYZ
4005+
tristate "Foobar XYZ"
4006+
depends on SND
4007+
select SND_PCM
4008+
help
4009+
Say Y here to include support for Foobar XYZ soundcard.
4010+
To compile this driver as a module, choose M here:
4011+
the module will be called snd-xyz.
40124012

40134013
The line ``select SND_PCM`` specifies that the driver xyz supports PCM.
40144014
In addition to SND_PCM, the following components are supported for
@@ -4032,7 +4032,7 @@ located in the new subdirectory, sound/pci/xyz.
40324032
1. Add a new directory (``sound/pci/xyz``) in ``sound/pci/Makefile``
40334033
as below::
40344034

4035-
obj-$(CONFIG_SND) += sound/pci/xyz/
4035+
obj-$(CONFIG_SND) += sound/pci/xyz/
40364036

40374037

40384038
2. Under the directory ``sound/pci/xyz``, create a Makefile::

sound/core/pcm_lib.c

Lines changed: 72 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@
3333
static int fill_silence_frames(struct snd_pcm_substream *substream,
3434
snd_pcm_uframes_t off, snd_pcm_uframes_t frames);
3535

36+
37+
static inline void update_silence_vars(struct snd_pcm_runtime *runtime,
38+
snd_pcm_uframes_t ptr,
39+
snd_pcm_uframes_t new_ptr)
40+
{
41+
snd_pcm_sframes_t delta;
42+
43+
delta = new_ptr - ptr;
44+
if (delta == 0)
45+
return;
46+
if (delta < 0)
47+
delta += runtime->boundary;
48+
if ((snd_pcm_uframes_t)delta < runtime->silence_filled)
49+
runtime->silence_filled -= delta;
50+
else
51+
runtime->silence_filled = 0;
52+
runtime->silence_start = new_ptr;
53+
}
54+
3655
/*
3756
* fill ring buffer with silence
3857
* runtime->silence_start: starting pointer to silence area
@@ -42,47 +61,67 @@ static int fill_silence_frames(struct snd_pcm_substream *substream,
4261
*
4362
* when runtime->silence_size >= runtime->boundary - fill processed area with silence immediately
4463
*/
45-
void snd_pcm_playback_silence(struct snd_pcm_substream *substream)
64+
void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr)
4665
{
4766
struct snd_pcm_runtime *runtime = substream->runtime;
48-
snd_pcm_uframes_t appl_ptr = READ_ONCE(runtime->control->appl_ptr);
49-
snd_pcm_sframes_t added, hw_avail, frames;
50-
snd_pcm_uframes_t noise_dist, ofs, transfer;
67+
snd_pcm_uframes_t frames, ofs, transfer;
5168
int err;
5269

53-
added = appl_ptr - runtime->silence_start;
54-
if (added) {
55-
if (added < 0)
56-
added += runtime->boundary;
57-
if (added < runtime->silence_filled)
58-
runtime->silence_filled -= added;
59-
else
60-
runtime->silence_filled = 0;
61-
runtime->silence_start = appl_ptr;
62-
}
63-
64-
// This will "legitimately" turn negative on underrun, and will be mangled
65-
// into a huge number by the boundary crossing handling. The initial state
66-
// might also be not quite sane. The code below MUST account for these cases.
67-
hw_avail = appl_ptr - runtime->status->hw_ptr;
68-
if (hw_avail < 0)
69-
hw_avail += runtime->boundary;
70-
71-
noise_dist = hw_avail + runtime->silence_filled;
7270
if (runtime->silence_size < runtime->boundary) {
73-
frames = runtime->silence_threshold - noise_dist;
74-
if (frames <= 0)
71+
snd_pcm_sframes_t noise_dist;
72+
snd_pcm_uframes_t appl_ptr = READ_ONCE(runtime->control->appl_ptr);
73+
update_silence_vars(runtime, runtime->silence_start, appl_ptr);
74+
/* initialization outside pointer updates */
75+
if (new_hw_ptr == ULONG_MAX)
76+
new_hw_ptr = runtime->status->hw_ptr;
77+
/* get hw_avail with the boundary crossing */
78+
noise_dist = appl_ptr - new_hw_ptr;
79+
if (noise_dist < 0)
80+
noise_dist += runtime->boundary;
81+
/* total noise distance */
82+
noise_dist += runtime->silence_filled;
83+
if (noise_dist >= (snd_pcm_sframes_t) runtime->silence_threshold)
7584
return;
85+
frames = runtime->silence_threshold - noise_dist;
7686
if (frames > runtime->silence_size)
7787
frames = runtime->silence_size;
7888
} else {
79-
frames = runtime->buffer_size - noise_dist;
80-
if (frames <= 0)
81-
return;
89+
/*
90+
* This filling mode aims at free-running mode (used for example by dmix),
91+
* which doesn't update the application pointer.
92+
*/
93+
snd_pcm_uframes_t hw_ptr = runtime->status->hw_ptr;
94+
if (new_hw_ptr == ULONG_MAX) {
95+
/*
96+
* Initialization, fill the whole unused buffer with silence.
97+
*
98+
* Usually, this is entered while stopped, before data is queued,
99+
* so both pointers are expected to be zero.
100+
*/
101+
snd_pcm_sframes_t avail = runtime->control->appl_ptr - hw_ptr;
102+
if (avail < 0)
103+
avail += runtime->boundary;
104+
/*
105+
* In free-running mode, appl_ptr will be zero even while running,
106+
* so we end up with a huge number. There is no useful way to
107+
* handle this, so we just clear the whole buffer.
108+
*/
109+
runtime->silence_filled = avail > runtime->buffer_size ? 0 : avail;
110+
runtime->silence_start = hw_ptr;
111+
} else {
112+
/* Silence the just played area immediately */
113+
update_silence_vars(runtime, hw_ptr, new_hw_ptr);
114+
}
115+
/*
116+
* In this mode, silence_filled actually includes the valid
117+
* sample data from the user.
118+
*/
119+
frames = runtime->buffer_size - runtime->silence_filled;
82120
}
83-
84121
if (snd_BUG_ON(frames > runtime->buffer_size))
85122
return;
123+
if (frames == 0)
124+
return;
86125
ofs = (runtime->silence_start + runtime->silence_filled) % runtime->buffer_size;
87126
do {
88127
transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames;
@@ -425,6 +464,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
425464
return 0;
426465
}
427466

467+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
468+
runtime->silence_size > 0)
469+
snd_pcm_playback_silence(substream, new_hw_ptr);
470+
428471
if (in_interrupt) {
429472
delta = new_hw_ptr - runtime->hw_ptr_interrupt;
430473
if (delta < 0)
@@ -442,10 +485,6 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
442485
runtime->hw_ptr_wrap += runtime->boundary;
443486
}
444487

445-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
446-
runtime->silence_size > 0)
447-
snd_pcm_playback_silence(substream);
448-
449488
update_audio_tstamp(substream, &curr_tstamp, &audio_tstamp);
450489

451490
return snd_pcm_update_state(substream, runtime);

sound/core/pcm_local.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ int snd_pcm_update_state(struct snd_pcm_substream *substream,
2929
struct snd_pcm_runtime *runtime);
3030
int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
3131

32-
void snd_pcm_playback_silence(struct snd_pcm_substream *substream);
32+
void snd_pcm_playback_silence(struct snd_pcm_substream *substream,
33+
snd_pcm_uframes_t new_hw_ptr);
3334

3435
static inline snd_pcm_uframes_t
3536
snd_pcm_avail(struct snd_pcm_substream *substream)

sound/core/pcm_native.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
958958
if (snd_pcm_running(substream)) {
959959
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
960960
runtime->silence_size > 0)
961-
snd_pcm_playback_silence(substream);
961+
snd_pcm_playback_silence(substream, ULONG_MAX);
962962
err = snd_pcm_update_state(substream, runtime);
963963
}
964964
snd_pcm_stream_unlock_irq(substream);
@@ -1455,7 +1455,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream,
14551455
__snd_pcm_set_state(runtime, state);
14561456
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
14571457
runtime->silence_size > 0)
1458-
snd_pcm_playback_silence(substream);
1458+
snd_pcm_playback_silence(substream, ULONG_MAX);
14591459
snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTART);
14601460
}
14611461

@@ -1916,7 +1916,7 @@ static void snd_pcm_post_reset(struct snd_pcm_substream *substream,
19161916
runtime->control->appl_ptr = runtime->status->hw_ptr;
19171917
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
19181918
runtime->silence_size > 0)
1919-
snd_pcm_playback_silence(substream);
1919+
snd_pcm_playback_silence(substream, ULONG_MAX);
19201920
snd_pcm_stream_unlock_irq(substream);
19211921
}
19221922

sound/pci/emu10k1/emu10k1_callback.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ release_voice(struct snd_emux_voice *vp)
120120
struct snd_emu10k1 *hw;
121121

122122
hw = vp->hw;
123-
dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
123+
dcysusv = (unsigned char)vp->reg.parm.modrelease | DCYSUSM_PHASE1_MASK;
124124
snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv);
125-
dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease | DCYSUSV_CHANNELENABLE_MASK;
125+
dcysusv = (unsigned char)vp->reg.parm.volrelease | DCYSUSV_PHASE1_MASK | DCYSUSV_CHANNELENABLE_MASK;
126126
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, dcysusv);
127127
}
128128

@@ -138,7 +138,8 @@ terminate_voice(struct snd_emux_voice *vp)
138138
if (snd_BUG_ON(!vp))
139139
return;
140140
hw = vp->hw;
141-
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
141+
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch,
142+
DCYSUSV_PHASE1_MASK | DCYSUSV_DECAYTIME_MASK | DCYSUSV_CHANNELENABLE_MASK);
142143
if (vp->block) {
143144
struct snd_emu10k1_memblk *emem;
144145
emem = (struct snd_emu10k1_memblk *)vp->block;
@@ -347,9 +348,9 @@ start_voice(struct snd_emux_voice *vp)
347348
}
348349

349350
/* channel to be silent and idle */
350-
snd_emu10k1_ptr_write(hw, DCYSUSV, ch, 0x0000);
351-
snd_emu10k1_ptr_write(hw, VTFT, ch, 0x0000FFFF);
352-
snd_emu10k1_ptr_write(hw, CVCF, ch, 0x0000FFFF);
351+
snd_emu10k1_ptr_write(hw, DCYSUSV, ch, 0);
352+
snd_emu10k1_ptr_write(hw, VTFT, ch, VTFT_FILTERTARGET_MASK);
353+
snd_emu10k1_ptr_write(hw, CVCF, ch, CVCF_CURRENTFILTER_MASK);
353354
snd_emu10k1_ptr_write(hw, PTRX, ch, 0);
354355
snd_emu10k1_ptr_write(hw, CPF, ch, 0);
355356

@@ -453,7 +454,7 @@ start_voice(struct snd_emux_voice *vp)
453454
/* reset volume */
454455
temp = (unsigned int)vp->vtarget << 16;
455456
snd_emu10k1_ptr_write(hw, VTFT, ch, temp | vp->ftarget);
456-
snd_emu10k1_ptr_write(hw, CVCF, ch, temp | 0xff00);
457+
snd_emu10k1_ptr_write(hw, CVCF, ch, temp | CVCF_CURRENTFILTER_MASK);
457458
return 0;
458459
}
459460

sound/pci/emu10k1/emu10k1_main.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void snd_emu10k1_voice_init(struct snd_emu10k1 *emu, int ch)
5959
{
6060
snd_emu10k1_ptr_write(emu, DCYSUSV, ch, 0);
6161
snd_emu10k1_ptr_write(emu, IP, ch, 0);
62-
snd_emu10k1_ptr_write(emu, VTFT, ch, 0xffff);
63-
snd_emu10k1_ptr_write(emu, CVCF, ch, 0xffff);
62+
snd_emu10k1_ptr_write(emu, VTFT, ch, VTFT_FILTERTARGET_MASK);
63+
snd_emu10k1_ptr_write(emu, CVCF, ch, CVCF_CURRENTFILTER_MASK);
6464
snd_emu10k1_ptr_write(emu, PTRX, ch, 0);
6565
snd_emu10k1_ptr_write(emu, CPF, ch, 0);
6666
snd_emu10k1_ptr_write(emu, CCR, ch, 0);
@@ -74,7 +74,7 @@ void snd_emu10k1_voice_init(struct snd_emu10k1 *emu, int ch)
7474

7575
snd_emu10k1_ptr_write(emu, ATKHLDM, ch, 0);
7676
snd_emu10k1_ptr_write(emu, DCYSUSM, ch, 0);
77-
snd_emu10k1_ptr_write(emu, IFATN, ch, 0xffff);
77+
snd_emu10k1_ptr_write(emu, IFATN, ch, IFATN_FILTERCUTOFF_MASK | IFATN_ATTENUATION_MASK);
7878
snd_emu10k1_ptr_write(emu, PEFE, ch, 0);
7979
snd_emu10k1_ptr_write(emu, FMMOD, ch, 0);
8080
snd_emu10k1_ptr_write(emu, TREMFRQ, ch, 24); /* 1 Hz */
@@ -90,10 +90,10 @@ void snd_emu10k1_voice_init(struct snd_emu10k1 *emu, int ch)
9090

9191
/* Audigy extra stuffs */
9292
if (emu->audigy) {
93-
snd_emu10k1_ptr_write(emu, 0x4c, ch, 0); /* ?? */
94-
snd_emu10k1_ptr_write(emu, 0x4d, ch, 0); /* ?? */
95-
snd_emu10k1_ptr_write(emu, 0x4e, ch, 0); /* ?? */
96-
snd_emu10k1_ptr_write(emu, 0x4f, ch, 0); /* ?? */
93+
snd_emu10k1_ptr_write(emu, A_CSBA, ch, 0);
94+
snd_emu10k1_ptr_write(emu, A_CSDC, ch, 0);
95+
snd_emu10k1_ptr_write(emu, A_CSFE, ch, 0);
96+
snd_emu10k1_ptr_write(emu, A_CSHG, ch, 0);
9797
snd_emu10k1_ptr_write(emu, A_FXRT1, ch, 0x03020100);
9898
snd_emu10k1_ptr_write(emu, A_FXRT2, ch, 0x3f3f3f3f);
9999
snd_emu10k1_ptr_write(emu, A_SENDAMOUNTS, ch, 0);
@@ -259,7 +259,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir)
259259

260260
snd_emu10k1_ptr_write(emu, PTB, 0, emu->ptb_pages.addr);
261261
snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */
262-
snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */
262+
snd_emu10k1_ptr_write(emu, TCBS, 0, TCBS_BUFFSIZE_256K); /* taken from original driver */
263263

264264
silent_page = (emu->silent_page.addr << emu->address_mode) | (emu->address_mode ? MAP_PTI_MASK1 : MAP_PTI_MASK0);
265265
for (ch = 0; ch < NUM_G; ch++) {
@@ -818,7 +818,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
818818
/* FPGA netlist already present so clear it */
819819
/* Return to programming mode */
820820

821-
snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02);
821+
snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_HANA);
822822
}
823823
snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
824824
dev_dbg(emu->card->dev, "reg2 = 0x%x\n", reg);
@@ -858,36 +858,36 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
858858
/* Optical -> ADAT I/O */
859859
emu->emu1010.optical_in = 1; /* IN_ADAT */
860860
emu->emu1010.optical_out = 1; /* OUT_ADAT */
861-
tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : 0) |
862-
(emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : 0);
861+
tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : EMU_HANA_OPTICAL_IN_SPDIF) |
862+
(emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : EMU_HANA_OPTICAL_OUT_SPDIF);
863863
snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
864864
/* Set no attenuation on Audio Dock pads. */
865-
snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00);
866865
emu->emu1010.adc_pads = 0x00;
866+
snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, emu->emu1010.adc_pads);
867867
/* Unmute Audio dock DACs, Headphone source DAC-4. */
868-
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
868+
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, EMU_HANA_DOCK_PHONES_192_DAC4);
869869
/* DAC PADs. */
870-
snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f);
871-
emu->emu1010.dac_pads = 0x0f;
870+
emu->emu1010.dac_pads = EMU_HANA_DOCK_DAC_PAD1 | EMU_HANA_DOCK_DAC_PAD2 |
871+
EMU_HANA_DOCK_DAC_PAD3 | EMU_HANA_DOCK_DAC_PAD4;
872+
snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, emu->emu1010.dac_pads);
872873
/* SPDIF Format. Set Consumer mode, 24bit, copy enable */
873-
snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10);
874+
snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, EMU_HANA_SPDIF_MODE_RX_INVALID);
874875
/* MIDI routing */
875-
snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19);
876-
/* Unknown. */
877-
snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c);
876+
snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, EMU_HANA_MIDI_INA_FROM_HAMOA | EMU_HANA_MIDI_INB_FROM_DOCK2);
877+
snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, EMU_HANA_MIDI_OUT_DOCK2 | EMU_HANA_MIDI_OUT_SYNC2);
878878
/* IRQ Enable: All on */
879-
/* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); */
879+
/* snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x0f); */
880880
/* IRQ Enable: All off */
881881
snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00);
882882

883883
emu->emu1010.internal_clock = 1; /* 48000 */
884884
/* Default WCLK set to 48kHz. */
885-
snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00);
885+
snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
886886
/* Word Clock source, Internal 48kHz x1 */
887887
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
888888
/* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
889889
/* Audio Dock LEDs. */
890-
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
890+
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_LOCK | EMU_HANA_DOCK_LEDS_2_48K);
891891

892892
#if 0
893893
/* For 96kHz */
@@ -1014,7 +1014,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu)
10141014
EMU_DST_ALICE_I2S2_LEFT, EMU_SRC_DOCK_ADC3_LEFT1);
10151015
snd_emu1010_fpga_link_dst_src_write(emu,
10161016
EMU_DST_ALICE_I2S2_RIGHT, EMU_SRC_DOCK_ADC3_RIGHT1);
1017-
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01); /* Unmute all */
1017+
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
10181018

10191019
#if 0
10201020
snd_emu1010_fpga_link_dst_src_write(emu,

0 commit comments

Comments
 (0)