aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi
diff options
context:
space:
mode:
authorPrzemyslaw Bruski <pbruskispam@op.pl>2011-03-13 11:18:55 -0400
committerTakashi Iwai <tiwai@suse.de>2011-03-14 06:15:59 -0400
commit19002fd5f1ba452ba13491f97da65367f80e09a8 (patch)
tree39b2eedd2fff4908cac72d1556eee15164deb715 /sound/pci/ctxfi
parent7e79443ce250776b8477426127acdac15c567f22 (diff)
ALSA: ctxfi - Fix microphone boost codes/comments
microphone boost was set at +12dB, not +20dB (like in Windows driver and in adc_conf structure declaration), some comments added. Signed-off-by: Przemyslaw Bruski <pbruskispam@op.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r--sound/pci/ctxfi/cthw20k2.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index b6b11bfe7574..5364164674e4 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -1307,10 +1307,10 @@ static int hw_pll_init(struct hw *hw, unsigned int rsr)
1307 set_field(&pllctl, PLLCTL_B, 0); 1307 set_field(&pllctl, PLLCTL_B, 0);
1308 if (48000 == rsr) { 1308 if (48000 == rsr) {
1309 set_field(&pllctl, PLLCTL_FD, 16 - 2); 1309 set_field(&pllctl, PLLCTL_FD, 16 - 2);
1310 set_field(&pllctl, PLLCTL_RD, 1 - 1); 1310 set_field(&pllctl, PLLCTL_RD, 1 - 1); /* 3000*16/1 = 48000 */
1311 } else { /* 44100 */ 1311 } else { /* 44100 */
1312 set_field(&pllctl, PLLCTL_FD, 147 - 2); 1312 set_field(&pllctl, PLLCTL_FD, 147 - 2);
1313 set_field(&pllctl, PLLCTL_RD, 10 - 1); 1313 set_field(&pllctl, PLLCTL_RD, 10 - 1); /* 3000*147/10 = 44100 */
1314 } 1314 }
1315 hw_write_20kx(hw, PLL_CTL, pllctl); 1315 hw_write_20kx(hw, PLL_CTL, pllctl);
1316 mdelay(40); 1316 mdelay(40);
@@ -1740,6 +1740,10 @@ static int hw_is_adc_input_selected(struct hw *hw, enum ADCSRC type)
1740 return data; 1740 return data;
1741} 1741}
1742 1742
1743#define MIC_BOOST_0DB 0xCF
1744#define MIC_BOOST_STEPS_PER_DB 2
1745#define MIC_BOOST_20DB (MIC_BOOST_0DB + 20 * MIC_BOOST_STEPS_PER_DB)
1746
1743static int hw_adc_input_select(struct hw *hw, enum ADCSRC type) 1747static int hw_adc_input_select(struct hw *hw, enum ADCSRC type)
1744{ 1748{
1745 u32 data; 1749 u32 data;
@@ -1751,10 +1755,12 @@ static int hw_adc_input_select(struct hw *hw, enum ADCSRC type)
1751 hw_write_20kx(hw, GPIO_DATA, data); 1755 hw_write_20kx(hw, GPIO_DATA, data);
1752 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101), 1756 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101),
1753 MAKE_WM8775_DATA(0x101)); /* Mic-in */ 1757 MAKE_WM8775_DATA(0x101)); /* Mic-in */
1754 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCL, 0xE7), 1758 hw20k2_i2c_write(hw,
1755 MAKE_WM8775_DATA(0xE7)); /* +12dB boost */ 1759 MAKE_WM8775_ADDR(WM8775_AADCL, MIC_BOOST_20DB),
1756 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCR, 0xE7), 1760 MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */
1757 MAKE_WM8775_DATA(0xE7)); /* +12dB boost */ 1761 hw20k2_i2c_write(hw,
1762 MAKE_WM8775_ADDR(WM8775_AADCR, MIC_BOOST_20DB),
1763 MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */
1758 break; 1764 break;
1759 case ADC_LINEIN: 1765 case ADC_LINEIN:
1760 data &= ~(0x1 << 14); 1766 data &= ~(0x1 << 14);
@@ -1827,10 +1833,12 @@ static int hw_adc_init(struct hw *hw, const struct adc_conf *info)
1827 1833
1828 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101), 1834 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_ADCMC, 0x101),
1829 MAKE_WM8775_DATA(0x101)); /* Mic-in */ 1835 MAKE_WM8775_DATA(0x101)); /* Mic-in */
1830 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCL, 0xE7), 1836 hw20k2_i2c_write(hw,
1831 MAKE_WM8775_DATA(0xE7)); /* +12dB boost */ 1837 MAKE_WM8775_ADDR(WM8775_AADCL, MIC_BOOST_20DB),
1832 hw20k2_i2c_write(hw, MAKE_WM8775_ADDR(WM8775_AADCR, 0xE7), 1838 MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */
1833 MAKE_WM8775_DATA(0xE7)); /* +12dB boost */ 1839 hw20k2_i2c_write(hw,
1840 MAKE_WM8775_ADDR(WM8775_AADCR, MIC_BOOST_20DB),
1841 MAKE_WM8775_DATA(MIC_BOOST_20DB)); /* +20dB */
1834 } else if (mux == 2) { 1842 } else if (mux == 2) {
1835 /* Configures GPIO data to select Line-in */ 1843 /* Configures GPIO data to select Line-in */
1836 data &= ~(0x1 << 14); 1844 data &= ~(0x1 << 14);