Copy speaker configuration from active to inactive bank
and perform bank switch operation while speaker channels
are getting enabled or disabled. This will make sure that
soundwire banks are always in sync and allow independent
control of speaker channels.
CRs-fixed: 1007465
Change-Id: Ic1653194c22fa5669b1c04fd9630158633fb00a5
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Handle soundwire slave devices ungroup in master controller.
Set the group device id to 0 when soundwire slave devices
request ungroup for independent control.
CRs-fixed: 1007465
Change-Id: I4f1b39dac949aa3f6aa3abb12ff0310fb0e98d1c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
pulled in the changes from the below commits.
Ia4329ac982eb2a29a2b925897cd87ca9711c30e3
Ic0ab015098035418458a5ba7c2ffad9df20f933c
Ia091228b5a6e6d3dced2bee6cd5fecf5632a62a0
Change-Id: Ie89d37060a73a190f752eebf226c630a903f0c1b
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Soundwire hardware has two banks for configuring soundwire
slave ports. After playback is stopped, disable soundwire slave
ports in both banks to avoid any port collisions during the start
of next playback on other slave device.
Change-Id: I5cfd1d985a1ca5fd7b4020d7e14697642f207501
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Put soundwire in suspend state when system is in idle state.
This will avoid power consumption on speakers when system is in
idle state.
Change-Id: I4f38457fa7681957e21ff1381f9bd841533bd7b5
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
sync to pm runtime increments the count and calls soundwire runtime
resume function. This is not needed for every soundwire register read
and write operation. Change removes syncing to pm runtime during
soundwire register read and write operations.
Change-Id: Id75dae4fb9d5a1785c3829541dbca9a3c4b4698f
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Before runtime PM is marked as suspended for the device, runtime
PM should be suspended for synchronization purpose. Without this,
the RPM status might not be updated to suspended and system might
go out of sync.
Change-Id: I77ce240bfae338f47d38277e115869a11df18101
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Runtime suspend and resume hooks are already taking care
of disabling and enabling the clocks.So need to do the same
in system suspend and resume. Otherwise it results in
disabling of clock when needed during suspend.
Change-Id: Ia5c99e6eff4190e8f6695c5ac15c2dc0c1fb0c05
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Slave devices attached to the WCD soundwire master would perform
device enumeration to determine the devices connected on the bus.
To perform this enumeration, call soundwire startup function to
invoke slave device startup function.
Change-Id: I96a21d9fe14b4bb0d8324dafcd8f4bfd63aa559e
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
In soundwire read/write commands, register value is defined
as 8 bit but it is accessed through 32 bit pointer which
may cause out of boundary memory access. Fix this issue by
typecast appropriately.
BUG: KASan: out of bounds access in swrm_read+0x1dc/0x30c at
addr ffffffc089871880
Write of size 4 by task kworker/u8:5/236
==addr ffffffc089871880
[<ffffffc00081d174>] swrm_read+0x1d8/0x30c
[<ffffffc000819808>] swr_read+0x5c/0x74
[<ffffffc000741e58>] regmap_swr_read+0xd8/0x11c
[<ffffffc00073a350>] _regmap_raw_read+0x210/0x314
[<ffffffc00073a4b0>] _regmap_bus_read+0x5c/0xb4
[<ffffffc000739548>] _regmap_read+0xe0/0x1ec
[<ffffffc0007396b8>] regmap_read+0x64/0xa8
[<ffffffc000dc9dd4>] snd_soc_component_read+0x34/0x70
[<ffffffc000dc9f44>] snd_soc_read+0x6c/0x94
Memory state around the buggy address:
ffffffc089871780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc089871800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
Change-Id: I3c56dffb4ca197e8fc23d54a44282a60254dd001
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Soundwire slave device version number can change over time.
Compare only the device ID part of Chip ID read from slave
device chip.
Change-Id: Idc2d84b3e8451cf73e75c3042393e22fecf1e88d
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
When Soundwire master device down callback is called, rather
than calling device suspend, call device down and turn off
clock.
Change-Id: I0c9b2b5cd3b816a6bb840309c588e02cf5ebb7c8
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
wsa8815 and wsa8810 have different chip id.
So add hack to register all the BONGO's.
Change-Id: I5653d37a02859aa41c91dc46128e867ef92b0b4d
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Modify codec, wsa and core drivers to maintain the power states
and configure the tasha codec and wsa hardware to low power mode
to reduce the power consumption during suspend.
Change-Id: I245c7ee154d0840b8036a99df374fc9392000585
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Soundwire master should be kept in clock pause state when
there is no active stream. This will save power when
there is no audio usecase through soundwire interface.
Add support for soundwire clock pause and resume.
Change-Id: If19a866986dcc749850ca2c48553424dfb068bfb
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Remove hardcoding of soundwire slave devices and get
the soundwire slave devices count during registering of
the devices.
Change-Id: I933bdbd3cbd4dc004c6a291df68418005bf4357a
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Print soundwire slave device IDs when the slave
status ID does not match with requestes slave device ID.
Change-Id: Id8759a8afbf92cf3d8d716c6eb10d886e20fa4d8
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Setting maximum number of pings to zero during soundwire master
initialization is not required. Add changes in soundwire master
initialization sequence to remove maximum number of pings.
Change-Id: Ifd3e9d7a6f5e5b9c84456c54d7647e8629c0ec3e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
WCD9335 is parent device node to soundwire master controller.
soundwire master controller will get notifications such as
port configuration, device up and down from WCD9335. Add
support to get notifications from WCD9335 to soundwire master.
Change-Id: I5d7e2b49aa3ad540bf279f3c7d3d5946f8e877c4
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update soundwire master initialization and port configuration
sequence as per HW configuration to connect ports between
soundwire master and slave devices for audio playback on
speaker.
Change-Id: I8072d6688a6ad3bdead04b01c011dd014256fe23
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Soundwire clock is needed for soundwire register
read and writes and also for data transfer. Enable
soundwire clock during soundwire master initialization.
Change-Id: I2f452dc1d00caeaa187ea1df0e45186ecf4b469d
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Check for NULL on all platform data function handlers to avoid
NULL pointer dereference.
Change-Id: Ic605ac5575f804f62c6178ed60386ce478fd1d18
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Soundwire logical device number is required for slave
device to communicate with master for register read/write
functionality. Add support in soundwire master driver
to provide logical device number to soundwire slave
device.
Change-Id: I8f64a7a4d9e5c923b3903590bb9903fee4d97cf8
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add soundwire master driver for soundwire master controller.
This driver initializes soundwire master controller
hardware and adds soundwire slave devices to the bus.
It handles all the interrupts generated by soundwire bus.
It also handles the port configuration of slave devices and
master for audio data transfer between master and slave ports.
Change-Id: Icf90e0268853c7b956e4c92f74af8dfb1efa0645
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>