[PATCH 5/8] ASoC: aw88399: add channel setter for HDA side codec

From: Marco Giunta

Date: Fri Jul 17 2026 - 09:31:39 EST


Add aw88399_dev_set_channel() to the shared library so that the HDA side
codec driver can set the amplifier's channel assignment without
including the aw88395 device header directly.

The AW88399's struct aw_device is defined in aw88395_device.h, which
lives under sound/soc/codecs/aw88395/. Without this accessor, the
HDA driver would need a cross-subsystem relative include path to
access the channel field. Providing a setter in the library keeps the
interface clean and avoids coupling the HDA driver to ASoC-internal
headers.

Tested-by: Nadim Kobeissi <nadim@symbolic.software>
Tested-by: Xia Yun'an <imitoy@xxxxxxxxxx>
Tested-by: Munzir Taha <munzirtaha@xxxxxxxxx>
Signed-off-by: Marco Giunta <marco_giunta@xxxxxxxxxx>
---
include/sound/aw88399.h | 1 +
sound/soc/codecs/aw88399-lib.c | 6 ++++++
2 files changed, 7 insertions(+)

diff --git a/include/sound/aw88399.h b/include/sound/aw88399.h
index 3dbc37dc13d1..a1e0de6be8ea 100644
--- a/include/sound/aw88399.h
+++ b/include/sound/aw88399.h
@@ -609,6 +609,7 @@ int aw_dev_set_volume(struct aw_device *aw_dev, unsigned int value);
int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc);
int aw88399_dev_get_prof_name(struct aw_device *aw_dev, int index, char **prof_name);
void aw88399_dev_mute(struct aw_device *aw_dev, bool is_mute);
+void aw88399_dev_set_channel(struct aw88399 *aw88399, int channel);
void aw88399_hw_reset(struct aw88399 *aw88399);
int aw88399_init(struct aw88399 *aw88399, struct i2c_client *i2c, struct regmap *regmap);
extern const struct regmap_config aw88399_remap_config;
diff --git a/sound/soc/codecs/aw88399-lib.c b/sound/soc/codecs/aw88399-lib.c
index 094a37b66fb5..5c7982891def 100644
--- a/sound/soc/codecs/aw88399-lib.c
+++ b/sound/soc/codecs/aw88399-lib.c
@@ -1401,5 +1401,11 @@ int aw88399_init(struct aw88399 *aw88399, struct i2c_client *i2c, struct regmap
}
EXPORT_SYMBOL_GPL(aw88399_init);

+void aw88399_dev_set_channel(struct aw88399 *aw88399, int channel)
+{
+ aw88399->aw_pa->channel = channel;
+}
+EXPORT_SYMBOL_GPL(aw88399_dev_set_channel);
+
MODULE_DESCRIPTION("AW88399 common device library");
MODULE_LICENSE("GPL");
--
2.55.0