Skip to content

Commit 2e9ac12

Browse files
committed
Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/spear', 'asoc/topic/sta32x', 'asoc/topic/stm32' and 'asoc/topic/sunxi' into asoc-next
6 parents 55eafeb + a728f56 + a1150d4 + c5efe23 + 635eac1 + 7d29938 commit 2e9ac12

File tree

18 files changed

+442
-94
lines changed

18 files changed

+442
-94
lines changed

Documentation/devicetree/bindings/sound/simple-card.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ Optional CPU/CODEC subnodes properties:
8686
in dai startup() and disabled with
8787
clk_disable_unprepare() in dai
8888
shutdown().
89+
- system-clock-direction-out : specifies clock direction as 'out' on
90+
initialization. It is useful for some aCPUs with
91+
fixed clocks.
8992

9093
Example 1 - single DAI link:
9194

Documentation/devicetree/bindings/sound/simple-scu-card.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Optional subnode properties:
2424
- simple-audio-card,convert-rate : platform specified sampling rate convert
2525
- simple-audio-card,convert-channels : platform specified converted channel size (2 - 8 ch)
2626
- simple-audio-card,prefix : see routing
27+
- simple-audio-card,widgets : Please refer to widgets.txt.
2728
- simple-audio-card,routing : A list of the connections between audio components.
2829
Each entry is a pair of strings, the first being the connection's sink,
2930
the second being the connection's source. Valid names for sources.

Documentation/devicetree/bindings/sound/sun4i-i2s.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
- compatible: should be one of the following:
99
- "allwinner,sun4i-a10-i2s"
1010
- "allwinner,sun6i-a31-i2s"
11+
- "allwinner,sun8i-h3-i2s"
1112
- reg: physical base address of the controller and length of memory mapped
1213
region.
1314
- interrupts: should contain the I2S interrupt.
@@ -22,6 +23,7 @@ Required properties:
2223

2324
Required properties for the following compatibles:
2425
- "allwinner,sun6i-a31-i2s"
26+
- "allwinner,sun8i-h3-i2s"
2527
- resets: phandle to the reset line for this codec
2628

2729
Example:

include/sound/simple_card_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
struct asoc_simple_dai {
1616
const char *name;
1717
unsigned int sysclk;
18+
int clk_direction;
1819
int slots;
1920
int slot_width;
2021
unsigned int tx_slot_mask;

sound/soc/codecs/sta32x.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,7 @@ static int sta32x_set_bias_level(struct snd_soc_codec *codec,
847847
msleep(300);
848848
sta32x_watchdog_stop(sta32x);
849849

850-
if (sta32x->gpiod_nreset)
851-
gpiod_set_value(sta32x->gpiod_nreset, 0);
850+
gpiod_set_value(sta32x->gpiod_nreset, 0);
852851

853852
regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies),
854853
sta32x->supplies);

sound/soc/generic/audio-graph-card.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ MODULE_DEVICE_TABLE(of, asoc_graph_of_match);
325325
static struct platform_driver asoc_graph_card = {
326326
.driver = {
327327
.name = "asoc-audio-graph-card",
328+
.pm = &snd_soc_pm_ops,
328329
.of_match_table = asoc_graph_of_match,
329330
},
330331
.probe = asoc_graph_card_probe,

sound/soc/generic/audio-graph-scu-card.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ MODULE_DEVICE_TABLE(of, asoc_graph_of_match);
401401
static struct platform_driver asoc_graph_card = {
402402
.driver = {
403403
.name = "asoc-audio-graph-scu-card",
404+
.pm = &snd_soc_pm_ops,
404405
.of_match_table = asoc_graph_of_match,
405406
},
406407
.probe = asoc_graph_card_probe,

sound/soc/generic/simple-card-utils.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ int asoc_simple_card_parse_clk(struct device *dev,
196196
simple_dai->sysclk = clk_get_rate(clk);
197197
}
198198

199-
dev_dbg(dev, "%s : sysclk = %d\n", name, simple_dai->sysclk);
199+
if (of_property_read_bool(node, "system-clock-direction-out"))
200+
simple_dai->clk_direction = SND_SOC_CLOCK_OUT;
201+
202+
dev_dbg(dev, "%s : sysclk = %d, direction %d\n", name,
203+
simple_dai->sysclk, simple_dai->clk_direction);
200204

201205
return 0;
202206
}
@@ -308,7 +312,8 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
308312
int ret;
309313

310314
if (simple_dai->sysclk) {
311-
ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, 0);
315+
ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk,
316+
simple_dai->clk_direction);
312317
if (ret && ret != -ENOTSUPP) {
313318
dev_err(dai->dev, "simple-card: set_sysclk error\n");
314319
return ret;

sound/soc/generic/simple-scu-card.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
191191
if (!node)
192192
return -EINVAL;
193193

194+
ret = asoc_simple_card_of_parse_widgets(card, PREFIX);
195+
if (ret < 0)
196+
return ret;
197+
194198
ret = asoc_simple_card_of_parse_routing(card, PREFIX, 0);
195199
if (ret < 0)
196200
return ret;
@@ -296,6 +300,7 @@ MODULE_DEVICE_TABLE(of, asoc_simple_of_match);
296300
static struct platform_driver asoc_simple_card = {
297301
.driver = {
298302
.name = "simple-scu-audio-card",
303+
.pm = &snd_soc_pm_ops,
299304
.of_match_table = asoc_simple_of_match,
300305
},
301306
.probe = asoc_simple_card_probe,

sound/soc/spear/spdif_in.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd,
151151
return ret;
152152
}
153153

154-
static struct snd_soc_dai_ops spdif_in_dai_ops = {
154+
static const struct snd_soc_dai_ops spdif_in_dai_ops = {
155155
.shutdown = spdif_in_shutdown,
156156
.trigger = spdif_in_trigger,
157157
.hw_params = spdif_in_hw_params,
@@ -216,15 +216,15 @@ static int spdif_in_probe(struct platform_device *pdev)
216216
return -EINVAL;
217217

218218
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
219-
if (!host) {
220-
dev_warn(&pdev->dev, "kzalloc fail\n");
219+
if (!host)
221220
return -ENOMEM;
222-
}
223221

224222
host->io_base = io_base;
225223
host->irq = platform_get_irq(pdev, 0);
226-
if (host->irq < 0)
227-
return -EINVAL;
224+
if (host->irq < 0) {
225+
dev_warn(&pdev->dev, "failed to get IRQ: %d\n", host->irq);
226+
return host->irq;
227+
}
228228

229229
host->clk = devm_clk_get(&pdev->dev, NULL);
230230
if (IS_ERR(host->clk))

sound/soc/spear/spdif_out.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,8 @@ static int spdif_out_probe(struct platform_device *pdev)
282282
int ret;
283283

284284
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
285-
if (!host) {
286-
dev_warn(&pdev->dev, "kzalloc fail\n");
285+
if (!host)
287286
return -ENOMEM;
288-
}
289287

290288
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
291289
host->io_base = devm_ioremap_resource(&pdev->dev, res);

sound/soc/stm/stm32_i2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev,
840840
}
841841

842842
/* Reset */
843-
rst = devm_reset_control_get(&pdev->dev, NULL);
843+
rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
844844
if (!IS_ERR(rst)) {
845845
reset_control_assert(rst);
846846
udelay(2);

sound/soc/stm/stm32_sai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int stm32_sai_probe(struct platform_device *pdev)
8585
}
8686

8787
/* reset */
88-
rst = reset_control_get(&pdev->dev, NULL);
88+
rst = reset_control_get_exclusive(&pdev->dev, NULL);
8989
if (!IS_ERR(rst)) {
9090
reset_control_assert(rst);
9191
udelay(2);

sound/soc/stm/stm32_spdifrx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
930930
return ret;
931931
}
932932

933-
rst = devm_reset_control_get(&pdev->dev, NULL);
933+
rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
934934
if (!IS_ERR(rst)) {
935935
reset_control_assert(rst);
936936
udelay(2);

sound/soc/sunxi/sun4i-codec.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = {
762762
{ "Mic1", NULL, "VMIC" },
763763
};
764764

765-
static struct snd_soc_codec_driver sun4i_codec_codec = {
765+
static const struct snd_soc_codec_driver sun4i_codec_codec = {
766766
.component_driver = {
767767
.controls = sun4i_codec_controls,
768768
.num_controls = ARRAY_SIZE(sun4i_codec_controls),
@@ -1068,7 +1068,7 @@ static const struct snd_soc_dapm_route sun6i_codec_codec_dapm_routes[] = {
10681068
{ "Right ADC", NULL, "Right ADC Mixer" },
10691069
};
10701070

1071-
static struct snd_soc_codec_driver sun6i_codec_codec = {
1071+
static const struct snd_soc_codec_driver sun6i_codec_codec = {
10721072
.component_driver = {
10731073
.controls = sun6i_codec_codec_widgets,
10741074
.num_controls = ARRAY_SIZE(sun6i_codec_codec_widgets),
@@ -1096,7 +1096,7 @@ static const struct snd_soc_dapm_widget sun8i_a23_codec_codec_widgets[] = {
10961096

10971097
};
10981098

1099-
static struct snd_soc_codec_driver sun8i_a23_codec_codec = {
1099+
static const struct snd_soc_codec_driver sun8i_a23_codec_codec = {
11001100
.component_driver = {
11011101
.controls = sun8i_a23_codec_codec_controls,
11021102
.num_controls = ARRAY_SIZE(sun8i_a23_codec_codec_controls),
@@ -1171,9 +1171,8 @@ static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
11711171
{
11721172
struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
11731173

1174-
if (scodec->gpio_pa)
1175-
gpiod_set_value_cansleep(scodec->gpio_pa,
1176-
!!SND_SOC_DAPM_EVENT_ON(event));
1174+
gpiod_set_value_cansleep(scodec->gpio_pa,
1175+
!!SND_SOC_DAPM_EVENT_ON(event));
11771176

11781177
return 0;
11791178
}
@@ -1574,7 +1573,8 @@ static int sun4i_codec_probe(struct platform_device *pdev)
15741573
}
15751574

15761575
if (quirks->has_reset) {
1577-
scodec->rst = devm_reset_control_get(&pdev->dev, NULL);
1576+
scodec->rst = devm_reset_control_get_exclusive(&pdev->dev,
1577+
NULL);
15781578
if (IS_ERR(scodec->rst)) {
15791579
dev_err(&pdev->dev, "Failed to get reset control\n");
15801580
return PTR_ERR(scodec->rst);
@@ -1655,7 +1655,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
16551655
goto err_unregister_codec;
16561656
}
16571657

1658-
platform_set_drvdata(pdev, card);
16591658
snd_soc_card_set_drvdata(card, scodec);
16601659

16611660
ret = snd_soc_register_card(card);

0 commit comments

Comments
 (0)