sync hh.org
[hh.org.git] / arch / arm / mach-pxa / h5400 / h5400_audio.c
blobd3fb2ba6d1fcae2fafa11cf876a9dd4f21b3dd01
1 /*
2 * Hardware audio controls for HP iPAQ h5400
4 * Copyright © 2005 Erik Hovland <erik@hovland.org>
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
8 * more details.
12 #include <linux/module.h>
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/pm.h>
16 #include <sound/ak4535.h>
17 #include <linux/device.h>
18 #include <asm/hardware.h>
19 #include <asm/io.h>
20 #include <asm/arch/ipaq.h>
21 #include <asm/arch/h5400-asic.h>
22 #include <linux/platform_device.h>
24 #include <asm/hardware/samcop_base.h>
26 /* It's up to the <machine>_audio drive to initialize
27 * the ak4535_device_controls variable, as it's needed
28 * to initialize the ak4535 module.
31 ak4535_device_controls_t ak4535_device_controls;
33 static void h5400_codec_set_power (int mode)
35 samcop_set_gpio_b (&h5400_samcop.dev,
36 SAMCOP_GPIO_GPB_CODEC_POWER_ON,
37 mode);
40 static void h5400_audio_set_power (int mode)
42 samcop_set_gpio_b (&h5400_samcop.dev,
43 SAMCOP_GPIO_GPB_AUDIO_POWER_ON,
44 mode);
47 static void h5400_audio_set_mute (int mode)
51 static int __init h5400_audio_init(void)
53 ak4535_device_controls.set_codec_power = h5400_codec_set_power;
54 ak4535_device_controls.set_audio_power = h5400_audio_set_power;
55 ak4535_device_controls.set_audio_mute = h5400_audio_set_mute;
56 return (0);
59 static void __exit h5400_audio_exit(void)
61 ak4535_device_controls.set_codec_power = NULL;
62 ak4535_device_controls.set_audio_power = NULL;
63 ak4535_device_controls.set_audio_mute = NULL;
67 module_init(h5400_audio_init);
68 module_exit(h5400_audio_exit);
70 EXPORT_SYMBOL(ak4535_device_controls);
71 MODULE_AUTHOR("Erik Hovland <erik@hovland.org>");
72 MODULE_DESCRIPTION("Hardware audio controls for HP iPAQ h5xxx");
73 MODULE_LICENSE("GPL");