Lines Matching +full:0 +full:x0400000
39 * :1098.7654:3210.9876:5432.1098:7654.3210: 0..31
44 * : . : . : . : x. : HDSPM_ClockModeMaster - 1: Master, 0: Slave
46 * : . : . : . : . : 0:64, 1:128, 2:256, 3:512,
49 … . : . : . :10 . : HDSPM_Frequency1|HDSPM_Frequency0: 1=32K,2=44.1K,3=48K,0=??
57 * : . : . 10: . : . : <MADI> sync ref: 0:WC, 1:Madi, 2:TCO, 3:SyncIn
58 * : . 3 : . 10: 2 . : . : <AES32> 0:WC, 1:AES1 ... 8:AES8, 9: TCO, 10:SyncIn?
60 * : . : . : x . : . : <MADI> HDSPM_InputSelect0 : 0=optical,1=coax
86 * :1098.7654:3210.9876:5432.1098:7654.3210: 0..31
98 * :7654.3210:7654.3210:7654.3210:7654.3210: 0..31
101 * : . : . : . : . x: HDSPM_c0Master 1: Master, 0: Slave
107 * : . : . : . : . : RayDat: 0:WC, 1:AES, 2:SPDIF, 3..6: ADAT1..4,
109 * : . : . : . : . : AIO: 0:WC, 1:AES, 2: SPDIF, 3: ATAT,
116 * :7654.3210:7654.3210:7654.3210:7654.3210: 0..31
143 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
173 #define HDSPM_WR_SETTINGS 0
184 /* DMA enable for 64 channels, only Bit 0 is relevant */
199 #define HDSPM_statusRegister 0
208 #define HDSPM_RD_STATUS_0 0
217 #define HDSPM_TCO1_TCO_lock 0x00000001
218 #define HDSPM_TCO1_WCK_Input_Range_LSB 0x00000002
219 #define HDSPM_TCO1_WCK_Input_Range_MSB 0x00000004
220 #define HDSPM_TCO1_LTC_Input_valid 0x00000008
221 #define HDSPM_TCO1_WCK_Input_valid 0x00000010
222 #define HDSPM_TCO1_Video_Input_Format_NTSC 0x00000020
223 #define HDSPM_TCO1_Video_Input_Format_PAL 0x00000040
225 #define HDSPM_TCO1_set_TC 0x00000100
226 #define HDSPM_TCO1_set_drop_frame_flag 0x00000200
227 #define HDSPM_TCO1_LTC_Format_LSB 0x00000400
228 #define HDSPM_TCO1_LTC_Format_MSB 0x00000800
230 #define HDSPM_TCO2_TC_run 0x00010000
231 #define HDSPM_TCO2_WCK_IO_ratio_LSB 0x00020000
232 #define HDSPM_TCO2_WCK_IO_ratio_MSB 0x00040000
233 #define HDSPM_TCO2_set_num_drop_frames_LSB 0x00080000
234 #define HDSPM_TCO2_set_num_drop_frames_MSB 0x00100000
235 #define HDSPM_TCO2_set_jam_sync 0x00200000
236 #define HDSPM_TCO2_set_flywheel 0x00400000
238 #define HDSPM_TCO2_set_01_4 0x01000000
239 #define HDSPM_TCO2_set_pull_down 0x02000000
240 #define HDSPM_TCO2_set_pull_up 0x04000000
241 #define HDSPM_TCO2_set_freq 0x08000000
242 #define HDSPM_TCO2_set_term_75R 0x10000000
243 #define HDSPM_TCO2_set_input_LSB 0x20000000
244 #define HDSPM_TCO2_set_input_MSB 0x40000000
245 #define HDSPM_TCO2_set_freq_from_app 0x80000000
257 /* status is data bytes in MIDI-FIFO (0-128) */
287 #define HDSPM_Start (1<<0) /* start engine */
291 #define HDSPM_Latency2 (1<<3) /* by Latency{2,1,0} */
293 #define HDSPM_ClockModeMaster (1<<4) /* 1=Master, 0=Autosync */
294 #define HDSPM_c0Master 0x1 /* Master clock bit in settings
299 #define HDSPM_Frequency0 (1<<6) /* 0=44.1kHz/88.2kHz 1=48kHz/96kHz */
300 #define HDSPM_Frequency1 (1<<7) /* 0=32kHz/64kHz */
301 #define HDSPM_DoubleSpeed (1<<8) /* 0=normal speed, 1=double speed */
306 56channelMODE=0 */ /* MADI ONLY*/
310 0=off, 1=on */ /* MADI ONLY */
313 #define HDSPM_InputSelect0 (1<<14) /* Input select 0= optical, 1=coax
316 #define HDSPM_InputSelect1 (1<<15) /* should be 0 */
328 #define HDSPM_Midi0InterruptEnable 0x0400000
329 #define HDSPM_Midi1InterruptEnable 0x0800000
330 #define HDSPM_Midi2InterruptEnable 0x0200000
331 #define HDSPM_Midi3InterruptEnable 0x4000000
333 #define HDSPM_LineOut (1<<24) /* Analog Out on channel 63/64 on=1, mute=0 */
334 #define HDSPe_FLOAT_FORMAT 0x2000000
343 #define HDSPM_c0_Wck48 0x20 /* also RayDAT */
344 #define HDSPM_c0_Input0 0x1000
345 #define HDSPM_c0_Input1 0x2000
346 #define HDSPM_c0_Spdif_Opt 0x4000
347 #define HDSPM_c0_Pro 0x8000
348 #define HDSPM_c0_clr_tms 0x10000
349 #define HDSPM_c0_AEB1 0x20000
350 #define HDSPM_c0_AEB2 0x40000
351 #define HDSPM_c0_LineOut 0x80000
352 #define HDSPM_c0_AD_GAIN0 0x100000
353 #define HDSPM_c0_AD_GAIN1 0x200000
354 #define HDSPM_c0_DA_GAIN0 0x400000
355 #define HDSPM_c0_DA_GAIN1 0x800000
356 #define HDSPM_c0_PH_GAIN0 0x1000000
357 #define HDSPM_c0_PH_GAIN1 0x2000000
358 #define HDSPM_c0_Sym6db 0x4000000
366 #define HDSPM_InputOptical 0
371 #define HDSPM_c0_SyncRef0 0x2
372 #define HDSPM_c0_SyncRef1 0x4
373 #define HDSPM_c0_SyncRef2 0x8
374 #define HDSPM_c0_SyncRef3 0x10
378 #define HDSPM_SYNC_FROM_WORD 0 /* Preferred sync reference */
397 #define HDSPM_SYNC_CHECK_NO_LOCK 0
402 #define HDSPM_AUTOSYNC_FROM_WORD 0
409 #define HDSPM_OPTICAL 0 /* optical */
415 #define hdspm_encode_in(x) (((x)&0x3)<<14)
416 #define hdspm_decode_in(x) (((x)>>14)&0x3)
419 #define HDSPM_TMS (1<<0)
435 #define HDSPM_audioIRQPending (1<<0) /* IRQ is high and pending */
436 #define HDSPM_RX_64ch (1<<1) /* Input 64chan. MODE=1, 56chn MODE=0 */
437 #define HDSPM_AB_int (1<<2) /* InputChannel Opt=0, Coax=1
441 #define HDSPM_madiLock (1<<3) /* MADI Locked =1, no=0 */
444 #define HDSPM_tcoLockMadi 0x00000020 /* Optional TCO locked status for HDSPe MADI*/
445 #define HDSPM_tcoSync 0x10000000 /* Optional TCO sync status for HDSPe MADI and AES32!*/
447 #define HDSPM_syncInLock 0x00010000 /* Sync In lock status for HDSPe MADI! */
448 #define HDSPM_syncInSync 0x00020000 /* Sync In sync status for HDSPe MADI! */
450 #define HDSPM_BufferPositionMask 0x000FFC0 /* Bit 6..15 : h/w buffer pointer */
457 #define HDSPM_madiFreq0 (1<<22) /* system freq 0=error */
465 #define HDSPM_tco_detect 0x08000000
466 #define HDSPM_tcoLockAes 0x20000000 /* Optional TCO locked status for HDSPe AES */
468 #define HDSPM_s2_tco_detect 0x00000040
469 #define HDSPM_s2_AEBO_D 0x00000080
470 #define HDSPM_s2_AEBI_D 0x00000100
473 #define HDSPM_midi0IRQPending 0x40000000
474 #define HDSPM_midi1IRQPending 0x80000000
475 #define HDSPM_midi2IRQPending 0x20000000
476 #define HDSPM_midi2IRQPendingAES 0x00000020
477 #define HDSPM_midi3IRQPending 0x00200000
494 #define HDSPM_version0 (1<<0) /* not really defined but I guess */
504 #define HDSPM_wc_freq3 0x800 /* 1000=176.4, 1001=192 */
506 #define HDSPM_SyncRef0 0x10000 /* Sync Reference */
507 #define HDSPM_SyncRef1 0x20000
527 #define HDSPM_status1_F_0 0x0400000
528 #define HDSPM_status1_F_1 0x0800000
529 #define HDSPM_status1_F_2 0x1000000
530 #define HDSPM_status1_F_3 0x2000000
536 #define HDSPM_SelSyncRef_WORD 0
547 #define HDSPM_AES32_wcLock 0x0200000
548 #define HDSPM_AES32_wcSync 0x0100000
550 /* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
553 /* (status >> HDSPM_AES32_syncref_bit) & 0xF gives sync source */
555 #define HDSPM_AES32_AUTOSYNC_FROM_WORD 0
570 #define HDSPM_LockAES 0x80
571 #define HDSPM_LockAES1 0x80
572 #define HDSPM_LockAES2 0x40
573 #define HDSPM_LockAES3 0x20
574 #define HDSPM_LockAES4 0x10
575 #define HDSPM_LockAES5 0x8
576 #define HDSPM_LockAES6 0x4
577 #define HDSPM_LockAES7 0x2
578 #define HDSPM_LockAES8 0x1
598 #define MINUS_INFINITY_GAIN 0
635 #define HDSPM_SPEED_SINGLE 0
800 0, 1, 2, 3, 4, 5, 6, 7,
815 0, 1, /* AES */
828 0, 1, /* AES */
843 0, 1, /* AES */
855 0, 1, /* line in */
869 0, 1, /* line out */
884 0, 1, /* line in */
899 0, 1, /* line out */
914 0, 1, /* line in */
929 0, 1, /* line out */
945 0, 1, 2, 3, 4, 5, 6, 7,
974 int input; /* 0: LTC, 1:Video, 2: WC*/
975 int framerate; /* 0=24, 1=25, 2=29.97, 3=29.97d, 4=30, 5=30d */
976 int wordclock; /* 0=1:1, 1=44.1->48, 2=48->44.1 */
977 int samplerate; /* 0=44.1, 1=48, 2= freq from app */
978 int pull; /* 0=0, 1=+0.1%, 2=-0.1%, 3=+4%, 4=-4%*/
979 int term; /* 0 = off, 1 = on */
1080 .class = 0,
1081 .class_mask = 0,
1082 .driver_data = 0},
1083 {0,}
1119 0, 32000, 44100, 48000, 64000, 88200, in HDSPM_bit2freq()
1122 return 0; in HDSPM_bit2freq()
1154 return 0; in hdspm_read_in_gain()
1163 return 0; in hdspm_read_pb_gain()
1176 (hdspm->mixer->ch[chan].in[in] = data & 0xFFFF)); in hdspm_write_in_gain()
1177 return 0; in hdspm_write_in_gain()
1189 (hdspm->mixer->ch[chan].pb[pb] = data & 0xFFFF)); in hdspm_write_pb_gain()
1190 return 0; in hdspm_write_pb_gain()
1213 (hdspm->playback_pid >= 0) && (hdspm->capture_pid >= 0)) { in snd_hdspm_use_is_exclusive()
1214 ret = 0; in snd_hdspm_use_is_exclusive()
1255 int syncref, rate = 0, rate_bits; in hdspm_external_sample_rate()
1291 return 0; in hdspm_external_sample_rate()
1299 rate = 0; /* no lock */ in hdspm_external_sample_rate()
1321 rate = 0; break; in hdspm_external_sample_rate()
1332 rate = 0; in hdspm_external_sample_rate()
1335 if ((status2 & HDSPM_wcLock) != 0 && in hdspm_external_sample_rate()
1336 (status2 & HDSPM_SelSyncRef0) == 0) { in hdspm_external_sample_rate()
1370 rate = 0; in hdspm_external_sample_rate()
1378 if (rate != 0 && in hdspm_external_sample_rate()
1415 rate = 0; in hdspm_external_sample_rate()
1423 bool is_valid_input = 0; in hdspm_external_sample_rate()
1424 bool has_sync = 0; in hdspm_external_sample_rate()
1461 * 0, 128 samples as 1 ... 4096 samples as 6. For old cards, 7 in hdspm_get_latency()
1492 (hdspm->period_bytes / 4) : 0; in hdspm_hw_pointer()
1521 for (i = 0; i < HDSPM_MAX_CHANNELS; i++) { in hdspm_silence_playback()
1522 memset(buf, 0, n); in hdspm_silence_playback()
1537 * have values from 0 .. 7. While 0 still means 64 samples and in hdspm_set_interrupt_interval()
1542 * 2^(n+6) with n ranging from 0 .. 7. in hdspm_set_interrupt_interval()
1547 n = 0; in hdspm_set_interrupt_interval()
1563 return 0; in hdspm_set_interrupt_interval()
1570 if (period == 0) in hdspm_calc_dds_value()
1571 return 0; in hdspm_calc_dds_value()
1587 return 0; in hdspm_calc_dds_value()
1598 if (snd_BUG_ON(rate <= 0)) in hdspm_set_dds_value()
1634 int not_set = 0; in hdspm_set_rate()
1734 && (hdspm->capture_pid >= 0 || hdspm->playback_pid >= 0)) { in hdspm_set_rate()
1752 hdspm_write(hdspm, HDSPM_eeprom_wr, 0); in hdspm_set_rate()
1779 if (not_set != 0) in hdspm_set_rate()
1782 return 0; in hdspm_set_rate()
1785 /* mainly for init to 0 on load */
1793 else if (sgain < 0) in all_in_all_mixer()
1794 gain = 0; in all_in_all_mixer()
1798 for (i = 0; i < HDSPM_MIXER_CHANNELS; i++) in all_in_all_mixer()
1799 for (j = 0; j < HDSPM_MIXER_CHANNELS; j++) { in all_in_all_mixer()
1812 /* the hardware already does the relevant bit-mask with 0xff */ in snd_hdspm_midi_read_byte()
1819 /* the hardware already does the relevant bit-mask with 0xff */ in snd_hdspm_midi_write_byte()
1825 return hdspm_read(hdspm, hdspm->midi[id].statusIn) & 0xFF; in snd_hdspm_midi_input_available()
1832 fifo_bytes_used = hdspm_read(hdspm, hdspm->midi[id].statusOut) & 0xFF; in snd_hdspm_midi_output_possible()
1837 return 0; in snd_hdspm_midi_output_possible()
1861 if (n_pending > 0) { in snd_hdspm_midi_output_write()
1867 if (to_write > 0) { in snd_hdspm_midi_output_write()
1868 for (i = 0; i < to_write; ++i) in snd_hdspm_midi_output_write()
1876 return 0; in snd_hdspm_midi_output_write()
1890 if (n_pending > 0) { in snd_hdspm_midi_input_read()
1894 for (i = 0; i < n_pending; ++i) in snd_hdspm_midi_input_read()
1907 hmidi->pending = 0; in snd_hdspm_midi_input_read()
1974 snd_hdspm_midi_output_timer, 0); in snd_hdspm_midi_output_trigger()
1979 if (hmidi->istimer && --hmidi->istimer <= 0) in snd_hdspm_midi_output_trigger()
1997 return 0; in snd_hdspm_midi_input_open()
2009 return 0; in snd_hdspm_midi_output_open()
2016 snd_hdspm_midi_input_trigger (substream, 0); in snd_hdspm_midi_input_close()
2023 return 0; in snd_hdspm_midi_input_close()
2030 snd_hdspm_midi_output_trigger (substream, 0); in snd_hdspm_midi_output_close()
2037 return 0; in snd_hdspm_midi_output_close()
2064 if (0 == id) { in snd_hdspm_create_midi()
2067 hdspm->midi[0].dataIn = HDSPM_midiDataIn2; in snd_hdspm_create_midi()
2068 hdspm->midi[0].statusIn = HDSPM_midiStatusIn2; in snd_hdspm_create_midi()
2069 hdspm->midi[0].dataOut = HDSPM_midiDataOut2; in snd_hdspm_create_midi()
2070 hdspm->midi[0].statusOut = HDSPM_midiStatusOut2; in snd_hdspm_create_midi()
2071 hdspm->midi[0].ie = HDSPM_Midi2InterruptEnable; in snd_hdspm_create_midi()
2072 hdspm->midi[0].irq = HDSPM_midi2IRQPending; in snd_hdspm_create_midi()
2074 hdspm->midi[0].dataIn = HDSPM_midiDataIn0; in snd_hdspm_create_midi()
2075 hdspm->midi[0].statusIn = HDSPM_midiStatusIn0; in snd_hdspm_create_midi()
2076 hdspm->midi[0].dataOut = HDSPM_midiDataOut0; in snd_hdspm_create_midi()
2077 hdspm->midi[0].statusOut = HDSPM_midiStatusOut0; in snd_hdspm_create_midi()
2078 hdspm->midi[0].ie = HDSPM_Midi0InterruptEnable; in snd_hdspm_create_midi()
2079 hdspm->midi[0].irq = HDSPM_midi0IRQPending; in snd_hdspm_create_midi()
2116 if ((id == 0) && (MADIface == hdspm->io_type)) { in snd_hdspm_create_midi()
2128 if (err < 0) in snd_hdspm_create_midi()
2153 if (err < 0) in snd_hdspm_create_midi()
2168 return 0; in snd_hdspm_create_midi()
2175 int i = 0; in hdspm_midi_work()
2215 if (0 == hdspm_system_clock_mode(hdspm)) { in hdspm_get_system_sample_rate()
2249 return 0; in snd_hdspm_info_system_sample_rate()
2259 ucontrol->value.integer.value[0] = hdspm_get_system_sample_rate(hdspm); in snd_hdspm_get_system_sample_rate()
2260 return 0; in snd_hdspm_get_system_sample_rate()
2268 int rate = ucontrol->value.integer.value[0]; in snd_hdspm_put_system_sample_rate()
2272 hdspm_set_dds_value(hdspm, ucontrol->value.integer.value[0]); in snd_hdspm_put_system_sample_rate()
2273 return 0; in snd_hdspm_put_system_sample_rate()
2288 return (status >> 16) & 0xF; in hdspm_get_wc_sample_rate()
2292 return (status >> HDSPM_AES32_wcFreq_bit) & 0xF; in hdspm_get_wc_sample_rate()
2298 return 0; in hdspm_get_wc_sample_rate()
2314 return (status >> 20) & 0xF; in hdspm_get_tco_sample_rate()
2318 return (status >> 1) & 0xF; in hdspm_get_tco_sample_rate()
2324 return 0; in hdspm_get_tco_sample_rate()
2340 return (status >> 12) & 0xF; in hdspm_get_sync_in_sample_rate()
2347 return 0; in hdspm_get_sync_in_sample_rate()
2360 return (timecode >> (4*index)) & 0xF; in hdspm_get_aes_sample_rate()
2365 return 0; in hdspm_get_aes_sample_rate()
2376 return (status >> (idx*4)) & 0xF; in hdspm_get_s1_sample_rate()
2389 int i, selected_rate = 0; in hdspm_external_rate_to_enum()
2413 return 0; in snd_hdspm_info_autosync_sample_rate()
2426 case 0: in snd_hdspm_get_autosync_sample_rate()
2427 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2431 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2435 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2439 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2447 case 0: /* WC */ in snd_hdspm_get_autosync_sample_rate()
2448 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2452 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2456 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2460 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2469 case 0: /* WC */ in snd_hdspm_get_autosync_sample_rate()
2470 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2474 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2478 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2482 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2486 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2496 ucontrol->value.enumerated.item[0] = in snd_hdspm_get_autosync_sample_rate()
2503 return 0; in snd_hdspm_get_autosync_sample_rate()
2521 * @returns 0 - master, 1 - slave
2529 return 0; in hdspm_system_clock_mode()
2534 return 0; in hdspm_system_clock_mode()
2543 * @param mode 0 - master, 1 - slave
2550 (0 == mode)); in hdspm_set_system_clock_mode()
2559 return 0; in snd_hdspm_info_system_clock_mode()
2567 ucontrol->value.enumerated.item[0] = hdspm_system_clock_mode(hdspm); in snd_hdspm_get_system_clock_mode()
2568 return 0; in snd_hdspm_get_system_clock_mode()
2580 val = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_system_clock_mode()
2581 if (val < 0) in snd_hdspm_put_system_clock_mode()
2582 val = 0; in snd_hdspm_put_system_clock_mode()
2588 return 0; in snd_hdspm_put_system_clock_mode()
2605 case 32000: return 0; in hdspm_clock_source()
2623 case 0: in hdspm_set_clock_source()
2645 return 0; in hdspm_set_clock_source()
2659 ucontrol->value.enumerated.item[0] = hdspm_clock_source(hdspm); in snd_hdspm_get_clock_source()
2660 return 0; in snd_hdspm_get_clock_source()
2672 val = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_clock_source()
2673 if (val < 0) in snd_hdspm_put_clock_source()
2674 val = 0; in snd_hdspm_put_clock_source()
2679 change = (hdspm_set_clock_source(hdspm, val) == 0) ? 1 : 0; in snd_hdspm_put_clock_source()
2681 change = 0; in snd_hdspm_put_clock_source()
2709 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2727 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2735 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2747 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2760 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2777 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2787 case 0: return 0; /* WC */ in hdspm_pref_sync_ref()
2809 int p = 0; in hdspm_set_pref_sync_ref()
2815 case 0: /* WC */ in hdspm_set_pref_sync_ref()
2860 case 0: /* WC */ in hdspm_set_pref_sync_ref()
2877 case 0: /* WC */ in hdspm_set_pref_sync_ref()
2896 case 0: p = 0; break; /* WC */ in hdspm_set_pref_sync_ref()
2909 case 0: p = 0; break; /* WC */ in hdspm_set_pref_sync_ref()
2925 case 0: p = 0; break; /* WC */ in hdspm_set_pref_sync_ref()
2935 case 0: p = 0; break; /* WC */ in hdspm_set_pref_sync_ref()
2961 return 0; in hdspm_set_pref_sync_ref()
2972 return 0; in snd_hdspm_info_pref_sync_ref()
2981 if (psf >= 0) { in snd_hdspm_get_pref_sync_ref()
2982 ucontrol->value.enumerated.item[0] = psf; in snd_hdspm_get_pref_sync_ref()
2983 return 0; in snd_hdspm_get_pref_sync_ref()
2993 int val, change = 0; in snd_hdspm_put_pref_sync_ref()
2998 val = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_pref_sync_ref()
3000 if (val < 0) in snd_hdspm_put_pref_sync_ref()
3001 val = 0; in snd_hdspm_put_pref_sync_ref()
3007 change = (0 == hdspm_set_pref_sync_ref(hdspm, val)) ? 1 : 0; in snd_hdspm_put_pref_sync_ref()
3029 unsigned int syncref = (status >> HDSPM_AES32_syncref_bit) & 0xF; in hdspm_autosync_ref()
3055 return 0; in hdspm_autosync_ref()
3075 return 0; in snd_hdspm_info_autosync_ref()
3083 ucontrol->value.enumerated.item[0] = hdspm_autosync_ref(hdspm); in snd_hdspm_get_autosync_ref()
3084 return 0; in snd_hdspm_get_autosync_ref()
3103 return 0; in snd_hdspm_info_tco_video_input_format()
3110 int ret = 0; in snd_hdspm_get_tco_video_input_format()
3126 ret = 0; in snd_hdspm_get_tco_video_input_format()
3129 ucontrol->value.enumerated.item[0] = ret; in snd_hdspm_get_tco_video_input_format()
3130 return 0; in snd_hdspm_get_tco_video_input_format()
3150 return 0; in snd_hdspm_info_tco_ltc_frames()
3156 int ret = 0; in hdspm_tco_ltc_frames()
3162 case 0: in hdspm_tco_ltc_frames()
3189 ucontrol->value.enumerated.item[0] = hdspm_tco_ltc_frames(hdspm); in snd_hdspm_get_tco_ltc_frames()
3190 return 0; in snd_hdspm_get_tco_ltc_frames()
3211 return (reg & regmask) ? 1 : 0; in hdspm_toggle_setting()
3234 return 0; in hdspm_set_toggle_setting()
3246 ucontrol->value.integer.value[0] = hdspm_toggle_setting(hdspm, regmask); in snd_hdspm_get_toggle_setting()
3248 return 0; in snd_hdspm_get_toggle_setting()
3261 val = ucontrol->value.integer.value[0] & 1; in snd_hdspm_put_toggle_setting()
3280 return (hdspm->control_register & HDSPM_InputSelect0) ? 1 : 0; in hdspm_input_select()
3291 return 0; in hdspm_set_input_select()
3299 return 0; in snd_hdspm_info_input_select()
3308 ucontrol->value.enumerated.item[0] = hdspm_input_select(hdspm); in snd_hdspm_get_input_select()
3310 return 0; in snd_hdspm_get_input_select()
3322 val = ucontrol->value.integer.value[0] & 1; in snd_hdspm_put_input_select()
3342 return (hdspm->control_register & HDSPM_DS_DoubleWire) ? 1 : 0; in hdspm_ds_wire()
3353 return 0; in hdspm_set_ds_wire()
3361 return 0; in snd_hdspm_info_ds_wire()
3370 ucontrol->value.enumerated.item[0] = hdspm_ds_wire(hdspm); in snd_hdspm_get_ds_wire()
3372 return 0; in snd_hdspm_get_ds_wire()
3384 val = ucontrol->value.integer.value[0] & 1; in snd_hdspm_put_ds_wire()
3408 return 0; in hdspm_qs_wire()
3415 case 0: in hdspm_set_qs_wire()
3426 return 0; in hdspm_set_qs_wire()
3434 return 0; in snd_hdspm_info_qs_wire()
3443 ucontrol->value.enumerated.item[0] = hdspm_qs_wire(hdspm); in snd_hdspm_get_qs_wire()
3445 return 0; in snd_hdspm_get_qs_wire()
3457 val = ucontrol->value.integer.value[0]; in snd_hdspm_put_qs_wire()
3458 if (val < 0) in snd_hdspm_put_qs_wire()
3459 val = 0; in snd_hdspm_put_qs_wire()
3490 return 0; in hdspm_set_tristate()
3509 return 0; in snd_hdspm_info_tristate()
3519 ucontrol->value.enumerated.item[0] = hdspm_tristate(hdspm, regmask); in snd_hdspm_get_tristate()
3521 return 0; in snd_hdspm_get_tristate()
3534 val = ucontrol->value.integer.value[0]; in snd_hdspm_put_tristate()
3535 if (val < 0) in snd_hdspm_put_tristate()
3536 val = 0; in snd_hdspm_put_tristate()
3562 return 0; in hdspm_madi_speedmode()
3569 case 0: in hdspm_set_madi_speedmode()
3580 return 0; in hdspm_set_madi_speedmode()
3588 return 0; in snd_hdspm_info_madi_speedmode()
3597 ucontrol->value.enumerated.item[0] = hdspm_madi_speedmode(hdspm); in snd_hdspm_get_madi_speedmode()
3599 return 0; in snd_hdspm_get_madi_speedmode()
3611 val = ucontrol->value.integer.value[0]; in snd_hdspm_put_madi_speedmode()
3612 if (val < 0) in snd_hdspm_put_madi_speedmode()
3613 val = 0; in snd_hdspm_put_madi_speedmode()
3627 .device = 0, \
3640 uinfo->value.integer.min = 0; in snd_hdspm_info_mixer()
3643 return 0; in snd_hdspm_info_mixer()
3653 source = ucontrol->value.integer.value[0]; in snd_hdspm_get_mixer()
3654 if (source < 0) in snd_hdspm_get_mixer()
3655 source = 0; in snd_hdspm_get_mixer()
3660 if (destination < 0) in snd_hdspm_get_mixer()
3661 destination = 0; in snd_hdspm_get_mixer()
3676 return 0; in snd_hdspm_get_mixer()
3691 source = ucontrol->value.integer.value[0]; in snd_hdspm_put_mixer()
3694 if (source < 0 || source >= 2 * HDSPM_MAX_CHANNELS) in snd_hdspm_put_mixer()
3696 if (destination < 0 || destination >= HDSPM_MAX_CHANNELS) in snd_hdspm_put_mixer()
3744 uinfo->value.integer.min = 0; in snd_hdspm_info_playback_mixer()
3747 return 0; in snd_hdspm_info_playback_mixer()
3758 if (snd_BUG_ON(channel < 0 || channel >= HDSPM_MAX_CHANNELS)) in snd_hdspm_get_playback_mixer()
3762 ucontrol->value.integer.value[0] = in snd_hdspm_get_playback_mixer()
3766 return 0; in snd_hdspm_get_playback_mixer()
3782 if (snd_BUG_ON(channel < 0 || channel >= HDSPM_MAX_CHANNELS)) in snd_hdspm_put_playback_mixer()
3785 gain = ucontrol->value.integer.value[0]*UNITY_GAIN/64; in snd_hdspm_put_playback_mixer()
3823 return 0; in snd_hdspm_info_sync_check()
3831 return 0; in snd_hdspm_tco_info_lock_check()
3847 return 0; in hdspm_wc_sync_check()
3858 return 0; in hdspm_wc_sync_check()
3865 if (status & 0x2000000) in hdspm_wc_sync_check()
3867 else if (status & 0x1000000) in hdspm_wc_sync_check()
3869 return 0; in hdspm_wc_sync_check()
3891 return 0; in hdspm_madi_sync_check()
3901 lock = (status & (0x1<<idx)) ? 1 : 0; in hdspm_s1_sync_check()
3902 sync = (status & (0x100<<idx)) ? 1 : 0; in hdspm_s1_sync_check()
3908 return 0; in hdspm_s1_sync_check()
3914 int status, lock = 0, sync = 0; in hdspm_sync_in_sync_check()
3920 lock = (status & 0x400) ? 1 : 0; in hdspm_sync_in_sync_check()
3921 sync = (status & 0x800) ? 1 : 0; in hdspm_sync_in_sync_check()
3926 lock = (status & HDSPM_syncInLock) ? 1 : 0; in hdspm_sync_in_sync_check()
3927 sync = (status & HDSPM_syncInSync) ? 1 : 0; in hdspm_sync_in_sync_check()
3932 lock = (status & 0x100000) ? 1 : 0; in hdspm_sync_in_sync_check()
3933 sync = (status & 0x200000) ? 1 : 0; in hdspm_sync_in_sync_check()
3945 return 0; in hdspm_sync_in_sync_check()
3953 lock = (status2 & (0x0080 >> idx)) ? 1 : 0; in hdspm_aes_sync_check()
3954 sync = (status2 & (0x8000 >> idx)) ? 1 : 0; in hdspm_aes_sync_check()
3960 return 0; in hdspm_aes_sync_check()
3968 return (status & mask) ? 1 : 0; in hdspm_tco_input_check()
3986 return 0; in hdspm_tco_sync_check()
3995 return 0; in hdspm_tco_sync_check()
4000 if (status & 0x8000000) in hdspm_tco_sync_check()
4002 if (status & 0x4000000) in hdspm_tco_sync_check()
4004 return 0; /* No signal */ in hdspm_tco_sync_check()
4024 case 0: /* WC */ in snd_hdspm_get_sync_check()
4038 case 0: /* WC */ in snd_hdspm_get_sync_check()
4052 case 0: /* WC */ in snd_hdspm_get_sync_check()
4069 case 0: /* WC */ in snd_hdspm_get_sync_check()
4102 ucontrol->value.enumerated.item[0] = val; in snd_hdspm_get_sync_check()
4103 return 0; in snd_hdspm_get_sync_check()
4113 unsigned int tc[4] = { 0, 0, 0, 0}; in hdspm_tco_write()
4116 case 0: in hdspm_tco_write()
4193 hdspm_write(hdspm, HDSPM_WR_TCO, tc[0]); in hdspm_tco_write()
4217 return 0; in snd_hdspm_info_tco_sample_rate()
4225 ucontrol->value.enumerated.item[0] = hdspm->tco->samplerate; in snd_hdspm_get_tco_sample_rate()
4227 return 0; in snd_hdspm_get_tco_sample_rate()
4235 if (hdspm->tco->samplerate != ucontrol->value.enumerated.item[0]) { in snd_hdspm_put_tco_sample_rate()
4236 hdspm->tco->samplerate = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_tco_sample_rate()
4243 return 0; in snd_hdspm_put_tco_sample_rate()
4261 static const char *const texts[] = { "0", "+ 0.1 %", "- 0.1 %", in snd_hdspm_info_tco_pull()
4264 return 0; in snd_hdspm_info_tco_pull()
4272 ucontrol->value.enumerated.item[0] = hdspm->tco->pull; in snd_hdspm_get_tco_pull()
4274 return 0; in snd_hdspm_get_tco_pull()
4282 if (hdspm->tco->pull != ucontrol->value.enumerated.item[0]) { in snd_hdspm_put_tco_pull()
4283 hdspm->tco->pull = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_tco_pull()
4290 return 0; in snd_hdspm_put_tco_pull()
4309 return 0; in snd_hdspm_info_tco_wck_conversion()
4317 ucontrol->value.enumerated.item[0] = hdspm->tco->wordclock; in snd_hdspm_get_tco_wck_conversion()
4319 return 0; in snd_hdspm_get_tco_wck_conversion()
4327 if (hdspm->tco->wordclock != ucontrol->value.enumerated.item[0]) { in snd_hdspm_put_tco_wck_conversion()
4328 hdspm->tco->wordclock = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_tco_wck_conversion()
4335 return 0; in snd_hdspm_put_tco_wck_conversion()
4356 return 0; in snd_hdspm_info_tco_frame_rate()
4364 ucontrol->value.enumerated.item[0] = hdspm->tco->framerate; in snd_hdspm_get_tco_frame_rate()
4366 return 0; in snd_hdspm_get_tco_frame_rate()
4374 if (hdspm->tco->framerate != ucontrol->value.enumerated.item[0]) { in snd_hdspm_put_tco_frame_rate()
4375 hdspm->tco->framerate = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_tco_frame_rate()
4382 return 0; in snd_hdspm_put_tco_frame_rate()
4402 return 0; in snd_hdspm_info_tco_sync_source()
4410 ucontrol->value.enumerated.item[0] = hdspm->tco->input; in snd_hdspm_get_tco_sync_source()
4412 return 0; in snd_hdspm_get_tco_sync_source()
4420 if (hdspm->tco->input != ucontrol->value.enumerated.item[0]) { in snd_hdspm_put_tco_sync_source()
4421 hdspm->tco->input = ucontrol->value.enumerated.item[0]; in snd_hdspm_put_tco_sync_source()
4428 return 0; in snd_hdspm_put_tco_sync_source()
4448 uinfo->value.integer.min = 0; in snd_hdspm_info_tco_word_term()
4451 return 0; in snd_hdspm_info_tco_word_term()
4460 ucontrol->value.integer.value[0] = hdspm->tco->term; in snd_hdspm_get_tco_word_term()
4462 return 0; in snd_hdspm_get_tco_word_term()
4471 if (hdspm->tco->term != ucontrol->value.integer.value[0]) { in snd_hdspm_put_tco_word_term()
4472 hdspm->tco->term = ucontrol->value.integer.value[0]; in snd_hdspm_put_tco_word_term()
4479 return 0; in snd_hdspm_put_tco_word_term()
4486 HDSPM_MIXER("Mixer", 0),
4487 HDSPM_INTERNAL_CLOCK("Internal Clock", 0),
4488 HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0),
4489 HDSPM_PREF_SYNC_REF("Preferred Sync Reference", 0),
4490 HDSPM_AUTOSYNC_REF("AutoSync Reference", 0),
4491 HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0),
4492 HDSPM_AUTOSYNC_SAMPLE_RATE("External Rate", 0),
4493 HDSPM_SYNC_CHECK("WC SyncCheck", 0),
4502 HDSPM_INPUT_SELECT("Input Select", 0),
4503 HDSPM_MADI_SPEEDMODE("MADI Speed Mode", 0)
4508 HDSPM_MIXER("Mixer", 0),
4509 HDSPM_INTERNAL_CLOCK("Internal Clock", 0),
4510 HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0),
4511 HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0),
4512 HDSPM_AUTOSYNC_SAMPLE_RATE("External Rate", 0),
4513 HDSPM_SYNC_CHECK("MADI SyncCheck", 0),
4517 HDSPM_MADI_SPEEDMODE("MADI Speed Mode", 0)
4521 HDSPM_MIXER("Mixer", 0),
4522 HDSPM_INTERNAL_CLOCK("Internal Clock", 0),
4523 HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0),
4524 HDSPM_PREF_SYNC_REF("Preferred Sync Reference", 0),
4525 HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0),
4526 HDSPM_AUTOSYNC_SAMPLE_RATE("External Rate", 0),
4527 HDSPM_SYNC_CHECK("WC SyncCheck", 0),
4533 HDSPM_AUTOSYNC_SAMPLE_RATE("WC Frequency", 0),
4550 HDSPM_INPUT_SELECT("Input Select", 0),
4551 HDSPM_SPDIF_OPTICAL("SPDIF Out Optical", 0),
4552 HDSPM_PROFESSIONAL("SPDIF Out Professional", 0);
4553 HDSPM_SPDIF_IN("SPDIF In", 0);
4554 HDSPM_BREAKOUT_CABLE("Breakout Cable", 0);
4555 HDSPM_INPUT_LEVEL("Input Level", 0);
4556 HDSPM_OUTPUT_LEVEL("Output Level", 0);
4557 HDSPM_PHONES("Phones", 0);
4562 HDSPM_MIXER("Mixer", 0),
4563 HDSPM_INTERNAL_CLOCK("Internal Clock", 0),
4564 HDSPM_SYSTEM_CLOCK_MODE("Clock Mode", 0),
4565 HDSPM_PREF_SYNC_REF("Pref Sync Ref", 0),
4566 HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0),
4567 HDSPM_SYNC_CHECK("WC SyncCheck", 0),
4576 HDSPM_AUTOSYNC_SAMPLE_RATE("WC Frequency", 0),
4590 HDSPM_MIXER("Mixer", 0),
4591 HDSPM_INTERNAL_CLOCK("Internal Clock", 0),
4592 HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0),
4593 HDSPM_PREF_SYNC_REF("Preferred Sync Reference", 0),
4594 HDSPM_AUTOSYNC_REF("AutoSync Reference", 0),
4595 HDSPM_SYSTEM_SAMPLE_RATE("System Sample Rate", 0),
4597 HDSPM_SYNC_CHECK("WC Sync Check", 0),
4608 HDSPM_AUTOSYNC_SAMPLE_RATE("WC Frequency", 0),
4624 HDSPM_DS_WIRE("Double Speed Wire Mode", 0),
4625 HDSPM_QS_WIRE("Quad Speed Wire Mode", 0),
4632 HDSPM_TCO_SAMPLE_RATE("TCO Sample Rate", 0),
4633 HDSPM_TCO_PULL("TCO Pull", 0),
4634 HDSPM_TCO_WCK_CONVERSION("TCO WCK Conversion", 0),
4635 HDSPM_TCO_FRAME_RATE("TCO Frame Rate", 0),
4636 HDSPM_TCO_SYNC_SOURCE("TCO Sync Source", 0),
4637 HDSPM_TCO_WORD_TERM("TCO Word Term", 0),
4640 HDSPM_TCO_LTC_FRAMES("TCO Detected Frame Rate", 0),
4641 HDSPM_TCO_VIDEO_INPUT_FORMAT("Video Input Format", 0)
4654 hdspm->playback_mixer_ctls[i]->vd[0].access = in hdspm_update_simple_mixer_controls()
4659 hdspm->playback_mixer_ctls[i]->vd[0].access = in hdspm_update_simple_mixer_controls()
4668 return 0; in hdspm_update_simple_mixer_controls()
4704 for (idx = 0; idx < limit; idx++) { in snd_hdspm_create_controls()
4707 if (err < 0) in snd_hdspm_create_controls()
4722 for (idx = 0; idx < limit; ++idx) { in snd_hdspm_create_controls()
4726 if (err < 0) in snd_hdspm_create_controls()
4736 for (idx = 0; idx < limit; idx++) { in snd_hdspm_create_controls()
4739 if (err < 0) in snd_hdspm_create_controls()
4744 return 0; in snd_hdspm_create_controls()
4759 u64 freq_const = 0; in snd_hdspm_proc_read_tco()
4775 case 0: in snd_hdspm_proc_read_tco()
4839 frames = ltc & 0xF; in snd_hdspm_proc_read_tco()
4841 frames += (ltc & 0x3) * 10; in snd_hdspm_proc_read_tco()
4843 seconds = ltc & 0xF; in snd_hdspm_proc_read_tco()
4845 seconds += (ltc & 0x7) * 10; in snd_hdspm_proc_read_tco()
4847 minutes = ltc & 0xF; in snd_hdspm_proc_read_tco()
4849 minutes += (ltc & 0x7) * 10; in snd_hdspm_proc_read_tco()
4851 hours = ltc & 0xF; in snd_hdspm_proc_read_tco()
4853 hours += (ltc & 0x3) * 10; in snd_hdspm_proc_read_tco()
4885 snd_iprintf(buffer, "HW Serial: 0x%06x%06x\n", in snd_hdspm_proc_read_madi()
4886 (hdspm_read(hdspm, HDSPM_midiStatusIn1)>>8) & 0xFFFFFF, in snd_hdspm_proc_read_madi()
4889 snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", in snd_hdspm_proc_read_madi()
4897 (status & HDSPM_midi0IRQPending) ? 1 : 0, in snd_hdspm_proc_read_madi()
4898 (status & HDSPM_midi1IRQPending) ? 1 : 0, in snd_hdspm_proc_read_madi()
4903 ((status & HDSPM_BufferID) ? 1 : 0), in snd_hdspm_proc_read_madi()
4912 "MIDI FIFO: Out1=0x%x, Out2=0x%x, In1=0x%x, In2=0x%x \n", in snd_hdspm_proc_read_madi()
4913 hdspm_read(hdspm, HDSPM_midiStatusOut0) & 0xFF, in snd_hdspm_proc_read_madi()
4914 hdspm_read(hdspm, HDSPM_midiStatusOut1) & 0xFF, in snd_hdspm_proc_read_madi()
4915 hdspm_read(hdspm, HDSPM_midiStatusIn0) & 0xFF, in snd_hdspm_proc_read_madi()
4916 hdspm_read(hdspm, HDSPM_midiStatusIn1) & 0xFF); in snd_hdspm_proc_read_madi()
4918 "MIDIoverMADI FIFO: In=0x%x, Out=0x%x \n", in snd_hdspm_proc_read_madi()
4919 hdspm_read(hdspm, HDSPM_midiStatusIn2) & 0xFF, in snd_hdspm_proc_read_madi()
4920 hdspm_read(hdspm, HDSPM_midiStatusOut2) & 0xFF); in snd_hdspm_proc_read_madi()
4922 "Register: ctrl1=0x%x, ctrl2=0x%x, status1=0x%x, " in snd_hdspm_proc_read_madi()
4923 "status2=0x%x\n", in snd_hdspm_proc_read_madi()
5046 snd_iprintf(buffer, "IRQ: %d Registers bus: 0x%lx VM: 0x%lx\n", in snd_hdspm_proc_read_aes32()
5054 (status & HDSPM_midi0IRQPending) ? 1 : 0, in snd_hdspm_proc_read_aes32()
5055 (status & HDSPM_midi1IRQPending) ? 1 : 0, in snd_hdspm_proc_read_aes32()
5060 ((status & HDSPM_BufferID) ? 1 : 0), in snd_hdspm_proc_read_aes32()
5069 "MIDI FIFO: Out1=0x%x, Out2=0x%x, In1=0x%x, In2=0x%x \n", in snd_hdspm_proc_read_aes32()
5070 hdspm_read(hdspm, HDSPM_midiStatusOut0) & 0xFF, in snd_hdspm_proc_read_aes32()
5071 hdspm_read(hdspm, HDSPM_midiStatusOut1) & 0xFF, in snd_hdspm_proc_read_aes32()
5072 hdspm_read(hdspm, HDSPM_midiStatusIn0) & 0xFF, in snd_hdspm_proc_read_aes32()
5073 hdspm_read(hdspm, HDSPM_midiStatusIn1) & 0xFF); in snd_hdspm_proc_read_aes32()
5075 "MIDIoverMADI FIFO: In=0x%x, Out=0x%x \n", in snd_hdspm_proc_read_aes32()
5076 hdspm_read(hdspm, HDSPM_midiStatusIn2) & 0xFF, in snd_hdspm_proc_read_aes32()
5077 hdspm_read(hdspm, HDSPM_midiStatusOut2) & 0xFF); in snd_hdspm_proc_read_aes32()
5079 "Register: ctrl1=0x%x, ctrl2=0x%x, status1=0x%x, " in snd_hdspm_proc_read_aes32()
5080 "status2=0x%x\n", in snd_hdspm_proc_read_aes32()
5107 if (pref_syncref == 0) in snd_hdspm_proc_read_aes32()
5132 HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF)); in snd_hdspm_proc_read_aes32()
5134 for (x = 0; x < 8; x++) { in snd_hdspm_proc_read_aes32()
5139 HDSPM_bit2freq((timecode >> (4*x)) & 0xF)); in snd_hdspm_proc_read_aes32()
5190 snd_iprintf(buffer, "STATUS1: 0x%08x\n", status1); in snd_hdspm_proc_read_raydat()
5191 snd_iprintf(buffer, "STATUS2: 0x%08x\n", status2); in snd_hdspm_proc_read_raydat()
5192 snd_iprintf(buffer, "STATUS3: 0x%08x\n", status3); in snd_hdspm_proc_read_raydat()
5198 (hdspm_system_clock_mode(hdspm) == 0) ? "master" : "slave"); in snd_hdspm_proc_read_raydat()
5204 lock = 0x1; in snd_hdspm_proc_read_raydat()
5205 sync = 0x100; in snd_hdspm_proc_read_raydat()
5207 for (i = 0; i < 8; i++) { in snd_hdspm_proc_read_raydat()
5210 (status1 & lock) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5211 (status1 & sync) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5212 texts_freq[(status2 >> (i * 4)) & 0xF]); in snd_hdspm_proc_read_raydat()
5219 (status1 & 0x1000000) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5220 (status1 & 0x2000000) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5221 texts_freq[(status1 >> 16) & 0xF]); in snd_hdspm_proc_read_raydat()
5224 (status1 & 0x4000000) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5225 (status1 & 0x8000000) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5226 texts_freq[(status1 >> 20) & 0xF]); in snd_hdspm_proc_read_raydat()
5229 (status3 & 0x400) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5230 (status3 & 0x800) ? 1 : 0, in snd_hdspm_proc_read_raydat()
5231 texts_freq[(status2 >> 12) & 0xF]); in snd_hdspm_proc_read_raydat()
5244 for (i = 0; i < 256 /* 1024*64 */; i += j) { in snd_hdspm_proc_read_debug()
5245 snd_iprintf(buffer, "0x%08X: ", i); in snd_hdspm_proc_read_debug()
5246 for (j = 0; j < 16; j += 4) in snd_hdspm_proc_read_debug()
5262 for (i = 0; i < hdspm->max_channels_in; i++) { in snd_hdspm_proc_ports_in()
5275 for (i = 0; i < hdspm->max_channels_out; i++) { in snd_hdspm_proc_ports_out()
5327 hdspm->settings_register = 0; in snd_hdspm_set_defaults()
5333 0x2 + 0x8 + 0x10 + 0x80 + 0x400 + 0x4000 + 0x1000000; in snd_hdspm_set_defaults()
5338 hdspm->settings_register = 0x1 + 0x1000; in snd_hdspm_set_defaults()
5342 0x2 + 0x8 + 0x10 + 0x80 + 0x400 + 0x4000 + 0x1000000; in snd_hdspm_set_defaults()
5362 hdspm->control2_register = 0; in snd_hdspm_set_defaults()
5371 all_in_all_mixer(hdspm, 0 * UNITY_GAIN); in snd_hdspm_set_defaults()
5379 return 0; in snd_hdspm_set_defaults()
5391 int i, audio, midi, schedule = 0; in snd_hdspm_interrupt()
5409 * 0 64 ~3998231 ~8191558 in snd_hdspm_interrupt()
5413 now-hdspm->last_interrupt, status & 0xFFC0); in snd_hdspm_interrupt()
5420 hdspm_write(hdspm, HDSPM_interruptConfirmation, 0); in snd_hdspm_interrupt()
5433 i = 0; in snd_hdspm_interrupt()
5436 hdspm->midi[i].statusIn) & 0xff) && in snd_hdspm_interrupt()
5485 runtime->status->hw_ptr = 0; in snd_hdspm_reset()
5497 return 0; in snd_hdspm_reset()
5519 if (other_pid > 0 && this_pid != other_pid) { in snd_hdspm_hw_params()
5547 err = hdspm_set_rate(hdspm, params_rate(params), 0); in snd_hdspm_hw_params()
5548 if (err < 0) { in snd_hdspm_hw_params()
5559 if (err < 0) { in snd_hdspm_hw_params()
5576 if (err < 0) { in snd_hdspm_hw_params()
5584 for (i = 0; i < params_channels(params); ++i) { in snd_hdspm_hw_params()
5587 if (c < 0) in snd_hdspm_hw_params()
5601 for (i = 0; i < params_channels(params); ++i) { in snd_hdspm_hw_params()
5604 if (c < 0) in snd_hdspm_hw_params()
5621 "Allocated sample buffer for %s at 0x%08X\n", in snd_hdspm_hw_params()
5624 snd_pcm_sgbuf_get_addr(substream, 0)); in snd_hdspm_hw_params()
5642 return 0; in snd_hdspm_hw_params()
5662 return 0; in snd_hdspm_hw_params()
5673 for (i = 0; i < HDSPM_MAX_CHANNELS; ++i) in snd_hdspm_hw_free()
5674 snd_hdspm_enable_out(hdspm, i, 0); in snd_hdspm_hw_free()
5678 for (i = 0; i < HDSPM_MAX_CHANNELS; ++i) in snd_hdspm_hw_free()
5679 snd_hdspm_enable_in(hdspm, i, 0); in snd_hdspm_hw_free()
5686 return 0; in snd_hdspm_hw_free()
5705 if (hdspm->channel_map_out[channel] < 0) { in snd_hdspm_channel_info()
5723 if (hdspm->channel_map_in[channel] < 0) { in snd_hdspm_channel_info()
5734 info->first = 0; in snd_hdspm_channel_info()
5736 return 0; in snd_hdspm_channel_info()
5819 return 0; in snd_hdspm_trigger()
5824 return 0; in snd_hdspm_prepare()
5849 .fifo_size = 0
5874 .fifo_size = 0
5909 return 0; in snd_hdspm_hw_rule_in_channels_rate()
5944 return 0; in snd_hdspm_hw_rule_out_channels_rate()
5979 return 0; in snd_hdspm_hw_rule_rate_in_channels()
6013 return 0; in snd_hdspm_hw_rule_rate_out_channels()
6024 list[0] = hdspm->qs_in_channels; in snd_hdspm_hw_rule_in_channels()
6027 return snd_interval_list(c, 3, list, 0); in snd_hdspm_hw_rule_in_channels()
6038 list[0] = hdspm->qs_out_channels; in snd_hdspm_hw_rule_out_channels()
6041 return snd_interval_list(c, 3, list, 0); in snd_hdspm_hw_rule_out_channels()
6053 .mask = 0
6083 snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24); in snd_hdspm_open()
6084 snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE); in snd_hdspm_open()
6109 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_hdspm_open()
6112 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, in snd_hdspm_open()
6119 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, in snd_hdspm_open()
6124 snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, in snd_hdspm_open()
6129 return 0; in snd_hdspm_open()
6149 return 0; in snd_hdspm_release()
6155 return 0; in snd_hdspm_hwdep_dummy_op()
6177 int i = 0; in snd_hdspm_hwdep_ioctl()
6183 for (i = 0; i < HDSPM_MAX_CHANNELS; i++) { in snd_hdspm_hwdep_ioctl()
6221 if (0 != s) { in snd_hdspm_hwdep_ioctl()
6235 case 0: in snd_hdspm_hwdep_ioctl()
6266 if (0 != s) { in snd_hdspm_hwdep_ioctl()
6276 memset(&info, 0, sizeof(info)); in snd_hdspm_hwdep_ioctl()
6288 info.passthru = 0; in snd_hdspm_hwdep_ioctl()
6295 memset(&status, 0, sizeof(status)); in snd_hdspm_hwdep_ioctl()
6319 (statusregister & HDSPM_AB_int) ? 1 : 0; in snd_hdspm_hwdep_ioctl()
6321 (statusregister & HDSPM_RX_64ch) ? 1 : 0; in snd_hdspm_hwdep_ioctl()
6323 status.card_specific.madi.frame_format = 0; in snd_hdspm_hwdep_ioctl()
6336 memset(&hdspm_version, 0, sizeof(hdspm_version)); in snd_hdspm_hwdep_ioctl()
6343 hdspm_version.addons = 0; in snd_hdspm_hwdep_ioctl()
6363 return 0; in snd_hdspm_hwdep_ioctl()
6383 err = snd_hwdep_new(card, "HDSPM hwdep", 0, &hw); in snd_hdspm_create_hwdep()
6384 if (err < 0) in snd_hdspm_create_hwdep()
6396 return 0; in snd_hdspm_create_hwdep()
6416 return 0; in snd_hdspm_preallocate_memory()
6440 err = snd_pcm_new(card, hdspm->card_name, 0, 1, 1, &pcm); in snd_hdspm_create_pcm()
6441 if (err < 0) in snd_hdspm_create_pcm()
6456 if (err < 0) in snd_hdspm_create_pcm()
6459 return 0; in snd_hdspm_create_pcm()
6466 for (i = 0; i < hdspm->midiPorts; i++) in snd_hdspm_initialize_midi_flush()
6477 if (err < 0) in snd_hdspm_create_alsa_devices()
6480 i = 0; in snd_hdspm_create_alsa_devices()
6483 if (err < 0) { in snd_hdspm_create_alsa_devices()
6490 if (err < 0) in snd_hdspm_create_alsa_devices()
6494 if (err < 0) in snd_hdspm_create_alsa_devices()
6510 if (err < 0) in snd_hdspm_create_alsa_devices()
6519 if (err < 0) { in snd_hdspm_create_alsa_devices()
6526 return 0; in snd_hdspm_create_alsa_devices()
6566 if ((hdspm->firmware_rev == 0xf0) || in snd_hdspm_create()
6567 ((hdspm->firmware_rev >= 0xe6) && in snd_hdspm_create()
6568 (hdspm->firmware_rev <= 0xea))) { in snd_hdspm_create()
6572 } else if ((hdspm->firmware_rev == 0xd2) || in snd_hdspm_create()
6573 ((hdspm->firmware_rev >= 0xc8) && in snd_hdspm_create()
6574 (hdspm->firmware_rev <= 0xcf))) { in snd_hdspm_create()
6587 if (err < 0) in snd_hdspm_create()
6593 if (err < 0) in snd_hdspm_create()
6596 hdspm->port = pci_resource_start(pci, 0); in snd_hdspm_create()
6597 io_extent = pci_resource_len(pci, 0); in snd_hdspm_create()
6599 dev_dbg(card->dev, "grabbed memory region 0x%lx-0x%lx\n", in snd_hdspm_create()
6604 dev_err(card->dev, "unable to remap region 0x%lx-0x%lx\n", in snd_hdspm_create()
6608 dev_dbg(card->dev, "remapped region (0x%lx) 0x%lx-0x%lx\n", in snd_hdspm_create()
6692 if (0 == (hdspm_read(hdspm, HDSPM_statusRegister2) & HDSPM_s2_AEBI_D)) { in snd_hdspm_create()
6699 if (0 == (hdspm_read(hdspm, HDSPM_statusRegister2) & HDSPM_s2_AEBO_D)) { in snd_hdspm_create()
6842 HDSPM_midiStatusIn0)>>8) & 0xFFFFFF; in snd_hdspm_create()
6847 * If the serial number is 0xFFFFFF, then we're dealing with in snd_hdspm_create()
6852 if (!id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { in snd_hdspm_create()
6861 if (err < 0) in snd_hdspm_create()
6866 return 0; in snd_hdspm_create()
6885 if (hdspm->irq >= 0) in snd_hdspm_free()
6896 return 0; in snd_hdspm_free()
6926 if (err < 0) in snd_hdspm_probe()
6935 if (err < 0) in snd_hdspm_probe()
6942 "%s S/N 0x%x at 0x%lx, irq %d", in snd_hdspm_probe()
6949 "%s at 0x%lx, irq %d", in snd_hdspm_probe()
6954 if (err < 0) in snd_hdspm_probe()
6960 return 0; in snd_hdspm_probe()