Revision 36cd6f6f arch_init.c

b/arch_init.c
899 899
    } init;
900 900
};
901 901

  
902
static struct soundhw soundhw[] = {
903
#ifdef HAS_AUDIO_CHOICE
904
#ifdef CONFIG_PCSPK
905
    {
906
        "pcspk",
907
        "PC speaker",
908
        0,
909
        1,
910
        { .init_isa = pcspk_audio_init }
911
    },
912
#endif
913

  
914
#ifdef CONFIG_SB16
915
    {
916
        "sb16",
917
        "Creative Sound Blaster 16",
918
        0,
919
        1,
920
        { .init_isa = SB16_init }
921
    },
922
#endif
923

  
924
#ifdef CONFIG_CS4231A
925
    {
926
        "cs4231a",
927
        "CS4231A",
928
        0,
929
        1,
930
        { .init_isa = cs4231a_init }
931
    },
932
#endif
933

  
934
#ifdef CONFIG_ADLIB
935
    {
936
        "adlib",
937
#ifdef HAS_YMF262
938
        "Yamaha YMF262 (OPL3)",
939
#else
940
        "Yamaha YM3812 (OPL2)",
941
#endif
942
        0,
943
        1,
944
        { .init_isa = Adlib_init }
945
    },
946
#endif
947

  
948
#ifdef CONFIG_GUS
949
    {
950
        "gus",
951
        "Gravis Ultrasound GF1",
952
        0,
953
        1,
954
        { .init_isa = GUS_init }
955
    },
956
#endif
957

  
958
#ifdef CONFIG_AC97
959
    {
960
        "ac97",
961
        "Intel 82801AA AC97 Audio",
962
        0,
963
        0,
964
        { .init_pci = ac97_init }
965
    },
966
#endif
902
static struct soundhw soundhw[9];
903
static int soundhw_count;
967 904

  
968
#ifdef CONFIG_ES1370
969
    {
970
        "es1370",
971
        "ENSONIQ AudioPCI ES1370",
972
        0,
973
        0,
974
        { .init_pci = es1370_init }
975
    },
976
#endif
977

  
978
#ifdef CONFIG_HDA
979
    {
980
        "hda",
981
        "Intel HD Audio",
982
        0,
983
        0,
984
        { .init_pci = intel_hda_and_codec_init }
985
    },
986
#endif
987

  
988
#endif /* HAS_AUDIO_CHOICE */
905
void isa_register_soundhw(const char *name, const char *descr,
906
                          int (*init_isa)(ISABus *bus))
907
{
908
    assert(soundhw_count < ARRAY_SIZE(soundhw) - 1);
909
    soundhw[soundhw_count].name = name;
910
    soundhw[soundhw_count].descr = descr;
911
    soundhw[soundhw_count].isa = 1;
912
    soundhw[soundhw_count].init.init_isa = init_isa;
913
    soundhw_count++;
914
}
989 915

  
990
    { NULL, NULL, 0, 0, { NULL } }
991
};
916
void pci_register_soundhw(const char *name, const char *descr,
917
                          int (*init_pci)(PCIBus *bus))
918
{
919
    assert(soundhw_count < ARRAY_SIZE(soundhw) - 1);
920
    soundhw[soundhw_count].name = name;
921
    soundhw[soundhw_count].descr = descr;
922
    soundhw[soundhw_count].isa = 0;
923
    soundhw[soundhw_count].init.init_pci = init_pci;
924
    soundhw_count++;
925
}
992 926

  
993 927
void select_soundhw(const char *optarg)
994 928
{
......
997 931
    if (is_help_option(optarg)) {
998 932
    show_valid_cards:
999 933

  
1000
#ifdef HAS_AUDIO_CHOICE
1001
        printf("Valid sound card names (comma separated):\n");
1002
        for (c = soundhw; c->name; ++c) {
1003
            printf ("%-11s %s\n", c->name, c->descr);
934
        if (soundhw_count) {
935
             printf("Valid sound card names (comma separated):\n");
936
             for (c = soundhw; c->name; ++c) {
937
                 printf ("%-11s %s\n", c->name, c->descr);
938
             }
939
             printf("\n-soundhw all will enable all of the above\n");
940
        } else {
941
             printf("Machine has no user-selectable audio hardware "
942
                    "(it may or may not have always-present audio hardware).\n");
1004 943
        }
1005
        printf("\n-soundhw all will enable all of the above\n");
1006
#else
1007
        printf("Machine has no user-selectable audio hardware "
1008
               "(it may or may not have always-present audio hardware).\n");
1009
#endif
1010 944
        exit(!is_help_option(optarg));
1011 945
    }
1012 946
    else {

Also available in: Unified diff