tumbler.c (94bd217e2d683719ab21a4ac117d8a1b91cbedc9) tumbler.c (15afafc2565bc785eb7a440b8b4a53f77910cf04)
1/*
2 * PMac Tumbler/Snapper lowlevel functions
3 *
4 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 830 unchanged lines hidden (view full) ---

839 .put = snapper_put_mix, \
840 .index = idx,\
841 .private_value = ofs, \
842}
843
844
845/*
846 */
1/*
2 * PMac Tumbler/Snapper lowlevel functions
3 *
4 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 830 unchanged lines hidden (view full) ---

839 .put = snapper_put_mix, \
840 .index = idx,\
841 .private_value = ofs, \
842}
843
844
845/*
846 */
847static struct snd_kcontrol_new tumbler_mixers[] __devinitdata = {
847static struct snd_kcontrol_new tumbler_mixers[] = {
848 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
849 .name = "Master Playback Volume",
850 .info = tumbler_info_master_volume,
851 .get = tumbler_get_master_volume,
852 .put = tumbler_put_master_volume
853 },
854 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
855 .name = "Master Playback Switch",

--- 7 unchanged lines hidden (view full) ---

863 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
864 .name = "DRC Range",
865 .info = tumbler_info_drc_value,
866 .get = tumbler_get_drc_value,
867 .put = tumbler_put_drc_value
868 },
869};
870
848 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
849 .name = "Master Playback Volume",
850 .info = tumbler_info_master_volume,
851 .get = tumbler_get_master_volume,
852 .put = tumbler_put_master_volume
853 },
854 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
855 .name = "Master Playback Switch",

--- 7 unchanged lines hidden (view full) ---

863 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
864 .name = "DRC Range",
865 .info = tumbler_info_drc_value,
866 .get = tumbler_get_drc_value,
867 .put = tumbler_put_drc_value
868 },
869};
870
871static struct snd_kcontrol_new snapper_mixers[] __devinitdata = {
871static struct snd_kcontrol_new snapper_mixers[] = {
872 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
873 .name = "Master Playback Volume",
874 .info = tumbler_info_master_volume,
875 .get = tumbler_get_master_volume,
876 .put = tumbler_put_master_volume
877 },
878 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .name = "Master Playback Switch",

--- 16 unchanged lines hidden (view full) ---

896 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
897 .name = "Input Source", /* FIXME: "Capture Source" doesn't work properly */
898 .info = snapper_info_capture_source,
899 .get = snapper_get_capture_source,
900 .put = snapper_put_capture_source
901 },
902};
903
872 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
873 .name = "Master Playback Volume",
874 .info = tumbler_info_master_volume,
875 .get = tumbler_get_master_volume,
876 .put = tumbler_put_master_volume
877 },
878 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .name = "Master Playback Switch",

--- 16 unchanged lines hidden (view full) ---

896 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
897 .name = "Input Source", /* FIXME: "Capture Source" doesn't work properly */
898 .info = snapper_info_capture_source,
899 .get = snapper_get_capture_source,
900 .put = snapper_put_capture_source
901 },
902};
903
904static struct snd_kcontrol_new tumbler_hp_sw __devinitdata = {
904static struct snd_kcontrol_new tumbler_hp_sw = {
905 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
906 .name = "Headphone Playback Switch",
907 .info = snd_pmac_boolean_mono_info,
908 .get = tumbler_get_mute_switch,
909 .put = tumbler_put_mute_switch,
910 .private_value = TUMBLER_MUTE_HP,
911};
905 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
906 .name = "Headphone Playback Switch",
907 .info = snd_pmac_boolean_mono_info,
908 .get = tumbler_get_mute_switch,
909 .put = tumbler_put_mute_switch,
910 .private_value = TUMBLER_MUTE_HP,
911};
912static struct snd_kcontrol_new tumbler_speaker_sw __devinitdata = {
912static struct snd_kcontrol_new tumbler_speaker_sw = {
913 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
914 .name = "Speaker Playback Switch",
915 .info = snd_pmac_boolean_mono_info,
916 .get = tumbler_get_mute_switch,
917 .put = tumbler_put_mute_switch,
918 .private_value = TUMBLER_MUTE_AMP,
919};
913 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
914 .name = "Speaker Playback Switch",
915 .info = snd_pmac_boolean_mono_info,
916 .get = tumbler_get_mute_switch,
917 .put = tumbler_put_mute_switch,
918 .private_value = TUMBLER_MUTE_AMP,
919};
920static struct snd_kcontrol_new tumbler_lineout_sw __devinitdata = {
920static struct snd_kcontrol_new tumbler_lineout_sw = {
921 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
922 .name = "Line Out Playback Switch",
923 .info = snd_pmac_boolean_mono_info,
924 .get = tumbler_get_mute_switch,
925 .put = tumbler_put_mute_switch,
926 .private_value = TUMBLER_MUTE_LINE,
927};
921 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
922 .name = "Line Out Playback Switch",
923 .info = snd_pmac_boolean_mono_info,
924 .get = tumbler_get_mute_switch,
925 .put = tumbler_put_mute_switch,
926 .private_value = TUMBLER_MUTE_LINE,
927};
928static struct snd_kcontrol_new tumbler_drc_sw __devinitdata = {
928static struct snd_kcontrol_new tumbler_drc_sw = {
929 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
930 .name = "DRC Switch",
931 .info = snd_pmac_boolean_mono_info,
932 .get = tumbler_get_drc_switch,
933 .put = tumbler_put_drc_switch
934};
935
936

--- 334 unchanged lines hidden (view full) ---

1271 do_gpio_write(&mix->hp_detect, val | 0x80);
1272 }
1273 if (mix->lineout_irq >= 0)
1274 enable_irq(mix->lineout_irq);
1275}
1276#endif
1277
1278/* initialize tumbler */
929 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
930 .name = "DRC Switch",
931 .info = snd_pmac_boolean_mono_info,
932 .get = tumbler_get_drc_switch,
933 .put = tumbler_put_drc_switch
934};
935
936

--- 334 unchanged lines hidden (view full) ---

1271 do_gpio_write(&mix->hp_detect, val | 0x80);
1272 }
1273 if (mix->lineout_irq >= 0)
1274 enable_irq(mix->lineout_irq);
1275}
1276#endif
1277
1278/* initialize tumbler */
1279static int __devinit tumbler_init(struct snd_pmac *chip)
1279static int tumbler_init(struct snd_pmac *chip)
1280{
1281 int irq;
1282 struct pmac_tumbler *mix = chip->mixer_data;
1283
1284 if (tumbler_find_device("audio-hw-reset",
1285 "platform-do-hw-reset",
1286 &mix->audio_reset, 0) < 0)
1287 tumbler_find_device("hw-reset",

--- 56 unchanged lines hidden (view full) ---

1344 tumbler_gpio_free(&mix->hp_mute);
1345 tumbler_gpio_free(&mix->hp_detect);
1346 snd_pmac_keywest_cleanup(&mix->i2c);
1347 kfree(mix);
1348 chip->mixer_data = NULL;
1349}
1350
1351/* exported */
1280{
1281 int irq;
1282 struct pmac_tumbler *mix = chip->mixer_data;
1283
1284 if (tumbler_find_device("audio-hw-reset",
1285 "platform-do-hw-reset",
1286 &mix->audio_reset, 0) < 0)
1287 tumbler_find_device("hw-reset",

--- 56 unchanged lines hidden (view full) ---

1344 tumbler_gpio_free(&mix->hp_mute);
1345 tumbler_gpio_free(&mix->hp_detect);
1346 snd_pmac_keywest_cleanup(&mix->i2c);
1347 kfree(mix);
1348 chip->mixer_data = NULL;
1349}
1350
1351/* exported */
1352int __devinit snd_pmac_tumbler_init(struct snd_pmac *chip)
1352int snd_pmac_tumbler_init(struct snd_pmac *chip)
1353{
1354 int i, err;
1355 struct pmac_tumbler *mix;
1356 const u32 *paddr;
1357 struct device_node *tas_node, *np;
1358 char *chipname;
1359
1360 request_module("i2c-powermac");

--- 135 unchanged lines hidden ---
1353{
1354 int i, err;
1355 struct pmac_tumbler *mix;
1356 const u32 *paddr;
1357 struct device_node *tas_node, *np;
1358 char *chipname;
1359
1360 request_module("i2c-powermac");

--- 135 unchanged lines hidden ---