mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: codecs: add Qualcomm Tambora (WCD9378) SDCA codec
Add support for the Qualcomm Tambora (WCD9378) headset codec in SDCA
mode over SoundWire. On ARM/DT platforms without ACPI/DisCo firmware
the SDCA topology and SoundWire port properties are supplied as static
data through the codec driver.
The codec exposes a single SimpleJack SDCA Function providing:
- Headphone playback via FU 6 (mute + Q7.8 volume) and OT 43/45.
- Headset mic capture via IT 33 with MICB2 bias at 2.75V.
- MBHC-based headset jack detection.
The driver enables the codec supplies, releases the reset GPIO, and
uses:
- sdw_slave_ops.read_prop to publish SoundWire slave properties and
dpn caps for the compute-mode dataports.
- sdca_class_ops.populate_function to hand the SDCA Function data
(entities, clusters, init_table) to the class driver from static
tables.
Binds SoundWire slave id 0x0217:0x0110 when qcom,sdca-compliant is
set on the DT node.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260925161049.758913-8-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
a36d24da5c
commit
0c30b8ca84
|
|
@ -2552,6 +2552,17 @@ config SND_SOC_WCD939X_SDW
|
|||
The WCD9390/9395 is a audio codec IC Integrated in
|
||||
Qualcomm SoCs like SM8650.
|
||||
|
||||
config SND_SOC_WCD9378_SDCA
|
||||
tristate "Qualcomm Tambora (WCD9378) SDCA codec"
|
||||
depends on SOUNDWIRE
|
||||
depends on SND_SOC_SDCA_CLASS
|
||||
help
|
||||
This enables support for the Qualcomm Tambora (WCD9378) headset
|
||||
codec when driven via the SDCA class driver on ARM platforms
|
||||
without ACPI/DisCo tables. It provides the static SDCA topology
|
||||
and SoundWire data port properties transcribed from the factory
|
||||
ACPI tables.
|
||||
|
||||
config SND_SOC_WM0010
|
||||
tristate
|
||||
depends on SPI_MASTER
|
||||
|
|
|
|||
|
|
@ -369,6 +369,7 @@ snd-soc-wcd938x-y := wcd938x.o
|
|||
snd-soc-wcd938x-sdw-y := wcd938x-sdw.o
|
||||
snd-soc-wcd939x-y := wcd939x.o
|
||||
snd-soc-wcd939x-sdw-y := wcd939x-sdw.o
|
||||
snd-soc-wcd9378-y := wcd9378-sdw.o wcd9378-sdca.o
|
||||
snd-soc-wm-adsp-y := wm_adsp.o
|
||||
snd-soc-wm-adsp-test-y := wm_adsp_fw_find_test.o
|
||||
snd-soc-wm0010-y := wm0010.o
|
||||
|
|
@ -825,6 +826,7 @@ ifdef CONFIG_SND_SOC_WCD939X_SDW
|
|||
# avoid link failure by forcing sdw code built-in when needed
|
||||
obj-$(CONFIG_SND_SOC_WCD939X) += snd-soc-wcd939x-sdw.o
|
||||
endif
|
||||
obj-$(CONFIG_SND_SOC_WCD9378_SDCA) += snd-soc-wcd9378.o
|
||||
obj-$(CONFIG_SND_SOC_WM0010) += snd-soc-wm0010.o
|
||||
obj-$(CONFIG_SND_SOC_WM1250_EV1) += snd-soc-wm1250-ev1.o
|
||||
obj-$(CONFIG_SND_SOC_WM2000) += snd-soc-wm2000.o
|
||||
|
|
|
|||
1080
sound/soc/codecs/wcd9378-sdca.c
Normal file
1080
sound/soc/codecs/wcd9378-sdca.c
Normal file
File diff suppressed because it is too large
Load Diff
20
sound/soc/codecs/wcd9378-sdca.h
Normal file
20
sound/soc/codecs/wcd9378-sdca.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
|
||||
/* Copyright (c) 2025 Qualcomm Technologies, Inc. */
|
||||
|
||||
#ifndef _WCD9378_SDCA_H
|
||||
#define _WCD9378_SDCA_H
|
||||
|
||||
#include <linux/soundwire/sdw.h>
|
||||
#include <linux/soundwire/sdw_type.h>
|
||||
|
||||
int wcd9378_sdca_probe(struct sdw_slave *slave,
|
||||
const struct sdw_device_id *id);
|
||||
void wcd9378_sdca_remove(struct sdw_slave *slave);
|
||||
int wcd9378_sdca_read_prop(struct sdw_slave *slave);
|
||||
|
||||
int wcd9378_sdca_runtime_suspend(struct device *dev);
|
||||
int wcd9378_sdca_runtime_resume(struct device *dev);
|
||||
int wcd9378_sdca_system_suspend(struct device *dev);
|
||||
int wcd9378_sdca_system_resume(struct device *dev);
|
||||
|
||||
#endif /* _WCD9378_SDCA_H */
|
||||
51
sound/soc/codecs/wcd9378-sdw.c
Normal file
51
sound/soc/codecs/wcd9378-sdw.c
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
|
||||
// Copyright (c) 2025 Qualcomm Technologies, Inc.
|
||||
|
||||
/*
|
||||
* WCD9378 (Tambora) SoundWire driver glue for the SDCA compute-mode
|
||||
* codec. The SDCA topology and hardware-specific probe logic live in
|
||||
* wcd9378-sdca.c; this file carries the SoundWire slave driver plumbing
|
||||
* and the module boilerplate.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/soundwire/sdw.h>
|
||||
#include <linux/soundwire/sdw_type.h>
|
||||
#include "wcd9378-sdca.h"
|
||||
|
||||
static const struct dev_pm_ops wcd9378_sdw_pm_ops = {
|
||||
SYSTEM_SLEEP_PM_OPS(wcd9378_sdca_system_suspend,
|
||||
wcd9378_sdca_system_resume)
|
||||
RUNTIME_PM_OPS(wcd9378_sdca_runtime_suspend,
|
||||
wcd9378_sdca_runtime_resume, NULL)
|
||||
};
|
||||
|
||||
static const struct sdw_slave_ops wcd9378_sdw_ops = {
|
||||
.read_prop = wcd9378_sdca_read_prop,
|
||||
};
|
||||
|
||||
static const struct sdw_device_id wcd9378_sdw_id[] = {
|
||||
SDW_SLAVE_ENTRY(0x0217, 0x0110, 0),
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(sdw, wcd9378_sdw_id);
|
||||
|
||||
static struct sdw_driver wcd9378_sdw_driver = {
|
||||
.driver = {
|
||||
.name = "wcd9378",
|
||||
.pm = pm_ptr(&wcd9378_sdw_pm_ops),
|
||||
},
|
||||
.probe = wcd9378_sdca_probe,
|
||||
.remove = wcd9378_sdca_remove,
|
||||
.id_table = wcd9378_sdw_id,
|
||||
.ops = &wcd9378_sdw_ops,
|
||||
};
|
||||
module_sdw_driver(wcd9378_sdw_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Qualcomm WCD9378 (Tambora) SoundWire codec");
|
||||
MODULE_AUTHOR("Qualcomm Technologies, Inc.");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
MODULE_IMPORT_NS("SND_SOC_SDCA");
|
||||
MODULE_IMPORT_NS("SND_SOC_SDCA_CLASS");
|
||||
Loading…
Reference in New Issue
Block a user