···132 mpu_irq - IRQ # for MPU-401 UART (PnP setup)133 dma1 - first DMA # for AD1816A chip (PnP setup)134 dma2 - second DMA # for AD1816A chip (PnP setup)0135136 Module supports up to 8 cards, autoprobe and PnP.137
···132 mpu_irq - IRQ # for MPU-401 UART (PnP setup)133 dma1 - first DMA # for AD1816A chip (PnP setup)134 dma2 - second DMA # for AD1816A chip (PnP setup)135+ clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz)136137 Module supports up to 8 cards, autoprobe and PnP.138
···34223423 <para>3424 The <structfield>iface</structfield> field specifies the type of3425- the control,3426- <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>. There are3427- <constant>MIXER</constant>, <constant>PCM</constant>,3428- <constant>CARD</constant>, etc.00000003429 </para>34303431 <para>
···34223423 <para>3424 The <structfield>iface</structfield> field specifies the type of3425+ the control, <constant>SNDRV_CTL_ELEM_IFACE_XXX</constant>, which3426+ is usually <constant>MIXER</constant>.3427+ Use <constant>CARD</constant> for global controls that are not3428+ logically part of the mixer.3429+ If the control is closely associated with some specific device on3430+ the sound card, use <constant>HWDEP</constant>,3431+ <constant>PCM</constant>, <constant>RAWMIDI</constant>,3432+ <constant>TIMER</constant>, or <constant>SEQUENCER</constant>, and3433+ specify the device number with the3434+ <structfield>device</structfield> and3435+ <structfield>subdevice</structfield> fields.3436 </para>34373438 <para>
+2
include/linux/sound.h
···29 * Sound core interface functions30 */31032extern int register_sound_special(struct file_operations *fops, int unit);033extern int register_sound_mixer(struct file_operations *fops, int dev);34extern int register_sound_midi(struct file_operations *fops, int dev);35extern int register_sound_dsp(struct file_operations *fops, int dev);
···29 * Sound core interface functions30 */3132+struct device;33extern int register_sound_special(struct file_operations *fops, int unit);34+extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev);35extern int register_sound_mixer(struct file_operations *fops, int dev);36extern int register_sound_midi(struct file_operations *fops, int dev);37extern int register_sound_dsp(struct file_operations *fops, int dev);
+9
include/sound/ac97_codec.h
···26 */2728#include <linux/bitops.h>029#include "pcm.h"30#include "control.h"31#include "info.h"···375#define AC97_HAS_NO_PC_BEEP (1<<12) /* no PC Beep volume */376#define AC97_HAS_NO_VIDEO (1<<13) /* no Video volume */377#define AC97_HAS_NO_CD (1<<14) /* no CD volume */000378379/* rates indexes */380#define AC97_RATES_FRONT_DAC 0···524 /* jack-sharing info */525 unsigned char indep_surround;526 unsigned char channel_mode;0527};528529/* conditions */···604 unsigned short mask;605 const char **texts;606};0000607#endif /* __SOUND_AC97_CODEC_H */
···26 */2728#include <linux/bitops.h>29+#include <linux/device.h>30#include "pcm.h"31#include "control.h"32#include "info.h"···374#define AC97_HAS_NO_PC_BEEP (1<<12) /* no PC Beep volume */375#define AC97_HAS_NO_VIDEO (1<<13) /* no Video volume */376#define AC97_HAS_NO_CD (1<<14) /* no CD volume */377+#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */378+#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */379+#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */380381/* rates indexes */382#define AC97_RATES_FRONT_DAC 0···520 /* jack-sharing info */521 unsigned char indep_surround;522 unsigned char channel_mode;523+ struct device dev;524};525526/* conditions */···599 unsigned short mask;600 const char **texts;601};602+603+/* ad hoc AC97 device driver access */604+extern struct bus_type ac97_bus_type;605+606#endif /* __SOUND_AC97_CODEC_H */
+1
include/sound/ad1816a.h
···138 spinlock_t lock;139140 unsigned short mode;0141142 snd_card_t *card;143 snd_pcm_t *pcm;
···138 spinlock_t lock;139140 unsigned short mode;141+ unsigned int clock_freq;142143 snd_card_t *card;144 snd_pcm_t *pcm;
···1/* include/version.h. Generated by configure. */2+#define CONFIG_SND_VERSION "1.0.10rc1"3+#define CONFIG_SND_DATE " (Tue Aug 30 05:31:08 2005 UTC)"
+6
include/sound/ymfpci.h
···295 unsigned int running: 1;296 unsigned int output_front: 1;297 unsigned int output_rear: 1;0298 u32 period_size; /* cached from runtime->period_size */299 u32 buffer_size; /* cached from runtime->buffer_size */300 u32 period_pos;···368 int mode_dup4ch;369 int rear_opened;370 int spdif_opened;00000371372 spinlock_t reg_lock;373 spinlock_t voice_lock;
···295 unsigned int running: 1;296 unsigned int output_front: 1;297 unsigned int output_rear: 1;298+ unsigned int update_pcm_vol;299 u32 period_size; /* cached from runtime->period_size */300 u32 buffer_size; /* cached from runtime->buffer_size */301 u32 period_pos;···367 int mode_dup4ch;368 int rear_opened;369 int spdif_opened;370+ struct {371+ u16 left;372+ u16 right;373+ snd_kcontrol_t *ctl;374+ } pcm_mixer[32];375376 spinlock_t reg_lock;377 spinlock_t voice_lock;
+6-6
sound/arm/pxa2xx-ac97.c
···132 udelay(10);133 GCR |= GCR_WARM_RST;134 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);135- udelay(50);136#else137- GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;;138 wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);139#endif 140···261 return 0;262}263264-static int pxa2xx_ac97_do_resume(snd_card_t *card, unsigned int state)265{266 if (card->power_state != SNDRV_CTL_POWER_D0) {267 pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;···275 return 0;276}277278-static int pxa2xx_ac97_suspend(struct device *_dev, u32 state, u32 level)279{280 snd_card_t *card = dev_get_drvdata(_dev);281 int ret = 0;282283 if (card && level == SUSPEND_DISABLE)284- ret = pxa2xx_ac97_do_suspend(card, SNDRV_CTL_POWER_D3cold);285286 return ret;287}···292 int ret = 0;293294 if (card && level == RESUME_ENABLE)295- ret = pxa2xx_ac97_do_resume(card, SNDRV_CTL_POWER_D0);296297 return ret;298}
···132 udelay(10);133 GCR |= GCR_WARM_RST;134 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);135+ udelay(500);136#else137+ GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;138 wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);139#endif 140···261 return 0;262}263264+static int pxa2xx_ac97_do_resume(snd_card_t *card)265{266 if (card->power_state != SNDRV_CTL_POWER_D0) {267 pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;···275 return 0;276}277278+static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state, u32 level)279{280 snd_card_t *card = dev_get_drvdata(_dev);281 int ret = 0;282283 if (card && level == SUSPEND_DISABLE)284+ ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND);285286 return ret;287}···292 int ret = 0;293294 if (card && level == RESUME_ENABLE)295+ ret = pxa2xx_ac97_do_resume(card);296297 return ret;298}
+2-3
sound/core/memalloc.c
···512 * proc file interface513 */514#define SND_MEM_PROC_FILE "driver/snd-page-alloc"515-struct proc_dir_entry *snd_mem_proc;516517static int snd_mem_proc_read(char *page, char **start, off_t off,518 int count, int *eof, void *data)···655656static void __exit snd_mem_exit(void)657{658- if (snd_mem_proc)659- remove_proc_entry(SND_MEM_PROC_FILE, NULL);660 free_all_reserved_pages();661 if (snd_allocated_pages > 0)662 printk(KERN_ERR "snd-malloc: Memory leak? pages not freed = %li\n", snd_allocated_pages);
···512 * proc file interface513 */514#define SND_MEM_PROC_FILE "driver/snd-page-alloc"515+static struct proc_dir_entry *snd_mem_proc;516517static int snd_mem_proc_read(char *page, char **start, off_t off,518 int count, int *eof, void *data)···655656static void __exit snd_mem_exit(void)657{658+ remove_proc_entry(SND_MEM_PROC_FILE, NULL);0659 free_all_reserved_pages();660 if (snd_allocated_pages > 0)661 printk(KERN_ERR "snd-malloc: Memory leak? pages not freed = %li\n", snd_allocated_pages);
···1+/*2+ * Linux driver model AC97 bus interface3+ *4+ * Author: Nicolas Pitre5+ * Created: Jan 14, 20056+ * Copyright: (C) MontaVista Software Inc.7+ *8+ * This program is free software; you can redistribute it and/or modify9+ * it under the terms of the GNU General Public License as published by10+ * the Free Software Foundation; either version 2 of the License, or11+ * (at your option) any later version.12+ */13+14+#include <linux/module.h>15+#include <linux/init.h>16+#include <linux/device.h>17+#include <linux/string.h>18+19+/*20+ * Codec families have names seperated by commas, so we search for an21+ * individual codec name within the family string. 22+ */23+static int ac97_bus_match(struct device *dev, struct device_driver *drv)24+{25+ return (strstr(dev->bus_id, drv->name) != NULL);26+}27+28+static int ac97_bus_suspend(struct device *dev, pm_message_t state)29+{30+ int ret = 0;31+32+ if (dev->driver && dev->driver->suspend) {33+ ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE);34+ if (ret == 0)35+ ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE);36+ if (ret == 0)37+ ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);38+ }39+ return ret;40+}41+42+static int ac97_bus_resume(struct device *dev)43+{44+ int ret = 0;45+46+ if (dev->driver && dev->driver->resume) {47+ ret = dev->driver->resume(dev, RESUME_POWER_ON);48+ if (ret == 0)49+ ret = dev->driver->resume(dev, RESUME_RESTORE_STATE);50+ if (ret == 0)51+ ret = dev->driver->resume(dev, RESUME_ENABLE);52+ }53+ return ret;54+}55+56+struct bus_type ac97_bus_type = {57+ .name = "ac97",58+ .match = ac97_bus_match,59+ .suspend = ac97_bus_suspend,60+ .resume = ac97_bus_resume,61+};62+63+static int __init ac97_bus_init(void)64+{65+ return bus_register(&ac97_bus_type);66+}67+68+subsys_initcall(ac97_bus_init);69+70+static void __exit ac97_bus_exit(void)71+{72+ bus_unregister(&ac97_bus_type);73+}74+75+module_exit(ac97_bus_exit);76+77+EXPORT_SYMBOL(ac97_bus_type);78+79+MODULE_LICENSE("GPL");