18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci#ifndef __SOUND_HOONTECH_H
38c2ecf20Sopenharmony_ci#define __SOUND_HOONTECH_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci *   ALSA driver for ICEnsemble ICE1712 (Envy24)
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci *   Lowlevel functions for Hoontech STDSP24
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci *	Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define  HOONTECH_DEVICE_DESC \
148c2ecf20Sopenharmony_ci	"{Hoontech,SoundTrack DSP 24}," \
158c2ecf20Sopenharmony_ci	"{Hoontech,SoundTrack DSP 24 Value}," \
168c2ecf20Sopenharmony_ci	"{Hoontech,SoundTrack DSP 24 Media 7.1}," \
178c2ecf20Sopenharmony_ci	"{Event Electronics,EZ8},"
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define ICE1712_SUBDEVICE_STDSP24		0x12141217	/* Hoontech SoundTrack Audio DSP 24 */
208c2ecf20Sopenharmony_ci#define ICE1712_SUBDEVICE_STDSP24_VALUE		0x00010010	/* A dummy id for Hoontech SoundTrack Audio DSP 24 Value */
218c2ecf20Sopenharmony_ci#define ICE1712_SUBDEVICE_STDSP24_MEDIA7_1	0x16141217	/* Hoontech ST Audio DSP24 Media 7.1 */
228c2ecf20Sopenharmony_ci#define ICE1712_SUBDEVICE_EVENT_EZ8		0x00010001	/* A dummy id for EZ8 */
238c2ecf20Sopenharmony_ci#define ICE1712_SUBDEVICE_STAUDIO_ADCIII	0x00010002	/* A dummy id for STAudio ADCIII */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciextern struct snd_ice1712_card_info snd_ice1712_hoontech_cards[];
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* Hoontech SoundTrack Audio DSP 24 GPIO definitions */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_0_BOX(r, x)	r[0] = ((r[0] & ~3) | ((x)&3))
318c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_0_DAREAR(r, x)	r[0] = ((r[0] & ~4) | (((x)&1)<<2))
328c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_1_CHN1(r, x)	r[1] = ((r[1] & ~1) | ((x)&1))
338c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_1_CHN2(r, x)	r[1] = ((r[1] & ~2) | (((x)&1)<<1))
348c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_1_CHN3(r, x)	r[1] = ((r[1] & ~4) | (((x)&1)<<2))
358c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_2_CHN4(r, x)	r[2] = ((r[2] & ~1) | ((x)&1))
368c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_2_MIDIIN(r, x)	r[2] = ((r[2] & ~2) | (((x)&1)<<1))
378c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_2_MIDI1(r, x)	r[2] = ((r[2] & ~4) | (((x)&1)<<2))
388c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_3_MIDI2(r, x)	r[3] = ((r[3] & ~1) | ((x)&1))
398c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_3_MUTE(r, x)	r[3] = ((r[3] & ~2) | (((x)&1)<<1))
408c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_3_INSEL(r, x)	r[3] = ((r[3] & ~4) | (((x)&1)<<2))
418c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_SET_ADDR(r, a)	r[a&3] = ((r[a&3] & ~0x18) | (((a)&3)<<3))
428c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_CLOCK(r, a, c)	r[a&3] = ((r[a&3] & ~0x20) | (((c)&1)<<5))
438c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_CLOCK_BIT	(1<<5)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* Hoontech SoundTrack Audio DSP 24 box configuration definitions */
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_DAREAR		(1<<0)
488c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_MUTE		(1<<1)
498c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_INSEL		(1<<2)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_CHN1	(1<<0)	/* input channel 1 */
528c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_CHN2	(1<<1)	/* input channel 2 */
538c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_CHN3	(1<<2)	/* input channel 3 */
548c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_CHN4	(1<<3)	/* input channel 4 */
558c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_MIDI1	(1<<8)
568c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_BOX_MIDI2	(1<<9)
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/* Hoontech SoundTrack Audio DSP 24 Value definitions for modified hardware */
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_AK4524_CS	0x03	/* AK4524 chip select; low = active */
618c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_SERIAL_DATA	0x0c	/* ak4524 data */
628c2ecf20Sopenharmony_ci#define ICE1712_STDSP24_SERIAL_CLOCK	0x30	/* ak4524 clock */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#endif /* __SOUND_HOONTECH_H */
65