]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ASoC: ssm2602: Replace reg_default_raw with reg_default
authorJames Kelly <jamespeterkelly@gmail.com>
Mon, 19 Mar 2018 10:29:50 +0000 (21:29 +1100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:48:39 +0000 (11:48 -0400)
commitd8f3dfdf1e5dc12b3df6d20e5ed96af9fbbbe60e
tree4b4d79d97fb2f259c27b09eaac9ef3ee8eea6625
parent0353f1fa0c4ddf6c756c878c5642d2b18547c317
ASoC: ssm2602: Replace reg_default_raw with reg_default

BugLink: http://bugs.launchpad.net/bugs/1773233
commit a01df75ce737951ad13a08d101306e88c3f57cb2 upstream.

SSM2602 driver is broken on recent kernels (at least
since 4.9). User space applications such as amixer or
alsamixer get EIO when attempting to access codec
controls via the relevant IOCTLs.

Root cause of these failures is the regcache_hw_init
function in drivers/base/regmap/regcache.c, which
prevents regmap cache initalization from the
reg_defaults_raw element of the regmap_config structure
when registers are write only. It also disables the
regmap cache entirely when all registers are write only
or volatile as is the case for the SSM2602 driver.

Using the reg_defaults element of the regmap_config
structure rather than the reg_defaults_raw element to
initalize the regmap cache avoids the logic in the
regcache_hw_init function entirely. It also makes this
driver consistent with other ASoC codec drivers, as
this driver was the ONLY codec driver that used the
reg_defaults_raw element to initalize the cache.

Tested on Digilent Zybo Z7 development board which has
a SSM2603 codec chip connected to a Xilinx Zynq SoC.

Signed-off-by: James Kelly <jamespeterkelly@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
sound/soc/codecs/ssm2602.c