diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 16:38:36 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-04 16:38:36 -0800 |
commit | 4da5cc2cec8caec1d357053e85a7a32f243f93a1 (patch) | |
tree | 3f8b603af4af88f86be7ec1d4e3639a7fc9dd1a6 /sound/isa/es1688 | |
parent | 25c862cc9ea9b312c25a9f577f91b973131f1261 (diff) | |
parent | c6f43290ae687c11cdcd150d8bfeb57ec29cfa5b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'sound/isa/es1688')
-rw-r--r-- | sound/isa/es1688/es1688.c | 130 | ||||
-rw-r--r-- | sound/isa/es1688/es1688_lib.c | 158 |
2 files changed, 159 insertions, 129 deletions
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index 26a7d335ed8..50d23cf3d7c 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c @@ -20,16 +20,17 @@ */ #include <sound/driver.h> -#include <asm/dma.h> #include <linux/init.h> +#include <linux/err.h> +#include <linux/platform_device.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/moduleparam.h> +#include <asm/dma.h> #include <sound/core.h> #include <sound/es1688.h> #include <sound/mpu401.h> #include <sound/opl3.h> -#define SNDRV_LEGACY_AUTO_PROBE #define SNDRV_LEGACY_FIND_FREE_IRQ #define SNDRV_LEGACY_FIND_FREE_DMA #include <sound/initval.h> @@ -68,19 +69,20 @@ MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ESx688 driver."); module_param_array(dma8, int, NULL, 0444); MODULE_PARM_DESC(dma8, "8-bit DMA # for ESx688 driver."); -static snd_card_t *snd_audiodrive_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; +static struct platform_device *devices[SNDRV_CARDS]; #define PFX "es1688: " -static int __init snd_audiodrive_probe(int dev) +static int __init snd_es1688_probe(struct platform_device *pdev) { + int dev = pdev->id; static int possible_irqs[] = {5, 9, 10, 7, -1}; static int possible_dmas[] = {1, 3, 0, -1}; int xirq, xdma, xmpu_irq; - snd_card_t *card; - es1688_t *chip; - opl3_t *opl3; - snd_pcm_t *pcm; + struct snd_card *card; + struct snd_es1688 *chip; + struct snd_opl3 *opl3; + struct snd_pcm *pcm; int err; card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); @@ -105,10 +107,30 @@ static int __init snd_audiodrive_probe(int dev) } } - if ((err = snd_es1688_create(card, port[dev], mpu_port[dev], - xirq, xmpu_irq, xdma, - ES1688_HW_AUTO, &chip)) < 0) - goto _err; + if (port[dev] != SNDRV_AUTO_PORT) { + if ((err = snd_es1688_create(card, port[dev], mpu_port[dev], + xirq, xmpu_irq, xdma, + ES1688_HW_AUTO, &chip)) < 0) + goto _err; + } else { + /* auto-probe legacy ports */ + static unsigned long possible_ports[] = { + 0x220, 0x240, 0x260, + }; + int i; + for (i = 0; i < ARRAY_SIZE(possible_ports); i++) { + err = snd_es1688_create(card, possible_ports[i], + mpu_port[dev], + xirq, xmpu_irq, xdma, + ES1688_HW_AUTO, &chip); + if (err >= 0) { + port[dev] = possible_ports[i]; + break; + } + } + if (i >= ARRAY_SIZE(possible_ports)) + goto _err; + } if ((err = snd_es1688_pcm(chip, 0, &pcm)) < 0) goto _err; @@ -136,13 +158,12 @@ static int __init snd_audiodrive_probe(int dev) goto _err; } - if ((err = snd_card_set_generic_dev(card)) < 0) - goto _err; + snd_card_set_dev(card, &pdev->dev); if ((err = snd_card_register(card)) < 0) goto _err; - snd_audiodrive_cards[dev] = card; + platform_set_drvdata(pdev, card); return 0; _err: @@ -150,53 +171,70 @@ static int __init snd_audiodrive_probe(int dev) return err; } -static int __init snd_audiodrive_legacy_auto_probe(unsigned long xport) +static int snd_es1688_remove(struct platform_device *devptr) { - static int dev; - int res; - - for ( ; dev < SNDRV_CARDS; dev++) { - if (!enable[dev] || port[dev] != SNDRV_AUTO_PORT) - continue; - port[dev] = xport; - res = snd_audiodrive_probe(dev); - if (res < 0) - port[dev] = SNDRV_AUTO_PORT; - return res; - } - return -ENODEV; + snd_card_free(platform_get_drvdata(devptr)); + platform_set_drvdata(devptr, NULL); + return 0; +} + +#define ES1688_DRIVER "snd_es1688" + +static struct platform_driver snd_es1688_driver = { + .probe = snd_es1688_probe, + .remove = snd_es1688_remove, + /* FIXME: suspend/resume */ + .driver = { + .name = ES1688_DRIVER + }, +}; + +static void __init_or_module snd_es1688_unregister_all(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(devices); ++i) + platform_device_unregister(devices[i]); + platform_driver_unregister(&snd_es1688_driver); } static int __init alsa_card_es1688_init(void) { - static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; - int dev, cards = 0, i; - - for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { - if (port[dev] == SNDRV_AUTO_PORT) - continue; - if (snd_audiodrive_probe(dev) >= 0) - cards++; + int i, cards, err; + + err = platform_driver_register(&snd_es1688_driver); + if (err < 0) + return err; + + cards = 0; + for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + struct platform_device *device; + device = platform_device_register_simple(ES1688_DRIVER, + i, NULL, 0); + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; + } + devices[i] = device; + cards++; } - i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe); - if (i > 0) - cards += i; - if (!cards) { #ifdef MODULE printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); #endif - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_es1688_unregister_all(); + return err; } static void __exit alsa_card_es1688_exit(void) { - int idx; - - for (idx = 0; idx < SNDRV_CARDS; idx++) - snd_card_free(snd_audiodrive_cards[idx]); + snd_es1688_unregister_all(); } module_init(alsa_card_es1688_init) diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c index 2edc9c9f044..702ad51ee9d 100644 --- a/sound/isa/es1688/es1688_lib.c +++ b/sound/isa/es1688/es1688_lib.c @@ -36,7 +36,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); MODULE_DESCRIPTION("ESS ESx688 lowlevel module"); MODULE_LICENSE("GPL"); -static int snd_es1688_dsp_command(es1688_t *chip, unsigned char val) +static int snd_es1688_dsp_command(struct snd_es1688 *chip, unsigned char val) { int i; @@ -51,7 +51,7 @@ static int snd_es1688_dsp_command(es1688_t *chip, unsigned char val) return 0; } -static int snd_es1688_dsp_get_byte(es1688_t *chip) +static int snd_es1688_dsp_get_byte(struct snd_es1688 *chip) { int i; @@ -62,7 +62,7 @@ static int snd_es1688_dsp_get_byte(es1688_t *chip) return -ENODEV; } -static int snd_es1688_write(es1688_t *chip, +static int snd_es1688_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data) { if (!snd_es1688_dsp_command(chip, reg)) @@ -70,7 +70,7 @@ static int snd_es1688_write(es1688_t *chip, return snd_es1688_dsp_command(chip, data); } -static int snd_es1688_read(es1688_t *chip, unsigned char reg) +static int snd_es1688_read(struct snd_es1688 *chip, unsigned char reg) { /* Read a byte from an extended mode register of ES1688 */ if (!snd_es1688_dsp_command(chip, 0xc0)) @@ -80,7 +80,7 @@ static int snd_es1688_read(es1688_t *chip, unsigned char reg) return snd_es1688_dsp_get_byte(chip); } -void snd_es1688_mixer_write(es1688_t *chip, +void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data) { outb(reg, ES1688P(chip, MIXER_ADDR)); @@ -89,7 +89,7 @@ void snd_es1688_mixer_write(es1688_t *chip, udelay(10); } -static unsigned char snd_es1688_mixer_read(es1688_t *chip, unsigned char reg) +static unsigned char snd_es1688_mixer_read(struct snd_es1688 *chip, unsigned char reg) { unsigned char result; @@ -100,7 +100,7 @@ static unsigned char snd_es1688_mixer_read(es1688_t *chip, unsigned char reg) return result; } -static int snd_es1688_reset(es1688_t *chip) +static int snd_es1688_reset(struct snd_es1688 *chip) { int i; @@ -117,7 +117,7 @@ static int snd_es1688_reset(es1688_t *chip) return 0; } -static int snd_es1688_probe(es1688_t *chip) +static int snd_es1688_probe(struct snd_es1688 *chip) { unsigned long flags; unsigned short major, minor, hw; @@ -191,7 +191,7 @@ static int snd_es1688_probe(es1688_t *chip) return 0; } -static int snd_es1688_init(es1688_t * chip, int enable) +static int snd_es1688_init(struct snd_es1688 * chip, int enable) { static int irqs[16] = {-1, -1, 0, -1, -1, 1, -1, 2, -1, 0, 3, -1, -1, -1, -1, -1}; unsigned long flags; @@ -283,7 +283,7 @@ static int snd_es1688_init(es1688_t * chip, int enable) */ -static ratnum_t clocks[2] = { +static struct snd_ratnum clocks[2] = { { .num = 795444, .den_min = 1, @@ -298,14 +298,14 @@ static ratnum_t clocks[2] = { } }; -static snd_pcm_hw_constraint_ratnums_t hw_constraints_clocks = { +static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = { .nrats = 2, .rats = clocks, }; -static void snd_es1688_set_rate(es1688_t *chip, snd_pcm_substream_t *substream) +static void snd_es1688_set_rate(struct snd_es1688 *chip, struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int bits, divider; if (runtime->rate_num == clocks[0].num) @@ -319,13 +319,13 @@ static void snd_es1688_set_rate(es1688_t *chip, snd_pcm_substream_t *substream) snd_es1688_write(chip, 0xa2, divider); } -static int snd_es1688_ioctl(snd_pcm_substream_t * substream, +static int snd_es1688_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg) { return snd_pcm_lib_ioctl(substream, cmd, arg); } -static int snd_es1688_trigger(es1688_t *chip, int cmd, unsigned char value) +static int snd_es1688_trigger(struct snd_es1688 *chip, int cmd, unsigned char value) { int val; @@ -350,22 +350,22 @@ static int snd_es1688_trigger(es1688_t *chip, int cmd, unsigned char value) return 0; } -static int snd_es1688_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_es1688_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } -static int snd_es1688_hw_free(snd_pcm_substream_t * substream) +static int snd_es1688_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static int snd_es1688_playback_prepare(snd_pcm_substream_t * substream) +static int snd_es1688_playback_prepare(struct snd_pcm_substream *substream) { unsigned long flags; - es1688_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int size = snd_pcm_lib_buffer_bytes(substream); unsigned int count = snd_pcm_lib_period_bytes(substream); @@ -415,18 +415,18 @@ static int snd_es1688_playback_prepare(snd_pcm_substream_t * substream) return 0; } -static int snd_es1688_playback_trigger(snd_pcm_substream_t * substream, +static int snd_es1688_playback_trigger(struct snd_pcm_substream *substream, int cmd) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); return snd_es1688_trigger(chip, cmd, 0x05); } -static int snd_es1688_capture_prepare(snd_pcm_substream_t * substream) +static int snd_es1688_capture_prepare(struct snd_pcm_substream *substream) { unsigned long flags; - es1688_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int size = snd_pcm_lib_buffer_bytes(substream); unsigned int count = snd_pcm_lib_period_bytes(substream); @@ -472,16 +472,16 @@ static int snd_es1688_capture_prepare(snd_pcm_substream_t * substream) return 0; } -static int snd_es1688_capture_trigger(snd_pcm_substream_t * substream, +static int snd_es1688_capture_trigger(struct snd_pcm_substream *substream, int cmd) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); return snd_es1688_trigger(chip, cmd, 0x0f); } static irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - es1688_t *chip = dev_id; + struct snd_es1688 *chip = dev_id; if (chip->trigger_value == 0x05) /* ok.. playback is active */ snd_pcm_period_elapsed(chip->playback_substream); @@ -492,9 +492,9 @@ static irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *r return IRQ_HANDLED; } -static snd_pcm_uframes_t snd_es1688_playback_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_es1688_playback_pointer(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); size_t ptr; if (chip->trigger_value != 0x05) @@ -503,9 +503,9 @@ static snd_pcm_uframes_t snd_es1688_playback_pointer(snd_pcm_substream_t * subst return bytes_to_frames(substream->runtime, ptr); } -static snd_pcm_uframes_t snd_es1688_capture_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_es1688_capture_pointer(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); size_t ptr; if (chip->trigger_value != 0x0f) @@ -518,7 +518,7 @@ static snd_pcm_uframes_t snd_es1688_capture_pointer(snd_pcm_substream_t * substr */ -static snd_pcm_hardware_t snd_es1688_playback = +static struct snd_pcm_hardware snd_es1688_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP_VALID), @@ -536,7 +536,7 @@ static snd_pcm_hardware_t snd_es1688_playback = .fifo_size = 0, }; -static snd_pcm_hardware_t snd_es1688_capture = +static struct snd_pcm_hardware snd_es1688_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP_VALID), @@ -558,10 +558,10 @@ static snd_pcm_hardware_t snd_es1688_capture = */ -static int snd_es1688_playback_open(snd_pcm_substream_t * substream) +static int snd_es1688_playback_open(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; if (chip->capture_substream != NULL) return -EAGAIN; @@ -572,10 +572,10 @@ static int snd_es1688_playback_open(snd_pcm_substream_t * substream) return 0; } -static int snd_es1688_capture_open(snd_pcm_substream_t * substream) +static int snd_es1688_capture_open(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; if (chip->playback_substream != NULL) return -EAGAIN; @@ -586,23 +586,23 @@ static int snd_es1688_capture_open(snd_pcm_substream_t * substream) return 0; } -static int snd_es1688_playback_close(snd_pcm_substream_t * substream) +static int snd_es1688_playback_close(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); chip->playback_substream = NULL; return 0; } -static int snd_es1688_capture_close(snd_pcm_substream_t * substream) +static int snd_es1688_capture_close(struct snd_pcm_substream *substream) { - es1688_t *chip = snd_pcm_substream_chip(substream); + struct snd_es1688 *chip = snd_pcm_substream_chip(substream); chip->capture_substream = NULL; return 0; } -static int snd_es1688_free(es1688_t *chip) +static int snd_es1688_free(struct snd_es1688 *chip) { if (chip->res_port) { snd_es1688_init(chip, 0); @@ -618,33 +618,33 @@ static int snd_es1688_free(es1688_t *chip) return 0; } -static int snd_es1688_dev_free(snd_device_t *device) +static int snd_es1688_dev_free(struct snd_device *device) { - es1688_t *chip = device->device_data; + struct snd_es1688 *chip = device->device_data; return snd_es1688_free(chip); } -static const char *snd_es1688_chip_id(es1688_t *chip) +static const char *snd_es1688_chip_id(struct snd_es1688 *chip) { static char tmp[16]; sprintf(tmp, "ES%s688 rev %i", chip->hardware == ES1688_HW_688 ? "" : "1", chip->version & 0x0f); return tmp; } -int snd_es1688_create(snd_card_t * card, +int snd_es1688_create(struct snd_card *card, unsigned long port, unsigned long mpu_port, int irq, int mpu_irq, int dma8, unsigned short hardware, - es1688_t **rchip) + struct snd_es1688 **rchip) { - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_es1688_dev_free, }; - es1688_t *chip; + struct snd_es1688 *chip; int err; *rchip = NULL; @@ -702,7 +702,7 @@ int snd_es1688_create(snd_card_t * card, return 0; } -static snd_pcm_ops_t snd_es1688_playback_ops = { +static struct snd_pcm_ops snd_es1688_playback_ops = { .open = snd_es1688_playback_open, .close = snd_es1688_playback_close, .ioctl = snd_es1688_ioctl, @@ -713,7 +713,7 @@ static snd_pcm_ops_t snd_es1688_playback_ops = { .pointer = snd_es1688_playback_pointer, }; -static snd_pcm_ops_t snd_es1688_capture_ops = { +static struct snd_pcm_ops snd_es1688_capture_ops = { .open = snd_es1688_capture_open, .close = snd_es1688_capture_close, .ioctl = snd_es1688_ioctl, @@ -724,16 +724,9 @@ static snd_pcm_ops_t snd_es1688_capture_ops = { .pointer = snd_es1688_capture_pointer, }; -static void snd_es1688_pcm_free(snd_pcm_t *pcm) +int snd_es1688_pcm(struct snd_es1688 * chip, int device, struct snd_pcm ** rpcm) { - es1688_t *chip = pcm->private_data; - chip->pcm = NULL; - snd_pcm_lib_preallocate_free_for_all(pcm); -} - -int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm) -{ - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if ((err = snd_pcm_new(chip->card, "ESx688", device, 1, 1, &pcm)) < 0) @@ -743,7 +736,6 @@ int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1688_capture_ops); pcm->private_data = chip; - pcm->private_free = snd_es1688_pcm_free; pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; sprintf(pcm->name, snd_es1688_chip_id(chip)); chip->pcm = pcm; @@ -761,7 +753,7 @@ int snd_es1688_pcm(es1688_t * chip, int device, snd_pcm_t ** rpcm) * MIXER part */ -static int snd_es1688_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_es1688_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts[9] = { "Mic", "Mic Master", "CD", "AOUT", @@ -777,16 +769,16 @@ static int snd_es1688_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * u return 0; } -static int snd_es1688_get_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = snd_es1688_mixer_read(chip, ES1688_REC_DEV) & 7; return 0; } -static int snd_es1688_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; unsigned char oval, nval; int change; @@ -809,7 +801,7 @@ static int snd_es1688_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * .get = snd_es1688_get_single, .put = snd_es1688_put_single, \ .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } -static int snd_es1688_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_es1688_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { int mask = (kcontrol->private_value >> 16) & 0xff; @@ -820,9 +812,9 @@ static int snd_es1688_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -static int snd_es1688_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int reg = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; @@ -837,9 +829,9 @@ static int snd_es1688_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t return 0; } -static int snd_es1688_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int reg = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; @@ -868,7 +860,7 @@ static int snd_es1688_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t .get = snd_es1688_get_double, .put = snd_es1688_put_double, \ .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } -static int snd_es1688_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) +static int snd_es1688_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { int mask = (kcontrol->private_value >> 24) & 0xff; @@ -879,9 +871,9 @@ static int snd_es1688_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t return 0; } -static int snd_es1688_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int left_reg = kcontrol->private_value & 0xff; int right_reg = (kcontrol->private_value >> 8) & 0xff; @@ -913,9 +905,9 @@ static int snd_es1688_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t return 0; } -static int snd_es1688_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) +static int snd_es1688_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - es1688_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_es1688 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int left_reg = kcontrol->private_value & 0xff; int right_reg = (kcontrol->private_value >> 8) & 0xff; @@ -976,7 +968,7 @@ static int snd_es1688_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t return change; } -static snd_kcontrol_new_t snd_es1688_controls[] = { +static struct snd_kcontrol_new snd_es1688_controls[] = { ES1688_DOUBLE("Master Playback Volume", 0, ES1688_MASTER_DEV, ES1688_MASTER_DEV, 4, 0, 15, 0), ES1688_DOUBLE("PCM Playback Volume", 0, ES1688_PCM_DEV, ES1688_PCM_DEV, 4, 0, 15, 0), ES1688_DOUBLE("Line Playback Volume", 0, ES1688_LINE_DEV, ES1688_LINE_DEV, 4, 0, 15, 0), @@ -1011,9 +1003,9 @@ static unsigned char snd_es1688_init_table[][2] = { { ES1688_REC_DEV, 0x17 } }; -int snd_es1688_mixer(es1688_t *chip) +int snd_es1688_mixer(struct snd_es1688 *chip) { - snd_card_t *card; + struct snd_card *card; unsigned int idx; int err; unsigned char reg, val; |