From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
alsa-devel@alsa-project.org, matt@genesi-usa.com,
mfuzzey@gmail.com, kernel@pengutronix.de, shawn.guo@linaro.org
Subject: [RFC 2/4] ASoC: imx-sgtl5000: Let the code clock be a mandatory binding
Date: Wed, 17 Apr 2013 20:55:19 -0300 [thread overview]
Message-ID: <1366242921-16376-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1366242921-16376-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Currently passing a codec clock is optional.
Make the codec clock to be a required binding in order to simplify codec clock
handling in imx-sgtl5000.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Mark/Shawn/Sascha,
I am marking this one as RFC because I don't have mx51babbage nor mx53qsb handy
to test it.
Will test on these platforms when I have a chance, but just wanted to share
it now and maybe get some feedback first.
arch/arm/boot/dts/imx51-babbage.dts | 13 ++++++++++++-
arch/arm/boot/dts/imx53-qsb.dts | 1 +
arch/arm/mach-imx/mach-imx53.c | 16 ----------------
sound/soc/fsl/imx-sgtl5000.c | 18 ++++++------------
4 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 6dd9486..5318d26 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -61,6 +61,16 @@
mux-int-port = <2>;
mux-ext-port = <3>;
};
+
+ clocks {
+ clk_26M: clock {
+ compatible = "fixed-clock";
+ reg=<0>;
+ #clock-cells = <0>;
+ clock-frequency = <26000000>;
+ gpios = <&gpio4 26 1>;
+ };
+ };
};
&esdhc1 {
@@ -229,6 +239,7 @@
MX51_PAD_EIM_A27__GPIO2_21 0x5
MX51_PAD_CSPI1_SS0__GPIO4_24 0x85
MX51_PAD_CSPI1_SS1__GPIO4_25 0x85
+ MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
>;
};
};
@@ -255,7 +266,7 @@
sgtl5000: codec@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
- clock-frequency = <26000000>;
+ clocks = <&clk_26M>;
VDDA-supply = <&vdig_reg>;
VDDIO-supply = <&vvideo_reg>;
};
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
index 160d1bc..27e56e0 100644
--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -145,6 +145,7 @@
sgtl5000: codec@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
+ clocks = <&clks 150>;
VDDA-supply = <®_3p2v>;
VDDIO-supply = <®_3p2v>;
};
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index f579c61..8d47571 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -23,24 +23,8 @@
#include "common.h"
#include "mx53.h"
-static void __init imx53_qsb_init(void)
-{
- struct clk *clk;
-
- clk = clk_get_sys(NULL, "ssi_ext1");
- if (IS_ERR(clk)) {
- pr_err("failed to get clk ssi_ext1\n");
- return;
- }
-
- clk_register_clkdev(clk, NULL, "0-000a");
-}
-
static void __init imx53_dt_init(void)
{
- if (of_machine_is_compatible("fsl,imx53-qsb"))
- imx53_qsb_init();
-
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 88fc02c..9c286e6 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -130,20 +130,14 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
data->codec_clk = clk_get(&codec_dev->dev, NULL);
if (IS_ERR(data->codec_clk)) {
- /* assuming clock enabled by default */
- data->codec_clk = NULL;
- ret = of_property_read_u32(codec_np, "clock-frequency",
- &data->clk_frequency);
- if (ret) {
- dev_err(&codec_dev->dev,
- "clock-frequency missing or invalid\n");
- goto fail;
- }
- } else {
- data->clk_frequency = clk_get_rate(data->codec_clk);
- clk_prepare_enable(data->codec_clk);
+ ret = PTR_ERR(data->codec_clk);
+ dev_err(&codec_dev->dev, "could not get codec clk: %d\n", ret);
+ goto fail;
}
+ data->clk_frequency = clk_get_rate(data->codec_clk);
+ clk_prepare_enable(data->codec_clk);
+
data->dai.name = "HiFi";
data->dai.stream_name = "HiFi";
data->dai.codec_dai_name = "sgtl5000";
--
1.7.9.5
next prev parent reply other threads:[~2013-04-17 23:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 23:55 [PATCH 1/4] ASoC: imx-sgtl5000: Do not enter the error path on success Fabio Estevam
2013-04-17 23:55 ` Fabio Estevam [this message]
2013-04-18 3:36 ` [RFC 2/4] ASoC: imx-sgtl5000: Let the code clock be a mandatory binding Shawn Guo
2013-04-18 3:56 ` Fabio Estevam
2013-04-18 6:41 ` Shawn Guo
2013-04-19 3:54 ` Fabio Estevam
2013-04-17 23:55 ` [PATCH 3/4] ASoC: imx-sgtl5000: Do a sanity check on the codec clock Fabio Estevam
2013-04-17 23:55 ` [PATCH 4/4] ASoC: imx-sgtl5000: Convert to devm_clk_get() Fabio Estevam
2013-04-18 1:29 ` [PATCH 1/4] ASoC: imx-sgtl5000: Do not enter the error path on success Shawn Guo
2013-04-18 1:38 ` Shawn Guo
2013-04-18 2:06 ` Fabio Estevam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366242921-16376-2-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=matt@genesi-usa.com \
--cc=mfuzzey@gmail.com \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox