* [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
@ 2020-03-11 11:35 ` Srinivas Kandagatla
0 siblings, 0 replies; 14+ messages in thread
From: Srinivas Kandagatla @ 2020-03-11 11:35 UTC (permalink / raw)
To: broonie, vkoul
Cc: alsa-devel, Srinivas Kandagatla, pierre-louis.bossart, linux-kernel
WSA881x works in PDM mode so the wordlength is fixed, which also makes
the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
Writing to this register will throw up errors with Qualcomm Controller.
So use ro_blockctrl1_reg flag to mark this field as read-only so that
core will not write to this register.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
sound/soc/codecs/wsa881x.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index b59f1d0e7f84..35b44b297f9e 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -394,6 +394,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
+ .read_only_wordlength = true,
}, {
/* COMP */
.num = 2,
@@ -401,6 +402,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
+ .read_only_wordlength = true,
}, {
/* BOOST */
.num = 3,
@@ -408,6 +410,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
+ .read_only_wordlength = true,
}, {
/* VISENSE */
.num = 4,
@@ -415,6 +418,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
+ .read_only_wordlength = true,
}
};
--
2.21.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
2020-03-11 11:35 ` Srinivas Kandagatla
@ 2020-03-11 18:58 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-11 18:58 UTC (permalink / raw)
To: Srinivas Kandagatla, broonie, vkoul; +Cc: linux-kernel, alsa-devel
On 3/11/20 6:35 AM, Srinivas Kandagatla wrote:
> WSA881x works in PDM mode so the wordlength is fixed, which also makes
> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
> Writing to this register will throw up errors with Qualcomm Controller.
it'd be good to clarify the nature of these errors, i.e.
a) is this the Slave device responding with a NAK?
b) is this the Slave device responding with COMMAND_IGNORED, and those
responses not handled by the controller?
c) something else?
Thanks!
> So use ro_blockctrl1_reg flag to mark this field as read-only so that
> core will not write to this register.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> sound/soc/codecs/wsa881x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index b59f1d0e7f84..35b44b297f9e 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -394,6 +394,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* COMP */
> .num = 2,
> @@ -401,6 +402,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* BOOST */
> .num = 3,
> @@ -408,6 +410,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* VISENSE */
> .num = 4,
> @@ -415,6 +418,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }
> };
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
@ 2020-03-11 18:58 ` Pierre-Louis Bossart
0 siblings, 0 replies; 14+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-11 18:58 UTC (permalink / raw)
To: Srinivas Kandagatla, broonie, vkoul; +Cc: alsa-devel, linux-kernel
On 3/11/20 6:35 AM, Srinivas Kandagatla wrote:
> WSA881x works in PDM mode so the wordlength is fixed, which also makes
> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
> Writing to this register will throw up errors with Qualcomm Controller.
it'd be good to clarify the nature of these errors, i.e.
a) is this the Slave device responding with a NAK?
b) is this the Slave device responding with COMMAND_IGNORED, and those
responses not handled by the controller?
c) something else?
Thanks!
> So use ro_blockctrl1_reg flag to mark this field as read-only so that
> core will not write to this register.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> sound/soc/codecs/wsa881x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index b59f1d0e7f84..35b44b297f9e 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -394,6 +394,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* COMP */
> .num = 2,
> @@ -401,6 +402,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* BOOST */
> .num = 3,
> @@ -408,6 +410,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* VISENSE */
> .num = 4,
> @@ -415,6 +418,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }
> };
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
2020-03-11 18:58 ` Pierre-Louis Bossart
@ 2020-03-12 9:54 ` Srinivas Kandagatla
-1 siblings, 0 replies; 14+ messages in thread
From: Srinivas Kandagatla @ 2020-03-12 9:54 UTC (permalink / raw)
To: Pierre-Louis Bossart, broonie, vkoul; +Cc: linux-kernel, alsa-devel
On 11/03/2020 18:58, Pierre-Louis Bossart wrote:
>
> On 3/11/20 6:35 AM, Srinivas Kandagatla wrote:
>> WSA881x works in PDM mode so the wordlength is fixed, which also makes
>> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
>> Writing to this register will throw up errors with Qualcomm Controller.
>
> it'd be good to clarify the nature of these errors, i.e.
>
> a) is this the Slave device responding with a NAK?
> b) is this the Slave device responding with COMMAND_IGNORED, and those
> responses not handled by the controller?
> c) something else?
With the current version of Qcom SoundWire controller driver, it can
only know if the write succeeded or not based on completion interrupt.
There are no details of the actual error code visible to the driver. But
the new version of the same controller is expected to return better
error codes.
thanks,
srini
>
> Thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
@ 2020-03-12 9:54 ` Srinivas Kandagatla
0 siblings, 0 replies; 14+ messages in thread
From: Srinivas Kandagatla @ 2020-03-12 9:54 UTC (permalink / raw)
To: Pierre-Louis Bossart, broonie, vkoul; +Cc: alsa-devel, linux-kernel
On 11/03/2020 18:58, Pierre-Louis Bossart wrote:
>
> On 3/11/20 6:35 AM, Srinivas Kandagatla wrote:
>> WSA881x works in PDM mode so the wordlength is fixed, which also makes
>> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
>> Writing to this register will throw up errors with Qualcomm Controller.
>
> it'd be good to clarify the nature of these errors, i.e.
>
> a) is this the Slave device responding with a NAK?
> b) is this the Slave device responding with COMMAND_IGNORED, and those
> responses not handled by the controller?
> c) something else?
With the current version of Qcom SoundWire controller driver, it can
only know if the write succeeded or not based on completion interrupt.
There are no details of the actual error code visible to the driver. But
the new version of the same controller is expected to return better
error codes.
thanks,
srini
>
> Thanks!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
2020-03-11 11:35 ` Srinivas Kandagatla
@ 2020-03-20 14:02 ` Vinod Koul
-1 siblings, 0 replies; 14+ messages in thread
From: Vinod Koul @ 2020-03-20 14:02 UTC (permalink / raw)
To: broonie, Srinivas Kandagatla
Cc: pierre-louis.bossart, linux-kernel, alsa-devel
Hi Mark,
On 11-03-20, 11:35, Srinivas Kandagatla wrote:
> WSA881x works in PDM mode so the wordlength is fixed, which also makes
> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
> Writing to this register will throw up errors with Qualcomm Controller.
> So use ro_blockctrl1_reg flag to mark this field as read-only so that
> core will not write to this register.
I have applied the sdw patch. Since this depends on sdw patch, feel free
to pull the below tag before you apply this
The following changes since commit bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9:
Linux 5.6-rc1 (2020-02-09 16:08:48 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git topic/ro_wordlength
for you to fetch changes up to a9107de4b03604ce0d279315c91b31b8065ee4ea:
soundwire: stream: Add read_only_wordlength flag to port properties (2020-03-20 19:24:59 +0530)
----------------------------------------------------------------
Srinivas Kandagatla (1):
soundwire: stream: Add read_only_wordlength flag to port properties
drivers/soundwire/stream.c | 16 +++++++++-------
include/linux/soundwire/sdw.h | 2 ++
2 files changed, 11 insertions(+), 7 deletions(-)
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> sound/soc/codecs/wsa881x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index b59f1d0e7f84..35b44b297f9e 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -394,6 +394,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* COMP */
> .num = 2,
> @@ -401,6 +402,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* BOOST */
> .num = 3,
> @@ -408,6 +410,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* VISENSE */
> .num = 4,
> @@ -415,6 +418,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }
> };
>
> --
> 2.21.0
--
~Vinod
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] ASoC: wsa881x: mark read_only_wordlength flag
@ 2020-03-20 14:02 ` Vinod Koul
0 siblings, 0 replies; 14+ messages in thread
From: Vinod Koul @ 2020-03-20 14:02 UTC (permalink / raw)
To: broonie, Srinivas Kandagatla
Cc: alsa-devel, pierre-louis.bossart, linux-kernel
Hi Mark,
On 11-03-20, 11:35, Srinivas Kandagatla wrote:
> WSA881x works in PDM mode so the wordlength is fixed, which also makes
> the only field "WordLength" in DPN_BlockCtrl1 register a read-only.
> Writing to this register will throw up errors with Qualcomm Controller.
> So use ro_blockctrl1_reg flag to mark this field as read-only so that
> core will not write to this register.
I have applied the sdw patch. Since this depends on sdw patch, feel free
to pull the below tag before you apply this
The following changes since commit bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9:
Linux 5.6-rc1 (2020-02-09 16:08:48 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git topic/ro_wordlength
for you to fetch changes up to a9107de4b03604ce0d279315c91b31b8065ee4ea:
soundwire: stream: Add read_only_wordlength flag to port properties (2020-03-20 19:24:59 +0530)
----------------------------------------------------------------
Srinivas Kandagatla (1):
soundwire: stream: Add read_only_wordlength flag to port properties
drivers/soundwire/stream.c | 16 +++++++++-------
include/linux/soundwire/sdw.h | 2 ++
2 files changed, 11 insertions(+), 7 deletions(-)
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
> sound/soc/codecs/wsa881x.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
> index b59f1d0e7f84..35b44b297f9e 100644
> --- a/sound/soc/codecs/wsa881x.c
> +++ b/sound/soc/codecs/wsa881x.c
> @@ -394,6 +394,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* COMP */
> .num = 2,
> @@ -401,6 +402,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* BOOST */
> .num = 3,
> @@ -408,6 +410,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }, {
> /* VISENSE */
> .num = 4,
> @@ -415,6 +418,7 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
> .min_ch = 1,
> .max_ch = 1,
> .simple_ch_prep_sm = true,
> + .read_only_wordlength = true,
> }
> };
>
> --
> 2.21.0
--
~Vinod
^ permalink raw reply [flat|nested] 14+ messages in thread