opti92x-ad1848.c (10a3061accd897c9e4e3821cbd501660ac482497) opti92x-ad1848.c (5dd250728aa4cad49cfa18eb8ed11ba470ce382a)
1/*
2 card-opti92x-ad1848.c - driver for OPTi 82c92x based soundcards.
3 Copyright (C) 1998-2000 by Massimo Piccioni <dafastidio@libero.it>
4
5 Part of this code was developed at the Italian Ministry of Air Defence,
6 Sixth Division (oh, che pace ...), Rome.
7
8 Thanks to Maria Grazia Pollarini, Salvatore Vassallo.

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

131 char name[7];
132
133 unsigned long mc_base;
134 struct resource *res_mc_base;
135 unsigned long mc_base_size;
136#ifdef OPTi93X
137 unsigned long mc_indir_index;
138 struct resource *res_mc_indir;
1/*
2 card-opti92x-ad1848.c - driver for OPTi 82c92x based soundcards.
3 Copyright (C) 1998-2000 by Massimo Piccioni <dafastidio@libero.it>
4
5 Part of this code was developed at the Italian Ministry of Air Defence,
6 Sixth Division (oh, che pace ...), Rome.
7
8 Thanks to Maria Grazia Pollarini, Salvatore Vassallo.

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

131 char name[7];
132
133 unsigned long mc_base;
134 struct resource *res_mc_base;
135 unsigned long mc_base_size;
136#ifdef OPTi93X
137 unsigned long mc_indir_index;
138 struct resource *res_mc_indir;
139 struct snd_wss *codec;
140#endif /* OPTi93X */
139#endif /* OPTi93X */
140 struct snd_wss *codec;
141 unsigned long pwd_reg;
142
143 spinlock_t lock;
144
145 long wss_base;
146 int irq;
147};
148

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

865#ifdef OPTi93X
866 WSS_HW_OPTI93X, WSS_HWSHARE_IRQ,
867#else
868 WSS_HW_DETECT, 0,
869#endif
870 &codec);
871 if (error < 0)
872 return error;
141 unsigned long pwd_reg;
142
143 spinlock_t lock;
144
145 long wss_base;
146 int irq;
147};
148

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

865#ifdef OPTi93X
866 WSS_HW_OPTI93X, WSS_HWSHARE_IRQ,
867#else
868 WSS_HW_DETECT, 0,
869#endif
870 &codec);
871 if (error < 0)
872 return error;
873#ifdef OPTi93X
874 chip->codec = codec;
873 chip->codec = codec;
875#endif
876 error = snd_wss_pcm(codec, 0, &pcm);
877 if (error < 0)
878 return error;
879 error = snd_wss_mixer(codec);
880 if (error < 0)
881 return error;
882#ifdef OPTi93X
883 error = snd_opti93x_mixer(codec);

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

1048static int __devexit snd_opti9xx_isa_remove(struct device *devptr,
1049 unsigned int dev)
1050{
1051 snd_card_free(dev_get_drvdata(devptr));
1052 dev_set_drvdata(devptr, NULL);
1053 return 0;
1054}
1055
874 error = snd_wss_pcm(codec, 0, &pcm);
875 if (error < 0)
876 return error;
877 error = snd_wss_mixer(codec);
878 if (error < 0)
879 return error;
880#ifdef OPTi93X
881 error = snd_opti93x_mixer(codec);

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

1046static int __devexit snd_opti9xx_isa_remove(struct device *devptr,
1047 unsigned int dev)
1048{
1049 snd_card_free(dev_get_drvdata(devptr));
1050 dev_set_drvdata(devptr, NULL);
1051 return 0;
1052}
1053
1054#ifdef CONFIG_PM
1055static 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
1064static 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
1083static 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
1089static 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
1056static struct isa_driver snd_opti9xx_driver = {
1057 .match = snd_opti9xx_isa_match,
1058 .probe = snd_opti9xx_isa_probe,
1059 .remove = __devexit_p(snd_opti9xx_isa_remove),
1095static struct isa_driver snd_opti9xx_driver = {
1096 .match = snd_opti9xx_isa_match,
1097 .probe = snd_opti9xx_isa_probe,
1098 .remove = __devexit_p(snd_opti9xx_isa_remove),
1060 /* FIXME: suspend/resume */
1099#ifdef CONFIG_PM
1100 .suspend = snd_opti9xx_isa_suspend,
1101 .resume = snd_opti9xx_isa_resume,
1102#endif
1061 .driver = {
1062 .name = DEV_NAME
1063 },
1064};
1065
1066#ifdef CONFIG_PNP
1067static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
1068 const struct pnp_card_device_id *pid)

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

1118
1119static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard)
1120{
1121 snd_card_free(pnp_get_card_drvdata(pcard));
1122 pnp_set_card_drvdata(pcard, NULL);
1123 snd_opti9xx_pnp_is_probed = 0;
1124}
1125
1103 .driver = {
1104 .name = DEV_NAME
1105 },
1106};
1107
1108#ifdef CONFIG_PNP
1109static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
1110 const struct pnp_card_device_id *pid)

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

1160
1161static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard)
1162{
1163 snd_card_free(pnp_get_card_drvdata(pcard));
1164 pnp_set_card_drvdata(pcard, NULL);
1165 snd_opti9xx_pnp_is_probed = 0;
1166}
1167
1168#ifdef CONFIG_PM
1169static 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
1175static 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
1126static struct pnp_card_driver opti9xx_pnpc_driver = {
1127 .flags = PNP_DRIVER_RES_DISABLE,
1128 .name = "opti9xx",
1129 .id_table = snd_opti9xx_pnpids,
1130 .probe = snd_opti9xx_pnp_probe,
1131 .remove = __devexit_p(snd_opti9xx_pnp_remove),
1181static struct pnp_card_driver opti9xx_pnpc_driver = {
1182 .flags = PNP_DRIVER_RES_DISABLE,
1183 .name = "opti9xx",
1184 .id_table = snd_opti9xx_pnpids,
1185 .probe = snd_opti9xx_pnp_probe,
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
1132};
1133#endif
1134
1135#ifdef OPTi93X
1136#define CHIP_NAME "82C93x"
1137#else
1138#define CHIP_NAME "82C92x"
1139#endif

--- 25 unchanged lines hidden ---
1191};
1192#endif
1193
1194#ifdef OPTi93X
1195#define CHIP_NAME "82C93x"
1196#else
1197#define CHIP_NAME "82C92x"
1198#endif

--- 25 unchanged lines hidden ---