lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241216110341.3707-3-quic_pkumpatl@quicinc.com>
Date: Mon, 16 Dec 2024 16:33:41 +0530
From: Prasad Kumpatla <quic_pkumpatl@...cinc.com>
To: Fabio Estevam <festevam@...il.com>, Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>
Cc: linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, quic_mohsquicinc.com@...lcomm.com,
        kernel@...cinc.com, Prasad Kumpatla <quic_pkumpatl@...cinc.com>
Subject: [PATCH v1 2/2] ASoC: sgtl5000: Introduce "mclk-rate" Property for Device Tree Configuration

Introduce the "mclk-rate" property, enabling the configuration of the
Master Clock (MCLK) via the device tree. The Codec Slave supports
a defined range of frequencies, and users can request the desired rate
from the Master, using `clk_set_rate()`. If the property is not specified,
the default MCLK frequency will be applied.

Signed-off-by: Prasad Kumpatla <quic_pkumpatl@...cinc.com>
---
 sound/soc/codecs/sgtl5000.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 7aa89e34657e..7e134a3219c7 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -1615,6 +1615,16 @@ static int sgtl5000_i2c_probe(struct i2c_client *client)
 		goto disable_regs;
 	}
 
+	if (!of_property_read_u32(np, "mclk-rate", &value)) {
+		if (value > 0) {
+			ret = clk_set_rate(sgtl5000->mclk, value);
+			if (ret) {
+				dev_err(&client->dev, "Failed to set mclock\n");
+				goto disable_regs;
+			}
+		}
+	}
+
 	ret = clk_prepare_enable(sgtl5000->mclk);
 	if (ret) {
 		dev_err(&client->dev, "Error enabling clock %d\n", ret);
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ