Ignore:
Timestamp:
Jul 13, 2007, 4:47:31 PM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to Alsa 0.9.0rc3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c

    r206 r210  
    10021002static struct snd_kcontrol_new snd_cmipci_spdif_default __devinitdata =
    10031003{
    1004     SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    1005     SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),0,0,0,
    1006     snd_cmipci_spdif_default_info,
    1007     snd_cmipci_spdif_default_get,
    1008     snd_cmipci_spdif_default_put,0
     1004        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
     1005        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
     1006        .info =         snd_cmipci_spdif_default_info,
     1007        .get =          snd_cmipci_spdif_default_get,
     1008        .put =          snd_cmipci_spdif_default_put
    10091009};
    10101010
     
    10291029static struct snd_kcontrol_new snd_cmipci_spdif_mask __devinitdata =
    10301030{
    1031     SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    1032     SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),0,
    1033     SNDRV_CTL_ELEM_ACCESS_READ,0,
    1034     snd_cmipci_spdif_mask_info,
    1035     snd_cmipci_spdif_mask_get,0,0
     1031        .access =       SNDRV_CTL_ELEM_ACCESS_READ,
     1032        .iface =        SNDRV_CTL_ELEM_IFACE_MIXER,
     1033        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,CON_MASK),
     1034        .info =         snd_cmipci_spdif_mask_info,
     1035        .get =          snd_cmipci_spdif_mask_get,
    10361036};
    10371037
     
    10761076static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata =
    10771077{
    1078     SNDRV_CTL_ELEM_IFACE_PCM,0,0,
    1079     SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),0,
    1080     SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,0,
    1081     snd_cmipci_spdif_stream_info,
    1082     snd_cmipci_spdif_stream_get,
    1083     snd_cmipci_spdif_stream_put,0
     1078        .access =       SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
     1079        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
     1080        .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,PCM_STREAM),
     1081        .info =         snd_cmipci_spdif_stream_info,
     1082        .get =          snd_cmipci_spdif_stream_get,
     1083        .put =          snd_cmipci_spdif_stream_put
    10841084};
    10851085
     
    18391839
    18401840#define CMIPCI_DOUBLE(xname, left_reg, right_reg, left_shift, right_shift, mask, invert, stereo) \
    1841     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    1842     0, 0, snd_cmipci_info_volume, \
    1843     snd_cmipci_get_volume, snd_cmipci_put_volume, \
    1844     0,\
    1845     COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \
     1841{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     1842 .info = snd_cmipci_info_volume, \
     1843 .get = snd_cmipci_get_volume, .put = snd_cmipci_put_volume, \
     1844 .private_value = COMPOSE_SB_REG(left_reg, right_reg, left_shift, right_shift, mask, invert, stereo), \
    18461845    }
    18471846
     
    19411940 */
    19421941#define CMIPCI_SB_INPUT_SW(xname, left_shift, right_shift) \
    1943     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    1944     0, 0, snd_cmipci_info_input_sw, \
    1945     snd_cmipci_get_input_sw, snd_cmipci_put_input_sw, \
    1946     0, \
    1947     COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \
     1942{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     1943  .info = snd_cmipci_info_input_sw, \
     1944  .get = snd_cmipci_get_input_sw, .put = snd_cmipci_put_input_sw, \
     1945  .private_value = COMPOSE_SB_REG(SB_DSP4_INPUT_LEFT, SB_DSP4_INPUT_RIGHT, left_shift, right_shift, 1, 0, 1), \
    19481946    }
    19491947static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol,
     
    20062004
    20072005#define CMIPCI_MIXER_SW_STEREO(xname, reg, lshift, rshift, invert) \
    2008     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    2009     0, 0, snd_cmipci_info_native_mixer, \
    2010     snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \
    2011     0, \
    2012     COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \
     2006{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     2007  .info = snd_cmipci_info_native_mixer, \
     2008  .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \
     2009  .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, 1, invert, 1), \
    20132010    }
    20142011
    20152012#define CMIPCI_MIXER_SW_MONO(xname, reg, shift, invert) \
    2016     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    2017     0, 0, snd_cmipci_info_native_mixer, \
    2018     snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \
    2019     0, \
    2020     COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \
     2013{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     2014  .info = snd_cmipci_info_native_mixer, \
     2015  .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \
     2016  .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, 1, invert, 0), \
    20212017    }
    20222018
    20232019#define CMIPCI_MIXER_VOL_STEREO(xname, reg, lshift, rshift, mask) \
    2024     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    2025     0, 0, snd_cmipci_info_native_mixer, \
    2026     snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \
    2027     0, \
    2028     COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \
     2020{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     2021  .info = snd_cmipci_info_native_mixer, \
     2022  .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \
     2023  .private_value = COMPOSE_SB_REG(reg, reg, lshift, rshift, mask, 0, 1), \
    20292024    }
    20302025
    20312026#define CMIPCI_MIXER_VOL_MONO(xname, reg, shift, mask) \
    2032     { SNDRV_CTL_ELEM_IFACE_MIXER, 0, 0, xname, 0, \
    2033     0, 0, snd_cmipci_info_native_mixer, \
    2034     snd_cmipci_get_native_mixer, snd_cmipci_put_native_mixer, \
    2035     0, \
    2036     COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \
     2027{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
     2028  .info = snd_cmipci_info_native_mixer, \
     2029  .get = snd_cmipci_get_native_mixer, .put = snd_cmipci_put_native_mixer, \
     2030  .private_value = COMPOSE_SB_REG(reg, reg, shift, shift, mask, 0, 0), \
    20372031    }
    20382032
     
    21292123    //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1),
    21302124    { /* switch with sensitivity */
    2131         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    2132         "PCM Playback Switch",0,0,0,
    2133         snd_cmipci_info_native_mixer,
    2134         snd_cmipci_get_native_mixer_sensitive,
    2135         snd_cmipci_put_native_mixer_sensitive,
    2136         0,
    2137         COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0),
     2125                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     2126                .name = "PCM Playback Switch",
     2127                .info = snd_cmipci_info_native_mixer,
     2128                .get = snd_cmipci_get_native_mixer_sensitive,
     2129                .put = snd_cmipci_put_native_mixer_sensitive,
     2130                .private_value = COMPOSE_SB_REG(CM_REG_MIXER1, CM_REG_MIXER1, CM_WSMUTE_SHIFT, CM_WSMUTE_SHIFT, 1, 1, 0),
    21382131    },
    21392132    CMIPCI_MIXER_SW_STEREO("PCM Capture Switch", CM_REG_MIXER1, CM_WAVEINL_SHIFT, CM_WAVEINR_SHIFT, 0),
     
    22602253}
    22612254
     2255#ifdef TARGET_OS2
    22622256#define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \
    22632257    static struct cmipci_switch_args cmipci_switch_arg_##sname = { \
    2264     xreg, \
    2265     xmask, \
    2266     xmask_on, \
    2267     xis_byte, \
    2268     xac3, \
    2269     }
     2258  xreg, \
     2259  xmask, \
     2260  xmask_on, \
     2261  xis_byte, \
     2262  xac3, \
     2263    }
     2264#else
     2265#define DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask_on, xis_byte, xac3) \
     2266    static struct cmipci_switch_args cmipci_switch_arg_##sname = { \
     2267  .reg = xreg, \
     2268  .mask = xmask, \
     2269  .mask_on = xmask_on, \
     2270  .is_byte = xis_byte, \
     2271  .ac3_sensitive = xac3, \
     2272    }
     2273#endif
    22702274
    22712275#define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \
     
    23052309// safe to do so in this case)
    23062310#define DEFINE_SWITCH(sname, stype, sarg) \
    2307     { stype, 0, 0, \
    2308     sname, 0, 0, 0, \
    2309     snd_cmipci_uswitch_info, \
    2310     snd_cmipci_uswitch_get, \
    2311     snd_cmipci_uswitch_put, \
    2312     0, \
    2313     (unsigned long)&cmipci_switch_arg_##sarg,\
     2311{ .name = sname, \
     2312  .iface = stype, \
     2313  .info = snd_cmipci_uswitch_info, \
     2314  .get = snd_cmipci_uswitch_get, \
     2315  .put = snd_cmipci_uswitch_put, \
     2316  .private_value = (unsigned long)&cmipci_switch_arg_##sarg,\
    23142317    }
    23152318
     
    24732476#endif
    24742477    // DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable),
    2475     {
    2476         SNDRV_CTL_ELEM_IFACE_MIXER,0,0,
    2477         "IEC958 Output Switch",0,0, 0,
    2478         snd_cmipci_uswitch_info,
    2479         snd_cmipci_spdout_enable_get,
    2480         snd_cmipci_spdout_enable_put,0
     2478        { .name = "IEC958 Output Switch",
     2479          .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
     2480          .info = snd_cmipci_uswitch_info,
     2481          .get = snd_cmipci_spdout_enable_get,
     2482          .put = snd_cmipci_spdout_enable_put,
    24812483    },
    24822484    DEFINE_MIXER_SWITCH("IEC958 In Valid", spdi_valid),
Note: See TracChangeset for help on using the changeset viewer.