From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: broonie@kernel.org, vkoul@kernel.org
Cc: robh@kernel.org, devicetree@vger.kernel.org,
yung-chuan.liao@linux.intel.com,
pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com,
linux-kernel@vger.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH v3 5/5] ASoC: codecs: wsa881x: add static port map support
Date: Fri, 12 Mar 2021 11:39:29 +0000 [thread overview]
Message-ID: <20210312113929.17512-6-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20210312113929.17512-1-srinivas.kandagatla@linaro.org>
Two instances of WSA881x(Speaker Right, Speaker Left) ports
are statically mapped to master ports. Allow the driver to parse
those mappings from device tree.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
sound/soc/codecs/wsa881x.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index db87e07b11c9..b3568aec0cd0 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1093,6 +1093,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
const struct sdw_device_id *id)
{
struct wsa881x_priv *wsa881x;
+ struct device *dev = &pdev->dev;
wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL);
if (!wsa881x)
@@ -1105,6 +1106,12 @@ static int wsa881x_probe(struct sdw_slave *pdev,
return PTR_ERR(wsa881x->sd_n);
}
+ /* valid port numbers on this codec starts from 1, so skip 0th index */
+ if (of_property_read_u32_array(dev->of_node, "qcom,port-mapping",
+ &pdev->m_port_map[1],
+ WSA881X_MAX_SWR_PORTS))
+ dev_info(dev, "Static Port mapping not specified\n");
+
dev_set_drvdata(&pdev->dev, wsa881x);
wsa881x->slave = pdev;
wsa881x->dev = &pdev->dev;
--
2.21.0
prev parent reply other threads:[~2021-03-12 11:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 11:39 [PATCH v3 0/5] soundwire: add static port map support Srinivas Kandagatla
2021-03-12 11:39 ` [PATCH v3 1/5] soundwire: add static port mapping support Srinivas Kandagatla
2021-03-12 16:56 ` Pierre-Louis Bossart
2021-03-15 9:54 ` Srinivas Kandagatla
2021-03-12 11:39 ` [PATCH v3 2/5] soundwire: qcom: update port map allocation bit mask Srinivas Kandagatla
2021-03-12 11:39 ` [PATCH v3 3/5] soundwire: qcom: add static port map support Srinivas Kandagatla
2021-03-12 11:39 ` [PATCH v3 4/5] ASoC: dt-bindings: wsa881x: add bindings for port mapping Srinivas Kandagatla
2021-03-12 11:39 ` Srinivas Kandagatla [this message]
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=20210312113929.17512-6-srinivas.kandagatla@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh@kernel.org \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/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;
as well as URLs for NNTP newsgroup(s).