Commit ff2db7c5ab78817eb3c5d15dd87f18e9be726f1a
1 parent
fa6688e1c7
Exists in
master
and in
4 other branches
m68k: amiga - Sound platform device conversion
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Showing 2 changed files with 36 additions and 20 deletions Side-by-side Diff
arch/m68k/amiga/platform.c
... | ... | @@ -67,6 +67,11 @@ |
67 | 67 | if (AMIGAHW_PRESENT(AMI_VIDEO)) |
68 | 68 | platform_device_register_simple("amiga-video", -1, NULL, 0); |
69 | 69 | |
70 | + | |
71 | + /* sound hardware */ | |
72 | + if (AMIGAHW_PRESENT(AMI_AUDIO)) | |
73 | + platform_device_register_simple("amiga-audio", -1, NULL, 0); | |
74 | + | |
70 | 75 | return 0; |
71 | 76 | } |
72 | 77 |
sound/oss/dmasound/dmasound_paula.c
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #include <linux/ioport.h> |
22 | 22 | #include <linux/soundcard.h> |
23 | 23 | #include <linux/interrupt.h> |
24 | +#include <linux/platform_device.h> | |
24 | 25 | |
25 | 26 | #include <asm/uaccess.h> |
26 | 27 | #include <asm/setup.h> |
27 | 28 | |
28 | 29 | |
29 | 30 | |
30 | 31 | |
31 | 32 | |
... | ... | @@ -710,32 +711,42 @@ |
710 | 711 | /*** Config & Setup **********************************************************/ |
711 | 712 | |
712 | 713 | |
713 | -static int __init dmasound_paula_init(void) | |
714 | +static int __init amiga_audio_probe(struct platform_device *pdev) | |
714 | 715 | { |
715 | - int err; | |
716 | - | |
717 | - if (MACH_IS_AMIGA && AMIGAHW_PRESENT(AMI_AUDIO)) { | |
718 | - if (!request_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40, | |
719 | - "dmasound [Paula]")) | |
720 | - return -EBUSY; | |
721 | - dmasound.mach = machAmiga; | |
722 | - dmasound.mach.default_hard = def_hard ; | |
723 | - dmasound.mach.default_soft = def_soft ; | |
724 | - err = dmasound_init(); | |
725 | - if (err) | |
726 | - release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40); | |
727 | - return err; | |
728 | - } else | |
729 | - return -ENODEV; | |
716 | + dmasound.mach = machAmiga; | |
717 | + dmasound.mach.default_hard = def_hard ; | |
718 | + dmasound.mach.default_soft = def_soft ; | |
719 | + return dmasound_init(); | |
730 | 720 | } |
731 | 721 | |
732 | -static void __exit dmasound_paula_cleanup(void) | |
722 | +static int __exit amiga_audio_remove(struct platform_device *pdev) | |
733 | 723 | { |
734 | 724 | dmasound_deinit(); |
735 | - release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40); | |
725 | + return 0; | |
736 | 726 | } |
737 | 727 | |
738 | -module_init(dmasound_paula_init); | |
739 | -module_exit(dmasound_paula_cleanup); | |
728 | +static struct platform_driver amiga_audio_driver = { | |
729 | + .remove = __exit_p(amiga_audio_remove), | |
730 | + .driver = { | |
731 | + .name = "amiga-audio", | |
732 | + .owner = THIS_MODULE, | |
733 | + }, | |
734 | +}; | |
735 | + | |
736 | +static int __init amiga_audio_init(void) | |
737 | +{ | |
738 | + return platform_driver_probe(&amiga_audio_driver, amiga_audio_probe); | |
739 | +} | |
740 | + | |
741 | +module_init(amiga_audio_init); | |
742 | + | |
743 | +static void __exit amiga_audio_exit(void) | |
744 | +{ | |
745 | + platform_driver_unregister(&amiga_audio_driver); | |
746 | +} | |
747 | + | |
748 | +module_exit(amiga_audio_exit); | |
749 | + | |
740 | 750 | MODULE_LICENSE("GPL"); |
751 | +MODULE_ALIAS("platform:amiga-audio"); |