aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 19:36:07 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 19:36:07 -0400
commitc9294e4b3793e2bd397691ae015283eecca29562 (patch)
treea8f59a67b1540565000ee679615641dcc1255307 /sound/pci/echoaudio
parentae02cde7e9bc7bb4cb48b1798479889f043ba2ae (diff)
parenta2328d0249fce44381289525bd580b37d2105963 (diff)
Merge branch 'topic/echoaudio' into for-linus
Diffstat (limited to 'sound/pci/echoaudio')
-rw-r--r--sound/pci/echoaudio/Makefile4
-rw-r--r--sound/pci/echoaudio/echoaudio.c17
-rw-r--r--sound/pci/echoaudio/echoaudio.h3
-rw-r--r--sound/pci/echoaudio/echoaudio_dsp.h9
-rw-r--r--sound/pci/echoaudio/indigo_dsp.c12
-rw-r--r--sound/pci/echoaudio/indigo_express_dsp.c119
-rw-r--r--sound/pci/echoaudio/indigodj_dsp.c12
-rw-r--r--sound/pci/echoaudio/indigodjx.c107
-rw-r--r--sound/pci/echoaudio/indigodjx_dsp.c68
-rw-r--r--sound/pci/echoaudio/indigoio_dsp.c12
-rw-r--r--sound/pci/echoaudio/indigoiox.c109
-rw-r--r--sound/pci/echoaudio/indigoiox_dsp.c68
-rw-r--r--sound/pci/echoaudio/mia_dsp.c12
13 files changed, 488 insertions, 64 deletions
diff --git a/sound/pci/echoaudio/Makefile b/sound/pci/echoaudio/Makefile
index 7b576aeb3f8d..1361de77e0cd 100644
--- a/sound/pci/echoaudio/Makefile
+++ b/sound/pci/echoaudio/Makefile
@@ -15,6 +15,8 @@ snd-echo3g-objs := echo3g.o
15snd-indigo-objs := indigo.o 15snd-indigo-objs := indigo.o
16snd-indigoio-objs := indigoio.o 16snd-indigoio-objs := indigoio.o
17snd-indigodj-objs := indigodj.o 17snd-indigodj-objs := indigodj.o
18snd-indigoiox-objs := indigoiox.o
19snd-indigodjx-objs := indigodjx.o
18 20
19obj-$(CONFIG_SND_DARLA20) += snd-darla20.o 21obj-$(CONFIG_SND_DARLA20) += snd-darla20.o
20obj-$(CONFIG_SND_GINA20) += snd-gina20.o 22obj-$(CONFIG_SND_GINA20) += snd-gina20.o
@@ -28,3 +30,5 @@ obj-$(CONFIG_SND_ECHO3G) += snd-echo3g.o
28obj-$(CONFIG_SND_INDIGO) += snd-indigo.o 30obj-$(CONFIG_SND_INDIGO) += snd-indigo.o
29obj-$(CONFIG_SND_INDIGOIO) += snd-indigoio.o 31obj-$(CONFIG_SND_INDIGOIO) += snd-indigoio.o
30obj-$(CONFIG_SND_INDIGODJ) += snd-indigodj.o 32obj-$(CONFIG_SND_INDIGODJ) += snd-indigodj.o
33obj-$(CONFIG_SND_INDIGOIOX) += snd-indigoiox.o
34obj-$(CONFIG_SND_INDIGODJX) += snd-indigodjx.o
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 9d015a76eb69..da2065cd2c0d 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -950,6 +950,8 @@ static int __devinit snd_echo_new_pcm(struct echoaudio *chip)
950 Control interface 950 Control interface
951******************************************************************************/ 951******************************************************************************/
952 952
953#ifndef ECHOCARD_HAS_VMIXER
954
953/******************* PCM output volume *******************/ 955/******************* PCM output volume *******************/
954static int snd_echo_output_gain_info(struct snd_kcontrol *kcontrol, 956static int snd_echo_output_gain_info(struct snd_kcontrol *kcontrol,
955 struct snd_ctl_elem_info *uinfo) 957 struct snd_ctl_elem_info *uinfo)
@@ -1001,18 +1003,6 @@ static int snd_echo_output_gain_put(struct snd_kcontrol *kcontrol,
1001 return changed; 1003 return changed;
1002} 1004}
1003 1005
1004#ifdef ECHOCARD_HAS_VMIXER
1005/* On Vmixer cards this one controls the line-out volume */
1006static struct snd_kcontrol_new snd_echo_line_output_gain __devinitdata = {
1007 .name = "Line Playback Volume",
1008 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1009 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ,
1010 .info = snd_echo_output_gain_info,
1011 .get = snd_echo_output_gain_get,
1012 .put = snd_echo_output_gain_put,
1013 .tlv = {.p = db_scale_output_gain},
1014};
1015#else
1016static struct snd_kcontrol_new snd_echo_pcm_output_gain __devinitdata = { 1006static struct snd_kcontrol_new snd_echo_pcm_output_gain __devinitdata = {
1017 .name = "PCM Playback Volume", 1007 .name = "PCM Playback Volume",
1018 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1008 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -1022,6 +1012,7 @@ static struct snd_kcontrol_new snd_echo_pcm_output_gain __devinitdata = {
1022 .put = snd_echo_output_gain_put, 1012 .put = snd_echo_output_gain_put,
1023 .tlv = {.p = db_scale_output_gain}, 1013 .tlv = {.p = db_scale_output_gain},
1024}; 1014};
1015
1025#endif 1016#endif
1026 1017
1027 1018
@@ -2037,8 +2028,6 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
2037 2028
2038#ifdef ECHOCARD_HAS_VMIXER 2029#ifdef ECHOCARD_HAS_VMIXER
2039 snd_echo_vmixer.count = num_pipes_out(chip) * num_busses_out(chip); 2030 snd_echo_vmixer.count = num_pipes_out(chip) * num_busses_out(chip);
2040 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_line_output_gain, chip))) < 0)
2041 goto ctl_error;
2042 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_vmixer, chip))) < 0) 2031 if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_echo_vmixer, chip))) < 0)
2043 goto ctl_error; 2032 goto ctl_error;
2044#else 2033#else
diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h
index 1c88e051abf2..f9490ae36c2e 100644
--- a/sound/pci/echoaudio/echoaudio.h
+++ b/sound/pci/echoaudio/echoaudio.h
@@ -189,6 +189,9 @@
189#define INDIGO 0x0090 189#define INDIGO 0x0090
190#define INDIGO_IO 0x00a0 190#define INDIGO_IO 0x00a0
191#define INDIGO_DJ 0x00b0 191#define INDIGO_DJ 0x00b0
192#define DC8 0x00c0
193#define INDIGO_IOX 0x00d0
194#define INDIGO_DJX 0x00e0
192#define ECHO3G 0x0100 195#define ECHO3G 0x0100
193 196
194 197
diff --git a/sound/pci/echoaudio/echoaudio_dsp.h b/sound/pci/echoaudio/echoaudio_dsp.h
index e352f3ae292c..cb7d75a0a503 100644
--- a/sound/pci/echoaudio/echoaudio_dsp.h
+++ b/sound/pci/echoaudio/echoaudio_dsp.h
@@ -576,8 +576,13 @@ SET_LAYLA24_FREQUENCY_REG command.
576#define E3G_ASIC_NOT_LOADED 0xffff 576#define E3G_ASIC_NOT_LOADED 0xffff
577#define E3G_BOX_TYPE_MASK 0xf0 577#define E3G_BOX_TYPE_MASK 0xf0
578 578
579#define EXT_3GBOX_NC 0x01 579/* Indigo express control register values */
580#define EXT_3GBOX_NOT_SET 0x02 580#define INDIGO_EXPRESS_32000 0x02
581#define INDIGO_EXPRESS_44100 0x01
582#define INDIGO_EXPRESS_48000 0x00
583#define INDIGO_EXPRESS_DOUBLE_SPEED 0x10
584#define INDIGO_EXPRESS_QUAD_SPEED 0x04
585#define INDIGO_EXPRESS_CLOCK_MASK 0x17
581 586
582 587
583/* 588/*
diff --git a/sound/pci/echoaudio/indigo_dsp.c b/sound/pci/echoaudio/indigo_dsp.c
index f05e39f7aad9..0b2cd9c86277 100644
--- a/sound/pci/echoaudio/indigo_dsp.c
+++ b/sound/pci/echoaudio/indigo_dsp.c
@@ -63,18 +63,6 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
63 if ((err = init_line_levels(chip)) < 0) 63 if ((err = init_line_levels(chip)) < 0)
64 return err; 64 return err;
65 65
66 /* Default routing of the virtual channels: all vchannels are routed
67 to the stereo output */
68 set_vmixer_gain(chip, 0, 0, 0);
69 set_vmixer_gain(chip, 1, 1, 0);
70 set_vmixer_gain(chip, 0, 2, 0);
71 set_vmixer_gain(chip, 1, 3, 0);
72 set_vmixer_gain(chip, 0, 4, 0);
73 set_vmixer_gain(chip, 1, 5, 0);
74 set_vmixer_gain(chip, 0, 6, 0);
75 set_vmixer_gain(chip, 1, 7, 0);
76 err = update_vmixer_level(chip);
77
78 DE_INIT(("init_hw done\n")); 66 DE_INIT(("init_hw done\n"));
79 return err; 67 return err;
80} 68}
diff --git a/sound/pci/echoaudio/indigo_express_dsp.c b/sound/pci/echoaudio/indigo_express_dsp.c
new file mode 100644
index 000000000000..9ab625e15652
--- /dev/null
+++ b/sound/pci/echoaudio/indigo_express_dsp.c
@@ -0,0 +1,119 @@
1/************************************************************************
2
3This file is part of Echo Digital Audio's generic driver library.
4Copyright Echo Digital Audio Corporation (c) 1998 - 2005
5All rights reserved
6www.echoaudio.com
7
8This library is free software; you can redistribute it and/or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation; either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public
19License along with this library; if not, write to the Free Software
20Foundation, 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
29static 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 chip->comm_page->control_register = cpu_to_le32(control_reg);
65 chip->sample_rate = rate;
66 clear_handshake(chip);
67 return send_vector(chip, DSP_VC_UPDATE_CLOCKS);
68 }
69 return 0;
70}
71
72
73
74/* This function routes the sound from a virtual channel to a real output */
75static int set_vmixer_gain(struct echoaudio *chip, u16 output, u16 pipe,
76 int gain)
77{
78 int index;
79
80 if (snd_BUG_ON(pipe >= num_pipes_out(chip) ||
81 output >= num_busses_out(chip)))
82 return -EINVAL;
83
84 if (wait_handshake(chip))
85 return -EIO;
86
87 chip->vmixer_gain[output][pipe] = gain;
88 index = output * num_pipes_out(chip) + pipe;
89 chip->comm_page->vmixer[index] = gain;
90
91 DE_ACT(("set_vmixer_gain: pipe %d, out %d = %d\n", pipe, output, gain));
92 return 0;
93}
94
95
96
97/* Tell the DSP to read and update virtual mixer levels in comm page. */
98static int update_vmixer_level(struct echoaudio *chip)
99{
100 if (wait_handshake(chip))
101 return -EIO;
102 clear_handshake(chip);
103 return send_vector(chip, DSP_VC_SET_VMIXER_GAIN);
104}
105
106
107
108static u32 detect_input_clocks(const struct echoaudio *chip)
109{
110 return ECHO_CLOCK_BIT_INTERNAL;
111}
112
113
114
115/* The IndigoIO has no ASIC. Just do nothing */
116static int load_asic(struct echoaudio *chip)
117{
118 return 0;
119}
diff --git a/sound/pci/echoaudio/indigodj_dsp.c b/sound/pci/echoaudio/indigodj_dsp.c
index 90730a5ecb42..08392916691e 100644
--- a/sound/pci/echoaudio/indigodj_dsp.c
+++ b/sound/pci/echoaudio/indigodj_dsp.c
@@ -63,18 +63,6 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
63 if ((err = init_line_levels(chip)) < 0) 63 if ((err = init_line_levels(chip)) < 0)
64 return err; 64 return err;
65 65
66 /* Default routing of the virtual channels: vchannels 0-3 and
67 vchannels 4-7 are routed to real channels 0-4 */
68 set_vmixer_gain(chip, 0, 0, 0);
69 set_vmixer_gain(chip, 1, 1, 0);
70 set_vmixer_gain(chip, 2, 2, 0);
71 set_vmixer_gain(chip, 3, 3, 0);
72 set_vmixer_gain(chip, 0, 4, 0);
73 set_vmixer_gain(chip, 1, 5, 0);
74 set_vmixer_gain(chip, 2, 6, 0);
75 set_vmixer_gain(chip, 3, 7, 0);
76 err = update_vmixer_level(chip);
77
78 DE_INIT(("init_hw done\n")); 66 DE_INIT(("init_hw done\n"));
79 return err; 67 return err;
80} 68}
diff --git a/sound/pci/echoaudio/indigodjx.c b/sound/pci/echoaudio/indigodjx.c
new file mode 100644
index 000000000000..3482ef69f491
--- /dev/null
+++ b/sound/pci/echoaudio/indigodjx.c
@@ -0,0 +1,107 @@
1/*
2 * ALSA driver for Echoaudio soundcards.
3 * Copyright (C) 2009 Giuliano Pochini <pochini@shiny.it>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#define INDIGO_FAMILY
20#define ECHOCARD_INDIGO_DJX
21#define ECHOCARD_NAME "Indigo DJx"
22#define ECHOCARD_HAS_SUPER_INTERLEAVE
23#define ECHOCARD_HAS_VMIXER
24#define ECHOCARD_HAS_STEREO_BIG_ENDIAN32
25
26/* Pipe indexes */
27#define PX_ANALOG_OUT 0 /* 8 */
28#define PX_DIGITAL_OUT 8 /* 0 */
29#define PX_ANALOG_IN 8 /* 0 */
30#define PX_DIGITAL_IN 8 /* 0 */
31#define PX_NUM 8
32
33/* Bus indexes */
34#define BX_ANALOG_OUT 0 /* 4 */
35#define BX_DIGITAL_OUT 4 /* 0 */
36#define BX_ANALOG_IN 4 /* 0 */
37#define BX_DIGITAL_IN 4 /* 0 */
38#define BX_NUM 4
39
40
41#include <linux/delay.h>
42#include <linux/init.h>
43#include <linux/interrupt.h>
44#include <linux/pci.h>
45#include <linux/slab.h>
46#include <linux/moduleparam.h>
47#include <linux/firmware.h>
48#include <linux/io.h>
49#include <sound/core.h>
50#include <sound/info.h>
51#include <sound/control.h>
52#include <sound/tlv.h>
53#include <sound/pcm.h>
54#include <sound/pcm_params.h>
55#include <sound/asoundef.h>
56#include <sound/initval.h>
57#include <asm/atomic.h>
58#include "echoaudio.h"
59
60MODULE_FIRMWARE("ea/loader_dsp.fw");
61MODULE_FIRMWARE("ea/indigo_djx_dsp.fw");
62
63#define FW_361_LOADER 0
64#define FW_INDIGO_DJX_DSP 1
65
66static const struct firmware card_fw[] = {
67 {0, "loader_dsp.fw"},
68 {0, "indigo_djx_dsp.fw"}
69};
70
71static struct pci_device_id snd_echo_ids[] = {
72 {0x1057, 0x3410, 0xECC0, 0x00E0, 0, 0, 0}, /* Indigo DJx*/
73 {0,}
74};
75
76static struct snd_pcm_hardware pcm_hardware_skel = {
77 .info = SNDRV_PCM_INFO_MMAP |
78 SNDRV_PCM_INFO_INTERLEAVED |
79 SNDRV_PCM_INFO_BLOCK_TRANSFER |
80 SNDRV_PCM_INFO_MMAP_VALID |
81 SNDRV_PCM_INFO_PAUSE |
82 SNDRV_PCM_INFO_SYNC_START,
83 .formats = SNDRV_PCM_FMTBIT_U8 |
84 SNDRV_PCM_FMTBIT_S16_LE |
85 SNDRV_PCM_FMTBIT_S24_3LE |
86 SNDRV_PCM_FMTBIT_S32_LE |
87 SNDRV_PCM_FMTBIT_S32_BE,
88 .rates = SNDRV_PCM_RATE_32000 |
89 SNDRV_PCM_RATE_44100 |
90 SNDRV_PCM_RATE_48000 |
91 SNDRV_PCM_RATE_88200 |
92 SNDRV_PCM_RATE_96000,
93 .rate_min = 32000,
94 .rate_max = 96000,
95 .channels_min = 1,
96 .channels_max = 4,
97 .buffer_bytes_max = 262144,
98 .period_bytes_min = 32,
99 .period_bytes_max = 131072,
100 .periods_min = 2,
101 .periods_max = 220,
102};
103
104#include "indigodjx_dsp.c"
105#include "indigo_express_dsp.c"
106#include "echoaudio_dsp.c"
107#include "echoaudio.c"
diff --git a/sound/pci/echoaudio/indigodjx_dsp.c b/sound/pci/echoaudio/indigodjx_dsp.c
new file mode 100644
index 000000000000..f591fc2ed960
--- /dev/null
+++ b/sound/pci/echoaudio/indigodjx_dsp.c
@@ -0,0 +1,68 @@
1/************************************************************************
2
3This file is part of Echo Digital Audio's generic driver library.
4Copyright Echo Digital Audio Corporation (c) 1998 - 2005
5All rights reserved
6www.echoaudio.com
7
8This library is free software; you can redistribute it and/or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation; either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public
19License along with this library; if not, write to the Free Software
20Foundation, 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
29static int update_vmixer_level(struct echoaudio *chip);
30static int set_vmixer_gain(struct echoaudio *chip, u16 output,
31 u16 pipe, int gain);
32
33
34static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
35{
36 int err;
37
38 DE_INIT(("init_hw() - Indigo DJx\n"));
39 if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_DJX))
40 return -ENODEV;
41
42 err = init_dsp_comm_page(chip);
43 if (err < 0) {
44 DE_INIT(("init_hw - could not initialize DSP comm page\n"));
45 return err;
46 }
47
48 chip->device_id = device_id;
49 chip->subdevice_id = subdevice_id;
50 chip->bad_board = TRUE;
51 chip->dsp_code_to_load = &card_fw[FW_INDIGO_DJX_DSP];
52 /* Since this card has no ASIC, mark it as loaded so everything
53 works OK */
54 chip->asic_loaded = TRUE;
55 chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
56
57 err = load_firmware(chip);
58 if (err < 0)
59 return err;
60 chip->bad_board = FALSE;
61
62 err = init_line_levels(chip);
63 if (err < 0)
64 return err;
65
66 DE_INIT(("init_hw done\n"));
67 return err;
68}
diff --git a/sound/pci/echoaudio/indigoio_dsp.c b/sound/pci/echoaudio/indigoio_dsp.c
index a7e09ec21079..0604c8a85223 100644
--- a/sound/pci/echoaudio/indigoio_dsp.c
+++ b/sound/pci/echoaudio/indigoio_dsp.c
@@ -63,18 +63,6 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
63 if ((err = init_line_levels(chip)) < 0) 63 if ((err = init_line_levels(chip)) < 0)
64 return err; 64 return err;
65 65
66 /* Default routing of the virtual channels: all vchannels are routed
67 to the stereo output */
68 set_vmixer_gain(chip, 0, 0, 0);
69 set_vmixer_gain(chip, 1, 1, 0);
70 set_vmixer_gain(chip, 0, 2, 0);
71 set_vmixer_gain(chip, 1, 3, 0);
72 set_vmixer_gain(chip, 0, 4, 0);
73 set_vmixer_gain(chip, 1, 5, 0);
74 set_vmixer_gain(chip, 0, 6, 0);
75 set_vmixer_gain(chip, 1, 7, 0);
76 err = update_vmixer_level(chip);
77
78 DE_INIT(("init_hw done\n")); 66 DE_INIT(("init_hw done\n"));
79 return err; 67 return err;
80} 68}
diff --git a/sound/pci/echoaudio/indigoiox.c b/sound/pci/echoaudio/indigoiox.c
new file mode 100644
index 000000000000..aebee27a40ff
--- /dev/null
+++ b/sound/pci/echoaudio/indigoiox.c
@@ -0,0 +1,109 @@
1/*
2 * ALSA driver for Echoaudio soundcards.
3 * Copyright (C) 2009 Giuliano Pochini <pochini@shiny.it>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#define INDIGO_FAMILY
20#define ECHOCARD_INDIGO_IOX
21#define ECHOCARD_NAME "Indigo IOx"
22#define ECHOCARD_HAS_MONITOR
23#define ECHOCARD_HAS_SUPER_INTERLEAVE
24#define ECHOCARD_HAS_VMIXER
25#define ECHOCARD_HAS_STEREO_BIG_ENDIAN32
26
27/* Pipe indexes */
28#define PX_ANALOG_OUT 0 /* 8 */
29#define PX_DIGITAL_OUT 8 /* 0 */
30#define PX_ANALOG_IN 8 /* 2 */
31#define PX_DIGITAL_IN 10 /* 0 */
32#define PX_NUM 10
33
34/* Bus indexes */
35#define BX_ANALOG_OUT 0 /* 2 */
36#define BX_DIGITAL_OUT 2 /* 0 */
37#define BX_ANALOG_IN 2 /* 2 */
38#define BX_DIGITAL_IN 4 /* 0 */
39#define BX_NUM 4
40
41
42#include <linux/delay.h>
43#include <linux/init.h>
44#include <linux/interrupt.h>
45#include <linux/pci.h>
46#include <linux/slab.h>
47#include <linux/moduleparam.h>
48#include <linux/firmware.h>
49#include <linux/io.h>
50#include <sound/core.h>
51#include <sound/info.h>
52#include <sound/control.h>
53#include <sound/tlv.h>
54#include <sound/pcm.h>
55#include <sound/pcm_params.h>
56#include <sound/asoundef.h>
57#include <sound/initval.h>
58#include <asm/atomic.h>
59#include "echoaudio.h"
60
61MODULE_FIRMWARE("ea/loader_dsp.fw");
62MODULE_FIRMWARE("ea/indigo_iox_dsp.fw");
63
64#define FW_361_LOADER 0
65#define FW_INDIGO_IOX_DSP 1
66
67static const struct firmware card_fw[] = {
68 {0, "loader_dsp.fw"},
69 {0, "indigo_iox_dsp.fw"}
70};
71
72static struct pci_device_id snd_echo_ids[] = {
73 {0x1057, 0x3410, 0xECC0, 0x00D0, 0, 0, 0}, /* Indigo IOx */
74 {0,}
75};
76
77static struct snd_pcm_hardware pcm_hardware_skel = {
78 .info = SNDRV_PCM_INFO_MMAP |
79 SNDRV_PCM_INFO_INTERLEAVED |
80 SNDRV_PCM_INFO_BLOCK_TRANSFER |
81 SNDRV_PCM_INFO_MMAP_VALID |
82 SNDRV_PCM_INFO_PAUSE |
83 SNDRV_PCM_INFO_SYNC_START,
84 .formats = SNDRV_PCM_FMTBIT_U8 |
85 SNDRV_PCM_FMTBIT_S16_LE |
86 SNDRV_PCM_FMTBIT_S24_3LE |
87 SNDRV_PCM_FMTBIT_S32_LE |
88 SNDRV_PCM_FMTBIT_S32_BE,
89 .rates = SNDRV_PCM_RATE_32000 |
90 SNDRV_PCM_RATE_44100 |
91 SNDRV_PCM_RATE_48000 |
92 SNDRV_PCM_RATE_88200 |
93 SNDRV_PCM_RATE_96000,
94 .rate_min = 32000,
95 .rate_max = 96000,
96 .channels_min = 1,
97 .channels_max = 8,
98 .buffer_bytes_max = 262144,
99 .period_bytes_min = 32,
100 .period_bytes_max = 131072,
101 .periods_min = 2,
102 .periods_max = 220,
103};
104
105#include "indigoiox_dsp.c"
106#include "indigo_express_dsp.c"
107#include "echoaudio_dsp.c"
108#include "echoaudio.c"
109
diff --git a/sound/pci/echoaudio/indigoiox_dsp.c b/sound/pci/echoaudio/indigoiox_dsp.c
new file mode 100644
index 000000000000..f357521c79e6
--- /dev/null
+++ b/sound/pci/echoaudio/indigoiox_dsp.c
@@ -0,0 +1,68 @@
1/************************************************************************
2
3This file is part of Echo Digital Audio's generic driver library.
4Copyright Echo Digital Audio Corporation (c) 1998 - 2005
5All rights reserved
6www.echoaudio.com
7
8This library is free software; you can redistribute it and/or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation; either
11version 2.1 of the License, or (at your option) any later version.
12
13This library is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public
19License along with this library; if not, write to the Free Software
20Foundation, 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
29static int update_vmixer_level(struct echoaudio *chip);
30static int set_vmixer_gain(struct echoaudio *chip, u16 output,
31 u16 pipe, int gain);
32
33
34static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
35{
36 int err;
37
38 DE_INIT(("init_hw() - Indigo IOx\n"));
39 if (snd_BUG_ON((subdevice_id & 0xfff0) != INDIGO_IOX))
40 return -ENODEV;
41
42 err = init_dsp_comm_page(chip);
43 if (err < 0) {
44 DE_INIT(("init_hw - could not initialize DSP comm page\n"));
45 return err;
46 }
47
48 chip->device_id = device_id;
49 chip->subdevice_id = subdevice_id;
50 chip->bad_board = TRUE;
51 chip->dsp_code_to_load = &card_fw[FW_INDIGO_IOX_DSP];
52 /* Since this card has no ASIC, mark it as loaded so everything
53 works OK */
54 chip->asic_loaded = TRUE;
55 chip->input_clock_types = ECHO_CLOCK_BIT_INTERNAL;
56
57 err = load_firmware(chip);
58 if (err < 0)
59 return err;
60 chip->bad_board = FALSE;
61
62 err = init_line_levels(chip);
63 if (err < 0)
64 return err;
65
66 DE_INIT(("init_hw done\n"));
67 return err;
68}
diff --git a/sound/pci/echoaudio/mia_dsp.c b/sound/pci/echoaudio/mia_dsp.c
index 3eca16cb7f71..551405114cbc 100644
--- a/sound/pci/echoaudio/mia_dsp.c
+++ b/sound/pci/echoaudio/mia_dsp.c
@@ -69,18 +69,6 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
69 if ((err = init_line_levels(chip))) 69 if ((err = init_line_levels(chip)))
70 return err; 70 return err;
71 71
72 /* Default routing of the virtual channels: vchannels 0-3 go to analog
73 outputs and vchannels 4-7 go to S/PDIF outputs */
74 set_vmixer_gain(chip, 0, 0, 0);
75 set_vmixer_gain(chip, 1, 1, 0);
76 set_vmixer_gain(chip, 0, 2, 0);
77 set_vmixer_gain(chip, 1, 3, 0);
78 set_vmixer_gain(chip, 2, 4, 0);
79 set_vmixer_gain(chip, 3, 5, 0);
80 set_vmixer_gain(chip, 2, 6, 0);
81 set_vmixer_gain(chip, 3, 7, 0);
82 err = update_vmixer_level(chip);
83
84 DE_INIT(("init_hw done\n")); 72 DE_INIT(("init_hw done\n"));
85 return err; 73 return err;
86} 74}