mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
ASoC: Merge up fixes
Needed for new Intel board file changes.
This commit is contained in:
@@ -48,6 +48,10 @@ properties:
|
||||
- const: mclk_rx
|
||||
- const: hclk
|
||||
|
||||
port:
|
||||
$ref: audio-graph-port.yaml#
|
||||
unevaluatedProperties: false
|
||||
|
||||
resets:
|
||||
maxItems: 1
|
||||
|
||||
|
||||
11
MAINTAINERS
11
MAINTAINERS
@@ -21720,6 +21720,15 @@ S: Supported
|
||||
W: https://github.com/thesofproject/linux/
|
||||
F: sound/soc/sof/
|
||||
|
||||
SOUND - GENERIC SOUND CARD (Simple-Audio-Card, Audio-Graph-Card)
|
||||
M: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
||||
S: Supported
|
||||
L: linux-sound@vger.kernel.org
|
||||
F: sound/soc/generic/
|
||||
F: include/sound/simple_card*
|
||||
F: Documentation/devicetree/bindings/sound/simple-card.yaml
|
||||
F: Documentation/devicetree/bindings/sound/audio-graph*.yaml
|
||||
|
||||
SOUNDWIRE SUBSYSTEM
|
||||
M: Vinod Koul <vkoul@kernel.org>
|
||||
M: Bard Liao <yung-chuan.liao@linux.intel.com>
|
||||
@@ -23313,7 +23322,7 @@ F: Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
|
||||
F: drivers/iio/adc/ti-lmp92064.c
|
||||
|
||||
TI PCM3060 ASoC CODEC DRIVER
|
||||
M: Kirill Marinushkin <kmarinushkin@birdec.com>
|
||||
M: Kirill Marinushkin <k.marinushkin@gmail.com>
|
||||
L: linux-sound@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/sound/pcm3060.txt
|
||||
|
||||
@@ -383,11 +383,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
|
||||
static int intel_prepare(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
|
||||
struct sdw_intel *sdw = cdns_to_intel(cdns);
|
||||
struct sdw_cdns_dai_runtime *dai_runtime;
|
||||
struct snd_pcm_hw_params *hw_params;
|
||||
int ch, dir;
|
||||
int ret = 0;
|
||||
|
||||
dai_runtime = cdns->dai_runtime_array[dai->id];
|
||||
if (!dai_runtime) {
|
||||
@@ -396,12 +397,8 @@ static int intel_prepare(struct snd_pcm_substream *substream,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
hw_params = &rtd->dpcm[substream->stream].hw_params;
|
||||
if (dai_runtime->suspended) {
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_hw_params *hw_params;
|
||||
|
||||
hw_params = &rtd->dpcm[substream->stream].hw_params;
|
||||
|
||||
dai_runtime->suspended = false;
|
||||
|
||||
/*
|
||||
@@ -422,15 +419,11 @@ static int intel_prepare(struct snd_pcm_substream *substream,
|
||||
/* the SHIM will be configured in the callback functions */
|
||||
|
||||
sdw_cdns_config_stream(cdns, ch, dir, dai_runtime->pdi);
|
||||
|
||||
/* Inform DSP about PDI stream number */
|
||||
ret = intel_params_stream(sdw, substream, dai,
|
||||
hw_params,
|
||||
sdw->instance,
|
||||
dai_runtime->pdi->intel_alh_id);
|
||||
}
|
||||
|
||||
return ret;
|
||||
/* Inform DSP about PDI stream number */
|
||||
return intel_params_stream(sdw, substream, dai, hw_params, sdw->instance,
|
||||
dai_runtime->pdi->intel_alh_id);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -721,6 +721,10 @@ static const struct config_entry acpi_config_table[] = {
|
||||
#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || \
|
||||
IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
|
||||
/* BayTrail */
|
||||
{
|
||||
.flags = FLAG_SST_OR_SOF_BYT,
|
||||
.acpi_hid = "LPE0F28",
|
||||
},
|
||||
{
|
||||
.flags = FLAG_SST_OR_SOF_BYT,
|
||||
.acpi_hid = "80860F28",
|
||||
|
||||
@@ -227,6 +227,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21M3"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21M4"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
@@ -325,6 +332,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
@@ -388,6 +402,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
|
||||
@@ -747,8 +747,10 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
|
||||
|
||||
cs42l51->reset_gpio = devm_gpiod_get_optional(dev, "reset",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(cs42l51->reset_gpio))
|
||||
return PTR_ERR(cs42l51->reset_gpio);
|
||||
if (IS_ERR(cs42l51->reset_gpio)) {
|
||||
ret = PTR_ERR(cs42l51->reset_gpio);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cs42l51->reset_gpio) {
|
||||
dev_dbg(dev, "Release reset gpio\n");
|
||||
@@ -780,6 +782,7 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
|
||||
return 0;
|
||||
|
||||
error:
|
||||
gpiod_set_value_cansleep(cs42l51->reset_gpio, 1);
|
||||
regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies),
|
||||
cs42l51->supplies);
|
||||
return ret;
|
||||
|
||||
@@ -202,12 +202,14 @@
|
||||
#define CDC_RX_RXn_RX_PATH_SEC3(rx, n) (0x042c + rx->rxn_reg_stride * n)
|
||||
#define CDC_RX_RX0_RX_PATH_SEC4 (0x0430)
|
||||
#define CDC_RX_RX0_RX_PATH_SEC7 (0x0434)
|
||||
#define CDC_RX_RXn_RX_PATH_SEC7(rx, n) (0x0434 + rx->rxn_reg_stride * n)
|
||||
#define CDC_RX_RXn_RX_PATH_SEC7(rx, n) \
|
||||
(0x0434 + (rx->rxn_reg_stride * n) + ((n > 1) ? rx->rxn_reg_stride2 : 0))
|
||||
#define CDC_RX_DSM_OUT_DELAY_SEL_MASK GENMASK(2, 0)
|
||||
#define CDC_RX_DSM_OUT_DELAY_TWO_SAMPLE 0x2
|
||||
#define CDC_RX_RX0_RX_PATH_MIX_SEC0 (0x0438)
|
||||
#define CDC_RX_RX0_RX_PATH_MIX_SEC1 (0x043C)
|
||||
#define CDC_RX_RXn_RX_PATH_DSM_CTL(rx, n) (0x0440 + rx->rxn_reg_stride * n)
|
||||
#define CDC_RX_RXn_RX_PATH_DSM_CTL(rx, n) \
|
||||
(0x0440 + (rx->rxn_reg_stride * n) + ((n > 1) ? rx->rxn_reg_stride2 : 0))
|
||||
#define CDC_RX_RXn_DSM_CLK_EN_MASK BIT(0)
|
||||
#define CDC_RX_RX0_RX_PATH_DSM_CTL (0x0440)
|
||||
#define CDC_RX_RX0_RX_PATH_DSM_DATA1 (0x0444)
|
||||
@@ -645,6 +647,7 @@ struct rx_macro {
|
||||
int rx_mclk_cnt;
|
||||
enum lpass_codec_version codec_version;
|
||||
int rxn_reg_stride;
|
||||
int rxn_reg_stride2;
|
||||
bool is_ear_mode_on;
|
||||
bool hph_pwr_mode;
|
||||
bool hph_hd2_mode;
|
||||
@@ -1929,9 +1932,6 @@ static int rx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
|
||||
CDC_RX_PATH_PGA_MUTE_MASK, 0x0);
|
||||
}
|
||||
|
||||
if (j == INTERP_AUX)
|
||||
dsm_reg = CDC_RX_RXn_RX_PATH_DSM_CTL(rx, 2);
|
||||
|
||||
int_mux_cfg0 = CDC_RX_INP_MUX_RX_INT0_CFG0 + j * 8;
|
||||
int_mux_cfg1 = int_mux_cfg0 + 4;
|
||||
int_mux_cfg0_val = snd_soc_component_read(component, int_mux_cfg0);
|
||||
@@ -2702,9 +2702,6 @@ static int rx_macro_enable_interp_clk(struct snd_soc_component *component,
|
||||
|
||||
main_reg = CDC_RX_RXn_RX_PATH_CTL(rx, interp_idx);
|
||||
dsm_reg = CDC_RX_RXn_RX_PATH_DSM_CTL(rx, interp_idx);
|
||||
if (interp_idx == INTERP_AUX)
|
||||
dsm_reg = CDC_RX_RXn_RX_PATH_DSM_CTL(rx, 2);
|
||||
|
||||
rx_cfg2_reg = CDC_RX_RXn_RX_PATH_CFG2(rx, interp_idx);
|
||||
|
||||
if (SND_SOC_DAPM_EVENT_ON(event)) {
|
||||
@@ -3821,6 +3818,7 @@ static int rx_macro_probe(struct platform_device *pdev)
|
||||
case LPASS_CODEC_VERSION_2_0:
|
||||
case LPASS_CODEC_VERSION_2_1:
|
||||
rx->rxn_reg_stride = 0x80;
|
||||
rx->rxn_reg_stride2 = 0xc;
|
||||
def_count = ARRAY_SIZE(rx_defaults) + ARRAY_SIZE(rx_pre_2_5_defaults);
|
||||
reg_defaults = kmalloc_array(def_count, sizeof(struct reg_default), GFP_KERNEL);
|
||||
if (!reg_defaults)
|
||||
@@ -3834,6 +3832,7 @@ static int rx_macro_probe(struct platform_device *pdev)
|
||||
case LPASS_CODEC_VERSION_2_7:
|
||||
case LPASS_CODEC_VERSION_2_8:
|
||||
rx->rxn_reg_stride = 0xc0;
|
||||
rx->rxn_reg_stride2 = 0x0;
|
||||
def_count = ARRAY_SIZE(rx_defaults) + ARRAY_SIZE(rx_2_5_defaults);
|
||||
reg_defaults = kmalloc_array(def_count, sizeof(struct reg_default), GFP_KERNEL);
|
||||
if (!reg_defaults)
|
||||
|
||||
@@ -54,10 +54,17 @@ static int max9768_set_gpio(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
|
||||
struct max9768 *max9768 = snd_soc_component_get_drvdata(c);
|
||||
bool val = !ucontrol->value.integer.value[0];
|
||||
int ret;
|
||||
|
||||
gpiod_set_value_cansleep(max9768->mute, !ucontrol->value.integer.value[0]);
|
||||
if (val != gpiod_get_value_cansleep(max9768->mute))
|
||||
ret = 1;
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
return 0;
|
||||
gpiod_set_value_cansleep(max9768->mute, val);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const DECLARE_TLV_DB_RANGE(volume_tlv,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// PCM3060 I2C driver
|
||||
//
|
||||
// Copyright (C) 2018 Kirill Marinushkin <kmarinushkin@birdec.com>
|
||||
// Copyright (C) 2018 Kirill Marinushkin <k.marinushkin@gmail.com>
|
||||
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/module.h>
|
||||
@@ -55,5 +55,5 @@ static struct i2c_driver pcm3060_i2c_driver = {
|
||||
module_i2c_driver(pcm3060_i2c_driver);
|
||||
|
||||
MODULE_DESCRIPTION("PCM3060 I2C driver");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <kmarinushkin@birdec.com>");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <k.marinushkin@gmail.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// PCM3060 SPI driver
|
||||
//
|
||||
// Copyright (C) 2018 Kirill Marinushkin <kmarinushkin@birdec.com>
|
||||
// Copyright (C) 2018 Kirill Marinushkin <k.marinushkin@gmail.com>
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/spi/spi.h>
|
||||
@@ -55,5 +55,5 @@ static struct spi_driver pcm3060_spi_driver = {
|
||||
module_spi_driver(pcm3060_spi_driver);
|
||||
|
||||
MODULE_DESCRIPTION("PCM3060 SPI driver");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <kmarinushkin@birdec.com>");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <k.marinushkin@gmail.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// PCM3060 codec driver
|
||||
//
|
||||
// Copyright (C) 2018 Kirill Marinushkin <kmarinushkin@birdec.com>
|
||||
// Copyright (C) 2018 Kirill Marinushkin <k.marinushkin@gmail.com>
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <sound/pcm_params.h>
|
||||
@@ -343,5 +343,5 @@ int pcm3060_probe(struct device *dev)
|
||||
EXPORT_SYMBOL(pcm3060_probe);
|
||||
|
||||
MODULE_DESCRIPTION("PCM3060 codec driver");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <kmarinushkin@birdec.com>");
|
||||
MODULE_AUTHOR("Kirill Marinushkin <k.marinushkin@gmail.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* PCM3060 codec driver
|
||||
*
|
||||
* Copyright (C) 2018 Kirill Marinushkin <kmarinushkin@birdec.com>
|
||||
* Copyright (C) 2018 Kirill Marinushkin <k.marinushkin@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef _SND_SOC_PCM3060_H
|
||||
|
||||
@@ -2419,10 +2419,20 @@ static irqreturn_t rt5640_jd_gpio_irq(int irq, void *data)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void rt5640_cancel_work(void *data)
|
||||
static void rt5640_disable_irq_and_cancel_work(void *data)
|
||||
{
|
||||
struct rt5640_priv *rt5640 = data;
|
||||
|
||||
if (rt5640->jd_gpio_irq_requested) {
|
||||
free_irq(rt5640->jd_gpio_irq, rt5640);
|
||||
rt5640->jd_gpio_irq_requested = false;
|
||||
}
|
||||
|
||||
if (rt5640->irq_requested) {
|
||||
free_irq(rt5640->irq, rt5640);
|
||||
rt5640->irq_requested = false;
|
||||
}
|
||||
|
||||
cancel_delayed_work_sync(&rt5640->jack_work);
|
||||
cancel_delayed_work_sync(&rt5640->bp_work);
|
||||
}
|
||||
@@ -2463,13 +2473,7 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component)
|
||||
if (!rt5640->jack)
|
||||
return;
|
||||
|
||||
if (rt5640->jd_gpio_irq_requested)
|
||||
free_irq(rt5640->jd_gpio_irq, rt5640);
|
||||
|
||||
if (rt5640->irq_requested)
|
||||
free_irq(rt5640->irq, rt5640);
|
||||
|
||||
rt5640_cancel_work(rt5640);
|
||||
rt5640_disable_irq_and_cancel_work(rt5640);
|
||||
|
||||
if (rt5640->jack->status & SND_JACK_MICROPHONE) {
|
||||
rt5640_disable_micbias1_ovcd_irq(component);
|
||||
@@ -2477,8 +2481,6 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component)
|
||||
snd_soc_jack_report(rt5640->jack, 0, SND_JACK_BTN_0);
|
||||
}
|
||||
|
||||
rt5640->jd_gpio_irq_requested = false;
|
||||
rt5640->irq_requested = false;
|
||||
rt5640->jd_gpio = NULL;
|
||||
rt5640->jack = NULL;
|
||||
}
|
||||
@@ -2798,7 +2800,8 @@ static int rt5640_suspend(struct snd_soc_component *component)
|
||||
if (rt5640->jack) {
|
||||
/* disable jack interrupts during system suspend */
|
||||
disable_irq(rt5640->irq);
|
||||
rt5640_cancel_work(rt5640);
|
||||
cancel_delayed_work_sync(&rt5640->jack_work);
|
||||
cancel_delayed_work_sync(&rt5640->bp_work);
|
||||
}
|
||||
|
||||
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
|
||||
@@ -3032,7 +3035,7 @@ static int rt5640_i2c_probe(struct i2c_client *i2c)
|
||||
INIT_DELAYED_WORK(&rt5640->jack_work, rt5640_jack_work);
|
||||
|
||||
/* Make sure work is stopped on probe-error / remove */
|
||||
ret = devm_add_action_or_reset(&i2c->dev, rt5640_cancel_work, rt5640);
|
||||
ret = devm_add_action_or_reset(&i2c->dev, rt5640_disable_irq_and_cancel_work, rt5640);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ static int rt722_sdca_read_prop(struct sdw_slave *slave)
|
||||
}
|
||||
|
||||
/* set the timeout values */
|
||||
prop->clk_stop_timeout = 200;
|
||||
prop->clk_stop_timeout = 900;
|
||||
|
||||
/* wake-up event */
|
||||
prop->wake_capable = 1;
|
||||
|
||||
@@ -1992,6 +1992,7 @@ static int tasdevice_dspfw_ready(const struct firmware *fmw,
|
||||
break;
|
||||
case 0x202:
|
||||
case 0x400:
|
||||
case 0x401:
|
||||
tas_priv->fw_parse_variable_header =
|
||||
fw_parse_variable_header_git;
|
||||
tas_priv->fw_parse_program_data =
|
||||
|
||||
@@ -714,12 +714,17 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w,
|
||||
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
|
||||
struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component);
|
||||
int hph_mode = wcd937x->hph_mode;
|
||||
u8 val;
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
val = WCD937X_DIGITAL_PDM_WD_CTL2_EN |
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL |
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF;
|
||||
snd_soc_component_update_bits(component,
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2,
|
||||
BIT(0), BIT(0));
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2_MASK,
|
||||
val);
|
||||
break;
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
usleep_range(1000, 1010);
|
||||
@@ -740,7 +745,8 @@ static int wcd937x_codec_enable_aux_pa(struct snd_soc_dapm_widget *w,
|
||||
hph_mode);
|
||||
snd_soc_component_update_bits(component,
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2,
|
||||
BIT(0), 0x00);
|
||||
WCD937X_DIGITAL_PDM_WD_CTL2_MASK,
|
||||
0x00);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2048,6 +2054,8 @@ static const struct snd_kcontrol_new wcd937x_snd_controls[] = {
|
||||
wcd937x_get_swr_port, wcd937x_set_swr_port),
|
||||
SOC_SINGLE_EXT("HPHR Switch", WCD937X_HPH_R, 0, 1, 0,
|
||||
wcd937x_get_swr_port, wcd937x_set_swr_port),
|
||||
SOC_SINGLE_EXT("LO Switch", WCD937X_LO, 0, 1, 0,
|
||||
wcd937x_get_swr_port, wcd937x_set_swr_port),
|
||||
|
||||
SOC_SINGLE_EXT("ADC1 Switch", WCD937X_ADC1, 1, 1, 0,
|
||||
wcd937x_get_swr_port, wcd937x_set_swr_port),
|
||||
|
||||
@@ -391,6 +391,10 @@
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL0 0x3465
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL1 0x3466
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL2 0x3467
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL2_HOLD_OFF BIT(2)
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL2_TIMEOUT_SEL BIT(1)
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL2_EN BIT(0)
|
||||
#define WCD937X_DIGITAL_PDM_WD_CTL2_MASK GENMASK(2, 0)
|
||||
#define WCD937X_DIGITAL_INTR_MODE 0x346A
|
||||
#define WCD937X_DIGITAL_INTR_MASK_0 0x346B
|
||||
#define WCD937X_DIGITAL_INTR_MASK_1 0x346C
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
|
||||
#define MICFIL_OSR_DEFAULT 16
|
||||
|
||||
#define MICFIL_NUM_RATES 7
|
||||
#define MICFIL_CLK_SRC_NUM 3
|
||||
/* clock source ids */
|
||||
#define MICFIL_AUDIO_PLL1 0
|
||||
#define MICFIL_AUDIO_PLL2 1
|
||||
#define MICFIL_CLK_EXT3 2
|
||||
|
||||
enum quality {
|
||||
QUALITY_HIGH,
|
||||
QUALITY_MEDIUM,
|
||||
@@ -45,9 +52,12 @@ struct fsl_micfil {
|
||||
struct clk *mclk;
|
||||
struct clk *pll8k_clk;
|
||||
struct clk *pll11k_clk;
|
||||
struct clk *clk_src[MICFIL_CLK_SRC_NUM];
|
||||
struct snd_dmaengine_dai_dma_data dma_params_rx;
|
||||
struct sdma_peripheral_config sdmacfg;
|
||||
struct snd_soc_card *card;
|
||||
struct snd_pcm_hw_constraint_list constraint_rates;
|
||||
unsigned int constraint_rates_list[MICFIL_NUM_RATES];
|
||||
unsigned int dataline;
|
||||
char name[32];
|
||||
int irq[MICFIL_IRQ_LINES];
|
||||
@@ -68,6 +78,7 @@ struct fsl_micfil_soc_data {
|
||||
bool imx;
|
||||
bool use_edma;
|
||||
bool use_verid;
|
||||
bool volume_sx;
|
||||
u64 formats;
|
||||
};
|
||||
|
||||
@@ -77,6 +88,7 @@ static struct fsl_micfil_soc_data fsl_micfil_imx8mm = {
|
||||
.fifo_depth = 8,
|
||||
.dataline = 0xf,
|
||||
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
||||
.volume_sx = true,
|
||||
};
|
||||
|
||||
static struct fsl_micfil_soc_data fsl_micfil_imx8mp = {
|
||||
@@ -85,6 +97,7 @@ static struct fsl_micfil_soc_data fsl_micfil_imx8mp = {
|
||||
.fifo_depth = 32,
|
||||
.dataline = 0xf,
|
||||
.formats = SNDRV_PCM_FMTBIT_S32_LE,
|
||||
.volume_sx = false,
|
||||
};
|
||||
|
||||
static struct fsl_micfil_soc_data fsl_micfil_imx93 = {
|
||||
@@ -95,6 +108,7 @@ static struct fsl_micfil_soc_data fsl_micfil_imx93 = {
|
||||
.formats = SNDRV_PCM_FMTBIT_S32_LE,
|
||||
.use_edma = true,
|
||||
.use_verid = true,
|
||||
.volume_sx = false,
|
||||
};
|
||||
|
||||
static const struct of_device_id fsl_micfil_dt_ids[] = {
|
||||
@@ -318,7 +332,26 @@ static int hwvad_detected(struct snd_kcontrol *kcontrol,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = {
|
||||
static const struct snd_kcontrol_new fsl_micfil_volume_controls[] = {
|
||||
SOC_SINGLE_TLV("CH0 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(0), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH1 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(1), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH2 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(2), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH3 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(3), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH4 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(4), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH5 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(5), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH6 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(6), 0xF, 0, gain_tlv),
|
||||
SOC_SINGLE_TLV("CH7 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(7), 0xF, 0, gain_tlv),
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new fsl_micfil_volume_sx_controls[] = {
|
||||
SOC_SINGLE_SX_TLV("CH0 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(0), 0x8, 0xF, gain_tlv),
|
||||
SOC_SINGLE_SX_TLV("CH1 Volume", REG_MICFIL_OUT_CTRL,
|
||||
@@ -335,6 +368,9 @@ static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = {
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(6), 0x8, 0xF, gain_tlv),
|
||||
SOC_SINGLE_SX_TLV("CH7 Volume", REG_MICFIL_OUT_CTRL,
|
||||
MICFIL_OUTGAIN_CHX_SHIFT(7), 0x8, 0xF, gain_tlv),
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = {
|
||||
SOC_ENUM_EXT("MICFIL Quality Select",
|
||||
fsl_micfil_quality_enum,
|
||||
micfil_quality_get, micfil_quality_set),
|
||||
@@ -450,12 +486,34 @@ static int fsl_micfil_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct fsl_micfil *micfil = snd_soc_dai_get_drvdata(dai);
|
||||
unsigned int rates[MICFIL_NUM_RATES] = {8000, 11025, 16000, 22050, 32000, 44100, 48000};
|
||||
int i, j, k = 0;
|
||||
u64 clk_rate;
|
||||
|
||||
if (!micfil) {
|
||||
dev_err(dai->dev, "micfil dai priv_data not set\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
micfil->constraint_rates.list = micfil->constraint_rates_list;
|
||||
micfil->constraint_rates.count = 0;
|
||||
|
||||
for (j = 0; j < MICFIL_NUM_RATES; j++) {
|
||||
for (i = 0; i < MICFIL_CLK_SRC_NUM; i++) {
|
||||
clk_rate = clk_get_rate(micfil->clk_src[i]);
|
||||
if (clk_rate != 0 && do_div(clk_rate, rates[j]) == 0) {
|
||||
micfil->constraint_rates_list[k++] = rates[j];
|
||||
micfil->constraint_rates.count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (micfil->constraint_rates.count > 0)
|
||||
snd_pcm_hw_constraint_list(substream->runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_RATE,
|
||||
&micfil->constraint_rates);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -814,6 +872,20 @@ static int fsl_micfil_dai_probe(struct snd_soc_dai *cpu_dai)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsl_micfil_component_probe(struct snd_soc_component *component)
|
||||
{
|
||||
struct fsl_micfil *micfil = snd_soc_component_get_drvdata(component);
|
||||
|
||||
if (micfil->soc->volume_sx)
|
||||
snd_soc_add_component_controls(component, fsl_micfil_volume_sx_controls,
|
||||
ARRAY_SIZE(fsl_micfil_volume_sx_controls));
|
||||
else
|
||||
snd_soc_add_component_controls(component, fsl_micfil_volume_controls,
|
||||
ARRAY_SIZE(fsl_micfil_volume_controls));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_soc_dai_ops fsl_micfil_dai_ops = {
|
||||
.probe = fsl_micfil_dai_probe,
|
||||
.startup = fsl_micfil_startup,
|
||||
@@ -835,6 +907,7 @@ static struct snd_soc_dai_driver fsl_micfil_dai = {
|
||||
|
||||
static const struct snd_soc_component_driver fsl_micfil_component = {
|
||||
.name = "fsl-micfil-dai",
|
||||
.probe = fsl_micfil_component_probe,
|
||||
.controls = fsl_micfil_snd_controls,
|
||||
.num_controls = ARRAY_SIZE(fsl_micfil_snd_controls),
|
||||
.legacy_dai_naming = 1,
|
||||
@@ -1160,6 +1233,12 @@ static int fsl_micfil_probe(struct platform_device *pdev)
|
||||
fsl_asoc_get_pll_clocks(&pdev->dev, &micfil->pll8k_clk,
|
||||
&micfil->pll11k_clk);
|
||||
|
||||
micfil->clk_src[MICFIL_AUDIO_PLL1] = micfil->pll8k_clk;
|
||||
micfil->clk_src[MICFIL_AUDIO_PLL2] = micfil->pll11k_clk;
|
||||
micfil->clk_src[MICFIL_CLK_EXT3] = devm_clk_get(&pdev->dev, "clkext3");
|
||||
if (IS_ERR(micfil->clk_src[MICFIL_CLK_EXT3]))
|
||||
micfil->clk_src[MICFIL_CLK_EXT3] = NULL;
|
||||
|
||||
/* init regmap */
|
||||
regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
|
||||
if (IS_ERR(regs))
|
||||
|
||||
@@ -270,16 +270,19 @@ static enum graph_type __graph_get_type(struct device_node *lnk)
|
||||
|
||||
if (of_node_name_eq(np, GRAPH_NODENAME_MULTI)) {
|
||||
ret = GRAPH_MULTI;
|
||||
fw_devlink_purge_absent_suppliers(&np->fwnode);
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
if (of_node_name_eq(np, GRAPH_NODENAME_DPCM)) {
|
||||
ret = GRAPH_DPCM;
|
||||
fw_devlink_purge_absent_suppliers(&np->fwnode);
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
if (of_node_name_eq(np, GRAPH_NODENAME_C2C)) {
|
||||
ret = GRAPH_C2C;
|
||||
fw_devlink_purge_absent_suppliers(&np->fwnode);
|
||||
goto out_put;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,28 @@ static const struct sst_res_info bytcr_res_info = {
|
||||
.acpi_ipc_irq_index = 0
|
||||
};
|
||||
|
||||
/* For "LPE0F28" ACPI device found on some Android factory OS models */
|
||||
static const struct sst_res_info lpe8086_res_info = {
|
||||
.shim_offset = 0x140000,
|
||||
.shim_size = 0x000100,
|
||||
.shim_phy_addr = SST_BYT_SHIM_PHY_ADDR,
|
||||
.ssp0_offset = 0xa0000,
|
||||
.ssp0_size = 0x1000,
|
||||
.dma0_offset = 0x98000,
|
||||
.dma0_size = 0x4000,
|
||||
.dma1_offset = 0x9c000,
|
||||
.dma1_size = 0x4000,
|
||||
.iram_offset = 0x0c0000,
|
||||
.iram_size = 0x14000,
|
||||
.dram_offset = 0x100000,
|
||||
.dram_size = 0x28000,
|
||||
.mbox_offset = 0x144000,
|
||||
.mbox_size = 0x1000,
|
||||
.acpi_lpe_res_index = 1,
|
||||
.acpi_ddr_index = 0,
|
||||
.acpi_ipc_irq_index = 0
|
||||
};
|
||||
|
||||
static struct sst_platform_info byt_rvp_platform_data = {
|
||||
.probe_data = &byt_fwparse_info,
|
||||
.ipc_info = &byt_ipc_info,
|
||||
@@ -268,10 +290,38 @@ static int sst_acpi_probe(struct platform_device *pdev)
|
||||
mach->pdata = &chv_platform_data;
|
||||
pdata = mach->pdata;
|
||||
|
||||
ret = kstrtouint(id->id, 16, &dev_id);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Unique device id conversion error: %d\n", ret);
|
||||
return ret;
|
||||
if (!strcmp(id->id, "LPE0F28")) {
|
||||
struct resource *rsrc;
|
||||
|
||||
/* Use regular BYT SST PCI VID:PID */
|
||||
dev_id = 0x80860F28;
|
||||
byt_rvp_platform_data.res_info = &lpe8086_res_info;
|
||||
|
||||
/*
|
||||
* The "LPE0F28" ACPI device has separate IO-mem resources for:
|
||||
* DDR, SHIM, MBOX, IRAM, DRAM, CFG
|
||||
* None of which covers the entire LPE base address range.
|
||||
* lpe8086_res_info.acpi_lpe_res_index points to the SHIM.
|
||||
* Patch this to cover the entire base address range as expected
|
||||
* by sst_platform_get_resources().
|
||||
*/
|
||||
rsrc = platform_get_resource(pdev, IORESOURCE_MEM,
|
||||
pdata->res_info->acpi_lpe_res_index);
|
||||
if (!rsrc) {
|
||||
dev_err(dev, "Invalid SHIM base\n");
|
||||
return -EIO;
|
||||
}
|
||||
rsrc->start -= pdata->res_info->shim_offset;
|
||||
rsrc->end = rsrc->start + 0x200000 - 1;
|
||||
} else {
|
||||
ret = kstrtouint(id->id, 16, &dev_id);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Unique device id conversion error: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (soc_intel_is_byt_cr(pdev))
|
||||
byt_rvp_platform_data.res_info = &bytcr_res_info;
|
||||
}
|
||||
|
||||
dev_dbg(dev, "ACPI device id: %x\n", dev_id);
|
||||
@@ -280,11 +330,6 @@ static int sst_acpi_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (soc_intel_is_byt_cr(pdev)) {
|
||||
/* override resource info */
|
||||
byt_rvp_platform_data.res_info = &bytcr_res_info;
|
||||
}
|
||||
|
||||
/* update machine parameters */
|
||||
mach->mach_params.acpi_ipc_irq_index =
|
||||
pdata->res_info->acpi_ipc_irq_index;
|
||||
@@ -344,6 +389,7 @@ static void sst_acpi_remove(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
static const struct acpi_device_id sst_acpi_ids[] = {
|
||||
{ "LPE0F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines},
|
||||
{ "80860F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines},
|
||||
{ "808622A8", (unsigned long)&snd_soc_acpi_intel_cherrytrail_machines},
|
||||
{ },
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user