From 954bea35571461b083390a82b03f077f901fe678 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 10:37:40 +0100 Subject: [ALSA] intel8x0 - Clean up delay function Modules: Intel8x0 driver,Intel8x0-modem driver Remove superfluous delay macro. Call appropriate functions directly. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index cf7801d2dd1..af2b1435e63 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2149,10 +2149,6 @@ static void do_ali_reset(intel8x0_t *chip) iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000); } -#define do_delay(chip) do {\ - schedule_timeout_uninterruptible(1);\ -} while (0) - static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) { unsigned long end_time; @@ -2176,7 +2172,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) do { if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0) goto __ok; - do_delay(chip); + schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); return -EIO; @@ -2192,7 +2188,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); if (status) break; - do_delay(chip); + schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); if (! status) { /* no codec is found */ @@ -2210,7 +2206,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) /* wait for other codecs ready status. */ end_time = jiffies + HZ / 4; while (status != nstatus && time_after_eq(end_time, jiffies)) { - do_delay(chip); + schedule_timeout_uninterruptible(1); status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus; } @@ -2227,7 +2223,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); if (status == nstatus) break; - do_delay(chip); + schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); } @@ -2261,7 +2257,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing) for (i = 0; i < HZ / 2; i++) { if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO)) goto __ok; - do_delay(chip); + schedule_timeout_uninterruptible(1); } snd_printk(KERN_ERR "AC'97 reset failed.\n"); if (probing) @@ -2273,7 +2269,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing) if (reg & 0x80) /* primary codec */ break; iputdword(chip, ICHREG(ALI_RTSR), reg | 0x80); - do_delay(chip); + schedule_timeout_uninterruptible(1); } do_ali_reset(chip); -- cgit v1.2.3-70-g09d2 From 6b75a9d8b6c794d4c41d1b875c3e8e920b09e151 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 15:04:53 +0100 Subject: [ALSA] Remove xxx_t typedefs: PCI Intel8x0 Modules: Intel8x0 driver,Intel8x0-modem driver Remove xxx_t typedefs from the PCI Intel8x0 and modem drivers. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 428 ++++++++++++++++++++++++++++---------------------- sound/pci/intel8x0m.c | 228 ++++++++++++++------------- 2 files changed, 362 insertions(+), 294 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index af2b1435e63..3ea90f1e22e 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -272,7 +272,8 @@ enum { #define ALI_INT_CPRAIS (1<<7) /* command port available */ #define ALI_INT_SPRAIS (1<<5) /* status port available */ #define ALI_INT_GPIO (1<<1) -#define ALI_INT_MASK (ALI_INT_SPDIFOUT|ALI_INT_CODECSPDIFOUT|ALI_INT_MICIN|ALI_INT_PCMOUT|ALI_INT_PCMIN) +#define ALI_INT_MASK (ALI_INT_SPDIFOUT|ALI_INT_CODECSPDIFOUT|\ + ALI_INT_MICIN|ALI_INT_PCMOUT|ALI_INT_PCMIN) #define ICH_ALI_SC_RESET (1<<31) /* master reset */ #define ICH_ALI_SC_AC97_DBL (1<<30) @@ -303,18 +304,40 @@ enum { * */ -enum { ICHD_PCMIN, ICHD_PCMOUT, ICHD_MIC, ICHD_MIC2, ICHD_PCM2IN, ICHD_SPBAR, ICHD_LAST = ICHD_SPBAR }; -enum { NVD_PCMIN, NVD_PCMOUT, NVD_MIC, NVD_SPBAR, NVD_LAST = NVD_SPBAR }; -enum { ALID_PCMIN, ALID_PCMOUT, ALID_MIC, ALID_AC97SPDIFOUT, ALID_SPDIFIN, ALID_SPDIFOUT, ALID_LAST = ALID_SPDIFOUT }; +enum { + ICHD_PCMIN, + ICHD_PCMOUT, + ICHD_MIC, + ICHD_MIC2, + ICHD_PCM2IN, + ICHD_SPBAR, + ICHD_LAST = ICHD_SPBAR +}; +enum { + NVD_PCMIN, + NVD_PCMOUT, + NVD_MIC, + NVD_SPBAR, + NVD_LAST = NVD_SPBAR +}; +enum { + ALID_PCMIN, + ALID_PCMOUT, + ALID_MIC, + ALID_AC97SPDIFOUT, + ALID_SPDIFIN, + ALID_SPDIFOUT, + ALID_LAST = ALID_SPDIFOUT +}; -#define get_ichdev(substream) (ichdev_t *)(substream->runtime->private_data) +#define get_ichdev(substream) (substream->runtime->private_data) -typedef struct { +struct ichdev { unsigned int ichd; /* ich device number */ unsigned long reg_offset; /* offset to bmaddr */ u32 *bdbar; /* CPU address (32bit) */ unsigned int bdbar_addr; /* PCI bus address (32bit) */ - snd_pcm_substream_t *substream; + struct snd_pcm_substream *substream; unsigned int physbuf; /* physical address (32bit) */ unsigned int size; unsigned int fragsize; @@ -336,11 +359,9 @@ typedef struct { int pcm_open_flag; unsigned int page_attr_changed: 1; unsigned int suspended: 1; -} ichdev_t; - -typedef struct _snd_intel8x0 intel8x0_t; +}; -struct _snd_intel8x0 { +struct intel8x0 { unsigned int device_type; int irq; @@ -353,11 +374,11 @@ struct _snd_intel8x0 { void __iomem *remap_bmaddr; struct pci_dev *pci; - snd_card_t *card; + struct snd_card *card; int pcm_devs; - snd_pcm_t *pcm[6]; - ichdev_t ichd[6]; + struct snd_pcm *pcm[6]; + struct ichdev ichd[6]; unsigned multi4: 1, multi6: 1, @@ -374,8 +395,8 @@ struct _snd_intel8x0 { int spdif_idx; /* SPDIF BAR index; *_SPBAR or -1 if use PCMOUT */ unsigned int sdm_saved; /* SDM reg value */ - ac97_bus_t *ac97_bus; - ac97_t *ac97[3]; + struct snd_ac97_bus *ac97_bus; + struct snd_ac97 *ac97[3]; unsigned int ac97_sdin[3]; spinlock_t reg_lock; @@ -418,7 +439,7 @@ MODULE_DEVICE_TABLE(pci, snd_intel8x0_ids); * Lowlevel I/O - busmaster */ -static u8 igetbyte(intel8x0_t *chip, u32 offset) +static u8 igetbyte(struct intel8x0 *chip, u32 offset) { if (chip->bm_mmio) return readb(chip->remap_bmaddr + offset); @@ -426,7 +447,7 @@ static u8 igetbyte(intel8x0_t *chip, u32 offset) return inb(chip->bmaddr + offset); } -static u16 igetword(intel8x0_t *chip, u32 offset) +static u16 igetword(struct intel8x0 *chip, u32 offset) { if (chip->bm_mmio) return readw(chip->remap_bmaddr + offset); @@ -434,7 +455,7 @@ static u16 igetword(intel8x0_t *chip, u32 offset) return inw(chip->bmaddr + offset); } -static u32 igetdword(intel8x0_t *chip, u32 offset) +static u32 igetdword(struct intel8x0 *chip, u32 offset) { if (chip->bm_mmio) return readl(chip->remap_bmaddr + offset); @@ -442,7 +463,7 @@ static u32 igetdword(intel8x0_t *chip, u32 offset) return inl(chip->bmaddr + offset); } -static void iputbyte(intel8x0_t *chip, u32 offset, u8 val) +static void iputbyte(struct intel8x0 *chip, u32 offset, u8 val) { if (chip->bm_mmio) writeb(val, chip->remap_bmaddr + offset); @@ -450,7 +471,7 @@ static void iputbyte(intel8x0_t *chip, u32 offset, u8 val) outb(val, chip->bmaddr + offset); } -static void iputword(intel8x0_t *chip, u32 offset, u16 val) +static void iputword(struct intel8x0 *chip, u32 offset, u16 val) { if (chip->bm_mmio) writew(val, chip->remap_bmaddr + offset); @@ -458,7 +479,7 @@ static void iputword(intel8x0_t *chip, u32 offset, u16 val) outw(val, chip->bmaddr + offset); } -static void iputdword(intel8x0_t *chip, u32 offset, u32 val) +static void iputdword(struct intel8x0 *chip, u32 offset, u32 val) { if (chip->bm_mmio) writel(val, chip->remap_bmaddr + offset); @@ -470,7 +491,7 @@ static void iputdword(intel8x0_t *chip, u32 offset, u32 val) * Lowlevel I/O - AC'97 registers */ -static u16 iagetword(intel8x0_t *chip, u32 offset) +static u16 iagetword(struct intel8x0 *chip, u32 offset) { if (chip->mmio) return readw(chip->remap_addr + offset); @@ -478,7 +499,7 @@ static u16 iagetword(intel8x0_t *chip, u32 offset) return inw(chip->addr + offset); } -static void iaputword(intel8x0_t *chip, u32 offset, u16 val) +static void iaputword(struct intel8x0 *chip, u32 offset, u16 val) { if (chip->mmio) writew(val, chip->remap_addr + offset); @@ -495,7 +516,7 @@ static void iaputword(intel8x0_t *chip, u32 offset, u16 val) */ /* return the GLOB_STA bit for the corresponding codec */ -static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec) +static unsigned int get_ich_codec_bit(struct intel8x0 *chip, unsigned int codec) { static unsigned int codec_bit[3] = { ICH_PCR, ICH_SCR, ICH_TCR @@ -506,7 +527,7 @@ static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec) return codec_bit[codec]; } -static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec) +static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int codec) { int time; @@ -545,11 +566,11 @@ static int snd_intel8x0_codec_semaphore(intel8x0_t *chip, unsigned int codec) return -EBUSY; } -static void snd_intel8x0_codec_write(ac97_t *ac97, +static void snd_intel8x0_codec_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0 *chip = ac97->private_data; if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) { if (! chip->in_ac97_init) @@ -558,10 +579,10 @@ static void snd_intel8x0_codec_write(ac97_t *ac97, iaputword(chip, reg + ac97->num * 0x80, val); } -static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, +static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97, unsigned short reg) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0 *chip = ac97->private_data; unsigned short res; unsigned int tmp; @@ -573,7 +594,8 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, res = iagetword(chip, reg + ac97->num * 0x80); if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { /* reset RCS and preserve other R/WC bits */ - iputdword(chip, ICHREG(GLOB_STA), tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); + iputdword(chip, ICHREG(GLOB_STA), tmp & + ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); if (! chip->in_ac97_init) snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg); res = 0xffff; @@ -582,7 +604,7 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, return res; } -static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec) +static void snd_intel8x0_codec_read_test(struct intel8x0 *chip, unsigned int codec) { unsigned int tmp; @@ -590,7 +612,8 @@ static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec) iagetword(chip, codec * 0x80); if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { /* reset RCS and preserve other R/WC bits */ - iputdword(chip, ICHREG(GLOB_STA), tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); + iputdword(chip, ICHREG(GLOB_STA), tmp & + ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); } } } @@ -598,7 +621,7 @@ static void snd_intel8x0_codec_read_test(intel8x0_t *chip, unsigned int codec) /* * access to AC97 for Ali5455 */ -static int snd_intel8x0_ali_codec_ready(intel8x0_t *chip, int mask) +static int snd_intel8x0_ali_codec_ready(struct intel8x0 *chip, int mask) { int count = 0; for (count = 0; count < 0x7f; count++) { @@ -611,7 +634,7 @@ static int snd_intel8x0_ali_codec_ready(intel8x0_t *chip, int mask) return -EBUSY; } -static int snd_intel8x0_ali_codec_semaphore(intel8x0_t *chip) +static int snd_intel8x0_ali_codec_semaphore(struct intel8x0 *chip) { int time = 100; if (chip->buggy_semaphore) @@ -623,9 +646,9 @@ static int snd_intel8x0_ali_codec_semaphore(intel8x0_t *chip) return snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_CODEC_READY); } -static unsigned short snd_intel8x0_ali_codec_read(ac97_t *ac97, unsigned short reg) +static unsigned short snd_intel8x0_ali_codec_read(struct snd_ac97 *ac97, unsigned short reg) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0 *chip = ac97->private_data; unsigned short data = 0xffff; if (snd_intel8x0_ali_codec_semaphore(chip)) @@ -641,9 +664,10 @@ static unsigned short snd_intel8x0_ali_codec_read(ac97_t *ac97, unsigned short r return data; } -static void snd_intel8x0_ali_codec_write(ac97_t *ac97, unsigned short reg, unsigned short val) +static void snd_intel8x0_ali_codec_write(struct snd_ac97 *ac97, unsigned short reg, + unsigned short val) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0 *chip = ac97->private_data; if (snd_intel8x0_ali_codec_semaphore(chip)) return; @@ -658,7 +682,7 @@ static void snd_intel8x0_ali_codec_write(ac97_t *ac97, unsigned short reg, unsig /* * DMA I/O */ -static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev) +static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev) { int idx; u32 *bdbar = ichdev->bdbar; @@ -681,10 +705,15 @@ static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev) ichdev->ack_reload = ichdev->ack = 1; ichdev->fragsize1 = ichdev->fragsize; for (idx = 0; idx < (ICH_REG_LVI_MASK + 1) * 2; idx += 2) { - bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size)); + bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + + (((idx >> 1) * ichdev->fragsize) % + ichdev->size)); bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */ ichdev->fragsize >> ichdev->pos_shift); - // printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]); +#if 0 + printk("bdbar[%i] = 0x%x [0x%x]\n", + idx + 0, bdbar[idx + 0], bdbar[idx + 1]); +#endif } ichdev->frags = ichdev->size / ichdev->fragsize; } @@ -722,7 +751,7 @@ static void fill_nocache(void *buf, int size, int nocache) * Interrupt handler */ -static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) +static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev) { unsigned long port = ichdev->reg_offset; int status, civ, i, step; @@ -757,7 +786,12 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) ichdev->lvi_frag++; ichdev->lvi_frag %= ichdev->frags; ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1); - // printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), inl(port + 4), inb(port + ICH_REG_OFF_CR)); +#if 0 + printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", + ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], + ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), + inl(port + 4), inb(port + ICH_REG_OFF_CR)); +#endif if (--ichdev->ack == 0) { ichdev->ack = ichdev->ack_reload; ack = 1; @@ -773,8 +807,8 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - intel8x0_t *chip = dev_id; - ichdev_t *ichdev; + struct intel8x0 *chip = dev_id; + struct ichdev *ichdev; unsigned int status; unsigned int i; @@ -808,10 +842,10 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs * PCM part */ -static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd) +static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); unsigned char val = 0; unsigned long port = ichdev->reg_offset; @@ -847,12 +881,14 @@ static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd) return 0; } -static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd) +static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); unsigned long port = ichdev->reg_offset; - static int fiforeg[] = { ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3) }; + static int fiforeg[] = { + ICHREG(ALI_FIFOCR1), ICHREG(ALI_FIFOCR2), ICHREG(ALI_FIFOCR3) + }; unsigned int val, fifo; val = igetdword(chip, ICHREG(ALI_DMACR)); @@ -871,14 +907,16 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd) } iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE); val &= ~(1 << (ichdev->ali_slot + 16)); /* clear PAUSE flag */ - iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot)); /* start DMA */ + /* start DMA */ + iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot)); break; case SNDRV_PCM_TRIGGER_SUSPEND: ichdev->suspended = 1; /* fallthru */ case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16))); /* pause */ + /* pause */ + iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16))); iputbyte(chip, port + ICH_REG_OFF_CR, 0); while (igetbyte(chip, port + ICH_REG_OFF_CR)) ; @@ -887,7 +925,8 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd) /* reset whole DMA things */ iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS); /* clear interrupts */ - iputbyte(chip, port + ICH_REG_OFF_SR, igetbyte(chip, port + ICH_REG_OFF_SR) | 0x1e); + iputbyte(chip, port + ICH_REG_OFF_SR, + igetbyte(chip, port + ICH_REG_OFF_SR) | 0x1e); iputdword(chip, ICHREG(ALI_INTERRUPTSR), igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ichdev->int_sta_mask); break; @@ -897,12 +936,12 @@ static int snd_intel8x0_ali_trigger(snd_pcm_substream_t *substream, int cmd) return 0; } -static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int dbl = params_rate(hw_params) > 48000; int err; @@ -930,15 +969,16 @@ static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream, ichdev->pcm_open_flag = 1; /* Force SPDIF setting */ if (ichdev->ichd == ICHD_PCMOUT && chip->spdif_idx < 0) - snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF, params_rate(hw_params)); + snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF, + params_rate(hw_params)); } return err; } -static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream) +static int snd_intel8x0_hw_free(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); if (ichdev->pcm_open_flag) { snd_ac97_pcm_close(ichdev->pcm); @@ -951,8 +991,8 @@ static int snd_intel8x0_hw_free(snd_pcm_substream_t * substream) return snd_pcm_lib_free_pages(substream); } -static void snd_intel8x0_setup_pcm_out(intel8x0_t *chip, - snd_pcm_runtime_t *runtime) +static void snd_intel8x0_setup_pcm_out(struct intel8x0 *chip, + struct snd_pcm_runtime *runtime) { unsigned int cnt; int dbl = runtime->rate > 48000; @@ -1004,11 +1044,11 @@ static void snd_intel8x0_setup_pcm_out(intel8x0_t *chip, spin_unlock_irq(&chip->reg_lock); } -static int snd_intel8x0_pcm_prepare(snd_pcm_substream_t * substream) +static int snd_intel8x0_pcm_prepare(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct ichdev *ichdev = get_ichdev(substream); ichdev->physbuf = runtime->dma_addr; ichdev->size = snd_pcm_lib_buffer_bytes(substream); @@ -1022,10 +1062,10 @@ static int snd_intel8x0_pcm_prepare(snd_pcm_substream_t * substream) return 0; } -static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); size_t ptr1, ptr; int civ, timeout = 100; unsigned int position; @@ -1052,7 +1092,7 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substrea return bytes_to_frames(substream->runtime, ptr); } -static snd_pcm_hardware_t snd_intel8x0_stream = +static struct snd_pcm_hardware snd_intel8x0_stream = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -1077,7 +1117,7 @@ static unsigned int channels4[] = { 2, 4, }; -static snd_pcm_hw_constraint_list_t hw_constraints_channels4 = { +static struct snd_pcm_hw_constraint_list hw_constraints_channels4 = { .count = ARRAY_SIZE(channels4), .list = channels4, .mask = 0, @@ -1087,16 +1127,16 @@ static unsigned int channels6[] = { 2, 4, 6, }; -static snd_pcm_hw_constraint_list_t hw_constraints_channels6 = { +static struct snd_pcm_hw_constraint_list hw_constraints_channels6 = { .count = ARRAY_SIZE(channels6), .list = channels6, .mask = 0, }; -static int snd_intel8x0_pcm_open(snd_pcm_substream_t * substream, ichdev_t *ichdev) +static int snd_intel8x0_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int err; ichdev->substream = substream; @@ -1113,10 +1153,10 @@ static int snd_intel8x0_pcm_open(snd_pcm_substream_t * substream, ichdev_t *ichd return 0; } -static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_playback_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct intel8x0 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int err; err = snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMOUT]); @@ -1125,10 +1165,12 @@ static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream) if (chip->multi6) { runtime->hw.channels_max = 6; - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels6); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &hw_constraints_channels6); } else if (chip->multi4) { runtime->hw.channels_max = 4; - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels4); + snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, + &hw_constraints_channels4); } if (chip->dra) { snd_ac97_pcm_double_rate_rules(runtime); @@ -1140,94 +1182,94 @@ static int snd_intel8x0_playback_open(snd_pcm_substream_t * substream) return 0; } -static int snd_intel8x0_playback_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_playback_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_PCMOUT].substream = NULL; return 0; } -static int snd_intel8x0_capture_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_capture_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCMIN]); } -static int snd_intel8x0_capture_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_capture_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_PCMIN].substream = NULL; return 0; } -static int snd_intel8x0_mic_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_mic_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC]); } -static int snd_intel8x0_mic_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_mic_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_MIC].substream = NULL; return 0; } -static int snd_intel8x0_mic2_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_mic2_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_MIC2]); } -static int snd_intel8x0_mic2_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_mic2_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_MIC2].substream = NULL; return 0; } -static int snd_intel8x0_capture2_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_capture2_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ICHD_PCM2IN]); } -static int snd_intel8x0_capture2_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_capture2_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_PCM2IN].substream = NULL; return 0; } -static int snd_intel8x0_spdif_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_spdif_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; return snd_intel8x0_pcm_open(substream, &chip->ichd[idx]); } -static int snd_intel8x0_spdif_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_spdif_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); int idx = chip->device_type == DEVICE_NFORCE ? NVD_SPBAR : ICHD_SPBAR; chip->ichd[idx].substream = NULL; return 0; } -static int snd_intel8x0_ali_ac97spdifout_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_ac97spdifout_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); unsigned int val; spin_lock_irq(&chip->reg_lock); @@ -1240,9 +1282,9 @@ static int snd_intel8x0_ali_ac97spdifout_open(snd_pcm_substream_t * substream) return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_AC97SPDIFOUT]); } -static int snd_intel8x0_ali_ac97spdifout_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); unsigned int val; chip->ichd[ALID_AC97SPDIFOUT].substream = NULL; @@ -1255,39 +1297,39 @@ static int snd_intel8x0_ali_ac97spdifout_close(snd_pcm_substream_t * substream) return 0; } -static int snd_intel8x0_ali_spdifin_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFIN]); } -static int snd_intel8x0_ali_spdifin_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_spdifin_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ALID_SPDIFIN].substream = NULL; return 0; } #if 0 // NYI -static int snd_intel8x0_ali_spdifout_open(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_spdifout_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); return snd_intel8x0_pcm_open(substream, &chip->ichd[ALID_SPDIFOUT]); } -static int snd_intel8x0_ali_spdifout_close(snd_pcm_substream_t * substream) +static int snd_intel8x0_ali_spdifout_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0 *chip = snd_pcm_substream_chip(substream); chip->ichd[ALID_SPDIFOUT].substream = NULL; return 0; } #endif -static snd_pcm_ops_t snd_intel8x0_playback_ops = { +static struct snd_pcm_ops snd_intel8x0_playback_ops = { .open = snd_intel8x0_playback_open, .close = snd_intel8x0_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1298,7 +1340,7 @@ static snd_pcm_ops_t snd_intel8x0_playback_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_capture_ops = { +static struct snd_pcm_ops snd_intel8x0_capture_ops = { .open = snd_intel8x0_capture_open, .close = snd_intel8x0_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1309,7 +1351,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_capture_mic_ops = { +static struct snd_pcm_ops snd_intel8x0_capture_mic_ops = { .open = snd_intel8x0_mic_open, .close = snd_intel8x0_mic_close, .ioctl = snd_pcm_lib_ioctl, @@ -1320,7 +1362,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_mic_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_capture_mic2_ops = { +static struct snd_pcm_ops snd_intel8x0_capture_mic2_ops = { .open = snd_intel8x0_mic2_open, .close = snd_intel8x0_mic2_close, .ioctl = snd_pcm_lib_ioctl, @@ -1331,7 +1373,7 @@ static snd_pcm_ops_t snd_intel8x0_capture_mic2_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_capture2_ops = { +static struct snd_pcm_ops snd_intel8x0_capture2_ops = { .open = snd_intel8x0_capture2_open, .close = snd_intel8x0_capture2_close, .ioctl = snd_pcm_lib_ioctl, @@ -1342,7 +1384,7 @@ static snd_pcm_ops_t snd_intel8x0_capture2_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_spdif_ops = { +static struct snd_pcm_ops snd_intel8x0_spdif_ops = { .open = snd_intel8x0_spdif_open, .close = snd_intel8x0_spdif_close, .ioctl = snd_pcm_lib_ioctl, @@ -1353,7 +1395,7 @@ static snd_pcm_ops_t snd_intel8x0_spdif_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_ali_playback_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_playback_ops = { .open = snd_intel8x0_playback_open, .close = snd_intel8x0_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1364,7 +1406,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_playback_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_ali_capture_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_capture_ops = { .open = snd_intel8x0_capture_open, .close = snd_intel8x0_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1375,7 +1417,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_capture_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_ali_capture_mic_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_capture_mic_ops = { .open = snd_intel8x0_mic_open, .close = snd_intel8x0_mic_close, .ioctl = snd_pcm_lib_ioctl, @@ -1386,7 +1428,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_capture_mic_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_ali_ac97spdifout_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = { .open = snd_intel8x0_ali_ac97spdifout_open, .close = snd_intel8x0_ali_ac97spdifout_close, .ioctl = snd_pcm_lib_ioctl, @@ -1397,7 +1439,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_ac97spdifout_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0_ali_spdifin_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = { .open = snd_intel8x0_ali_spdifin_open, .close = snd_intel8x0_ali_spdifin_close, .ioctl = snd_pcm_lib_ioctl, @@ -1409,7 +1451,7 @@ static snd_pcm_ops_t snd_intel8x0_ali_spdifin_ops = { }; #if 0 // NYI -static snd_pcm_ops_t snd_intel8x0_ali_spdifout_ops = { +static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = { .open = snd_intel8x0_ali_spdifout_open, .close = snd_intel8x0_ali_spdifout_close, .ioctl = snd_pcm_lib_ioctl, @@ -1423,16 +1465,17 @@ static snd_pcm_ops_t snd_intel8x0_ali_spdifout_ops = { struct ich_pcm_table { char *suffix; - snd_pcm_ops_t *playback_ops; - snd_pcm_ops_t *capture_ops; + struct snd_pcm_ops *playback_ops; + struct snd_pcm_ops *capture_ops; size_t prealloc_size; size_t prealloc_max_size; int ac97_idx; }; -static int __devinit snd_intel8x0_pcm1(intel8x0_t *chip, int device, struct ich_pcm_table *rec) +static int __devinit snd_intel8x0_pcm1(struct intel8x0 *chip, int device, + struct ich_pcm_table *rec) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; char name[32]; @@ -1459,7 +1502,8 @@ static int __devinit snd_intel8x0_pcm1(intel8x0_t *chip, int device, struct ich_ strcpy(pcm->name, chip->card->shortname); chip->pcm[device] = pcm; - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, + snd_dma_pci_data(chip->pci), rec->prealloc_size, rec->prealloc_max_size); return 0; @@ -1557,7 +1601,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = { #endif }; -static int __devinit snd_intel8x0_pcm(intel8x0_t *chip) +static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip) { int i, tblsize, device, err; struct ich_pcm_table *tbl, *rec; @@ -1604,15 +1648,15 @@ static int __devinit snd_intel8x0_pcm(intel8x0_t *chip) * Mixer part */ -static void snd_intel8x0_mixer_free_ac97_bus(ac97_bus_t *bus) +static void snd_intel8x0_mixer_free_ac97_bus(struct snd_ac97_bus *bus) { - intel8x0_t *chip = bus->private_data; + struct intel8x0 *chip = bus->private_data; chip->ac97_bus = NULL; } -static void snd_intel8x0_mixer_free_ac97(ac97_t *ac97) +static void snd_intel8x0_mixer_free_ac97(struct snd_ac97 *ac97) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0 *chip = ac97->private_data; chip->ac97[ac97->num] = NULL; } @@ -1961,19 +2005,20 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { { } /* terminator */ }; -static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const char *quirk_override) +static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock, + const char *quirk_override) { - ac97_bus_t *pbus; - ac97_template_t ac97; + struct snd_ac97_bus *pbus; + struct snd_ac97_template ac97; int err; unsigned int i, codecs; unsigned int glob_sta = 0; - ac97_bus_ops_t *ops; - static ac97_bus_ops_t standard_bus_ops = { + struct snd_ac97_bus_ops *ops; + static struct snd_ac97_bus_ops standard_bus_ops = { .write = snd_intel8x0_codec_write, .read = snd_intel8x0_codec_read, }; - static ac97_bus_ops_t ali_bus_ops = { + static struct snd_ac97_bus_ops ali_bus_ops = { .write = snd_intel8x0_ali_codec_write, .read = snd_intel8x0_ali_codec_read, }; @@ -2128,7 +2173,8 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const __err: /* clear the cold-reset bit for the next chance */ if (chip->device_type != DEVICE_ALI) - iputdword(chip, ICHREG(GLOB_CNT), igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD); + iputdword(chip, ICHREG(GLOB_CNT), + igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD); return err; } @@ -2137,7 +2183,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock, const * */ -static void do_ali_reset(intel8x0_t *chip) +static void do_ali_reset(struct intel8x0 *chip) { iputdword(chip, ICHREG(ALI_SCR), ICH_ALI_SC_RESET); iputdword(chip, ICHREG(ALI_FIFOCR1), 0x83838383); @@ -2149,7 +2195,7 @@ static void do_ali_reset(intel8x0_t *chip) iputdword(chip, ICHREG(ALI_INTERRUPTSR), 0x00000000); } -static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) +static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing) { unsigned long end_time; unsigned int cnt, status, nstatus; @@ -2174,7 +2220,8 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) goto __ok; schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); - snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); + snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", + igetdword(chip, ICHREG(GLOB_CNT))); return -EIO; __ok: @@ -2185,14 +2232,16 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) */ end_time = jiffies + HZ; do { - status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); + status = igetdword(chip, ICHREG(GLOB_STA)) & + (ICH_PCR | ICH_SCR | ICH_TCR); if (status) break; schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); if (! status) { /* no codec is found */ - snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", igetdword(chip, ICHREG(GLOB_STA))); + snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", + igetdword(chip, ICHREG(GLOB_STA))); return -EIO; } @@ -2220,7 +2269,8 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) /* wait until all the probed codecs are ready */ end_time = jiffies + HZ; do { - nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); + nstatus = igetdword(chip, ICHREG(GLOB_STA)) & + (ICH_PCR | ICH_SCR | ICH_TCR); if (status == nstatus) break; schedule_timeout_uninterruptible(1); @@ -2241,7 +2291,7 @@ static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing) return 0; } -static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing) +static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing) { u32 reg; int i = 0; @@ -2276,7 +2326,7 @@ static int snd_intel8x0_ali_chip_init(intel8x0_t *chip, int probing) return 0; } -static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing) +static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing) { unsigned int i; int err; @@ -2298,11 +2348,12 @@ static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing) iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS); /* initialize Buffer Descriptor Lists */ for (i = 0; i < chip->bdbars_count; i++) - iputdword(chip, ICH_REG_OFF_BDBAR + chip->ichd[i].reg_offset, chip->ichd[i].bdbar_addr); + iputdword(chip, ICH_REG_OFF_BDBAR + chip->ichd[i].reg_offset, + chip->ichd[i].bdbar_addr); return 0; } -static int snd_intel8x0_free(intel8x0_t *chip) +static int snd_intel8x0_free(struct intel8x0 *chip) { unsigned int i; @@ -2325,7 +2376,7 @@ static int snd_intel8x0_free(intel8x0_t *chip) synchronize_irq(chip->irq); __hw_end: if (chip->irq >= 0) - free_irq(chip->irq, (void *)chip); + free_irq(chip->irq, chip); if (chip->bdbars.area) { if (chip->fix_nocache) fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 0); @@ -2345,9 +2396,9 @@ static int snd_intel8x0_free(intel8x0_t *chip) /* * power management */ -static int intel8x0_suspend(snd_card_t *card, pm_message_t state) +static int intel8x0_suspend(struct snd_card *card, pm_message_t state) { - intel8x0_t *chip = card->pm_private_data; + struct intel8x0 *chip = card->pm_private_data; int i; for (i = 0; i < chip->pcm_devs; i++) @@ -2355,9 +2406,9 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state) /* clear nocache */ if (chip->fix_nocache) { for (i = 0; i < chip->bdbars_count; i++) { - ichdev_t *ichdev = &chip->ichd[i]; + struct ichdev *ichdev = &chip->ichd[i]; if (ichdev->substream && ichdev->page_attr_changed) { - snd_pcm_runtime_t *runtime = ichdev->substream->runtime; + struct snd_pcm_runtime *runtime = ichdev->substream->runtime; if (runtime->dma_area) fill_nocache(runtime->dma_area, runtime->dma_bytes, 0); } @@ -2370,19 +2421,20 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state) chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); if (chip->irq >= 0) - free_irq(chip->irq, (void *)chip); + free_irq(chip->irq, chip); pci_disable_device(chip->pci); return 0; } -static int intel8x0_resume(snd_card_t *card) +static int intel8x0_resume(struct snd_card *card) { - intel8x0_t *chip = card->pm_private_data; + struct intel8x0 *chip = card->pm_private_data; int i; pci_enable_device(chip->pci); pci_set_master(chip->pci); - request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip); + request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, + card->shortname, chip); synchronize_irq(chip->irq); snd_intel8x0_chip_init(chip, 1); @@ -2407,9 +2459,9 @@ static int intel8x0_resume(snd_card_t *card) /* refill nocache */ if (chip->fix_nocache) { for (i = 0; i < chip->bdbars_count; i++) { - ichdev_t *ichdev = &chip->ichd[i]; + struct ichdev *ichdev = &chip->ichd[i]; if (ichdev->substream && ichdev->page_attr_changed) { - snd_pcm_runtime_t *runtime = ichdev->substream->runtime; + struct snd_pcm_runtime *runtime = ichdev->substream->runtime; if (runtime->dma_area) fill_nocache(runtime->dma_area, runtime->dma_bytes, 1); } @@ -2418,7 +2470,7 @@ static int intel8x0_resume(snd_card_t *card) /* resume status */ for (i = 0; i < chip->bdbars_count; i++) { - ichdev_t *ichdev = &chip->ichd[i]; + struct ichdev *ichdev = &chip->ichd[i]; unsigned long port = ichdev->reg_offset; if (! ichdev->substream || ! ichdev->suspended) continue; @@ -2436,10 +2488,10 @@ static int intel8x0_resume(snd_card_t *card) #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ -static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip) +static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip) { - snd_pcm_substream_t *subs; - ichdev_t *ichdev; + struct snd_pcm_substream *subs; + struct ichdev *ichdev; unsigned long port; unsigned long pos, t; struct timeval start_time, stop_time; @@ -2516,10 +2568,10 @@ static void __devinit intel8x0_measure_ac97_clock(intel8x0_t *chip) printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock); } -static void snd_intel8x0_proc_read(snd_info_entry_t * entry, - snd_info_buffer_t * buffer) +static void snd_intel8x0_proc_read(struct snd_info_entry * entry, + struct snd_info_buffer *buffer) { - intel8x0_t *chip = entry->private_data; + struct intel8x0 *chip = entry->private_data; unsigned int tmp; snd_iprintf(buffer, "Intel8x0\n\n"); @@ -2542,17 +2594,17 @@ static void snd_intel8x0_proc_read(snd_info_entry_t * entry, chip->ac97_sdin[2]); } -static void __devinit snd_intel8x0_proc_init(intel8x0_t * chip) +static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; if (! snd_card_proc_new(chip->card, "intel8x0", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read); } -static int snd_intel8x0_dev_free(snd_device_t *device) +static int snd_intel8x0_dev_free(struct snd_device *device) { - intel8x0_t *chip = device->device_data; + struct intel8x0 *chip = device->device_data; return snd_intel8x0_free(chip); } @@ -2561,17 +2613,17 @@ struct ich_reg_info { unsigned int offset; }; -static int __devinit snd_intel8x0_create(snd_card_t * card, +static int __devinit snd_intel8x0_create(struct snd_card *card, struct pci_dev *pci, unsigned long device_type, - intel8x0_t ** r_intel8x0) + struct intel8x0 ** r_intel8x0) { - intel8x0_t *chip; + struct intel8x0 *chip; int err; unsigned int i; unsigned int int_sta_masks; - ichdev_t *ichdev; - static snd_device_ops_t ops = { + struct ichdev *ichdev; + static struct snd_device_ops ops = { .dev_free = snd_intel8x0_dev_free, }; @@ -2734,7 +2786,7 @@ static int __devinit snd_intel8x0_create(snd_card_t * card, /* request irq after initializaing int_sta_mask, etc */ if (request_irq(pci->irq, snd_intel8x0_interrupt, - SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) { + SA_INTERRUPT|SA_SHIRQ, card->shortname, chip)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_intel8x0_free(chip); return -EBUSY; @@ -2793,8 +2845,8 @@ static struct shortname_table { static int __devinit snd_intel8x0_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - snd_card_t *card; - intel8x0_t *chip; + struct snd_card *card; + struct intel8x0 *chip; int err; struct shortname_table *name; diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 3244df9c1e9..3b6724e02e4 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -38,7 +38,8 @@ #include MODULE_AUTHOR("Jaroslav Kysela "); -MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; SiS 7013; NVidia MCP/2/2S/3 modems"); +MODULE_DESCRIPTION("Intel 82801AA,82901AB,i810,i820,i830,i840,i845,MX440; " + "SiS 7013; NVidia MCP/2/2S/3 modems"); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH}," "{Intel,82901AB-ICH0}," @@ -163,14 +164,14 @@ DEFINE_REGSET(OFF, 0); /* offset */ enum { ICHD_MDMIN, ICHD_MDMOUT, ICHD_MDMLAST = ICHD_MDMOUT }; enum { ALID_MDMIN, ALID_MDMOUT, ALID_MDMLAST = ALID_MDMOUT }; -#define get_ichdev(substream) (ichdev_t *)(substream->runtime->private_data) +#define get_ichdev(substream) (substream->runtime->private_data) -typedef struct { +struct ichdev { unsigned int ichd; /* ich device number */ unsigned long reg_offset; /* offset to bmaddr */ u32 *bdbar; /* CPU address (32bit) */ unsigned int bdbar_addr; /* PCI bus address (32bit) */ - snd_pcm_substream_t *substream; + struct snd_pcm_substream *substream; unsigned int physbuf; /* physical address (32bit) */ unsigned int size; unsigned int fragsize; @@ -187,12 +188,10 @@ typedef struct { unsigned int roff_picb; unsigned int int_sta_mask; /* interrupt status mask */ unsigned int ali_slot; /* ALI DMA slot */ - ac97_t *ac97; -} ichdev_t; - -typedef struct _snd_intel8x0m intel8x0_t; + struct snd_ac97 *ac97; +}; -struct _snd_intel8x0m { +struct intel8x0m { unsigned int device_type; int irq; @@ -205,16 +204,16 @@ struct _snd_intel8x0m { void __iomem *remap_bmaddr; struct pci_dev *pci; - snd_card_t *card; + struct snd_card *card; int pcm_devs; - snd_pcm_t *pcm[2]; - ichdev_t ichd[2]; + struct snd_pcm *pcm[2]; + struct ichdev ichd[2]; unsigned int in_ac97_init: 1; - ac97_bus_t *ac97_bus; - ac97_t *ac97; + struct snd_ac97_bus *ac97_bus; + struct snd_ac97 *ac97; spinlock_t reg_lock; @@ -254,7 +253,7 @@ MODULE_DEVICE_TABLE(pci, snd_intel8x0m_ids); * Lowlevel I/O - busmaster */ -static u8 igetbyte(intel8x0_t *chip, u32 offset) +static u8 igetbyte(struct intel8x0m *chip, u32 offset) { if (chip->bm_mmio) return readb(chip->remap_bmaddr + offset); @@ -262,7 +261,7 @@ static u8 igetbyte(intel8x0_t *chip, u32 offset) return inb(chip->bmaddr + offset); } -static u16 igetword(intel8x0_t *chip, u32 offset) +static u16 igetword(struct intel8x0m *chip, u32 offset) { if (chip->bm_mmio) return readw(chip->remap_bmaddr + offset); @@ -270,7 +269,7 @@ static u16 igetword(intel8x0_t *chip, u32 offset) return inw(chip->bmaddr + offset); } -static u32 igetdword(intel8x0_t *chip, u32 offset) +static u32 igetdword(struct intel8x0m *chip, u32 offset) { if (chip->bm_mmio) return readl(chip->remap_bmaddr + offset); @@ -278,7 +277,7 @@ static u32 igetdword(intel8x0_t *chip, u32 offset) return inl(chip->bmaddr + offset); } -static void iputbyte(intel8x0_t *chip, u32 offset, u8 val) +static void iputbyte(struct intel8x0m *chip, u32 offset, u8 val) { if (chip->bm_mmio) writeb(val, chip->remap_bmaddr + offset); @@ -286,7 +285,7 @@ static void iputbyte(intel8x0_t *chip, u32 offset, u8 val) outb(val, chip->bmaddr + offset); } -static void iputword(intel8x0_t *chip, u32 offset, u16 val) +static void iputword(struct intel8x0m *chip, u32 offset, u16 val) { if (chip->bm_mmio) writew(val, chip->remap_bmaddr + offset); @@ -294,7 +293,7 @@ static void iputword(intel8x0_t *chip, u32 offset, u16 val) outw(val, chip->bmaddr + offset); } -static void iputdword(intel8x0_t *chip, u32 offset, u32 val) +static void iputdword(struct intel8x0m *chip, u32 offset, u32 val) { if (chip->bm_mmio) writel(val, chip->remap_bmaddr + offset); @@ -306,7 +305,7 @@ static void iputdword(intel8x0_t *chip, u32 offset, u32 val) * Lowlevel I/O - AC'97 registers */ -static u16 iagetword(intel8x0_t *chip, u32 offset) +static u16 iagetword(struct intel8x0m *chip, u32 offset) { if (chip->mmio) return readw(chip->remap_addr + offset); @@ -314,7 +313,7 @@ static u16 iagetword(intel8x0_t *chip, u32 offset) return inw(chip->addr + offset); } -static void iaputword(intel8x0_t *chip, u32 offset, u16 val) +static void iaputword(struct intel8x0m *chip, u32 offset, u16 val) { if (chip->mmio) writew(val, chip->remap_addr + offset); @@ -331,7 +330,7 @@ static void iaputword(intel8x0_t *chip, u32 offset, u16 val) */ /* return the GLOB_STA bit for the corresponding codec */ -static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec) +static unsigned int get_ich_codec_bit(struct intel8x0m *chip, unsigned int codec) { static unsigned int codec_bit[3] = { ICH_PCR, ICH_SCR, ICH_TCR @@ -340,7 +339,7 @@ static unsigned int get_ich_codec_bit(intel8x0_t *chip, unsigned int codec) return codec_bit[codec]; } -static int snd_intel8x0m_codec_semaphore(intel8x0_t *chip, unsigned int codec) +static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int codec) { int time; @@ -370,11 +369,11 @@ static int snd_intel8x0m_codec_semaphore(intel8x0_t *chip, unsigned int codec) return -EBUSY; } -static void snd_intel8x0_codec_write(ac97_t *ac97, +static void snd_intel8x0_codec_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0m *chip = ac97->private_data; if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) { if (! chip->in_ac97_init) @@ -383,10 +382,10 @@ static void snd_intel8x0_codec_write(ac97_t *ac97, iaputword(chip, reg + ac97->num * 0x80, val); } -static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, +static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97, unsigned short reg) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0m *chip = ac97->private_data; unsigned short res; unsigned int tmp; @@ -398,7 +397,8 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, res = iagetword(chip, reg + ac97->num * 0x80); if ((tmp = igetdword(chip, ICHREG(GLOB_STA))) & ICH_RCS) { /* reset RCS and preserve other R/WC bits */ - iputdword(chip, ICHREG(GLOB_STA), tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); + iputdword(chip, ICHREG(GLOB_STA), + tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI)); if (! chip->in_ac97_init) snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg); res = 0xffff; @@ -413,7 +413,7 @@ static unsigned short snd_intel8x0_codec_read(ac97_t *ac97, /* * DMA I/O */ -static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev) +static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev) { int idx; u32 *bdbar = ichdev->bdbar; @@ -460,7 +460,7 @@ static void snd_intel8x0_setup_periods(intel8x0_t *chip, ichdev_t *ichdev) * Interrupt handler */ -static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) +static inline void snd_intel8x0_update(struct intel8x0m *chip, struct ichdev *ichdev) { unsigned long port = ichdev->reg_offset; int civ, i, step; @@ -489,8 +489,15 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) for (i = 0; i < step; i++) { ichdev->lvi_frag++; ichdev->lvi_frag %= ichdev->frags; - ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1); - // printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), inl(port + 4), inb(port + ICH_REG_OFF_CR)); + ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + + ichdev->lvi_frag * + ichdev->fragsize1); +#if 0 + printk("new: bdbar[%i] = 0x%x [0x%x], prefetch = %i, all = 0x%x, 0x%x\n", + ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2], + ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port), + inl(port + 4), inb(port + ICH_REG_OFF_CR)); +#endif if (--ichdev->ack == 0) { ichdev->ack = ichdev->ack_reload; ack = 1; @@ -506,8 +513,8 @@ static inline void snd_intel8x0_update(intel8x0_t *chip, ichdev_t *ichdev) static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - intel8x0_t *chip = dev_id; - ichdev_t *ichdev; + struct intel8x0m *chip = dev_id; + struct ichdev *ichdev; unsigned int status; unsigned int i; @@ -541,10 +548,10 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs * PCM part */ -static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd) +static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); unsigned char val = 0; unsigned long port = ichdev->reg_offset; @@ -576,21 +583,21 @@ static int snd_intel8x0_pcm_trigger(snd_pcm_substream_t *substream, int cmd) return 0; } -static int snd_intel8x0_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_intel8x0_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_intel8x0_hw_free(snd_pcm_substream_t * substream) +static int snd_intel8x0_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); + struct ichdev *ichdev = get_ichdev(substream); size_t ptr1, ptr; ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift; @@ -604,11 +611,11 @@ static snd_pcm_uframes_t snd_intel8x0_pcm_pointer(snd_pcm_substream_t * substrea return bytes_to_frames(substream->runtime, ptr); } -static int snd_intel8x0m_pcm_prepare(snd_pcm_substream_t * substream) +static int snd_intel8x0m_pcm_prepare(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - ichdev_t *ichdev = get_ichdev(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct ichdev *ichdev = get_ichdev(substream); ichdev->physbuf = runtime->dma_addr; ichdev->size = snd_pcm_lib_buffer_bytes(substream); @@ -619,7 +626,7 @@ static int snd_intel8x0m_pcm_prepare(snd_pcm_substream_t * substream) return 0; } -static snd_pcm_hardware_t snd_intel8x0m_stream = +static struct snd_pcm_hardware snd_intel8x0m_stream = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -641,58 +648,59 @@ static snd_pcm_hardware_t snd_intel8x0m_stream = }; -static int snd_intel8x0m_pcm_open(snd_pcm_substream_t * substream, ichdev_t *ichdev) +static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev) { static unsigned int rates[] = { 8000, 9600, 12000, 16000 }; - static snd_pcm_hw_constraint_list_t hw_constraints_rates = { + static struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, }; - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; int err; ichdev->substream = substream; runtime->hw = snd_intel8x0m_stream; - err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); + err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, + &hw_constraints_rates); if ( err < 0 ) return err; runtime->private_data = ichdev; return 0; } -static int snd_intel8x0m_playback_open(snd_pcm_substream_t * substream) +static int snd_intel8x0m_playback_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); return snd_intel8x0m_pcm_open(substream, &chip->ichd[ICHD_MDMOUT]); } -static int snd_intel8x0m_playback_close(snd_pcm_substream_t * substream) +static int snd_intel8x0m_playback_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_MDMOUT].substream = NULL; return 0; } -static int snd_intel8x0m_capture_open(snd_pcm_substream_t * substream) +static int snd_intel8x0m_capture_open(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); return snd_intel8x0m_pcm_open(substream, &chip->ichd[ICHD_MDMIN]); } -static int snd_intel8x0m_capture_close(snd_pcm_substream_t * substream) +static int snd_intel8x0m_capture_close(struct snd_pcm_substream *substream) { - intel8x0_t *chip = snd_pcm_substream_chip(substream); + struct intel8x0m *chip = snd_pcm_substream_chip(substream); chip->ichd[ICHD_MDMIN].substream = NULL; return 0; } -static snd_pcm_ops_t snd_intel8x0m_playback_ops = { +static struct snd_pcm_ops snd_intel8x0m_playback_ops = { .open = snd_intel8x0m_playback_open, .close = snd_intel8x0m_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -703,7 +711,7 @@ static snd_pcm_ops_t snd_intel8x0m_playback_ops = { .pointer = snd_intel8x0_pcm_pointer, }; -static snd_pcm_ops_t snd_intel8x0m_capture_ops = { +static struct snd_pcm_ops snd_intel8x0m_capture_ops = { .open = snd_intel8x0m_capture_open, .close = snd_intel8x0m_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -717,16 +725,17 @@ static snd_pcm_ops_t snd_intel8x0m_capture_ops = { struct ich_pcm_table { char *suffix; - snd_pcm_ops_t *playback_ops; - snd_pcm_ops_t *capture_ops; + struct snd_pcm_ops *playback_ops; + struct snd_pcm_ops *capture_ops; size_t prealloc_size; size_t prealloc_max_size; int ac97_idx; }; -static int __devinit snd_intel8x0_pcm1(intel8x0_t *chip, int device, struct ich_pcm_table *rec) +static int __devinit snd_intel8x0_pcm1(struct intel8x0m *chip, int device, + struct ich_pcm_table *rec) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; char name[32]; @@ -772,7 +781,7 @@ static struct ich_pcm_table intel_pcms[] __devinitdata = { }, }; -static int __devinit snd_intel8x0_pcm(intel8x0_t *chip) +static int __devinit snd_intel8x0_pcm(struct intel8x0m *chip) { int i, tblsize, device, err; struct ich_pcm_table *tbl, *rec; @@ -819,27 +828,27 @@ static int __devinit snd_intel8x0_pcm(intel8x0_t *chip) * Mixer part */ -static void snd_intel8x0_mixer_free_ac97_bus(ac97_bus_t *bus) +static void snd_intel8x0_mixer_free_ac97_bus(struct snd_ac97_bus *bus) { - intel8x0_t *chip = bus->private_data; + struct intel8x0m *chip = bus->private_data; chip->ac97_bus = NULL; } -static void snd_intel8x0_mixer_free_ac97(ac97_t *ac97) +static void snd_intel8x0_mixer_free_ac97(struct snd_ac97 *ac97) { - intel8x0_t *chip = ac97->private_data; + struct intel8x0m *chip = ac97->private_data; chip->ac97 = NULL; } -static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) +static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock) { - ac97_bus_t *pbus; - ac97_template_t ac97; - ac97_t *x97; + struct snd_ac97_bus *pbus; + struct snd_ac97_template ac97; + struct snd_ac97 *x97; int err; unsigned int glob_sta = 0; - static ac97_bus_ops_t ops = { + static struct snd_ac97_bus_ops ops = { .write = snd_intel8x0_codec_write, .read = snd_intel8x0_codec_read, }; @@ -880,7 +889,8 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) __err: /* clear the cold-reset bit for the next chance */ if (chip->device_type != DEVICE_ALI) - iputdword(chip, ICHREG(GLOB_CNT), igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD); + iputdword(chip, ICHREG(GLOB_CNT), + igetdword(chip, ICHREG(GLOB_CNT)) & ~ICH_AC97COLD); return err; } @@ -889,7 +899,7 @@ static int __devinit snd_intel8x0_mixer(intel8x0_t *chip, int ac97_clock) * */ -static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) +static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing) { unsigned long end_time; unsigned int cnt, status, nstatus; @@ -912,7 +922,8 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) goto __ok; schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); - snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); + snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", + igetdword(chip, ICHREG(GLOB_CNT))); return -EIO; __ok: @@ -923,14 +934,16 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) */ end_time = jiffies + HZ; do { - status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); + status = igetdword(chip, ICHREG(GLOB_STA)) & + (ICH_PCR | ICH_SCR | ICH_TCR); if (status) break; schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); if (! status) { /* no codec is found */ - snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", igetdword(chip, ICHREG(GLOB_STA))); + snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", + igetdword(chip, ICHREG(GLOB_STA))); return -EIO; } @@ -952,7 +965,8 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) /* wait until all the probed codecs are ready */ end_time = jiffies + HZ; do { - nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR); + nstatus = igetdword(chip, ICHREG(GLOB_STA)) & + (ICH_PCR | ICH_SCR | ICH_TCR); if (status == nstatus) break; schedule_timeout_uninterruptible(1); @@ -967,7 +981,7 @@ static int snd_intel8x0m_ich_chip_init(intel8x0_t *chip, int probing) return 0; } -static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing) +static int snd_intel8x0_chip_init(struct intel8x0m *chip, int probing) { unsigned int i; int err; @@ -988,7 +1002,7 @@ static int snd_intel8x0_chip_init(intel8x0_t *chip, int probing) return 0; } -static int snd_intel8x0_free(intel8x0_t *chip) +static int snd_intel8x0_free(struct intel8x0m *chip) { unsigned int i; @@ -1010,7 +1024,7 @@ static int snd_intel8x0_free(intel8x0_t *chip) if (chip->remap_bmaddr) iounmap(chip->remap_bmaddr); if (chip->irq >= 0) - free_irq(chip->irq, (void *)chip); + free_irq(chip->irq, chip); pci_release_regions(chip->pci); pci_disable_device(chip->pci); kfree(chip); @@ -1021,9 +1035,9 @@ static int snd_intel8x0_free(intel8x0_t *chip) /* * power management */ -static int intel8x0m_suspend(snd_card_t *card, pm_message_t state) +static int intel8x0m_suspend(struct snd_card *card, pm_message_t state) { - intel8x0_t *chip = card->pm_private_data; + struct intel8x0m *chip = card->pm_private_data; int i; for (i = 0; i < chip->pcm_devs; i++) @@ -1034,9 +1048,9 @@ static int intel8x0m_suspend(snd_card_t *card, pm_message_t state) return 0; } -static int intel8x0m_resume(snd_card_t *card) +static int intel8x0m_resume(struct snd_card *card) { - intel8x0_t *chip = card->pm_private_data; + struct intel8x0m *chip = card->pm_private_data; pci_enable_device(chip->pci); pci_set_master(chip->pci); snd_intel8x0_chip_init(chip, 0); @@ -1047,17 +1061,18 @@ static int intel8x0m_resume(snd_card_t *card) } #endif /* CONFIG_PM */ -static void snd_intel8x0m_proc_read(snd_info_entry_t * entry, - snd_info_buffer_t * buffer) +static void snd_intel8x0m_proc_read(struct snd_info_entry * entry, + struct snd_info_buffer *buffer) { - intel8x0_t *chip = entry->private_data; + struct intel8x0m *chip = entry->private_data; unsigned int tmp; snd_iprintf(buffer, "Intel8x0m\n\n"); if (chip->device_type == DEVICE_ALI) return; tmp = igetdword(chip, ICHREG(GLOB_STA)); - snd_iprintf(buffer, "Global control : 0x%08x\n", igetdword(chip, ICHREG(GLOB_CNT))); + snd_iprintf(buffer, "Global control : 0x%08x\n", + igetdword(chip, ICHREG(GLOB_CNT))); snd_iprintf(buffer, "Global status : 0x%08x\n", tmp); snd_iprintf(buffer, "AC'97 codecs ready :%s%s%s%s\n", tmp & ICH_PCR ? " primary" : "", @@ -1066,17 +1081,17 @@ static void snd_intel8x0m_proc_read(snd_info_entry_t * entry, (tmp & (ICH_PCR | ICH_SCR | ICH_TCR)) == 0 ? " none" : ""); } -static void __devinit snd_intel8x0m_proc_init(intel8x0_t * chip) +static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; if (! snd_card_proc_new(chip->card, "intel8x0m", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0m_proc_read); } -static int snd_intel8x0_dev_free(snd_device_t *device) +static int snd_intel8x0_dev_free(struct snd_device *device) { - intel8x0_t *chip = device->device_data; + struct intel8x0m *chip = device->device_data; return snd_intel8x0_free(chip); } @@ -1085,17 +1100,17 @@ struct ich_reg_info { unsigned int offset; }; -static int __devinit snd_intel8x0m_create(snd_card_t * card, +static int __devinit snd_intel8x0m_create(struct snd_card *card, struct pci_dev *pci, unsigned long device_type, - intel8x0_t ** r_intel8x0) + struct intel8x0m ** r_intel8x0) { - intel8x0_t *chip; + struct intel8x0m *chip; int err; unsigned int i; unsigned int int_sta_masks; - ichdev_t *ichdev; - static snd_device_ops_t ops = { + struct ichdev *ichdev; + static struct snd_device_ops ops = { .dev_free = snd_intel8x0_dev_free, }; static struct ich_reg_info intel_regs[2] = { @@ -1160,7 +1175,8 @@ static int __devinit snd_intel8x0m_create(snd_card_t * card, } port_inited: - if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip)) { + if (request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, + card->shortname, chip)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_intel8x0_free(chip); return -EBUSY; @@ -1259,8 +1275,8 @@ static struct shortname_table { static int __devinit snd_intel8x0m_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - snd_card_t *card; - intel8x0_t *chip; + struct snd_card *card; + struct intel8x0m *chip; int err; struct shortname_table *name; -- cgit v1.2.3-70-g09d2 From 5809c6c41ae95ce3f45ad14d31503deb1fa8268a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 16:10:01 +0100 Subject: [ALSA] intel8x0 - Fix PM support Modules: Intel8x0 driver,Intel8x0-modem driver Fix PM support on Intel8x0 and modem drivers. Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 37 ++++++++++++++++++++++--------------- sound/pci/intel8x0m.c | 35 +++++++++++++++++++++-------------- 2 files changed, 43 insertions(+), 29 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 3ea90f1e22e..c5c4ec64a15 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2396,11 +2396,13 @@ static int snd_intel8x0_free(struct intel8x0 *chip) /* * power management */ -static int intel8x0_suspend(struct snd_card *card, pm_message_t state) +static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) { - struct intel8x0 *chip = card->pm_private_data; + struct snd_card *card = pci_get_drvdata(pci); + struct intel8x0 *chip = card->private_data; int i; + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); for (i = 0; i < chip->pcm_devs; i++) snd_pcm_suspend_all(chip->pcm[i]); /* clear nocache */ @@ -2415,26 +2417,29 @@ static int intel8x0_suspend(struct snd_card *card, pm_message_t state) } } for (i = 0; i < 3; i++) - if (chip->ac97[i]) - snd_ac97_suspend(chip->ac97[i]); + snd_ac97_suspend(chip->ac97[i]); if (chip->device_type == DEVICE_INTEL_ICH4) chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); if (chip->irq >= 0) free_irq(chip->irq, chip); - pci_disable_device(chip->pci); + pci_disable_device(pci); + pci_save_state(pci); return 0; } -static int intel8x0_resume(struct snd_card *card) +static int intel8x0_resume(struct pci_dev *pci) { - struct intel8x0 *chip = card->pm_private_data; + struct snd_card *card = pci_get_drvdata(pci); + struct intel8x0 *chip = card->private_data; int i; - pci_enable_device(chip->pci); - pci_set_master(chip->pci); - request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, + pci_restore_state(pci); + pci_enable_device(pci); + pci_set_master(pci); + request_irq(pci->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, chip); + chip->irq = pci->irq; synchronize_irq(chip->irq); snd_intel8x0_chip_init(chip, 1); @@ -2453,8 +2458,7 @@ static int intel8x0_resume(struct snd_card *card) fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 1); for (i = 0; i < 3; i++) - if (chip->ac97[i]) - snd_ac97_resume(chip->ac97[i]); + snd_ac97_resume(chip->ac97[i]); /* refill nocache */ if (chip->fix_nocache) { @@ -2482,6 +2486,7 @@ static int intel8x0_resume(struct snd_card *card) iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI); } + snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } #endif /* CONFIG_PM */ @@ -2800,8 +2805,6 @@ static int __devinit snd_intel8x0_create(struct snd_card *card, return err; } - snd_card_set_pm_callback(card, intel8x0_suspend, intel8x0_resume, chip); - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { snd_intel8x0_free(chip); return err; @@ -2889,6 +2892,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci, snd_card_free(card); return err; } + card->private_data = chip; if ((err = snd_intel8x0_mixer(chip, ac97_clock, ac97_quirk)) < 0) { snd_card_free(card); @@ -2927,7 +2931,10 @@ static struct pci_driver driver = { .id_table = snd_intel8x0_ids, .probe = snd_intel8x0_probe, .remove = __devexit_p(snd_intel8x0_remove), - SND_PCI_PM_CALLBACKS +#ifdef CONFIG_PM + .suspend = intel8x0_suspend, + .resume = intel8x0_resume, +#endif }; diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 3b6724e02e4..466170e1216 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -1035,28 +1035,33 @@ static int snd_intel8x0_free(struct intel8x0m *chip) /* * power management */ -static int intel8x0m_suspend(struct snd_card *card, pm_message_t state) +static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state) { - struct intel8x0m *chip = card->pm_private_data; + struct snd_card *card = pci_get_drvdata(pci); + struct intel8x0m *chip = card->private_data; int i; + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); for (i = 0; i < chip->pcm_devs; i++) snd_pcm_suspend_all(chip->pcm[i]); - if (chip->ac97) - snd_ac97_suspend(chip->ac97); - pci_disable_device(chip->pci); + snd_ac97_suspend(chip->ac97); + pci_disable_device(pci); + pci_save_state(pci); return 0; } -static int intel8x0m_resume(struct snd_card *card) +static int intel8x0m_resume(struct pci_dev *pci) { - struct intel8x0m *chip = card->pm_private_data; - pci_enable_device(chip->pci); - pci_set_master(chip->pci); + struct snd_card *card = pci_get_drvdata(pci); + struct intel8x0m *chip = card->private_data; + + pci_restore_state(pci); + pci_enable_device(pci); + pci_set_master(pci); snd_intel8x0_chip_init(chip, 0); - if (chip->ac97) - snd_ac97_resume(chip->ac97); + snd_ac97_resume(chip->ac97); + snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } #endif /* CONFIG_PM */ @@ -1233,8 +1238,6 @@ static int __devinit snd_intel8x0m_create(struct snd_card *card, return err; } - snd_card_set_pm_callback(card, intel8x0m_suspend, intel8x0m_resume, chip); - if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { snd_intel8x0_free(chip); return err; @@ -1298,6 +1301,7 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci, snd_card_free(card); return err; } + card->private_data = chip; if ((err = snd_intel8x0_mixer(chip, ac97_clock)) < 0) { snd_card_free(card); @@ -1332,7 +1336,10 @@ static struct pci_driver driver = { .id_table = snd_intel8x0m_ids, .probe = snd_intel8x0m_probe, .remove = __devexit_p(snd_intel8x0m_remove), - SND_PCI_PM_CALLBACKS +#ifdef CONFIG_PM + .suspend = intel8x0m_suspend, + .resume = intel8x0m_resume, +#endif }; -- cgit v1.2.3-70-g09d2 From 2eb061f41cf74f829bfe90a9c79c765172be9f0b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 18 Nov 2005 07:44:13 +0100 Subject: [ALSA] intel8x0 - Added swap_hp quirk for Fujitsu-Siemens Celsius H320 [0x10cf:0x12f2] Modules: Intel8x0 driver Signed-off-by: Jaroslav Kysela --- sound/pci/intel8x0.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index c5c4ec64a15..5bbc8a04753 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1911,6 +1911,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "Fujitsu-Siemens 4010", .type = AC97_TUNE_HP_ONLY }, + { + .subvendor = 0x10cf, + .subdevice = 0x12f2, + .name = "Fujitsu-Siemens Celsius H320", + .type = AC97_TUNE_SWAP_HP + }, { .subvendor = 0x10f1, .subdevice = 0x2665, -- cgit v1.2.3-70-g09d2 From adf1b3d25e50dbab48fdd21006bea2dd5a4cb3a8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 1 Dec 2005 10:49:58 +0100 Subject: [ALSA] Optimize for config without PROC_FS (pci drivers) Optimize the code when compiled without CONFIG_PROC_FS for some pci drivers. Signed-off-by: Takashi Iwai --- sound/pci/ac97/ac97_codec.c | 38 ++----------------------------------- sound/pci/ac97/ac97_local.h | 1 - sound/pci/ac97/ac97_proc.c | 36 +++++++++++++++++++++++++++++++++++ sound/pci/ac97/ak4531_codec.c | 8 +++++++- sound/pci/atiixp.c | 5 ++++- sound/pci/atiixp_modem.c | 5 ++++- sound/pci/ca0106/ca0106_main.c | 2 ++ sound/pci/ca0106/ca0106_proc.c | 3 +++ sound/pci/cs46xx/cs46xx_lib.c | 5 +++++ sound/pci/cs46xx/cs46xx_lib.h | 10 ++++++++++ sound/pci/cs46xx/dsp_spos.c | 2 ++ sound/pci/cs46xx/dsp_spos_scb_lib.c | 4 ++++ sound/pci/emu10k1/emu10k1_main.c | 2 ++ sound/pci/emu10k1/emuproc.c | 2 ++ sound/pci/intel8x0.c | 4 ++++ sound/pci/intel8x0m.c | 5 +++++ 16 files changed, 92 insertions(+), 40 deletions(-) (limited to 'sound/pci/intel8x0.c') diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index abc83fa85bc..17c3ddac35c 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -184,42 +184,6 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { { 0, 0, NULL, NULL, NULL } }; -const char *snd_ac97_stereo_enhancements[] = -{ - /* 0 */ "No 3D Stereo Enhancement", - /* 1 */ "Analog Devices Phat Stereo", - /* 2 */ "Creative Stereo Enhancement", - /* 3 */ "National Semi 3D Stereo Enhancement", - /* 4 */ "YAMAHA Ymersion", - /* 5 */ "BBE 3D Stereo Enhancement", - /* 6 */ "Crystal Semi 3D Stereo Enhancement", - /* 7 */ "Qsound QXpander", - /* 8 */ "Spatializer 3D Stereo Enhancement", - /* 9 */ "SRS 3D Stereo Enhancement", - /* 10 */ "Platform Tech 3D Stereo Enhancement", - /* 11 */ "AKM 3D Audio", - /* 12 */ "Aureal Stereo Enhancement", - /* 13 */ "Aztech 3D Enhancement", - /* 14 */ "Binaura 3D Audio Enhancement", - /* 15 */ "ESS Technology Stereo Enhancement", - /* 16 */ "Harman International VMAx", - /* 17 */ "Nvidea/IC Ensemble/KS Waves 3D Stereo Enhancement", - /* 18 */ "Philips Incredible Sound", - /* 19 */ "Texas Instruments 3D Stereo Enhancement", - /* 20 */ "VLSI Technology 3D Stereo Enhancement", - /* 21 */ "TriTech 3D Stereo Enhancement", - /* 22 */ "Realtek 3D Stereo Enhancement", - /* 23 */ "Samsung 3D Stereo Enhancement", - /* 24 */ "Wolfson Microelectronics 3D Enhancement", - /* 25 */ "Delta Integration 3D Enhancement", - /* 26 */ "SigmaTel 3D Enhancement", - /* 27 */ "IC Ensemble/KS Waves", - /* 28 */ "Rockwell 3D Stereo Enhancement", - /* 29 */ "Reserved 29", - /* 30 */ "Reserved 30", - /* 31 */ "Reserved 31" -}; - /* * I/O routines @@ -1895,10 +1859,12 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, init_MUTEX(&ac97->reg_mutex); init_MUTEX(&ac97->page_mutex); +#ifdef CONFIG_PCI if (ac97->pci) { pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor); pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device); } +#endif if (bus->ops->reset) { bus->ops->reset(ac97); goto __access_ok; diff --git a/sound/pci/ac97/ac97_local.h b/sound/pci/ac97/ac97_local.h index e98587e027d..a6244c720a1 100644 --- a/sound/pci/ac97/ac97_local.h +++ b/sound/pci/ac97/ac97_local.h @@ -57,7 +57,6 @@ struct ac97_enum { .private_value = (unsigned long)&xenum } /* ac97_codec.c */ -extern const char *snd_ac97_stereo_enhancements[]; extern const struct snd_kcontrol_new snd_ac97_controls_3d[]; extern const struct snd_kcontrol_new snd_ac97_controls_spdif[]; struct snd_kcontrol *snd_ac97_cnew(const struct snd_kcontrol_new *_template, struct snd_ac97 * ac97); diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c index 26607320129..7134b3f55fb 100644 --- a/sound/pci/ac97/ac97_proc.c +++ b/sound/pci/ac97/ac97_proc.c @@ -68,6 +68,42 @@ static void snd_ac97_proc_read_functions(struct snd_ac97 *ac97, struct snd_info_ } } +static const char *snd_ac97_stereo_enhancements[] = +{ + /* 0 */ "No 3D Stereo Enhancement", + /* 1 */ "Analog Devices Phat Stereo", + /* 2 */ "Creative Stereo Enhancement", + /* 3 */ "National Semi 3D Stereo Enhancement", + /* 4 */ "YAMAHA Ymersion", + /* 5 */ "BBE 3D Stereo Enhancement", + /* 6 */ "Crystal Semi 3D Stereo Enhancement", + /* 7 */ "Qsound QXpander", + /* 8 */ "Spatializer 3D Stereo Enhancement", + /* 9 */ "SRS 3D Stereo Enhancement", + /* 10 */ "Platform Tech 3D Stereo Enhancement", + /* 11 */ "AKM 3D Audio", + /* 12 */ "Aureal Stereo Enhancement", + /* 13 */ "Aztech 3D Enhancement", + /* 14 */ "Binaura 3D Audio Enhancement", + /* 15 */ "ESS Technology Stereo Enhancement", + /* 16 */ "Harman International VMAx", + /* 17 */ "Nvidea/IC Ensemble/KS Waves 3D Stereo Enhancement", + /* 18 */ "Philips Incredible Sound", + /* 19 */ "Texas Instruments 3D Stereo Enhancement", + /* 20 */ "VLSI Technology 3D Stereo Enhancement", + /* 21 */ "TriTech 3D Stereo Enhancement", + /* 22 */ "Realtek 3D Stereo Enhancement", + /* 23 */ "Samsung 3D Stereo Enhancement", + /* 24 */ "Wolfson Microelectronics 3D Enhancement", + /* 25 */ "Delta Integration 3D Enhancement", + /* 26 */ "SigmaTel 3D Enhancement", + /* 27 */ "IC Ensemble/KS Waves", + /* 28 */ "Rockwell 3D Stereo Enhancement", + /* 29 */ "Reserved 29", + /* 30 */ "Reserved 30", + /* 31 */ "Reserved 31" +}; + static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffer *buffer, int subidx) { char name[64]; diff --git a/sound/pci/ac97/ak4531_codec.c b/sound/pci/ac97/ak4531_codec.c index 3eb885584e9..dcfb5036ff8 100644 --- a/sound/pci/ac97/ak4531_codec.c +++ b/sound/pci/ac97/ak4531_codec.c @@ -30,7 +30,11 @@ MODULE_AUTHOR("Jaroslav Kysela "); MODULE_DESCRIPTION("Universal routines for AK4531 codec"); MODULE_LICENSE("GPL"); +#ifdef CONFIG_PROC_FS static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531); +#else +#define snd_ak4531_proc_init(card,ak) +#endif /* * @@ -425,8 +429,9 @@ void snd_ak4531_resume(struct snd_ak4531 *ak4531) } #endif +#ifdef CONFIG_PROC_FS /* - + * /proc interface */ static void snd_ak4531_proc_read(struct snd_info_entry *entry, @@ -448,6 +453,7 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453 if (! snd_card_proc_new(card, "ak4531", &entry)) snd_info_set_text_ops(entry, ak4531, 1024, snd_ak4531_proc_read); } +#endif EXPORT_SYMBOL(snd_ak4531_mixer); #ifdef CONFIG_PM diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index a039284c7c5..33e0664a192 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1477,6 +1477,7 @@ static int snd_atiixp_resume(struct pci_dev *pci) #endif /* CONFIG_PM */ +#ifdef CONFIG_PROC_FS /* * proc interface for register dump */ @@ -1498,7 +1499,9 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip) if (! snd_card_proc_new(chip->card, "atiixp", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read); } - +#else /* !CONFIG_PROC_FS */ +#define snd_atiixp_proc_init(chip) +#endif /* diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 73f1f2b1a35..8d8fd5a4ed3 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1156,6 +1156,7 @@ static int snd_atiixp_resume(struct pci_dev *pci) #endif /* CONFIG_PM */ +#ifdef CONFIG_PROC_FS /* * proc interface for register dump */ @@ -1177,7 +1178,9 @@ static void __devinit snd_atiixp_proc_init(struct atiixp_modem *chip) if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read); } - +#else +#define snd_atiixp_proc_init(chip) +#endif /* diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 744f9718372..5964cdc93f7 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -1456,7 +1456,9 @@ static int __devinit snd_ca0106_probe(struct pci_dev *pci, } snd_printdd(" done.\n"); +#ifdef CONFIG_PROC_FS snd_ca0106_proc_init(chip); +#endif if ((err = snd_card_register(card)) < 0) { snd_card_free(card); diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c index 94b62259938..63757273bfb 100644 --- a/sound/pci/ca0106/ca0106_proc.c +++ b/sound/pci/ca0106/ca0106_proc.c @@ -77,6 +77,8 @@ #include "ca0106.h" +#ifdef CONFIG_PROC_FS + struct snd_ca0106_category_str { int val; const char *name; @@ -459,3 +461,4 @@ int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu) return 0; } +#endif /* CONFIG_PROC_FS */ diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 0ec0592a6e6..8fb275d6eb7 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2747,6 +2747,7 @@ int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; } static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { } #endif /* CONFIG_GAMEPORT */ +#ifdef CONFIG_PROC_FS /* * proc interface */ @@ -2800,6 +2801,10 @@ static int snd_cs46xx_proc_done(struct snd_cs46xx *chip) #endif return 0; } +#else /* !CONFIG_PROC_FS */ +#define snd_cs46xx_proc_init(card, chip) +#define snd_cs46xx_proc_done(chip) +#endif /* * stop the h/w diff --git a/sound/pci/cs46xx/cs46xx_lib.h b/sound/pci/cs46xx/cs46xx_lib.h index 8b4a4aeaf85..f75750c2bd2 100644 --- a/sound/pci/cs46xx/cs46xx_lib.h +++ b/sound/pci/cs46xx/cs46xx_lib.h @@ -88,8 +88,13 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip); int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module); struct dsp_symbol_entry *cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type); +#ifdef CONFIG_PROC_FS int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip); int cs46xx_dsp_proc_done (struct snd_cs46xx *chip); +#else +#define cs46xx_dsp_proc_init(card, chip) +#define cs46xx_dsp_proc_done(chip) +#endif int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip); int snd_cs46xx_download (struct snd_cs46xx *chip, u32 *src, unsigned long offset, unsigned long len); @@ -106,9 +111,14 @@ int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip); int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data); struct dsp_scb_descriptor * cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest); +#ifdef CONFIG_PROC_FS void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb); void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb); +#else +#define cs46xx_dsp_proc_free_scb_desc(scb) +#define cs46xx_dsp_proc_register_scb_desc(chip, scb) +#endif struct dsp_scb_descriptor * cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip); struct dsp_scb_descriptor * cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index ac98917a147..445a448949e 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -439,6 +439,7 @@ cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symb } +#ifdef CONFIG_PROC_FS static struct dsp_symbol_entry * cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type) { @@ -912,6 +913,7 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) return 0; } +#endif /* CONFIG_PROC_FS */ static int debug_tree; static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data, diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 6e865005b26..509aa2b6333 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -64,6 +64,7 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s } +#ifdef CONFIG_PROC_FS static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry, struct snd_info_buffer *buffer) { @@ -106,6 +107,7 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry, snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count); up(&chip->spos_mutex); } +#endif static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb) { @@ -220,6 +222,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * } +#ifdef CONFIG_PROC_FS void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb) { if (scb->proc_info) { @@ -275,6 +278,7 @@ out: scb->proc_info = entry; } } +#endif /* CONFIG_PROC_FS */ static struct dsp_scb_descriptor * _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest, diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index cc36b748d9a..175f8aac8de 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1076,7 +1076,9 @@ int __devinit snd_emu10k1_create(struct snd_card *card, if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, emu, &ops)) < 0) goto error; +#ifdef CONFIG_PROC_FS snd_emu10k1_proc_init(emu); +#endif snd_card_set_dev(card, &pci->dev); *remu = emu; diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c index b88137f9165..90f1c52703a 100644 --- a/sound/pci/emu10k1/emuproc.c +++ b/sound/pci/emu10k1/emuproc.c @@ -32,6 +32,7 @@ #include #include "p16v.h" +#ifdef CONFIG_PROC_FS static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu, struct snd_info_buffer *buffer, char *title, @@ -620,3 +621,4 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu) } return 0; } +#endif /* CONFIG_PROC_FS */ diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 5bbc8a04753..d3a4e5e8e04 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2579,6 +2579,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip) printk(KERN_INFO "intel8x0: clocking to %d\n", chip->ac97_bus->clock); } +#ifdef CONFIG_PROC_FS static void snd_intel8x0_proc_read(struct snd_info_entry * entry, struct snd_info_buffer *buffer) { @@ -2612,6 +2613,9 @@ static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip) if (! snd_card_proc_new(chip->card, "intel8x0", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read); } +#else +#define snd_intel8x0_proc_init(x) +#endif static int snd_intel8x0_dev_free(struct snd_device *device) { diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 466170e1216..47e26aaa9ad 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -1066,6 +1066,7 @@ static int intel8x0m_resume(struct pci_dev *pci) } #endif /* CONFIG_PM */ +#ifdef CONFIG_PROC_FS static void snd_intel8x0m_proc_read(struct snd_info_entry * entry, struct snd_info_buffer *buffer) { @@ -1093,6 +1094,10 @@ static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip) if (! snd_card_proc_new(chip->card, "intel8x0m", &entry)) snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0m_proc_read); } +#else /* !CONFIG_PROC_FS */ +#define snd_intel8x0m_proc_init(chip) +#endif /* CONFIG_PROC_FS */ + static int snd_intel8x0_dev_free(struct snd_device *device) { -- cgit v1.2.3-70-g09d2 From a0faefedf7d81b6ead6a33e5576a6439606d7ed5 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 6 Dec 2005 13:59:12 +0100 Subject: [ALSA] Add a new quirk for mute-LED and HP-only. Modules: AC97 Codec,ATIIXP driver,Intel8x0 driver This patch adds a new quirk for ac97 hardware that combines the existing AC97_TUNE_MUTE_LED and AC97_TUNE_HP_ONLY quirks. This is needed for several current HP laptops. Additionally, it adds the HP nx6125 to the AC97_TUNE_MUTE_LED list. Fixed for the latest version of ALSA by Takashi Iwai . Signed-off-by: Matthew Garrett Signed-off-by: Takashi Iwai --- include/sound/ac97_codec.h | 1 + sound/pci/ac97/ac97_codec.c | 36 ++++++++++++++++++++++++++++++++++++ sound/pci/atiixp.c | 6 ++++++ sound/pci/intel8x0.c | 24 ++++++++++++++++++++++++ 4 files changed, 67 insertions(+) (limited to 'sound/pci/intel8x0.c') diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index a1814cd9549..b0b3ea7b365 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -541,6 +541,7 @@ enum { AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */ AC97_TUNE_INV_EAPD, /* inverted EAPD implementation */ AC97_TUNE_MUTE_LED, /* EAPD bit works as mute LED */ + AC97_TUNE_HP_MUTE_LED, /* EAPD bit works as mute LED, use headphone control as master */ }; struct ac97_quirk { diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 33d7a1fc2f9..3020ca2b602 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -2457,6 +2457,41 @@ static int tune_mute_led(struct snd_ac97 *ac97) return 0; } +static int hp_master_mute_sw_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + int err = bind_hp_volsw_put(kcontrol, ucontrol); + if (err > 0) { + struct snd_ac97 *ac97 = snd_kcontrol_chip(kcontrol); + int shift = (kcontrol->private_value >> 8) & 0x0f; + int rshift = (kcontrol->private_value >> 12) & 0x0f; + unsigned short mask; + if (shift != rshift) + mask = 0x8080; + else + mask = 0x8000; + snd_ac97_update_bits(ac97, AC97_POWERDOWN, 0x8000, + (ac97->regs[AC97_MASTER] & mask) == mask ? + 0x8000 : 0); + } + return err; +} + +static int tune_hp_mute_led(struct snd_ac97 *ac97) +{ + struct snd_kcontrol *msw = ctl_find(ac97, "Master Playback Switch", NULL); + struct snd_kcontrol *mvol = ctl_find(ac97, "Master Playback Volume", NULL); + if (! msw || ! mvol) + return -ENOENT; + msw->put = hp_master_mute_sw_put; + mvol->put = bind_hp_volsw_put; + snd_ac97_remove_ctl(ac97, "External Amplifier", NULL); + snd_ac97_remove_ctl(ac97, "Headphone Playback", "Switch"); + snd_ac97_remove_ctl(ac97, "Headphone Playback", "Volume"); + snd_ac97_update_bits(ac97, AC97_POWERDOWN, 0x8000, 0x8000); /* mute LED on */ + return 0; +} + struct quirk_table { const char *name; int (*func)(struct snd_ac97 *); @@ -2471,6 +2506,7 @@ static struct quirk_table applicable_quirks[] = { { "alc_jack", tune_alc_jack }, { "inv_eapd", tune_inv_eapd }, { "mute_led", tune_mute_led }, + { "hp_mute_led", tune_hp_mute_led }, }; /* apply the quirk with the given type */ diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 33e0664a192..b7217adaf1d 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1353,6 +1353,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "HP Pavilion ZV5030US", .type = AC97_TUNE_MUTE_LED }, + { + .subvendor = 0x103c, + .subdevice = 0x308b, + .name = "HP nx6125", + .type = AC97_TUNE_MUTE_LED + }, { } /* terminator */ }; diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index d3a4e5e8e04..5466b1fa0cd 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1857,6 +1857,30 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "HP xw8000", .type = AC97_TUNE_HP_ONLY }, + { + .subvendor = 0x103c, + .subdevice = 0x0938, + .name = "HP nc4200", + .type = AC97_TUNE_HP_MUTE_LED + }, + { + .subvendor = 0x103c, + .subdevice = 0x099c, + .name = "HP nc6120", + .type = AC97_TUNE_HP_MUTE_LED + }, + { + .subvendor = 0x103c, + .subdevice = 0x0944, + .name = "HP nc6220", + .type = AC97_TUNE_HP_MUTE_LED + }, + { + .subvendor = 0x103c, + .subdevice = 0x0934, + .name = "HP nc8220", + .type = AC97_TUNE_HP_MUTE_LED + }, { .subvendor = 0x103c, .subdevice = 0x12f1, -- cgit v1.2.3-70-g09d2