* [PATCH v2 0/3] ASoC: Update rtq9128 document and source file
@ 2026-01-12 1:27 cy_huang
2026-01-12 1:27 ` [PATCH v2 1/3] ASoC: codecs: rtq9128: Modify the chip initial setting cy_huang
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: cy_huang @ 2026-01-12 1:27 UTC (permalink / raw)
To: Mark Brown, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Liam Girdwood, ChiYuan Huang,
musk_wang, roy_chiu, allen_lin, devicetree, linux-sound,
linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
This patch series include two parts
- Update initial setting for rtq9128 specific feature
- Add rtq9154 backward compatible with rtq9128
v2
- Fix commit message typo
ChiYuan Huang (3):
ASoC: codecs: rtq9128: Modify the chip initial setting
dt-bindings: sound: rtq9128: Add rtq9154 backward compatible
ASoC: codecs: rtq9128: Add compatible changes for rtq9154
.../bindings/sound/richtek,rtq9128.yaml | 12 +-
sound/soc/codecs/rtq9128.c | 114 ++++++++++++++++--
2 files changed, 117 insertions(+), 9 deletions(-)
base-commit: f0b9d8eb98dfee8d00419aa07543bdc2c1a44fb1
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] ASoC: codecs: rtq9128: Modify the chip initial setting
2026-01-12 1:27 [PATCH v2 0/3] ASoC: Update rtq9128 document and source file cy_huang
@ 2026-01-12 1:27 ` cy_huang
2026-01-12 1:27 ` [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible cy_huang
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: cy_huang @ 2026-01-12 1:27 UTC (permalink / raw)
To: Mark Brown, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Liam Girdwood, ChiYuan Huang,
musk_wang, roy_chiu, allen_lin, devicetree, linux-sound,
linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
Modify the chip initial setting to default enable DC load detection
function. This function is the chip specific feature that can detect
the output open/short.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
sound/soc/codecs/rtq9128.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c
index 391cc03d687f..289bb3c04a90 100644
--- a/sound/soc/codecs/rtq9128.c
+++ b/sound/soc/codecs/rtq9128.c
@@ -352,7 +352,7 @@ static const struct snd_soc_dapm_route rtq9128_dapm_routes[] = {
static const struct rtq9128_init_reg rtq9128_tka470b_tables[] = {
{ 0xA0, 0xEF },
{ 0x0D, 0x00 },
- { 0x03, 0x05 },
+ { 0x03, 0x45 },
{ 0x05, 0x31 },
{ 0x06, 0x23 },
{ 0x70, 0x11 },
@@ -367,7 +367,7 @@ static const struct rtq9128_init_reg rtq9128_tka470b_tables[] = {
static const struct rtq9128_init_reg rtq9128_dh_tables[] = {
{ 0x0F, 0x00 },
- { 0x03, 0x0D },
+ { 0x03, 0x4D },
{ 0xB2, 0xFF },
{ 0xB3, 0xFF },
{ 0x30, 0x180 },
@@ -378,7 +378,7 @@ static const struct rtq9128_init_reg rtq9128_dh_tables[] = {
static const struct rtq9128_init_reg rtq9128_dl_tables[] = {
{ 0x0F, 0x00 },
- { 0x03, 0x0D },
+ { 0x03, 0x4D },
{ 0x30, 0x180 },
{ 0x8A, 0x55 },
{ 0x72, 0x00 },
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible
2026-01-12 1:27 [PATCH v2 0/3] ASoC: Update rtq9128 document and source file cy_huang
2026-01-12 1:27 ` [PATCH v2 1/3] ASoC: codecs: rtq9128: Modify the chip initial setting cy_huang
@ 2026-01-12 1:27 ` cy_huang
2026-01-12 14:31 ` Mark Brown
2026-01-12 1:27 ` [PATCH v2 3/3] ASoC: codecs: rtq9128: Add compatible changes for rtq9154 cy_huang
2026-01-13 13:50 ` [PATCH v2 0/3] ASoC: Update rtq9128 document and source file Mark Brown
3 siblings, 1 reply; 6+ messages in thread
From: cy_huang @ 2026-01-12 1:27 UTC (permalink / raw)
To: Mark Brown, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Liam Girdwood, ChiYuan Huang,
musk_wang, roy_chiu, allen_lin, devicetree, linux-sound,
linux-kernel, Krzysztof Kozlowski
From: ChiYuan Huang <cy_huang@richtek.com>
Add rtq9154 backward compatible support.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
v2
- Fix commit message typo
---
.../devicetree/bindings/sound/richtek,rtq9128.yaml | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml b/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml
index d54686a19ab7..a125663988a5 100644
--- a/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml
+++ b/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml
@@ -14,13 +14,21 @@ description:
class-D audio power amplifier and delivering 4x75W into 4OHm at 10%
THD+N from a 25V supply in automotive applications.
+ The RTQ9154 is the family series of RTQ9128. The major change is to modify
+ the package size. Beside this, whole functions are almost all the same.
+
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
- enum:
- - richtek,rtq9128
+ oneOf:
+ - enum:
+ - richtek,rtq9128
+ - items:
+ - enum:
+ - richtek,rtq9154
+ - const: richtek,rtq9128
reg:
maxItems: 1
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] ASoC: codecs: rtq9128: Add compatible changes for rtq9154
2026-01-12 1:27 [PATCH v2 0/3] ASoC: Update rtq9128 document and source file cy_huang
2026-01-12 1:27 ` [PATCH v2 1/3] ASoC: codecs: rtq9128: Modify the chip initial setting cy_huang
2026-01-12 1:27 ` [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible cy_huang
@ 2026-01-12 1:27 ` cy_huang
2026-01-13 13:50 ` [PATCH v2 0/3] ASoC: Update rtq9128 document and source file Mark Brown
3 siblings, 0 replies; 6+ messages in thread
From: cy_huang @ 2026-01-12 1:27 UTC (permalink / raw)
To: Mark Brown, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Liam Girdwood, ChiYuan Huang,
musk_wang, roy_chiu, allen_lin, devicetree, linux-sound,
linux-kernel
From: ChiYuan Huang <cy_huang@richtek.com>
Although rtq9154 only modify the outter package, some register settings
related to the channel order definition are still different. Use the chip
model ID code to seperate these changes.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
sound/soc/codecs/rtq9128.c | 108 +++++++++++++++++++++++++++++++++++--
1 file changed, 104 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c
index 289bb3c04a90..14a2c0723d33 100644
--- a/sound/soc/codecs/rtq9128.c
+++ b/sound/soc/codecs/rtq9128.c
@@ -40,6 +40,12 @@
#define RTQ9128_REG_EFUSE_DATA 0xE0
#define RTQ9128_REG_VENDOR_ID 0xF9
+#define RTQ9154_REG_CH1_VOL 0x34
+#define RTQ9154_REG_CH2_VOL 0x33
+#define RTQ9154_REG_CH3_VOL 0x32
+#define RTQ9154_REG_CH4_VOL 0x31
+#define RTQ9154_REG_AUTOULQM 0xAD
+
#define RTQ9128_CHSTAT_VAL_MASK GENMASK(1, 0)
#define RTQ9128_DOLEN_MASK GENMASK(7, 6)
#define RTQ9128_TDMSRCIN_MASK GENMASK(5, 4)
@@ -48,6 +54,7 @@
#define RTQ9128_MSMUTE_MASK BIT(0)
#define RTQ9128_DIE_CHECK_MASK GENMASK(4, 0)
#define RTQ9128_VENDOR_ID_MASK GENMASK(19, 8)
+#define RTQ9128_MODEL_ID_MASK GENMASK(7, 4)
#define RTQ9128_SOFT_RESET_VAL 0x80
#define RTQ9128_VENDOR_ID_VAL 0x470
@@ -56,6 +63,15 @@
#define RTQ9128_TKA470B_VAL 0
#define RTQ9128_RTQ9128DH_VAL 0x0F
#define RTQ9128_RTQ9128DL_VAL 0x10
+#define RTQ9154_MODEL_ID 0x08
+
+#define RTQ9154_AUTOULQM_VAL 0x82
+
+enum rtq9128_chip_model {
+ CHIP_MODEL_RTQ9128 = 0,
+ CHIP_MODEL_RTQ9154,
+ CHIP_MODEL_MAX
+};
struct rtq9128_data {
struct gpio_desc *enable;
@@ -63,6 +79,7 @@ struct rtq9128_data {
int tdm_slots;
int tdm_slot_width;
bool tdm_input_data2_select;
+ enum rtq9128_chip_model chip_model;
};
struct rtq9128_init_reg {
@@ -251,6 +268,28 @@ static const struct soc_enum rtq9128_out4_phase_enum =
SOC_ENUM_SINGLE(RTQ9128_REG_PLLTRI_GEN2, 0, ARRAY_SIZE(phase_select_text),
phase_select_text);
+static const struct soc_enum rtq9154_ch1_si_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDI_SEL, 0, ARRAY_SIZE(source_select_text),
+ source_select_text);
+static const struct soc_enum rtq9154_ch2_si_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDI_SEL, 2, ARRAY_SIZE(source_select_text),
+ source_select_text);
+static const struct soc_enum rtq9154_ch3_si_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDI_SEL, 4, ARRAY_SIZE(source_select_text),
+ source_select_text);
+static const struct soc_enum rtq9154_ch4_si_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDI_SEL, 6, ARRAY_SIZE(source_select_text),
+ source_select_text);
+static const struct soc_enum rtq9154_out1_phase_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_PLLTRI_GEN2, 0, ARRAY_SIZE(phase_select_text),
+ phase_select_text);
+static const struct soc_enum rtq9154_out2_phase_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_PLLTRI_GEN2, 4, ARRAY_SIZE(phase_select_text),
+ phase_select_text);
+static const struct soc_enum rtq9154_out3_phase_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_PLLTRI_GEN1, 0, ARRAY_SIZE(phase_select_text),
+ phase_select_text);
+
/*
* In general usage, DVDD could be 1P8V, 3P0V or 3P3V.
* This DVDD undervoltage protection is to prevent from the abnormal power
@@ -283,10 +322,33 @@ static const struct snd_kcontrol_new rtq9128_snd_ctrls[] = {
SOC_ENUM("DVDD UV Threshold Select", rtq9128_dvdduv_select_enum),
};
+static const struct snd_kcontrol_new rtq9154_snd_ctrls[] = {
+ SOC_SINGLE_TLV("MS Volume", RTQ9128_REG_MS_VOL, 2, 511, 1, dig_tlv),
+ SOC_SINGLE_TLV("CH1 Volume", RTQ9154_REG_CH1_VOL, 2, 511, 1, dig_tlv),
+ SOC_SINGLE_TLV("CH2 Volume", RTQ9154_REG_CH2_VOL, 2, 511, 1, dig_tlv),
+ SOC_SINGLE_TLV("CH3 Volume", RTQ9154_REG_CH3_VOL, 2, 511, 1, dig_tlv),
+ SOC_SINGLE_TLV("CH4 Volume", RTQ9154_REG_CH4_VOL, 2, 511, 1, dig_tlv),
+ SOC_SINGLE_TLV("SPK Gain Volume", RTQ9128_REG_MISC, 0, 5, 0, spkgain_tlv),
+ SOC_SINGLE("PBTL12 Switch", RTQ9128_REG_MISC, 4, 1, 0),
+ SOC_SINGLE("PBTL34 Switch", RTQ9128_REG_MISC, 5, 1, 0),
+ SOC_SINGLE("Spread Spectrum Switch", RTQ9128_REG_PWM_SS_OPT, 7, 1, 0),
+ SOC_SINGLE("SDO Select", RTQ9128_REG_SDO_SEL, 0, 15, 0),
+ SOC_ENUM("CH1 SI Select", rtq9154_ch1_si_enum),
+ SOC_ENUM("CH2 SI Select", rtq9154_ch2_si_enum),
+ SOC_ENUM("CH3 SI Select", rtq9154_ch3_si_enum),
+ SOC_ENUM("CH4 SI Select", rtq9154_ch4_si_enum),
+ SOC_ENUM("PWM FREQ Select", rtq9128_pwm_freq_enum),
+ SOC_ENUM("OUT1 Phase Select", rtq9154_out1_phase_enum),
+ SOC_ENUM("OUT2 Phase Select", rtq9154_out2_phase_enum),
+ SOC_ENUM("OUT3 Phase Select", rtq9154_out3_phase_enum),
+ SOC_ENUM("DVDD UV Threshold Select", rtq9128_dvdduv_select_enum),
+};
+
static int rtq9128_dac_power_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
int event)
{
struct snd_soc_component *comp = snd_soc_dapm_to_component(w->dapm);
+ struct rtq9128_data *data = snd_soc_component_get_drvdata(comp);
unsigned int shift, mask;
int ret;
@@ -301,6 +363,10 @@ static int rtq9128_dac_power_event(struct snd_soc_dapm_widget *w, struct snd_kco
else
shift = 0;
+ /* Compared to RTQ9128, RTQ9154 use the reverse order for DACx bitfield location */
+ if (data->chip_model == CHIP_MODEL_RTQ9154)
+ shift = 6 - shift;
+
mask = RTQ9128_CHSTAT_VAL_MASK << shift;
/* Turn channel state to Normal or HiZ */
@@ -387,6 +453,7 @@ static const struct rtq9128_init_reg rtq9128_dl_tables[] = {
static int rtq9128_component_probe(struct snd_soc_component *comp)
{
+ struct rtq9128_data *data = snd_soc_component_get_drvdata(comp);
const struct rtq9128_init_reg *table, *curr;
size_t table_size;
unsigned int val;
@@ -421,6 +488,14 @@ static int rtq9128_component_probe(struct snd_soc_component *comp)
return ret;
}
+
+ if (data->chip_model == CHIP_MODEL_RTQ9154) {
+ /* Enable RTQ9154 Specific AUTO ULQM feature */
+ ret = snd_soc_component_write(comp, RTQ9154_REG_AUTOULQM, RTQ9154_AUTOULQM_VAL);
+ if (ret < 0)
+ return ret;
+ }
+
pm_runtime_mark_last_busy(comp->dev);
pm_runtime_put(comp->dev);
@@ -439,6 +514,18 @@ static const struct snd_soc_component_driver rtq9128_comp_driver = {
.endianness = 1,
};
+static const struct snd_soc_component_driver rtq9154_comp_driver = {
+ .probe = rtq9128_component_probe,
+ .controls = rtq9154_snd_ctrls,
+ .num_controls = ARRAY_SIZE(rtq9154_snd_ctrls),
+ .dapm_widgets = rtq9128_dapm_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(rtq9128_dapm_widgets),
+ .dapm_routes = rtq9128_dapm_routes,
+ .num_dapm_routes = ARRAY_SIZE(rtq9128_dapm_routes),
+ .use_pmdown_time = 1,
+ .endianness = 1,
+};
+
static int rtq9128_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
struct rtq9128_data *data = snd_soc_dai_get_drvdata(dai);
@@ -679,7 +766,8 @@ static int rtq9128_probe(struct i2c_client *i2c)
struct device *dev = &i2c->dev;
struct rtq9128_data *data;
struct regmap *regmap;
- unsigned int venid;
+ unsigned int veninfo, venid, chip_model;
+ const struct snd_soc_component_driver *comp_drv;
int ret;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -712,21 +800,33 @@ static int rtq9128_probe(struct i2c_client *i2c)
if (IS_ERR(regmap))
return dev_err_probe(dev, PTR_ERR(regmap), "Failed to init regmap\n");
- ret = regmap_read(regmap, RTQ9128_REG_VENDOR_ID, &venid);
+ ret = regmap_read(regmap, RTQ9128_REG_VENDOR_ID, &veninfo);
if (ret)
return dev_err_probe(dev, ret, "Failed to get vendor id\n");
- venid = FIELD_GET(RTQ9128_VENDOR_ID_MASK, venid);
+ venid = FIELD_GET(RTQ9128_VENDOR_ID_MASK, veninfo);
if (venid != RTQ9128_VENDOR_ID_VAL)
return dev_err_probe(dev, -ENODEV, "Vendor ID not match (0x%x)\n", venid);
+ chip_model = FIELD_GET(RTQ9128_MODEL_ID_MASK, veninfo);
+ switch (chip_model) {
+ case RTQ9154_MODEL_ID:
+ data->chip_model = CHIP_MODEL_RTQ9154;
+ comp_drv = &rtq9154_comp_driver;
+ break;
+ default:
+ data->chip_model = CHIP_MODEL_RTQ9128;
+ comp_drv = &rtq9128_comp_driver;
+ break;
+ }
+
pm_runtime_set_active(dev);
pm_runtime_mark_last_busy(dev);
ret = devm_pm_runtime_enable(dev);
if (ret)
return dev_err_probe(dev, ret, "Failed to enable pm runtime\n");
- return devm_snd_soc_register_component(dev, &rtq9128_comp_driver, &rtq9128_dai, 1);
+ return devm_snd_soc_register_component(dev, comp_drv, &rtq9128_dai, 1);
}
static int rtq9128_pm_runtime_suspend(struct device *dev)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible
2026-01-12 1:27 ` [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible cy_huang
@ 2026-01-12 14:31 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-01-12 14:31 UTC (permalink / raw)
To: cy_huang
Cc: Krzysztof Kozlowski, Rob Herring, Conor Dooley, Liam Girdwood,
musk_wang, roy_chiu, allen_lin, devicetree, linux-sound,
linux-kernel, Krzysztof Kozlowski
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
On Mon, Jan 12, 2026 at 09:27:33AM +0800, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
>
> Add rtq9154 backward compatible support.
Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/3] ASoC: Update rtq9128 document and source file
2026-01-12 1:27 [PATCH v2 0/3] ASoC: Update rtq9128 document and source file cy_huang
` (2 preceding siblings ...)
2026-01-12 1:27 ` [PATCH v2 3/3] ASoC: codecs: rtq9128: Add compatible changes for rtq9154 cy_huang
@ 2026-01-13 13:50 ` Mark Brown
3 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2026-01-13 13:50 UTC (permalink / raw)
To: Krzysztof Kozlowski, cy_huang
Cc: Rob Herring, Conor Dooley, Liam Girdwood, musk_wang, roy_chiu,
allen_lin, devicetree, linux-sound, linux-kernel
On Mon, 12 Jan 2026 09:27:31 +0800, cy_huang@richtek.com wrote:
> This patch series include two parts
> - Update initial setting for rtq9128 specific feature
> - Add rtq9154 backward compatible with rtq9128
>
> v2
> - Fix commit message typo
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: codecs: rtq9128: Modify the chip initial setting
commit: daf86dcdbb40c4a0e4b8e579c6eecf148560711f
[2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible
commit: b7d53fe53cb57db1ca5743d2ac2db28140c37647
[3/3] ASoC: codecs: rtq9128: Add compatible changes for rtq9154
commit: 6be9ea62afedef0f976eb3dba4c117be0c1d3809
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-13 13:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-12 1:27 [PATCH v2 0/3] ASoC: Update rtq9128 document and source file cy_huang
2026-01-12 1:27 ` [PATCH v2 1/3] ASoC: codecs: rtq9128: Modify the chip initial setting cy_huang
2026-01-12 1:27 ` [PATCH v2 2/3] dt-bindings: sound: rtq9128: Add rtq9154 backward compatible cy_huang
2026-01-12 14:31 ` Mark Brown
2026-01-12 1:27 ` [PATCH v2 3/3] ASoC: codecs: rtq9128: Add compatible changes for rtq9154 cy_huang
2026-01-13 13:50 ` [PATCH v2 0/3] ASoC: Update rtq9128 document and source file Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox