From nobody Wed Dec 17 09:45:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EF0CCE7AF9 for ; Thu, 28 Sep 2023 03:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjI1Dlo (ORCPT ); Wed, 27 Sep 2023 23:41:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229987AbjI1Dll (ORCPT ); Wed, 27 Sep 2023 23:41:41 -0400 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECADC11F; Wed, 27 Sep 2023 20:41:37 -0700 (PDT) X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTPS Server V6.0(1978106:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Thu, 28 Sep 2023 11:41:10 +0800 (CST) Received: from ex3.rt.l (192.168.10.46) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Thu, 28 Sep 2023 11:41:09 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex3.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Thu, 28 Sep 2023 11:41:09 +0800 From: To: Mark Brown , Krzysztof Kozlowski CC: Conor Dooley , Rob Herring , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , ChiYuan Huang , Allen Lin , , , Subject: [PATCH 1/2] ASoC: dt-bindings: rtq9128: Add TDM input source slect property Date: Thu, 28 Sep 2023 11:41:07 +0800 Message-ID: <1695872468-24433-2-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695872468-24433-1-git-send-email-cy_huang@richtek.com> References: <1695872468-24433-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: ChiYuan Huang Create a boolean property to select TDM input source coms from 'DATA2'. Signed-off-by: ChiYuan Huang --- .../devicetree/bindings/sound/richtek,rtq9128.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml b= /Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml index d117f08fff30..d54686a19ab7 100644 --- a/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml +++ b/Documentation/devicetree/bindings/sound/richtek,rtq9128.yaml @@ -28,6 +28,13 @@ properties: enable-gpios: maxItems: 1 =20 + richtek,tdm-input-data2-select: + type: boolean + description: + By default, if TDM mode is used, TDM data input will select 'DATA1' = pin + as the data source. This option will configure TDM data input source= from + 'DATA1' to 'DATA2' pin. + '#sound-dai-cells': const: 0 =20 --=20 2.34.1 From nobody Wed Dec 17 09:45:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DA7CCE7AF9 for ; Thu, 28 Sep 2023 03:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjI1Dls (ORCPT ); Wed, 27 Sep 2023 23:41:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbjI1Dll (ORCPT ); Wed, 27 Sep 2023 23:41:41 -0400 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBDB110A; Wed, 27 Sep 2023 20:41:37 -0700 (PDT) X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTPS Server V6.0(1978095:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Thu, 28 Sep 2023 11:41:10 +0800 (CST) Received: from ex3.rt.l (192.168.10.46) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Thu, 28 Sep 2023 11:41:10 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex3.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Thu, 28 Sep 2023 11:41:10 +0800 From: To: Mark Brown , Krzysztof Kozlowski CC: Conor Dooley , Rob Herring , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , ChiYuan Huang , Allen Lin , , , Subject: [PATCH 2/2] ASoC: codecs: rtq9128: Add TDM input source select Date: Thu, 28 Sep 2023 11:41:08 +0800 Message-ID: <1695872468-24433-3-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695872468-24433-1-git-send-email-cy_huang@richtek.com> References: <1695872468-24433-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: ChiYuan Huang Pase the property to decide the TDM input source comes from 'DATA1' or 'DATA2 pin. Signed-off-by: ChiYuan Huang --- sound/soc/codecs/rtq9128.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c index 926b79ed8078..371d622c6214 100644 --- a/sound/soc/codecs/rtq9128.c +++ b/sound/soc/codecs/rtq9128.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ =20 #define RTQ9128_CHSTAT_VAL_MASK GENMASK(1, 0) #define RTQ9128_DOLEN_MASK GENMASK(7, 6) +#define RTQ9128_TDMSRCIN_MASK GENMASK(5, 4) #define RTQ9128_AUDBIT_MASK GENMASK(5, 4) #define RTQ9128_AUDFMT_MASK GENMASK(3, 0) #define RTQ9128_MSMUTE_MASK BIT(0) @@ -59,6 +61,7 @@ struct rtq9128_data { struct gpio_desc *enable; int tdm_slots; int tdm_slot_width; + bool tdm_input_data2_select; }; =20 struct rtq9128_init_reg { @@ -484,7 +487,7 @@ static int rtq9128_dai_set_tdm_slot(struct snd_soc_dai = *dai, unsigned int tx_mas struct rtq9128_data *data =3D snd_soc_dai_get_drvdata(dai); struct snd_soc_component *comp =3D dai->component; struct device *dev =3D dai->dev; - unsigned int mask, start_loc; + unsigned int mask, start_loc, srcin_select; int i, frame_length, ret; =20 dev_dbg(dev, "%s: slot %d slot_width %d, tx/rx mask 0x%x 0x%x\n", __func_= _, slots, @@ -530,6 +533,14 @@ static int rtq9128_dai_set_tdm_slot(struct snd_soc_dai= *dai, unsigned int tx_mas } } =20 + srcin_select =3D data->tdm_input_data2_select ? RTQ9128_TDMSRCIN_MASK : 0; + ret =3D snd_soc_component_update_bits(comp, RTQ9128_REG_SDO_SEL, RTQ9128_= TDMSRCIN_MASK, + srcin_select); + if (ret < 0) { + dev_err(dev, "Failed to configure TDM source input select\n"); + return ret; + } + data->tdm_slots =3D slots; data->tdm_slot_width =3D slot_width; =20 @@ -672,6 +683,9 @@ static int rtq9128_probe(struct i2c_client *i2c) else if (data->enable) usleep_range(10000, 11000); =20 + data->tdm_input_data2_select =3D device_property_read_bool(dev, + "richtek,tdm-input-data2-select"); + i2c_set_clientdata(i2c, data); =20 /* --=20 2.34.1