diff options
Diffstat (limited to 'sound/ppc')
-rw-r--r-- | sound/ppc/Kconfig | 15 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 3 | ||||
-rw-r--r-- | sound/ppc/powermac.c | 3 | ||||
-rw-r--r-- | sound/ppc/tumbler.c | 23 |
4 files changed, 36 insertions, 8 deletions
diff --git a/sound/ppc/Kconfig b/sound/ppc/Kconfig index 75213bf4d56..206b9333f91 100644 --- a/sound/ppc/Kconfig +++ b/sound/ppc/Kconfig @@ -13,11 +13,24 @@ config SND_POWERMAC tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)" depends on SND && I2C && INPUT && PPC_PMAC select SND_PCM + select SND_GENERIC_DRIVER help Say Y here to include support for the integrated sound device. To compile this driver as a module, choose M here: the module will be called snd-powermac. -endmenu +config SND_POWERMAC_AUTO_DRC + bool "Toggle DRC automatically at headphone/line plug-in" + depends on SND_POWERMAC + default y + help + Say Y here to enable the automatic toggle of DRC (dynamic + range compression) on Tumbler/Snapper. + If this feature is enabled, DRC is turned off when the + headphone/line jack is plugged, and turned on when unplugged. + Note that you can turn on/off DRC manually even without this + option. + +endmenu diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index c89e82eb06a..e35b48d29c4 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -988,6 +988,7 @@ static int __init snd_pmac_detect(pmac_t *chip) case 0x33: case 0x29: case 0x24: + case 0x5c: chip->num_freqs = ARRAY_SIZE(tumbler_freqs); chip->model = PMAC_SNAPPER; chip->can_byte_swap = 0; /* FIXME: check this */ @@ -1159,7 +1160,7 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) snd_runtime_check(chip_return, return -EINVAL); *chip_return = NULL; - chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); + chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (chip == NULL) return -ENOMEM; chip->card = card; diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index 231f6432ea6..a6d8cbf4064 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c @@ -131,6 +131,9 @@ static int __init snd_pmac_probe(void) if (enable_beep) snd_pmac_attach_beep(chip); + if ((err = snd_card_set_generic_dev(card)) < 0) + goto __error; + if ((err = snd_card_register(card)) < 0) goto __error; diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index b94437c024b..65384afcfc3 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -948,7 +948,6 @@ static void device_change_handler(void *self) msleep(10); check_mute(chip, &mix->amp_mute, 1, mix->auto_mute_notify, chip->speaker_sw_ctl); - mix->drc_enable = 0; } else { /* unmute speaker, mute others */ check_mute(chip, &mix->amp_mute, 0, mix->auto_mute_notify, @@ -960,20 +959,21 @@ static void device_change_handler(void *self) if (mix->line_mute.addr != 0) check_mute(chip, &mix->line_mute, 1, mix->auto_mute_notify, chip->lineout_sw_ctl); - mix->drc_enable = 1; } - if (mix->auto_mute_notify) { + if (mix->auto_mute_notify) snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->hp_detect_ctl->id); + +#ifdef CONFIG_SND_POWERMAC_AUTO_DRC + mix->drc_enable = ! (headphone || lineout); + if (mix->auto_mute_notify) snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &chip->drc_sw_ctl->id); - } - - /* first set the DRC so the speaker do not explode -ReneR */ if (chip->model == PMAC_TUMBLER) tumbler_set_drc(mix); else snapper_set_drc(mix); +#endif /* reset the master volume so the correct amplification is applied */ tumbler_set_master_volume(mix); @@ -1370,6 +1370,17 @@ int __init snd_pmac_tumbler_init(pmac_t *chip) if ((err = snd_ctl_add(chip->card, chip->drc_sw_ctl)) < 0) return err; + /* set initial DRC range to 60% */ + if (chip->model == PMAC_TUMBLER) + mix->drc_range = (TAS3001_DRC_MAX * 6) / 10; + else + mix->drc_range = (TAS3004_DRC_MAX * 6) / 10; + mix->drc_enable = 1; /* will be changed later if AUTO_DRC is set */ + if (chip->model == PMAC_TUMBLER) + tumbler_set_drc(mix); + else + snapper_set_drc(mix); + #ifdef CONFIG_PM chip->suspend = tumbler_suspend; chip->resume = tumbler_resume; |