~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/pci/echoaudio/indigo_express_dsp.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /************************************************************************
  2 
  3 This file is part of Echo Digital Audio's generic driver library.
  4 Copyright Echo Digital Audio Corporation (c) 1998 - 2005
  5 All rights reserved
  6 www.echoaudio.com
  7 
  8 This library is free software; you can redistribute it and/or
  9 modify it under the terms of the GNU Lesser General Public
 10 License as published by the Free Software Foundation; either
 11 version 2.1 of the License, or (at your option) any later version.
 12 
 13 This library is distributed in the hope that it will be useful,
 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 16 Lesser General Public License for more details.
 17 
 18 You should have received a copy of the GNU Lesser General Public
 19 License along with this library; if not, write to the Free Software
 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 21 
 22 *************************************************************************
 23 
 24  Translation from C++ and adaptation for use in ALSA-Driver
 25  were made by Giuliano Pochini <pochini@shiny.it>
 26 
 27 *************************************************************************/
 28 
 29 static int set_sample_rate(struct echoaudio *chip, u32 rate)
 30 {
 31         u32 clock, control_reg, old_control_reg;
 32 
 33         if (wait_handshake(chip))
 34                 return -EIO;
 35 
 36         old_control_reg = le32_to_cpu(chip->comm_page->control_register);
 37         control_reg = old_control_reg & ~INDIGO_EXPRESS_CLOCK_MASK;
 38 
 39         switch (rate) {
 40         case 32000:
 41                 clock = INDIGO_EXPRESS_32000;
 42                 break;
 43         case 44100:
 44                 clock = INDIGO_EXPRESS_44100;
 45                 break;
 46         case 48000:
 47                 clock = INDIGO_EXPRESS_48000;
 48                 break;
 49         case 64000:
 50                 clock = INDIGO_EXPRESS_32000|INDIGO_EXPRESS_DOUBLE_SPEED;
 51                 break;
 52         case 88200:
 53                 clock = INDIGO_EXPRESS_44100|INDIGO_EXPRESS_DOUBLE_SPEED;
 54                 break;
 55         case 96000:
 56                 clock = INDIGO_EXPRESS_48000|INDIGO_EXPRESS_DOUBLE_SPEED;
 57                 break;
 58         default:
 59                 return -EINVAL;
 60         }
 61 
 62         control_reg |= clock;
 63         if (control_reg != old_control_reg) {
 64                 dev_dbg(chip->card->dev,
 65                         "set_sample_rate: %d clock %d\n", rate, clock);
 66                 chip->comm_page->control_register = cpu_to_le32(control_reg);
 67                 chip->sample_rate = rate;
 68                 clear_handshake(chip);
 69                 return send_vector(chip, DSP_VC_UPDATE_CLOCKS);
 70         }
 71         return 0;
 72 }
 73 
 74 
 75 
 76 /* This function routes the sound from a virtual channel to a real output */
 77 static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
 78                            int gain)
 79 {
 80         int index;
 81 
 82         if (snd_BUG_ON(pipe >= num_pipes_out(chip) ||
 83                        output >= num_busses_out(chip)))
 84                 return -EINVAL;
 85 
 86         if (wait_handshake(chip))
 87                 return -EIO;
 88 
 89         chip->vmixer_gain[output][pipe] = gain;
 90         index = output * num_pipes_out(chip) + pipe;
 91         chip->comm_page->vmixer[index] = gain;
 92 
 93         dev_dbg(chip->card->dev,
 94                 "set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain);
 95         return 0;
 96 }
 97 
 98 
 99 
100 /* Tell the DSP to read and update virtual mixer levels in comm page. */
101 static int update_vmixer_level(struct echoaudio *chip)
102 {
103         if (wait_handshake(chip))
104                 return -EIO;
105         clear_handshake(chip);
106         return send_vector(chip, DSP_VC_SET_VMIXER_GAIN);
107 }
108 
109 
110 
111 static u32 detect_input_clocks(const struct echoaudio *chip)
112 {
113         return ECHO_CLOCK_BIT_INTERNAL;
114 }
115 
116 
117 
118 /* The IndigoIO has no ASIC. Just do nothing */
119 static int load_asic(struct echoaudio *chip)
120 {
121         return 0;
122 }
123 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php