*/
static dev_info_t dev_info = "snd-pdaudiocf";
-static snd_card_t *card_list[SNDRV_CARDS];
+static struct snd_card *card_list[SNDRV_CARDS];
static dev_link_t *dev_list;
/*
/*
* destructor
*/
-static int snd_pdacf_free(pdacf_t *pdacf)
+static int snd_pdacf_free(struct snd_pdacf *pdacf)
{
dev_link_t *link = &pdacf->link;
return 0;
}
-static int snd_pdacf_dev_free(snd_device_t *device)
+static int snd_pdacf_dev_free(struct snd_device *device)
{
- pdacf_t *chip = device->device_data;
+ struct snd_pdacf *chip = device->device_data;
return snd_pdacf_free(chip);
}
client_reg_t client_reg; /* Register with cardmgr */
dev_link_t *link; /* Info for cardmgr */
int i, ret;
- pdacf_t *pdacf;
- snd_card_t *card;
- static snd_device_ops_t ops = {
+ struct snd_pdacf *pdacf;
+ struct snd_card *card;
+ static struct snd_device_ops ops = {
.dev_free = snd_pdacf_dev_free,
};
*
* returns 0 if successful, or a negative error code.
*/
-static int snd_pdacf_assign_resources(pdacf_t *pdacf, int port, int irq)
+static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq)
{
int err;
- snd_card_t *card = pdacf->card;
+ struct snd_card *card = pdacf->card;
snd_printdd(KERN_DEBUG "pdacf assign resources: port = 0x%x, irq = %d\n", port, irq);
pdacf->port = port;
*/
static void snd_pdacf_detach(dev_link_t *link)
{
- pdacf_t *chip = link->priv;
+ struct snd_pdacf *chip = link->priv;
snd_printdd(KERN_DEBUG "pdacf_detach called\n");
/* Remove the interface data from the linked list */
static void pdacf_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
- pdacf_t *pdacf = link->priv;
+ struct snd_pdacf *pdacf = link->priv;
tuple_t tuple;
cisparse_t *parse = NULL;
config_info_t conf;
static int pdacf_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
- pdacf_t *chip = link->priv;
+ struct snd_pdacf *chip = link->priv;
switch (event) {
case CS_EVENT_CARD_REMOVAL:
#define PDAUDIOCF_STAT_IS_CONFIGURED (1<<1)
#define PDAUDIOCF_STAT_IS_SUSPENDED (1<<2)
-typedef struct {
- snd_card_t *card;
+struct snd_pdacf {
+ struct snd_card *card;
int index;
unsigned long port;
struct tasklet_struct tq;
spinlock_t ak4117_lock;
- ak4117_t *ak4117;
+ struct ak4117 *ak4117;
unsigned int chip_status;
- snd_pcm_t *pcm;
- snd_pcm_substream_t *pcm_substream;
+ struct snd_pcm *pcm;
+ struct snd_pcm_substream *pcm_substream;
unsigned int pcm_running: 1;
unsigned int pcm_channels;
unsigned int pcm_swab;
/* pcmcia stuff */
dev_link_t link;
dev_node_t node;
-} pdacf_t;
+};
-static inline void pdacf_reg_write(pdacf_t *chip, unsigned char reg, unsigned short val)
+static inline void pdacf_reg_write(struct snd_pdacf *chip, unsigned char reg, unsigned short val)
{
outw(chip->regmap[reg>>1] = val, chip->port + reg);
}
-static inline unsigned short pdacf_reg_read(pdacf_t *chip, unsigned char reg)
+static inline unsigned short pdacf_reg_read(struct snd_pdacf *chip, unsigned char reg)
{
return inw(chip->port + reg);
}
-pdacf_t *snd_pdacf_create(snd_card_t *card);
-int snd_pdacf_ak4117_create(pdacf_t *pdacf);
-void snd_pdacf_powerdown(pdacf_t *chip);
+struct snd_pdacf *snd_pdacf_create(struct snd_card *card);
+int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf);
+void snd_pdacf_powerdown(struct snd_pdacf *chip);
#ifdef CONFIG_PM
-int snd_pdacf_suspend(snd_card_t *card, pm_message_t state);
-int snd_pdacf_resume(snd_card_t *card);
+int snd_pdacf_suspend(struct snd_card *card, pm_message_t state);
+int snd_pdacf_resume(struct snd_card *card);
#endif
-int snd_pdacf_pcm_new(pdacf_t *chip);
+int snd_pdacf_pcm_new(struct snd_pdacf *chip);
irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs);
void pdacf_tasklet(unsigned long private_data);
-void pdacf_reinit(pdacf_t *chip, int resume);
+void pdacf_reinit(struct snd_pdacf *chip, int resume);
#endif /* __PDAUDIOCF_H */
*/
static unsigned char pdacf_ak4117_read(void *private_data, unsigned char reg)
{
- pdacf_t *chip = private_data;
+ struct snd_pdacf *chip = private_data;
unsigned long timeout;
unsigned long flags;
unsigned char res;
static void pdacf_ak4117_write(void *private_data, unsigned char reg, unsigned char val)
{
- pdacf_t *chip = private_data;
+ struct snd_pdacf *chip = private_data;
unsigned long timeout;
unsigned long flags;
}
#if 0
-void pdacf_dump(pdacf_t *chip)
+void pdacf_dump(struct snd_pdacf *chip)
{
printk("PDAUDIOCF DUMP (0x%lx):\n", chip->port);
printk("WPD : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_WDP));
}
#endif
-static int pdacf_reset(pdacf_t *chip, int powerdown)
+static int pdacf_reset(struct snd_pdacf *chip, int powerdown)
{
u16 val;
return 0;
}
-void pdacf_reinit(pdacf_t *chip, int resume)
+void pdacf_reinit(struct snd_pdacf *chip, int resume)
{
pdacf_reset(chip, 0);
if (resume)
pdacf_reg_write(chip, PDAUDIOCF_REG_IER, chip->regmap[PDAUDIOCF_REG_IER>>1]);
}
-static void pdacf_proc_read(snd_info_entry_t * entry,
- snd_info_buffer_t * buffer)
+static void pdacf_proc_read(struct snd_info_entry * entry,
+ struct snd_info_buffer *buffer)
{
- pdacf_t *chip = entry->private_data;
+ struct snd_pdacf *chip = entry->private_data;
u16 tmp;
snd_iprintf(buffer, "PDAudioCF\n\n");
}
-static void pdacf_proc_init(pdacf_t *chip)
+static void pdacf_proc_init(struct snd_pdacf *chip)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
if (! snd_card_proc_new(chip->card, "pdaudiocf", &entry))
snd_info_set_text_ops(entry, chip, 1024, pdacf_proc_read);
}
-pdacf_t *snd_pdacf_create(snd_card_t *card)
+struct snd_pdacf *snd_pdacf_create(struct snd_card *card)
{
- pdacf_t *chip;
+ struct snd_pdacf *chip;
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return chip;
}
-static void snd_pdacf_ak4117_change(ak4117_t *ak4117, unsigned char c0, unsigned char c1)
+static void snd_pdacf_ak4117_change(struct ak4117 *ak4117, unsigned char c0, unsigned char c1)
{
- pdacf_t *chip = ak4117->change_callback_private;
+ struct snd_pdacf *chip = ak4117->change_callback_private;
unsigned long flags;
u16 val;
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
-int snd_pdacf_ak4117_create(pdacf_t *chip)
+int snd_pdacf_ak4117_create(struct snd_pdacf *chip)
{
int err;
u16 val;
return 0;
}
-void snd_pdacf_powerdown(pdacf_t *chip)
+void snd_pdacf_powerdown(struct snd_pdacf *chip)
{
u16 val;
#ifdef CONFIG_PM
-int snd_pdacf_suspend(snd_card_t *card, pm_message_t state)
+int snd_pdacf_suspend(struct snd_card *card, pm_message_t state)
{
- pdacf_t *chip = card->pm_private_data;
+ struct snd_pdacf *chip = card->pm_private_data;
u16 val;
snd_pcm_suspend_all(chip->pcm);
return 0;
}
-static inline int check_signal(pdacf_t *chip)
+static inline int check_signal(struct snd_pdacf *chip)
{
return (chip->ak4117->rcs0 & AK4117_UNLCK) == 0;
}
-int snd_pdacf_resume(snd_card_t *card)
+int snd_pdacf_resume(struct snd_card *card)
{
- pdacf_t *chip = card->pm_private_data;
+ struct snd_pdacf *chip = card->pm_private_data;
int timeout = 40;
pdacf_reinit(chip, 1);
*/
irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs)
{
- pdacf_t *chip = dev;
+ struct snd_pdacf *chip = dev;
unsigned short stat;
if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE|
}
}
-static void pdacf_transfer(pdacf_t *chip, unsigned int size, unsigned int off)
+static void pdacf_transfer(struct snd_pdacf *chip, unsigned int size, unsigned int off)
{
unsigned long rdp_port = chip->port + PDAUDIOCF_REG_MD;
unsigned int xor = chip->pcm_xor;
void pdacf_tasklet(unsigned long private_data)
{
- pdacf_t *chip = (pdacf_t *) private_data;
+ struct snd_pdacf *chip = (struct snd_pdacf *) private_data;
int size, off, cont, rdp, wdp;
if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE|PDAUDIOCF_STAT_IS_CONFIGURED)) != PDAUDIOCF_STAT_IS_CONFIGURED)
*/
/* get the physical page pointer on the given offset */
-static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset)
+static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, unsigned long offset)
{
void *pageptr = subs->runtime->dma_area + offset;
return vmalloc_to_page(pageptr);
* hw_params callback
* NOTE: this may be called not only once per pcm open!
*/
-static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size)
+static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size)
{
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pcm_runtime *runtime = subs->runtime;
if (runtime->dma_area) {
if (runtime->dma_bytes >= size)
return 0; /* already enough large */
* hw_free callback
* NOTE: this may be called not only once per pcm open!
*/
-static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs)
+static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
{
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pcm_runtime *runtime = subs->runtime;
if (runtime->dma_area) {
vfree(runtime->dma_area);
runtime->dma_area = NULL;
/*
* clear the SRAM contents
*/
-static int pdacf_pcm_clear_sram(pdacf_t *chip)
+static int pdacf_pcm_clear_sram(struct snd_pdacf *chip)
{
int max_loop = 64 * 1024;
/*
* pdacf_pcm_trigger - trigger callback for capture
*/
-static int pdacf_pcm_trigger(snd_pcm_substream_t *subs, int cmd)
+static int pdacf_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
{
- pdacf_t *chip = snd_pcm_substream_chip(subs);
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
+ struct snd_pcm_runtime *runtime = subs->runtime;
int inc, ret = 0, rate;
unsigned short mask, val, tmp;
/*
* pdacf_pcm_hw_params - hw_params callback for playback and capture
*/
-static int pdacf_pcm_hw_params(snd_pcm_substream_t *subs,
- snd_pcm_hw_params_t *hw_params)
+static int pdacf_pcm_hw_params(struct snd_pcm_substream *subs,
+ struct snd_pcm_hw_params *hw_params)
{
return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params));
}
/*
* pdacf_pcm_hw_free - hw_free callback for playback and capture
*/
-static int pdacf_pcm_hw_free(snd_pcm_substream_t *subs)
+static int pdacf_pcm_hw_free(struct snd_pcm_substream *subs)
{
return snd_pcm_free_vmalloc_buffer(subs);
}
/*
* pdacf_pcm_prepare - prepare callback for playback and capture
*/
-static int pdacf_pcm_prepare(snd_pcm_substream_t *subs)
+static int pdacf_pcm_prepare(struct snd_pcm_substream *subs)
{
- pdacf_t *chip = snd_pcm_substream_chip(subs);
- snd_pcm_runtime_t *runtime = subs->runtime;
+ struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
+ struct snd_pcm_runtime *runtime = subs->runtime;
u16 val, nval, aval;
if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE)
* capture hw information
*/
-static snd_pcm_hardware_t pdacf_pcm_capture_hw = {
+static struct snd_pcm_hardware pdacf_pcm_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
/*
* pdacf_pcm_capture_open - open callback for capture
*/
-static int pdacf_pcm_capture_open(snd_pcm_substream_t *subs)
+static int pdacf_pcm_capture_open(struct snd_pcm_substream *subs)
{
- snd_pcm_runtime_t *runtime = subs->runtime;
- pdacf_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pcm_runtime *runtime = subs->runtime;
+ struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE)
return -EBUSY;
/*
* pdacf_pcm_capture_close - close callback for capture
*/
-static int pdacf_pcm_capture_close(snd_pcm_substream_t *subs)
+static int pdacf_pcm_capture_close(struct snd_pcm_substream *subs)
{
- pdacf_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
if (!chip)
return -EINVAL;
/*
* pdacf_pcm_capture_pointer - pointer callback for capture
*/
-static snd_pcm_uframes_t pdacf_pcm_capture_pointer(snd_pcm_substream_t *subs)
+static snd_pcm_uframes_t pdacf_pcm_capture_pointer(struct snd_pcm_substream *subs)
{
- pdacf_t *chip = snd_pcm_substream_chip(subs);
+ struct snd_pdacf *chip = snd_pcm_substream_chip(subs);
return chip->pcm_hwptr;
}
/*
* operators for PCM capture
*/
-static snd_pcm_ops_t pdacf_pcm_capture_ops = {
+static struct snd_pcm_ops pdacf_pcm_capture_ops = {
.open = pdacf_pcm_capture_open,
.close = pdacf_pcm_capture_close,
.ioctl = snd_pcm_lib_ioctl,
/*
* snd_pdacf_pcm_new - create and initialize a pcm
*/
-int snd_pdacf_pcm_new(pdacf_t *chip)
+int snd_pdacf_pcm_new(struct snd_pdacf *chip)
{
- snd_pcm_t *pcm;
+ struct snd_pcm *pcm;
int err;
err = snd_pcm_new(chip->card, "PDAudioCF", 0, 0, 1, &pcm);