External email: Use caution opening links or attachmentsThanks Dmitry
10.01.2020 20:04, Sowjanya Komatineni ÐÐÑÐÑ:
On 1/9/20 10:52 AM, Sowjanya Komatineni wrote:Seems only T210 was making use of the CaR's TEGRA*_CLK_CLK_OUT_*, thus
Dmitry,
On 1/7/20 10:28 PM, Sameer Pujar wrote:
On 1/8/2020 11:18 AM, Sowjanya Komatineni wrote:Will update
On 1/7/20 9:34 PM, Sameer Pujar wrote:Yes, but falling back essentially means 'mclk' is not available and
On 1/8/2020 9:55 AM, Sowjanya Komatineni wrote:Want to show error even if mclk retrieval returns ENOENT to clearly
mclk is from clk_out_1 which is part of Tegra PMC block and pmcThis error print can be moved inside below if, when this actually
clocks
are moved to Tegra PMC driver with pmc as clock provider and using
pmc
clock ids.
New device tree uses clk_out_1 from pmc clock provider.
So, this patch adds implementation for mclk fallback to extern1 when
retrieving mclk returns -ENOENT to be backward compatible of new
device
tree with older kernels.
Tested-by: Dmitry Osipenko <digetx@xxxxxxxxx>
Reviewed-by: Dmitry Osipenko <digetx@xxxxxxxxx>
Signed-off-by: Sowjanya Komatineni <skomatineni@xxxxxxxxxx>
---
sound/soc/tegra/tegra_asoc_utils.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sound/soc/tegra/tegra_asoc_utils.c
b/sound/soc/tegra/tegra_asoc_utils.c
index 9cfebef74870..9a5f81039491 100644
--- a/sound/soc/tegra/tegra_asoc_utils.c
+++ b/sound/soc/tegra/tegra_asoc_utils.c
@@ -183,7 +183,16 @@ int tegra_asoc_utils_init(struct
tegra_asoc_utils_data *data,
data->clk_cdev1 = devm_clk_get(dev, "mclk");
if (IS_ERR(data->clk_cdev1)) {
dev_err(data->dev, "Can't retrieve clk cdev1\n");
meant to be an error condition.
indicate mclk does not exist along with message of falling back to
extern1.
fallback print is not an error.
Not a major issue though, you can consider updating. Otherwise LGTM.
Will use dev_info- return PTR_ERR(data->clk_cdev1);This can be a info print?
+ if (PTR_ERR(data->clk_cdev1) != -ENOENT)
+ return PTR_ERR(data->clk_cdev1);
+ /* Fall back to extern1 */
+ data->clk_cdev1 = devm_clk_get(dev, "extern1");
+ if (IS_ERR(data->clk_cdev1)) {
+ dev_err(data->dev, "Can't retrieve clk extern1\n");
+ return PTR_ERR(data->clk_cdev1);
+ }
+
+ dev_err(data->dev, "Falling back to extern1\n");
Dmitry/Rob, there was discussion in v3 regarding backporting mclk}
/*
fallback.
Dmitry wanted Rob to confirm on this
I think openSUSE Leap could be one of those distros that use LTS kernel
with newer device-trees, but that's not 100%. Maybe Rob could help
clarifying that.
Dmitry/Rob, Can you please confirm if mclk fallback patch need
backport to have new device tree work with old kernels?
Can you please confirm if we need to backport this mclk fallback patch?
the backporting isn't needed.
OK, Will move patches of device tree updates to use new DT ID prior to removal of old ID.
Also, please use 'git rebase --exec make ...' to make sure that all
patches are compiling without problems. The removal of the legacy clock
IDs should be done after the device-trees changes, otherwise it looks
like DTBs compilation will fail. It's possible that the order of the
patches could be changed if Thierry will chose to split this series into
several pull requests, nevertheless all patches should compile and work
in the original order.