Skip to content

Commit

Permalink
Merge branch 'asoc-5.6' into asoc-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
broonie committed Mar 27, 2020
2 parents 16fbf79 + f25e203 commit 8e3bb8e
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 95 deletions.
15 changes: 13 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4021,8 +4021,8 @@ F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
F: sound/soc/codecs/cros_ec_codec.*

CIRRUS LOGIC AUDIO CODEC DRIVERS
M: Brian Austin <brian.austin@cirrus.com>
M: Paul Handrigan <Paul.Handrigan@cirrus.com>
M: James Schulman <james.schulman@cirrus.com>
M: David Rhodes <david.rhodes@cirrus.com>
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: sound/soc/codecs/cs*
Expand Down Expand Up @@ -15613,6 +15613,17 @@ F: sound/soc/
F: include/dt-bindings/sound/
F: include/sound/soc*

SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS
M: Pierre-Louis Bossart <[email protected]>
M: Liam Girdwood <[email protected]>
M: Ranjani Sridharan <[email protected]>
M: Kai Vehmanen <[email protected]>
M: Daniel Baluta <[email protected]>
L: [email protected] (moderated for non-subscribers)
W: https://github.com/thesofproject/linux/
S: Supported
F: sound/soc/sof/

SOUNDWIRE SUBSYSTEM
M: Vinod Koul <[email protected]>
M: Sanyog Kale <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ struct snd_soc_card {
const struct snd_soc_dapm_route *of_dapm_routes;
int num_of_dapm_routes;
bool fully_routed;
bool disable_route_checks;

/* lists of probed devices belonging to this card */
struct list_head component_dev_list;
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/max98357a.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ MODULE_DEVICE_TABLE(of, max98357a_device_id);
#ifdef CONFIG_ACPI
static const struct acpi_device_id max98357a_acpi_match[] = {
{ "MX98357A", 0 },
{ "MX98360A", 0 },
{},
};
MODULE_DEVICE_TABLE(acpi, max98357a_acpi_match);
Expand Down
4 changes: 3 additions & 1 deletion sound/soc/codecs/rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ static void rt5682_jack_detect_handler(struct work_struct *work)
static const struct snd_kcontrol_new rt5682_snd_controls[] = {
/* DAC Digital Volume */
SOC_DOUBLE_TLV("DAC1 Playback Volume", RT5682_DAC1_DIG_VOL,
RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 86, 0, dac_vol_tlv),
RT5682_L_VOL_SFT + 1, RT5682_R_VOL_SFT + 1, 87, 0, dac_vol_tlv),

/* IN Boost Volume */
SOC_SINGLE_TLV("CBJ Boost Volume", RT5682_CBJ_BST_CTRL,
Expand Down Expand Up @@ -2651,6 +2651,8 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
RT5682_CP_CLK_HP_MASK, RT5682_CP_CLK_HP_300KHZ);
regmap_update_bits(rt5682->regmap, RT5682_HP_CHARGE_PUMP_1,
RT5682_PM_HP_MASK, RT5682_PM_HP_HV);
regmap_update_bits(rt5682->regmap, RT5682_DMIC_CTRL_1,
RT5682_FIFO_CLK_DIV_MASK, RT5682_FIFO_CLK_DIV_2);

INIT_DELAYED_WORK(&rt5682->jack_detect_work,
rt5682_jack_detect_handler);
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/rt5682.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@
#define RT5682_DMIC_1_EN_SFT 15
#define RT5682_DMIC_1_DIS (0x0 << 15)
#define RT5682_DMIC_1_EN (0x1 << 15)
#define RT5682_FIFO_CLK_DIV_MASK (0x7 << 12)
#define RT5682_FIFO_CLK_DIV_2 (0x1 << 12)
#define RT5682_DMIC_1_DP_MASK (0x3 << 4)
#define RT5682_DMIC_1_DP_SFT 4
#define RT5682_DMIC_1_DP_GPIO2 (0x0 << 4)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/tas2562.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static const struct snd_kcontrol_new vsense_switch =
1, 1);

static const struct snd_kcontrol_new tas2562_snd_controls[] = {
SOC_SINGLE_TLV("Amp Gain Volume", TAS2562_PB_CFG1, 0, 0x1c, 0,
SOC_SINGLE_TLV("Amp Gain Volume", TAS2562_PB_CFG1, 1, 0x1c, 0,
tas2562_dac_tlv),
};

Expand Down
18 changes: 9 additions & 9 deletions sound/soc/codecs/wcd9335.c
Original file line number Diff line number Diff line change
Expand Up @@ -4926,11 +4926,11 @@ static const struct regmap_range_cfg wcd9335_ranges[] = {
.name = "WCD9335",
.range_min = 0x0,
.range_max = WCD9335_MAX_REGISTER,
.selector_reg = WCD9335_REG(0x0, 0),
.selector_reg = WCD9335_SEL_REGISTER,
.selector_mask = 0xff,
.selector_shift = 0,
.window_start = 0x0,
.window_len = 0x1000,
.window_start = 0x800,
.window_len = 0x100,
},
};

Expand Down Expand Up @@ -4968,20 +4968,20 @@ static const struct regmap_range_cfg wcd9335_ifc_ranges[] = {
{
.name = "WCD9335-IFC-DEV",
.range_min = 0x0,
.range_max = WCD9335_REG(0, 0x7ff),
.selector_reg = WCD9335_REG(0, 0x0),
.selector_mask = 0xff,
.range_max = WCD9335_MAX_REGISTER,
.selector_reg = WCD9335_SEL_REGISTER,
.selector_mask = 0xfff,
.selector_shift = 0,
.window_start = 0x0,
.window_len = 0x1000,
.window_start = 0x800,
.window_len = 0x400,
},
};

static struct regmap_config wcd9335_ifc_regmap_config = {
.reg_bits = 16,
.val_bits = 8,
.can_multi_write = true,
.max_register = WCD9335_REG(0, 0x7FF),
.max_register = WCD9335_MAX_REGISTER,
.ranges = wcd9335_ifc_ranges,
.num_ranges = ARRAY_SIZE(wcd9335_ifc_ranges),
};
Expand Down
7 changes: 4 additions & 3 deletions sound/soc/codecs/wcd9335.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* in slimbus mode the reg base starts from 0x800
* in i2s/i2c mode the reg base is 0x0
*/
#define WCD9335_REG(pg, r) ((pg << 12) | (r) | 0x800)
#define WCD9335_REG(pg, r) ((pg << 8) | (r))
#define WCD9335_REG_OFFSET(r) (r & 0xFF)
#define WCD9335_PAGE_OFFSET(r) ((r >> 12) & 0xFF)
#define WCD9335_PAGE_OFFSET(r) ((r >> 8) & 0xFF)

/* Page-0 Registers */
#define WCD9335_PAGE0_PAGE_REGISTER WCD9335_REG(0x00, 0x000)
Expand Down Expand Up @@ -600,7 +600,8 @@
#define WCD9335_CDC_CLK_RST_CTRL_FS_CNT_ENABLE BIT(0)
#define WCD9335_CDC_CLK_RST_CTRL_FS_CNT_DISABLE 0
#define WCD9335_CDC_TOP_TOP_CFG1 WCD9335_REG(0x0d, 0x082)
#define WCD9335_MAX_REGISTER WCD9335_REG(0x80, 0x0FF)
#define WCD9335_MAX_REGISTER 0xffff
#define WCD9335_SEL_REGISTER 0x800

/* SLIMBUS Slave Registers */
#define WCD9335_SLIM_PGD_PORT_INT_EN0 WCD9335_REG(0, 0x30)
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/codecs/wm_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,12 +1436,12 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,
subname = NULL; /* don't append subname */
break;
case 2:
ret = snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
ret = scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
"%s%c %.12s %x", dsp->name, *region_name,
wm_adsp_fw_text[dsp->fw], alg_region->alg);
break;
default:
ret = snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
ret = scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
"%s %.12s %x", dsp->name,
wm_adsp_fw_text[dsp->fw], alg_region->alg);
break;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/wsa881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
wsa881x->sconfig.type = SDW_STREAM_PDM;
pdev->prop.sink_ports = GENMASK(WSA881X_MAX_SWR_PORTS, 0);
pdev->prop.sink_dpn_prop = wsa_sink_dpn_prop;
gpiod_set_value(wsa881x->sd_n, 1);
gpiod_direction_output(wsa881x->sd_n, 1);

wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config);
if (IS_ERR(wsa881x->regmap)) {
Expand Down
7 changes: 4 additions & 3 deletions sound/soc/intel/boards/bdw-rt5650.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ SND_SOC_DAILINK_DEF(be,
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
#else
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_DUMMY()));
#endif

static struct snd_soc_dai_link bdw_rt5650_dais[] = {
Expand Down Expand Up @@ -264,7 +261,11 @@ static struct snd_soc_dai_link bdw_rt5650_dais[] = {
.dpcm_playback = 1,
.dpcm_capture = 1,
.init = bdw_rt5650_init,
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_REG(dummy, be, dummy),
#else
SND_SOC_DAILINK_REG(ssp0_port, be, platform),
#endif
},
};

Expand Down
7 changes: 4 additions & 3 deletions sound/soc/intel/boards/bdw-rt5677.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,6 @@ SND_SOC_DAILINK_DEF(be,
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
#else
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_DUMMY()));
#endif

/* Wake on voice interface */
Expand Down Expand Up @@ -350,7 +347,11 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
.dpcm_playback = 1,
.dpcm_capture = 1,
.init = bdw_rt5677_init,
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_REG(dummy, be, dummy),
#else
SND_SOC_DAILINK_REG(ssp0_port, be, platform),
#endif
},
};

Expand Down
7 changes: 4 additions & 3 deletions sound/soc/intel/boards/broadwell.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ SND_SOC_DAILINK_DEF(codec,
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_CPU("ssp0-port")));
#else
SND_SOC_DAILINK_DEF(ssp0_port,
DAILINK_COMP_ARRAY(COMP_DUMMY()));
#endif

/* broadwell digital audio interface glue - connects codec <--> CPU */
Expand Down Expand Up @@ -226,7 +223,11 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
.ops = &broadwell_rt286_ops,
.dpcm_playback = 1,
.dpcm_capture = 1,
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
SND_SOC_DAILINK_REG(dummy, codec, dummy),
#else
SND_SOC_DAILINK_REG(ssp0_port, codec, platform),
#endif
},
};

Expand Down
1 change: 1 addition & 0 deletions sound/soc/intel/boards/skl_nau88l25_ssm4567.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ static struct snd_soc_card skylake_audio_card = {
.codec_conf = ssm4567_codec_conf,
.num_configs = ARRAY_SIZE(ssm4567_codec_conf),
.fully_routed = true,
.disable_route_checks = true,
.late_probe = skylake_card_late_probe,
};

Expand Down
3 changes: 0 additions & 3 deletions sound/soc/intel/skylake/bxt-sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "skl.h"

#define BXT_BASEFW_TIMEOUT 3000
#define BXT_INIT_TIMEOUT 300
#define BXT_ROM_INIT_TIMEOUT 70
#define BXT_IPC_PURGE_FW 0x01004000

Expand All @@ -38,8 +37,6 @@
/* Delay before scheduling D0i3 entry */
#define BXT_D0I3_DELAY 5000

#define BXT_FW_ROM_INIT_RETRY 3

static unsigned int bxt_get_errorcode(struct sst_dsp *ctx)
{
return sst_dsp_shim_read(ctx, BXT_ADSP_ERROR_CODE);
Expand Down
35 changes: 28 additions & 7 deletions sound/soc/intel/skylake/cnl-sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,34 @@ static int cnl_prepare_fw(struct sst_dsp *ctx, const void *fwdata, u32 fwsize)
ctx->dsp_ops.stream_tag = stream_tag;
memcpy(ctx->dmab.area, fwdata, fwsize);

ret = skl_dsp_core_power_up(ctx, SKL_DSP_CORE0_MASK);
if (ret < 0) {
dev_err(ctx->dev, "dsp core0 power up failed\n");
ret = -EIO;
goto base_fw_load_failed;
}

/* purge FW request */
sst_dsp_shim_write(ctx, CNL_ADSP_REG_HIPCIDR,
CNL_ADSP_REG_HIPCIDR_BUSY | (CNL_IPC_PURGE |
((stream_tag - 1) << CNL_ROM_CTRL_DMA_ID)));

ret = cnl_dsp_enable_core(ctx, SKL_DSP_CORE0_MASK);
ret = skl_dsp_start_core(ctx, SKL_DSP_CORE0_MASK);
if (ret < 0) {
dev_err(ctx->dev, "dsp boot core failed ret: %d\n", ret);
dev_err(ctx->dev, "Start dsp core failed ret: %d\n", ret);
ret = -EIO;
goto base_fw_load_failed;
}

ret = sst_dsp_register_poll(ctx, CNL_ADSP_REG_HIPCIDA,
CNL_ADSP_REG_HIPCIDA_DONE,
CNL_ADSP_REG_HIPCIDA_DONE,
BXT_INIT_TIMEOUT, "HIPCIDA Done");
if (ret < 0) {
dev_err(ctx->dev, "timeout for purge request: %d\n", ret);
goto base_fw_load_failed;
}

/* enable interrupt */
cnl_ipc_int_enable(ctx);
cnl_ipc_op_int_enable(ctx);
Expand Down Expand Up @@ -109,7 +125,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
{
struct firmware stripped_fw;
struct skl_dev *cnl = ctx->thread_context;
int ret;
int ret, i;

if (!ctx->fw) {
ret = request_firmware(&ctx->fw, ctx->fw_name, ctx->dev);
Expand All @@ -131,12 +147,16 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
stripped_fw.size = ctx->fw->size;
skl_dsp_strip_extended_manifest(&stripped_fw);

ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
if (ret < 0) {
dev_err(ctx->dev, "prepare firmware failed: %d\n", ret);
goto cnl_load_base_firmware_failed;
for (i = 0; i < BXT_FW_ROM_INIT_RETRY; i++) {
ret = cnl_prepare_fw(ctx, stripped_fw.data, stripped_fw.size);
if (!ret)
break;
dev_dbg(ctx->dev, "prepare firmware failed: %d\n", ret);
}

if (ret < 0)
goto cnl_load_base_firmware_failed;

ret = sst_transfer_fw_host_dma(ctx);
if (ret < 0) {
dev_err(ctx->dev, "transfer firmware failed: %d\n", ret);
Expand All @@ -158,6 +178,7 @@ static int cnl_load_base_firmware(struct sst_dsp *ctx)
return 0;

cnl_load_base_firmware_failed:
dev_err(ctx->dev, "firmware load failed: %d\n", ret);
release_firmware(ctx->fw);
ctx->fw = NULL;

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/intel/skylake/skl-nhlt.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ void skl_nhlt_remove_sysfs(struct skl_dev *skl)
{
struct device *dev = &skl->pci->dev;

sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
if (skl->nhlt)
sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/intel/skylake/skl-sst-dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ struct skl_dev;

#define SKL_FW_INIT 0x1
#define SKL_FW_RFW_START 0xf
#define BXT_FW_ROM_INIT_RETRY 3
#define BXT_INIT_TIMEOUT 300

#define SKL_ADSPIC_IPC 1
#define SKL_ADSPIS_IPC 1
Expand Down
Loading

0 comments on commit 8e3bb8e

Please sign in to comment.