aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_ca0132.c
diff options
context:
space:
mode:
authorIan Minett <ian_minett@creativelabs.com>2012-12-20 21:53:41 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-15 11:01:16 -0500
commit406261ce998589dc980d9a6683a5ef3153eec1a5 (patch)
treee4a68a41886d26597e9a0ec7f0972f8e882be6f7 /sound/pci/hda/patch_ca0132.c
parent441aa6a016f66f2d20a95d1afafe3e47254a666f (diff)
ALSA: hda/ca0132: Fix potential init errors and update module description
Handle a potential dma_engine alloc error and fix the possible use of an uninitialized status variable in dspxfr_one_seg(). Also correct the initial sampling rate for Mic 1. Update the module description. Signed-off-by: Ian Minett <ian_minett@creativelabs.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_ca0132.c')
-rw-r--r--sound/pci/hda/patch_ca0132.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 4c9b95e56567..2b026e2733c8 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2223,7 +2223,7 @@ static int dspxfr_one_seg(struct hda_codec *codec,
2223 unsigned int port_map_mask, 2223 unsigned int port_map_mask,
2224 bool ovly) 2224 bool ovly)
2225{ 2225{
2226 int status; 2226 int status = 0;
2227 bool comm_dma_setup_done = false; 2227 bool comm_dma_setup_done = false;
2228 const unsigned int *data; 2228 const unsigned int *data;
2229 unsigned int chip_addx; 2229 unsigned int chip_addx;
@@ -2416,8 +2416,10 @@ static int dspxfr_image(struct hda_codec *codec,
2416 return -EINVAL; 2416 return -EINVAL;
2417 2417
2418 dma_engine = kzalloc(sizeof(*dma_engine), GFP_KERNEL); 2418 dma_engine = kzalloc(sizeof(*dma_engine), GFP_KERNEL);
2419 if (!dma_engine) 2419 if (!dma_engine) {
2420 return -ENOMEM; 2420 status = -ENOMEM;
2421 goto exit;
2422 }
2421 2423
2422 dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL); 2424 dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL);
2423 if (!dma_engine->dmab) { 2425 if (!dma_engine->dmab) {
@@ -4340,8 +4342,8 @@ static void ca0132_set_dsp_msr(struct hda_codec *codec, bool is96k)
4340 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_B_96KHZ, is96k); 4342 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_B_96KHZ, is96k);
4341 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_C_96KHZ, is96k); 4343 chipio_set_control_flag(codec, CONTROL_FLAG_ADC_C_96KHZ, is96k);
4342 4344
4343 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_16_000); 4345 chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000);
4344 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_16_000); 4346 chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000);
4345 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000); 4347 chipio_set_conn_rate(codec, MEM_CONNID_WUH, SR_48_000);
4346} 4348}
4347 4349
@@ -4685,7 +4687,7 @@ static struct hda_codec_preset snd_hda_preset_ca0132[] = {
4685MODULE_ALIAS("snd-hda-codec-id:11020011"); 4687MODULE_ALIAS("snd-hda-codec-id:11020011");
4686 4688
4687MODULE_LICENSE("GPL"); 4689MODULE_LICENSE("GPL");
4688MODULE_DESCRIPTION("Creative CA0132, CA0132 HD-audio codec"); 4690MODULE_DESCRIPTION("Creative Sound Core3D codec");
4689 4691
4690static struct hda_codec_preset_list ca0132_list = { 4692static struct hda_codec_preset_list ca0132_list = {
4691 .preset = snd_hda_preset_ca0132, 4693 .preset = snd_hda_preset_ca0132,