summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2017-06-17 10:36:40 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2017-06-17 10:36:40 -0300
commit683b9eda58bdc48ad6606f22ca318f1d2200934d (patch)
tree7acde2eff67256e06cae0419b03af38c5503e5c1 /sound
parenta4418c438de6ad397fd17f006ca86257fb9ec5a6 (diff)
parent30278abfe0977b1d2f065271ce1ea23c0e2d1b6e (diff)
Merge remote-tracking branch 'imx/imx_4.1.15_2.0.0_ga' into 4.1-2.0.x-imx
* imx/imx_4.1.15_2.0.0_ga: (157 commits) MLK-14762 ARM: dts: imx6sll-evk: correct gpio pin for lcd power control MLK-14285-3 usb: phy: mxs: optimize disconnect line condition MLK-14285-2 usb: chipidea: set mode for usb phy driver MLK-14285-1 usb: phy: add usb mode for usb_phy MLK-14747 driver: cpufreq: Correct dc regulator voltage on imx6ull MLK-14720 epdc: correct WFE setting when bypass legacy process MLK-13801-02 ARM: dts: Correct the gpt timer clock source on imx6ul/ull/sll MLK-13801-01 ARM: imx: add gpt_3m clock on imx6sll MLK-14680 pxp/epdc: add LUT cancellation feature MLK-14518-2 pxp: set data path for pxp after reset MLK-14518-1 pxp: initialize pxp according to recommended flow MLK-14516 epdc: bypass pxp legacy process when there's no transformation MLK-14369 epdc: sync LUT status to PXP before enable collision detection MLK-13198 pxp: imx7d: fix error histogram status report issue MLK-13917 pxp: fix build error for pxp library in user space MLK-13862-2 epdc/pxp: imx6ull/imx6sll: enhance the LUT cleanup flow to avoid stalling display MLK-13862-1 epdc/pxp: imx7d: enhance the LUT cleanup flow to avoid stalling display MLK-14697 ARM: dts: imx: update the setpoint data of imx6sll MXSCM-266 arm: dts: increase lpddr2 voltage to 1.25V MXSCM-265: dts: place imx6sxscm dtb files under CONFIG_SOC_IMX6SX ...
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8960.c19
-rw-r--r--sound/soc/fsl/imx-hdmi-dma.c4
-rw-r--r--sound/soc/fsl/imx-wm8958.c16
-rw-r--r--sound/soc/fsl/imx-wm8960.c16
4 files changed, 34 insertions, 21 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 28eb426a8356..6cd20fdd93c0 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -814,6 +814,10 @@ static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec,
}
}
+ ret = wm8960_configure_clocking(codec);
+ if (ret)
+ return ret;
+
/* Set VMID to 2x50k */
snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x80);
break;
@@ -1020,11 +1024,6 @@ static bool is_pll_freq_available(unsigned int source, unsigned int target)
target *= 4;
Ndiv = target / source;
- if (Ndiv < 6) {
- source >>= 1;
- Ndiv = target / source;
- }
-
if ((Ndiv < 6) || (Ndiv > 12))
return false;
@@ -1135,6 +1134,9 @@ static int wm8960_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
if (pll_id == WM8960_SYSCLK_AUTO)
return 0;
+ if (is_pll_freq_available(freq_in, freq_out))
+ return -EINVAL;
+
return wm8960_set_pll(codec, freq_in, freq_out);
}
@@ -1294,6 +1296,7 @@ static int wm8960_i2c_probe(struct i2c_client *i2c,
struct wm8960_data *pdata = dev_get_platdata(&i2c->dev);
struct wm8960_priv *wm8960;
int ret;
+ int repeat_reset = 10;
wm8960 = devm_kzalloc(&i2c->dev, sizeof(struct wm8960_priv),
GFP_KERNEL);
@@ -1315,7 +1318,11 @@ static int wm8960_i2c_probe(struct i2c_client *i2c,
else if (i2c->dev.of_node)
wm8960_set_pdata_from_of(i2c, &wm8960->pdata);
- ret = wm8960_reset(wm8960->regmap);
+ do {
+ ret = wm8960_reset(wm8960->regmap);
+ repeat_reset--;
+ } while (repeat_reset > 0 && ret != 0);
+
if (ret != 0) {
dev_err(&i2c->dev, "Failed to issue reset\n");
return ret;
diff --git a/sound/soc/fsl/imx-hdmi-dma.c b/sound/soc/fsl/imx-hdmi-dma.c
index 0df685159e9c..411906f9ab70 100644
--- a/sound/soc/fsl/imx-hdmi-dma.c
+++ b/sound/soc/fsl/imx-hdmi-dma.c
@@ -1,7 +1,7 @@
/*
* imx-hdmi-dma.c -- HDMI DMA driver for ALSA Soc Audio Layer
*
- * Copyright (C) 2011-2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2011-2016 Freescale Semiconductor, Inc.
*
* based on imx-pcm-dma-mx2.c
* Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
@@ -455,7 +455,7 @@ static void hdmi_dma_data_copy(struct snd_pcm_substream *substream,
if (runtime->access != SNDRV_PCM_ACCESS_MMAP_INTERLEAVED)
return;
- appl_bytes = runtime->status->hw_ptr * (runtime->frame_bits / 8);
+ appl_bytes = (runtime->status->hw_ptr % (priv->buffer_bytes/(runtime->frame_bits/8))) * (runtime->frame_bits/8);
if (type == 'p')
appl_bytes += 2 * priv->period_bytes;
offset = appl_bytes % priv->buffer_bytes;
diff --git a/sound/soc/fsl/imx-wm8958.c b/sound/soc/fsl/imx-wm8958.c
index a2adfb7a3fcf..0db3e6a4ef11 100644
--- a/sound/soc/fsl/imx-wm8958.c
+++ b/sound/soc/fsl/imx-wm8958.c
@@ -397,12 +397,13 @@ static int imx_wm8958_set_bias_level_post(struct snd_soc_card *card,
static int imx_wm8958_probe(struct platform_device *pdev)
{
- struct device_node *cpu_np, *codec_np = NULL, *gpr_np;
+ struct device_node *cpu_np, *codec_np = NULL;
struct device_node *np = pdev->dev.of_node;
struct platform_device *cpu_pdev;
struct imx_priv *priv = &card_priv;
struct i2c_client *codec_dev;
struct imx_wm8958_data *data;
+ struct of_phandle_args args;
int ret;
priv->pdev = pdev;
@@ -441,16 +442,19 @@ static int imx_wm8958_probe(struct platform_device *pdev)
goto fail;
}
- gpr_np = of_parse_phandle(pdev->dev.of_node, "gpr", 0);
- if (gpr_np) {
- data->gpr = syscon_node_to_regmap(gpr_np);
+ ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node, "gpr", 3,
+ 0, &args);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to get gpr property\n");
+ goto fail;
+ } else {
+ data->gpr = syscon_node_to_regmap(args.np);
if (IS_ERR(data->gpr)) {
ret = PTR_ERR(data->gpr);
dev_err(&pdev->dev, "failed to get gpr regmap\n");
goto fail;
}
- if (data->gpr)
- regmap_update_bits(data->gpr, 4, 1<<20, 1<<20);
+ regmap_update_bits(data->gpr, args.args[0], args.args[1], args.args[2]);
}
if (of_property_read_bool(np, "codec-master")) {
diff --git a/sound/soc/fsl/imx-wm8960.c b/sound/soc/fsl/imx-wm8960.c
index d65e7765f077..cef6d0066af3 100644
--- a/sound/soc/fsl/imx-wm8960.c
+++ b/sound/soc/fsl/imx-wm8960.c
@@ -420,13 +420,13 @@ static struct snd_soc_dai_link imx_wm8960_dai[] = {
static int imx_wm8960_probe(struct platform_device *pdev)
{
struct device_node *cpu_np, *codec_np = NULL;
- struct device_node *gpr_np;
struct platform_device *cpu_pdev;
struct imx_priv *priv = &card_priv;
struct i2c_client *codec_dev;
struct imx_wm8960_data *data;
struct platform_device *asrc_pdev = NULL;
struct device_node *asrc_np;
+ struct of_phandle_args args;
u32 width;
int ret;
@@ -476,17 +476,19 @@ static int imx_wm8960_probe(struct platform_device *pdev)
goto fail;
}
- gpr_np = of_parse_phandle(pdev->dev.of_node, "gpr", 0);
- if (gpr_np) {
- data->gpr = syscon_node_to_regmap(gpr_np);
+ ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node, "gpr", 3,
+ 0, &args);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to get gpr property\n");
+ goto fail;
+ } else {
+ data->gpr = syscon_node_to_regmap(args.np);
if (IS_ERR(data->gpr)) {
ret = PTR_ERR(data->gpr);
dev_err(&pdev->dev, "failed to get gpr regmap\n");
goto fail;
}
-
- /* set SAI2_MCLK_DIR to enable codec MCLK for imx7d */
- regmap_update_bits(data->gpr, 4, 1<<20, 1<<20);
+ regmap_update_bits(data->gpr, args.args[0], args.args[1], args.args[2]);
}
of_property_read_u32_array(pdev->dev.of_node, "hp-det", data->hp_det, 2);