Linux Audio

Check our new training course

Loading...
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef XONAR_DG_H_INCLUDED
 3#define XONAR_DG_H_INCLUDED
 4
 5#include "oxygen.h"
 6
 7#define GPIO_MAGIC		0x0008
 8#define GPIO_HP_DETECT		0x0010
 9#define GPIO_INPUT_ROUTE	0x0060
10#define GPIO_HP_REAR		0x0080
11#define GPIO_OUTPUT_ENABLE	0x0100
12
13#define CAPTURE_SRC_MIC		0
14#define CAPTURE_SRC_FP_MIC	1
15#define CAPTURE_SRC_LINE	2
16#define CAPTURE_SRC_AUX		3
17
18#define PLAYBACK_DST_HP		0
19#define PLAYBACK_DST_HP_FP	1
20#define PLAYBACK_DST_MULTICH	2
21
22enum cs4245_shadow_operation {
23	CS4245_SAVE_TO_SHADOW,
24	CS4245_LOAD_FROM_SHADOW
25};
26
27struct dg {
28	/* shadow copy of the CS4245 register space */
29	unsigned char cs4245_shadow[17];
30	/* output select: headphone/speakers */
31	unsigned char output_sel;
32	/* volumes for all capture sources */
33	char input_vol[4][2];
34	/* input select: mic/fp mic/line/aux */
35	unsigned char input_sel;
36};
37
38/* Xonar DG control routines */
39int cs4245_write_spi(struct oxygen *chip, u8 reg);
40int cs4245_read_spi(struct oxygen *chip, u8 reg);
41int cs4245_shadow_control(struct oxygen *chip, enum cs4245_shadow_operation op);
42void dg_init(struct oxygen *chip);
43void set_cs4245_dac_params(struct oxygen *chip,
44				  struct snd_pcm_hw_params *params);
45void set_cs4245_adc_params(struct oxygen *chip,
46				  struct snd_pcm_hw_params *params);
47unsigned int adjust_dg_dac_routing(struct oxygen *chip,
48					  unsigned int play_routing);
49void dump_cs4245_registers(struct oxygen *chip,
50				struct snd_info_buffer *buffer);
51void dg_suspend(struct oxygen *chip);
52void dg_resume(struct oxygen *chip);
53void dg_cleanup(struct oxygen *chip);
54
55extern const struct oxygen_model model_xonar_dg;
56
57#endif
v4.6
 
 1#ifndef XONAR_DG_H_INCLUDED
 2#define XONAR_DG_H_INCLUDED
 3
 4#include "oxygen.h"
 5
 6#define GPIO_MAGIC		0x0008
 7#define GPIO_HP_DETECT		0x0010
 8#define GPIO_INPUT_ROUTE	0x0060
 9#define GPIO_HP_REAR		0x0080
10#define GPIO_OUTPUT_ENABLE	0x0100
11
12#define CAPTURE_SRC_MIC		0
13#define CAPTURE_SRC_FP_MIC	1
14#define CAPTURE_SRC_LINE	2
15#define CAPTURE_SRC_AUX		3
16
17#define PLAYBACK_DST_HP		0
18#define PLAYBACK_DST_HP_FP	1
19#define PLAYBACK_DST_MULTICH	2
20
21enum cs4245_shadow_operation {
22	CS4245_SAVE_TO_SHADOW,
23	CS4245_LOAD_FROM_SHADOW
24};
25
26struct dg {
27	/* shadow copy of the CS4245 register space */
28	unsigned char cs4245_shadow[17];
29	/* output select: headphone/speakers */
30	unsigned char output_sel;
31	/* volumes for all capture sources */
32	char input_vol[4][2];
33	/* input select: mic/fp mic/line/aux */
34	unsigned char input_sel;
35};
36
37/* Xonar DG control routines */
38int cs4245_write_spi(struct oxygen *chip, u8 reg);
39int cs4245_read_spi(struct oxygen *chip, u8 reg);
40int cs4245_shadow_control(struct oxygen *chip, enum cs4245_shadow_operation op);
41void dg_init(struct oxygen *chip);
42void set_cs4245_dac_params(struct oxygen *chip,
43				  struct snd_pcm_hw_params *params);
44void set_cs4245_adc_params(struct oxygen *chip,
45				  struct snd_pcm_hw_params *params);
46unsigned int adjust_dg_dac_routing(struct oxygen *chip,
47					  unsigned int play_routing);
48void dump_cs4245_registers(struct oxygen *chip,
49				struct snd_info_buffer *buffer);
50void dg_suspend(struct oxygen *chip);
51void dg_resume(struct oxygen *chip);
52void dg_cleanup(struct oxygen *chip);
53
54extern struct oxygen_model model_xonar_dg;
55
56#endif