mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
ASoC: Merge fixes
So we can apply AMD patches that rely on them.
This commit is contained in:
commit
1a4f796501
@ -277,6 +277,11 @@ static inline int cs35l56_force_sync_asp1_registers_from_cache(struct cs35l56_ba
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool cs35l56_is_otp_register(unsigned int reg)
|
||||
{
|
||||
return (reg >> 16) == 3;
|
||||
}
|
||||
|
||||
extern struct regmap_config cs35l56_regmap_i2c;
|
||||
extern struct regmap_config cs35l56_regmap_spi;
|
||||
extern struct regmap_config cs35l56_regmap_sdw;
|
||||
|
@ -462,6 +462,11 @@ int snd_soc_component_force_enable_pin_unlocked(
|
||||
const char *pin);
|
||||
|
||||
/* component controls */
|
||||
struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
|
||||
const char * const ctl);
|
||||
struct snd_kcontrol *
|
||||
snd_soc_component_get_kcontrol_locked(struct snd_soc_component *component,
|
||||
const char * const ctl);
|
||||
int snd_soc_component_notify_control(struct snd_soc_component *component,
|
||||
const char * const ctl);
|
||||
|
||||
|
@ -423,6 +423,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "8A3E"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "8B27"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
|
@ -108,7 +108,7 @@ static efi_status_t cs_amp_get_efi_variable(efi_char16_t *name,
|
||||
|
||||
KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid, size, buf);
|
||||
|
||||
if (IS_ENABLED(CONFIG_EFI))
|
||||
if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
|
||||
return efi.get_variable(name, guid, &attr, size, buf);
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
|
@ -176,17 +176,10 @@ static int cs35l45_activate_ctl(struct snd_soc_component *component,
|
||||
struct snd_kcontrol *kcontrol;
|
||||
struct snd_kcontrol_volatile *vd;
|
||||
unsigned int index_offset;
|
||||
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||
|
||||
if (component->name_prefix)
|
||||
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s %s",
|
||||
component->name_prefix, ctl_name);
|
||||
else
|
||||
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name);
|
||||
|
||||
kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
|
||||
kcontrol = snd_soc_component_get_kcontrol_locked(component, ctl_name);
|
||||
if (!kcontrol) {
|
||||
dev_err(component->dev, "Can't find kcontrol %s\n", name);
|
||||
dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,79 @@
|
||||
/* Register addresses are offset when sent over SoundWire */
|
||||
#define CS35L56_SDW_ADDR_OFFSET 0x8000
|
||||
|
||||
/* Cirrus bus bridge registers */
|
||||
#define CS35L56_SDW_MEM_ACCESS_STATUS 0xd0
|
||||
#define CS35L56_SDW_MEM_READ_DATA 0xd8
|
||||
|
||||
#define CS35L56_SDW_LAST_LATE BIT(3)
|
||||
#define CS35L56_SDW_CMD_IN_PROGRESS BIT(2)
|
||||
#define CS35L56_SDW_RDATA_RDY BIT(0)
|
||||
|
||||
#define CS35L56_LATE_READ_POLL_US 10
|
||||
#define CS35L56_LATE_READ_TIMEOUT_US 1000
|
||||
|
||||
static int cs35l56_sdw_poll_mem_status(struct sdw_slave *peripheral,
|
||||
unsigned int mask,
|
||||
unsigned int match)
|
||||
{
|
||||
int ret, val;
|
||||
|
||||
ret = read_poll_timeout(sdw_read_no_pm, val,
|
||||
(val < 0) || ((val & mask) == match),
|
||||
CS35L56_LATE_READ_POLL_US, CS35L56_LATE_READ_TIMEOUT_US,
|
||||
false, peripheral, CS35L56_SDW_MEM_ACCESS_STATUS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (val < 0)
|
||||
return val;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l56_sdw_slow_read(struct sdw_slave *peripheral, unsigned int reg,
|
||||
u8 *buf, size_t val_size)
|
||||
{
|
||||
int ret, i;
|
||||
|
||||
reg += CS35L56_SDW_ADDR_OFFSET;
|
||||
|
||||
for (i = 0; i < val_size; i += sizeof(u32)) {
|
||||
/* Poll for bus bridge idle */
|
||||
ret = cs35l56_sdw_poll_mem_status(peripheral,
|
||||
CS35L56_SDW_CMD_IN_PROGRESS,
|
||||
0);
|
||||
if (ret < 0) {
|
||||
dev_err(&peripheral->dev, "!CMD_IN_PROGRESS fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Reading LSByte triggers read of register to holding buffer */
|
||||
sdw_read_no_pm(peripheral, reg + i);
|
||||
|
||||
/* Wait for data available */
|
||||
ret = cs35l56_sdw_poll_mem_status(peripheral,
|
||||
CS35L56_SDW_RDATA_RDY,
|
||||
CS35L56_SDW_RDATA_RDY);
|
||||
if (ret < 0) {
|
||||
dev_err(&peripheral->dev, "RDATA_RDY fail: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Read data from buffer */
|
||||
ret = sdw_nread_no_pm(peripheral, CS35L56_SDW_MEM_READ_DATA,
|
||||
sizeof(u32), &buf[i]);
|
||||
if (ret) {
|
||||
dev_err(&peripheral->dev, "Late read @%#x failed: %d\n", reg + i, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
swab32s((u32 *)&buf[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l56_sdw_read_one(struct sdw_slave *peripheral, unsigned int reg, void *buf)
|
||||
{
|
||||
int ret;
|
||||
@ -48,6 +121,10 @@ static int cs35l56_sdw_read(void *context, const void *reg_buf,
|
||||
int ret;
|
||||
|
||||
reg = le32_to_cpu(*(const __le32 *)reg_buf);
|
||||
|
||||
if (cs35l56_is_otp_register(reg))
|
||||
return cs35l56_sdw_slow_read(peripheral, reg, buf8, val_size);
|
||||
|
||||
reg += CS35L56_SDW_ADDR_OFFSET;
|
||||
|
||||
if (val_size == 4)
|
||||
|
@ -1095,6 +1095,11 @@ int cs35l56_system_resume(struct device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cs35l56_system_resume);
|
||||
|
||||
static int cs35l56_control_add_nop(struct wm_adsp *dsp, struct cs_dsp_coeff_ctl *cs_ctl)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
|
||||
{
|
||||
struct wm_adsp *dsp;
|
||||
@ -1117,6 +1122,12 @@ static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
|
||||
dsp->fw = 12;
|
||||
dsp->wmfw_optional = true;
|
||||
|
||||
/*
|
||||
* None of the firmware controls need to be exported so add a no-op
|
||||
* callback that suppresses creating an ALSA control.
|
||||
*/
|
||||
dsp->control_add = &cs35l56_control_add_nop;
|
||||
|
||||
dev_dbg(cs35l56->base.dev, "DSP system name: '%s'\n", dsp->system_name);
|
||||
|
||||
ret = wm_halo_init(dsp);
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/bits.h>
|
||||
#include <linux/build_bug.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
@ -252,24 +253,20 @@ CS42L43_IRQ_COMPLETE(load_detect)
|
||||
static irqreturn_t cs42l43_mic_shutter(int irq, void *data)
|
||||
{
|
||||
struct cs42l43_codec *priv = data;
|
||||
static const char * const controls[] = {
|
||||
"Decimator 1 Switch",
|
||||
"Decimator 2 Switch",
|
||||
"Decimator 3 Switch",
|
||||
"Decimator 4 Switch",
|
||||
};
|
||||
int i, ret;
|
||||
struct snd_soc_component *component = priv->component;
|
||||
int i;
|
||||
|
||||
dev_dbg(priv->dev, "Microphone shutter changed\n");
|
||||
|
||||
if (!priv->component)
|
||||
if (!component)
|
||||
return IRQ_NONE;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(controls); i++) {
|
||||
ret = snd_soc_component_notify_control(priv->component,
|
||||
controls[i]);
|
||||
if (ret)
|
||||
for (i = 1; i < ARRAY_SIZE(priv->kctl); i++) {
|
||||
if (!priv->kctl[i])
|
||||
return IRQ_NONE;
|
||||
|
||||
snd_ctl_notify(component->card->snd_card,
|
||||
SNDRV_CTL_EVENT_MASK_VALUE, &priv->kctl[i]->id);
|
||||
}
|
||||
|
||||
return IRQ_HANDLED;
|
||||
@ -278,18 +275,19 @@ static irqreturn_t cs42l43_mic_shutter(int irq, void *data)
|
||||
static irqreturn_t cs42l43_spk_shutter(int irq, void *data)
|
||||
{
|
||||
struct cs42l43_codec *priv = data;
|
||||
int ret;
|
||||
struct snd_soc_component *component = priv->component;
|
||||
|
||||
dev_dbg(priv->dev, "Speaker shutter changed\n");
|
||||
|
||||
if (!priv->component)
|
||||
if (!component)
|
||||
return IRQ_NONE;
|
||||
|
||||
ret = snd_soc_component_notify_control(priv->component,
|
||||
"Speaker Digital Switch");
|
||||
if (ret)
|
||||
if (!priv->kctl[0])
|
||||
return IRQ_NONE;
|
||||
|
||||
snd_ctl_notify(component->card->snd_card,
|
||||
SNDRV_CTL_EVENT_MASK_VALUE, &priv->kctl[0]->id);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
@ -590,7 +588,46 @@ static int cs42l43_asp_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mas
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs42l43_dai_probe(struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component);
|
||||
static const char * const controls[] = {
|
||||
"Speaker Digital Switch",
|
||||
"Decimator 1 Switch",
|
||||
"Decimator 2 Switch",
|
||||
"Decimator 3 Switch",
|
||||
"Decimator 4 Switch",
|
||||
};
|
||||
int i;
|
||||
|
||||
static_assert(ARRAY_SIZE(controls) == ARRAY_SIZE(priv->kctl));
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(controls); i++) {
|
||||
if (priv->kctl[i])
|
||||
continue;
|
||||
|
||||
priv->kctl[i] = snd_soc_component_get_kcontrol(component, controls[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs42l43_dai_remove(struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(priv->kctl); i++)
|
||||
priv->kctl[i] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_soc_dai_ops cs42l43_asp_ops = {
|
||||
.probe = cs42l43_dai_probe,
|
||||
.remove = cs42l43_dai_remove,
|
||||
.startup = cs42l43_startup,
|
||||
.hw_params = cs42l43_asp_hw_params,
|
||||
.set_fmt = cs42l43_asp_set_fmt,
|
||||
@ -608,9 +645,11 @@ static int cs42l43_sdw_hw_params(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
|
||||
return cs42l43_set_sample_rate(substream, params, dai);
|
||||
};
|
||||
}
|
||||
|
||||
static const struct snd_soc_dai_ops cs42l43_sdw_ops = {
|
||||
.probe = cs42l43_dai_probe,
|
||||
.remove = cs42l43_dai_remove,
|
||||
.startup = cs42l43_startup,
|
||||
.set_stream = cs42l43_sdw_set_stream,
|
||||
.hw_params = cs42l43_sdw_hw_params,
|
||||
|
@ -100,6 +100,8 @@ struct cs42l43_codec {
|
||||
struct delayed_work hp_ilimit_clear_work;
|
||||
bool hp_ilimited;
|
||||
int hp_ilimit_count;
|
||||
|
||||
struct snd_kcontrol *kctl[5];
|
||||
};
|
||||
|
||||
#if IS_REACHABLE(CONFIG_SND_SOC_CS42L43_SDW)
|
||||
|
@ -129,16 +129,16 @@ volsw_err:
|
||||
|
||||
static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1270, 50, 0);
|
||||
|
||||
static const char * const cs530x_in_hpf_text[] = {
|
||||
static const char * const cs530x_in_filter_text[] = {
|
||||
"Min Phase Slow Roll-off",
|
||||
"Min Phase Fast Roll-off",
|
||||
"Linear Phase Slow Roll-off",
|
||||
"Linear Phase Fast Roll-off",
|
||||
};
|
||||
|
||||
static SOC_ENUM_SINGLE_DECL(cs530x_in_hpf_enum, CS530X_IN_FILTER,
|
||||
static SOC_ENUM_SINGLE_DECL(cs530x_in_filter_enum, CS530X_IN_FILTER,
|
||||
CS530X_IN_FILTER_SHIFT,
|
||||
cs530x_in_hpf_text);
|
||||
cs530x_in_filter_text);
|
||||
|
||||
static const char * const cs530x_in_4ch_sum_text[] = {
|
||||
"None",
|
||||
@ -189,7 +189,7 @@ SOC_SINGLE_EXT_TLV("IN1 Volume", CS530X_IN_VOL_CTRL1_0, 0, 255, 1,
|
||||
SOC_SINGLE_EXT_TLV("IN2 Volume", CS530X_IN_VOL_CTRL1_1, 0, 255, 1,
|
||||
snd_soc_get_volsw, cs530x_put_volsw_vu, in_vol_tlv),
|
||||
|
||||
SOC_ENUM("IN HPF Select", cs530x_in_hpf_enum),
|
||||
SOC_ENUM("IN DEC Filter Select", cs530x_in_filter_enum),
|
||||
SOC_ENUM("Input Ramp Up", cs530x_ramp_inc_enum),
|
||||
SOC_ENUM("Input Ramp Down", cs530x_ramp_dec_enum),
|
||||
|
||||
|
@ -1472,6 +1472,8 @@ static void va_macro_set_lpass_codec_version(struct va_macro *va)
|
||||
|
||||
if ((core_id_0 == 0x01) && (core_id_1 == 0x0F))
|
||||
version = LPASS_CODEC_VERSION_2_0;
|
||||
if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && core_id_2 == 0x01)
|
||||
version = LPASS_CODEC_VERSION_2_0;
|
||||
if ((core_id_0 == 0x02) && (core_id_1 == 0x0E))
|
||||
version = LPASS_CODEC_VERSION_2_1;
|
||||
if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x50 || core_id_2 == 0x51))
|
||||
|
@ -736,7 +736,7 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(component->dev,
|
||||
dev_dbg(component->dev,
|
||||
"pll_int=%x pll_frac=%x mclk_scaler=%x pre_factor=%x\n",
|
||||
pll_param->pll_int, pll_param->pll_frac,
|
||||
pll_param->mclk_scaler, pll_param->pre_factor);
|
||||
|
@ -1049,7 +1049,7 @@ static int wcd9370_probe(struct sdw_slave *pdev,
|
||||
pdev->prop.lane_control_support = true;
|
||||
pdev->prop.simple_clk_stop_capable = true;
|
||||
if (wcd->is_tx) {
|
||||
pdev->prop.source_ports = GENMASK(WCD937X_MAX_TX_SWR_PORTS, 0);
|
||||
pdev->prop.source_ports = GENMASK(WCD937X_MAX_TX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.src_dpn_prop = wcd937x_dpn_prop;
|
||||
wcd->ch_info = &wcd937x_sdw_tx_ch_info[0];
|
||||
pdev->prop.wake_capable = true;
|
||||
@ -1062,7 +1062,7 @@ static int wcd9370_probe(struct sdw_slave *pdev,
|
||||
/* Start in cache-only until device is enumerated */
|
||||
regcache_cache_only(wcd->regmap, true);
|
||||
} else {
|
||||
pdev->prop.sink_ports = GENMASK(WCD937X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WCD937X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.sink_dpn_prop = wcd937x_dpn_prop;
|
||||
wcd->ch_info = &wcd937x_sdw_rx_ch_info[0];
|
||||
}
|
||||
|
@ -1252,12 +1252,12 @@ static int wcd9380_probe(struct sdw_slave *pdev,
|
||||
pdev->prop.lane_control_support = true;
|
||||
pdev->prop.simple_clk_stop_capable = true;
|
||||
if (wcd->is_tx) {
|
||||
pdev->prop.source_ports = GENMASK(WCD938X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.source_ports = GENMASK(WCD938X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.src_dpn_prop = wcd938x_dpn_prop;
|
||||
wcd->ch_info = &wcd938x_sdw_tx_ch_info[0];
|
||||
pdev->prop.wake_capable = true;
|
||||
} else {
|
||||
pdev->prop.sink_ports = GENMASK(WCD938X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WCD938X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.sink_dpn_prop = wcd938x_dpn_prop;
|
||||
wcd->ch_info = &wcd938x_sdw_rx_ch_info[0];
|
||||
}
|
||||
|
@ -1453,12 +1453,12 @@ static int wcd9390_probe(struct sdw_slave *pdev, const struct sdw_device_id *id)
|
||||
pdev->prop.lane_control_support = true;
|
||||
pdev->prop.simple_clk_stop_capable = true;
|
||||
if (wcd->is_tx) {
|
||||
pdev->prop.source_ports = GENMASK(WCD939X_MAX_TX_SWR_PORTS, 0);
|
||||
pdev->prop.source_ports = GENMASK(WCD939X_MAX_TX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.src_dpn_prop = wcd939x_tx_dpn_prop;
|
||||
wcd->ch_info = &wcd939x_sdw_tx_ch_info[0];
|
||||
pdev->prop.wake_capable = true;
|
||||
} else {
|
||||
pdev->prop.sink_ports = GENMASK(WCD939X_MAX_RX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WCD939X_MAX_RX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.sink_dpn_prop = wcd939x_rx_dpn_prop;
|
||||
wcd->ch_info = &wcd939x_sdw_rx_ch_info[0];
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ static void wm_adsp_ctl_work(struct work_struct *work)
|
||||
kfree(kcontrol);
|
||||
}
|
||||
|
||||
static int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl)
|
||||
int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl)
|
||||
{
|
||||
struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp);
|
||||
struct cs_dsp *cs_dsp = &dsp->cs_dsp;
|
||||
@ -658,6 +658,17 @@ err_ctl:
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wm_adsp_control_add);
|
||||
|
||||
static int wm_adsp_control_add_cb(struct cs_dsp_coeff_ctl *cs_ctl)
|
||||
{
|
||||
struct wm_adsp *dsp = container_of(cs_ctl->dsp, struct wm_adsp, cs_dsp);
|
||||
|
||||
if (dsp->control_add)
|
||||
return (dsp->control_add)(dsp, cs_ctl);
|
||||
else
|
||||
return wm_adsp_control_add(cs_ctl);
|
||||
}
|
||||
|
||||
static void wm_adsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl)
|
||||
{
|
||||
@ -2072,12 +2083,12 @@ irqreturn_t wm_halo_wdt_expire(int irq, void *data)
|
||||
EXPORT_SYMBOL_GPL(wm_halo_wdt_expire);
|
||||
|
||||
static const struct cs_dsp_client_ops wm_adsp1_client_ops = {
|
||||
.control_add = wm_adsp_control_add,
|
||||
.control_add = wm_adsp_control_add_cb,
|
||||
.control_remove = wm_adsp_control_remove,
|
||||
};
|
||||
|
||||
static const struct cs_dsp_client_ops wm_adsp2_client_ops = {
|
||||
.control_add = wm_adsp_control_add,
|
||||
.control_add = wm_adsp_control_add_cb,
|
||||
.control_remove = wm_adsp_control_remove,
|
||||
.pre_run = wm_adsp_pre_run,
|
||||
.post_run = wm_adsp_event_post_run,
|
||||
|
@ -37,6 +37,7 @@ struct wm_adsp {
|
||||
bool wmfw_optional;
|
||||
|
||||
struct work_struct boot_work;
|
||||
int (*control_add)(struct wm_adsp *dsp, struct cs_dsp_coeff_ctl *cs_ctl);
|
||||
int (*pre_run)(struct wm_adsp *dsp);
|
||||
|
||||
bool preloaded;
|
||||
@ -132,6 +133,8 @@ int wm_adsp_compr_pointer(struct snd_soc_component *component,
|
||||
int wm_adsp_compr_copy(struct snd_soc_component *component,
|
||||
struct snd_compr_stream *stream,
|
||||
char __user *buf, size_t count);
|
||||
|
||||
int wm_adsp_control_add(struct cs_dsp_coeff_ctl *cs_ctl);
|
||||
int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type,
|
||||
unsigned int alg, void *buf, size_t len);
|
||||
int wm_adsp_read_ctl(struct wm_adsp *dsp, const char *name, int type,
|
||||
|
@ -1152,7 +1152,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
|
||||
wsa881x->sconfig.frame_rate = 48000;
|
||||
wsa881x->sconfig.direction = SDW_DATA_DIR_RX;
|
||||
wsa881x->sconfig.type = SDW_STREAM_PDM;
|
||||
pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
|
||||
pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
|
||||
pdev->prop.clk_stop_mode1 = true;
|
||||
|
@ -1411,7 +1411,7 @@ static int wsa883x_probe(struct sdw_slave *pdev,
|
||||
WSA883X_MAX_SWR_PORTS))
|
||||
dev_dbg(dev, "Static Port mapping not specified\n");
|
||||
|
||||
pdev->prop.sink_ports = GENMASK(WSA883X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WSA883X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.simple_clk_stop_capable = true;
|
||||
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
|
||||
pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
|
||||
|
@ -1904,7 +1904,7 @@ static int wsa884x_probe(struct sdw_slave *pdev,
|
||||
WSA884X_MAX_SWR_PORTS))
|
||||
dev_dbg(dev, "Static Port mapping not specified\n");
|
||||
|
||||
pdev->prop.sink_ports = GENMASK(WSA884X_MAX_SWR_PORTS, 0);
|
||||
pdev->prop.sink_ports = GENMASK(WSA884X_MAX_SWR_PORTS - 1, 0);
|
||||
pdev->prop.simple_clk_stop_capable = true;
|
||||
pdev->prop.sink_dpn_prop = wsa884x_sink_dpn_prop;
|
||||
pdev->prop.scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY;
|
||||
|
@ -831,7 +831,7 @@ static const struct reg_default fsl_micfil_reg_defaults[] = {
|
||||
{REG_MICFIL_CTRL1, 0x00000000},
|
||||
{REG_MICFIL_CTRL2, 0x00000000},
|
||||
{REG_MICFIL_STAT, 0x00000000},
|
||||
{REG_MICFIL_FIFO_CTRL, 0x00000007},
|
||||
{REG_MICFIL_FIFO_CTRL, 0x0000001F},
|
||||
{REG_MICFIL_FIFO_STAT, 0x00000000},
|
||||
{REG_MICFIL_DATACH0, 0x00000000},
|
||||
{REG_MICFIL_DATACH1, 0x00000000},
|
||||
@ -855,6 +855,8 @@ static const struct reg_default fsl_micfil_reg_defaults[] = {
|
||||
|
||||
static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
struct fsl_micfil *micfil = dev_get_drvdata(dev);
|
||||
|
||||
switch (reg) {
|
||||
case REG_MICFIL_CTRL1:
|
||||
case REG_MICFIL_CTRL2:
|
||||
@ -872,9 +874,6 @@ static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg)
|
||||
case REG_MICFIL_DC_CTRL:
|
||||
case REG_MICFIL_OUT_CTRL:
|
||||
case REG_MICFIL_OUT_STAT:
|
||||
case REG_MICFIL_FSYNC_CTRL:
|
||||
case REG_MICFIL_VERID:
|
||||
case REG_MICFIL_PARAM:
|
||||
case REG_MICFIL_VAD0_CTRL1:
|
||||
case REG_MICFIL_VAD0_CTRL2:
|
||||
case REG_MICFIL_VAD0_STAT:
|
||||
@ -883,6 +882,12 @@ static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg)
|
||||
case REG_MICFIL_VAD0_NDATA:
|
||||
case REG_MICFIL_VAD0_ZCD:
|
||||
return true;
|
||||
case REG_MICFIL_FSYNC_CTRL:
|
||||
case REG_MICFIL_VERID:
|
||||
case REG_MICFIL_PARAM:
|
||||
if (micfil->soc->use_verid)
|
||||
return true;
|
||||
fallthrough;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -890,6 +895,8 @@ static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg)
|
||||
|
||||
static bool fsl_micfil_writeable_reg(struct device *dev, unsigned int reg)
|
||||
{
|
||||
struct fsl_micfil *micfil = dev_get_drvdata(dev);
|
||||
|
||||
switch (reg) {
|
||||
case REG_MICFIL_CTRL1:
|
||||
case REG_MICFIL_CTRL2:
|
||||
@ -899,7 +906,6 @@ static bool fsl_micfil_writeable_reg(struct device *dev, unsigned int reg)
|
||||
case REG_MICFIL_DC_CTRL:
|
||||
case REG_MICFIL_OUT_CTRL:
|
||||
case REG_MICFIL_OUT_STAT: /* Write 1 to Clear */
|
||||
case REG_MICFIL_FSYNC_CTRL:
|
||||
case REG_MICFIL_VAD0_CTRL1:
|
||||
case REG_MICFIL_VAD0_CTRL2:
|
||||
case REG_MICFIL_VAD0_STAT: /* Write 1 to Clear */
|
||||
@ -907,6 +913,10 @@ static bool fsl_micfil_writeable_reg(struct device *dev, unsigned int reg)
|
||||
case REG_MICFIL_VAD0_NCONFIG:
|
||||
case REG_MICFIL_VAD0_ZCD:
|
||||
return true;
|
||||
case REG_MICFIL_FSYNC_CTRL:
|
||||
if (micfil->soc->use_verid)
|
||||
return true;
|
||||
fallthrough;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@
|
||||
#define MICFIL_STAT_CHXF(ch) BIT(ch)
|
||||
|
||||
/* MICFIL FIFO Control Register -- REG_MICFIL_FIFO_CTRL 0x10 */
|
||||
#define MICFIL_FIFO_CTRL_FIFOWMK GENMASK(2, 0)
|
||||
#define MICFIL_FIFO_CTRL_FIFOWMK GENMASK(4, 0)
|
||||
|
||||
/* MICFIL FIFO Status Register -- REG_MICFIL_FIFO_STAT 0x14 */
|
||||
#define MICFIL_FIFO_STAT_FIFOX_OVER(ch) BIT(ch)
|
||||
|
@ -236,19 +236,45 @@ int snd_soc_component_force_enable_pin_unlocked(
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_force_enable_pin_unlocked);
|
||||
|
||||
static void soc_get_kcontrol_name(struct snd_soc_component *component,
|
||||
char *buf, int size, const char * const ctl)
|
||||
{
|
||||
/* When updating, change also snd_soc_dapm_widget_name_cmp() */
|
||||
if (component->name_prefix)
|
||||
snprintf(buf, size, "%s %s", component->name_prefix, ctl);
|
||||
else
|
||||
snprintf(buf, size, "%s", ctl);
|
||||
}
|
||||
|
||||
struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
|
||||
const char * const ctl)
|
||||
{
|
||||
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||
|
||||
soc_get_kcontrol_name(component, name, ARRAY_SIZE(name), ctl);
|
||||
|
||||
return snd_soc_card_get_kcontrol(component->card, name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_get_kcontrol);
|
||||
|
||||
struct snd_kcontrol *
|
||||
snd_soc_component_get_kcontrol_locked(struct snd_soc_component *component,
|
||||
const char * const ctl)
|
||||
{
|
||||
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||
|
||||
soc_get_kcontrol_name(component, name, ARRAY_SIZE(name), ctl);
|
||||
|
||||
return snd_soc_card_get_kcontrol_locked(component->card, name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(snd_soc_component_get_kcontrol_locked);
|
||||
|
||||
int snd_soc_component_notify_control(struct snd_soc_component *component,
|
||||
const char * const ctl)
|
||||
{
|
||||
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||
struct snd_kcontrol *kctl;
|
||||
|
||||
/* When updating, change also snd_soc_dapm_widget_name_cmp() */
|
||||
if (component->name_prefix)
|
||||
snprintf(name, ARRAY_SIZE(name), "%s %s", component->name_prefix, ctl);
|
||||
else
|
||||
snprintf(name, ARRAY_SIZE(name), "%s", ctl);
|
||||
|
||||
kctl = snd_soc_card_get_kcontrol(component->card, name);
|
||||
kctl = snd_soc_component_get_kcontrol(component, ctl);
|
||||
if (!kctl)
|
||||
return soc_component_ret(component, -EINVAL);
|
||||
|
||||
|
@ -573,7 +573,7 @@ static const struct snd_sof_dsp_ops sof_mt8195_ops = {
|
||||
static struct snd_sof_of_mach sof_mt8195_machs[] = {
|
||||
{
|
||||
.compatible = "google,tomato",
|
||||
.sof_tplg_filename = "sof-mt8195-mt6359-rt1019-rt5682-dts.tplg"
|
||||
.sof_tplg_filename = "sof-mt8195-mt6359-rt1019-rt5682.tplg"
|
||||
}, {
|
||||
.compatible = "mediatek,mt8195",
|
||||
.sof_tplg_filename = "sof-mt8195.tplg"
|
||||
|
@ -352,7 +352,7 @@ static int sti_uniperiph_resume(struct snd_soc_component *component)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sti_uniperiph_dai_probe(struct snd_soc_dai *dai)
|
||||
int sti_uniperiph_dai_probe(struct snd_soc_dai *dai)
|
||||
{
|
||||
struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai);
|
||||
struct sti_uniperiph_dai *dai_data = &priv->dai_data;
|
||||
|
@ -1380,6 +1380,7 @@ int uni_reader_init(struct platform_device *pdev,
|
||||
struct uniperif *reader);
|
||||
|
||||
/* common */
|
||||
int sti_uniperiph_dai_probe(struct snd_soc_dai *dai);
|
||||
int sti_uniperiph_dai_set_fmt(struct snd_soc_dai *dai,
|
||||
unsigned int fmt);
|
||||
|
||||
|
@ -1038,6 +1038,7 @@ static const struct snd_soc_dai_ops uni_player_dai_ops = {
|
||||
.startup = uni_player_startup,
|
||||
.shutdown = uni_player_shutdown,
|
||||
.prepare = uni_player_prepare,
|
||||
.probe = sti_uniperiph_dai_probe,
|
||||
.trigger = uni_player_trigger,
|
||||
.hw_params = sti_uniperiph_dai_hw_params,
|
||||
.set_fmt = sti_uniperiph_dai_set_fmt,
|
||||
|
@ -401,6 +401,7 @@ static const struct snd_soc_dai_ops uni_reader_dai_ops = {
|
||||
.startup = uni_reader_startup,
|
||||
.shutdown = uni_reader_shutdown,
|
||||
.prepare = uni_reader_prepare,
|
||||
.probe = sti_uniperiph_dai_probe,
|
||||
.trigger = uni_reader_trigger,
|
||||
.hw_params = sti_uniperiph_dai_hw_params,
|
||||
.set_fmt = sti_uniperiph_dai_set_fmt,
|
||||
|
Loading…
Reference in New Issue
Block a user