From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
vkoul@kernel.org, broonie@kernel.org
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
bgoswami@codeaurora.org, linux-kernel@vger.kernel.org,
plai@codeaurora.org, lgirdwood@gmail.com, robh+dt@kernel.org
Subject: Re: [alsa-devel] [PATCH v2 4/4] ASoC: codecs: add wsa881x amplifier support
Date: Thu, 8 Aug 2019 17:20:10 +0100 [thread overview]
Message-ID: <32516aae-8a43-6a74-c564-92dea8ff6e53@linaro.org> (raw)
In-Reply-To: <3ad15652-9d6c-11e4-7cc3-0f076c6841bb@linux.intel.com>
Thanks for taking time to review,
On 08/08/2019 16:18, Pierre-Louis Bossart wrote:
>
>> +/* 4 ports */
>> +static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
>> + {
>> + /* DAC */
>> + .num = 1,
>> + .type = SDW_DPN_SIMPLE,
>
> IIRC we added the REDUCED type in SoundWire 1.1 to cover the PDM case
> with channel packing (or was it grouping) used by Qualcomm. I am not
> sure the SIMPLE type works?
grouping I guess.
This is a simplified data port as there is no DPn_OffsetCtrl2 register
implemented.
Having said below channel count looks incorrect, i should fix that.
>
>> + .min_ch = 1,
>> + .max_ch = 8,
>> + .simple_ch_prep_sm = true,
>> + }, {
>> + /* COMP */
>> + .num = 2,
>> + .type = SDW_DPN_SIMPLE,
>> + .min_ch = 1,
>> + .max_ch = 8,
>> + .simple_ch_prep_sm = true,
>> + }, {
>> + /* BOOST */
>> + .num = 3,
>> + .type = SDW_DPN_SIMPLE,
>> + .min_ch = 1,
>> + .max_ch = 8,
>> + .simple_ch_prep_sm = true,
>> + }, {
>> + /* VISENSE */
>> + .num = 4,
>> + .type = SDW_DPN_SIMPLE,
>> + .min_ch = 1,
>> + .max_ch = 8,
>> + .simple_ch_prep_sm = true,
>> + }
>> +};
>
>> +static int wsa881x_update_status(struct sdw_slave *slave,
>> + enum sdw_slave_status status)
>> +{
>> + struct wsa881x_priv *wsa881x = dev_get_drvdata(&slave->dev);
>> +
>> + if (status == SDW_SLAVE_ATTACHED) {
>
> there is an ambiguity here, the Slave can be attached but as device0
> (not enumerated). We should check dev_num > 0
>
Thanks for point that! will add a check!
>> + if (!wsa881x->regmap) {
>> + wsa881x->regmap = devm_regmap_init_sdw(slave,
>> + &wsa881x_regmap_config);
>> + if (IS_ERR(wsa881x->regmap)) {
>> + dev_err(&slave->dev, "regmap_init failed\n");
>> + return PTR_ERR(wsa881x->regmap);
>> + }
>> + }
>> +
>> + return snd_soc_register_component(&slave->dev,
>> + &wsa881x_component_drv,
>> + NULL, 0);
>> + } else if (status == SDW_SLAVE_UNATTACHED) {
>> + snd_soc_unregister_component(&slave->dev);
>
> the update_status() is supposed to be called based on bus events, it'd
> be very odd to register/unregister the component itself dynamically. In
> our existing Realtek-based solutions the register_component() is called
> in the probe function (and unregister_component() in remove). We do the
> inits when the Slave becomes attached but the component is already
> registered.
>
looks less intrusive! I will give that a try!
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +
>> +static int wsa881x_remove(struct sdw_slave *sdw)
>> +{
>> + return 0;
>> +}
>> +
>> +static const struct sdw_device_id wsa881x_slave_id[] = {
>> + SDW_SLAVE_ENTRY(0x0217, 0x2010, 0),
>> + {},
>> +};
>> +MODULE_DEVICE_TABLE(sdw, wsa881x_slave_id);
>> +
>> +static struct sdw_driver wsa881x_codec_driver = {
>> + .probe = wsa881x_probe,
>> + .remove = wsa881x_remove,
>
> is this needed since you do nothing in that function?
yes, it can be removed! will do that in next version.
--srini
next prev parent reply other threads:[~2019-08-08 16:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 14:45 [PATCH v2 0/4] ASoC: codecs: Add WSA881x Smart Speaker " Srinivas Kandagatla
2019-08-08 14:45 ` [PATCH v2 1/4] dt-bindings: soundwire: add slave bindings Srinivas Kandagatla
2019-08-08 15:58 ` Pierre-Louis Bossart
2019-08-08 16:48 ` Srinivas Kandagatla
2019-08-08 19:52 ` Mark Brown
2019-08-09 4:54 ` Vinod Koul
2019-08-09 8:25 ` Srinivas Kandagatla
2019-08-09 5:00 ` Vinod Koul
2019-08-08 14:45 ` [PATCH v2 2/4] soundwire: core: add device tree support for slave devices Srinivas Kandagatla
2019-08-08 15:00 ` Pierre-Louis Bossart
2019-08-08 15:17 ` Srinivas Kandagatla
2019-08-09 5:46 ` Vinod Koul
2019-08-09 8:24 ` Srinivas Kandagatla
2019-08-09 5:07 ` Vinod Koul
2019-08-09 8:24 ` Srinivas Kandagatla
2019-08-08 14:45 ` [PATCH v2 3/4] dt-bindings: ASoC: Add WSA881x bindings Srinivas Kandagatla
2019-08-08 14:45 ` [PATCH v2 4/4] ASoC: codecs: add wsa881x amplifier support Srinivas Kandagatla
2019-08-08 15:18 ` [alsa-devel] " Pierre-Louis Bossart
2019-08-08 16:20 ` Srinivas Kandagatla [this message]
2019-08-08 16:29 ` Pierre-Louis Bossart
2019-08-09 4:56 ` [PATCH v2 0/4] ASoC: codecs: Add WSA881x Smart Speaker " Vinod Koul
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=32516aae-8a43-6a74-c564-92dea8ff6e53@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=bgoswami@codeaurora.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=plai@codeaurora.org \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.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
all inboxes | Powered by JetHome®