diff options
Diffstat (limited to 'sound/ppc')
-rw-r--r-- | sound/ppc/Kconfig | 1 | ||||
-rw-r--r-- | sound/ppc/awacs.c | 88 | ||||
-rw-r--r-- | sound/ppc/burgundy.c | 2 | ||||
-rw-r--r-- | sound/ppc/daca.c | 2 | ||||
-rw-r--r-- | sound/ppc/keywest.c | 82 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 11 | ||||
-rw-r--r-- | sound/ppc/powermac.c | 4 | ||||
-rw-r--r-- | sound/ppc/snd_ps3.c | 4 | ||||
-rw-r--r-- | sound/ppc/tumbler.c | 13 |
9 files changed, 139 insertions, 68 deletions
diff --git a/sound/ppc/Kconfig b/sound/ppc/Kconfig index 777de2b17178..bd2338ab2ced 100644 --- a/sound/ppc/Kconfig +++ b/sound/ppc/Kconfig | |||
@@ -13,6 +13,7 @@ config SND_POWERMAC | |||
13 | tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)" | 13 | tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)" |
14 | depends on I2C && INPUT && PPC_PMAC | 14 | depends on I2C && INPUT && PPC_PMAC |
15 | select SND_PCM | 15 | select SND_PCM |
16 | select SND_VMASTER | ||
16 | help | 17 | help |
17 | Say Y here to include support for the integrated sound device. | 18 | Say Y here to include support for the integrated sound device. |
18 | 19 | ||
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 7bd33e6552ab..80df9b1f651e 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c | |||
@@ -608,9 +608,12 @@ static struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] __initdata = { | |||
608 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_LINE, 0), | 608 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_LINE, 0), |
609 | }; | 609 | }; |
610 | 610 | ||
611 | static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __initdata = { | 611 | static struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] __initdata = { |
612 | AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), | 612 | AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), |
613 | AWACS_VOLUME("Master Playback Volume", 5, 6, 1), | 613 | }; |
614 | |||
615 | static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] __initdata = { | ||
616 | AWACS_VOLUME("Play-through Playback Volume", 5, 6, 1), | ||
614 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), | 617 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), |
615 | }; | 618 | }; |
616 | 619 | ||
@@ -627,6 +630,10 @@ static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] __initdata = { | |||
627 | AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), | 630 | AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), |
628 | }; | 631 | }; |
629 | 632 | ||
633 | static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] __initdata = { | ||
634 | AWACS_VOLUME("Headphone Playback Volume", 2, 6, 1), | ||
635 | }; | ||
636 | |||
630 | static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] __initdata = { | 637 | static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] __initdata = { |
631 | AWACS_VOLUME("Master Playback Volume", 2, 6, 1), | 638 | AWACS_VOLUME("Master Playback Volume", 2, 6, 1), |
632 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), | 639 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), |
@@ -645,12 +652,19 @@ static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] __initdata = { | |||
645 | AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0), | 652 | AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0), |
646 | }; | 653 | }; |
647 | 654 | ||
655 | static struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] __initdata = { | ||
656 | AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), | ||
657 | }; | ||
658 | |||
648 | static struct snd_kcontrol_new snd_pmac_awacs_master_sw __initdata = | 659 | static struct snd_kcontrol_new snd_pmac_awacs_master_sw __initdata = |
649 | AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1); | 660 | AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1); |
650 | 661 | ||
651 | static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac __initdata = | 662 | static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac __initdata = |
652 | AWACS_SWITCH("Line out Playback Switch", 1, SHIFT_HDMUTE, 1); | 663 | AWACS_SWITCH("Line out Playback Switch", 1, SHIFT_HDMUTE, 1); |
653 | 664 | ||
665 | static struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 __initdata = | ||
666 | AWACS_SWITCH("Headphone Playback Switch", 1, SHIFT_HDMUTE, 1); | ||
667 | |||
654 | static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] __initdata = { | 668 | static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] __initdata = { |
655 | AWACS_SWITCH("Mic Boost Capture Switch", 0, SHIFT_GAINLINE, 0), | 669 | AWACS_SWITCH("Mic Boost Capture Switch", 0, SHIFT_GAINLINE, 0), |
656 | }; | 670 | }; |
@@ -766,12 +780,16 @@ static void snd_pmac_awacs_resume(struct snd_pmac *chip) | |||
766 | } | 780 | } |
767 | #endif /* CONFIG_PM */ | 781 | #endif /* CONFIG_PM */ |
768 | 782 | ||
769 | #define IS_PM7500 (machine_is_compatible("AAPL,7500")) | 783 | #define IS_PM7500 (machine_is_compatible("AAPL,7500") \ |
784 | || machine_is_compatible("AAPL,8500") \ | ||
785 | || machine_is_compatible("AAPL,9500")) | ||
786 | #define IS_PM5500 (machine_is_compatible("AAPL,e411")) | ||
770 | #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer")) | 787 | #define IS_BEIGE (machine_is_compatible("AAPL,Gossamer")) |
771 | #define IS_IMAC1 (machine_is_compatible("PowerMac2,1")) | 788 | #define IS_IMAC1 (machine_is_compatible("PowerMac2,1")) |
772 | #define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \ | 789 | #define IS_IMAC2 (machine_is_compatible("PowerMac2,2") \ |
773 | || machine_is_compatible("PowerMac4,1")) | 790 | || machine_is_compatible("PowerMac4,1")) |
774 | #define IS_G4AGP (machine_is_compatible("PowerMac3,1")) | 791 | #define IS_G4AGP (machine_is_compatible("PowerMac3,1")) |
792 | #define IS_LOMBARD (machine_is_compatible("PowerBook1,1")) | ||
775 | 793 | ||
776 | static int imac1, imac2; | 794 | static int imac1, imac2; |
777 | 795 | ||
@@ -858,10 +876,14 @@ int __init | |||
858 | snd_pmac_awacs_init(struct snd_pmac *chip) | 876 | snd_pmac_awacs_init(struct snd_pmac *chip) |
859 | { | 877 | { |
860 | int pm7500 = IS_PM7500; | 878 | int pm7500 = IS_PM7500; |
879 | int pm5500 = IS_PM5500; | ||
861 | int beige = IS_BEIGE; | 880 | int beige = IS_BEIGE; |
862 | int g4agp = IS_G4AGP; | 881 | int g4agp = IS_G4AGP; |
882 | int lombard = IS_LOMBARD; | ||
863 | int imac; | 883 | int imac; |
864 | int err, vol; | 884 | int err, vol; |
885 | struct snd_kcontrol *vmaster_sw, *vmaster_vol; | ||
886 | struct snd_kcontrol *master_vol, *speaker_vol; | ||
865 | 887 | ||
866 | imac1 = IS_IMAC1; | 888 | imac1 = IS_IMAC1; |
867 | imac2 = IS_IMAC2; | 889 | imac2 = IS_IMAC2; |
@@ -915,7 +937,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
915 | /* set headphone-jack detection bit */ | 937 | /* set headphone-jack detection bit */ |
916 | switch (chip->model) { | 938 | switch (chip->model) { |
917 | case PMAC_AWACS: | 939 | case PMAC_AWACS: |
918 | chip->hp_stat_mask = pm7500 ? MASK_HDPCONN | 940 | chip->hp_stat_mask = pm7500 || pm5500 ? MASK_HDPCONN |
919 | : MASK_LOCONN; | 941 | : MASK_LOCONN; |
920 | break; | 942 | break; |
921 | case PMAC_SCREAMER: | 943 | case PMAC_SCREAMER: |
@@ -954,7 +976,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
954 | return err; | 976 | return err; |
955 | if (beige || g4agp) | 977 | if (beige || g4agp) |
956 | ; | 978 | ; |
957 | else if (chip->model == PMAC_SCREAMER) | 979 | else if (chip->model == PMAC_SCREAMER || pm5500) |
958 | err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), | 980 | err = build_mixers(chip, ARRAY_SIZE(snd_pmac_screamer_mixers2), |
959 | snd_pmac_screamer_mixers2); | 981 | snd_pmac_screamer_mixers2); |
960 | else if (!pm7500) | 982 | else if (!pm7500) |
@@ -962,19 +984,35 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
962 | snd_pmac_awacs_mixers2); | 984 | snd_pmac_awacs_mixers2); |
963 | if (err < 0) | 985 | if (err < 0) |
964 | return err; | 986 | return err; |
987 | if (pm5500) { | ||
988 | err = build_mixers(chip, | ||
989 | ARRAY_SIZE(snd_pmac_awacs_mixers2_pmac5500), | ||
990 | snd_pmac_awacs_mixers2_pmac5500); | ||
991 | if (err < 0) | ||
992 | return err; | ||
993 | } | ||
965 | if (pm7500) | 994 | if (pm7500) |
966 | err = build_mixers(chip, | 995 | err = build_mixers(chip, |
967 | ARRAY_SIZE(snd_pmac_awacs_mixers_pmac7500), | 996 | ARRAY_SIZE(snd_pmac_awacs_mixers_pmac7500), |
968 | snd_pmac_awacs_mixers_pmac7500); | 997 | snd_pmac_awacs_mixers_pmac7500); |
998 | else if (pm5500) | ||
999 | err = snd_ctl_add(chip->card, | ||
1000 | (master_vol = snd_ctl_new1(snd_pmac_awacs_mixers_pmac5500, | ||
1001 | chip))); | ||
969 | else if (beige) | 1002 | else if (beige) |
970 | err = build_mixers(chip, | 1003 | err = build_mixers(chip, |
971 | ARRAY_SIZE(snd_pmac_screamer_mixers_beige), | 1004 | ARRAY_SIZE(snd_pmac_screamer_mixers_beige), |
972 | snd_pmac_screamer_mixers_beige); | 1005 | snd_pmac_screamer_mixers_beige); |
973 | else if (imac) | 1006 | else if (imac || lombard) { |
1007 | err = snd_ctl_add(chip->card, | ||
1008 | (master_vol = snd_ctl_new1(snd_pmac_screamer_mixers_lo, | ||
1009 | chip))); | ||
1010 | if (err < 0) | ||
1011 | return err; | ||
974 | err = build_mixers(chip, | 1012 | err = build_mixers(chip, |
975 | ARRAY_SIZE(snd_pmac_screamer_mixers_imac), | 1013 | ARRAY_SIZE(snd_pmac_screamer_mixers_imac), |
976 | snd_pmac_screamer_mixers_imac); | 1014 | snd_pmac_screamer_mixers_imac); |
977 | else if (g4agp) | 1015 | } else if (g4agp) |
978 | err = build_mixers(chip, | 1016 | err = build_mixers(chip, |
979 | ARRAY_SIZE(snd_pmac_screamer_mixers_g4agp), | 1017 | ARRAY_SIZE(snd_pmac_screamer_mixers_g4agp), |
980 | snd_pmac_screamer_mixers_g4agp); | 1018 | snd_pmac_screamer_mixers_g4agp); |
@@ -984,8 +1022,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
984 | snd_pmac_awacs_mixers_pmac); | 1022 | snd_pmac_awacs_mixers_pmac); |
985 | if (err < 0) | 1023 | if (err < 0) |
986 | return err; | 1024 | return err; |
987 | chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac || g4agp) | 1025 | chip->master_sw_ctl = snd_ctl_new1((pm7500 || imac || g4agp || lombard) |
988 | ? &snd_pmac_awacs_master_sw_imac | 1026 | ? &snd_pmac_awacs_master_sw_imac |
1027 | : pm5500 | ||
1028 | ? &snd_pmac_awacs_master_sw_pmac5500 | ||
989 | : &snd_pmac_awacs_master_sw, chip); | 1029 | : &snd_pmac_awacs_master_sw, chip); |
990 | err = snd_ctl_add(chip->card, chip->master_sw_ctl); | 1030 | err = snd_ctl_add(chip->card, chip->master_sw_ctl); |
991 | if (err < 0) | 1031 | if (err < 0) |
@@ -1017,8 +1057,9 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
1017 | #endif /* PMAC_AMP_AVAIL */ | 1057 | #endif /* PMAC_AMP_AVAIL */ |
1018 | { | 1058 | { |
1019 | /* route A = headphone, route C = speaker */ | 1059 | /* route A = headphone, route C = speaker */ |
1020 | err = build_mixers(chip, ARRAY_SIZE(snd_pmac_awacs_speaker_vol), | 1060 | err = snd_ctl_add(chip->card, |
1021 | snd_pmac_awacs_speaker_vol); | 1061 | (speaker_vol = snd_ctl_new1(snd_pmac_awacs_speaker_vol, |
1062 | chip))); | ||
1022 | if (err < 0) | 1063 | if (err < 0) |
1023 | return err; | 1064 | return err; |
1024 | chip->speaker_sw_ctl = snd_ctl_new1(imac1 | 1065 | chip->speaker_sw_ctl = snd_ctl_new1(imac1 |
@@ -1031,6 +1072,33 @@ snd_pmac_awacs_init(struct snd_pmac *chip) | |||
1031 | return err; | 1072 | return err; |
1032 | } | 1073 | } |
1033 | 1074 | ||
1075 | if (pm5500 || imac || lombard) { | ||
1076 | vmaster_sw = snd_ctl_make_virtual_master( | ||
1077 | "Master Playback Switch", (unsigned int *) NULL); | ||
1078 | err = snd_ctl_add_slave_uncached(vmaster_sw, | ||
1079 | chip->master_sw_ctl); | ||
1080 | if (err < 0) | ||
1081 | return err; | ||
1082 | err = snd_ctl_add_slave_uncached(vmaster_sw, | ||
1083 | chip->speaker_sw_ctl); | ||
1084 | if (err < 0) | ||
1085 | return err; | ||
1086 | err = snd_ctl_add(chip->card, vmaster_sw); | ||
1087 | if (err < 0) | ||
1088 | return err; | ||
1089 | vmaster_vol = snd_ctl_make_virtual_master( | ||
1090 | "Master Playback Volume", (unsigned int *) NULL); | ||
1091 | err = snd_ctl_add_slave(vmaster_vol, master_vol); | ||
1092 | if (err < 0) | ||
1093 | return err; | ||
1094 | err = snd_ctl_add_slave(vmaster_vol, speaker_vol); | ||
1095 | if (err < 0) | ||
1096 | return err; | ||
1097 | err = snd_ctl_add(chip->card, vmaster_vol); | ||
1098 | if (err < 0) | ||
1099 | return err; | ||
1100 | } | ||
1101 | |||
1034 | if (beige || g4agp) | 1102 | if (beige || g4agp) |
1035 | err = build_mixers(chip, | 1103 | err = build_mixers(chip, |
1036 | ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), | 1104 | ARRAY_SIZE(snd_pmac_screamer_mic_boost_beige), |
diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c index f860d39af36b..45a76297c38d 100644 --- a/sound/ppc/burgundy.c +++ b/sound/ppc/burgundy.c | |||
@@ -35,7 +35,7 @@ snd_pmac_burgundy_busy_wait(struct snd_pmac *chip) | |||
35 | int timeout = 50; | 35 | int timeout = 50; |
36 | while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--) | 36 | while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--) |
37 | udelay(1); | 37 | udelay(1); |
38 | if (! timeout) | 38 | if (timeout < 0) |
39 | printk(KERN_DEBUG "burgundy_busy_wait: timeout\n"); | 39 | printk(KERN_DEBUG "burgundy_busy_wait: timeout\n"); |
40 | } | 40 | } |
41 | 41 | ||
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index 8a5b29031933..f8d478c2da62 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c | |||
@@ -82,7 +82,7 @@ static int daca_set_volume(struct pmac_daca *mix) | |||
82 | data[1] |= mix->deemphasis ? 0x40 : 0; | 82 | data[1] |= mix->deemphasis ? 0x40 : 0; |
83 | if (i2c_smbus_write_block_data(mix->i2c.client, DACA_REG_AVOL, | 83 | if (i2c_smbus_write_block_data(mix->i2c.client, DACA_REG_AVOL, |
84 | 2, data) < 0) { | 84 | 2, data) < 0) { |
85 | snd_printk("failed to set volume \n"); | 85 | snd_printk(KERN_ERR "failed to set volume \n"); |
86 | return -EINVAL; | 86 | return -EINVAL; |
87 | } | 87 | } |
88 | return 0; | 88 | return 0; |
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c index 6ff99ed77516..a5afb2682e7f 100644 --- a/sound/ppc/keywest.c +++ b/sound/ppc/keywest.c | |||
@@ -33,26 +33,25 @@ | |||
33 | static struct pmac_keywest *keywest_ctx; | 33 | static struct pmac_keywest *keywest_ctx; |
34 | 34 | ||
35 | 35 | ||
36 | static int keywest_attach_adapter(struct i2c_adapter *adapter); | ||
37 | static int keywest_detach_client(struct i2c_client *client); | ||
38 | |||
39 | struct i2c_driver keywest_driver = { | ||
40 | .driver = { | ||
41 | .name = "PMac Keywest Audio", | ||
42 | }, | ||
43 | .attach_adapter = &keywest_attach_adapter, | ||
44 | .detach_client = &keywest_detach_client, | ||
45 | }; | ||
46 | |||
47 | |||
48 | #ifndef i2c_device_name | 36 | #ifndef i2c_device_name |
49 | #define i2c_device_name(x) ((x)->name) | 37 | #define i2c_device_name(x) ((x)->name) |
50 | #endif | 38 | #endif |
51 | 39 | ||
40 | static int keywest_probe(struct i2c_client *client, | ||
41 | const struct i2c_device_id *id) | ||
42 | { | ||
43 | i2c_set_clientdata(client, keywest_ctx); | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * This is kind of a hack, best would be to turn powermac to fixed i2c | ||
49 | * bus numbers and declare the sound device as part of platform | ||
50 | * initialization | ||
51 | */ | ||
52 | static int keywest_attach_adapter(struct i2c_adapter *adapter) | 52 | static int keywest_attach_adapter(struct i2c_adapter *adapter) |
53 | { | 53 | { |
54 | int err; | 54 | struct i2c_board_info info; |
55 | struct i2c_client *new_client; | ||
56 | 55 | ||
57 | if (! keywest_ctx) | 56 | if (! keywest_ctx) |
58 | return -EINVAL; | 57 | return -EINVAL; |
@@ -60,46 +59,47 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter) | |||
60 | if (strncmp(i2c_device_name(adapter), "mac-io", 6)) | 59 | if (strncmp(i2c_device_name(adapter), "mac-io", 6)) |
61 | return 0; /* ignored */ | 60 | return 0; /* ignored */ |
62 | 61 | ||
63 | new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); | 62 | memset(&info, 0, sizeof(struct i2c_board_info)); |
64 | if (! new_client) | 63 | strlcpy(info.type, "keywest", I2C_NAME_SIZE); |
65 | return -ENOMEM; | 64 | info.addr = keywest_ctx->addr; |
66 | 65 | keywest_ctx->client = i2c_new_device(adapter, &info); | |
67 | new_client->addr = keywest_ctx->addr; | ||
68 | i2c_set_clientdata(new_client, keywest_ctx); | ||
69 | new_client->adapter = adapter; | ||
70 | new_client->driver = &keywest_driver; | ||
71 | new_client->flags = 0; | ||
72 | |||
73 | strcpy(i2c_device_name(new_client), keywest_ctx->name); | ||
74 | keywest_ctx->client = new_client; | ||
75 | 66 | ||
76 | /* Tell the i2c layer a new client has arrived */ | 67 | /* |
77 | if (i2c_attach_client(new_client)) { | 68 | * Let i2c-core delete that device on driver removal. |
78 | snd_printk(KERN_ERR "tumbler: cannot attach i2c client\n"); | 69 | * This is safe because i2c-core holds the core_lock mutex for us. |
79 | err = -ENODEV; | 70 | */ |
80 | goto __err; | 71 | list_add_tail(&keywest_ctx->client->detected, |
81 | } | 72 | &keywest_ctx->client->driver->clients); |
82 | |||
83 | return 0; | 73 | return 0; |
84 | |||
85 | __err: | ||
86 | kfree(new_client); | ||
87 | keywest_ctx->client = NULL; | ||
88 | return err; | ||
89 | } | 74 | } |
90 | 75 | ||
91 | static int keywest_detach_client(struct i2c_client *client) | 76 | static int keywest_remove(struct i2c_client *client) |
92 | { | 77 | { |
78 | i2c_set_clientdata(client, NULL); | ||
93 | if (! keywest_ctx) | 79 | if (! keywest_ctx) |
94 | return 0; | 80 | return 0; |
95 | if (client == keywest_ctx->client) | 81 | if (client == keywest_ctx->client) |
96 | keywest_ctx->client = NULL; | 82 | keywest_ctx->client = NULL; |
97 | 83 | ||
98 | i2c_detach_client(client); | ||
99 | kfree(client); | ||
100 | return 0; | 84 | return 0; |
101 | } | 85 | } |
102 | 86 | ||
87 | |||
88 | static const struct i2c_device_id keywest_i2c_id[] = { | ||
89 | { "keywest", 0 }, | ||
90 | { } | ||
91 | }; | ||
92 | |||
93 | struct i2c_driver keywest_driver = { | ||
94 | .driver = { | ||
95 | .name = "PMac Keywest Audio", | ||
96 | }, | ||
97 | .attach_adapter = keywest_attach_adapter, | ||
98 | .probe = keywest_probe, | ||
99 | .remove = keywest_remove, | ||
100 | .id_table = keywest_i2c_id, | ||
101 | }; | ||
102 | |||
103 | /* exported */ | 103 | /* exported */ |
104 | void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c) | 104 | void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c) |
105 | { | 105 | { |
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index af76ee862d27..9b4e9c316695 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c | |||
@@ -299,7 +299,7 @@ static int snd_pmac_pcm_trigger(struct snd_pmac *chip, struct pmac_stream *rec, | |||
299 | case SNDRV_PCM_TRIGGER_SUSPEND: | 299 | case SNDRV_PCM_TRIGGER_SUSPEND: |
300 | spin_lock(&chip->reg_lock); | 300 | spin_lock(&chip->reg_lock); |
301 | rec->running = 0; | 301 | rec->running = 0; |
302 | /*printk("stopped!!\n");*/ | 302 | /*printk(KERN_DEBUG "stopped!!\n");*/ |
303 | snd_pmac_dma_stop(rec); | 303 | snd_pmac_dma_stop(rec); |
304 | for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++) | 304 | for (i = 0, cp = rec->cmd.cmds; i < rec->nperiods; i++, cp++) |
305 | out_le16(&cp->command, DBDMA_STOP); | 305 | out_le16(&cp->command, DBDMA_STOP); |
@@ -334,7 +334,7 @@ static snd_pcm_uframes_t snd_pmac_pcm_pointer(struct snd_pmac *chip, | |||
334 | } | 334 | } |
335 | #endif | 335 | #endif |
336 | count += rec->cur_period * rec->period_size; | 336 | count += rec->cur_period * rec->period_size; |
337 | /*printk("pointer=%d\n", count);*/ | 337 | /*printk(KERN_DEBUG "pointer=%d\n", count);*/ |
338 | return bytes_to_frames(subs->runtime, count); | 338 | return bytes_to_frames(subs->runtime, count); |
339 | } | 339 | } |
340 | 340 | ||
@@ -486,7 +486,7 @@ static void snd_pmac_pcm_update(struct snd_pmac *chip, struct pmac_stream *rec) | |||
486 | if (! (stat & ACTIVE)) | 486 | if (! (stat & ACTIVE)) |
487 | break; | 487 | break; |
488 | 488 | ||
489 | /*printk("update frag %d\n", rec->cur_period);*/ | 489 | /*printk(KERN_DEBUG "update frag %d\n", rec->cur_period);*/ |
490 | st_le16(&cp->xfer_status, 0); | 490 | st_le16(&cp->xfer_status, 0); |
491 | st_le16(&cp->req_count, rec->period_size); | 491 | st_le16(&cp->req_count, rec->period_size); |
492 | /*st_le16(&cp->res_count, 0);*/ | 492 | /*st_le16(&cp->res_count, 0);*/ |
@@ -806,7 +806,7 @@ snd_pmac_ctrl_intr(int irq, void *devid) | |||
806 | struct snd_pmac *chip = devid; | 806 | struct snd_pmac *chip = devid; |
807 | int ctrl = in_le32(&chip->awacs->control); | 807 | int ctrl = in_le32(&chip->awacs->control); |
808 | 808 | ||
809 | /*printk("pmac: control interrupt.. 0x%x\n", ctrl);*/ | 809 | /*printk(KERN_DEBUG "pmac: control interrupt.. 0x%x\n", ctrl);*/ |
810 | if (ctrl & MASK_PORTCHG) { | 810 | if (ctrl & MASK_PORTCHG) { |
811 | /* do something when headphone is plugged/unplugged? */ | 811 | /* do something when headphone is plugged/unplugged? */ |
812 | if (chip->update_automute) | 812 | if (chip->update_automute) |
@@ -1033,7 +1033,8 @@ static int __init snd_pmac_detect(struct snd_pmac *chip) | |||
1033 | } | 1033 | } |
1034 | if (of_device_is_compatible(sound, "tumbler")) { | 1034 | if (of_device_is_compatible(sound, "tumbler")) { |
1035 | chip->model = PMAC_TUMBLER; | 1035 | chip->model = PMAC_TUMBLER; |
1036 | chip->can_capture = machine_is_compatible("PowerMac4,2"); | 1036 | chip->can_capture = machine_is_compatible("PowerMac4,2") |
1037 | || machine_is_compatible("PowerBook4,1"); | ||
1037 | chip->can_duplex = 0; | 1038 | chip->can_duplex = 0; |
1038 | // chip->can_byte_swap = 0; /* FIXME: check this */ | 1039 | // chip->can_byte_swap = 0; /* FIXME: check this */ |
1039 | chip->num_freqs = ARRAY_SIZE(tumbler_freqs); | 1040 | chip->num_freqs = ARRAY_SIZE(tumbler_freqs); |
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index 2e18ed0ea899..a2b69b8cff43 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c | |||
@@ -51,7 +51,7 @@ static struct platform_device *device; | |||
51 | /* | 51 | /* |
52 | */ | 52 | */ |
53 | 53 | ||
54 | static int __init snd_pmac_probe(struct platform_device *devptr) | 54 | static int __devinit snd_pmac_probe(struct platform_device *devptr) |
55 | { | 55 | { |
56 | struct snd_card *card; | 56 | struct snd_card *card; |
57 | struct snd_pmac *chip; | 57 | struct snd_pmac *chip; |
@@ -110,7 +110,7 @@ static int __init snd_pmac_probe(struct platform_device *devptr) | |||
110 | goto __error; | 110 | goto __error; |
111 | break; | 111 | break; |
112 | default: | 112 | default: |
113 | snd_printk("unsupported hardware %d\n", chip->model); | 113 | snd_printk(KERN_ERR "unsupported hardware %d\n", chip->model); |
114 | err = -EINVAL; | 114 | err = -EINVAL; |
115 | goto __error; | 115 | goto __error; |
116 | } | 116 | } |
diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c index ef2c3f417175..f361c26506aa 100644 --- a/sound/ppc/snd_ps3.c +++ b/sound/ppc/snd_ps3.c | |||
@@ -477,7 +477,7 @@ static int snd_ps3_pcm_prepare(struct snd_pcm_substream *substream) | |||
477 | card->dma_start_bus_addr[SND_PS3_CH_R] = | 477 | card->dma_start_bus_addr[SND_PS3_CH_R] = |
478 | runtime->dma_addr + (runtime->dma_bytes / 2); | 478 | runtime->dma_addr + (runtime->dma_bytes / 2); |
479 | 479 | ||
480 | pr_debug("%s: vaddr=%p bus=%#lx\n", __func__, | 480 | pr_debug("%s: vaddr=%p bus=%#llx\n", __func__, |
481 | card->dma_start_vaddr[SND_PS3_CH_L], | 481 | card->dma_start_vaddr[SND_PS3_CH_L], |
482 | card->dma_start_bus_addr[SND_PS3_CH_L]); | 482 | card->dma_start_bus_addr[SND_PS3_CH_L]); |
483 | 483 | ||
@@ -1028,7 +1028,7 @@ static int __init snd_ps3_driver_probe(struct ps3_system_bus_device *dev) | |||
1028 | pr_info("%s: nullbuffer alloc failed\n", __func__); | 1028 | pr_info("%s: nullbuffer alloc failed\n", __func__); |
1029 | goto clean_preallocate; | 1029 | goto clean_preallocate; |
1030 | } | 1030 | } |
1031 | pr_debug("%s: null vaddr=%p dma=%#lx\n", __func__, | 1031 | pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, |
1032 | the_card.null_buffer_start_vaddr, | 1032 | the_card.null_buffer_start_vaddr, |
1033 | the_card.null_buffer_start_dma_addr); | 1033 | the_card.null_buffer_start_dma_addr); |
1034 | /* set default sample rate/word width */ | 1034 | /* set default sample rate/word width */ |
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 3eb223385416..40222fcc0878 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #undef DEBUG | 41 | #undef DEBUG |
42 | 42 | ||
43 | #ifdef DEBUG | 43 | #ifdef DEBUG |
44 | #define DBG(fmt...) printk(fmt) | 44 | #define DBG(fmt...) printk(KERN_DEBUG fmt) |
45 | #else | 45 | #else |
46 | #define DBG(fmt...) | 46 | #define DBG(fmt...) |
47 | #endif | 47 | #endif |
@@ -240,7 +240,7 @@ static int tumbler_set_master_volume(struct pmac_tumbler *mix) | |||
240 | 240 | ||
241 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6, | 241 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6, |
242 | block) < 0) { | 242 | block) < 0) { |
243 | snd_printk("failed to set volume \n"); | 243 | snd_printk(KERN_ERR "failed to set volume \n"); |
244 | return -EINVAL; | 244 | return -EINVAL; |
245 | } | 245 | } |
246 | return 0; | 246 | return 0; |
@@ -350,7 +350,7 @@ static int tumbler_set_drc(struct pmac_tumbler *mix) | |||
350 | 350 | ||
351 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, | 351 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, |
352 | 2, val) < 0) { | 352 | 2, val) < 0) { |
353 | snd_printk("failed to set DRC\n"); | 353 | snd_printk(KERN_ERR "failed to set DRC\n"); |
354 | return -EINVAL; | 354 | return -EINVAL; |
355 | } | 355 | } |
356 | return 0; | 356 | return 0; |
@@ -386,7 +386,7 @@ static int snapper_set_drc(struct pmac_tumbler *mix) | |||
386 | 386 | ||
387 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, | 387 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, |
388 | 6, val) < 0) { | 388 | 6, val) < 0) { |
389 | snd_printk("failed to set DRC\n"); | 389 | snd_printk(KERN_ERR "failed to set DRC\n"); |
390 | return -EINVAL; | 390 | return -EINVAL; |
391 | } | 391 | } |
392 | return 0; | 392 | return 0; |
@@ -506,7 +506,8 @@ static int tumbler_set_mono_volume(struct pmac_tumbler *mix, | |||
506 | block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff; | 506 | block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff; |
507 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg, | 507 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg, |
508 | info->bytes, block) < 0) { | 508 | info->bytes, block) < 0) { |
509 | snd_printk("failed to set mono volume %d\n", info->index); | 509 | snd_printk(KERN_ERR "failed to set mono volume %d\n", |
510 | info->index); | ||
510 | return -EINVAL; | 511 | return -EINVAL; |
511 | } | 512 | } |
512 | return 0; | 513 | return 0; |
@@ -643,7 +644,7 @@ static int snapper_set_mix_vol1(struct pmac_tumbler *mix, int idx, int ch, int r | |||
643 | } | 644 | } |
644 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg, | 645 | if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg, |
645 | 9, block) < 0) { | 646 | 9, block) < 0) { |
646 | snd_printk("failed to set mono volume %d\n", reg); | 647 | snd_printk(KERN_ERR "failed to set mono volume %d\n", reg); |
647 | return -EINVAL; | 648 | return -EINVAL; |
648 | } | 649 | } |
649 | return 0; | 650 | return 0; |