* [PATCH v2 1/2] soundwire: qcom: update status from device id 1
@ 2022-09-16 13:53 ` Srinivas Kandagatla
0 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2022-09-16 13:53 UTC (permalink / raw)
To: vkoul
Cc: yung-chuan.liao, pierre-louis.bossart, sanyog.r.kale,
linux-arm-msm, alsa-devel, linux-kernel, quic_srivasam,
Srinivas Kandagatla
By default autoenumeration is enabled on QCom SoundWire controller
which means the core should not be dealing with device 0 w.r.t enumeration.
During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and
start programming the device id, however reading DEVID registers return zeros
which does not match to any of the slaves in the list and the core attempts
to park this device to Group 13. This results in adding SoundWire device
with enumeration address 0:0:0:0
Fix this by not passing device 0 status to SoundWire core.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Changes since v1:
- updated change log and split patch in to two as suggested by Pierre
drivers/soundwire/qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index e7f95c41eb70..d3ce580cdeaf 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
ctrl->slave_status = val;
- for (i = 0; i <= SDW_MAX_DEVICES; i++) {
+ for (i = 1; i <= SDW_MAX_DEVICES; i++) {
u32 s;
s = (val >> (i * 2));
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] soundwire: qcom: update status from device id 1
@ 2022-09-16 13:53 ` Srinivas Kandagatla
0 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2022-09-16 13:53 UTC (permalink / raw)
To: vkoul
Cc: alsa-devel, linux-arm-msm, pierre-louis.bossart, linux-kernel,
Srinivas Kandagatla, sanyog.r.kale, yung-chuan.liao,
quic_srivasam
By default autoenumeration is enabled on QCom SoundWire controller
which means the core should not be dealing with device 0 w.r.t enumeration.
During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and
start programming the device id, however reading DEVID registers return zeros
which does not match to any of the slaves in the list and the core attempts
to park this device to Group 13. This results in adding SoundWire device
with enumeration address 0:0:0:0
Fix this by not passing device 0 status to SoundWire core.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Changes since v1:
- updated change log and split patch in to two as suggested by Pierre
drivers/soundwire/qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index e7f95c41eb70..d3ce580cdeaf 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
ctrl->slave_status = val;
- for (i = 0; i <= SDW_MAX_DEVICES; i++) {
+ for (i = 1; i <= SDW_MAX_DEVICES; i++) {
u32 s;
s = (val >> (i * 2));
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] soundwire: qcom: do not send status of device 0 during alert
2022-09-16 13:53 ` Srinivas Kandagatla
@ 2022-09-16 13:53 ` Srinivas Kandagatla
-1 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2022-09-16 13:53 UTC (permalink / raw)
To: vkoul
Cc: yung-chuan.liao, pierre-louis.bossart, sanyog.r.kale,
linux-arm-msm, alsa-devel, linux-kernel, quic_srivasam,
Srinivas Kandagatla
Device0 can not be in alter status. And for consistency reasons do not
send status of device0 to core.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/soundwire/qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index d3ce580cdeaf..a04a8863b228 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
- for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
+ for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) {
status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] soundwire: qcom: do not send status of device 0 during alert
@ 2022-09-16 13:53 ` Srinivas Kandagatla
0 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2022-09-16 13:53 UTC (permalink / raw)
To: vkoul
Cc: alsa-devel, linux-arm-msm, pierre-louis.bossart, linux-kernel,
Srinivas Kandagatla, sanyog.r.kale, yung-chuan.liao,
quic_srivasam
Device0 can not be in alter status. And for consistency reasons do not
send status of device0 to core.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/soundwire/qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index d3ce580cdeaf..a04a8863b228 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
- for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
+ for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) {
status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/2] soundwire: qcom: do not send status of device 0 during alert
2022-09-16 13:53 ` Srinivas Kandagatla
(?)
@ 2022-09-16 14:22 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2022-09-16 14:22 UTC (permalink / raw)
To: Srinivas Kandagatla, vkoul
Cc: alsa-devel, linux-arm-msm, linux-kernel, sanyog.r.kale,
yung-chuan.liao, quic_srivasam
On 9/16/22 15:53, Srinivas Kandagatla wrote:
> Device0 can not be in alter status. And for consistency reasons do not
typo: alert
> send status of device0 to core.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
> drivers/soundwire/qcom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index d3ce580cdeaf..a04a8863b228 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -428,7 +428,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
>
> ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
>
> - for (dev_num = 0; dev_num <= SDW_MAX_DEVICES; dev_num++) {
> + for (dev_num = 1; dev_num <= SDW_MAX_DEVICES; dev_num++) {
> status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
>
> if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] soundwire: qcom: update status from device id 1
2022-09-16 13:53 ` Srinivas Kandagatla
(?)
(?)
@ 2022-09-16 14:22 ` Pierre-Louis Bossart
-1 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2022-09-16 14:22 UTC (permalink / raw)
To: Srinivas Kandagatla, vkoul
Cc: alsa-devel, linux-arm-msm, linux-kernel, sanyog.r.kale,
yung-chuan.liao, quic_srivasam
On 9/16/22 15:53, Srinivas Kandagatla wrote:
> By default autoenumeration is enabled on QCom SoundWire controller
> which means the core should not be dealing with device 0 w.r.t enumeration.
>
> During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and
> start programming the device id, however reading DEVID registers return zeros
> which does not match to any of the slaves in the list and the core attempts
> to park this device to Group 13. This results in adding SoundWire device
> with enumeration address 0:0:0:0
>
> Fix this by not passing device 0 status to SoundWire core.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
> Changes since v1:
> - updated change log and split patch in to two as suggested by Pierre
>
> drivers/soundwire/qcom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index e7f95c41eb70..d3ce580cdeaf 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -448,7 +448,7 @@ static void qcom_swrm_get_device_status(struct qcom_swrm_ctrl *ctrl)
> ctrl->reg_read(ctrl, SWRM_MCP_SLV_STATUS, &val);
> ctrl->slave_status = val;
>
> - for (i = 0; i <= SDW_MAX_DEVICES; i++) {
> + for (i = 1; i <= SDW_MAX_DEVICES; i++) {
> u32 s;
>
> s = (val >> (i * 2));
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] soundwire: qcom: update status from device id 1
2022-09-16 13:53 ` Srinivas Kandagatla
@ 2022-09-20 5:04 ` Vinod Koul
-1 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2022-09-20 5:04 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: yung-chuan.liao, pierre-louis.bossart, sanyog.r.kale,
linux-arm-msm, alsa-devel, linux-kernel, quic_srivasam
On 16-09-22, 14:53, Srinivas Kandagatla wrote:
> By default autoenumeration is enabled on QCom SoundWire controller
> which means the core should not be dealing with device 0 w.r.t enumeration.
>
> During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and
> start programming the device id, however reading DEVID registers return zeros
> which does not match to any of the slaves in the list and the core attempts
> to park this device to Group 13. This results in adding SoundWire device
> with enumeration address 0:0:0:0
>
> Fix this by not passing device 0 status to SoundWire core.
Applied after fixing typi pointed by Pierre, thanks
Also, pls check, I got conflict which was resolved
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] soundwire: qcom: update status from device id 1
@ 2022-09-20 5:04 ` Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2022-09-20 5:04 UTC (permalink / raw)
To: Srinivas Kandagatla
Cc: alsa-devel, linux-arm-msm, pierre-louis.bossart, linux-kernel,
sanyog.r.kale, yung-chuan.liao, quic_srivasam
On 16-09-22, 14:53, Srinivas Kandagatla wrote:
> By default autoenumeration is enabled on QCom SoundWire controller
> which means the core should not be dealing with device 0 w.r.t enumeration.
>
> During Enumeration if SoundWire core sees status[0] as SDW_SLAVE_ATTACHED and
> start programming the device id, however reading DEVID registers return zeros
> which does not match to any of the slaves in the list and the core attempts
> to park this device to Group 13. This results in adding SoundWire device
> with enumeration address 0:0:0:0
>
> Fix this by not passing device 0 status to SoundWire core.
Applied after fixing typi pointed by Pierre, thanks
Also, pls check, I got conflict which was resolved
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-20 5:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 13:53 [PATCH v2 1/2] soundwire: qcom: update status from device id 1 Srinivas Kandagatla
2022-09-16 13:53 ` Srinivas Kandagatla
2022-09-16 13:53 ` [PATCH v2 2/2] soundwire: qcom: do not send status of device 0 during alert Srinivas Kandagatla
2022-09-16 13:53 ` Srinivas Kandagatla
2022-09-16 14:22 ` Pierre-Louis Bossart
2022-09-16 14:22 ` [PATCH v2 1/2] soundwire: qcom: update status from device id 1 Pierre-Louis Bossart
2022-09-20 5:04 ` Vinod Koul
2022-09-20 5:04 ` Vinod Koul
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.