Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189598
b: refs/heads/master
c: 5dbd5ec
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Mar 29, 2010
1 parent 5824929 commit 737c976
Show file tree
Hide file tree
Showing 42 changed files with 203 additions and 322 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7445c995b06f2a999541ccf127886d24a2a7d012
refs/heads/master: 5dbd5ec6e1cf2e49128025d80813a275744a7ac5
2 changes: 1 addition & 1 deletion trunk/include/sound/ak4113.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ struct ak4113 {

int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
ak4113_write_t *write,
const unsigned char *pgm,
const unsigned char pgm[AK4113_WRITABLE_REGS],
void *private_data, struct ak4113 **r_ak4113);
void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg,
unsigned char mask, unsigned char val);
Expand Down
18 changes: 1 addition & 17 deletions trunk/include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ struct snd_soc_dai {
struct snd_soc_codec *codec;
unsigned int active;
unsigned char pop_wait:1;
void *dma_data;

/* DAI private data */
void *private_data;
Expand All @@ -229,21 +230,4 @@ struct snd_soc_dai {
struct list_head list;
};

static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
const struct snd_pcm_substream *ss)
{
return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
dai->playback.dma_data : dai->capture.dma_data;
}

static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
const struct snd_pcm_substream *ss,
void *data)
{
if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
dai->playback.dma_data = data;
else
dai->capture.dma_data = data;
}

#endif
1 change: 0 additions & 1 deletion trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ struct snd_soc_pcm_stream {
unsigned int channels_min; /* min channels */
unsigned int channels_max; /* max channels */
unsigned int active:1; /* stream is in use */
void *dma_data; /* used by platform code */
};

/* SoC audio ops */
Expand Down
1 change: 0 additions & 1 deletion trunk/sound/arm/pxa2xx-pcm-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
if (!rtd->dma_desc_array)
goto err1;

rtd->dma_ch = -1;
runtime->private_data = rtd;
return 0;

Expand Down
6 changes: 2 additions & 4 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ static void pcm_debug_name(struct snd_pcm_substream *substream,

#define xrun_debug(substream, mask) \
((substream)->pstr->xrun_debug & (mask))
#else
#define xrun_debug(substream, mask) 0
#endif

#define dump_stack_on_xrun(substream) do { \
if (xrun_debug(substream, XRUN_DEBUG_STACK)) \
Expand All @@ -172,7 +169,6 @@ static void xrun(struct snd_pcm_substream *substream)
}
}

#ifdef CONFIG_SND_PCM_XRUN_DEBUG
#define hw_ptr_error(substream, fmt, args...) \
do { \
if (xrun_debug(substream, XRUN_DEBUG_BASIC)) { \
Expand Down Expand Up @@ -259,6 +255,8 @@ static void xrun_log_show(struct snd_pcm_substream *substream)

#else /* ! CONFIG_SND_PCM_XRUN_DEBUG */

#define xrun_debug(substream, mask) 0
#define xrun(substream) do { } while (0)
#define hw_ptr_error(substream, fmt, args...) do { } while (0)
#define xrun_log(substream, pos) do { } while (0)
#define xrun_log_show(substream) do { } while (0)
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/i2c/other/ak4113.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static int snd_ak4113_dev_free(struct snd_device *device)
}

int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
ak4113_write_t *write, const unsigned char *pgm,
ak4113_write_t *write, const unsigned char pgm[5],
void *private_data, struct ak4113 **r_ak4113)
{
struct ak4113 *chip;
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/oss/vidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ static void vidc_audio_trigger(int dev, int enable_bits)
struct audio_operations *adev = audio_devs[dev];

if (enable_bits & PCM_ENABLE_OUTPUT) {
if (!(adev->dmap_out->flags & DMA_ACTIVE)) {
if (!(adev->flags & DMA_ACTIVE)) {
unsigned long flags;

local_irq_save(flags);

/* prevent recusion */
adev->dmap_out->flags |= DMA_ACTIVE;
adev->flags |= DMA_ACTIVE;

dma_interrupt = vidc_audio_dma_interrupt;
vidc_sound_dma_irq(0, NULL);
Expand Down
2 changes: 0 additions & 2 deletions trunk/sound/pci/ac97/ac97_patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1852,14 +1852,12 @@ static unsigned int ad1981_jacks_blacklist[] = {
0x10140523, /* Thinkpad R40 */
0x10140534, /* Thinkpad X31 */
0x10140537, /* Thinkpad T41p */
0x1014053e, /* Thinkpad R40e */
0x10140554, /* Thinkpad T42p/R50p */
0x10140567, /* Thinkpad T43p 2668-G7U */
0x10140581, /* Thinkpad X41-2527 */
0x10280160, /* Dell Dimension 2400 */
0x104380b0, /* Asus A7V8X-MX */
0x11790241, /* Toshiba Satellite A-15 S127 */
0x1179ff10, /* Toshiba P500 */
0x144dc01a, /* Samsung NP-X20C004/SEG */
0 /* end */
};
Expand Down
14 changes: 3 additions & 11 deletions trunk/sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,21 +941,13 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
struct snd_pcm_substream *substream)
{
size_t ptr;
unsigned int reg, rem, tries;

unsigned int reg;
if (!rec->running)
return 0;
#if 1 // this seems better..
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
for (tries = 0; tries < 3; tries++) {
rem = snd_cmipci_read_w(cm, reg);
if (rem < rec->dma_size)
goto ok;
}
printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem);
return SNDRV_PCM_POS_XRUN;
ok:
ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1);
ptr >>= rec->shift;
#else
reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1;
ptr = snd_cmipci_read(cm, reg) - rec->offset;
Expand Down
5 changes: 3 additions & 2 deletions trunk/sound/pci/echoaudio/echoaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2184,9 +2184,10 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
goto ctl_error;
#endif

err = snd_card_register(card);
if (err < 0)
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
goto ctl_error;
}
snd_printk(KERN_INFO "Card registered: %s\n", card->longname);

pci_set_drvdata(pci, chip);
Expand Down
52 changes: 26 additions & 26 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -12459,11 +12459,11 @@ static void alc268_aspire_one_speaker_automute(struct hda_codec *codec)
unsigned char bits;

present = snd_hda_jack_detect(codec, 0x15);
bits = present ? AMP_IN_MUTE(0) : 0;
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
}

static void alc268_acer_lc_unsol_event(struct hda_codec *codec,
Expand Down Expand Up @@ -13482,11 +13482,11 @@ static void alc269_quanta_fl1_speaker_automute(struct hda_codec *codec)
unsigned char bits;

present = snd_hda_jack_detect(codec, 0x15);
bits = present ? AMP_IN_MUTE(0) : 0;
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);

snd_hda_codec_write(codec, 0x20, 0,
AC_VERB_SET_COEF_INDEX, 0x0c);
Expand All @@ -13511,11 +13511,11 @@ static void alc269_lifebook_speaker_automute(struct hda_codec *codec)
/* Check port replicator headphone socket */
present |= snd_hda_jack_detect(codec, 0x1a);

bits = present ? AMP_IN_MUTE(0) : 0;
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);

snd_hda_codec_write(codec, 0x20, 0,
AC_VERB_SET_COEF_INDEX, 0x0c);
Expand Down Expand Up @@ -13646,11 +13646,11 @@ static void alc269_speaker_automute(struct hda_codec *codec)
unsigned char bits;

present = snd_hda_jack_detect(codec, nid);
bits = present ? AMP_IN_MUTE(0) : 0;
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
}

/* unsolicited event for HP jack sensing */
Expand Down Expand Up @@ -17115,9 +17115,9 @@ static void alc663_m51va_speaker_automute(struct hda_codec *codec)
present = snd_hda_jack_detect(codec, 0x21);
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
}

static void alc663_21jd_two_speaker_automute(struct hda_codec *codec)
Expand All @@ -17128,13 +17128,13 @@ static void alc663_21jd_two_speaker_automute(struct hda_codec *codec)
present = snd_hda_jack_detect(codec, 0x21);
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
}

static void alc663_15jd_two_speaker_automute(struct hda_codec *codec)
Expand All @@ -17145,13 +17145,13 @@ static void alc663_15jd_two_speaker_automute(struct hda_codec *codec)
present = snd_hda_jack_detect(codec, 0x15);
bits = present ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
AMP_IN_MUTE(0), bits);
HDA_AMP_MUTE, bits);
}

static void alc662_f5z_speaker_automute(struct hda_codec *codec)
Expand Down Expand Up @@ -17190,14 +17190,14 @@ static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec)

if (present1 || present2) {
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), AMP_IN_MUTE(0));
HDA_AMP_MUTE, HDA_AMP_MUTE);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), AMP_IN_MUTE(0));
HDA_AMP_MUTE, HDA_AMP_MUTE);
} else {
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
AMP_IN_MUTE(0), 0);
HDA_AMP_MUTE, 0);
snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
AMP_IN_MUTE(0), 0);
HDA_AMP_MUTE, 0);
}
}

Expand Down
24 changes: 10 additions & 14 deletions trunk/sound/pci/mixart/mixart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,15 +1161,13 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private
unsigned long count, unsigned long pos)
{
struct mixart_mgr *mgr = entry->private_data;
unsigned long maxsize;

if (pos >= MIXART_BA0_SIZE)
return 0;
maxsize = MIXART_BA0_SIZE - pos;
if (count > maxsize)
count = maxsize;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count))
if(count <= 0)
return 0;
if(pos + count > MIXART_BA0_SIZE)
count = (long)(MIXART_BA0_SIZE - pos);
if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
return -EFAULT;
return count;
}
Expand All @@ -1182,15 +1180,13 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private
unsigned long count, unsigned long pos)
{
struct mixart_mgr *mgr = entry->private_data;
unsigned long maxsize;

if (pos > MIXART_BA1_SIZE)
return 0;
maxsize = MIXART_BA1_SIZE - pos;
if (count > maxsize)
count = maxsize;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count))
if(count <= 0)
return 0;
if(pos + count > MIXART_BA1_SIZE)
count = (long)(MIXART_BA1_SIZE - pos);
if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
return -EFAULT;
return count;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/atmel/atmel-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int atmel_pcm_hw_params(struct snd_pcm_substream *substream,
snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
runtime->dma_bytes = params_buffer_bytes(params);

prtd->params = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
prtd->params = rtd->dai->cpu_dai->dma_data;
prtd->params->dma_intr_handler = atmel_pcm_dma_irq;

prtd->dma_buffer = runtime->dma_addr;
Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,12 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
ssc_p->dma_params[dir] = dma_params;

/*
* The snd_soc_pcm_stream->dma_data field is only used to communicate
* the appropriate DMA parameters to the pcm driver hw_params()
* The cpu_dai->dma_data field is only used to communicate the
* appropriate DMA parameters to the pcm driver hw_params()
* function. It should not be used for other purposes
* as it is common to all substreams.
*/
snd_soc_dai_set_dma_data(rtd->dai->cpu_dai, substream, dma_params);
rtd->dai->cpu_dai->dma_data = dma_params;

channels = params_channels(params);

Expand Down
15 changes: 6 additions & 9 deletions trunk/sound/soc/codecs/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
static int ac97_soc_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_card *card = socdev->card;
struct snd_soc_codec *codec;
struct snd_ac97_bus *ac97_bus;
struct snd_ac97_template ac97_template;
int i;
int ret = 0;

printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
Expand All @@ -104,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);

ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) {
printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
goto err;
}

/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0)
Expand All @@ -119,13 +123,6 @@ static int ac97_soc_probe(struct platform_device *pdev)
if (ret < 0)
goto bus_err;

for (i = 0; i < card->num_links; i++) {
if (card->dai_link[i].codec_dai->ac97_control) {
snd_ac97_dev_add_pdata(codec->ac97,
card->dai_link[i].cpu_dai->ac97_pdata);
}
}

return 0;

bus_err:
Expand Down
Loading

0 comments on commit 737c976

Please sign in to comment.