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

« back to all changes in this revision

Viewing changes to alsa-kernel/soc/txx9/txx9aclc-generic.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:
 
1
/*
 
2
 * Generic TXx9 ACLC machine driver
 
3
 *
 
4
 * Copyright (C) 2009 Atsushi Nemoto
 
5
 *
 
6
 * Based on RBTX49xx patch from CELF patch archive.
 
7
 * (C) Copyright TOSHIBA CORPORATION 2004-2006
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License version 2 as
 
11
 * published by the Free Software Foundation.
 
12
 *
 
13
 * This is a very generic AC97 sound machine driver for boards which
 
14
 * have (AC97) audio at ACLC (e.g. RBTX49XX boards).
 
15
 */
 
16
 
 
17
#include <linux/module.h>
 
18
#include <linux/platform_device.h>
 
19
#include <sound/core.h>
 
20
#include <sound/pcm.h>
 
21
#include <sound/soc.h>
 
22
#include "../codecs/ac97.h"
 
23
#include "txx9aclc.h"
 
24
 
 
25
static struct snd_soc_dai_link txx9aclc_generic_dai = {
 
26
        .name = "AC97",
 
27
        .stream_name = "AC97 HiFi",
 
28
        .cpu_dai = &txx9aclc_ac97_dai,
 
29
        .codec_dai = &ac97_dai,
 
30
};
 
31
 
 
32
static struct snd_soc_card txx9aclc_generic_card = {
 
33
        .name           = "Generic TXx9 ACLC Audio",
 
34
        .platform       = &txx9aclc_soc_platform,
 
35
        .dai_link       = &txx9aclc_generic_dai,
 
36
        .num_links      = 1,
 
37
};
 
38
 
 
39
static struct txx9aclc_soc_device txx9aclc_generic_soc_device = {
 
40
        .soc_dev = {
 
41
                .card           = &txx9aclc_generic_card,
 
42
                .codec_dev      = &soc_codec_dev_ac97,
 
43
        },
 
44
};
 
45
 
 
46
static int __init txx9aclc_generic_probe(struct platform_device *pdev)
 
47
{
 
48
        struct txx9aclc_soc_device *dev = &txx9aclc_generic_soc_device;
 
49
        struct platform_device *soc_pdev;
 
50
        int ret;
 
51
 
 
52
        soc_pdev = platform_device_alloc("soc-audio", -1);
 
53
        if (!soc_pdev)
 
54
                return -ENOMEM;
 
55
        platform_set_drvdata(soc_pdev, &dev->soc_dev);
 
56
        dev->soc_dev.dev = &soc_pdev->dev;
 
57
        ret = platform_device_add(soc_pdev);
 
58
        if (ret) {
 
59
                platform_device_put(soc_pdev);
 
60
                return ret;
 
61
        }
 
62
        platform_set_drvdata(pdev, soc_pdev);
 
63
        return 0;
 
64
}
 
65
 
 
66
static int __exit txx9aclc_generic_remove(struct platform_device *pdev)
 
67
{
 
68
        struct platform_device *soc_pdev = platform_get_drvdata(pdev);
 
69
 
 
70
        platform_device_unregister(soc_pdev);
 
71
        return 0;
 
72
}
 
73
 
 
74
static struct platform_driver txx9aclc_generic_driver = {
 
75
        .remove = txx9aclc_generic_remove,
 
76
        .driver = {
 
77
                .name = "txx9aclc-generic",
 
78
                .owner = THIS_MODULE,
 
79
        },
 
80
};
 
81
 
 
82
static int __init txx9aclc_generic_init(void)
 
83
{
 
84
        return platform_driver_probe(&txx9aclc_generic_driver,
 
85
                                     txx9aclc_generic_probe);
 
86
}
 
87
 
 
88
static void __exit txx9aclc_generic_exit(void)
 
89
{
 
90
        platform_driver_unregister(&txx9aclc_generic_driver);
 
91
}
 
92
 
 
93
module_init(txx9aclc_generic_init);
 
94
module_exit(txx9aclc_generic_exit);
 
95
 
 
96
MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
 
97
MODULE_DESCRIPTION("Generic TXx9 ACLC ALSA SoC audio driver");
 
98
MODULE_LICENSE("GPL");