Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
Linus Torvalds committed Dec 21, 2009
2 parents 3d354cb + 1f26cb9 commit 9d5eb67
Show file tree
Hide file tree
Showing 14 changed files with 467 additions and 188 deletions.
177 changes: 59 additions & 118 deletions sound/arm/aaci.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sound/arm/aaci.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
struct aaci_runtime {
void __iomem *base;
void __iomem *fifo;
spinlock_t lock;

struct ac97_pcm *pcm;
int pcm_open;
Expand Down Expand Up @@ -232,7 +233,6 @@ struct aaci {
struct snd_ac97 *ac97;

u32 maincr;
spinlock_t lock;

struct aaci_runtime playback;
struct aaci_runtime capture;
Expand Down
4 changes: 2 additions & 2 deletions sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ int snd_interval_ratnum(struct snd_interval *i,
int diff;
if (q == 0)
q = 1;
den = div_down(num, q);
den = div_up(num, q);
if (den < rats[k].den_min)
continue;
if (den > rats[k].den_max)
Expand Down Expand Up @@ -794,7 +794,7 @@ int snd_interval_ratnum(struct snd_interval *i,
i->empty = 1;
return -EINVAL;
}
den = div_up(num, q);
den = div_down(num, q);
if (den > rats[k].den_max)
continue;
if (den < rats[k].den_min)
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/msnd/msnd_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (err < 0)
return err;
mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
if (mpu == NULL) {
snd_device_free(card, rmidi);
return -ENOMEM;
Expand Down
6 changes: 3 additions & 3 deletions sound/isa/sb/emu8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,6 @@ size_dram(struct snd_emu8000 *emu)

while (size < EMU8000_MAX_DRAM) {

size += 512 * 1024; /* increment 512kbytes */

/* Write a unique data on the test address.
* if the address is out of range, the data is written on
* 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is
Expand All @@ -414,7 +412,9 @@ size_dram(struct snd_emu8000 *emu)
/*snd_emu8000_read_wait(emu);*/
EMU8000_SMLD_READ(emu); /* discard stale data */
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);

Expand Down
2 changes: 1 addition & 1 deletion sound/mips/sgio2audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
/* alloc virtual 'dma' area */
if (runtime->dma_area)
vfree(runtime->dma_area);
runtime->dma_area = vmalloc(size);
runtime->dma_area = vmalloc_user(size);
if (runtime->dma_area == NULL)
return -ENOMEM;
runtime->dma_bytes = size;
Expand Down
6 changes: 3 additions & 3 deletions sound/oss/pss.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static int pss_reset_dsp(pss_confdata * devc)
unsigned long i, limit = jiffies + HZ/10;

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));
outw(0x0000, REG(PSS_CONTROL));
return 1;
Expand Down Expand Up @@ -369,11 +369,11 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size
outw(0, REG(PSS_DATA));

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));

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));
if (val & 0x4000)
Expand Down
43 changes: 37 additions & 6 deletions sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "hda_codec.h"
#include "hda_local.h"
#include "hda_beep.h"

#define CXT_PIN_DIR_IN 0x00
#define CXT_PIN_DIR_OUT 0x01
Expand Down Expand Up @@ -111,6 +112,7 @@ struct conexant_spec {
unsigned int dell_automute;
unsigned int port_d_mode;
unsigned char ext_mic_bias;
unsigned int dell_vostro;
};

static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
Expand Down Expand Up @@ -476,6 +478,7 @@ static void conexant_free(struct hda_codec *codec)
snd_array_free(&spec->jacks);
}
#endif
snd_hda_detach_beep_device(codec);
kfree(codec->spec);
}

Expand Down Expand Up @@ -2109,9 +2112,12 @@ static int cxt5066_mic_boost_mux_enum_get(struct snd_kcontrol *kcontrol,
{
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
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,
AC_VERB_GET_AMP_GAIN_MUTE, AC_AMP_GET_OUTPUT);
val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_AMP_GAIN_MUTE, inout);

ucontrol->value.enumerated.item[0] = val & AC_AMP_GAIN;
return 0;
Expand All @@ -2123,16 +2129,19 @@ static int cxt5066_mic_boost_mux_enum_put(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
const struct hda_input_mux *imux = &cxt5066_analog_mic_boost;
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)
return 0;
idx = ucontrol->value.enumerated.item[0];
if (idx >= imux->num_items)
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_AMP_SET_RIGHT | AC_AMP_SET_LEFT | AC_AMP_SET_OUTPUT |
AC_AMP_SET_RIGHT | AC_AMP_SET_LEFT | inout |
imux->items[idx].index);

return 1;
Expand Down Expand Up @@ -2201,17 +2210,31 @@ static struct snd_kcontrol_new cxt5066_mixers[] = {

{
.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,
.get = cxt5066_mic_boost_mux_enum_get,
.put = cxt5066_mic_boost_mux_enum_put,
.private_value = 0x17,
},

HDA_BIND_VOL("Capture Volume", &cxt5066_bind_capture_vol_others),
HDA_BIND_SW("Capture Switch", &cxt5066_bind_capture_sw_others),
{}
};

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[] = {
{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port B */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, /* Port C */
Expand Down Expand Up @@ -2397,11 +2420,16 @@ static struct hda_verb cxt5066_init_verbs_portd_lo[] = {
/* initialize jack-sensing, too */
static int cxt5066_init(struct hda_codec *codec)
{
struct conexant_spec *spec = codec->spec;

snd_printdd("CXT5066: init\n");
conexant_init(codec);
if (codec->patch_ops.unsol_event) {
cxt5066_hp_automute(codec);
cxt5066_automic(codec);
if (spec->dell_vostro)
cxt5066_vostro_automic(codec);
else
cxt5066_automic(codec);
}
return 0;
}
Expand Down Expand Up @@ -2500,7 +2528,10 @@ static int patch_cxt5066(struct hda_codec *codec)
spec->init_verbs[0] = cxt5066_init_verbs_vostro;
spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
spec->mixers[spec->num_mixers++] = cxt5066_mixers;
spec->mixers[spec->num_mixers++] = cxt5066_vostro_mixers;
spec->port_d_mode = 0;
spec->dell_vostro = 1;
snd_hda_attach_beep_device(codec, 0x13);

/* no S/PDIF out */
spec->multiout.dig_out_nid = 0;
Expand Down
Loading

0 comments on commit 9d5eb67

Please sign in to comment.