Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * ALSA driver for ICEnsemble ICE1712 (Envy24) |
| 3 | * |
| 4 | * Lowlevel functions for Hoontech STDSP24 |
| 5 | * |
Jaroslav Kysela | c1017a4 | 2007-10-15 09:50:19 +0200 | [diff] [blame] | 6 | * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program 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 |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | */ |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <asm/io.h> |
| 25 | #include <linux/delay.h> |
| 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/init.h> |
| 28 | #include <linux/slab.h> |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 29 | #include <linux/mutex.h> |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #include <sound/core.h> |
| 32 | |
| 33 | #include "ice1712.h" |
| 34 | #include "hoontech.h" |
| 35 | |
| 36 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 37 | static void __devinit snd_ice1712_stdsp24_gpio_write(struct snd_ice1712 *ice, unsigned char byte) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | { |
| 39 | byte |= ICE1712_STDSP24_CLOCK_BIT; |
| 40 | udelay(100); |
| 41 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte); |
| 42 | byte &= ~ICE1712_STDSP24_CLOCK_BIT; |
| 43 | udelay(100); |
| 44 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte); |
| 45 | byte |= ICE1712_STDSP24_CLOCK_BIT; |
| 46 | udelay(100); |
| 47 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, byte); |
| 48 | } |
| 49 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 50 | static void __devinit snd_ice1712_stdsp24_darear(struct snd_ice1712 *ice, int activate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 52 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, activate); |
| 54 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[0]); |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 55 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | } |
| 57 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 58 | static void __devinit snd_ice1712_stdsp24_mute(struct snd_ice1712 *ice, int activate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 60 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, activate); |
| 62 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 63 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 66 | static void __devinit snd_ice1712_stdsp24_insel(struct snd_ice1712 *ice, int activate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 68 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, activate); |
| 70 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 71 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 74 | static void __devinit snd_ice1712_stdsp24_box_channel(struct snd_ice1712 *ice, int box, int chn, int activate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 76 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
| 78 | /* select box */ |
| 79 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); |
| 80 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[0]); |
| 81 | |
| 82 | /* prepare for write */ |
| 83 | if (chn == 3) |
| 84 | ICE1712_STDSP24_2_CHN4(ice->spec.hoontech.boxbits, 0); |
| 85 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, activate); |
| 86 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 87 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
| 88 | |
| 89 | ICE1712_STDSP24_1_CHN1(ice->spec.hoontech.boxbits, 1); |
| 90 | ICE1712_STDSP24_1_CHN2(ice->spec.hoontech.boxbits, 1); |
| 91 | ICE1712_STDSP24_1_CHN3(ice->spec.hoontech.boxbits, 1); |
| 92 | ICE1712_STDSP24_2_CHN4(ice->spec.hoontech.boxbits, 1); |
| 93 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[1]); |
| 94 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 95 | udelay(100); |
| 96 | if (chn == 3) { |
| 97 | ICE1712_STDSP24_2_CHN4(ice->spec.hoontech.boxbits, 0); |
| 98 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 99 | } else { |
| 100 | switch (chn) { |
| 101 | case 0: ICE1712_STDSP24_1_CHN1(ice->spec.hoontech.boxbits, 0); break; |
| 102 | case 1: ICE1712_STDSP24_1_CHN2(ice->spec.hoontech.boxbits, 0); break; |
| 103 | case 2: ICE1712_STDSP24_1_CHN3(ice->spec.hoontech.boxbits, 0); break; |
| 104 | } |
| 105 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[1]); |
| 106 | } |
| 107 | udelay(100); |
| 108 | ICE1712_STDSP24_1_CHN1(ice->spec.hoontech.boxbits, 1); |
| 109 | ICE1712_STDSP24_1_CHN2(ice->spec.hoontech.boxbits, 1); |
| 110 | ICE1712_STDSP24_1_CHN3(ice->spec.hoontech.boxbits, 1); |
| 111 | ICE1712_STDSP24_2_CHN4(ice->spec.hoontech.boxbits, 1); |
| 112 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[1]); |
| 113 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 114 | udelay(100); |
| 115 | |
| 116 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, 0); |
| 117 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 118 | |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 119 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 122 | static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int box, int master) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 124 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | |
| 126 | /* select box */ |
| 127 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, box); |
| 128 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[0]); |
| 129 | |
| 130 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 1); |
| 131 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, master); |
| 132 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 133 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
| 134 | |
| 135 | udelay(100); |
| 136 | |
| 137 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 0); |
| 138 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 139 | |
| 140 | mdelay(10); |
| 141 | |
| 142 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 1); |
| 143 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[2]); |
| 144 | |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 145 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | } |
| 147 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 148 | static void __devinit snd_ice1712_stdsp24_midi2(struct snd_ice1712 *ice, int activate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | { |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 150 | mutex_lock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, activate); |
| 152 | snd_ice1712_stdsp24_gpio_write(ice, ice->spec.hoontech.boxbits[3]); |
Ingo Molnar | 62932df | 2006-01-16 16:34:20 +0100 | [diff] [blame] | 153 | mutex_unlock(&ice->gpio_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | } |
| 155 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 156 | static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | { |
| 158 | int box, chn; |
| 159 | |
| 160 | ice->num_total_dacs = 8; |
| 161 | ice->num_total_adcs = 8; |
| 162 | |
| 163 | ice->spec.hoontech.boxbits[0] = |
| 164 | ice->spec.hoontech.boxbits[1] = |
| 165 | ice->spec.hoontech.boxbits[2] = |
| 166 | ice->spec.hoontech.boxbits[3] = 0; /* should be already */ |
| 167 | |
| 168 | ICE1712_STDSP24_SET_ADDR(ice->spec.hoontech.boxbits, 0); |
| 169 | ICE1712_STDSP24_CLOCK(ice->spec.hoontech.boxbits, 0, 1); |
| 170 | ICE1712_STDSP24_0_BOX(ice->spec.hoontech.boxbits, 0); |
| 171 | ICE1712_STDSP24_0_DAREAR(ice->spec.hoontech.boxbits, 0); |
| 172 | |
| 173 | ICE1712_STDSP24_SET_ADDR(ice->spec.hoontech.boxbits, 1); |
| 174 | ICE1712_STDSP24_CLOCK(ice->spec.hoontech.boxbits, 1, 1); |
| 175 | ICE1712_STDSP24_1_CHN1(ice->spec.hoontech.boxbits, 1); |
| 176 | ICE1712_STDSP24_1_CHN2(ice->spec.hoontech.boxbits, 1); |
| 177 | ICE1712_STDSP24_1_CHN3(ice->spec.hoontech.boxbits, 1); |
| 178 | |
| 179 | ICE1712_STDSP24_SET_ADDR(ice->spec.hoontech.boxbits, 2); |
| 180 | ICE1712_STDSP24_CLOCK(ice->spec.hoontech.boxbits, 2, 1); |
| 181 | ICE1712_STDSP24_2_CHN4(ice->spec.hoontech.boxbits, 1); |
| 182 | ICE1712_STDSP24_2_MIDIIN(ice->spec.hoontech.boxbits, 1); |
| 183 | ICE1712_STDSP24_2_MIDI1(ice->spec.hoontech.boxbits, 0); |
| 184 | |
| 185 | ICE1712_STDSP24_SET_ADDR(ice->spec.hoontech.boxbits, 3); |
| 186 | ICE1712_STDSP24_CLOCK(ice->spec.hoontech.boxbits, 3, 1); |
| 187 | ICE1712_STDSP24_3_MIDI2(ice->spec.hoontech.boxbits, 0); |
| 188 | ICE1712_STDSP24_3_MUTE(ice->spec.hoontech.boxbits, 1); |
| 189 | ICE1712_STDSP24_3_INSEL(ice->spec.hoontech.boxbits, 0); |
| 190 | |
| 191 | /* let's go - activate only functions in first box */ |
| 192 | ice->spec.hoontech.config = 0; |
| 193 | /* ICE1712_STDSP24_MUTE | |
| 194 | ICE1712_STDSP24_INSEL | |
| 195 | ICE1712_STDSP24_DAREAR; */ |
| 196 | ice->spec.hoontech.boxconfig[0] = ICE1712_STDSP24_BOX_CHN1 | |
| 197 | ICE1712_STDSP24_BOX_CHN2 | |
| 198 | ICE1712_STDSP24_BOX_CHN3 | |
| 199 | ICE1712_STDSP24_BOX_CHN4 | |
| 200 | ICE1712_STDSP24_BOX_MIDI1 | |
| 201 | ICE1712_STDSP24_BOX_MIDI2; |
| 202 | ice->spec.hoontech.boxconfig[1] = |
| 203 | ice->spec.hoontech.boxconfig[2] = |
| 204 | ice->spec.hoontech.boxconfig[3] = 0; |
| 205 | snd_ice1712_stdsp24_darear(ice, (ice->spec.hoontech.config & ICE1712_STDSP24_DAREAR) ? 1 : 0); |
| 206 | snd_ice1712_stdsp24_mute(ice, (ice->spec.hoontech.config & ICE1712_STDSP24_MUTE) ? 1 : 0); |
| 207 | snd_ice1712_stdsp24_insel(ice, (ice->spec.hoontech.config & ICE1712_STDSP24_INSEL) ? 1 : 0); |
Jaroslav Kysela | b8c5b53 | 2008-01-16 20:12:34 +0100 | [diff] [blame^] | 208 | for (box = 0; box < 1; box++) { |
| 209 | if (ice->spec.hoontech.boxconfig[box] & ICE1712_STDSP24_BOX_MIDI2) |
| 210 | snd_ice1712_stdsp24_midi2(ice, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | for (chn = 0; chn < 4; chn++) |
| 212 | snd_ice1712_stdsp24_box_channel(ice, box, chn, (ice->spec.hoontech.boxconfig[box] & (1 << chn)) ? 1 : 0); |
| 213 | snd_ice1712_stdsp24_box_midi(ice, box, |
| 214 | (ice->spec.hoontech.boxconfig[box] & ICE1712_STDSP24_BOX_MIDI1) ? 1 : 0); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | return 0; |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | * AK4524 access |
| 222 | */ |
| 223 | |
| 224 | /* start callback for STDSP24 with modified hardware */ |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 225 | static void stdsp24_ak4524_lock(struct snd_akm4xxx *ak, int chip) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | { |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 227 | struct snd_ice1712 *ice = ak->private_data[0]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | unsigned char tmp; |
| 229 | snd_ice1712_save_gpio_status(ice); |
| 230 | tmp = ICE1712_STDSP24_SERIAL_DATA | |
| 231 | ICE1712_STDSP24_SERIAL_CLOCK | |
| 232 | ICE1712_STDSP24_AK4524_CS; |
| 233 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, |
| 234 | ice->gpio.direction | tmp); |
| 235 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~tmp); |
| 236 | } |
| 237 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 238 | static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | { |
| 240 | /* Hoontech STDSP24 with modified hardware */ |
Ralf Baechle | bf748ed | 2007-03-13 15:31:08 +0100 | [diff] [blame] | 241 | static struct snd_akm4xxx akm_stdsp24_mv __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | .num_adcs = 2, |
| 243 | .num_dacs = 2, |
| 244 | .type = SND_AK4524, |
| 245 | .ops = { |
| 246 | .lock = stdsp24_ak4524_lock |
| 247 | } |
| 248 | }; |
| 249 | |
Ralf Baechle | bf748ed | 2007-03-13 15:31:08 +0100 | [diff] [blame] | 250 | static struct snd_ak4xxx_private akm_stdsp24_mv_priv __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | .caddr = 2, |
| 252 | .cif = 1, /* CIF high */ |
| 253 | .data_mask = ICE1712_STDSP24_SERIAL_DATA, |
| 254 | .clk_mask = ICE1712_STDSP24_SERIAL_CLOCK, |
| 255 | .cs_mask = ICE1712_STDSP24_AK4524_CS, |
| 256 | .cs_addr = ICE1712_STDSP24_AK4524_CS, |
| 257 | .cs_none = 0, |
| 258 | .add_flags = 0, |
| 259 | }; |
| 260 | |
| 261 | int err; |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 262 | struct snd_akm4xxx *ak; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | |
| 264 | /* set the analog DACs */ |
| 265 | ice->num_total_dacs = 2; |
| 266 | |
| 267 | /* set the analog ADCs */ |
| 268 | ice->num_total_adcs = 2; |
| 269 | |
| 270 | /* analog section */ |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 271 | ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | if (! ak) |
| 273 | return -ENOMEM; |
| 274 | ice->akm_codecs = 1; |
| 275 | |
| 276 | err = snd_ice1712_akm4xxx_init(ak, &akm_stdsp24_mv, &akm_stdsp24_mv_priv, ice); |
| 277 | if (err < 0) |
| 278 | return err; |
| 279 | |
| 280 | /* ak4524 controls */ |
| 281 | err = snd_ice1712_akm4xxx_build_controls(ice); |
| 282 | if (err < 0) |
| 283 | return err; |
| 284 | |
| 285 | return 0; |
| 286 | } |
| 287 | |
Takashi Iwai | 6ca308d | 2005-11-17 14:59:52 +0100 | [diff] [blame] | 288 | static int __devinit snd_ice1712_ez8_init(struct snd_ice1712 *ice) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 289 | { |
| 290 | ice->gpio.write_mask = ice->eeprom.gpiomask; |
| 291 | ice->gpio.direction = ice->eeprom.gpiodir; |
| 292 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ice->eeprom.gpiomask); |
| 293 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DIRECTION, ice->eeprom.gpiodir); |
| 294 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, ice->eeprom.gpiostate); |
| 295 | return 0; |
| 296 | } |
| 297 | |
| 298 | |
| 299 | /* entry point */ |
Ralf Baechle | bf748ed | 2007-03-13 15:31:08 +0100 | [diff] [blame] | 300 | struct snd_ice1712_card_info snd_ice1712_hoontech_cards[] __devinitdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | { |
| 302 | .subvendor = ICE1712_SUBDEVICE_STDSP24, |
| 303 | .name = "Hoontech SoundTrack Audio DSP24", |
| 304 | .model = "dsp24", |
| 305 | .chip_init = snd_ice1712_hoontech_init, |
| 306 | }, |
| 307 | { |
| 308 | .subvendor = ICE1712_SUBDEVICE_STDSP24_VALUE, /* a dummy id */ |
| 309 | .name = "Hoontech SoundTrack Audio DSP24 Value", |
| 310 | .model = "dsp24_value", |
| 311 | .chip_init = snd_ice1712_value_init, |
| 312 | }, |
| 313 | { |
| 314 | .subvendor = ICE1712_SUBDEVICE_STDSP24_MEDIA7_1, |
| 315 | .name = "Hoontech STA DSP24 Media 7.1", |
| 316 | .model = "dsp24_71", |
| 317 | .chip_init = snd_ice1712_hoontech_init, |
| 318 | }, |
| 319 | { |
| 320 | .subvendor = ICE1712_SUBDEVICE_EVENT_EZ8, /* a dummy id */ |
| 321 | .name = "Event Electronics EZ8", |
| 322 | .model = "ez8", |
| 323 | .chip_init = snd_ice1712_ez8_init, |
| 324 | }, |
| 325 | { } /* terminator */ |
| 326 | }; |