soundwire: bus: Update sdw_nread/nwrite_no_pm to handle page boundaries
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Wed, 22 Mar 2023 16:49:48 +0000 (16:49 +0000)
committerVinod Koul <vkoul@kernel.org>
Wed, 12 Apr 2023 10:00:37 +0000 (15:30 +0530)
commitd005ea713dd721c1ce9010e608eb416a3890d6b4
tree05cbfbf3f6c0990ba8b9840e00c287f9c439b948
parentd94e1e01c70375fcc102a8d09a00d28efeeef51c
soundwire: bus: Update sdw_nread/nwrite_no_pm to handle page boundaries

Currently issuing a sdw_nread/nwrite_no_pm across a page boundary
will silently fail to write correctly as nothing updates the page
registers, meaning the same page of the chip will get rewritten
with each successive page of data.

As the sdw_msg structure contains page information it seems
reasonable that a single sdw_msg should always be within one
page. It is also mostly simpler to handle the paging at the
bus level rather than each master having to handle it in their
xfer_msg callback.

As such add handling to the bus code to split up a transfer into
multiple sdw_msg's when they go across page boundaries.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230322164948.566962-3-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c