aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss
diff options
context:
space:
mode:
authorIan Wienand <ianw@gelato.unsw.edu.au>2005-11-02 22:49:10 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-11-02 22:49:10 -0500
commit7afada45da2727fd96402b1244168e0420ca496a (patch)
treea136010b8e4b9e816d29bfb084237eeb329067ee /sound/oss
parentcfa024f4e45562c50b9eccb23649ab103578037b (diff)
Input: convert dmasound_awacs (OSS) to dynamic input allocation
Signed-off-by: Ian Wienand <ianw@gelato.unsw.edu.au> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'sound/oss')
-rw-r--r--sound/oss/dmasound/dmasound_awacs.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index b2bf8bac842d..cebd881b91ae 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -2805,16 +2805,7 @@ __init setup_beep(void)
2805 return 0 ; 2805 return 0 ;
2806} 2806}
2807 2807
2808static struct input_dev awacs_beep_dev = { 2808static struct input_dev *awacs_beep_dev;
2809 .evbit = { BIT(EV_SND) },
2810 .sndbit = { BIT(SND_BELL) | BIT(SND_TONE) },
2811 .event = awacs_beep_event,
2812 .name = "dmasound beeper",
2813 .phys = "macio/input0", /* what the heck is this?? */
2814 .id = {
2815 .bustype = BUS_HOST,
2816 },
2817};
2818 2809
2819int __init dmasound_awacs_init(void) 2810int __init dmasound_awacs_init(void)
2820{ 2811{
@@ -2907,6 +2898,22 @@ printk("dmasound_pmac: couldn't find a Codec we can handle\n");
2907 return -ENODEV; 2898 return -ENODEV;
2908 } 2899 }
2909 2900
2901 awacs_beep_dev = input_allocate_device();
2902 if (!awacs_beep_dev) {
2903 release_OF_resource(io, 0);
2904 release_OF_resource(io, 1);
2905 release_OF_resource(io, 2);
2906 printk(KERN_ERR "dmasound: can't allocate input device !\n");
2907 return -ENOMEM;
2908 }
2909
2910 awacs_beep_dev->name = "dmasound beeper";
2911 awacs_beep_dev->phys = "macio/input0";
2912 awacs_beep_dev->id.bustype = BUS_HOST;
2913 awacs_beep_dev->event = awacs_beep_event;
2914 awacs_beep_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
2915 awacs_beep_dev->evbit[0] = BIT(EV_SND);
2916
2910 /* all OF versions I've seen use this value */ 2917 /* all OF versions I've seen use this value */
2911 if (i2s_node) 2918 if (i2s_node)
2912 i2s = ioremap(io->addrs[0].address, 0x1000); 2919 i2s = ioremap(io->addrs[0].address, 0x1000);
@@ -3140,14 +3147,14 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
3140 * XXX: we should handle errors here, but that would mean 3147 * XXX: we should handle errors here, but that would mean
3141 * rewriting the whole init code. later.. 3148 * rewriting the whole init code. later..
3142 */ 3149 */
3143 input_register_device(&awacs_beep_dev); 3150 input_register_device(awacs_beep_dev);
3144 3151
3145 return dmasound_init(); 3152 return dmasound_init();
3146} 3153}
3147 3154
3148static void __exit dmasound_awacs_cleanup(void) 3155static void __exit dmasound_awacs_cleanup(void)
3149{ 3156{
3150 input_unregister_device(&awacs_beep_dev); 3157 input_unregister_device(awacs_beep_dev);
3151 3158
3152 switch (awacs_revision) { 3159 switch (awacs_revision) {
3153 case AWACS_TUMBLER: 3160 case AWACS_TUMBLER: