Skip to content

Commit f341378

Browse files
committed
Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/rcar' and 'asoc/topic/rockchip' into asoc-next
4 parents c704f4e + 65aca64 + 53ae918 + 46dd2e2 commit f341378

File tree

19 files changed

+504
-308
lines changed

19 files changed

+504
-308
lines changed

Documentation/devicetree/bindings/sound/omap-mcpdm.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Required properties:
88
- interrupts: Interrupt number for McPDM
99
- interrupt-parent: The parent interrupt controller
1010
- ti,hwmods: Name of the hwmod associated to the McPDM
11+
- clocks: phandle for the pdmclk provider, likely <&twl6040>
12+
- clock-names: Must be "pdmclk"
1113

1214
Example:
1315

@@ -19,3 +21,11 @@ mcpdm: mcpdm@40132000 {
1921
interrupt-parent = <&gic>;
2022
ti,hwmods = "mcpdm";
2123
};
24+
25+
In board DTS file the pdmclk needs to be added:
26+
27+
&mcpdm {
28+
clocks = <&twl6040>;
29+
clock-names = "pdmclk";
30+
status = "okay";
31+
};

Documentation/devicetree/bindings/sound/renesas,rsnd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ Optional properties:
373373
- #clock-cells : it must be 0 if your system has audio_clkout
374374
it must be 1 if your system has audio_clkout0/1/2/3
375375
- clock-frequency : for all audio_clkout0/1/2/3
376+
- clkout-lr-asynchronous : boolean property. it indicates that audio_clkoutn
377+
is asynchronizes with lr-clock.
376378

377379
SSI subnode properties:
378380
- interrupts : Should contain SSI interrupt for PIO transfer

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Required properties:
2323
- rockchip,playback-channels: max playback channels, if not set, 8 channels default.
2424
- rockchip,capture-channels: max capture channels, if not set, 2 channels default.
2525

26+
Required properties for controller which support multi channels
27+
playback/capture:
28+
29+
- rockchip,grf: the phandle of the syscon node for GRF register.
30+
2631
Example for rk3288 I2S controller:
2732

2833
i2s@ff890000 {

include/sound/simple_card.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,7 @@
1313
#define __SIMPLE_CARD_H
1414

1515
#include <sound/soc.h>
16-
17-
struct asoc_simple_dai {
18-
const char *name;
19-
unsigned int sysclk;
20-
int slots;
21-
int slot_width;
22-
unsigned int tx_slot_mask;
23-
unsigned int rx_slot_mask;
24-
struct clk *clk;
25-
};
16+
#include <sound/simple_card_utils.h>
2617

2718
struct asoc_simple_card_info {
2819
const char *name;

include/sound/simple_card_utils.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* simple_card_core.h
3+
*
4+
* Copyright (c) 2016 Kuninori Morimoto <[email protected]>
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation.
9+
*/
10+
#ifndef __SIMPLE_CARD_CORE_H
11+
#define __SIMPLE_CARD_CORE_H
12+
13+
#include <sound/soc.h>
14+
15+
struct asoc_simple_dai {
16+
const char *name;
17+
unsigned int sysclk;
18+
int slots;
19+
int slot_width;
20+
unsigned int tx_slot_mask;
21+
unsigned int rx_slot_mask;
22+
struct clk *clk;
23+
};
24+
25+
int asoc_simple_card_parse_daifmt(struct device *dev,
26+
struct device_node *node,
27+
struct device_node *codec,
28+
char *prefix,
29+
unsigned int *retfmt);
30+
int asoc_simple_card_set_dailink_name(struct device *dev,
31+
struct snd_soc_dai_link *dai_link,
32+
const char *fmt, ...);
33+
int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
34+
char *prefix);
35+
36+
#endif /* __SIMPLE_CARD_CORE_H */

sound/soc/generic/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
config SND_SIMPLE_CARD_UTILS
2+
tristate
3+
14
config SND_SIMPLE_CARD
25
tristate "ASoC Simple sound card support"
6+
select SND_SIMPLE_CARD_UTILS
37
help
48
This option enables generic simple sound card support

sound/soc/generic/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
obj-$(CONFIG_SND_SIMPLE_CARD_UTILS) := simple-card-utils.o
2+
13
snd-soc-simple-card-objs := simple-card.o
24

35
obj-$(CONFIG_SND_SIMPLE_CARD) += snd-soc-simple-card.o

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

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* simple-card-core.c
3+
*
4+
* Copyright (c) 2016 Kuninori Morimoto <[email protected]>
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation.
9+
*/
10+
#include <linux/of.h>
11+
#include <sound/simple_card_utils.h>
12+
13+
int asoc_simple_card_parse_daifmt(struct device *dev,
14+
struct device_node *node,
15+
struct device_node *codec,
16+
char *prefix,
17+
unsigned int *retfmt)
18+
{
19+
struct device_node *bitclkmaster = NULL;
20+
struct device_node *framemaster = NULL;
21+
int prefix_len = prefix ? strlen(prefix) : 0;
22+
unsigned int daifmt;
23+
24+
daifmt = snd_soc_of_parse_daifmt(node, prefix,
25+
&bitclkmaster, &framemaster);
26+
daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
27+
28+
if (prefix_len && !bitclkmaster && !framemaster) {
29+
/*
30+
* No dai-link level and master setting was not found from
31+
* sound node level, revert back to legacy DT parsing and
32+
* take the settings from codec node.
33+
*/
34+
dev_dbg(dev, "Revert to legacy daifmt parsing\n");
35+
36+
daifmt = snd_soc_of_parse_daifmt(codec, NULL, NULL, NULL) |
37+
(daifmt & ~SND_SOC_DAIFMT_CLOCK_MASK);
38+
} else {
39+
if (codec == bitclkmaster)
40+
daifmt |= (codec == framemaster) ?
41+
SND_SOC_DAIFMT_CBM_CFM : SND_SOC_DAIFMT_CBM_CFS;
42+
else
43+
daifmt |= (codec == framemaster) ?
44+
SND_SOC_DAIFMT_CBS_CFM : SND_SOC_DAIFMT_CBS_CFS;
45+
}
46+
47+
of_node_put(bitclkmaster);
48+
of_node_put(framemaster);
49+
50+
*retfmt = daifmt;
51+
52+
return 0;
53+
}
54+
EXPORT_SYMBOL_GPL(asoc_simple_card_parse_daifmt);
55+
56+
int asoc_simple_card_set_dailink_name(struct device *dev,
57+
struct snd_soc_dai_link *dai_link,
58+
const char *fmt, ...)
59+
{
60+
va_list ap;
61+
char *name = NULL;
62+
int ret = -ENOMEM;
63+
64+
va_start(ap, fmt);
65+
name = devm_kvasprintf(dev, GFP_KERNEL, fmt, ap);
66+
va_end(ap);
67+
68+
if (name) {
69+
ret = 0;
70+
71+
dai_link->name = name;
72+
dai_link->stream_name = name;
73+
}
74+
75+
return ret;
76+
}
77+
EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name);
78+
79+
int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
80+
char *prefix)
81+
{
82+
char prop[128];
83+
int ret;
84+
85+
snprintf(prop, sizeof(prop), "%sname", prefix);
86+
87+
/* Parse the card name from DT */
88+
ret = snd_soc_of_parse_card_name(card, prop);
89+
if (ret < 0)
90+
return ret;
91+
92+
if (!card->name && card->dai_link)
93+
card->name = card->dai_link->name;
94+
95+
return 0;
96+
}
97+
EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);

0 commit comments

Comments
 (0)