Skip to content

Commit 5947e1b

Browse files
Garlic Tsengbroonie
authored andcommitted
ASoC: bt-sco: extend rate and add a general compatible string
Add supports for 16k (wideband BT) and add a general compatible string "linux,bt-sco" Signed-off-by: Garlic Tseng <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 8b0b50d commit 5947e1b

File tree

2 files changed

+37
-17
lines changed

2 files changed

+37
-17
lines changed

Documentation/devicetree/bindings/sound/bt-sco.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This device support generic Bluetooth SCO link.
44

55
Required properties:
66

7-
- compatible : "delta,dfbmcs320"
7+
- compatible : "delta,dfbmcs320" or "linux,bt-sco"
88

99
Example:
1010

sound/soc/codecs/bt-sco.c

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,41 @@ static const struct snd_soc_dapm_route bt_sco_routes[] = {
2525
{ "TX", NULL, "Playback" },
2626
};
2727

28-
static struct snd_soc_dai_driver bt_sco_dai = {
29-
.name = "bt-sco-pcm",
30-
.playback = {
31-
.stream_name = "Playback",
32-
.channels_min = 1,
33-
.channels_max = 1,
34-
.rates = SNDRV_PCM_RATE_8000,
35-
.formats = SNDRV_PCM_FMTBIT_S16_LE,
36-
},
37-
.capture = {
38-
.stream_name = "Capture",
39-
.channels_min = 1,
40-
.channels_max = 1,
41-
.rates = SNDRV_PCM_RATE_8000,
42-
.formats = SNDRV_PCM_FMTBIT_S16_LE,
28+
static struct snd_soc_dai_driver bt_sco_dai[] = {
29+
{
30+
.name = "bt-sco-pcm",
31+
.playback = {
32+
.stream_name = "Playback",
33+
.channels_min = 1,
34+
.channels_max = 1,
35+
.rates = SNDRV_PCM_RATE_8000,
36+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
37+
},
38+
.capture = {
39+
.stream_name = "Capture",
40+
.channels_min = 1,
41+
.channels_max = 1,
42+
.rates = SNDRV_PCM_RATE_8000,
43+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
44+
},
4345
},
46+
{
47+
.name = "bt-sco-pcm-wb",
48+
.playback = {
49+
.stream_name = "Playback",
50+
.channels_min = 1,
51+
.channels_max = 1,
52+
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
53+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
54+
},
55+
.capture = {
56+
.stream_name = "Capture",
57+
.channels_min = 1,
58+
.channels_max = 1,
59+
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
60+
.formats = SNDRV_PCM_FMTBIT_S16_LE,
61+
},
62+
}
4463
};
4564

4665
static struct snd_soc_codec_driver soc_codec_dev_bt_sco = {
@@ -53,7 +72,7 @@ static struct snd_soc_codec_driver soc_codec_dev_bt_sco = {
5372
static int bt_sco_probe(struct platform_device *pdev)
5473
{
5574
return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_bt_sco,
56-
&bt_sco_dai, 1);
75+
bt_sco_dai, ARRAY_SIZE(bt_sco_dai));
5776
}
5877

5978
static int bt_sco_remove(struct platform_device *pdev)
@@ -77,6 +96,7 @@ MODULE_DEVICE_TABLE(platform, bt_sco_driver_ids);
7796
#if defined(CONFIG_OF)
7897
static const struct of_device_id bt_sco_codec_of_match[] = {
7998
{ .compatible = "delta,dfbmcs320", },
99+
{ .compatible = "linux,bt-sco", },
80100
{},
81101
};
82102
MODULE_DEVICE_TABLE(of, bt_sco_codec_of_match);

0 commit comments

Comments
 (0)