Commit f03038ba authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown

ASoC: codecs: lpass-tx-macro: add support for SM8550

Add support for the TX macro codec on Qualcomm SM8550.  SM8550 does not
use NPL clock, thus add flags allowing to skip it.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230327132254.147975-7-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3e226b4d
...@@ -1915,7 +1915,10 @@ static int tx_macro_register_mclk_output(struct tx_macro *tx) ...@@ -1915,7 +1915,10 @@ static int tx_macro_register_mclk_output(struct tx_macro *tx)
struct clk_init_data init; struct clk_init_data init;
int ret; int ret;
parent_clk_name = __clk_get_name(tx->npl); if (tx->npl)
parent_clk_name = __clk_get_name(tx->npl);
else
parent_clk_name = __clk_get_name(tx->mclk);
init.name = clk_name; init.name = clk_name;
init.ops = &swclk_gate_ops; init.ops = &swclk_gate_ops;
...@@ -1946,10 +1949,13 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1946,10 +1949,13 @@ static int tx_macro_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
kernel_ulong_t flags;
struct tx_macro *tx; struct tx_macro *tx;
void __iomem *base; void __iomem *base;
int ret, reg; int ret, reg;
flags = (kernel_ulong_t)device_get_match_data(dev);
tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL);
if (!tx) if (!tx)
return -ENOMEM; return -ENOMEM;
...@@ -1966,9 +1972,11 @@ static int tx_macro_probe(struct platform_device *pdev) ...@@ -1966,9 +1972,11 @@ static int tx_macro_probe(struct platform_device *pdev)
if (IS_ERR(tx->mclk)) if (IS_ERR(tx->mclk))
return PTR_ERR(tx->mclk); return PTR_ERR(tx->mclk);
tx->npl = devm_clk_get(dev, "npl"); if (flags & LPASS_MACRO_FLAG_HAS_NPL_CLOCK) {
if (IS_ERR(tx->npl)) tx->npl = devm_clk_get(dev, "npl");
return PTR_ERR(tx->npl); if (IS_ERR(tx->npl))
return PTR_ERR(tx->npl);
}
tx->fsgen = devm_clk_get(dev, "fsgen"); tx->fsgen = devm_clk_get(dev, "fsgen");
if (IS_ERR(tx->fsgen)) if (IS_ERR(tx->fsgen))
...@@ -2143,10 +2151,21 @@ static const struct dev_pm_ops tx_macro_pm_ops = { ...@@ -2143,10 +2151,21 @@ static const struct dev_pm_ops tx_macro_pm_ops = {
}; };
static const struct of_device_id tx_macro_dt_match[] = { static const struct of_device_id tx_macro_dt_match[] = {
{ .compatible = "qcom,sc7280-lpass-tx-macro" }, {
{ .compatible = "qcom,sm8250-lpass-tx-macro" }, .compatible = "qcom,sc7280-lpass-tx-macro",
{ .compatible = "qcom,sm8450-lpass-tx-macro" }, .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
{ .compatible = "qcom,sc8280xp-lpass-tx-macro" }, }, {
.compatible = "qcom,sm8250-lpass-tx-macro",
.data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
}, {
.compatible = "qcom,sm8450-lpass-tx-macro",
.data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
}, {
.compatible = "qcom,sm8550-lpass-tx-macro",
}, {
.compatible = "qcom,sc8280xp-lpass-tx-macro",
.data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK,
},
{ } { }
}; };
MODULE_DEVICE_TABLE(of, tx_macro_dt_match); MODULE_DEVICE_TABLE(of, tx_macro_dt_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment