~ubuntu-branches/ubuntu/precise/alsa-driver/precise

« back to all changes in this revision

Viewing changes to alsa-kernel/soc/s3c24xx/s3c2443-ac97.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-11-04 16:28:58 UTC
  • mfrom: (1.1.12 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091104162858-7ky0tu33d7mn6oys
Tags: 1.0.21+dfsg-3ubuntu1
* Merge from debian unstable, remaining changes:
  - Script paths (/usr/sbin -> /sbin, /usr/bin -> /bin);
  - debian/rules:
    + Don't install snddevices and program-wrapper
    + install alsa-base apport hook
    + Package separate USB card list file
  - Vcs and maintainer fields mangling
  - Rename blacklist files in /etc/modprobe.d to be consistant with the rest
    of the distro
  - debian/alsa-base.init:
    + create /var/run/alsa if it doesn't exist
    + Run alsactl store before force unloading modules
    + Run alsactl restore after reloading unloaded modules
  - debian/linux-sound-base.postrm: Remove /etc/modprobe.d/blacklist* files
    on package removal
  - Add missing $CMDLINE_OPTS to all install rules.
  - Replace -Q with --quiet.
  - Add --use-blacklist to all rules so the blacklist still takes effect.
  - debian/alsa-base.postinst: Do not run snddevices
  - retain patches:
    + add_suspend_quirk_hp_nc6220_nw8240.patch,
    + refix_lp_68659_by_disabling_dxs_for_0x1458a002.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <linux/io.h>
20
20
#include <linux/wait.h>
21
21
#include <linux/delay.h>
 
22
#include <linux/gpio.h>
22
23
#include <linux/clk.h>
23
24
 
24
25
#include <sound/core.h>
46
47
 
47
48
static DECLARE_COMPLETION(ac97_completion);
48
49
static u32 codec_ready;
49
 
static DECLARE_MUTEX(ac97_mutex);
 
50
static DEFINE_MUTEX(ac97_mutex);
50
51
 
51
52
static unsigned short s3c2443_ac97_read(struct snd_ac97 *ac97,
52
53
        unsigned short reg)
55
56
        u32 ac_codec_cmd;
56
57
        u32 stat, addr, data;
57
58
 
58
 
        down(&ac97_mutex);
 
59
        mutex_lock(&ac97_mutex);
59
60
 
60
61
        codec_ready = S3C_AC97_GLBSTAT_CODECREADY;
61
62
        ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD);
78
79
                printk(KERN_ERR "s3c24xx-ac97: req addr = %02x,"
79
80
                                " rep addr = %02x\n", reg, addr);
80
81
 
81
 
        up(&ac97_mutex);
 
82
        mutex_unlock(&ac97_mutex);
82
83
 
83
84
        return (unsigned short)data;
84
85
}
89
90
        u32 ac_glbctrl;
90
91
        u32 ac_codec_cmd;
91
92
 
92
 
        down(&ac97_mutex);
 
93
        mutex_lock(&ac97_mutex);
93
94
 
94
95
        codec_ready = S3C_AC97_GLBSTAT_CODECREADY;
95
96
        ac_codec_cmd = readl(s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD);
108
109
        ac_codec_cmd |= S3C_AC97_CODEC_CMD_READ;
109
110
        writel(ac_codec_cmd, s3c24xx_ac97.regs + S3C_AC97_CODEC_CMD);
110
111
 
111
 
        up(&ac97_mutex);
 
112
        mutex_unlock(&ac97_mutex);
112
113
 
113
114
}
114
115
 
289
290
                                struct snd_soc_dai *dai)
290
291
{
291
292
        u32 ac_glbctrl;
 
293
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
 
294
        int channel = ((struct s3c24xx_pcm_dma_params *)
 
295
                  rtd->dai->cpu_dai->dma_data)->channel;
292
296
 
293
297
        ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
294
298
        switch (cmd) {
311
315
        }
312
316
        writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
313
317
 
 
318
        s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STARTED);
 
319
 
314
320
        return 0;
315
321
}
316
322
 
333
339
                                    int cmd, struct snd_soc_dai *dai)
334
340
{
335
341
        u32 ac_glbctrl;
 
342
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
 
343
        int channel = ((struct s3c24xx_pcm_dma_params *)
 
344
                  rtd->dai->cpu_dai->dma_data)->channel;
336
345
 
337
346
        ac_glbctrl = readl(s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
338
347
        switch (cmd) {
348
357
        }
349
358
        writel(ac_glbctrl, s3c24xx_ac97.regs + S3C_AC97_GLBCTRL);
350
359
 
 
360
        s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STARTED);
 
361
 
351
362
        return 0;
352
363
}
353
364