diff options
author | Harry Butterworth <heb1001@gmail.com> | 2011-06-14 11:09:12 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-06-16 01:28:57 -0400 |
commit | 030aba53ea361df2b44a292606c974ef48d438de (patch) | |
tree | 09d54469d0cc60b7eadf9fc1ee420087925c7974 /sound/pci/ctxfi | |
parent | b3c705aa9e9147a30009bdf6ba853aa7fe138e58 (diff) |
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>
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r-- | sound/pci/ctxfi/cthw20k2.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index 1aa083272703..d6c54b524bfa 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c | |||
@@ -1316,21 +1316,18 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr) | |||
1316 | 1316 | ||
1317 | pllenb = 0xB; | 1317 | pllenb = 0xB; |
1318 | hw_write_20kx(hw, PLL_ENB, pllenb); | 1318 | hw_write_20kx(hw, PLL_ENB, pllenb); |
1319 | pllctl = 0x20D00000; | 1319 | pllctl = 0x20C00000; |
1320 | set_field(&pllctl, PLLCTL_FD, 16 - 4); | 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); | ||
1321 | hw_write_20kx(hw, PLL_CTL, pllctl); | 1323 | hw_write_20kx(hw, PLL_CTL, pllctl); |
1322 | mdelay(40); | 1324 | mdelay(40); |
1325 | |||
1323 | pllctl = hw_read_20kx(hw, PLL_CTL); | 1326 | pllctl = hw_read_20kx(hw, PLL_CTL); |
1324 | set_field(&pllctl, PLLCTL_B, 0); | 1327 | set_field(&pllctl, PLLCTL_FD, 48000 == rsr ? 16 - 2 : 147 - 2); |
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 | } | ||
1332 | hw_write_20kx(hw, PLL_CTL, pllctl); | 1328 | hw_write_20kx(hw, PLL_CTL, pllctl); |
1333 | mdelay(40); | 1329 | mdelay(40); |
1330 | |||
1334 | for (i = 0; i < 1000; i++) { | 1331 | for (i = 0; i < 1000; i++) { |
1335 | pllstat = hw_read_20kx(hw, PLL_STAT); | 1332 | pllstat = hw_read_20kx(hw, PLL_STAT); |
1336 | if (get_field(pllstat, PLLSTAT_PD)) | 1333 | if (get_field(pllstat, PLLSTAT_PD)) |