Skip to content

Commit 030aba5

Browse files
heb1001tiwai
authored andcommitted
ALSA: ctxfi: Change PLL initialization code
This is a reworked patch from Creative to change the PLL code to address unreliable 44100Hz initialization. Signed-off-by: Harry Butterworth <heb1001@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent b3c705a commit 030aba5

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

‎sound/pci/ctxfi/cthw20k2.c‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,21 +1316,18 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
13161316

13171317
pllenb = 0xB;
13181318
hw_write_20kx(hw, PLL_ENB, pllenb);
1319-
pllctl = 0x20D00000;
1320-
set_field(&pllctl, PLLCTL_FD, 16 - 4);
1319+
pllctl = 0x20C00000;
1320+
set_field(&pllctl, PLLCTL_B, 0);
1321+
set_field(&pllctl, PLLCTL_FD, 48000 == rsr ? 16 - 4 : 147 - 4);
1322+
set_field(&pllctl, PLLCTL_RD, 48000 == rsr ? 1 - 1 : 10 - 1);
13211323
hw_write_20kx(hw, PLL_CTL, pllctl);
13221324
mdelay(40);
1325+
13231326
pllctl = hw_read_20kx(hw, PLL_CTL);
1324-
set_field(&pllctl, PLLCTL_B, 0);
1325-
if (48000 == rsr) {
1326-
set_field(&pllctl, PLLCTL_FD, 16 - 2);
1327-
set_field(&pllctl, PLLCTL_RD, 1 - 1); /* 3000*16/1 = 48000 */
1328-
} else { /* 44100 */
1329-
set_field(&pllctl, PLLCTL_FD, 147 - 2);
1330-
set_field(&pllctl, PLLCTL_RD, 10 - 1); /* 3000*147/10 = 44100 */
1331-
}
1327+
set_field(&pllctl, PLLCTL_FD, 48000 == rsr ? 16 - 2 : 147 - 2);
13321328
hw_write_20kx(hw, PLL_CTL, pllctl);
13331329
mdelay(40);
1330+
13341331
for (i = 0; i < 1000; i++) {
13351332
pllstat = hw_read_20kx(hw, PLL_STAT);
13361333
if (get_field(pllstat, PLLSTAT_PD))

0 commit comments

Comments
 (0)