Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * wm_hubs.h  --  WM899x common code
0004  *
0005  * Copyright 2009 Wolfson Microelectronics plc
0006  *
0007  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
0008  */
0009 
0010 #ifndef _WM_HUBS_H
0011 #define _WM_HUBS_H
0012 
0013 #include <linux/completion.h>
0014 #include <linux/interrupt.h>
0015 #include <linux/list.h>
0016 #include <sound/control.h>
0017 
0018 struct snd_soc_component;
0019 
0020 extern const unsigned int wm_hubs_spkmix_tlv[];
0021 
0022 /* This *must* be the first element of the codec->private_data struct */
0023 struct wm_hubs_data {
0024     int dcs_codes_l;
0025     int dcs_codes_r;
0026     int dcs_readback_mode;
0027     int hp_startup_mode;
0028     int series_startup;
0029     int no_series_update;
0030     bool micd_scthr;
0031 
0032     bool no_cache_dac_hp_direct;
0033     struct list_head dcs_cache;
0034     bool (*check_class_w_digital)(struct snd_soc_component *);
0035 
0036     int micb1_delay;
0037     int micb2_delay;
0038 
0039     bool lineout1_se;
0040     bool lineout1n_ena;
0041     bool lineout1p_ena;
0042 
0043     bool lineout2_se;
0044     bool lineout2n_ena;
0045     bool lineout2p_ena;
0046 
0047     bool dcs_done_irq;
0048     struct completion dcs_done;
0049 
0050     struct snd_soc_component *component;
0051 };
0052 
0053 extern int wm_hubs_add_analogue_controls(struct snd_soc_component *);
0054 extern int wm_hubs_add_analogue_routes(struct snd_soc_component *, int, int);
0055 extern int wm_hubs_handle_analogue_pdata(struct snd_soc_component *,
0056                      int lineout1_diff, int lineout2_diff,
0057                      int lineout1fb, int lineout2fb,
0058                      int jd_scthr, int jd_thr,
0059                      int micbias1_delay, int micbias2_delay,
0060                      int micbias1_lvl, int micbias2_lvl);
0061 
0062 extern irqreturn_t wm_hubs_dcs_done(int irq, void *data);
0063 extern void wm_hubs_vmid_ena(struct snd_soc_component *component);
0064 extern void wm_hubs_set_bias_level(struct snd_soc_component *component,
0065                    enum snd_soc_bias_level level);
0066 extern void wm_hubs_update_class_w(struct snd_soc_component *component);
0067 
0068 extern const struct snd_kcontrol_new wm_hubs_hpl_mux;
0069 extern const struct snd_kcontrol_new wm_hubs_hpr_mux;
0070 
0071 #endif