summaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx/miro.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opti9xx/miro.c')
-rw-r--r--sound/isa/opti9xx/miro.c80
1 files changed, 36 insertions, 44 deletions
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 1dd98375ac85..cd29b30b362e 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -25,7 +25,7 @@
#include <sound/driver.h>
#include <linux/init.h>
#include <linux/err.h>
-#include <linux/platform_device.h>
+#include <linux/isa.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/ioport.h>
@@ -137,10 +137,6 @@ struct snd_miro {
static void snd_miro_proc_init(struct snd_miro * miro);
-#define DRIVER_NAME "snd-miro"
-
-static struct platform_device *device;
-
static char * snd_opti9xx_names[] = {
"unkown",
"82C928", "82C929",
@@ -558,7 +554,7 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol,
return change;
}
-static struct snd_kcontrol_new snd_miro_controls[] = {
+static struct snd_kcontrol_new snd_miro_controls[] __devinitdata = {
MIRO_DOUBLE("Master Playback Volume", 0, ACI_GET_MASTER, ACI_SET_MASTER),
MIRO_DOUBLE("Mic Playback Volume", 1, ACI_GET_MIC, ACI_SET_MIC),
MIRO_DOUBLE("Line Playback Volume", 1, ACI_GET_LINE, ACI_SET_LINE),
@@ -570,7 +566,7 @@ MIRO_DOUBLE("Aux Playback Volume", 2, ACI_GET_LINE2, ACI_SET_LINE2),
/* Equalizer with seven bands (only PCM20)
from -12dB up to +12dB on each band */
-static struct snd_kcontrol_new snd_miro_eq_controls[] = {
+static struct snd_kcontrol_new snd_miro_eq_controls[] __devinitdata = {
MIRO_DOUBLE("Tone Control - 28 Hz", 0, ACI_GET_EQ1, ACI_SET_EQ1),
MIRO_DOUBLE("Tone Control - 160 Hz", 0, ACI_GET_EQ2, ACI_SET_EQ2),
MIRO_DOUBLE("Tone Control - 400 Hz", 0, ACI_GET_EQ3, ACI_SET_EQ3),
@@ -580,15 +576,15 @@ MIRO_DOUBLE("Tone Control - 6.3 kHz", 0, ACI_GET_EQ6, ACI_SET_EQ6),
MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7),
};
-static struct snd_kcontrol_new snd_miro_radio_control[] = {
+static struct snd_kcontrol_new snd_miro_radio_control[] __devinitdata = {
MIRO_DOUBLE("Radio Playback Volume", 0, ACI_GET_LINE1, ACI_SET_LINE1),
};
-static struct snd_kcontrol_new snd_miro_line_control[] = {
+static struct snd_kcontrol_new snd_miro_line_control[] __devinitdata = {
MIRO_DOUBLE("Line Playback Volume", 2, ACI_GET_LINE1, ACI_SET_LINE1),
};
-static struct snd_kcontrol_new snd_miro_preamp_control[] = {
+static struct snd_kcontrol_new snd_miro_preamp_control[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Mic Boost",
@@ -598,7 +594,7 @@ static struct snd_kcontrol_new snd_miro_preamp_control[] = {
.put = snd_miro_put_preamp,
}};
-static struct snd_kcontrol_new snd_miro_amp_control[] = {
+static struct snd_kcontrol_new snd_miro_amp_control[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Line Boost",
@@ -608,7 +604,7 @@ static struct snd_kcontrol_new snd_miro_amp_control[] = {
.put = snd_miro_put_amp,
}};
-static struct snd_kcontrol_new snd_miro_capture_control[] = {
+static struct snd_kcontrol_new snd_miro_capture_control[] __devinitdata = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Capture Switch",
@@ -618,7 +614,7 @@ static struct snd_kcontrol_new snd_miro_capture_control[] = {
.put = snd_miro_put_capture,
}};
-static unsigned char aci_init_values[][2] __initdata = {
+static unsigned char aci_init_values[][2] __devinitdata = {
{ ACI_SET_MUTE, 0x00 },
{ ACI_SET_POWERAMP, 0x00 },
{ ACI_SET_PREAMP, 0x00 },
@@ -641,7 +637,7 @@ static unsigned char aci_init_values[][2] __initdata = {
{ ACI_SET_MASTER + 1, 0x20 },
};
-static int __init snd_set_aci_init_values(struct snd_miro *miro)
+static int __devinit snd_set_aci_init_values(struct snd_miro *miro)
{
int idx, error;
@@ -751,7 +747,8 @@ static long snd_legacy_find_free_ioport(long *port_table, long size)
return -1;
}
-static int __init snd_miro_init(struct snd_miro *chip, unsigned short hardware)
+static int __devinit snd_miro_init(struct snd_miro *chip,
+ unsigned short hardware)
{
static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
@@ -962,7 +959,7 @@ static void snd_miro_proc_read(struct snd_info_entry * entry,
snd_iprintf(buffer, " preamp : 0x%x\n", miro->aci_preamp);
}
-static void __init snd_miro_proc_init(struct snd_miro * miro)
+static void __devinit snd_miro_proc_init(struct snd_miro * miro)
{
struct snd_info_entry *entry;
@@ -974,7 +971,7 @@ static void __init snd_miro_proc_init(struct snd_miro * miro)
* Init
*/
-static int __init snd_miro_configure(struct snd_miro *chip)
+static int __devinit snd_miro_configure(struct snd_miro *chip)
{
unsigned char wss_base_bits;
unsigned char irq_bits;
@@ -1131,7 +1128,8 @@ __skip_mpu:
return 0;
}
-static int __init snd_card_miro_detect(struct snd_card *card, struct snd_miro *chip)
+static int __devinit snd_card_miro_detect(struct snd_card *card,
+ struct snd_miro *chip)
{
int i, err;
unsigned char value;
@@ -1157,7 +1155,8 @@ static int __init snd_card_miro_detect(struct snd_card *card, struct snd_miro *c
return -ENODEV;
}
-static int __init snd_card_miro_aci_detect(struct snd_card *card, struct snd_miro * miro)
+static int __devinit snd_card_miro_aci_detect(struct snd_card *card,
+ struct snd_miro * miro)
{
unsigned char regval;
int i;
@@ -1213,7 +1212,12 @@ static void snd_card_miro_free(struct snd_card *card)
release_and_free_resource(miro->res_mc_base);
}
-static int __init snd_miro_probe(struct platform_device *devptr)
+static int __devinit snd_miro_match(struct device *devptr, unsigned int n)
+{
+ return 1;
+}
+
+static int __devinit snd_miro_probe(struct device *devptr, unsigned int n)
{
static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
static long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1};
@@ -1399,56 +1403,44 @@ static int __init snd_miro_probe(struct platform_device *devptr)
return error;
}
- snd_card_set_dev(card, &devptr->dev);
+ snd_card_set_dev(card, devptr);
if ((error = snd_card_register(card))) {
snd_card_free(card);
return error;
}
- platform_set_drvdata(devptr, card);
+ dev_set_drvdata(devptr, card);
return 0;
}
-static int __devexit snd_miro_remove(struct platform_device *devptr)
+static int __devexit snd_miro_remove(struct device *devptr, unsigned int dev)
{
- snd_card_free(platform_get_drvdata(devptr));
- platform_set_drvdata(devptr, NULL);
+ snd_card_free(dev_get_drvdata(devptr));
+ dev_set_drvdata(devptr, NULL);
return 0;
}
-static struct platform_driver snd_miro_driver = {
+#define DEV_NAME "miro"
+
+static struct isa_driver snd_miro_driver = {
+ .match = snd_miro_match,
.probe = snd_miro_probe,
.remove = __devexit_p(snd_miro_remove),
/* FIXME: suspend/resume */
.driver = {
- .name = DRIVER_NAME
+ .name = DEV_NAME
},
};
static int __init alsa_card_miro_init(void)
{
- int error;
-
- if ((error = platform_driver_register(&snd_miro_driver)) < 0)
- return error;
- device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
- if (! IS_ERR(device)) {
- if (platform_get_drvdata(device))
- return 0;
- platform_device_unregister(device);
- }
-#ifdef MODULE
- printk(KERN_ERR "no miro soundcard found\n");
-#endif
- platform_driver_unregister(&snd_miro_driver);
- return PTR_ERR(device);
+ return isa_register_driver(&snd_miro_driver, 1);
}
static void __exit alsa_card_miro_exit(void)
{
- platform_device_unregister(device);
- platform_driver_unregister(&snd_miro_driver);
+ isa_unregister_driver(&snd_miro_driver);
}
module_init(alsa_card_miro_init)
OpenPOWER on IntegriCloud