// SPDX-License-Identifier: GPL-2.0-or-later /* * Driver for Digigram VX soundcards * * IEC958 stuff * * Copyright (c) 2002 by Takashi Iwai <[email protected]> */ #include <linux/delay.h> #include <sound/core.h> #include <sound/vx_core.h> #include "vx_cmd.h" /* * vx_modify_board_clock - tell the board that its clock has been modified * @sync: DSP needs to resynchronize its FIFO */ static int vx_modify_board_clock(struct vx_core *chip, int sync) { … } /* * vx_modify_board_inputs - resync audio inputs */ static int vx_modify_board_inputs(struct vx_core *chip) { … } /* * vx_read_one_cbit - read one bit from UER config * @index: the bit index * returns 0 or 1. */ static int vx_read_one_cbit(struct vx_core *chip, int index) { … } /* * vx_write_one_cbit - write one bit to UER config * @index: the bit index * @val: bit value, 0 or 1 */ static void vx_write_one_cbit(struct vx_core *chip, int index, int val) { … } /* * vx_read_uer_status - read the current UER status * @mode: pointer to store the UER mode, VX_UER_MODE_XXX * * returns the frequency of UER, or 0 if not sync, * or a negative error code. */ static int vx_read_uer_status(struct vx_core *chip, unsigned int *mode) { … } /* * compute the sample clock value from frequency * * The formula is as follows: * * HexFreq = (dword) ((double) ((double) 28224000 / (double) Frequency)) * switch ( HexFreq & 0x00000F00 ) * case 0x00000100: ; * case 0x00000200: * case 0x00000300: HexFreq -= 0x00000201 ; * case 0x00000400: * case 0x00000500: * case 0x00000600: * case 0x00000700: HexFreq = (dword) (((double) 28224000 / (double) (Frequency*2)) - 1) * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF */ static int vx_calc_clock_from_freq(struct vx_core *chip, int freq) { … } /* * vx_change_clock_source - change the clock source * @source: the new source */ static void vx_change_clock_source(struct vx_core *chip, int source) { … } /* * set the internal clock */ void vx_set_internal_clock(struct vx_core *chip, unsigned int freq) { … } /* * set the iec958 status bits * @bits: 32-bit status bits */ void vx_set_iec958_status(struct vx_core *chip, unsigned int bits) { … } /* * vx_set_clock - change the clock and audio source if necessary */ int vx_set_clock(struct vx_core *chip, unsigned int freq) { … } /* * vx_change_frequency - called from interrupt handler */ int vx_change_frequency(struct vx_core *chip) { … }