soundwire: stream: Add read_only_wordlength flag to port properties
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Wed, 11 Mar 2020 11:35:44 +0000 (11:35 +0000)
committerVinod Koul <vkoul@kernel.org>
Fri, 20 Mar 2020 13:54:59 +0000 (19:24 +0530)
commita9107de4b03604ce0d279315c91b31b8065ee4ea
tree4c6fb188e1cb391bcf45ea6d24f509de2cde9823
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9
soundwire: stream: Add read_only_wordlength flag to port properties

According to SoundWire Specification Version 1.2.
"A Data Port number X (in the range 0-14) which supports only one
value of WordLength may implement the WordLength field in the
DPX_BlockCtrl1 Register as Read-Only, returning the fixed value of
WordLength in response to reads."

As WSA881x interfaces in PDM mode making the only field "WordLength"
in DPX_BlockCtrl1" fixed and read-only. Behaviour of writing to this
register on WSA881x soundwire slave with Qualcomm Soundwire Controller
is throwing up an error. Not sure how other controllers deal with
writing to readonly registers, but this patch provides a way to avoid
writes to DPN_BlockCtrl1 register by providing a read_only_wordlength
flag in struct sdw_dpn_prop

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200311113545.23773-2-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c
include/linux/soundwire/sdw.h