diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 4 | ||||
-rw-r--r-- | sound/core/pcm_misc.c | 18 | ||||
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 86 | ||||
-rw-r--r-- | sound/isa/wss/wss_lib.c | 5 | ||||
-rw-r--r-- | sound/oss/swarm_cs4297a.c | 17 | ||||
-rw-r--r-- | sound/pci/au88x0/au88x0_mixer.c | 11 | ||||
-rw-r--r-- | sound/pci/es1938.c | 25 | ||||
-rw-r--r-- | sound/pci/maestro3.c | 68 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 63 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr.h | 1 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr_core.c | 27 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr_core.h | 4 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr_mix22.c | 11 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr_mix22.h | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/device.c | 2 | ||||
-rw-r--r-- | sound/usb/mixer_quirks.c | 159 |
16 files changed, 335 insertions, 167 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 8f312fa6c282..7ae671923393 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -1250,10 +1250,10 @@ static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params, | |||
1250 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, | 1250 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
1251 | unsigned int cond, | 1251 | unsigned int cond, |
1252 | snd_pcm_hw_param_t var, | 1252 | snd_pcm_hw_param_t var, |
1253 | struct snd_pcm_hw_constraint_list *l) | 1253 | const struct snd_pcm_hw_constraint_list *l) |
1254 | { | 1254 | { |
1255 | return snd_pcm_hw_rule_add(runtime, cond, var, | 1255 | return snd_pcm_hw_rule_add(runtime, cond, var, |
1256 | snd_pcm_hw_rule_list, l, | 1256 | snd_pcm_hw_rule_list, (void *)l, |
1257 | var, -1); | 1257 | var, -1); |
1258 | } | 1258 | } |
1259 | 1259 | ||
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index 9c9eff9afbac..d4fc1bfbe457 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c | |||
@@ -488,3 +488,21 @@ unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) | |||
488 | return SNDRV_PCM_RATE_KNOT; | 488 | return SNDRV_PCM_RATE_KNOT; |
489 | } | 489 | } |
490 | EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit); | 490 | EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit); |
491 | |||
492 | /** | ||
493 | * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate | ||
494 | * @rate_bit: the rate bit to convert | ||
495 | * | ||
496 | * Returns the sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag | ||
497 | * or 0 for an unknown rate bit | ||
498 | */ | ||
499 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit) | ||
500 | { | ||
501 | unsigned int i; | ||
502 | |||
503 | for (i = 0; i < snd_pcm_known_rates.count; i++) | ||
504 | if ((1u << i) == rate_bit) | ||
505 | return snd_pcm_known_rates.list[i]; | ||
506 | return 0; | ||
507 | } | ||
508 | EXPORT_SYMBOL(snd_pcm_rate_bit_to_rate); | ||
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d7ccf28bd66a..f8fbe22515c9 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -135,10 +135,9 @@ struct snd_opti9xx { | |||
135 | unsigned long mc_base_size; | 135 | unsigned long mc_base_size; |
136 | #ifdef OPTi93X | 136 | #ifdef OPTi93X |
137 | unsigned long mc_indir_index; | 137 | unsigned long mc_indir_index; |
138 | unsigned long mc_indir_size; | ||
139 | struct resource *res_mc_indir; | 138 | struct resource *res_mc_indir; |
140 | struct snd_wss *codec; | ||
141 | #endif /* OPTi93X */ | 139 | #endif /* OPTi93X */ |
140 | struct snd_wss *codec; | ||
142 | unsigned long pwd_reg; | 141 | unsigned long pwd_reg; |
143 | 142 | ||
144 | spinlock_t lock; | 143 | spinlock_t lock; |
@@ -245,10 +244,8 @@ static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip, | |||
245 | case OPTi9XX_HW_82C931: | 244 | case OPTi9XX_HW_82C931: |
246 | case OPTi9XX_HW_82C933: | 245 | case OPTi9XX_HW_82C933: |
247 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; | 246 | chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; |
248 | if (!chip->mc_indir_index) { | 247 | if (!chip->mc_indir_index) |
249 | chip->mc_indir_index = 0xe0e; | 248 | chip->mc_indir_index = 0xe0e; |
250 | chip->mc_indir_size = 2; | ||
251 | } | ||
252 | chip->password = 0xe4; | 249 | chip->password = 0xe4; |
253 | chip->pwd_reg = 0; | 250 | chip->pwd_reg = 0; |
254 | break; | 251 | break; |
@@ -351,7 +348,7 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg, | |||
351 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) | 348 | (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) |
352 | 349 | ||
353 | 350 | ||
354 | static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip, | 351 | static int snd_opti9xx_configure(struct snd_opti9xx *chip, |
355 | long port, | 352 | long port, |
356 | int irq, int dma1, int dma2, | 353 | int irq, int dma1, int dma2, |
357 | long mpu_port, int mpu_irq) | 354 | long mpu_port, int mpu_irq) |
@@ -403,7 +400,9 @@ static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip, | |||
403 | 400 | ||
404 | #else /* OPTi93X */ | 401 | #else /* OPTi93X */ |
405 | case OPTi9XX_HW_82C931: | 402 | case OPTi9XX_HW_82C931: |
406 | case OPTi9XX_HW_82C933: | 403 | /* disable 3D sound (set GPIO1 as output, low) */ |
404 | snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(20), 0x04, 0x0c); | ||
405 | case OPTi9XX_HW_82C933: /* FALL THROUGH */ | ||
407 | /* | 406 | /* |
408 | * The BTC 1817DW has QS1000 wavetable which is connected | 407 | * The BTC 1817DW has QS1000 wavetable which is connected |
409 | * to the serial digital input of the OPTI931. | 408 | * to the serial digital input of the OPTI931. |
@@ -696,8 +695,7 @@ static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip) | |||
696 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) | 695 | if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) |
697 | return 0; | 696 | return 0; |
698 | #else /* OPTi93X */ | 697 | #else /* OPTi93X */ |
699 | chip->res_mc_indir = request_region(chip->mc_indir_index, | 698 | chip->res_mc_indir = request_region(chip->mc_indir_index, 2, |
700 | chip->mc_indir_size, | ||
701 | "OPTi93x MC"); | 699 | "OPTi93x MC"); |
702 | if (chip->res_mc_indir == NULL) | 700 | if (chip->res_mc_indir == NULL) |
703 | return -EBUSY; | 701 | return -EBUSY; |
@@ -770,8 +768,9 @@ static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip, | |||
770 | #ifdef OPTi93X | 768 | #ifdef OPTi93X |
771 | port = pnp_port_start(pdev, 0) - 4; | 769 | port = pnp_port_start(pdev, 0) - 4; |
772 | fm_port = pnp_port_start(pdev, 1) + 8; | 770 | fm_port = pnp_port_start(pdev, 1) + 8; |
773 | chip->mc_indir_index = pnp_port_start(pdev, 3) + 2; | 771 | /* adjust mc_indir_index - some cards report it at 0xe?d, |
774 | chip->mc_indir_size = pnp_port_len(pdev, 3) - 2; | 772 | other at 0xe?c but it really is always at 0xe?e */ |
773 | chip->mc_indir_index = (pnp_port_start(pdev, 3) & ~0xf) | 0xe; | ||
775 | #else | 774 | #else |
776 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); | 775 | devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); |
777 | if (devmc == NULL) | 776 | if (devmc == NULL) |
@@ -871,9 +870,7 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card) | |||
871 | &codec); | 870 | &codec); |
872 | if (error < 0) | 871 | if (error < 0) |
873 | return error; | 872 | return error; |
874 | #ifdef OPTi93X | ||
875 | chip->codec = codec; | 873 | chip->codec = codec; |
876 | #endif | ||
877 | error = snd_wss_pcm(codec, 0, &pcm); | 874 | error = snd_wss_pcm(codec, 0, &pcm); |
878 | if (error < 0) | 875 | if (error < 0) |
879 | return error; | 876 | return error; |
@@ -1054,11 +1051,55 @@ static int __devexit snd_opti9xx_isa_remove(struct device *devptr, | |||
1054 | return 0; | 1051 | return 0; |
1055 | } | 1052 | } |
1056 | 1053 | ||
1054 | #ifdef CONFIG_PM | ||
1055 | static int snd_opti9xx_suspend(struct snd_card *card) | ||
1056 | { | ||
1057 | struct snd_opti9xx *chip = card->private_data; | ||
1058 | |||
1059 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | ||
1060 | chip->codec->suspend(chip->codec); | ||
1061 | return 0; | ||
1062 | } | ||
1063 | |||
1064 | static int snd_opti9xx_resume(struct snd_card *card) | ||
1065 | { | ||
1066 | struct snd_opti9xx *chip = card->private_data; | ||
1067 | int error, xdma2; | ||
1068 | #if defined(CS4231) || defined(OPTi93X) | ||
1069 | xdma2 = dma2; | ||
1070 | #else | ||
1071 | xdma2 = -1; | ||
1072 | #endif | ||
1073 | |||
1074 | error = snd_opti9xx_configure(chip, port, irq, dma1, xdma2, | ||
1075 | mpu_port, mpu_irq); | ||
1076 | if (error) | ||
1077 | return error; | ||
1078 | chip->codec->resume(chip->codec); | ||
1079 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | ||
1080 | return 0; | ||
1081 | } | ||
1082 | |||
1083 | static int snd_opti9xx_isa_suspend(struct device *dev, unsigned int n, | ||
1084 | pm_message_t state) | ||
1085 | { | ||
1086 | return snd_opti9xx_suspend(dev_get_drvdata(dev)); | ||
1087 | } | ||
1088 | |||
1089 | static int snd_opti9xx_isa_resume(struct device *dev, unsigned int n) | ||
1090 | { | ||
1091 | return snd_opti9xx_resume(dev_get_drvdata(dev)); | ||
1092 | } | ||
1093 | #endif | ||
1094 | |||
1057 | static struct isa_driver snd_opti9xx_driver = { | 1095 | static struct isa_driver snd_opti9xx_driver = { |
1058 | .match = snd_opti9xx_isa_match, | 1096 | .match = snd_opti9xx_isa_match, |
1059 | .probe = snd_opti9xx_isa_probe, | 1097 | .probe = snd_opti9xx_isa_probe, |
1060 | .remove = __devexit_p(snd_opti9xx_isa_remove), | 1098 | .remove = __devexit_p(snd_opti9xx_isa_remove), |
1061 | /* FIXME: suspend/resume */ | 1099 | #ifdef CONFIG_PM |
1100 | .suspend = snd_opti9xx_isa_suspend, | ||
1101 | .resume = snd_opti9xx_isa_resume, | ||
1102 | #endif | ||
1062 | .driver = { | 1103 | .driver = { |
1063 | .name = DEV_NAME | 1104 | .name = DEV_NAME |
1064 | }, | 1105 | }, |
@@ -1124,12 +1165,29 @@ static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard) | |||
1124 | snd_opti9xx_pnp_is_probed = 0; | 1165 | snd_opti9xx_pnp_is_probed = 0; |
1125 | } | 1166 | } |
1126 | 1167 | ||
1168 | #ifdef CONFIG_PM | ||
1169 | static int snd_opti9xx_pnp_suspend(struct pnp_card_link *pcard, | ||
1170 | pm_message_t state) | ||
1171 | { | ||
1172 | return snd_opti9xx_suspend(pnp_get_card_drvdata(pcard)); | ||
1173 | } | ||
1174 | |||
1175 | static int snd_opti9xx_pnp_resume(struct pnp_card_link *pcard) | ||
1176 | { | ||
1177 | return snd_opti9xx_resume(pnp_get_card_drvdata(pcard)); | ||
1178 | } | ||
1179 | #endif | ||
1180 | |||
1127 | static struct pnp_card_driver opti9xx_pnpc_driver = { | 1181 | static struct pnp_card_driver opti9xx_pnpc_driver = { |
1128 | .flags = PNP_DRIVER_RES_DISABLE, | 1182 | .flags = PNP_DRIVER_RES_DISABLE, |
1129 | .name = "opti9xx", | 1183 | .name = "opti9xx", |
1130 | .id_table = snd_opti9xx_pnpids, | 1184 | .id_table = snd_opti9xx_pnpids, |
1131 | .probe = snd_opti9xx_pnp_probe, | 1185 | .probe = snd_opti9xx_pnp_probe, |
1132 | .remove = __devexit_p(snd_opti9xx_pnp_remove), | 1186 | .remove = __devexit_p(snd_opti9xx_pnp_remove), |
1187 | #ifdef CONFIG_PM | ||
1188 | .suspend = snd_opti9xx_pnp_suspend, | ||
1189 | .resume = snd_opti9xx_pnp_resume, | ||
1190 | #endif | ||
1133 | }; | 1191 | }; |
1134 | #endif | 1192 | #endif |
1135 | 1193 | ||
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 49c8a0c2442c..360b08b03e1d 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c | |||
@@ -1456,7 +1456,6 @@ static struct snd_pcm_hardware snd_wss_playback = | |||
1456 | { | 1456 | { |
1457 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 1457 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
1458 | SNDRV_PCM_INFO_MMAP_VALID | | 1458 | SNDRV_PCM_INFO_MMAP_VALID | |
1459 | SNDRV_PCM_INFO_RESUME | | ||
1460 | SNDRV_PCM_INFO_SYNC_START), | 1459 | SNDRV_PCM_INFO_SYNC_START), |
1461 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | | 1460 | .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | |
1462 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), | 1461 | SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), |
@@ -1657,6 +1656,10 @@ static void snd_wss_resume(struct snd_wss *chip) | |||
1657 | break; | 1656 | break; |
1658 | } | 1657 | } |
1659 | } | 1658 | } |
1659 | /* Yamaha needs this to resume properly */ | ||
1660 | if (chip->hardware == WSS_HW_OPL3SA2) | ||
1661 | snd_wss_out(chip, CS4231_PLAYBK_FORMAT, | ||
1662 | chip->image[CS4231_PLAYBK_FORMAT]); | ||
1660 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 1663 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
1661 | #if 1 | 1664 | #if 1 |
1662 | snd_wss_mce_down(chip); | 1665 | snd_wss_mce_down(chip); |
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c index 09d46484bc1a..7d8803a00b79 100644 --- a/sound/oss/swarm_cs4297a.c +++ b/sound/oss/swarm_cs4297a.c | |||
@@ -69,7 +69,6 @@ | |||
69 | #include <linux/sound.h> | 69 | #include <linux/sound.h> |
70 | #include <linux/slab.h> | 70 | #include <linux/slab.h> |
71 | #include <linux/soundcard.h> | 71 | #include <linux/soundcard.h> |
72 | #include <linux/ac97_codec.h> | ||
73 | #include <linux/pci.h> | 72 | #include <linux/pci.h> |
74 | #include <linux/bitops.h> | 73 | #include <linux/bitops.h> |
75 | #include <linux/interrupt.h> | 74 | #include <linux/interrupt.h> |
@@ -199,6 +198,22 @@ static const char invalid_magic[] = | |||
199 | } \ | 198 | } \ |
200 | }) | 199 | }) |
201 | 200 | ||
201 | /* AC97 registers */ | ||
202 | #define AC97_MASTER_VOL_STEREO 0x0002 /* Line Out */ | ||
203 | #define AC97_PCBEEP_VOL 0x000a /* none */ | ||
204 | #define AC97_PHONE_VOL 0x000c /* TAD Input (mono) */ | ||
205 | #define AC97_MIC_VOL 0x000e /* MIC Input (mono) */ | ||
206 | #define AC97_LINEIN_VOL 0x0010 /* Line Input (stereo) */ | ||
207 | #define AC97_CD_VOL 0x0012 /* CD Input (stereo) */ | ||
208 | #define AC97_AUX_VOL 0x0016 /* Aux Input (stereo) */ | ||
209 | #define AC97_PCMOUT_VOL 0x0018 /* Wave Output (stereo) */ | ||
210 | #define AC97_RECORD_SELECT 0x001a /* */ | ||
211 | #define AC97_RECORD_GAIN 0x001c | ||
212 | #define AC97_GENERAL_PURPOSE 0x0020 | ||
213 | #define AC97_3D_CONTROL 0x0022 | ||
214 | #define AC97_POWER_CONTROL 0x0026 | ||
215 | #define AC97_VENDOR_ID1 0x007c | ||
216 | |||
202 | struct list_head cs4297a_devs = { &cs4297a_devs, &cs4297a_devs }; | 217 | struct list_head cs4297a_devs = { &cs4297a_devs, &cs4297a_devs }; |
203 | 218 | ||
204 | typedef struct serdma_descr_s { | 219 | typedef struct serdma_descr_s { |
diff --git a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c index 557c782ae4fc..fa13efbebdaf 100644 --- a/sound/pci/au88x0/au88x0_mixer.c +++ b/sound/pci/au88x0/au88x0_mixer.c | |||
@@ -10,6 +10,15 @@ | |||
10 | #include <sound/core.h> | 10 | #include <sound/core.h> |
11 | #include "au88x0.h" | 11 | #include "au88x0.h" |
12 | 12 | ||
13 | static int remove_ctl(struct snd_card *card, const char *name) | ||
14 | { | ||
15 | struct snd_ctl_elem_id id; | ||
16 | memset(&id, 0, sizeof(id)); | ||
17 | strcpy(id.name, name); | ||
18 | id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; | ||
19 | return snd_ctl_remove_id(card, &id); | ||
20 | } | ||
21 | |||
13 | static int __devinit snd_vortex_mixer(vortex_t * vortex) | 22 | static int __devinit snd_vortex_mixer(vortex_t * vortex) |
14 | { | 23 | { |
15 | struct snd_ac97_bus *pbus; | 24 | struct snd_ac97_bus *pbus; |
@@ -28,5 +37,7 @@ static int __devinit snd_vortex_mixer(vortex_t * vortex) | |||
28 | ac97.scaps = AC97_SCAP_NO_SPDIF; | 37 | ac97.scaps = AC97_SCAP_NO_SPDIF; |
29 | err = snd_ac97_mixer(pbus, &ac97, &vortex->codec); | 38 | err = snd_ac97_mixer(pbus, &ac97, &vortex->codec); |
30 | vortex->isquad = ((vortex->codec == NULL) ? 0 : (vortex->codec->ext_id&0x80)); | 39 | vortex->isquad = ((vortex->codec == NULL) ? 0 : (vortex->codec->ext_id&0x80)); |
40 | remove_ctl(vortex->card, "Master Mono Playback Volume"); | ||
41 | remove_ctl(vortex->card, "Master Mono Playback Switch"); | ||
31 | return err; | 42 | return err; |
32 | } | 43 | } |
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 82c8d8c5c52a..a41106d745ca 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c | |||
@@ -1321,35 +1321,30 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol, | |||
1321 | return change; | 1321 | return change; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | static unsigned int db_scale_master[] = { | 1324 | static const DECLARE_TLV_DB_RANGE(db_scale_master, |
1325 | TLV_DB_RANGE_HEAD(2), | ||
1326 | 0, 54, TLV_DB_SCALE_ITEM(-3600, 50, 1), | 1325 | 0, 54, TLV_DB_SCALE_ITEM(-3600, 50, 1), |
1327 | 54, 63, TLV_DB_SCALE_ITEM(-900, 100, 0), | 1326 | 54, 63, TLV_DB_SCALE_ITEM(-900, 100, 0), |
1328 | }; | 1327 | ); |
1329 | 1328 | ||
1330 | static unsigned int db_scale_audio1[] = { | 1329 | static const DECLARE_TLV_DB_RANGE(db_scale_audio1, |
1331 | TLV_DB_RANGE_HEAD(2), | ||
1332 | 0, 8, TLV_DB_SCALE_ITEM(-3300, 300, 1), | 1330 | 0, 8, TLV_DB_SCALE_ITEM(-3300, 300, 1), |
1333 | 8, 15, TLV_DB_SCALE_ITEM(-900, 150, 0), | 1331 | 8, 15, TLV_DB_SCALE_ITEM(-900, 150, 0), |
1334 | }; | 1332 | ); |
1335 | 1333 | ||
1336 | static unsigned int db_scale_audio2[] = { | 1334 | static const DECLARE_TLV_DB_RANGE(db_scale_audio2, |
1337 | TLV_DB_RANGE_HEAD(2), | ||
1338 | 0, 8, TLV_DB_SCALE_ITEM(-3450, 300, 1), | 1335 | 0, 8, TLV_DB_SCALE_ITEM(-3450, 300, 1), |
1339 | 8, 15, TLV_DB_SCALE_ITEM(-1050, 150, 0), | 1336 | 8, 15, TLV_DB_SCALE_ITEM(-1050, 150, 0), |
1340 | }; | 1337 | ); |
1341 | 1338 | ||
1342 | static unsigned int db_scale_mic[] = { | 1339 | static const DECLARE_TLV_DB_RANGE(db_scale_mic, |
1343 | TLV_DB_RANGE_HEAD(2), | ||
1344 | 0, 8, TLV_DB_SCALE_ITEM(-2400, 300, 1), | 1340 | 0, 8, TLV_DB_SCALE_ITEM(-2400, 300, 1), |
1345 | 8, 15, TLV_DB_SCALE_ITEM(0, 150, 0), | 1341 | 8, 15, TLV_DB_SCALE_ITEM(0, 150, 0), |
1346 | }; | 1342 | ); |
1347 | 1343 | ||
1348 | static unsigned int db_scale_line[] = { | 1344 | static const DECLARE_TLV_DB_RANGE(db_scale_line, |
1349 | TLV_DB_RANGE_HEAD(2), | ||
1350 | 0, 8, TLV_DB_SCALE_ITEM(-3150, 300, 1), | 1345 | 0, 8, TLV_DB_SCALE_ITEM(-3150, 300, 1), |
1351 | 8, 15, TLV_DB_SCALE_ITEM(-750, 150, 0), | 1346 | 8, 15, TLV_DB_SCALE_ITEM(-750, 150, 0), |
1352 | }; | 1347 | ); |
1353 | 1348 | ||
1354 | static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0); | 1349 | static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0); |
1355 | 1350 | ||
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index deef21399586..adb3b4c7917e 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c | |||
@@ -361,74 +361,6 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)"); | |||
361 | #define DSP2HOST_REQ_I2SRATE 0x02 | 361 | #define DSP2HOST_REQ_I2SRATE 0x02 |
362 | #define DSP2HOST_REQ_TIMER 0x04 | 362 | #define DSP2HOST_REQ_TIMER 0x04 |
363 | 363 | ||
364 | /* AC97 registers */ | ||
365 | /* XXX fix this crap up */ | ||
366 | /*#define AC97_RESET 0x00*/ | ||
367 | |||
368 | #define AC97_VOL_MUTE_B 0x8000 | ||
369 | #define AC97_VOL_M 0x1F | ||
370 | #define AC97_LEFT_VOL_S 8 | ||
371 | |||
372 | #define AC97_MASTER_VOL 0x02 | ||
373 | #define AC97_LINE_LEVEL_VOL 0x04 | ||
374 | #define AC97_MASTER_MONO_VOL 0x06 | ||
375 | #define AC97_PC_BEEP_VOL 0x0A | ||
376 | #define AC97_PC_BEEP_VOL_M 0x0F | ||
377 | #define AC97_SROUND_MASTER_VOL 0x38 | ||
378 | #define AC97_PC_BEEP_VOL_S 1 | ||
379 | |||
380 | /*#define AC97_PHONE_VOL 0x0C | ||
381 | #define AC97_MIC_VOL 0x0E*/ | ||
382 | #define AC97_MIC_20DB_ENABLE 0x40 | ||
383 | |||
384 | /*#define AC97_LINEIN_VOL 0x10 | ||
385 | #define AC97_CD_VOL 0x12 | ||
386 | #define AC97_VIDEO_VOL 0x14 | ||
387 | #define AC97_AUX_VOL 0x16*/ | ||
388 | #define AC97_PCM_OUT_VOL 0x18 | ||
389 | /*#define AC97_RECORD_SELECT 0x1A*/ | ||
390 | #define AC97_RECORD_MIC 0x00 | ||
391 | #define AC97_RECORD_CD 0x01 | ||
392 | #define AC97_RECORD_VIDEO 0x02 | ||
393 | #define AC97_RECORD_AUX 0x03 | ||
394 | #define AC97_RECORD_MONO_MUX 0x02 | ||
395 | #define AC97_RECORD_DIGITAL 0x03 | ||
396 | #define AC97_RECORD_LINE 0x04 | ||
397 | #define AC97_RECORD_STEREO 0x05 | ||
398 | #define AC97_RECORD_MONO 0x06 | ||
399 | #define AC97_RECORD_PHONE 0x07 | ||
400 | |||
401 | /*#define AC97_RECORD_GAIN 0x1C*/ | ||
402 | #define AC97_RECORD_VOL_M 0x0F | ||
403 | |||
404 | /*#define AC97_GENERAL_PURPOSE 0x20*/ | ||
405 | #define AC97_POWER_DOWN_CTRL 0x26 | ||
406 | #define AC97_ADC_READY 0x0001 | ||
407 | #define AC97_DAC_READY 0x0002 | ||
408 | #define AC97_ANALOG_READY 0x0004 | ||
409 | #define AC97_VREF_ON 0x0008 | ||
410 | #define AC97_PR0 0x0100 | ||
411 | #define AC97_PR1 0x0200 | ||
412 | #define AC97_PR2 0x0400 | ||
413 | #define AC97_PR3 0x0800 | ||
414 | #define AC97_PR4 0x1000 | ||
415 | |||
416 | #define AC97_RESERVED1 0x28 | ||
417 | |||
418 | #define AC97_VENDOR_TEST 0x5A | ||
419 | |||
420 | #define AC97_CLOCK_DELAY 0x5C | ||
421 | #define AC97_LINEOUT_MUX_SEL 0x0001 | ||
422 | #define AC97_MONO_MUX_SEL 0x0002 | ||
423 | #define AC97_CLOCK_DELAY_SEL 0x1F | ||
424 | #define AC97_DAC_CDS_SHIFT 6 | ||
425 | #define AC97_ADC_CDS_SHIFT 11 | ||
426 | |||
427 | #define AC97_MULTI_CHANNEL_SEL 0x74 | ||
428 | |||
429 | /*#define AC97_VENDOR_ID1 0x7C | ||
430 | #define AC97_VENDOR_ID2 0x7E*/ | ||
431 | |||
432 | /* | 364 | /* |
433 | * ASSP control regs | 365 | * ASSP control regs |
434 | */ | 366 | */ |
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 0435f45e9513..e3ac1f768ff6 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
@@ -1368,6 +1368,67 @@ static void pcxhr_proc_gpo_write(struct snd_info_entry *entry, | |||
1368 | } | 1368 | } |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | /* Access to the results of the CMD_GET_TIME_CODE RMH */ | ||
1372 | #define TIME_CODE_VALID_MASK 0x00800000 | ||
1373 | #define TIME_CODE_NEW_MASK 0x00400000 | ||
1374 | #define TIME_CODE_BACK_MASK 0x00200000 | ||
1375 | #define TIME_CODE_WAIT_MASK 0x00100000 | ||
1376 | |||
1377 | /* Values for the CMD_MANAGE_SIGNAL RMH */ | ||
1378 | #define MANAGE_SIGNAL_TIME_CODE 0x01 | ||
1379 | #define MANAGE_SIGNAL_MIDI 0x02 | ||
1380 | |||
1381 | /* linear time code read proc*/ | ||
1382 | static void pcxhr_proc_ltc(struct snd_info_entry *entry, | ||
1383 | struct snd_info_buffer *buffer) | ||
1384 | { | ||
1385 | struct snd_pcxhr *chip = entry->private_data; | ||
1386 | struct pcxhr_mgr *mgr = chip->mgr; | ||
1387 | struct pcxhr_rmh rmh; | ||
1388 | unsigned int ltcHrs, ltcMin, ltcSec, ltcFrm; | ||
1389 | int err; | ||
1390 | /* commands available when embedded DSP is running */ | ||
1391 | if (!(mgr->dsp_loaded & (1 << PCXHR_FIRMWARE_DSP_MAIN_INDEX))) { | ||
1392 | snd_iprintf(buffer, "no firmware loaded\n"); | ||
1393 | return; | ||
1394 | } | ||
1395 | if (!mgr->capture_ltc) { | ||
1396 | pcxhr_init_rmh(&rmh, CMD_MANAGE_SIGNAL); | ||
1397 | rmh.cmd[0] |= MANAGE_SIGNAL_TIME_CODE; | ||
1398 | err = pcxhr_send_msg(mgr, &rmh); | ||
1399 | if (err) { | ||
1400 | snd_iprintf(buffer, "ltc not activated (%d)\n", err); | ||
1401 | return; | ||
1402 | } | ||
1403 | if (mgr->is_hr_stereo) | ||
1404 | hr222_manage_timecode(mgr, 1); | ||
1405 | else | ||
1406 | pcxhr_write_io_num_reg_cont(mgr, REG_CONT_VALSMPTE, | ||
1407 | REG_CONT_VALSMPTE, NULL); | ||
1408 | mgr->capture_ltc = 1; | ||
1409 | } | ||
1410 | pcxhr_init_rmh(&rmh, CMD_GET_TIME_CODE); | ||
1411 | err = pcxhr_send_msg(mgr, &rmh); | ||
1412 | if (err) { | ||
1413 | snd_iprintf(buffer, "ltc read error (err=%d)\n", err); | ||
1414 | return ; | ||
1415 | } | ||
1416 | ltcHrs = 10*((rmh.stat[0] >> 8) & 0x3) + (rmh.stat[0] & 0xf); | ||
1417 | ltcMin = 10*((rmh.stat[1] >> 16) & 0x7) + ((rmh.stat[1] >> 8) & 0xf); | ||
1418 | ltcSec = 10*(rmh.stat[1] & 0x7) + ((rmh.stat[2] >> 16) & 0xf); | ||
1419 | ltcFrm = 10*((rmh.stat[2] >> 8) & 0x3) + (rmh.stat[2] & 0xf); | ||
1420 | |||
1421 | snd_iprintf(buffer, "timecode: %02u:%02u:%02u-%02u\n", | ||
1422 | ltcHrs, ltcMin, ltcSec, ltcFrm); | ||
1423 | snd_iprintf(buffer, "raw: 0x%04x%06x%06x\n", rmh.stat[0] & 0x00ffff, | ||
1424 | rmh.stat[1] & 0xffffff, rmh.stat[2] & 0xffffff); | ||
1425 | /*snd_iprintf(buffer, "dsp ref time: 0x%06x%06x\n", | ||
1426 | rmh.stat[3] & 0xffffff, rmh.stat[4] & 0xffffff);*/ | ||
1427 | if (!(rmh.stat[0] & TIME_CODE_VALID_MASK)) { | ||
1428 | snd_iprintf(buffer, "warning: linear timecode not valid\n"); | ||
1429 | } | ||
1430 | } | ||
1431 | |||
1371 | static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip) | 1432 | static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip) |
1372 | { | 1433 | { |
1373 | struct snd_info_entry *entry; | 1434 | struct snd_info_entry *entry; |
@@ -1383,6 +1444,8 @@ static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip) | |||
1383 | entry->c.text.write = pcxhr_proc_gpo_write; | 1444 | entry->c.text.write = pcxhr_proc_gpo_write; |
1384 | entry->mode |= S_IWUSR; | 1445 | entry->mode |= S_IWUSR; |
1385 | } | 1446 | } |
1447 | if (!snd_card_proc_new(chip->card, "ltc", &entry)) | ||
1448 | snd_info_set_text_ops(entry, chip, pcxhr_proc_ltc); | ||
1386 | } | 1449 | } |
1387 | /* end of proc interface */ | 1450 | /* end of proc interface */ |
1388 | 1451 | ||
diff --git a/sound/pci/pcxhr/pcxhr.h b/sound/pci/pcxhr/pcxhr.h index bda776c49884..a4c602c45173 100644 --- a/sound/pci/pcxhr/pcxhr.h +++ b/sound/pci/pcxhr/pcxhr.h | |||
@@ -103,6 +103,7 @@ struct pcxhr_mgr { | |||
103 | unsigned int board_has_mic:1; /* if 1 the board has microphone input */ | 103 | unsigned int board_has_mic:1; /* if 1 the board has microphone input */ |
104 | unsigned int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */ | 104 | unsigned int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */ |
105 | unsigned int mono_capture:1; /* if 1 the board does mono capture */ | 105 | unsigned int mono_capture:1; /* if 1 the board does mono capture */ |
106 | unsigned int capture_ltc:1; /* if 1 the board captures LTC input */ | ||
106 | 107 | ||
107 | struct snd_dma_buffer hostport; | 108 | struct snd_dma_buffer hostport; |
108 | 109 | ||
diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c index 304411c1fe4b..b33db1e006e7 100644 --- a/sound/pci/pcxhr/pcxhr_core.c +++ b/sound/pci/pcxhr/pcxhr_core.c | |||
@@ -504,6 +504,8 @@ static struct pcxhr_cmd_info pcxhr_dsp_cmds[] = { | |||
504 | [CMD_FORMAT_STREAM_IN] = { 0x870000, 0, RMH_SSIZE_FIXED }, | 504 | [CMD_FORMAT_STREAM_IN] = { 0x870000, 0, RMH_SSIZE_FIXED }, |
505 | [CMD_STREAM_SAMPLE_COUNT] = { 0x902000, 2, RMH_SSIZE_FIXED }, | 505 | [CMD_STREAM_SAMPLE_COUNT] = { 0x902000, 2, RMH_SSIZE_FIXED }, |
506 | [CMD_AUDIO_LEVEL_ADJUST] = { 0xc22000, 0, RMH_SSIZE_FIXED }, | 506 | [CMD_AUDIO_LEVEL_ADJUST] = { 0xc22000, 0, RMH_SSIZE_FIXED }, |
507 | [CMD_GET_TIME_CODE] = { 0x060000, 5, RMH_SSIZE_FIXED }, | ||
508 | [CMD_MANAGE_SIGNAL] = { 0x0f0000, 0, RMH_SSIZE_FIXED }, | ||
507 | }; | 509 | }; |
508 | 510 | ||
509 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 511 | #ifdef CONFIG_SND_DEBUG_VERBOSE |
@@ -533,6 +535,8 @@ static char* cmd_names[] = { | |||
533 | [CMD_FORMAT_STREAM_IN] = "CMD_FORMAT_STREAM_IN", | 535 | [CMD_FORMAT_STREAM_IN] = "CMD_FORMAT_STREAM_IN", |
534 | [CMD_STREAM_SAMPLE_COUNT] = "CMD_STREAM_SAMPLE_COUNT", | 536 | [CMD_STREAM_SAMPLE_COUNT] = "CMD_STREAM_SAMPLE_COUNT", |
535 | [CMD_AUDIO_LEVEL_ADJUST] = "CMD_AUDIO_LEVEL_ADJUST", | 537 | [CMD_AUDIO_LEVEL_ADJUST] = "CMD_AUDIO_LEVEL_ADJUST", |
538 | [CMD_GET_TIME_CODE] = "CMD_GET_TIME_CODE", | ||
539 | [CMD_MANAGE_SIGNAL] = "CMD_MANAGE_SIGNAL", | ||
536 | }; | 540 | }; |
537 | #endif | 541 | #endif |
538 | 542 | ||
@@ -1133,13 +1137,12 @@ static u_int64_t pcxhr_stream_read_position(struct pcxhr_mgr *mgr, | |||
1133 | hw_sample_count = ((u_int64_t)rmh.stat[0]) << 24; | 1137 | hw_sample_count = ((u_int64_t)rmh.stat[0]) << 24; |
1134 | hw_sample_count += (u_int64_t)rmh.stat[1]; | 1138 | hw_sample_count += (u_int64_t)rmh.stat[1]; |
1135 | 1139 | ||
1136 | snd_printdd("stream %c%d : abs samples real(%ld) timer(%ld)\n", | 1140 | snd_printdd("stream %c%d : abs samples real(%llu) timer(%llu)\n", |
1137 | stream->pipe->is_capture ? 'C' : 'P', | 1141 | stream->pipe->is_capture ? 'C' : 'P', |
1138 | stream->substream->number, | 1142 | stream->substream->number, |
1139 | (long unsigned int)hw_sample_count, | 1143 | hw_sample_count, |
1140 | (long unsigned int)(stream->timer_abs_periods + | 1144 | stream->timer_abs_periods + stream->timer_period_frag + |
1141 | stream->timer_period_frag + | 1145 | mgr->granularity); |
1142 | mgr->granularity)); | ||
1143 | return hw_sample_count; | 1146 | return hw_sample_count; |
1144 | } | 1147 | } |
1145 | 1148 | ||
@@ -1243,10 +1246,18 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id) | |||
1243 | 1246 | ||
1244 | if ((dsp_time_diff < 0) && | 1247 | if ((dsp_time_diff < 0) && |
1245 | (mgr->dsp_time_last != PCXHR_DSP_TIME_INVALID)) { | 1248 | (mgr->dsp_time_last != PCXHR_DSP_TIME_INVALID)) { |
1246 | snd_printdd("ERROR DSP TIME old(%d) new(%d) -> " | 1249 | /* handle dsp counter wraparound without resync */ |
1247 | "resynchronize all streams\n", | 1250 | int tmp_diff = dsp_time_diff + PCXHR_DSP_TIME_MASK + 1; |
1251 | snd_printdd("WARNING DSP timestamp old(%d) new(%d)", | ||
1248 | mgr->dsp_time_last, dsp_time_new); | 1252 | mgr->dsp_time_last, dsp_time_new); |
1249 | mgr->dsp_time_err++; | 1253 | if (tmp_diff > 0 && tmp_diff <= (2*mgr->granularity)) { |
1254 | snd_printdd("-> timestamp wraparound OK: " | ||
1255 | "diff=%d\n", tmp_diff); | ||
1256 | dsp_time_diff = tmp_diff; | ||
1257 | } else { | ||
1258 | snd_printdd("-> resynchronize all streams\n"); | ||
1259 | mgr->dsp_time_err++; | ||
1260 | } | ||
1250 | } | 1261 | } |
1251 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 1262 | #ifdef CONFIG_SND_DEBUG_VERBOSE |
1252 | if (dsp_time_diff == 0) | 1263 | if (dsp_time_diff == 0) |
diff --git a/sound/pci/pcxhr/pcxhr_core.h b/sound/pci/pcxhr/pcxhr_core.h index be0173796cdb..a81ab6b811e7 100644 --- a/sound/pci/pcxhr/pcxhr_core.h +++ b/sound/pci/pcxhr/pcxhr_core.h | |||
@@ -79,6 +79,8 @@ enum { | |||
79 | CMD_FORMAT_STREAM_IN, /* cmd_len >= 4 stat_len = 0 */ | 79 | CMD_FORMAT_STREAM_IN, /* cmd_len >= 4 stat_len = 0 */ |
80 | CMD_STREAM_SAMPLE_COUNT, /* cmd_len = 2 stat_len = (2 * nb_stream) */ | 80 | CMD_STREAM_SAMPLE_COUNT, /* cmd_len = 2 stat_len = (2 * nb_stream) */ |
81 | CMD_AUDIO_LEVEL_ADJUST, /* cmd_len = 3 stat_len = 0 */ | 81 | CMD_AUDIO_LEVEL_ADJUST, /* cmd_len = 3 stat_len = 0 */ |
82 | CMD_GET_TIME_CODE, /* cmd_len = 1 stat_len = 5 */ | ||
83 | CMD_MANAGE_SIGNAL, /* cmd_len = 1 stat_len = 0 */ | ||
82 | CMD_LAST_INDEX | 84 | CMD_LAST_INDEX |
83 | }; | 85 | }; |
84 | 86 | ||
@@ -116,7 +118,7 @@ int pcxhr_send_msg(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh); | |||
116 | #define IO_NUM_REG_OUT_ANA_LEVEL 20 | 118 | #define IO_NUM_REG_OUT_ANA_LEVEL 20 |
117 | #define IO_NUM_REG_IN_ANA_LEVEL 21 | 119 | #define IO_NUM_REG_IN_ANA_LEVEL 21 |
118 | 120 | ||
119 | 121 | #define REG_CONT_VALSMPTE 0x000800 | |
120 | #define REG_CONT_UNMUTE_INPUTS 0x020000 | 122 | #define REG_CONT_UNMUTE_INPUTS 0x020000 |
121 | 123 | ||
122 | /* parameters used with register IO_NUM_REG_STATUS */ | 124 | /* parameters used with register IO_NUM_REG_STATUS */ |
diff --git a/sound/pci/pcxhr/pcxhr_mix22.c b/sound/pci/pcxhr/pcxhr_mix22.c index 1cb82c0a9cb3..84fe57626eba 100644 --- a/sound/pci/pcxhr/pcxhr_mix22.c +++ b/sound/pci/pcxhr/pcxhr_mix22.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #define PCXHR_DSP_RESET_DSP 0x01 | 53 | #define PCXHR_DSP_RESET_DSP 0x01 |
54 | #define PCXHR_DSP_RESET_MUTE 0x02 | 54 | #define PCXHR_DSP_RESET_MUTE 0x02 |
55 | #define PCXHR_DSP_RESET_CODEC 0x08 | 55 | #define PCXHR_DSP_RESET_CODEC 0x08 |
56 | #define PCXHR_DSP_RESET_SMPTE 0x10 | ||
56 | #define PCXHR_DSP_RESET_GPO_OFFSET 5 | 57 | #define PCXHR_DSP_RESET_GPO_OFFSET 5 |
57 | #define PCXHR_DSP_RESET_GPO_MASK 0x60 | 58 | #define PCXHR_DSP_RESET_GPO_MASK 0x60 |
58 | 59 | ||
@@ -527,6 +528,16 @@ int hr222_write_gpo(struct pcxhr_mgr *mgr, int value) | |||
527 | return 0; | 528 | return 0; |
528 | } | 529 | } |
529 | 530 | ||
531 | int hr222_manage_timecode(struct pcxhr_mgr *mgr, int enable) | ||
532 | { | ||
533 | if (enable) | ||
534 | mgr->dsp_reset |= PCXHR_DSP_RESET_SMPTE; | ||
535 | else | ||
536 | mgr->dsp_reset &= ~PCXHR_DSP_RESET_SMPTE; | ||
537 | |||
538 | PCXHR_OUTPB(mgr, PCXHR_DSP_RESET, mgr->dsp_reset); | ||
539 | return 0; | ||
540 | } | ||
530 | 541 | ||
531 | int hr222_update_analog_audio_level(struct snd_pcxhr *chip, | 542 | int hr222_update_analog_audio_level(struct snd_pcxhr *chip, |
532 | int is_capture, int channel) | 543 | int is_capture, int channel) |
diff --git a/sound/pci/pcxhr/pcxhr_mix22.h b/sound/pci/pcxhr/pcxhr_mix22.h index 5a37a0007e8f..5971b9933f41 100644 --- a/sound/pci/pcxhr/pcxhr_mix22.h +++ b/sound/pci/pcxhr/pcxhr_mix22.h | |||
@@ -34,6 +34,7 @@ int hr222_get_external_clock(struct pcxhr_mgr *mgr, | |||
34 | 34 | ||
35 | int hr222_read_gpio(struct pcxhr_mgr *mgr, int is_gpi, int *value); | 35 | int hr222_read_gpio(struct pcxhr_mgr *mgr, int is_gpi, int *value); |
36 | int hr222_write_gpo(struct pcxhr_mgr *mgr, int value); | 36 | int hr222_write_gpo(struct pcxhr_mgr *mgr, int value); |
37 | int hr222_manage_timecode(struct pcxhr_mgr *mgr, int enable); | ||
37 | 38 | ||
38 | #define HR222_LINE_PLAYBACK_LEVEL_MIN 0 /* -25.5 dB */ | 39 | #define HR222_LINE_PLAYBACK_LEVEL_MIN 0 /* -25.5 dB */ |
39 | #define HR222_LINE_PLAYBACK_ZERO_LEVEL 51 /* 0.0 dB */ | 40 | #define HR222_LINE_PLAYBACK_ZERO_LEVEL 51 /* 0.0 dB */ |
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 64aed432ae22..7da0d0aa72cb 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c | |||
@@ -485,7 +485,7 @@ static int __devinit snd_probe(struct usb_interface *intf, | |||
485 | const struct usb_device_id *id) | 485 | const struct usb_device_id *id) |
486 | { | 486 | { |
487 | int ret; | 487 | int ret; |
488 | struct snd_card *card; | 488 | struct snd_card *card = NULL; |
489 | struct usb_device *device = interface_to_usbdev(intf); | 489 | struct usb_device *device = interface_to_usbdev(intf); |
490 | 490 | ||
491 | ret = create_card(device, intf, &card); | 491 | ret = create_card(device, intf, &card); |
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 41f4b6911920..690000db0ec0 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -42,6 +42,13 @@ | |||
42 | 42 | ||
43 | extern struct snd_kcontrol_new *snd_usb_feature_unit_ctl; | 43 | extern struct snd_kcontrol_new *snd_usb_feature_unit_ctl; |
44 | 44 | ||
45 | struct std_mono_table { | ||
46 | unsigned int unitid, control, cmask; | ||
47 | int val_type; | ||
48 | const char *name; | ||
49 | snd_kcontrol_tlv_rw_t *tlv_callback; | ||
50 | }; | ||
51 | |||
45 | /* private_free callback */ | 52 | /* private_free callback */ |
46 | static void usb_mixer_elem_free(struct snd_kcontrol *kctl) | 53 | static void usb_mixer_elem_free(struct snd_kcontrol *kctl) |
47 | { | 54 | { |
@@ -114,6 +121,25 @@ static int snd_create_std_mono_ctl(struct usb_mixer_interface *mixer, | |||
114 | } | 121 | } |
115 | 122 | ||
116 | /* | 123 | /* |
124 | * Create a set of standard UAC controls from a table | ||
125 | */ | ||
126 | static int snd_create_std_mono_table(struct usb_mixer_interface *mixer, | ||
127 | struct std_mono_table *t) | ||
128 | { | ||
129 | int err; | ||
130 | |||
131 | while (t->name != NULL) { | ||
132 | err = snd_create_std_mono_ctl(mixer, t->unitid, t->control, | ||
133 | t->cmask, t->val_type, t->name, t->tlv_callback); | ||
134 | if (err < 0) | ||
135 | return err; | ||
136 | t++; | ||
137 | } | ||
138 | |||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | /* | ||
117 | * Sound Blaster remote control configuration | 143 | * Sound Blaster remote control configuration |
118 | * | 144 | * |
119 | * format of remote control data: | 145 | * format of remote control data: |
@@ -916,61 +942,6 @@ static int snd_ftu_create_mixer(struct usb_mixer_interface *mixer) | |||
916 | return 0; | 942 | return 0; |
917 | } | 943 | } |
918 | 944 | ||
919 | |||
920 | /* | ||
921 | * Create mixer for Electrix Ebox-44 | ||
922 | * | ||
923 | * The mixer units from this device are corrupt, and even where they | ||
924 | * are valid they presents mono controls as L and R channels of | ||
925 | * stereo. So we create a good mixer in code. | ||
926 | */ | ||
927 | |||
928 | static int snd_ebox44_create_mixer(struct usb_mixer_interface *mixer) | ||
929 | { | ||
930 | int err; | ||
931 | |||
932 | err = snd_create_std_mono_ctl(mixer, 4, 1, 0x0, USB_MIXER_INV_BOOLEAN, | ||
933 | "Headphone Playback Switch", NULL); | ||
934 | if (err < 0) | ||
935 | return err; | ||
936 | err = snd_create_std_mono_ctl(mixer, 4, 2, 0x1, USB_MIXER_S16, | ||
937 | "Headphone A Mix Playback Volume", NULL); | ||
938 | if (err < 0) | ||
939 | return err; | ||
940 | err = snd_create_std_mono_ctl(mixer, 4, 2, 0x2, USB_MIXER_S16, | ||
941 | "Headphone B Mix Playback Volume", NULL); | ||
942 | if (err < 0) | ||
943 | return err; | ||
944 | |||
945 | err = snd_create_std_mono_ctl(mixer, 7, 1, 0x0, USB_MIXER_INV_BOOLEAN, | ||
946 | "Output Playback Switch", NULL); | ||
947 | if (err < 0) | ||
948 | return err; | ||
949 | err = snd_create_std_mono_ctl(mixer, 7, 2, 0x1, USB_MIXER_S16, | ||
950 | "Output A Playback Volume", NULL); | ||
951 | if (err < 0) | ||
952 | return err; | ||
953 | err = snd_create_std_mono_ctl(mixer, 7, 2, 0x2, USB_MIXER_S16, | ||
954 | "Output B Playback Volume", NULL); | ||
955 | if (err < 0) | ||
956 | return err; | ||
957 | |||
958 | err = snd_create_std_mono_ctl(mixer, 10, 1, 0x0, USB_MIXER_INV_BOOLEAN, | ||
959 | "Input Capture Switch", NULL); | ||
960 | if (err < 0) | ||
961 | return err; | ||
962 | err = snd_create_std_mono_ctl(mixer, 10, 2, 0x1, USB_MIXER_S16, | ||
963 | "Input A Capture Volume", NULL); | ||
964 | if (err < 0) | ||
965 | return err; | ||
966 | err = snd_create_std_mono_ctl(mixer, 10, 2, 0x2, USB_MIXER_S16, | ||
967 | "Input B Capture Volume", NULL); | ||
968 | if (err < 0) | ||
969 | return err; | ||
970 | |||
971 | return 0; | ||
972 | } | ||
973 | |||
974 | void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, | 945 | void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, |
975 | unsigned char samplerate_id) | 946 | unsigned char samplerate_id) |
976 | { | 947 | { |
@@ -990,6 +961,81 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, | |||
990 | } | 961 | } |
991 | } | 962 | } |
992 | 963 | ||
964 | /* | ||
965 | * The mixer units for Ebox-44 are corrupt, and even where they | ||
966 | * are valid they presents mono controls as L and R channels of | ||
967 | * stereo. So we provide a good mixer here. | ||
968 | */ | ||
969 | struct std_mono_table ebox44_table[] = { | ||
970 | { | ||
971 | .unitid = 4, | ||
972 | .control = 1, | ||
973 | .cmask = 0x0, | ||
974 | .val_type = USB_MIXER_INV_BOOLEAN, | ||
975 | .name = "Headphone Playback Switch" | ||
976 | }, | ||
977 | { | ||
978 | .unitid = 4, | ||
979 | .control = 2, | ||
980 | .cmask = 0x1, | ||
981 | .val_type = USB_MIXER_S16, | ||
982 | .name = "Headphone A Mix Playback Volume" | ||
983 | }, | ||
984 | { | ||
985 | .unitid = 4, | ||
986 | .control = 2, | ||
987 | .cmask = 0x2, | ||
988 | .val_type = USB_MIXER_S16, | ||
989 | .name = "Headphone B Mix Playback Volume" | ||
990 | }, | ||
991 | |||
992 | { | ||
993 | .unitid = 7, | ||
994 | .control = 1, | ||
995 | .cmask = 0x0, | ||
996 | .val_type = USB_MIXER_INV_BOOLEAN, | ||
997 | .name = "Output Playback Switch" | ||
998 | }, | ||
999 | { | ||
1000 | .unitid = 7, | ||
1001 | .control = 2, | ||
1002 | .cmask = 0x1, | ||
1003 | .val_type = USB_MIXER_S16, | ||
1004 | .name = "Output A Playback Volume" | ||
1005 | }, | ||
1006 | { | ||
1007 | .unitid = 7, | ||
1008 | .control = 2, | ||
1009 | .cmask = 0x2, | ||
1010 | .val_type = USB_MIXER_S16, | ||
1011 | .name = "Output B Playback Volume" | ||
1012 | }, | ||
1013 | |||
1014 | { | ||
1015 | .unitid = 10, | ||
1016 | .control = 1, | ||
1017 | .cmask = 0x0, | ||
1018 | .val_type = USB_MIXER_INV_BOOLEAN, | ||
1019 | .name = "Input Capture Switch" | ||
1020 | }, | ||
1021 | { | ||
1022 | .unitid = 10, | ||
1023 | .control = 2, | ||
1024 | .cmask = 0x1, | ||
1025 | .val_type = USB_MIXER_S16, | ||
1026 | .name = "Input A Capture Volume" | ||
1027 | }, | ||
1028 | { | ||
1029 | .unitid = 10, | ||
1030 | .control = 2, | ||
1031 | .cmask = 0x2, | ||
1032 | .val_type = USB_MIXER_S16, | ||
1033 | .name = "Input B Capture Volume" | ||
1034 | }, | ||
1035 | |||
1036 | {} | ||
1037 | }; | ||
1038 | |||
993 | int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) | 1039 | int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) |
994 | { | 1040 | { |
995 | int err = 0; | 1041 | int err = 0; |
@@ -1035,7 +1081,8 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) | |||
1035 | break; | 1081 | break; |
1036 | 1082 | ||
1037 | case USB_ID(0x200c, 0x1018): /* Electrix Ebox-44 */ | 1083 | case USB_ID(0x200c, 0x1018): /* Electrix Ebox-44 */ |
1038 | err = snd_ebox44_create_mixer(mixer); | 1084 | /* detection is disabled in mixer_maps.c */ |
1085 | err = snd_create_std_mono_table(mixer, ebox44_table); | ||
1039 | break; | 1086 | break; |
1040 | } | 1087 | } |
1041 | 1088 | ||