diff options
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 239 |
1 files changed, 142 insertions, 97 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index b12308b5ba2a..748e36c66603 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -971,6 +971,7 @@ static inline void snd_hdspm_initialize_midi_flush(struct hdspm *hdspm); | |||
971 | static int hdspm_update_simple_mixer_controls(struct hdspm *hdspm); | 971 | static int hdspm_update_simple_mixer_controls(struct hdspm *hdspm); |
972 | static int hdspm_autosync_ref(struct hdspm *hdspm); | 972 | static int hdspm_autosync_ref(struct hdspm *hdspm); |
973 | static int snd_hdspm_set_defaults(struct hdspm *hdspm); | 973 | static int snd_hdspm_set_defaults(struct hdspm *hdspm); |
974 | static int hdspm_system_clock_mode(struct hdspm *hdspm); | ||
974 | static void hdspm_set_sgbuf(struct hdspm *hdspm, | 975 | static void hdspm_set_sgbuf(struct hdspm *hdspm, |
975 | struct snd_pcm_substream *substream, | 976 | struct snd_pcm_substream *substream, |
976 | unsigned int reg, int channels); | 977 | unsigned int reg, int channels); |
@@ -1989,10 +1990,14 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm) | |||
1989 | rate = hdspm_calc_dds_value(hdspm, period); | 1990 | rate = hdspm_calc_dds_value(hdspm, period); |
1990 | 1991 | ||
1991 | if (rate > 207000) { | 1992 | if (rate > 207000) { |
1992 | /* Unreasonable high sample rate as seen on PCI MADI cards. | 1993 | /* Unreasonable high sample rate as seen on PCI MADI cards. */ |
1993 | * Use the cached value instead. | 1994 | if (0 == hdspm_system_clock_mode(hdspm)) { |
1994 | */ | 1995 | /* master mode, return internal sample rate */ |
1995 | rate = hdspm->system_sample_rate; | 1996 | rate = hdspm->system_sample_rate; |
1997 | } else { | ||
1998 | /* slave mode, return external sample rate */ | ||
1999 | rate = hdspm_external_sample_rate(hdspm); | ||
2000 | } | ||
1996 | } | 2001 | } |
1997 | 2002 | ||
1998 | return rate; | 2003 | return rate; |
@@ -2000,12 +2005,14 @@ static int hdspm_get_system_sample_rate(struct hdspm *hdspm) | |||
2000 | 2005 | ||
2001 | 2006 | ||
2002 | #define HDSPM_SYSTEM_SAMPLE_RATE(xname, xindex) \ | 2007 | #define HDSPM_SYSTEM_SAMPLE_RATE(xname, xindex) \ |
2003 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2008 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2004 | .name = xname, \ | 2009 | .name = xname, \ |
2005 | .index = xindex, \ | 2010 | .index = xindex, \ |
2006 | .access = SNDRV_CTL_ELEM_ACCESS_READ, \ | 2011 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\ |
2007 | .info = snd_hdspm_info_system_sample_rate, \ | 2012 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ |
2008 | .get = snd_hdspm_get_system_sample_rate \ | 2013 | .info = snd_hdspm_info_system_sample_rate, \ |
2014 | .put = snd_hdspm_put_system_sample_rate, \ | ||
2015 | .get = snd_hdspm_get_system_sample_rate \ | ||
2009 | } | 2016 | } |
2010 | 2017 | ||
2011 | static int snd_hdspm_info_system_sample_rate(struct snd_kcontrol *kcontrol, | 2018 | static int snd_hdspm_info_system_sample_rate(struct snd_kcontrol *kcontrol, |
@@ -2030,6 +2037,16 @@ static int snd_hdspm_get_system_sample_rate(struct snd_kcontrol *kcontrol, | |||
2030 | return 0; | 2037 | return 0; |
2031 | } | 2038 | } |
2032 | 2039 | ||
2040 | static int snd_hdspm_put_system_sample_rate(struct snd_kcontrol *kcontrol, | ||
2041 | struct snd_ctl_elem_value * | ||
2042 | ucontrol) | ||
2043 | { | ||
2044 | struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); | ||
2045 | |||
2046 | hdspm_set_dds_value(hdspm, ucontrol->value.enumerated.item[0]); | ||
2047 | return 0; | ||
2048 | } | ||
2049 | |||
2033 | 2050 | ||
2034 | /** | 2051 | /** |
2035 | * Returns the WordClock sample rate class for the given card. | 2052 | * Returns the WordClock sample rate class for the given card. |
@@ -2163,6 +2180,7 @@ static int snd_hdspm_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, | |||
2163 | hdspm_get_s1_sample_rate(hdspm, | 2180 | hdspm_get_s1_sample_rate(hdspm, |
2164 | kcontrol->private_value-1); | 2181 | kcontrol->private_value-1); |
2165 | } | 2182 | } |
2183 | break; | ||
2166 | 2184 | ||
2167 | case AIO: | 2185 | case AIO: |
2168 | switch (kcontrol->private_value) { | 2186 | switch (kcontrol->private_value) { |
@@ -2183,6 +2201,7 @@ static int snd_hdspm_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, | |||
2183 | hdspm_get_s1_sample_rate(hdspm, | 2201 | hdspm_get_s1_sample_rate(hdspm, |
2184 | ucontrol->id.index-1); | 2202 | ucontrol->id.index-1); |
2185 | } | 2203 | } |
2204 | break; | ||
2186 | 2205 | ||
2187 | case AES32: | 2206 | case AES32: |
2188 | 2207 | ||
@@ -2204,8 +2223,23 @@ static int snd_hdspm_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, | |||
2204 | hdspm_get_s1_sample_rate(hdspm, | 2223 | hdspm_get_s1_sample_rate(hdspm, |
2205 | kcontrol->private_value-1); | 2224 | kcontrol->private_value-1); |
2206 | break; | 2225 | break; |
2226 | } | ||
2227 | break; | ||
2207 | 2228 | ||
2229 | case MADI: | ||
2230 | case MADIface: | ||
2231 | { | ||
2232 | int rate = hdspm_external_sample_rate(hdspm); | ||
2233 | int i, selected_rate = 0; | ||
2234 | for (i = 1; i < 10; i++) | ||
2235 | if (HDSPM_bit2freq(i) == rate) { | ||
2236 | selected_rate = i; | ||
2237 | break; | ||
2238 | } | ||
2239 | ucontrol->value.enumerated.item[0] = selected_rate; | ||
2208 | } | 2240 | } |
2241 | break; | ||
2242 | |||
2209 | default: | 2243 | default: |
2210 | break; | 2244 | break; |
2211 | } | 2245 | } |
@@ -2430,7 +2464,7 @@ static int snd_hdspm_put_clock_source(struct snd_kcontrol *kcontrol, | |||
2430 | 2464 | ||
2431 | 2465 | ||
2432 | #define HDSPM_PREF_SYNC_REF(xname, xindex) \ | 2466 | #define HDSPM_PREF_SYNC_REF(xname, xindex) \ |
2433 | {.iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2467 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2434 | .name = xname, \ | 2468 | .name = xname, \ |
2435 | .index = xindex, \ | 2469 | .index = xindex, \ |
2436 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\ | 2470 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |\ |
@@ -2766,12 +2800,12 @@ static int snd_hdspm_put_pref_sync_ref(struct snd_kcontrol *kcontrol, | |||
2766 | 2800 | ||
2767 | 2801 | ||
2768 | #define HDSPM_AUTOSYNC_REF(xname, xindex) \ | 2802 | #define HDSPM_AUTOSYNC_REF(xname, xindex) \ |
2769 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2803 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2770 | .name = xname, \ | 2804 | .name = xname, \ |
2771 | .index = xindex, \ | 2805 | .index = xindex, \ |
2772 | .access = SNDRV_CTL_ELEM_ACCESS_READ, \ | 2806 | .access = SNDRV_CTL_ELEM_ACCESS_READ, \ |
2773 | .info = snd_hdspm_info_autosync_ref, \ | 2807 | .info = snd_hdspm_info_autosync_ref, \ |
2774 | .get = snd_hdspm_get_autosync_ref, \ | 2808 | .get = snd_hdspm_get_autosync_ref, \ |
2775 | } | 2809 | } |
2776 | 2810 | ||
2777 | static int hdspm_autosync_ref(struct hdspm *hdspm) | 2811 | static int hdspm_autosync_ref(struct hdspm *hdspm) |
@@ -2855,12 +2889,12 @@ static int snd_hdspm_get_autosync_ref(struct snd_kcontrol *kcontrol, | |||
2855 | 2889 | ||
2856 | 2890 | ||
2857 | #define HDSPM_LINE_OUT(xname, xindex) \ | 2891 | #define HDSPM_LINE_OUT(xname, xindex) \ |
2858 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2892 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2859 | .name = xname, \ | 2893 | .name = xname, \ |
2860 | .index = xindex, \ | 2894 | .index = xindex, \ |
2861 | .info = snd_hdspm_info_line_out, \ | 2895 | .info = snd_hdspm_info_line_out, \ |
2862 | .get = snd_hdspm_get_line_out, \ | 2896 | .get = snd_hdspm_get_line_out, \ |
2863 | .put = snd_hdspm_put_line_out \ | 2897 | .put = snd_hdspm_put_line_out \ |
2864 | } | 2898 | } |
2865 | 2899 | ||
2866 | static int hdspm_line_out(struct hdspm * hdspm) | 2900 | static int hdspm_line_out(struct hdspm * hdspm) |
@@ -2912,12 +2946,12 @@ static int snd_hdspm_put_line_out(struct snd_kcontrol *kcontrol, | |||
2912 | 2946 | ||
2913 | 2947 | ||
2914 | #define HDSPM_TX_64(xname, xindex) \ | 2948 | #define HDSPM_TX_64(xname, xindex) \ |
2915 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 2949 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2916 | .name = xname, \ | 2950 | .name = xname, \ |
2917 | .index = xindex, \ | 2951 | .index = xindex, \ |
2918 | .info = snd_hdspm_info_tx_64, \ | 2952 | .info = snd_hdspm_info_tx_64, \ |
2919 | .get = snd_hdspm_get_tx_64, \ | 2953 | .get = snd_hdspm_get_tx_64, \ |
2920 | .put = snd_hdspm_put_tx_64 \ | 2954 | .put = snd_hdspm_put_tx_64 \ |
2921 | } | 2955 | } |
2922 | 2956 | ||
2923 | static int hdspm_tx_64(struct hdspm * hdspm) | 2957 | static int hdspm_tx_64(struct hdspm * hdspm) |
@@ -2968,12 +3002,12 @@ static int snd_hdspm_put_tx_64(struct snd_kcontrol *kcontrol, | |||
2968 | 3002 | ||
2969 | 3003 | ||
2970 | #define HDSPM_C_TMS(xname, xindex) \ | 3004 | #define HDSPM_C_TMS(xname, xindex) \ |
2971 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3005 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
2972 | .name = xname, \ | 3006 | .name = xname, \ |
2973 | .index = xindex, \ | 3007 | .index = xindex, \ |
2974 | .info = snd_hdspm_info_c_tms, \ | 3008 | .info = snd_hdspm_info_c_tms, \ |
2975 | .get = snd_hdspm_get_c_tms, \ | 3009 | .get = snd_hdspm_get_c_tms, \ |
2976 | .put = snd_hdspm_put_c_tms \ | 3010 | .put = snd_hdspm_put_c_tms \ |
2977 | } | 3011 | } |
2978 | 3012 | ||
2979 | static int hdspm_c_tms(struct hdspm * hdspm) | 3013 | static int hdspm_c_tms(struct hdspm * hdspm) |
@@ -3024,12 +3058,12 @@ static int snd_hdspm_put_c_tms(struct snd_kcontrol *kcontrol, | |||
3024 | 3058 | ||
3025 | 3059 | ||
3026 | #define HDSPM_SAFE_MODE(xname, xindex) \ | 3060 | #define HDSPM_SAFE_MODE(xname, xindex) \ |
3027 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3061 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3028 | .name = xname, \ | 3062 | .name = xname, \ |
3029 | .index = xindex, \ | 3063 | .index = xindex, \ |
3030 | .info = snd_hdspm_info_safe_mode, \ | 3064 | .info = snd_hdspm_info_safe_mode, \ |
3031 | .get = snd_hdspm_get_safe_mode, \ | 3065 | .get = snd_hdspm_get_safe_mode, \ |
3032 | .put = snd_hdspm_put_safe_mode \ | 3066 | .put = snd_hdspm_put_safe_mode \ |
3033 | } | 3067 | } |
3034 | 3068 | ||
3035 | static int hdspm_safe_mode(struct hdspm * hdspm) | 3069 | static int hdspm_safe_mode(struct hdspm * hdspm) |
@@ -3080,12 +3114,12 @@ static int snd_hdspm_put_safe_mode(struct snd_kcontrol *kcontrol, | |||
3080 | 3114 | ||
3081 | 3115 | ||
3082 | #define HDSPM_EMPHASIS(xname, xindex) \ | 3116 | #define HDSPM_EMPHASIS(xname, xindex) \ |
3083 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3117 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3084 | .name = xname, \ | 3118 | .name = xname, \ |
3085 | .index = xindex, \ | 3119 | .index = xindex, \ |
3086 | .info = snd_hdspm_info_emphasis, \ | 3120 | .info = snd_hdspm_info_emphasis, \ |
3087 | .get = snd_hdspm_get_emphasis, \ | 3121 | .get = snd_hdspm_get_emphasis, \ |
3088 | .put = snd_hdspm_put_emphasis \ | 3122 | .put = snd_hdspm_put_emphasis \ |
3089 | } | 3123 | } |
3090 | 3124 | ||
3091 | static int hdspm_emphasis(struct hdspm * hdspm) | 3125 | static int hdspm_emphasis(struct hdspm * hdspm) |
@@ -3136,12 +3170,12 @@ static int snd_hdspm_put_emphasis(struct snd_kcontrol *kcontrol, | |||
3136 | 3170 | ||
3137 | 3171 | ||
3138 | #define HDSPM_DOLBY(xname, xindex) \ | 3172 | #define HDSPM_DOLBY(xname, xindex) \ |
3139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3173 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3140 | .name = xname, \ | 3174 | .name = xname, \ |
3141 | .index = xindex, \ | 3175 | .index = xindex, \ |
3142 | .info = snd_hdspm_info_dolby, \ | 3176 | .info = snd_hdspm_info_dolby, \ |
3143 | .get = snd_hdspm_get_dolby, \ | 3177 | .get = snd_hdspm_get_dolby, \ |
3144 | .put = snd_hdspm_put_dolby \ | 3178 | .put = snd_hdspm_put_dolby \ |
3145 | } | 3179 | } |
3146 | 3180 | ||
3147 | static int hdspm_dolby(struct hdspm * hdspm) | 3181 | static int hdspm_dolby(struct hdspm * hdspm) |
@@ -3192,12 +3226,12 @@ static int snd_hdspm_put_dolby(struct snd_kcontrol *kcontrol, | |||
3192 | 3226 | ||
3193 | 3227 | ||
3194 | #define HDSPM_PROFESSIONAL(xname, xindex) \ | 3228 | #define HDSPM_PROFESSIONAL(xname, xindex) \ |
3195 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3229 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3196 | .name = xname, \ | 3230 | .name = xname, \ |
3197 | .index = xindex, \ | 3231 | .index = xindex, \ |
3198 | .info = snd_hdspm_info_professional, \ | 3232 | .info = snd_hdspm_info_professional, \ |
3199 | .get = snd_hdspm_get_professional, \ | 3233 | .get = snd_hdspm_get_professional, \ |
3200 | .put = snd_hdspm_put_professional \ | 3234 | .put = snd_hdspm_put_professional \ |
3201 | } | 3235 | } |
3202 | 3236 | ||
3203 | static int hdspm_professional(struct hdspm * hdspm) | 3237 | static int hdspm_professional(struct hdspm * hdspm) |
@@ -3247,12 +3281,12 @@ static int snd_hdspm_put_professional(struct snd_kcontrol *kcontrol, | |||
3247 | } | 3281 | } |
3248 | 3282 | ||
3249 | #define HDSPM_INPUT_SELECT(xname, xindex) \ | 3283 | #define HDSPM_INPUT_SELECT(xname, xindex) \ |
3250 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3284 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3251 | .name = xname, \ | 3285 | .name = xname, \ |
3252 | .index = xindex, \ | 3286 | .index = xindex, \ |
3253 | .info = snd_hdspm_info_input_select, \ | 3287 | .info = snd_hdspm_info_input_select, \ |
3254 | .get = snd_hdspm_get_input_select, \ | 3288 | .get = snd_hdspm_get_input_select, \ |
3255 | .put = snd_hdspm_put_input_select \ | 3289 | .put = snd_hdspm_put_input_select \ |
3256 | } | 3290 | } |
3257 | 3291 | ||
3258 | static int hdspm_input_select(struct hdspm * hdspm) | 3292 | static int hdspm_input_select(struct hdspm * hdspm) |
@@ -3319,12 +3353,12 @@ static int snd_hdspm_put_input_select(struct snd_kcontrol *kcontrol, | |||
3319 | 3353 | ||
3320 | 3354 | ||
3321 | #define HDSPM_DS_WIRE(xname, xindex) \ | 3355 | #define HDSPM_DS_WIRE(xname, xindex) \ |
3322 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3356 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3323 | .name = xname, \ | 3357 | .name = xname, \ |
3324 | .index = xindex, \ | 3358 | .index = xindex, \ |
3325 | .info = snd_hdspm_info_ds_wire, \ | 3359 | .info = snd_hdspm_info_ds_wire, \ |
3326 | .get = snd_hdspm_get_ds_wire, \ | 3360 | .get = snd_hdspm_get_ds_wire, \ |
3327 | .put = snd_hdspm_put_ds_wire \ | 3361 | .put = snd_hdspm_put_ds_wire \ |
3328 | } | 3362 | } |
3329 | 3363 | ||
3330 | static int hdspm_ds_wire(struct hdspm * hdspm) | 3364 | static int hdspm_ds_wire(struct hdspm * hdspm) |
@@ -3391,12 +3425,12 @@ static int snd_hdspm_put_ds_wire(struct snd_kcontrol *kcontrol, | |||
3391 | 3425 | ||
3392 | 3426 | ||
3393 | #define HDSPM_QS_WIRE(xname, xindex) \ | 3427 | #define HDSPM_QS_WIRE(xname, xindex) \ |
3394 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3428 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3395 | .name = xname, \ | 3429 | .name = xname, \ |
3396 | .index = xindex, \ | 3430 | .index = xindex, \ |
3397 | .info = snd_hdspm_info_qs_wire, \ | 3431 | .info = snd_hdspm_info_qs_wire, \ |
3398 | .get = snd_hdspm_get_qs_wire, \ | 3432 | .get = snd_hdspm_get_qs_wire, \ |
3399 | .put = snd_hdspm_put_qs_wire \ | 3433 | .put = snd_hdspm_put_qs_wire \ |
3400 | } | 3434 | } |
3401 | 3435 | ||
3402 | static int hdspm_qs_wire(struct hdspm * hdspm) | 3436 | static int hdspm_qs_wire(struct hdspm * hdspm) |
@@ -3563,15 +3597,15 @@ static int snd_hdspm_put_madi_speedmode(struct snd_kcontrol *kcontrol, | |||
3563 | } | 3597 | } |
3564 | 3598 | ||
3565 | #define HDSPM_MIXER(xname, xindex) \ | 3599 | #define HDSPM_MIXER(xname, xindex) \ |
3566 | { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \ | 3600 | { .iface = SNDRV_CTL_ELEM_IFACE_HWDEP, \ |
3567 | .name = xname, \ | 3601 | .name = xname, \ |
3568 | .index = xindex, \ | 3602 | .index = xindex, \ |
3569 | .device = 0, \ | 3603 | .device = 0, \ |
3570 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ | 3604 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | \ |
3571 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ | 3605 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ |
3572 | .info = snd_hdspm_info_mixer, \ | 3606 | .info = snd_hdspm_info_mixer, \ |
3573 | .get = snd_hdspm_get_mixer, \ | 3607 | .get = snd_hdspm_get_mixer, \ |
3574 | .put = snd_hdspm_put_mixer \ | 3608 | .put = snd_hdspm_put_mixer \ |
3575 | } | 3609 | } |
3576 | 3610 | ||
3577 | static int snd_hdspm_info_mixer(struct snd_kcontrol *kcontrol, | 3611 | static int snd_hdspm_info_mixer(struct snd_kcontrol *kcontrol, |
@@ -3670,12 +3704,12 @@ static int snd_hdspm_put_mixer(struct snd_kcontrol *kcontrol, | |||
3670 | */ | 3704 | */ |
3671 | 3705 | ||
3672 | #define HDSPM_PLAYBACK_MIXER \ | 3706 | #define HDSPM_PLAYBACK_MIXER \ |
3673 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ | 3707 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ |
3674 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | \ | 3708 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | \ |
3675 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ | 3709 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, \ |
3676 | .info = snd_hdspm_info_playback_mixer, \ | 3710 | .info = snd_hdspm_info_playback_mixer, \ |
3677 | .get = snd_hdspm_get_playback_mixer, \ | 3711 | .get = snd_hdspm_get_playback_mixer, \ |
3678 | .put = snd_hdspm_put_playback_mixer \ | 3712 | .put = snd_hdspm_put_playback_mixer \ |
3679 | } | 3713 | } |
3680 | 3714 | ||
3681 | static int snd_hdspm_info_playback_mixer(struct snd_kcontrol *kcontrol, | 3715 | static int snd_hdspm_info_playback_mixer(struct snd_kcontrol *kcontrol, |
@@ -3851,12 +3885,17 @@ static int hdspm_sync_in_sync_check(struct hdspm *hdspm) | |||
3851 | break; | 3885 | break; |
3852 | 3886 | ||
3853 | case MADI: | 3887 | case MADI: |
3854 | case AES32: | 3888 | status = hdspm_read(hdspm, HDSPM_statusRegister); |
3855 | status = hdspm_read(hdspm, HDSPM_statusRegister2); | ||
3856 | lock = (status & HDSPM_syncInLock) ? 1 : 0; | 3889 | lock = (status & HDSPM_syncInLock) ? 1 : 0; |
3857 | sync = (status & HDSPM_syncInSync) ? 1 : 0; | 3890 | sync = (status & HDSPM_syncInSync) ? 1 : 0; |
3858 | break; | 3891 | break; |
3859 | 3892 | ||
3893 | case AES32: | ||
3894 | status = hdspm_read(hdspm, HDSPM_statusRegister2); | ||
3895 | lock = (status & 0x100000) ? 1 : 0; | ||
3896 | sync = (status & 0x200000) ? 1 : 0; | ||
3897 | break; | ||
3898 | |||
3860 | case MADIface: | 3899 | case MADIface: |
3861 | break; | 3900 | break; |
3862 | } | 3901 | } |
@@ -3940,8 +3979,10 @@ static int snd_hdspm_get_sync_check(struct snd_kcontrol *kcontrol, | |||
3940 | case 8: /* SYNC IN */ | 3979 | case 8: /* SYNC IN */ |
3941 | val = hdspm_sync_in_sync_check(hdspm); break; | 3980 | val = hdspm_sync_in_sync_check(hdspm); break; |
3942 | default: | 3981 | default: |
3943 | val = hdspm_s1_sync_check(hdspm, ucontrol->id.index-1); | 3982 | val = hdspm_s1_sync_check(hdspm, |
3983 | kcontrol->private_value-1); | ||
3944 | } | 3984 | } |
3985 | break; | ||
3945 | 3986 | ||
3946 | case AIO: | 3987 | case AIO: |
3947 | switch (kcontrol->private_value) { | 3988 | switch (kcontrol->private_value) { |
@@ -3954,6 +3995,7 @@ static int snd_hdspm_get_sync_check(struct snd_kcontrol *kcontrol, | |||
3954 | default: | 3995 | default: |
3955 | val = hdspm_s1_sync_check(hdspm, ucontrol->id.index-1); | 3996 | val = hdspm_s1_sync_check(hdspm, ucontrol->id.index-1); |
3956 | } | 3997 | } |
3998 | break; | ||
3957 | 3999 | ||
3958 | case MADI: | 4000 | case MADI: |
3959 | switch (kcontrol->private_value) { | 4001 | switch (kcontrol->private_value) { |
@@ -3966,6 +4008,7 @@ static int snd_hdspm_get_sync_check(struct snd_kcontrol *kcontrol, | |||
3966 | case 3: /* SYNC_IN */ | 4008 | case 3: /* SYNC_IN */ |
3967 | val = hdspm_sync_in_sync_check(hdspm); break; | 4009 | val = hdspm_sync_in_sync_check(hdspm); break; |
3968 | } | 4010 | } |
4011 | break; | ||
3969 | 4012 | ||
3970 | case MADIface: | 4013 | case MADIface: |
3971 | val = hdspm_madi_sync_check(hdspm); /* MADI */ | 4014 | val = hdspm_madi_sync_check(hdspm); /* MADI */ |
@@ -3983,6 +4026,7 @@ static int snd_hdspm_get_sync_check(struct snd_kcontrol *kcontrol, | |||
3983 | val = hdspm_aes_sync_check(hdspm, | 4026 | val = hdspm_aes_sync_check(hdspm, |
3984 | kcontrol->private_value-1); | 4027 | kcontrol->private_value-1); |
3985 | } | 4028 | } |
4029 | break; | ||
3986 | 4030 | ||
3987 | } | 4031 | } |
3988 | 4032 | ||
@@ -4427,9 +4471,10 @@ static struct snd_kcontrol_new snd_hdspm_controls_madi[] = { | |||
4427 | HDSPM_PREF_SYNC_REF("Preferred Sync Reference", 0), | 4471 | HDSPM_PREF_SYNC_REF("Preferred Sync Reference", 0), |
4428 | HDSPM_AUTOSYNC_REF("AutoSync Reference", 0), | 4472 | HDSPM_AUTOSYNC_REF("AutoSync Reference", 0), |
4429 | HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0), | 4473 | HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0), |
4474 | HDSPM_AUTOSYNC_SAMPLE_RATE("External Rate", 0), | ||
4430 | HDSPM_SYNC_CHECK("WC SyncCheck", 0), | 4475 | HDSPM_SYNC_CHECK("WC SyncCheck", 0), |
4431 | HDSPM_SYNC_CHECK("MADI SyncCheck", 1), | 4476 | HDSPM_SYNC_CHECK("MADI SyncCheck", 1), |
4432 | HDSPM_SYNC_CHECK("TCO SyncCHeck", 2), | 4477 | HDSPM_SYNC_CHECK("TCO SyncCheck", 2), |
4433 | HDSPM_SYNC_CHECK("SYNC IN SyncCheck", 3), | 4478 | HDSPM_SYNC_CHECK("SYNC IN SyncCheck", 3), |
4434 | HDSPM_LINE_OUT("Line Out", 0), | 4479 | HDSPM_LINE_OUT("Line Out", 0), |
4435 | HDSPM_TX_64("TX 64 channels mode", 0), | 4480 | HDSPM_TX_64("TX 64 channels mode", 0), |
@@ -4855,7 +4900,7 @@ snd_hdspm_proc_read_madi(struct snd_info_entry * entry, | |||
4855 | insel = "Coaxial"; | 4900 | insel = "Coaxial"; |
4856 | break; | 4901 | break; |
4857 | default: | 4902 | default: |
4858 | insel = "Unkown"; | 4903 | insel = "Unknown"; |
4859 | } | 4904 | } |
4860 | 4905 | ||
4861 | snd_iprintf(buffer, | 4906 | snd_iprintf(buffer, |