asoc: machine driver and bring up changes for holi.
add machine driver for holi. compile wsa881x analog driver for holi. compile wcd937x and wcd938x drivers for holi. Change-Id: Icba23cc4b1dd40f7dec6f16bb67a6fae26317f80 Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
This commit is contained in:
@@ -26,8 +26,6 @@
|
||||
#include "wcd937x.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define DRV_NAME "wcd937x_codec"
|
||||
|
||||
#define WCD9370_VARIANT 0
|
||||
#define WCD9375_VARIANT 5
|
||||
#define WCD937X_VARIANT_ENTRY_SIZE 32
|
||||
@@ -40,6 +38,18 @@
|
||||
|
||||
#define NUM_ATTEMPTS 5
|
||||
|
||||
#define WCD937X_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
|
||||
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
|
||||
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000 |\
|
||||
SNDRV_PCM_RATE_384000)
|
||||
/* Fractional Rates */
|
||||
#define WCD937X_FRAC_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_88200 |\
|
||||
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_352800)
|
||||
|
||||
#define WCD937X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
enum {
|
||||
CODEC_TX = 0,
|
||||
CODEC_RX,
|
||||
@@ -91,12 +101,36 @@ static struct regmap_irq_chip wcd937x_regmap_irq_chip = {
|
||||
.mask_base = WCD937X_DIGITAL_INTR_MASK_0,
|
||||
.ack_base = WCD937X_DIGITAL_INTR_CLEAR_0,
|
||||
.use_ack = 1,
|
||||
.clear_ack = 1,
|
||||
.type_base = WCD937X_DIGITAL_INTR_LEVEL_0,
|
||||
.runtime_pm = false,
|
||||
.handle_post_irq = wcd937x_handle_post_irq,
|
||||
.irq_drv_data = NULL,
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_driver wcd937x_dai[] = {
|
||||
{
|
||||
.name = "wcd937x_cdc",
|
||||
.playback = {
|
||||
.stream_name = "WCD937X_AIF Playback",
|
||||
.rates = WCD937X_RATES | WCD937X_FRAC_RATES,
|
||||
.formats = WCD937X_FORMATS,
|
||||
.rate_max = 384000,
|
||||
.rate_min = 8000,
|
||||
.channels_min = 1,
|
||||
.channels_max = 4,
|
||||
},
|
||||
.capture = {
|
||||
.stream_name = "WCD937X_AIF Capture",
|
||||
.rates = WCD937X_RATES,
|
||||
.formats = WCD937X_FORMATS,
|
||||
.rate_max = 192000,
|
||||
.rate_min = 8000,
|
||||
.channels_min = 1,
|
||||
.channels_max = 4,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static int wcd937x_handle_post_irq(void *data)
|
||||
{
|
||||
struct wcd937x_priv *wcd937x = data;
|
||||
@@ -278,7 +312,7 @@ static int wcd937x_tx_connect_port(struct snd_soc_component *component,
|
||||
u8 ch_mask;
|
||||
u32 ch_rate;
|
||||
u8 ch_type = 0;
|
||||
int slave_port_idx;
|
||||
int slave_ch_idx;
|
||||
u8 num_port = 1;
|
||||
int ret = 0;
|
||||
|
||||
@@ -2224,15 +2258,15 @@ static const struct snd_soc_dapm_widget wcd937x_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
/* micbias widgets*/
|
||||
SND_SOC_DAPM_MICBIAS_E("MIC BIAS1", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("MIC BIAS1", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MICBIAS_E("MIC BIAS2", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("MIC BIAS2", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MICBIAS_E("MIC BIAS3", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("MIC BIAS3", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
@@ -2316,15 +2350,15 @@ static const struct snd_soc_dapm_widget wcd937x_dapm_widgets[] = {
|
||||
SND_SOC_DAPM_OUTPUT("HPHR"),
|
||||
|
||||
/* micbias pull up widgets*/
|
||||
SND_SOC_DAPM_MICBIAS_E("VA MIC BIAS1", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("VA MIC BIAS1", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias_pullup,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MICBIAS_E("VA MIC BIAS2", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("VA MIC BIAS2", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias_pullup,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
SND_SOC_DAPM_MICBIAS_E("VA MIC BIAS3", SND_SOC_NOPM, 0, 0,
|
||||
SND_SOC_DAPM_SUPPLY("VA MIC BIAS3", SND_SOC_NOPM, 0, 0,
|
||||
wcd937x_codec_enable_micbias_pullup,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
@@ -2576,19 +2610,25 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
return 0;
|
||||
}
|
||||
card = component->card;
|
||||
priv->entry = snd_info_create_subdir(codec_root->module,
|
||||
priv->entry = snd_info_create_module_entry(codec_root->module,
|
||||
"wcd937x", codec_root);
|
||||
if (!priv->entry) {
|
||||
dev_dbg(component->dev, "%s: failed to create wcd937x entry\n",
|
||||
__func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
priv->entry->mode = S_IFDIR | 0555;
|
||||
if (snd_info_register(priv->entry) < 0) {
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
}
|
||||
version_entry = snd_info_create_card_entry(card->snd_card,
|
||||
"version",
|
||||
priv->entry);
|
||||
if (!version_entry) {
|
||||
dev_dbg(component->dev, "%s: failed to create wcd937x version entry\n",
|
||||
__func__);
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -2599,6 +2639,7 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
|
||||
if (snd_info_register(version_entry) < 0) {
|
||||
snd_info_free_entry(version_entry);
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
}
|
||||
priv->version_entry = version_entry;
|
||||
@@ -2610,6 +2651,8 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
dev_dbg(component->dev,
|
||||
"%s: failed to create wcd937x variant entry\n",
|
||||
__func__);
|
||||
snd_info_free_entry(version_entry);
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -2620,6 +2663,8 @@ int wcd937x_info_create_codec_entry(struct snd_info_entry *codec_root,
|
||||
|
||||
if (snd_info_register(variant_entry) < 0) {
|
||||
snd_info_free_entry(variant_entry);
|
||||
snd_info_free_entry(version_entry);
|
||||
snd_info_free_entry(priv->entry);
|
||||
return -ENOMEM;
|
||||
}
|
||||
priv->variant_entry = variant_entry;
|
||||
@@ -2781,7 +2826,7 @@ static void wcd937x_soc_codec_remove(struct snd_soc_component *component)
|
||||
}
|
||||
|
||||
static const struct snd_soc_component_driver soc_codec_dev_wcd937x = {
|
||||
.name = DRV_NAME,
|
||||
.name = WCD937X_DRV_NAME,
|
||||
.probe = wcd937x_soc_codec_probe,
|
||||
.remove = wcd937x_soc_codec_remove,
|
||||
.controls = wcd937x_snd_controls,
|
||||
@@ -3185,7 +3230,7 @@ static int wcd937x_bind(struct device *dev)
|
||||
wcd_disable_irq(&wcd937x->irq_info, WCD937X_IRQ_AUX_PDM_WD_INT);
|
||||
|
||||
ret = snd_soc_register_component(dev, &soc_codec_dev_wcd937x,
|
||||
NULL, 0);
|
||||
wcd937x_dai, ARRAY_SIZE(wcd937x_dai));
|
||||
if (ret) {
|
||||
dev_err(dev, "%s: Codec registration failed\n",
|
||||
__func__);
|
||||
|
Reference in New Issue
Block a user