Commit 9d5eb678 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (24 commits)
  ALSA: sbawe: fix memory detection
  ALSA: fix incorrect rounding direction in snd_interval_ratnum()
  ALSA: HDA: add powersaving hook for Realtek
  ALSA: HDA: remove useless mixers on Aspire 8930G
  ALSA: HDA: simplify Aspire 8930G verb array
  ALSA: hda: Set Front Mic to input vref 50% for Lenovo 3000 Y410
  ALSA: hda/realtek: Remove extra .capsrc_nids initialization for ALC889_INTEL
  ALSA: Use kzalloc for allocating only one thing
  ALSA: AACI: switch to per-pcm locking
  ALSA: AACI: add double-rate support
  ALSA: AACI: factor common hw_params logic into aaci_pcm_hw_params
  ALSA: AACI: cleanup aaci_pcm_hw_params
  ALSA: AACI: simplify codec rate information
  ALSA: aaci - Fix a typo
  ASoC: wm8974: fix a wrong bit definition
  sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
  ALSA: hda - Fix quirk for Maxdata obook4-1
  ALSA: hda - Fix missing capsrc_nids for ALC88x
  ALSA: hda - Make use of beep device found in Dell Vostro 1015n
  ALSA: hda - Fixed internal mic initialization for Dell Vostro 1015
  ...
parents 3d354cbc 1f26cb92
This diff is collapsed.
...@@ -202,6 +202,7 @@ ...@@ -202,6 +202,7 @@
struct aaci_runtime { struct aaci_runtime {
void __iomem *base; void __iomem *base;
void __iomem *fifo; void __iomem *fifo;
spinlock_t lock;
struct ac97_pcm *pcm; struct ac97_pcm *pcm;
int pcm_open; int pcm_open;
...@@ -232,7 +233,6 @@ struct aaci { ...@@ -232,7 +233,6 @@ struct aaci {
struct snd_ac97 *ac97; struct snd_ac97 *ac97;
u32 maincr; u32 maincr;
spinlock_t lock;
struct aaci_runtime playback; struct aaci_runtime playback;
struct aaci_runtime capture; struct aaci_runtime capture;
......
...@@ -758,7 +758,7 @@ int snd_interval_ratnum(struct snd_interval *i, ...@@ -758,7 +758,7 @@ int snd_interval_ratnum(struct snd_interval *i,
int diff; int diff;
if (q == 0) if (q == 0)
q = 1; q = 1;
den = div_down(num, q); den = div_up(num, q);
if (den < rats[k].den_min) if (den < rats[k].den_min)
continue; continue;
if (den > rats[k].den_max) if (den > rats[k].den_max)
...@@ -794,7 +794,7 @@ int snd_interval_ratnum(struct snd_interval *i, ...@@ -794,7 +794,7 @@ int snd_interval_ratnum(struct snd_interval *i,
i->empty = 1; i->empty = 1;
return -EINVAL; return -EINVAL;
} }
den = div_up(num, q); den = div_down(num, q);
if (den > rats[k].den_max) if (den > rats[k].den_max)
continue; continue;
if (den < rats[k].den_min) if (den < rats[k].den_min)
......
...@@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *card, int device) ...@@ -162,7 +162,7 @@ int snd_msndmidi_new(struct snd_card *card, int device)
err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi); err = snd_rawmidi_new(card, "MSND-MIDI", device, 1, 1, &rmidi);
if (err < 0) if (err < 0)
return err; return err;
mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL); mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
if (mpu == NULL) { if (mpu == NULL) {
snd_device_free(card, rmidi); snd_device_free(card, rmidi);
return -ENOMEM; return -ENOMEM;
......
...@@ -393,8 +393,6 @@ size_dram(struct snd_emu8000 *emu) ...@@ -393,8 +393,6 @@ size_dram(struct snd_emu8000 *emu)
while (size < EMU8000_MAX_DRAM) { while (size < EMU8000_MAX_DRAM) {
size += 512 * 1024; /* increment 512kbytes */
/* Write a unique data on the test address. /* Write a unique data on the test address.
* if the address is out of range, the data is written on * if the address is out of range, the data is written on
* 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is * 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is
...@@ -414,7 +412,9 @@ size_dram(struct snd_emu8000 *emu) ...@@ -414,7 +412,9 @@ size_dram(struct snd_emu8000 *emu)
/*snd_emu8000_read_wait(emu);*/ /*snd_emu8000_read_wait(emu);*/
EMU8000_SMLD_READ(emu); /* discard stale data */ EMU8000_SMLD_READ(emu); /* discard stale data */
if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
break; /* we must have wrapped around */ break; /* no memory at this address */
size += 512 * 1024; /* increment 512kbytes */
snd_emu8000_read_wait(emu); snd_emu8000_read_wait(emu);
......
...@@ -609,7 +609,7 @@ static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -609,7 +609,7 @@ static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
/* alloc virtual 'dma' area */ /* alloc virtual 'dma' area */
if (runtime->dma_area) if (runtime->dma_area)
vfree(runtime->dma_area); vfree(runtime->dma_area);
runtime->dma_area = vmalloc(size); runtime->dma_area = vmalloc_user(size);
if (runtime->dma_area == NULL) if (runtime->dma_area == NULL)
return -ENOMEM; return -ENOMEM;
runtime->dma_bytes = size; runtime->dma_bytes = size;
......
...@@ -269,7 +269,7 @@ static int pss_reset_dsp(pss_confdata * devc) ...@@ -269,7 +269,7 @@ static int pss_reset_dsp(pss_confdata * devc)
unsigned long i, limit = jiffies + HZ/10; unsigned long i, limit = jiffies + HZ/10;
outw(0x2000, REG(PSS_CONTROL)); outw(0x2000, REG(PSS_CONTROL));
for (i = 0; i < 32768 && (limit-jiffies >= 0); i++) for (i = 0; i < 32768 && time_after_eq(limit, jiffies); i++)
inw(REG(PSS_CONTROL)); inw(REG(PSS_CONTROL));
outw(0x0000, REG(PSS_CONTROL)); outw(0x0000, REG(PSS_CONTROL));
return 1; return 1;
...@@ -369,11 +369,11 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size ...@@ -369,11 +369,11 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size
outw(0, REG(PSS_DATA)); outw(0, REG(PSS_DATA));
limit = jiffies + HZ/10; limit = jiffies + HZ/10;
for (i = 0; i < 32768 && (limit - jiffies >= 0); i++) for (i = 0; i < 32768 && time_after_eq(limit, jiffies); i++)
val = inw(REG(PSS_STATUS)); val = inw(REG(PSS_STATUS));
limit = jiffies + HZ/10; limit = jiffies + HZ/10;
for (i = 0; i < 32768 && (limit-jiffies >= 0); i++) for (i = 0; i < 32768 && time_after_eq(limit, jiffies); i++)
{ {
val = inw(REG(PSS_STATUS)); val = inw(REG(PSS_STATUS));
if (val & 0x4000) if (val & 0x4000)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_beep.h"
#define CXT_PIN_DIR_IN 0x00 #define CXT_PIN_DIR_IN 0x00
#define CXT_PIN_DIR_OUT 0x01 #define CXT_PIN_DIR_OUT 0x01
...@@ -111,6 +112,7 @@ struct conexant_spec { ...@@ -111,6 +112,7 @@ struct conexant_spec {
unsigned int dell_automute; unsigned int dell_automute;
unsigned int port_d_mode; unsigned int port_d_mode;
unsigned char ext_mic_bias; unsigned char ext_mic_bias;
unsigned int dell_vostro;
}; };
static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
...@@ -476,6 +478,7 @@ static void conexant_free(struct hda_codec *codec) ...@@ -476,6 +478,7 @@ static void conexant_free(struct hda_codec *codec)
snd_array_free(&spec->jacks); snd_array_free(&spec->jacks);
} }
#endif #endif
snd_hda_detach_beep_device(codec);
kfree(codec->spec); kfree(codec->spec);
} }
...@@ -2109,9 +2112,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol, ...@@ -2109,9 +2112,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol,
{ {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
int val; int val;
hda_nid_t nid = kcontrol->private_value & 0xff;
int inout = (kcontrol->private_value & 0x100) ?
AC_AMP_GET_INPUT : AC_AMP_GET_OUTPUT;
val = snd_hda_codec_read(codec, 0x17, 0, val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_AMP_GAIN_MUTE, AC_AMP_GET_OUTPUT); AC_VERB_GET_AMP_GAIN_MUTE, inout);
ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN; ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN;
return 0; return 0;
...@@ -2123,6 +2129,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol, ...@@ -2123,6 +2129,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol); struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
const struct hda_input_mux *imux = &cxt5066_analog_mic_boost; const struct hda_input_mux *imux = &cxt5066_analog_mic_boost;
unsigned int idx; unsigned int idx;
hda_nid_t nid = kcontrol->private_value & 0xff;
int inout = (kcontrol->private_value & 0x100) ?
AC_AMP_SET_INPUT : AC_AMP_SET_OUTPUT;
if (!imux->num_items) if (!imux->num_items)
return 0; return 0;
...@@ -2130,9 +2139,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol, ...@@ -2130,9 +2139,9 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
if (idx >= imux->num_items) if (idx >= imux->num_items)
idx = imux->num_items - 1; idx = imux->num_items - 1;
snd_hda_codec_write_cache(codec, 0x17, 0, snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AC_VERB_SET_AMP_GAIN_MUTE,
AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT | AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | inout |
imux->items[idx].index); imux->items[idx].index);
return 1; return 1;
...@@ -2201,10 +2210,11 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { ...@@ -2201,10 +2210,11 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Analog Mic Boost Capture Enum", .name = "Ext Mic Boost Capture Enum",
.info = cxt5066_mic_boost_mux_enum_info, .info = cxt5066_mic_boost_mux_enum_info,
.get = cxt5066_mic_boost_mux_enum_get, .get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put, .put = cxt5066_mic_boost_mux_enum_put,
.private_value = 0x17,
}, },
HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others), HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others),
...@@ -2212,6 +2222,19 @@ static struct snd_kcontrol_new cxt5066_mixers[] = { ...@@ -2212,6 +2222,19 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {
{} {}
}; };
static struct snd_kcontrol_new cxt5066_vostro_mixers[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Int Mic Boost Capture Enum",
.info = cxt5066_mic_boost_mux_enum_info,
.get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put,
.private_value = 0x23 | 0x100,
},
HDA_CODEC_VOLUME_MONO("Beep Playback Volume", 0x13, 1, 0x0, HDA_OUTPUT),
{}
};
static struct hda_verb cxt5066_init_verbs[] = { static struct hda_verb cxt5066_init_verbs[] = {
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */ {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */ {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */
...@@ -2397,11 +2420,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = { ...@@ -2397,11 +2420,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = {
/* initialize jack-sensing, too */ /* initialize jack-sensing, too */
static int cxt5066_init(struct hda_codec *codec) static int cxt5066_init(struct hda_codec *codec)
{ {
struct conexant_spec *spec = codec->spec;
snd_printdd("CXT5066: init\n"); snd_printdd("CXT5066: init\n");
conexant_init(codec); conexant_init(codec);
if (codec->patch_ops.unsol_event) { if (codec->patch_ops.unsol_event) {
cxt5066_hp_automute(codec); cxt5066_hp_automute(codec);
cxt5066_automic(codec); if (spec->dell_vostro)
cxt5066_vostro_automic(codec);
else
cxt5066_automic(codec);
} }
return 0; return 0;
} }
...@@ -2500,7 +2528,10 @@ static int patch_cxt5066(struct hda_codec *codec) ...@@ -2500,7 +2528,10 @@ static int patch_cxt5066(struct hda_codec *codec)
spec->init_verbs[0] = cxt5066_init_verbs_vostro; spec->init_verbs[0] = cxt5066_init_verbs_vostro;
spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
spec->mixers[spec->num_mixers++] = cxt5066_mixers; spec->mixers[spec->num_mixers++] = cxt5066_mixers;
spec->mixers[spec->num_mixers++] = cxt5066_vostro_mixers;
spec->port_d_mode = 0; spec->port_d_mode = 0;
spec->dell_vostro = 1;
snd_hda_attach_beep_device(codec, 0x13);
/* no S/PDIF out */ /* no S/PDIF out */
spec->multiout.dig_out_nid = 0; spec->multiout.dig_out_nid = 0;
......
This diff is collapsed.
...@@ -51,7 +51,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s ...@@ -51,7 +51,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
return 0; /* already enough large */ return 0; /* already enough large */
vfree(runtime->dma_area); vfree(runtime->dma_area);
} }
runtime->dma_area = vmalloc_32(size); runtime->dma_area = vmalloc_32_user(size);
if (! runtime->dma_area) if (! runtime->dma_area)
return -ENOMEM; return -ENOMEM;
runtime->dma_bytes = size; runtime->dma_bytes = size;
......
...@@ -470,7 +470,7 @@ EXPORT_SYMBOL_GPL(soc_codec_dev_ak4642); ...@@ -470,7 +470,7 @@ EXPORT_SYMBOL_GPL(soc_codec_dev_ak4642);
static int __init ak4642_modinit(void) static int __init ak4642_modinit(void)
{ {
int ret; int ret = 0;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
ret = i2c_add_driver(&ak4642_i2c_driver); ret = i2c_add_driver(&ak4642_i2c_driver);
#endif #endif
......
...@@ -191,6 +191,7 @@ static int ac97_analog_prepare(struct snd_pcm_substream *substream, ...@@ -191,6 +191,7 @@ static int ac97_analog_prepare(struct snd_pcm_substream *substream,
vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS); vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
vra |= 0x1; /* enable variable rate audio */ vra |= 0x1; /* enable variable rate audio */
vra &= ~0x4; /* disable SPDIF output */
stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra); stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
...@@ -221,22 +222,6 @@ static int ac97_digital_prepare(struct snd_pcm_substream *substream, ...@@ -221,22 +222,6 @@ static int ac97_digital_prepare(struct snd_pcm_substream *substream,
return stac9766_ac97_write(codec, reg, runtime->rate); return stac9766_ac97_write(codec, reg, runtime->rate);
} }
static int ac97_digital_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct snd_soc_codec *codec = dai->codec;
unsigned short vra;
switch (cmd) {
case SNDRV_PCM_TRIGGER_STOP:
vra = stac9766_ac97_read(codec, AC97_EXTENDED_STATUS);
vra &= !0x04;
stac9766_ac97_write(codec, AC97_EXTENDED_STATUS, vra);
break;
}
return 0;
}
static int stac9766_set_bias_level(struct snd_soc_codec *codec, static int stac9766_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
...@@ -315,7 +300,6 @@ static struct snd_soc_dai_ops stac9766_dai_ops_analog = { ...@@ -315,7 +300,6 @@ static struct snd_soc_dai_ops stac9766_dai_ops_analog = {
static struct snd_soc_dai_ops stac9766_dai_ops_digital = { static struct snd_soc_dai_ops stac9766_dai_ops_digital = {
.prepare = ac97_digital_prepare, .prepare = ac97_digital_prepare,
.trigger = ac97_digital_trigger,
}; };
struct snd_soc_dai stac9766_dai[] = { struct snd_soc_dai stac9766_dai[] = {
......
...@@ -47,7 +47,7 @@ static const u16 wm8974_reg[WM8974_CACHEREGNUM] = { ...@@ -47,7 +47,7 @@ static const u16 wm8974_reg[WM8974_CACHEREGNUM] = {
}; };
#define WM8974_POWER1_BIASEN 0x08 #define WM8974_POWER1_BIASEN 0x08
#define WM8974_POWER1_BUFIOEN 0x10 #define WM8974_POWER1_BUFIOEN 0x04
struct wm8974_priv { struct wm8974_priv {
struct snd_soc_codec codec; struct snd_soc_codec codec;
......
...@@ -752,7 +752,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s ...@@ -752,7 +752,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t s
return 0; /* already large enough */ return 0; /* already large enough */
vfree(runtime->dma_area); vfree(runtime->dma_area);
} }
runtime->dma_area = vmalloc(size); runtime->dma_area = vmalloc_user(size);
if (!runtime->dma_area) if (!runtime->dma_area)
return -ENOMEM; return -ENOMEM;
runtime->dma_bytes = size; runtime->dma_bytes = size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment