Commit Graph

32 Commits

Author SHA1 Message Date
Phani Kumar Uppalapati a78b277072 swr-wcd-ctrl: Ensure soundwire banks are always in sync
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>
2016-05-03 04:51:39 -07:00
Phani Kumar Uppalapati 5544d5f08c swr-wcd-ctrl: Handle soundwire slave device ungroup
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>
2016-05-03 04:51:05 -07:00
Santosh Mardi 39326a27dd ASoC: msm: critical tasha fixes for 48x2 frames
pulled in the changes from the below commits.

Ia4329ac982eb2a29a2b925897cd87ca9711c30e3
Ic0ab015098035418458a5ba7c2ffad9df20f933c
Ia091228b5a6e6d3dced2bee6cd5fecf5632a62a0

Change-Id: Ie89d37060a73a190f752eebf226c630a903f0c1b
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-04-26 03:11:39 -07:00
Santosh Mardi 6203e5d262 ASoC: msm: critical tasha fixes
tasha fixes pulled in by the below change id.

I4ca4a554c0a83d4053301ca5dd2afb8b09fa5194
I2cb4447b36fef111ed1f9b8991b3882b8d57f6a7
I80ee0dedac8fa81ce54a0e61c839a97b9b45d36b

Change-Id: I258d5bb48a25f13e0c0f348a8f6a7bf1b38922d0
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
2016-03-22 13:04:44 +05:30
Sudheer Papothi 3801154abf soundwire: Disable ports in both banks after playback usecase
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>
2015-12-14 06:03:38 -08:00
Sudheer Papothi 1455868f44 soundwire: put soundwire in suspend state when system is idle
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>
2015-12-03 02:55:59 -08:00
Laxminath Kasam da3830af82 soundwire: Remove pm runtime sync during soundwire read and write
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>
2015-11-04 13:59:19 +05:30
Banajit Goswami 794ad84fbf soundwire: disable runtime PM before marking it as suspend
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>
2015-11-04 13:58:15 +05:30
Sudheer Papothi 13e9f7543f soundwire: Changes to reduce cold start output latency
Refactor soundwire master driver code by optimizing port
configuration and supporting multi register write to reduce
cold start output latency.

Change-Id: I997e47810ece4414707c5e284510595e78aca639
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2015-10-21 10:41:53 +05:30
Linux Build Service Account aa5f5cdcd0 Merge "Revert "soundwire: hack to register all the bongo's"" 2015-10-20 04:37:30 -07:00
Linux Build Service Account fd9fdeb19a Merge "soundwire: don't disable clock during suspend" 2015-10-16 04:42:44 -07:00
Linux Build Service Account d273a3fd0e Merge "ARM: dt: msm: add more wsa881x devices for MSM8976 targets" 2015-10-16 04:42:42 -07:00
Yeleswarapu Nagaradhesh a42d47f139 Revert "soundwire: hack to register all the bongo's"
This reverts commit 9825f3404c.

Change-Id: I5bc2cbd3d725f3edb28ea0ac830ecf5924aaefb5
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2015-10-15 00:17:16 -07:00
Yeleswarapu Nagaradhesh 94296c40cd soundwire: don't disable clock during suspend
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>
2015-10-14 01:46:40 -07:00
Banajit Goswami df4fdb8676 soundwire: call startup function for remaining slave init
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>
2015-10-14 01:43:42 -07:00
Vidyakumar Athota e3433eb0ea ASoC: soundwire: fix out of boundary access issues
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>
2015-10-13 23:29:13 -07:00
Banajit Goswami 6ef49550ee soundwire: compare only dev-ID part of Chip-ID for slave device
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>
2015-08-18 05:51:47 -07:00
Banajit Goswami c3be7c799b soundwire: turn soundwire device off if device is down
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>
2015-08-12 05:10:42 -07:00
Yeleswarapu Nagaradhesh 9825f3404c soundwire: hack to register all the bongo's
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>
2015-08-06 00:11:03 -07:00
Yeleswarapu Nagaradhesh 4ff9349c8b ASoC: wcd: update codec driver to maintain the power states
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>
2015-07-22 23:07:02 +05:30
Sudheer Papothi 8b8a7b78dc soundwire: Add support for clock pause and resume
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>
2015-07-22 23:06:48 +05:30
Sudheer Papothi e11c89562e soundwire: Remove hardcoding of soundwire slave devices
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>
2015-07-20 09:36:24 -07:00
Sudheer Papothi 2dc618c734 soundwire: Print message to identify slave device IDs
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>
2015-07-02 11:11:56 -07:00
Sudheer Papothi 4ca2a23dab soundwire: Change in soundwire master init sequence
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>
2015-05-24 00:56:53 -07:00
Sudheer Papothi 492a70c12f soundwire: Add debug support for soundwire master
Add debug support in soundwire master driver to
peek/poke soundwire master registers.

Change-Id: I5451f6d50e4c8b1fcc4e9238a59fa7f54cc2c8a3
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2015-05-14 00:56:30 +05:30
Sudheer Papothi 04bd59fad6 soundwire: Add support to get notifications from WCD9935
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>
2015-05-14 00:56:13 +05:30
Sudheer Papothi fe5c8380f1 soundwire: Update soundwire master port configuration
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>
2015-05-12 18:04:38 +05:30
Sudheer Papothi c589dd2b43 soundwire: Enable soundwire clock
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>
2015-05-12 18:04:36 +05:30
Linux Build Service Account 5cc8d7b275 Merge "soundwire: Check for NULL pointer dereference" 2015-05-08 21:50:42 -07:00
Sudheer Papothi 57bb56ad7a soundwire: Check for NULL pointer dereference
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>
2015-05-08 12:13:59 -07:00
Sudheer Papothi b1d4d5453c soundwire: Add support to get logical device number
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>
2015-05-07 03:31:57 -07:00
Sudheer Papothi 6c1f428522 soundwire: Initial version of soundwire master
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>
2015-05-01 00:08:01 -07:00