diff options
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 2 | ||||
-rw-r--r-- | sound/soc/generic/simple-card.c | 13 | ||||
-rw-r--r-- | sound/soc/samsung/i2s.c | 29 |
4 files changed, 34 insertions, 21 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 3d39f0b5b4a8..8f4c73d17c87 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -1277,7 +1277,7 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | |||
1277 | return ret; | 1277 | return ret; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies), | 1280 | ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies), |
1281 | sgtl5000->supplies); | 1281 | sgtl5000->supplies); |
1282 | if (ret) | 1282 | if (ret) |
1283 | goto err_ldo_remove; | 1283 | goto err_ldo_remove; |
@@ -1285,13 +1285,16 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | |||
1285 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), | 1285 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), |
1286 | sgtl5000->supplies); | 1286 | sgtl5000->supplies); |
1287 | if (ret) | 1287 | if (ret) |
1288 | goto err_ldo_remove; | 1288 | goto err_regulator_free; |
1289 | 1289 | ||
1290 | /* wait for all power rails bring up */ | 1290 | /* wait for all power rails bring up */ |
1291 | udelay(10); | 1291 | udelay(10); |
1292 | 1292 | ||
1293 | return 0; | 1293 | return 0; |
1294 | 1294 | ||
1295 | err_regulator_free: | ||
1296 | regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), | ||
1297 | sgtl5000->supplies); | ||
1295 | err_ldo_remove: | 1298 | err_ldo_remove: |
1296 | if (!external_vddd) | 1299 | if (!external_vddd) |
1297 | ldo_regulator_remove(codec); | 1300 | ldo_regulator_remove(codec); |
@@ -1361,6 +1364,8 @@ static int sgtl5000_probe(struct snd_soc_codec *codec) | |||
1361 | err: | 1364 | err: |
1362 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), | 1365 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), |
1363 | sgtl5000->supplies); | 1366 | sgtl5000->supplies); |
1367 | regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), | ||
1368 | sgtl5000->supplies); | ||
1364 | ldo_regulator_remove(codec); | 1369 | ldo_regulator_remove(codec); |
1365 | 1370 | ||
1366 | return ret; | 1371 | return ret; |
@@ -1374,6 +1379,8 @@ static int sgtl5000_remove(struct snd_soc_codec *codec) | |||
1374 | 1379 | ||
1375 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), | 1380 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), |
1376 | sgtl5000->supplies); | 1381 | sgtl5000->supplies); |
1382 | regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), | ||
1383 | sgtl5000->supplies); | ||
1377 | ldo_regulator_remove(codec); | 1384 | ldo_regulator_remove(codec); |
1378 | 1385 | ||
1379 | return 0; | 1386 | return 0; |
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index e12fafbb1e09..5360772bc1ad 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -879,7 +879,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
879 | case SNDRV_PCM_FORMAT_S20_3LE: | 879 | case SNDRV_PCM_FORMAT_S20_3LE: |
880 | data |= (0x01 << 4); | 880 | data |= (0x01 << 4); |
881 | break; | 881 | break; |
882 | case SNDRV_PCM_FORMAT_S24_LE: | 882 | case SNDRV_PCM_FORMAT_S24_3LE: |
883 | data |= (0x02 << 4); | 883 | data |= (0x02 << 4); |
884 | break; | 884 | break; |
885 | case SNDRV_PCM_FORMAT_S32_LE: | 885 | case SNDRV_PCM_FORMAT_S32_LE: |
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 03a7fdcdf114..159e517fa09a 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -116,6 +116,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
116 | { | 116 | { |
117 | struct device_node *node; | 117 | struct device_node *node; |
118 | struct clk *clk; | 118 | struct clk *clk; |
119 | u32 val; | ||
119 | int ret; | 120 | int ret; |
120 | 121 | ||
121 | /* | 122 | /* |
@@ -151,10 +152,8 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
151 | } | 152 | } |
152 | 153 | ||
153 | dai->sysclk = clk_get_rate(clk); | 154 | dai->sysclk = clk_get_rate(clk); |
154 | } else if (of_property_read_bool(np, "system-clock-frequency")) { | 155 | } else if (!of_property_read_u32(np, "system-clock-frequency", &val)) { |
155 | of_property_read_u32(np, | 156 | dai->sysclk = val; |
156 | "system-clock-frequency", | ||
157 | &dai->sysclk); | ||
158 | } else { | 157 | } else { |
159 | clk = of_clk_get(node, 0); | 158 | clk = of_clk_get(node, 0); |
160 | if (!IS_ERR(clk)) | 159 | if (!IS_ERR(clk)) |
@@ -303,6 +302,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
303 | { | 302 | { |
304 | struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; | 303 | struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; |
305 | struct simple_dai_props *dai_props = priv->dai_props; | 304 | struct simple_dai_props *dai_props = priv->dai_props; |
305 | u32 val; | ||
306 | int ret; | 306 | int ret; |
307 | 307 | ||
308 | /* parsing the card name from DT */ | 308 | /* parsing the card name from DT */ |
@@ -325,8 +325,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
325 | } | 325 | } |
326 | 326 | ||
327 | /* Factor to mclk, used in hw_params() */ | 327 | /* Factor to mclk, used in hw_params() */ |
328 | of_property_read_u32(node, "simple-audio-card,mclk-fs", | 328 | ret = of_property_read_u32(node, "simple-audio-card,mclk-fs", &val); |
329 | &priv->mclk_fs); | 329 | if (ret == 0) |
330 | priv->mclk_fs = val; | ||
330 | 331 | ||
331 | dev_dbg(dev, "New simple-card: %s\n", priv->snd_card.name ? | 332 | dev_dbg(dev, "New simple-card: %s\n", priv->snd_card.name ? |
332 | priv->snd_card.name : ""); | 333 | priv->snd_card.name : ""); |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 2ac76fa3e742..d2533dbc8399 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -68,6 +68,8 @@ struct i2s_dai { | |||
68 | #define DAI_OPENED (1 << 0) /* Dai is opened */ | 68 | #define DAI_OPENED (1 << 0) /* Dai is opened */ |
69 | #define DAI_MANAGER (1 << 1) /* Dai is the manager */ | 69 | #define DAI_MANAGER (1 << 1) /* Dai is the manager */ |
70 | unsigned mode; | 70 | unsigned mode; |
71 | /* CDCLK pin direction: 0 - input, 1 - output */ | ||
72 | unsigned int cdclk_out:1; | ||
71 | /* Driver for this DAI */ | 73 | /* Driver for this DAI */ |
72 | struct snd_soc_dai_driver i2s_dai_drv; | 74 | struct snd_soc_dai_driver i2s_dai_drv; |
73 | /* DMA parameters */ | 75 | /* DMA parameters */ |
@@ -737,6 +739,9 @@ static int i2s_startup(struct snd_pcm_substream *substream, | |||
737 | 739 | ||
738 | spin_unlock_irqrestore(&lock, flags); | 740 | spin_unlock_irqrestore(&lock, flags); |
739 | 741 | ||
742 | if (!is_opened(other) && i2s->cdclk_out) | ||
743 | i2s_set_sysclk(dai, SAMSUNG_I2S_CDCLK, | ||
744 | 0, SND_SOC_CLOCK_OUT); | ||
740 | return 0; | 745 | return 0; |
741 | } | 746 | } |
742 | 747 | ||
@@ -752,9 +757,13 @@ static void i2s_shutdown(struct snd_pcm_substream *substream, | |||
752 | i2s->mode &= ~DAI_OPENED; | 757 | i2s->mode &= ~DAI_OPENED; |
753 | i2s->mode &= ~DAI_MANAGER; | 758 | i2s->mode &= ~DAI_MANAGER; |
754 | 759 | ||
755 | if (is_opened(other)) | 760 | if (is_opened(other)) { |
756 | other->mode |= DAI_MANAGER; | 761 | other->mode |= DAI_MANAGER; |
757 | 762 | } else { | |
763 | u32 mod = readl(i2s->addr + I2SMOD); | ||
764 | i2s->cdclk_out = !(mod & MOD_CDCLKCON); | ||
765 | other->cdclk_out = i2s->cdclk_out; | ||
766 | } | ||
758 | /* Reset any constraint on RFS and BFS */ | 767 | /* Reset any constraint on RFS and BFS */ |
759 | i2s->rfs = 0; | 768 | i2s->rfs = 0; |
760 | i2s->bfs = 0; | 769 | i2s->bfs = 0; |
@@ -920,11 +929,9 @@ static int i2s_suspend(struct snd_soc_dai *dai) | |||
920 | { | 929 | { |
921 | struct i2s_dai *i2s = to_info(dai); | 930 | struct i2s_dai *i2s = to_info(dai); |
922 | 931 | ||
923 | if (dai->active) { | 932 | i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); |
924 | i2s->suspend_i2smod = readl(i2s->addr + I2SMOD); | 933 | i2s->suspend_i2scon = readl(i2s->addr + I2SCON); |
925 | i2s->suspend_i2scon = readl(i2s->addr + I2SCON); | 934 | i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); |
926 | i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); | ||
927 | } | ||
928 | 935 | ||
929 | return 0; | 936 | return 0; |
930 | } | 937 | } |
@@ -933,11 +940,9 @@ static int i2s_resume(struct snd_soc_dai *dai) | |||
933 | { | 940 | { |
934 | struct i2s_dai *i2s = to_info(dai); | 941 | struct i2s_dai *i2s = to_info(dai); |
935 | 942 | ||
936 | if (dai->active) { | 943 | writel(i2s->suspend_i2scon, i2s->addr + I2SCON); |
937 | writel(i2s->suspend_i2scon, i2s->addr + I2SCON); | 944 | writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); |
938 | writel(i2s->suspend_i2smod, i2s->addr + I2SMOD); | 945 | writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR); |
939 | writel(i2s->suspend_i2spsr, i2s->addr + I2SPSR); | ||
940 | } | ||
941 | 946 | ||
942 | return 0; | 947 | return 0; |
943 | } | 948 | } |