soundwire: bus: filter-out unwanted interrupt reports
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 8 Sep 2020 13:45:16 +0000 (21:45 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 10 Sep 2020 05:51:04 +0000 (11:21 +0530)
commit310f6dc6dc5d7372e878e3e401ae087b63d545de
treed5359a0160a101d6a55ab2daa0a31659aa5a7a83
parent2acd30b9f6032c6cbefc5e255c17ebbb0718e56a
soundwire: bus: filter-out unwanted interrupt reports

Unlike the traditional usage, in the SoundWire specification the
interrupt masks only gate the propagation of an interrupt condition to
the PING frame status. They do not gate the changes of the INT_STAT
registers, which will happen regardless of the mask settings. See
Figure 116 of the SoundWire 1.2 specification for an in-depth
description of the interrupt model.

When the bus driver reads the SCP_INT1_STAT register, it will retrieve
all the interrupt status, including for the mask fields that were not
explicitly set. For example, even if the PARITY mask is not set, the
PARITY error status will be reported if an implementation-defined
interrupt for jack detection is enabled and occurs.

Filtering undesired interrupt reports and handling has to be
implemented in software. This patch enables this filtering for the
INT1_IMPL_DEF, PARITY and BUS_CLASH interrupt sources.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200908134521.6781-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c