Skip to content

Commit 88f9206

Browse files
committed
Merge remote-tracking branches 'asoc/topic/s8', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/simple' and 'asoc/topic/sti' into asoc-next
6 parents c509c2f + dcc0799 + 09a0102 + 10ff080 + 5fb9cb1 + 05c1b44 commit 88f9206

10 files changed

Lines changed: 58 additions & 286 deletions

File tree

Documentation/devicetree/bindings/sound/samsung,odroidx2-max98090.txt

Lines changed: 0 additions & 35 deletions
This file was deleted.

Documentation/devicetree/bindings/sound/sgtl5000.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ Required properties:
77

88
- clocks : the clock provider of SYS_MCLK
99

10+
- VDDA-supply : the regulator provider of VDDA
11+
12+
- VDDIO-supply: the regulator provider of VDDIO
13+
14+
Optional properties:
15+
16+
- VDDD-supply : the regulator provider of VDDD
17+
1018
- micbias-resistor-k-ohms : the bias resistor to be used in kOmhs
1119
The resistor can take values of 2k, 4k or 8k.
1220
If set to 0 it will be off.
@@ -15,17 +23,9 @@ Required properties:
1523

1624
- micbias-voltage-m-volts : the bias voltage to be used in mVolts
1725
The voltage can take values from 1.25V to 3V by 250mV steps
18-
If this node is not mentionned or the value is unknown, then
26+
If this node is not mentioned or the value is unknown, then
1927
the value is set to 1.25V.
2028

21-
- VDDA-supply : the regulator provider of VDDA
22-
23-
- VDDIO-supply: the regulator provider of VDDIO
24-
25-
Optional properties:
26-
27-
- VDDD-supply : the regulator provider of VDDD
28-
2929
Example:
3030

3131
codec: sgtl5000@0a {

Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Required properties:
3333
"tx" for "st,sti-uni-player" compatibility
3434
"rx" for "st,sti-uni-reader" compatibility
3535

36-
- version: IP version integrated in SOC.
36+
- st,version: IP version integrated in SOC.
3737

3838
- dai-name: DAI name that describes the IP.
3939

40-
- IP mode: IP working mode depending on associated codec.
40+
- st,mode: IP working mode depending on associated codec.
4141
"HDMI" connected to HDMI codec and support IEC HDMI formats (player only).
4242
"SPDIF" connected to SPDIF codec and support SPDIF formats (player only).
4343
"PCM" PCM standard mode for I2S or TDM bus.
@@ -47,7 +47,7 @@ Required properties ("st,sti-uni-player" compatibility only):
4747
- clocks: CPU_DAI IP clock source, listed in the same order than the
4848
CPU_DAI properties.
4949

50-
- uniperiph-id: internal SOC IP instance ID.
50+
- st,uniperiph-id: internal SOC IP instance ID.
5151

5252
Optional properties:
5353
- pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
@@ -84,9 +84,9 @@ Example:
8484
dmas = <&fdma0 4 0 1>;
8585
dai-name = "Uni Player #2 (DAC)";
8686
dma-names = "tx";
87-
uniperiph-id = <2>;
88-
version = <5>;
89-
mode = "PCM";
87+
st,uniperiph-id = <2>;
88+
st,version = <5>;
89+
st,mode = "PCM";
9090
};
9191

9292
sti_uni_player3: sti-uni-player@3 {
@@ -100,9 +100,9 @@ Example:
100100
dmas = <&fdma0 7 0 1>;
101101
dma-names = "tx";
102102
dai-name = "Uni Player #3 (SPDIF)";
103-
uniperiph-id = <3>;
104-
version = <5>;
105-
mode = "SPDIF";
103+
st,uniperiph-id = <3>;
104+
st,version = <5>;
105+
st,mode = "SPDIF";
106106
};
107107

108108
sti_uni_reader1: sti-uni-reader@1 {
@@ -115,7 +115,7 @@ Example:
115115
dmas = <&fdma0 6 0 1>;
116116
dma-names = "rx";
117117
dai-name = "Uni Reader #1 (HDMI RX)";
118-
version = <3>;
118+
st,version = <3>;
119119
st,mode = "PCM";
120120
};
121121

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,6 @@ F: drivers/*/*/*s3c2410*
16031603
F: drivers/memory/samsung/*
16041604
F: drivers/soc/samsung/*
16051605
F: drivers/spi/spi-s3c*
1606-
F: sound/soc/samsung/*
16071606
F: Documentation/arm/Samsung/
16081607
F: Documentation/devicetree/bindings/arm/samsung/
16091608
F: Documentation/devicetree/bindings/sram/samsung-sram.txt
@@ -9884,7 +9883,9 @@ S: Maintained
98849883
F: drivers/platform/x86/samsung-laptop.c
98859884

98869885
SAMSUNG AUDIO (ASoC) DRIVERS
9886+
M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
98879887
M: Sangbeom Kim <sbkim73@samsung.com>
9888+
M: Sylwester Nawrocki <s.nawrocki@samsung.com>
98889889
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
98899890
S: Supported
98909891
F: sound/soc/samsung/

include/sound/soc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@
179179
.get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
180180
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
181181
xmin, xmax, xsign_bit, xinvert) }
182+
#define SOC_SINGLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
183+
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
184+
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
185+
SNDRV_CTL_ELEM_ACCESS_READWRITE, \
186+
.tlv.p = (tlv_array), \
187+
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
188+
.put = snd_soc_put_volsw, \
189+
.private_value = (unsigned long)&(struct soc_mixer_control) \
190+
{.reg = xreg, .rreg = xreg, \
191+
.min = xmin, .max = xmax, .platform_max = xmax, \
192+
.sign_bit = 7,} }
182193
#define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
183194
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
184195
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \

sound/soc/generic/simple-card.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
223223
u32 val;
224224
int ret;
225225

226+
if (!np)
227+
return 0;
228+
226229
/*
227230
* Get node via "sound-dai = <&phandle port>"
228231
* it will be used as xxx_of_node on soc_bind_dai_link()
@@ -238,9 +241,14 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
238241
*args_count = args.args_count;
239242

240243
/* Get dai->name */
241-
ret = snd_soc_of_get_dai_name(np, name);
242-
if (ret < 0)
243-
return ret;
244+
if (name) {
245+
ret = snd_soc_of_get_dai_name(np, name);
246+
if (ret < 0)
247+
return ret;
248+
}
249+
250+
if (!dai)
251+
return 0;
244252

245253
/* Parse TDM slot */
246254
ret = snd_soc_of_parse_tdm_slot(np, &dai->tx_slot_mask,
@@ -374,21 +382,20 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
374382
if (ret < 0)
375383
goto dai_link_of_err;
376384

385+
ret = asoc_simple_card_sub_parse_of(plat, NULL,
386+
&dai_link->platform_of_node,
387+
NULL, NULL);
388+
if (ret < 0)
389+
goto dai_link_of_err;
390+
377391
if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) {
378392
ret = -EINVAL;
379393
goto dai_link_of_err;
380394
}
381395

382-
if (plat) {
383-
struct of_phandle_args args;
384-
385-
ret = of_parse_phandle_with_args(plat, "sound-dai",
386-
"#sound-dai-cells", 0, &args);
387-
dai_link->platform_of_node = args.np;
388-
} else {
389-
/* Assumes platform == cpu */
396+
/* Assumes platform == cpu */
397+
if (!dai_link->platform_of_node)
390398
dai_link->platform_of_node = dai_link->cpu_of_node;
391-
}
392399

393400
/* DAI link name is created from CPU/CODEC dai name */
394401
name = devm_kzalloc(dev,

sound/soc/samsung/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,6 @@ config SND_SOC_SNOW
224224
Say Y if you want to add audio support for various Snow
225225
boards based on Exynos5 series of SoCs.
226226

227-
config SND_SOC_ODROIDX2
228-
tristate "Audio support for Odroid-X2 and Odroid-U3"
229-
depends on SND_SOC_SAMSUNG && I2C
230-
select SND_SOC_MAX98090
231-
select SND_SAMSUNG_I2S
232-
help
233-
Say Y here to enable audio support for the Odroid-X2/U3.
234-
235227
config SND_SOC_ARNDALE_RT5631_ALC5631
236228
tristate "Audio support for RT5631(ALC5631) on Arndale Board"
237229
depends on SND_SOC_SAMSUNG && I2C

sound/soc/samsung/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ snd-soc-tobermory-objs := tobermory.o
4343
snd-soc-lowland-objs := lowland.o
4444
snd-soc-littlemill-objs := littlemill.o
4545
snd-soc-bells-objs := bells.o
46-
snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o
4746
snd-soc-arndale-rt5631-objs := arndale_rt5631.o
4847

4948
obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
@@ -69,5 +68,4 @@ obj-$(CONFIG_SND_SOC_TOBERMORY) += snd-soc-tobermory.o
6968
obj-$(CONFIG_SND_SOC_LOWLAND) += snd-soc-lowland.o
7069
obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o
7170
obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o
72-
obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o
7371
obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o

sound/soc/samsung/i2s.c

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/io.h>
1919
#include <linux/module.h>
2020
#include <linux/of.h>
21+
#include <linux/of_device.h>
2122
#include <linux/of_gpio.h>
2223
#include <linux/pm_runtime.h>
2324

@@ -1106,21 +1107,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
11061107
return i2s;
11071108
}
11081109

1109-
static const struct of_device_id exynos_i2s_match[];
1110-
1111-
static inline const struct samsung_i2s_dai_data *samsung_i2s_get_driver_data(
1112-
struct platform_device *pdev)
1113-
{
1114-
if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
1115-
const struct of_device_id *match;
1116-
match = of_match_node(exynos_i2s_match, pdev->dev.of_node);
1117-
return match ? match->data : NULL;
1118-
} else {
1119-
return (struct samsung_i2s_dai_data *)
1120-
platform_get_device_id(pdev)->driver_data;
1121-
}
1122-
}
1123-
11241110
#ifdef CONFIG_PM
11251111
static int i2s_runtime_suspend(struct device *dev)
11261112
{
@@ -1233,9 +1219,13 @@ static int samsung_i2s_probe(struct platform_device *pdev)
12331219
const struct samsung_i2s_dai_data *i2s_dai_data;
12341220
int ret;
12351221

1236-
/* Call during Seconday interface registration */
1237-
i2s_dai_data = samsung_i2s_get_driver_data(pdev);
1222+
if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node)
1223+
i2s_dai_data = of_device_get_match_data(&pdev->dev);
1224+
else
1225+
i2s_dai_data = (struct samsung_i2s_dai_data *)
1226+
platform_get_device_id(pdev)->driver_data;
12381227

1228+
/* Call during the secondary interface registration */
12391229
if (i2s_dai_data->dai_type == TYPE_SEC) {
12401230
sec_dai = dev_get_drvdata(&pdev->dev);
12411231
if (!sec_dai) {
@@ -1477,10 +1467,6 @@ static const struct samsung_i2s_dai_data i2sv5_dai_type_i2s1 = {
14771467
.i2s_variant_regs = &i2sv5_i2s1_regs,
14781468
};
14791469

1480-
static const struct samsung_i2s_dai_data samsung_dai_type_pri = {
1481-
.dai_type = TYPE_PRI,
1482-
};
1483-
14841470
static const struct samsung_i2s_dai_data samsung_dai_type_sec = {
14851471
.dai_type = TYPE_SEC,
14861472
};
@@ -1492,9 +1478,6 @@ static const struct platform_device_id samsung_i2s_driver_ids[] = {
14921478
}, {
14931479
.name = "samsung-i2s-sec",
14941480
.driver_data = (kernel_ulong_t)&samsung_dai_type_sec,
1495-
}, {
1496-
.name = "samsung-i2sv4",
1497-
.driver_data = (kernel_ulong_t)&i2sv5_dai_type,
14981481
},
14991482
{},
15001483
};

0 commit comments

Comments
 (0)