diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/arm/aaci.c | 3 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_beep.c | 16 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.c | 10 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 21 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 16 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 18 | ||||
-rw-r--r-- | sound/soc/codecs/ac97.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/wm8510.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/wm8940.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/wm8974.c | 14 | ||||
-rw-r--r-- | sound/soc/sh/fsi-ak4642.c | 30 |
13 files changed, 90 insertions, 81 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index c5699863643b..656e474dca47 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c | |||
@@ -441,6 +441,7 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, | |||
441 | struct snd_pcm_hw_params *params) | 441 | struct snd_pcm_hw_params *params) |
442 | { | 442 | { |
443 | int err; | 443 | int err; |
444 | struct aaci *aaci = substream->private_data; | ||
444 | 445 | ||
445 | aaci_pcm_hw_free(substream); | 446 | aaci_pcm_hw_free(substream); |
446 | if (aacirun->pcm_open) { | 447 | if (aacirun->pcm_open) { |
@@ -560,7 +561,6 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream) | |||
560 | static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream, | 561 | static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream, |
561 | struct snd_pcm_hw_params *params) | 562 | struct snd_pcm_hw_params *params) |
562 | { | 563 | { |
563 | struct aaci *aaci = substream->private_data; | ||
564 | struct aaci_runtime *aacirun = substream->runtime->private_data; | 564 | struct aaci_runtime *aacirun = substream->runtime->private_data; |
565 | unsigned int channels = params_channels(params); | 565 | unsigned int channels = params_channels(params); |
566 | int ret; | 566 | int ret; |
@@ -659,7 +659,6 @@ static struct snd_pcm_ops aaci_playback_ops = { | |||
659 | static int aaci_pcm_capture_hw_params(struct snd_pcm_substream *substream, | 659 | static int aaci_pcm_capture_hw_params(struct snd_pcm_substream *substream, |
660 | struct snd_pcm_hw_params *params) | 660 | struct snd_pcm_hw_params *params) |
661 | { | 661 | { |
662 | struct aaci *aaci = substream->private_data; | ||
663 | struct aaci_runtime *aacirun = substream->runtime->private_data; | 662 | struct aaci_runtime *aacirun = substream->runtime->private_data; |
664 | int ret; | 663 | int ret; |
665 | 664 | ||
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 29ab46a12e11..25b0641e6b8c 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -1918,13 +1918,13 @@ int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) | |||
1918 | 1918 | ||
1919 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, | 1919 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_RATE, |
1920 | hw->rate_min, hw->rate_max); | 1920 | hw->rate_min, hw->rate_max); |
1921 | if (err < 0) | 1921 | if (err < 0) |
1922 | return err; | 1922 | return err; |
1923 | 1923 | ||
1924 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | 1924 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, |
1925 | hw->period_bytes_min, hw->period_bytes_max); | 1925 | hw->period_bytes_min, hw->period_bytes_max); |
1926 | if (err < 0) | 1926 | if (err < 0) |
1927 | return err; | 1927 | return err; |
1928 | 1928 | ||
1929 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, | 1929 | err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, |
1930 | hw->periods_min, hw->periods_max); | 1930 | hw->periods_min, hw->periods_max); |
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index 5fe34a8d8c81..e4581a42ace5 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c | |||
@@ -42,7 +42,7 @@ static void snd_hda_generate_beep(struct work_struct *work) | |||
42 | return; | 42 | return; |
43 | 43 | ||
44 | /* generate tone */ | 44 | /* generate tone */ |
45 | snd_hda_codec_write_cache(codec, beep->nid, 0, | 45 | snd_hda_codec_write(codec, beep->nid, 0, |
46 | AC_VERB_SET_BEEP_CONTROL, beep->tone); | 46 | AC_VERB_SET_BEEP_CONTROL, beep->tone); |
47 | } | 47 | } |
48 | 48 | ||
@@ -119,7 +119,7 @@ static void snd_hda_do_detach(struct hda_beep *beep) | |||
119 | beep->dev = NULL; | 119 | beep->dev = NULL; |
120 | cancel_work_sync(&beep->beep_work); | 120 | cancel_work_sync(&beep->beep_work); |
121 | /* turn off beep for sure */ | 121 | /* turn off beep for sure */ |
122 | snd_hda_codec_write_cache(beep->codec, beep->nid, 0, | 122 | snd_hda_codec_write(beep->codec, beep->nid, 0, |
123 | AC_VERB_SET_BEEP_CONTROL, 0); | 123 | AC_VERB_SET_BEEP_CONTROL, 0); |
124 | } | 124 | } |
125 | 125 | ||
@@ -192,7 +192,7 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) | |||
192 | beep->enabled = enable; | 192 | beep->enabled = enable; |
193 | if (!enable) { | 193 | if (!enable) { |
194 | /* turn off beep */ | 194 | /* turn off beep */ |
195 | snd_hda_codec_write_cache(beep->codec, beep->nid, 0, | 195 | snd_hda_codec_write(beep->codec, beep->nid, 0, |
196 | AC_VERB_SET_BEEP_CONTROL, 0); | 196 | AC_VERB_SET_BEEP_CONTROL, 0); |
197 | } | 197 | } |
198 | if (beep->mode == HDA_BEEP_MODE_SWREG) { | 198 | if (beep->mode == HDA_BEEP_MODE_SWREG) { |
@@ -239,8 +239,12 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) | |||
239 | mutex_init(&beep->mutex); | 239 | mutex_init(&beep->mutex); |
240 | 240 | ||
241 | if (beep->mode == HDA_BEEP_MODE_ON) { | 241 | if (beep->mode == HDA_BEEP_MODE_ON) { |
242 | beep->enabled = 1; | 242 | int err = snd_hda_do_attach(beep); |
243 | snd_hda_do_register(&beep->register_work); | 243 | if (err < 0) { |
244 | kfree(beep); | ||
245 | codec->beep = NULL; | ||
246 | return err; | ||
247 | } | ||
244 | } | 248 | } |
245 | 249 | ||
246 | return 0; | 250 | return 0; |
@@ -253,7 +257,7 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) | |||
253 | if (beep) { | 257 | if (beep) { |
254 | cancel_work_sync(&beep->register_work); | 258 | cancel_work_sync(&beep->register_work); |
255 | cancel_delayed_work(&beep->unregister_work); | 259 | cancel_delayed_work(&beep->unregister_work); |
256 | if (beep->enabled) | 260 | if (beep->dev) |
257 | snd_hda_do_detach(beep); | 261 | snd_hda_do_detach(beep); |
258 | codec->beep = NULL; | 262 | codec->beep = NULL; |
259 | kfree(beep); | 263 | kfree(beep); |
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 950ee5cfcacf..f98b47cd6cfb 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1327,11 +1327,13 @@ EXPORT_SYMBOL_HDA(snd_hda_query_pin_caps); | |||
1327 | */ | 1327 | */ |
1328 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) | 1328 | u32 snd_hda_pin_sense(struct hda_codec *codec, hda_nid_t nid) |
1329 | { | 1329 | { |
1330 | u32 pincap = snd_hda_query_pin_caps(codec, nid); | 1330 | u32 pincap; |
1331 | |||
1332 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1333 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1334 | 1331 | ||
1332 | if (!codec->no_trigger_sense) { | ||
1333 | pincap = snd_hda_query_pin_caps(codec, nid); | ||
1334 | if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ | ||
1335 | snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
1336 | } | ||
1335 | return snd_hda_codec_read(codec, nid, 0, | 1337 | return snd_hda_codec_read(codec, nid, 0, |
1336 | AC_VERB_GET_PIN_SENSE, 0); | 1338 | AC_VERB_GET_PIN_SENSE, 0); |
1337 | } | 1339 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 1d541b7f5547..0a770a28e71f 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -817,6 +817,7 @@ struct hda_codec { | |||
817 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index | 817 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index |
818 | * (e.g. Conexant codecs) | 818 | * (e.g. Conexant codecs) |
819 | */ | 819 | */ |
820 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ | ||
820 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 821 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
821 | unsigned int power_on :1; /* current (global) power-state */ | 822 | unsigned int power_on :1; /* current (global) power-state */ |
822 | unsigned int power_transition :1; /* power-state in transition */ | 823 | unsigned int power_transition :1; /* power-state in transition */ |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ff8ad46cc50e..ec9c348336cc 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -356,6 +356,7 @@ struct azx_dev { | |||
356 | */ | 356 | */ |
357 | unsigned char stream_tag; /* assigned stream */ | 357 | unsigned char stream_tag; /* assigned stream */ |
358 | unsigned char index; /* stream index */ | 358 | unsigned char index; /* stream index */ |
359 | int device; /* last device number assigned to */ | ||
359 | 360 | ||
360 | unsigned int opened :1; | 361 | unsigned int opened :1; |
361 | unsigned int running :1; | 362 | unsigned int running :1; |
@@ -1441,10 +1442,13 @@ static int __devinit azx_codec_configure(struct azx *chip) | |||
1441 | */ | 1442 | */ |
1442 | 1443 | ||
1443 | /* assign a stream for the PCM */ | 1444 | /* assign a stream for the PCM */ |
1444 | static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream) | 1445 | static inline struct azx_dev * |
1446 | azx_assign_device(struct azx *chip, struct snd_pcm_substream *substream) | ||
1445 | { | 1447 | { |
1446 | int dev, i, nums; | 1448 | int dev, i, nums; |
1447 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { | 1449 | struct azx_dev *res = NULL; |
1450 | |||
1451 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
1448 | dev = chip->playback_index_offset; | 1452 | dev = chip->playback_index_offset; |
1449 | nums = chip->playback_streams; | 1453 | nums = chip->playback_streams; |
1450 | } else { | 1454 | } else { |
@@ -1453,10 +1457,15 @@ static inline struct azx_dev *azx_assign_device(struct azx *chip, int stream) | |||
1453 | } | 1457 | } |
1454 | for (i = 0; i < nums; i++, dev++) | 1458 | for (i = 0; i < nums; i++, dev++) |
1455 | if (!chip->azx_dev[dev].opened) { | 1459 | if (!chip->azx_dev[dev].opened) { |
1456 | chip->azx_dev[dev].opened = 1; | 1460 | res = &chip->azx_dev[dev]; |
1457 | return &chip->azx_dev[dev]; | 1461 | if (res->device == substream->pcm->device) |
1462 | break; | ||
1458 | } | 1463 | } |
1459 | return NULL; | 1464 | if (res) { |
1465 | res->opened = 1; | ||
1466 | res->device = substream->pcm->device; | ||
1467 | } | ||
1468 | return res; | ||
1460 | } | 1469 | } |
1461 | 1470 | ||
1462 | /* release the assigned stream */ | 1471 | /* release the assigned stream */ |
@@ -1505,7 +1514,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) | |||
1505 | int err; | 1514 | int err; |
1506 | 1515 | ||
1507 | mutex_lock(&chip->open_mutex); | 1516 | mutex_lock(&chip->open_mutex); |
1508 | azx_dev = azx_assign_device(chip, substream->stream); | 1517 | azx_dev = azx_assign_device(chip, substream); |
1509 | if (azx_dev == NULL) { | 1518 | if (azx_dev == NULL) { |
1510 | mutex_unlock(&chip->open_mutex); | 1519 | mutex_unlock(&chip->open_mutex); |
1511 | return -EBUSY; | 1520 | return -EBUSY; |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 1a36137e13ec..69a941c7b158 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -1186,6 +1186,8 @@ static int patch_ad1986a(struct hda_codec *codec) | |||
1186 | */ | 1186 | */ |
1187 | spec->multiout.no_share_stream = 1; | 1187 | spec->multiout.no_share_stream = 1; |
1188 | 1188 | ||
1189 | codec->no_trigger_sense = 1; | ||
1190 | |||
1189 | return 0; | 1191 | return 0; |
1190 | } | 1192 | } |
1191 | 1193 | ||
@@ -1371,6 +1373,8 @@ static int patch_ad1983(struct hda_codec *codec) | |||
1371 | 1373 | ||
1372 | codec->patch_ops = ad198x_patch_ops; | 1374 | codec->patch_ops = ad198x_patch_ops; |
1373 | 1375 | ||
1376 | codec->no_trigger_sense = 1; | ||
1377 | |||
1374 | return 0; | 1378 | return 0; |
1375 | } | 1379 | } |
1376 | 1380 | ||
@@ -1813,6 +1817,9 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1813 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; | 1817 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; |
1814 | break; | 1818 | break; |
1815 | } | 1819 | } |
1820 | |||
1821 | codec->no_trigger_sense = 1; | ||
1822 | |||
1816 | return 0; | 1823 | return 0; |
1817 | } | 1824 | } |
1818 | 1825 | ||
@@ -3118,6 +3125,8 @@ static int patch_ad1988(struct hda_codec *codec) | |||
3118 | #endif | 3125 | #endif |
3119 | spec->vmaster_nid = 0x04; | 3126 | spec->vmaster_nid = 0x04; |
3120 | 3127 | ||
3128 | codec->no_trigger_sense = 1; | ||
3129 | |||
3121 | return 0; | 3130 | return 0; |
3122 | } | 3131 | } |
3123 | 3132 | ||
@@ -3330,6 +3339,8 @@ static int patch_ad1884(struct hda_codec *codec) | |||
3330 | 3339 | ||
3331 | codec->patch_ops = ad198x_patch_ops; | 3340 | codec->patch_ops = ad198x_patch_ops; |
3332 | 3341 | ||
3342 | codec->no_trigger_sense = 1; | ||
3343 | |||
3333 | return 0; | 3344 | return 0; |
3334 | } | 3345 | } |
3335 | 3346 | ||
@@ -4287,6 +4298,8 @@ static int patch_ad1884a(struct hda_codec *codec) | |||
4287 | break; | 4298 | break; |
4288 | } | 4299 | } |
4289 | 4300 | ||
4301 | codec->no_trigger_sense = 1; | ||
4302 | |||
4290 | return 0; | 4303 | return 0; |
4291 | } | 4304 | } |
4292 | 4305 | ||
@@ -4623,6 +4636,9 @@ static int patch_ad1882(struct hda_codec *codec) | |||
4623 | spec->mixers[2] = ad1882_6stack_mixers; | 4636 | spec->mixers[2] = ad1882_6stack_mixers; |
4624 | break; | 4637 | break; |
4625 | } | 4638 | } |
4639 | |||
4640 | codec->no_trigger_sense = 1; | ||
4641 | |||
4626 | return 0; | 4642 | return 0; |
4627 | } | 4643 | } |
4628 | 4644 | ||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index eeda7beeb57a..2291a8396817 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4453,14 +4453,7 @@ static inline int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) | |||
4453 | { | 4453 | { |
4454 | if (!nid) | 4454 | if (!nid) |
4455 | return 0; | 4455 | return 0; |
4456 | /* NOTE: we can't use snd_hda_jack_detect() here because STAC/IDT | 4456 | return snd_hda_jack_detect(codec, nid); |
4457 | * codecs behave wrongly when SET_PIN_SENSE is triggered, although | ||
4458 | * the pincap gives TRIG_REQ bit. | ||
4459 | */ | ||
4460 | if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0) & | ||
4461 | AC_PINSENSE_PRESENCE) | ||
4462 | return 1; | ||
4463 | return 0; | ||
4464 | } | 4457 | } |
4465 | 4458 | ||
4466 | static void stac92xx_line_out_detect(struct hda_codec *codec, | 4459 | static void stac92xx_line_out_detect(struct hda_codec *codec, |
@@ -4962,6 +4955,7 @@ static int patch_stac9200(struct hda_codec *codec) | |||
4962 | if (spec == NULL) | 4955 | if (spec == NULL) |
4963 | return -ENOMEM; | 4956 | return -ENOMEM; |
4964 | 4957 | ||
4958 | codec->no_trigger_sense = 1; | ||
4965 | codec->spec = spec; | 4959 | codec->spec = spec; |
4966 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); | 4960 | spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); |
4967 | spec->pin_nids = stac9200_pin_nids; | 4961 | spec->pin_nids = stac9200_pin_nids; |
@@ -5024,6 +5018,7 @@ static int patch_stac925x(struct hda_codec *codec) | |||
5024 | if (spec == NULL) | 5018 | if (spec == NULL) |
5025 | return -ENOMEM; | 5019 | return -ENOMEM; |
5026 | 5020 | ||
5021 | codec->no_trigger_sense = 1; | ||
5027 | codec->spec = spec; | 5022 | codec->spec = spec; |
5028 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); | 5023 | spec->num_pins = ARRAY_SIZE(stac925x_pin_nids); |
5029 | spec->pin_nids = stac925x_pin_nids; | 5024 | spec->pin_nids = stac925x_pin_nids; |
@@ -5108,6 +5103,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) | |||
5108 | if (spec == NULL) | 5103 | if (spec == NULL) |
5109 | return -ENOMEM; | 5104 | return -ENOMEM; |
5110 | 5105 | ||
5106 | codec->no_trigger_sense = 1; | ||
5111 | codec->spec = spec; | 5107 | codec->spec = spec; |
5112 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; | 5108 | codec->slave_dig_outs = stac92hd73xx_slave_dig_outs; |
5113 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); | 5109 | spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids); |
@@ -5255,6 +5251,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) | |||
5255 | if (spec == NULL) | 5251 | if (spec == NULL) |
5256 | return -ENOMEM; | 5252 | return -ENOMEM; |
5257 | 5253 | ||
5254 | codec->no_trigger_sense = 1; | ||
5258 | codec->spec = spec; | 5255 | codec->spec = spec; |
5259 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; | 5256 | codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs; |
5260 | spec->digbeep_nid = 0x21; | 5257 | spec->digbeep_nid = 0x21; |
@@ -5418,6 +5415,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec) | |||
5418 | if (spec == NULL) | 5415 | if (spec == NULL) |
5419 | return -ENOMEM; | 5416 | return -ENOMEM; |
5420 | 5417 | ||
5418 | codec->no_trigger_sense = 1; | ||
5421 | codec->spec = spec; | 5419 | codec->spec = spec; |
5422 | codec->patch_ops = stac92xx_patch_ops; | 5420 | codec->patch_ops = stac92xx_patch_ops; |
5423 | spec->num_pins = STAC92HD71BXX_NUM_PINS; | 5421 | spec->num_pins = STAC92HD71BXX_NUM_PINS; |
@@ -5661,6 +5659,7 @@ static int patch_stac922x(struct hda_codec *codec) | |||
5661 | if (spec == NULL) | 5659 | if (spec == NULL) |
5662 | return -ENOMEM; | 5660 | return -ENOMEM; |
5663 | 5661 | ||
5662 | codec->no_trigger_sense = 1; | ||
5664 | codec->spec = spec; | 5663 | codec->spec = spec; |
5665 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); | 5664 | spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); |
5666 | spec->pin_nids = stac922x_pin_nids; | 5665 | spec->pin_nids = stac922x_pin_nids; |
@@ -5764,6 +5763,7 @@ static int patch_stac927x(struct hda_codec *codec) | |||
5764 | if (spec == NULL) | 5763 | if (spec == NULL) |
5765 | return -ENOMEM; | 5764 | return -ENOMEM; |
5766 | 5765 | ||
5766 | codec->no_trigger_sense = 1; | ||
5767 | codec->spec = spec; | 5767 | codec->spec = spec; |
5768 | codec->slave_dig_outs = stac927x_slave_dig_outs; | 5768 | codec->slave_dig_outs = stac927x_slave_dig_outs; |
5769 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); | 5769 | spec->num_pins = ARRAY_SIZE(stac927x_pin_nids); |
@@ -5898,6 +5898,7 @@ static int patch_stac9205(struct hda_codec *codec) | |||
5898 | if (spec == NULL) | 5898 | if (spec == NULL) |
5899 | return -ENOMEM; | 5899 | return -ENOMEM; |
5900 | 5900 | ||
5901 | codec->no_trigger_sense = 1; | ||
5901 | codec->spec = spec; | 5902 | codec->spec = spec; |
5902 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); | 5903 | spec->num_pins = ARRAY_SIZE(stac9205_pin_nids); |
5903 | spec->pin_nids = stac9205_pin_nids; | 5904 | spec->pin_nids = stac9205_pin_nids; |
@@ -6053,6 +6054,7 @@ static int patch_stac9872(struct hda_codec *codec) | |||
6053 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); | 6054 | spec = kzalloc(sizeof(*spec), GFP_KERNEL); |
6054 | if (spec == NULL) | 6055 | if (spec == NULL) |
6055 | return -ENOMEM; | 6056 | return -ENOMEM; |
6057 | codec->no_trigger_sense = 1; | ||
6056 | codec->spec = spec; | 6058 | codec->spec = spec; |
6057 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); | 6059 | spec->num_pins = ARRAY_SIZE(stac9872_pin_nids); |
6058 | spec->pin_nids = stac9872_pin_nids; | 6060 | spec->pin_nids = stac9872_pin_nids; |
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 69bd0acc81c8..a1bbe16b7f96 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c | |||
@@ -102,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev) | |||
102 | INIT_LIST_HEAD(&codec->dapm_widgets); | 102 | INIT_LIST_HEAD(&codec->dapm_widgets); |
103 | INIT_LIST_HEAD(&codec->dapm_paths); | 103 | INIT_LIST_HEAD(&codec->dapm_paths); |
104 | 104 | ||
105 | ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); | ||
106 | if (ret < 0) { | ||
107 | printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n"); | ||
108 | goto err; | ||
109 | } | ||
110 | |||
105 | /* register pcms */ | 111 | /* register pcms */ |
106 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); | 112 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); |
107 | if (ret < 0) | 113 | if (ret < 0) |
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 265e68c75df8..af8cb6995a1f 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -424,23 +424,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream, | |||
424 | 424 | ||
425 | /* filter coefficient */ | 425 | /* filter coefficient */ |
426 | switch (params_rate(params)) { | 426 | switch (params_rate(params)) { |
427 | case SNDRV_PCM_RATE_8000: | 427 | case 8000: |
428 | adn |= 0x5 << 1; | 428 | adn |= 0x5 << 1; |
429 | break; | 429 | break; |
430 | case SNDRV_PCM_RATE_11025: | 430 | case 11025: |
431 | adn |= 0x4 << 1; | 431 | adn |= 0x4 << 1; |
432 | break; | 432 | break; |
433 | case SNDRV_PCM_RATE_16000: | 433 | case 16000: |
434 | adn |= 0x3 << 1; | 434 | adn |= 0x3 << 1; |
435 | break; | 435 | break; |
436 | case SNDRV_PCM_RATE_22050: | 436 | case 22050: |
437 | adn |= 0x2 << 1; | 437 | adn |= 0x2 << 1; |
438 | break; | 438 | break; |
439 | case SNDRV_PCM_RATE_32000: | 439 | case 32000: |
440 | adn |= 0x1 << 1; | 440 | adn |= 0x1 << 1; |
441 | break; | 441 | break; |
442 | case SNDRV_PCM_RATE_44100: | 442 | case 44100: |
443 | case SNDRV_PCM_RATE_48000: | 443 | case 48000: |
444 | break; | 444 | break; |
445 | } | 445 | } |
446 | 446 | ||
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 3d850b97037a..31e39ffd1d8e 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c | |||
@@ -378,23 +378,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream, | |||
378 | iface |= (1 << 9); | 378 | iface |= (1 << 9); |
379 | 379 | ||
380 | switch (params_rate(params)) { | 380 | switch (params_rate(params)) { |
381 | case SNDRV_PCM_RATE_8000: | 381 | case 8000: |
382 | addcntrl |= (0x5 << 1); | 382 | addcntrl |= (0x5 << 1); |
383 | break; | 383 | break; |
384 | case SNDRV_PCM_RATE_11025: | 384 | case 11025: |
385 | addcntrl |= (0x4 << 1); | 385 | addcntrl |= (0x4 << 1); |
386 | break; | 386 | break; |
387 | case SNDRV_PCM_RATE_16000: | 387 | case 16000: |
388 | addcntrl |= (0x3 << 1); | 388 | addcntrl |= (0x3 << 1); |
389 | break; | 389 | break; |
390 | case SNDRV_PCM_RATE_22050: | 390 | case 22050: |
391 | addcntrl |= (0x2 << 1); | 391 | addcntrl |= (0x2 << 1); |
392 | break; | 392 | break; |
393 | case SNDRV_PCM_RATE_32000: | 393 | case 32000: |
394 | addcntrl |= (0x1 << 1); | 394 | addcntrl |= (0x1 << 1); |
395 | break; | 395 | break; |
396 | case SNDRV_PCM_RATE_44100: | 396 | case 44100: |
397 | case SNDRV_PCM_RATE_48000: | 397 | case 48000: |
398 | break; | 398 | break; |
399 | } | 399 | } |
400 | ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); | 400 | ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl); |
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index a808675388fc..8812751da8c9 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c | |||
@@ -482,23 +482,23 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream, | |||
482 | 482 | ||
483 | /* filter coefficient */ | 483 | /* filter coefficient */ |
484 | switch (params_rate(params)) { | 484 | switch (params_rate(params)) { |
485 | case SNDRV_PCM_RATE_8000: | 485 | case 8000: |
486 | adn |= 0x5 << 1; | 486 | adn |= 0x5 << 1; |
487 | break; | 487 | break; |
488 | case SNDRV_PCM_RATE_11025: | 488 | case 11025: |
489 | adn |= 0x4 << 1; | 489 | adn |= 0x4 << 1; |
490 | break; | 490 | break; |
491 | case SNDRV_PCM_RATE_16000: | 491 | case 16000: |
492 | adn |= 0x3 << 1; | 492 | adn |= 0x3 << 1; |
493 | break; | 493 | break; |
494 | case SNDRV_PCM_RATE_22050: | 494 | case 22050: |
495 | adn |= 0x2 << 1; | 495 | adn |= 0x2 << 1; |
496 | break; | 496 | break; |
497 | case SNDRV_PCM_RATE_32000: | 497 | case 32000: |
498 | adn |= 0x1 << 1; | 498 | adn |= 0x1 << 1; |
499 | break; | 499 | break; |
500 | case SNDRV_PCM_RATE_44100: | 500 | case 44100: |
501 | case SNDRV_PCM_RATE_48000: | 501 | case 48000: |
502 | break; | 502 | break; |
503 | } | 503 | } |
504 | 504 | ||
diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c index c7af09729c6e..5263ab18f827 100644 --- a/sound/soc/sh/fsi-ak4642.c +++ b/sound/soc/sh/fsi-ak4642.c | |||
@@ -42,42 +42,12 @@ static struct snd_soc_device fsi_snd_devdata = { | |||
42 | .codec_dev = &soc_codec_dev_ak4642, | 42 | .codec_dev = &soc_codec_dev_ak4642, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #define AK4642_BUS 0 | ||
46 | #define AK4642_ADR 0x12 | ||
47 | static int ak4642_add_i2c_device(void) | ||
48 | { | ||
49 | struct i2c_board_info info; | ||
50 | struct i2c_adapter *adapter; | ||
51 | struct i2c_client *client; | ||
52 | |||
53 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
54 | info.addr = AK4642_ADR; | ||
55 | strlcpy(info.type, "ak4642", I2C_NAME_SIZE); | ||
56 | |||
57 | adapter = i2c_get_adapter(AK4642_BUS); | ||
58 | if (!adapter) { | ||
59 | printk(KERN_DEBUG "can't get i2c adapter\n"); | ||
60 | return -ENODEV; | ||
61 | } | ||
62 | |||
63 | client = i2c_new_device(adapter, &info); | ||
64 | i2c_put_adapter(adapter); | ||
65 | if (!client) { | ||
66 | printk(KERN_DEBUG "can't add i2c device\n"); | ||
67 | return -ENODEV; | ||
68 | } | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static struct platform_device *fsi_snd_device; | 45 | static struct platform_device *fsi_snd_device; |
74 | 46 | ||
75 | static int __init fsi_ak4642_init(void) | 47 | static int __init fsi_ak4642_init(void) |
76 | { | 48 | { |
77 | int ret = -ENOMEM; | 49 | int ret = -ENOMEM; |
78 | 50 | ||
79 | ak4642_add_i2c_device(); | ||
80 | |||
81 | fsi_snd_device = platform_device_alloc("soc-audio", -1); | 51 | fsi_snd_device = platform_device_alloc("soc-audio", -1); |
82 | if (!fsi_snd_device) | 52 | if (!fsi_snd_device) |
83 | goto out; | 53 | goto out; |