11a59d1b8SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds * ALSA driver for VT1720/VT1724 (Envy24PT/Envy24HT)
41da177e4SLinus Torvalds *
51da177e4SLinus Torvalds * Lowlevel functions for VT1720-based motherboards
61da177e4SLinus Torvalds *
71da177e4SLinus Torvalds * Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
81da177e4SLinus Torvalds */
91da177e4SLinus Torvalds
101da177e4SLinus Torvalds #include <linux/delay.h>
111da177e4SLinus Torvalds #include <linux/interrupt.h>
121da177e4SLinus Torvalds #include <linux/init.h>
131da177e4SLinus Torvalds #include <sound/core.h>
141da177e4SLinus Torvalds
151da177e4SLinus Torvalds #include "ice1712.h"
16189bc171STakashi Iwai #include "envy24ht.h"
171da177e4SLinus Torvalds #include "vt1720_mobo.h"
181da177e4SLinus Torvalds
191da177e4SLinus Torvalds
k8x800_init(struct snd_ice1712 * ice)20e23e7a14SBill Pemberton static int k8x800_init(struct snd_ice1712 *ice)
211da177e4SLinus Torvalds {
221da177e4SLinus Torvalds ice->vt1720 = 1;
231da177e4SLinus Torvalds
241da177e4SLinus Torvalds /* VT1616 codec */
251da177e4SLinus Torvalds ice->num_total_dacs = 6;
261da177e4SLinus Torvalds ice->num_total_adcs = 2;
271da177e4SLinus Torvalds
281da177e4SLinus Torvalds /* WM8728 codec */
291da177e4SLinus Torvalds /* FIXME: TODO */
301da177e4SLinus Torvalds
311da177e4SLinus Torvalds return 0;
321da177e4SLinus Torvalds }
331da177e4SLinus Torvalds
k8x800_add_controls(struct snd_ice1712 * ice)34e23e7a14SBill Pemberton static int k8x800_add_controls(struct snd_ice1712 *ice)
351da177e4SLinus Torvalds {
361da177e4SLinus Torvalds /* FIXME: needs some quirks for VT1616? */
371da177e4SLinus Torvalds return 0;
381da177e4SLinus Torvalds }
391da177e4SLinus Torvalds
401da177e4SLinus Torvalds /* EEPROM image */
411da177e4SLinus Torvalds
42*f16a4e96STakashi Iwai static const unsigned char k8x800_eeprom[] = {
43189bc171STakashi Iwai [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
44189bc171STakashi Iwai [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
45189bc171STakashi Iwai [ICE_EEP2_I2S] = 0x00, /* - */
46189bc171STakashi Iwai [ICE_EEP2_SPDIF] = 0x00, /* - */
47189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR] = 0xff,
48189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR1] = 0xff,
49189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
50189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK] = 0xff,
51189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK1] = 0xff,
52189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
53189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE] = 0x00,
54189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE1] = 0x00,
55189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
561da177e4SLinus Torvalds };
571da177e4SLinus Torvalds
58*f16a4e96STakashi Iwai static const unsigned char sn25p_eeprom[] = {
59189bc171STakashi Iwai [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */
60189bc171STakashi Iwai [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */
61189bc171STakashi Iwai [ICE_EEP2_I2S] = 0x00, /* - */
62189bc171STakashi Iwai [ICE_EEP2_SPDIF] = 0x41, /* - */
63189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR] = 0xff,
64189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR1] = 0xff,
65189bc171STakashi Iwai [ICE_EEP2_GPIO_DIR2] = 0x00, /* - */
66189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK] = 0xff,
67189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK1] = 0xff,
68189bc171STakashi Iwai [ICE_EEP2_GPIO_MASK2] = 0x00, /* - */
69189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE] = 0x00,
70189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE1] = 0x00,
71189bc171STakashi Iwai [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */
7209f9a891STakashi Iwai };
7309f9a891STakashi Iwai
741da177e4SLinus Torvalds
751da177e4SLinus Torvalds /* entry point */
76e23e7a14SBill Pemberton struct snd_ice1712_card_info snd_vt1720_mobo_cards[] = {
771da177e4SLinus Torvalds {
781da177e4SLinus Torvalds .subvendor = VT1720_SUBDEVICE_K8X800,
791da177e4SLinus Torvalds .name = "Albatron K8X800 Pro II",
801da177e4SLinus Torvalds .model = "k8x800",
811da177e4SLinus Torvalds .chip_init = k8x800_init,
821da177e4SLinus Torvalds .build_controls = k8x800_add_controls,
831da177e4SLinus Torvalds .eeprom_size = sizeof(k8x800_eeprom),
841da177e4SLinus Torvalds .eeprom_data = k8x800_eeprom,
851da177e4SLinus Torvalds },
861da177e4SLinus Torvalds {
871da177e4SLinus Torvalds .subvendor = VT1720_SUBDEVICE_ZNF3_150,
881da177e4SLinus Torvalds .name = "Chaintech ZNF3-150",
891da177e4SLinus Torvalds /* identical with k8x800 */
901da177e4SLinus Torvalds .chip_init = k8x800_init,
911da177e4SLinus Torvalds .build_controls = k8x800_add_controls,
921da177e4SLinus Torvalds .eeprom_size = sizeof(k8x800_eeprom),
931da177e4SLinus Torvalds .eeprom_data = k8x800_eeprom,
941da177e4SLinus Torvalds },
951da177e4SLinus Torvalds {
961da177e4SLinus Torvalds .subvendor = VT1720_SUBDEVICE_ZNF3_250,
971da177e4SLinus Torvalds .name = "Chaintech ZNF3-250",
981da177e4SLinus Torvalds /* identical with k8x800 */
991da177e4SLinus Torvalds .chip_init = k8x800_init,
1001da177e4SLinus Torvalds .build_controls = k8x800_add_controls,
1011da177e4SLinus Torvalds .eeprom_size = sizeof(k8x800_eeprom),
1021da177e4SLinus Torvalds .eeprom_data = k8x800_eeprom,
1031da177e4SLinus Torvalds },
1041da177e4SLinus Torvalds {
1051da177e4SLinus Torvalds .subvendor = VT1720_SUBDEVICE_9CJS,
1061da177e4SLinus Torvalds .name = "Chaintech 9CJS",
1071da177e4SLinus Torvalds /* identical with k8x800 */
1081da177e4SLinus Torvalds .chip_init = k8x800_init,
1091da177e4SLinus Torvalds .build_controls = k8x800_add_controls,
1101da177e4SLinus Torvalds .eeprom_size = sizeof(k8x800_eeprom),
1111da177e4SLinus Torvalds .eeprom_data = k8x800_eeprom,
1121da177e4SLinus Torvalds },
113b9cce374STakashi Iwai {
114b9cce374STakashi Iwai .subvendor = VT1720_SUBDEVICE_SN25P,
115b9cce374STakashi Iwai .name = "Shuttle SN25P",
11609f9a891STakashi Iwai .model = "sn25p",
117b9cce374STakashi Iwai .chip_init = k8x800_init,
118b9cce374STakashi Iwai .build_controls = k8x800_add_controls,
119b9cce374STakashi Iwai .eeprom_size = sizeof(k8x800_eeprom),
12009f9a891STakashi Iwai .eeprom_data = sn25p_eeprom,
121b9cce374STakashi Iwai },
1221da177e4SLinus Torvalds { } /* terminator */
1231da177e4SLinus Torvalds };
1241da177e4SLinus Torvalds
125