Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef XONAR_DG_H_INCLUDED
0003 #define XONAR_DG_H_INCLUDED
0004 
0005 #include "oxygen.h"
0006 
0007 #define GPIO_MAGIC      0x0008
0008 #define GPIO_HP_DETECT      0x0010
0009 #define GPIO_INPUT_ROUTE    0x0060
0010 #define GPIO_HP_REAR        0x0080
0011 #define GPIO_OUTPUT_ENABLE  0x0100
0012 
0013 #define CAPTURE_SRC_MIC     0
0014 #define CAPTURE_SRC_FP_MIC  1
0015 #define CAPTURE_SRC_LINE    2
0016 #define CAPTURE_SRC_AUX     3
0017 
0018 #define PLAYBACK_DST_HP     0
0019 #define PLAYBACK_DST_HP_FP  1
0020 #define PLAYBACK_DST_MULTICH    2
0021 
0022 enum cs4245_shadow_operation {
0023     CS4245_SAVE_TO_SHADOW,
0024     CS4245_LOAD_FROM_SHADOW
0025 };
0026 
0027 struct dg {
0028     /* shadow copy of the CS4245 register space */
0029     unsigned char cs4245_shadow[17];
0030     /* output select: headphone/speakers */
0031     unsigned char output_sel;
0032     /* volumes for all capture sources */
0033     char input_vol[4][2];
0034     /* input select: mic/fp mic/line/aux */
0035     unsigned char input_sel;
0036 };
0037 
0038 /* Xonar DG control routines */
0039 int cs4245_write_spi(struct oxygen *chip, u8 reg);
0040 int cs4245_read_spi(struct oxygen *chip, u8 reg);
0041 int cs4245_shadow_control(struct oxygen *chip, enum cs4245_shadow_operation op);
0042 void dg_init(struct oxygen *chip);
0043 void set_cs4245_dac_params(struct oxygen *chip,
0044                   struct snd_pcm_hw_params *params);
0045 void set_cs4245_adc_params(struct oxygen *chip,
0046                   struct snd_pcm_hw_params *params);
0047 unsigned int adjust_dg_dac_routing(struct oxygen *chip,
0048                       unsigned int play_routing);
0049 void dump_cs4245_registers(struct oxygen *chip,
0050                 struct snd_info_buffer *buffer);
0051 void dg_suspend(struct oxygen *chip);
0052 void dg_resume(struct oxygen *chip);
0053 void dg_cleanup(struct oxygen *chip);
0054 
0055 extern const struct oxygen_model model_xonar_dg;
0056 
0057 #endif