serial-u16550.c (d9bc125caf592b7d081021f32ce5b717efdf70c8) serial-u16550.c (788c6043335590e0a483fdc18f85b1405a157bf9)
1/*
2 * serial.c
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>,
4 * Isaku Yamahata <yamahata@private.email.ne.jp>,
5 * George Hansper <ghansper@apana.org.au>,
6 * Hannu Savolainen
7 *
8 * This code is based on the code from ALSA 0.5.9, but heavily rewritten.

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

322 spin_unlock_irqrestore(&uart->open_lock, flags);
323}
324
325/*
326 * this method probes, if an uart sits on given port
327 * return 0 if found
328 * return negative error if not found
329 */
1/*
2 * serial.c
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>,
4 * Isaku Yamahata <yamahata@private.email.ne.jp>,
5 * George Hansper <ghansper@apana.org.au>,
6 * Hannu Savolainen
7 *
8 * This code is based on the code from ALSA 0.5.9, but heavily rewritten.

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

322 spin_unlock_irqrestore(&uart->open_lock, flags);
323}
324
325/*
326 * this method probes, if an uart sits on given port
327 * return 0 if found
328 * return negative error if not found
329 */
330static int __init snd_uart16550_detect(struct snd_uart16550 *uart)
330static int __devinit snd_uart16550_detect(struct snd_uart16550 *uart)
331{
332 unsigned long io_base = uart->base;
333 int ok;
334 unsigned char c;
335
336 /* Do some vague tests for the presence of the uart */
337 if (io_base == 0 || io_base == SNDRV_AUTO_PORT) {
338 return -ENODEV; /* Not configured */

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

776};
777
778static int snd_uart16550_dev_free(struct snd_device *device)
779{
780 struct snd_uart16550 *uart = device->device_data;
781 return snd_uart16550_free(uart);
782}
783
331{
332 unsigned long io_base = uart->base;
333 int ok;
334 unsigned char c;
335
336 /* Do some vague tests for the presence of the uart */
337 if (io_base == 0 || io_base == SNDRV_AUTO_PORT) {
338 return -ENODEV; /* Not configured */

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

776};
777
778static int snd_uart16550_dev_free(struct snd_device *device)
779{
780 struct snd_uart16550 *uart = device->device_data;
781 return snd_uart16550_free(uart);
782}
783
784static int __init snd_uart16550_create(struct snd_card *card,
784static int __devinit snd_uart16550_create(struct snd_card *card,
785 unsigned long iobase,
786 int irq,
787 unsigned int speed,
788 unsigned int base,
789 int adaptor,
790 int droponfull,
791 struct snd_uart16550 **ruart)
792{

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

855 }
856
857 if (ruart)
858 *ruart = uart;
859
860 return 0;
861}
862
785 unsigned long iobase,
786 int irq,
787 unsigned int speed,
788 unsigned int base,
789 int adaptor,
790 int droponfull,
791 struct snd_uart16550 **ruart)
792{

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

855 }
856
857 if (ruart)
858 *ruart = uart;
859
860 return 0;
861}
862
863static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream)
863static void __devinit snd_uart16550_substreams(struct snd_rawmidi_str *stream)
864{
865 struct snd_rawmidi_substream *substream;
866
867 list_for_each_entry(substream, &stream->substreams, list) {
868 sprintf(substream->name, "Serial MIDI %d", substream->number + 1);
869 }
870}
871
864{
865 struct snd_rawmidi_substream *substream;
866
867 list_for_each_entry(substream, &stream->substreams, list) {
868 sprintf(substream->name, "Serial MIDI %d", substream->number + 1);
869 }
870}
871
872static int __init snd_uart16550_rmidi(struct snd_uart16550 *uart, int device,
872static int __devinit snd_uart16550_rmidi(struct snd_uart16550 *uart, int device,
873 int outs, int ins,
874 struct snd_rawmidi **rmidi)
875{
876 struct snd_rawmidi *rrawmidi;
877 int err;
878
879 err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device,
880 outs, ins, &rrawmidi);

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

891 SNDRV_RAWMIDI_INFO_INPUT |
892 SNDRV_RAWMIDI_INFO_DUPLEX;
893 rrawmidi->private_data = uart;
894 if (rmidi)
895 *rmidi = rrawmidi;
896 return 0;
897}
898
873 int outs, int ins,
874 struct snd_rawmidi **rmidi)
875{
876 struct snd_rawmidi *rrawmidi;
877 int err;
878
879 err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device,
880 outs, ins, &rrawmidi);

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

891 SNDRV_RAWMIDI_INFO_INPUT |
892 SNDRV_RAWMIDI_INFO_DUPLEX;
893 rrawmidi->private_data = uart;
894 if (rmidi)
895 *rmidi = rrawmidi;
896 return 0;
897}
898
899static int __init snd_serial_probe(struct platform_device *devptr)
899static int __devinit snd_serial_probe(struct platform_device *devptr)
900{
901 struct snd_card *card;
902 struct snd_uart16550 *uart;
903 int err;
904 int dev = devptr->id;
905
906 switch (adaptor[dev]) {
907 case SNDRV_SERIAL_SOUNDCANVAS:

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

976 platform_set_drvdata(devptr, card);
977 return 0;
978
979 _err:
980 snd_card_free(card);
981 return err;
982}
983
900{
901 struct snd_card *card;
902 struct snd_uart16550 *uart;
903 int err;
904 int dev = devptr->id;
905
906 switch (adaptor[dev]) {
907 case SNDRV_SERIAL_SOUNDCANVAS:

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

976 platform_set_drvdata(devptr, card);
977 return 0;
978
979 _err:
980 snd_card_free(card);
981 return err;
982}
983
984static int snd_serial_remove(struct platform_device *devptr)
984static int __devexit snd_serial_remove(struct platform_device *devptr)
985{
986 snd_card_free(platform_get_drvdata(devptr));
987 platform_set_drvdata(devptr, NULL);
988 return 0;
989}
990
991#define SND_SERIAL_DRIVER "snd_serial_u16550"
992
993static struct platform_driver snd_serial_driver = {
994 .probe = snd_serial_probe,
985{
986 snd_card_free(platform_get_drvdata(devptr));
987 platform_set_drvdata(devptr, NULL);
988 return 0;
989}
990
991#define SND_SERIAL_DRIVER "snd_serial_u16550"
992
993static struct platform_driver snd_serial_driver = {
994 .probe = snd_serial_probe,
995 .remove = snd_serial_remove,
995 .remove = __devexit_p( snd_serial_remove),
996 .driver = {
997 .name = SND_SERIAL_DRIVER
998 },
999};
1000
1001static void __init_or_module snd_serial_unregister_all(void)
1002{
1003 int i;

--- 46 unchanged lines hidden ---
996 .driver = {
997 .name = SND_SERIAL_DRIVER
998 },
999};
1000
1001static void __init_or_module snd_serial_unregister_all(void)
1002{
1003 int i;

--- 46 unchanged lines hidden ---