treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / sound / soc / codecs / bt-sco.c
blob4d286844e3c832cc81ed182b8ce3b6aa815dd0b4
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Driver for generic Bluetooth SCO link
4 * Copyright 2011 Lars-Peter Clausen <lars@metafoo.de>
5 */
7 #include <linux/init.h>
8 #include <linux/module.h>
9 #include <linux/platform_device.h>
11 #include <sound/soc.h>
13 static const struct snd_soc_dapm_widget bt_sco_widgets[] = {
14 SND_SOC_DAPM_INPUT("RX"),
15 SND_SOC_DAPM_OUTPUT("TX"),
18 static const struct snd_soc_dapm_route bt_sco_routes[] = {
19 { "Capture", NULL, "RX" },
20 { "TX", NULL, "Playback" },
23 static struct snd_soc_dai_driver bt_sco_dai[] = {
25 .name = "bt-sco-pcm",
26 .playback = {
27 .stream_name = "Playback",
28 .channels_min = 1,
29 .channels_max = 1,
30 .rates = SNDRV_PCM_RATE_8000,
31 .formats = SNDRV_PCM_FMTBIT_S16_LE,
33 .capture = {
34 .stream_name = "Capture",
35 .channels_min = 1,
36 .channels_max = 1,
37 .rates = SNDRV_PCM_RATE_8000,
38 .formats = SNDRV_PCM_FMTBIT_S16_LE,
42 .name = "bt-sco-pcm-wb",
43 .playback = {
44 .stream_name = "Playback",
45 .channels_min = 1,
46 .channels_max = 1,
47 .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
48 .formats = SNDRV_PCM_FMTBIT_S16_LE,
50 .capture = {
51 .stream_name = "Capture",
52 .channels_min = 1,
53 .channels_max = 1,
54 .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
55 .formats = SNDRV_PCM_FMTBIT_S16_LE,
60 static const struct snd_soc_component_driver soc_component_dev_bt_sco = {
61 .dapm_widgets = bt_sco_widgets,
62 .num_dapm_widgets = ARRAY_SIZE(bt_sco_widgets),
63 .dapm_routes = bt_sco_routes,
64 .num_dapm_routes = ARRAY_SIZE(bt_sco_routes),
65 .idle_bias_on = 1,
66 .use_pmdown_time = 1,
67 .endianness = 1,
68 .non_legacy_dai_naming = 1,
71 static int bt_sco_probe(struct platform_device *pdev)
73 return devm_snd_soc_register_component(&pdev->dev,
74 &soc_component_dev_bt_sco,
75 bt_sco_dai, ARRAY_SIZE(bt_sco_dai));
78 static int bt_sco_remove(struct platform_device *pdev)
80 return 0;
83 static const struct platform_device_id bt_sco_driver_ids[] = {
85 .name = "dfbmcs320",
88 .name = "bt-sco",
90 {},
92 MODULE_DEVICE_TABLE(platform, bt_sco_driver_ids);
94 #if defined(CONFIG_OF)
95 static const struct of_device_id bt_sco_codec_of_match[] = {
96 { .compatible = "delta,dfbmcs320", },
97 { .compatible = "linux,bt-sco", },
98 {},
100 MODULE_DEVICE_TABLE(of, bt_sco_codec_of_match);
101 #endif
103 static struct platform_driver bt_sco_driver = {
104 .driver = {
105 .name = "bt-sco",
106 .of_match_table = of_match_ptr(bt_sco_codec_of_match),
108 .probe = bt_sco_probe,
109 .remove = bt_sco_remove,
110 .id_table = bt_sco_driver_ids,
113 module_platform_driver(bt_sco_driver);
115 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
116 MODULE_DESCRIPTION("ASoC generic bluetooth sco link driver");
117 MODULE_LICENSE("GPL");