Skip to content

Commit 200ceb9

Browse files
21cnbaobroonie
authored andcommitted
ASoC: dfbmcs320: make the driver common for other BT modules
DFBM-CS320 is only one of bluetooth modules using CSR bluetooth chips, we don't want everyone to have a seperate codec driver. anyway, the feature of Bluetooth SCO is same on all platforms, so this patch makes the DFBM-CS320 driver become a common BT SCO link driver. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent c778879 commit 200ceb9

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

sound/soc/codecs/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ config SND_SOC_ALL_CODECS
4040
select SND_SOC_DA7213 if I2C
4141
select SND_SOC_DA732X if I2C
4242
select SND_SOC_DA9055 if I2C
43-
select SND_SOC_DFBMCS320
43+
select SND_SOC_BT_SCO
4444
select SND_SOC_ISABELLE if I2C
4545
select SND_SOC_JZ4740_CODEC
4646
select SND_SOC_LM4857 if I2C
@@ -263,7 +263,7 @@ config SND_SOC_DA732X
263263
config SND_SOC_DA9055
264264
tristate
265265

266-
config SND_SOC_DFBMCS320
266+
config SND_SOC_BT_SCO
267267
tristate
268268

269269
config SND_SOC_DMIC

sound/soc/codecs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ snd-soc-da7210-objs := da7210.o
2727
snd-soc-da7213-objs := da7213.o
2828
snd-soc-da732x-objs := da732x.o
2929
snd-soc-da9055-objs := da9055.o
30-
snd-soc-dfbmcs320-objs := dfbmcs320.o
30+
snd-soc-bt-sco-objs := bt-sco.o
3131
snd-soc-dmic-objs := dmic.o
3232
snd-soc-isabelle-objs := isabelle.o
3333
snd-soc-jz4740-codec-objs := jz4740.o
@@ -154,7 +154,7 @@ obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o
154154
obj-$(CONFIG_SND_SOC_DA7213) += snd-soc-da7213.o
155155
obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o
156156
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
157-
obj-$(CONFIG_SND_SOC_DFBMCS320) += snd-soc-dfbmcs320.o
157+
obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o
158158
obj-$(CONFIG_SND_SOC_DMIC) += snd-soc-dmic.o
159159
obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o
160160
obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o

sound/soc/codecs/dfbmcs320.c renamed to sound/soc/codecs/bt-sco.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Driver for the DFBM-CS320 bluetooth module
2+
* Driver for generic Bluetooth SCO link
33
* Copyright 2011 Lars-Peter Clausen <[email protected]>
44
*
55
* This program is free software; you can redistribute it and/or modify it
@@ -15,8 +15,8 @@
1515

1616
#include <sound/soc.h>
1717

18-
static struct snd_soc_dai_driver dfbmcs320_dai = {
19-
.name = "dfbmcs320-pcm",
18+
static struct snd_soc_dai_driver bt_sco_dai = {
19+
.name = "bt-sco-pcm",
2020
.playback = {
2121
.channels_min = 1,
2222
.channels_max = 1,
@@ -31,32 +31,41 @@ static struct snd_soc_dai_driver dfbmcs320_dai = {
3131
},
3232
};
3333

34-
static struct snd_soc_codec_driver soc_codec_dev_dfbmcs320;
34+
static struct snd_soc_codec_driver soc_codec_dev_bt_sco;
3535

36-
static int dfbmcs320_probe(struct platform_device *pdev)
36+
static int bt_sco_probe(struct platform_device *pdev)
3737
{
38-
return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_dfbmcs320,
39-
&dfbmcs320_dai, 1);
38+
return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_bt_sco,
39+
&bt_sco_dai, 1);
4040
}
4141

42-
static int dfbmcs320_remove(struct platform_device *pdev)
42+
static int bt_sco_remove(struct platform_device *pdev)
4343
{
4444
snd_soc_unregister_codec(&pdev->dev);
4545

4646
return 0;
4747
}
4848

49-
static struct platform_driver dfmcs320_driver = {
49+
static struct platform_device_id bt_sco_driver_ids[] = {
50+
{
51+
.name = "dfbmcs320",
52+
},
53+
{},
54+
};
55+
MODULE_DEVICE_TABLE(platform, bt_sco_driver_ids);
56+
57+
static struct platform_driver bt_sco_driver = {
5058
.driver = {
51-
.name = "dfbmcs320",
59+
.name = "bt-sco",
5260
.owner = THIS_MODULE,
5361
},
54-
.probe = dfbmcs320_probe,
55-
.remove = dfbmcs320_remove,
62+
.probe = bt_sco_probe,
63+
.remove = bt_sco_remove,
64+
.id_table = bt_sco_driver_ids,
5665
};
5766

58-
module_platform_driver(dfmcs320_driver);
67+
module_platform_driver(bt_sco_driver);
5968

6069
MODULE_AUTHOR("Lars-Peter Clausen <[email protected]>");
61-
MODULE_DESCRIPTION("ASoC DFBM-CS320 bluethooth module driver");
70+
MODULE_DESCRIPTION("ASoC generic bluethooth sco link driver");
6271
MODULE_LICENSE("GPL");

sound/soc/samsung/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ config SND_SOC_SAMSUNG_NEO1973_WM8753
3939
depends on SND_SOC_SAMSUNG && MACH_NEO1973_GTA02
4040
select SND_S3C24XX_I2S
4141
select SND_SOC_WM8753
42-
select SND_SOC_DFBMCS320
42+
select SND_SOC_SCO
4343
help
4444
Say Y here to enable audio support for the Openmoko Neo1973
4545
Smartphones.

sound/soc/samsung/neo1973_wm8753.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static struct snd_soc_dai_link neo1973_dai[] = {
373373
{ /* Voice via BT */
374374
.name = "Bluetooth",
375375
.stream_name = "Voice",
376-
.cpu_dai_name = "dfbmcs320-pcm",
376+
.cpu_dai_name = "bt-sco-pcm",
377377
.codec_dai_name = "wm8753-voice",
378378
.codec_name = "wm8753.0-001a",
379379
.ops = &neo1973_voice_ops,

0 commit comments

Comments
 (0)