18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Driver for Digigram VXpocket soundcards
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __VXPOCKET_H
98c2ecf20Sopenharmony_ci#define __VXPOCKET_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <sound/vx_core.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <pcmcia/cistpl.h>
148c2ecf20Sopenharmony_ci#include <pcmcia/ds.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cistruct snd_vxpocket {
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	struct vx_core core;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci	unsigned long port;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	int mic_level;	/* analog mic level (or boost) */
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci	unsigned int regCDSP;	/* current CDSP register */
258c2ecf20Sopenharmony_ci	unsigned int regDIALOG;	/* current DIALOG register */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci	int index;	/* card index */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	/* pcmcia stuff */
308c2ecf20Sopenharmony_ci	struct pcmcia_device	*p_dev;
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define to_vxpocket(x)	container_of(x, struct snd_vxpocket, core)
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciextern const struct snd_vx_ops snd_vxpocket_ops;
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_civoid vx_set_mic_boost(struct vx_core *chip, int boost);
388c2ecf20Sopenharmony_civoid vx_set_mic_level(struct vx_core *chip, int level);
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ciint vxp_add_mic_controls(struct vx_core *chip);
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci/* Constants used to access the CDSP register (0x08). */
438c2ecf20Sopenharmony_ci#define CDSP_MAGIC	0xA7	/* magic value (for read) */
448c2ecf20Sopenharmony_ci/* for write */
458c2ecf20Sopenharmony_ci#define VXP_CDSP_CLOCKIN_SEL_MASK	0x80	/* 0 (internal), 1 (AES/EBU) */
468c2ecf20Sopenharmony_ci#define VXP_CDSP_DATAIN_SEL_MASK	0x40	/* 0 (analog), 1 (UER) */
478c2ecf20Sopenharmony_ci#define VXP_CDSP_SMPTE_SEL_MASK		0x20
488c2ecf20Sopenharmony_ci#define VXP_CDSP_RESERVED_MASK		0x10
498c2ecf20Sopenharmony_ci#define VXP_CDSP_MIC_SEL_MASK		0x08
508c2ecf20Sopenharmony_ci#define VXP_CDSP_VALID_IRQ_MASK		0x04
518c2ecf20Sopenharmony_ci#define VXP_CDSP_CODEC_RESET_MASK	0x02
528c2ecf20Sopenharmony_ci#define VXP_CDSP_DSP_RESET_MASK		0x01
538c2ecf20Sopenharmony_ci/* VXPOCKET 240/440 */
548c2ecf20Sopenharmony_ci#define P24_CDSP_MICS_SEL_MASK		0x18
558c2ecf20Sopenharmony_ci#define P24_CDSP_MIC20_SEL_MASK		0x10
568c2ecf20Sopenharmony_ci#define P24_CDSP_MIC38_SEL_MASK		0x08
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/* Constants used to access the MEMIRQ register (0x0C). */
598c2ecf20Sopenharmony_ci#define P44_MEMIRQ_MASTER_SLAVE_SEL_MASK 0x08
608c2ecf20Sopenharmony_ci#define P44_MEMIRQ_SYNCED_ALONE_SEL_MASK 0x04
618c2ecf20Sopenharmony_ci#define P44_MEMIRQ_WCLK_OUT_IN_SEL_MASK  0x02 /* Not used */
628c2ecf20Sopenharmony_ci#define P44_MEMIRQ_WCLK_UER_SEL_MASK     0x01 /* Not used */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* Micro levels (0x0C) */
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* Constants used to access the DIALOG register (0x0D). */
678c2ecf20Sopenharmony_ci#define VXP_DLG_XILINX_REPROG_MASK	0x80	/* W */
688c2ecf20Sopenharmony_ci#define VXP_DLG_DATA_XICOR_MASK		0x80	/* R */
698c2ecf20Sopenharmony_ci#define VXP_DLG_RESERVED4_0_MASK	0x40
708c2ecf20Sopenharmony_ci#define VXP_DLG_RESERVED2_0_MASK	0x20
718c2ecf20Sopenharmony_ci#define VXP_DLG_RESERVED1_0_MASK	0x10
728c2ecf20Sopenharmony_ci#define VXP_DLG_DMAWRITE_SEL_MASK	0x08	/* W */
738c2ecf20Sopenharmony_ci#define VXP_DLG_DMAREAD_SEL_MASK	0x04	/* W */
748c2ecf20Sopenharmony_ci#define VXP_DLG_MEMIRQ_MASK		0x02	/* R */
758c2ecf20Sopenharmony_ci#define VXP_DLG_DMA16_SEL_MASK		0x02	/* W */
768c2ecf20Sopenharmony_ci#define VXP_DLG_ACK_MEMIRQ_MASK		0x01	/* R/W */
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#endif /* __VXPOCKET_H */
80