123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- /*
- * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
- #ifndef WCD9335_H
- #define WCD9335_H
- #include <sound/soc.h>
- /* z value defined in milliohm */
- /* z floating defined in ohms */
- /* Number of input and output Slimbus port */
- enum {
- TASHA_RX0 = 0,
- TASHA_RX1,
- TASHA_RX2,
- TASHA_RX3,
- TASHA_RX4,
- TASHA_RX5,
- TASHA_RX6,
- TASHA_RX7,
- TASHA_RX8,
- TASHA_RX9,
- TASHA_RX10,
- TASHA_RX11,
- TASHA_RX12,
- TASHA_RX_MAX,
- };
- enum {
- TASHA_TX0 = 0,
- TASHA_TX1,
- TASHA_TX2,
- TASHA_TX3,
- TASHA_TX4,
- TASHA_TX5,
- TASHA_TX6,
- TASHA_TX7,
- TASHA_TX8,
- TASHA_TX9,
- TASHA_TX10,
- TASHA_TX11,
- TASHA_TX12,
- TASHA_TX13,
- TASHA_TX14,
- TASHA_TX15,
- TASHA_TX_MAX,
- };
- enum wcd9335_codec_event {
- WCD9335_CODEC_EVENT_CODEC_UP = 0,
- };
- enum tasha_on_demand_supply {
- ON_DEMAND_MICBIAS = 0,
- ON_DEMAND_SUPPLIES_MAX,
- };
- /* structure used to put the defined
- * ondemand supply for codec
- * and count being used.
- */
- struct on_demand_supply {
- struct regulator *supply;
- int ondemand_supply_count;
- };
- /* Dai data structure holds the
- * dai specific info like rate,
- * channel number etc.
- */
- struct tasha_codec_dai_data {
- u32 rate;
- u32 *ch_num;
- u32 ch_act;
- u32 ch_tot;
- };
- /* Structure used to update codec
- * register defaults after reset
- */
- struct tasha_reg_mask_val {
- u16 reg;
- u8 mask;
- u8 val;
- };
- /* Selects compander and smart boost settings
- * for a given speaker mode
- */
- enum {
- SPKR_MODE_DEFAULT,
- SPKR_MODE_1, /* COMP Gain = 12dB, Smartboost Max = 5.5V */
- };
- /*
- * Rx path gain offsets
- */
- enum {
- RX_GAIN_OFFSET_M1P5_DB,
- RX_GAIN_OFFSET_0_DB,
- };
- extern void *tasha_get_afe_config(struct snd_soc_codec *codec,
- enum afe_config_type config_type);
- extern int tasha_cdc_mclk_enable(struct snd_soc_codec *codec, int enable,
- bool dapm);
- extern int tasha_cdc_mclk_tx_enable(struct snd_soc_codec *codec, int enable,
- bool dapm);
- extern int tasha_enable_efuse_sensing(struct snd_soc_codec *codec);
- extern int tasha_mbhc_hs_detect(struct snd_soc_codec *codec,
- struct wcd_mbhc_config *mbhc_cfg);
- extern void tasha_mbhc_hs_detect_exit(struct snd_soc_codec *codec);
- extern void tasha_mbhc_zdet_gpio_ctrl(
- int (*zdet_gpio_cb)(struct snd_soc_codec *codec, bool high),
- struct snd_soc_codec *codec);
- extern int tasha_codec_info_create_codec_entry(
- struct snd_info_entry *codec_root,
- struct snd_soc_codec *codec);
- extern void tasha_event_register(
- int (*machine_event_cb)(struct snd_soc_codec *codec,
- enum wcd9335_codec_event),
- struct snd_soc_codec *codec);
- extern int tasha_codec_enable_standalone_micbias(struct snd_soc_codec *codec,
- int micb_num,
- bool enable);
- extern int tasha_set_spkr_mode(struct snd_soc_codec *codec, int mode);
- extern int tasha_set_spkr_gain_offset(struct snd_soc_codec *codec, int offset);
- extern enum codec_variant tasha_codec_ver(void);
|