aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/ssm4567.c
AgeCommit message (Collapse)Author
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-05ASoC: ssm4567: Add OF device ID tableJavier Martinez Canillas
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Before this patch: $ modinfo sound/soc/codecs/snd-soc-ssm4567.ko | grep alias alias: acpi*:INT343B:* alias: i2c:ssm4567 After this patch: $ modinfo sound/soc/codecs/snd-soc-ssm4567.ko | grep alias alias: acpi*:INT343B:* alias: of:N*T*Cadi,ssm4567C* alias: of:N*T*Cadi,ssm4567 alias: i2c:ssm4567 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on ssm4567Kuninori Morimoto
codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-27ASoC: ssm4567: Reset device before regcache_sync()Lars-Peter Clausen
When the ssm4567 is powered up the driver calles regcache_sync() to restore the register map content. regcache_sync() assumes that the device is in its power-on reset state. Make sure that this is the case by explicitly resetting the ssm4567 register map before calling regcache_sync() otherwise we might end up with a incorrect register map which leads to undefined behaviour. One such undefined behaviour was observed when returning from system suspend while a playback stream is active, in that case the ssm4567 was kept muted after resume. Fixes: 1ee44ce03011 ("ASoC: ssm4567: Add driver for Analog Devices SSM4567 amplifier") Reported-by: Harsha Priya <harshapriya.n@intel.com> Tested-by: Fang, Yang A <yang.a.fang@intel.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-14ASoC: ssm4567: Add sense supportLars-Peter Clausen
The ssm4567 has sensing circuitry that can be used to monitor the current and voltage on the speaker amplifier output has well as the VBAT input. This data can be output over the I2S interface so it can be processed by a DSP or similar. This patch adds the sense capture output stream to the CODEC DAI as well as DAPM widgets that ensure that the sensing circuitry is powered up when the capture stream is active. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24Merge branch 'fix/ssm4567' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-ssm4567
2015-07-24Merge branch 'topic/owner' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-ssm4567 Conflicts: sound/soc/codecs/ssm4567.c
2015-07-24ASoC: ssm4567: Added ACPI entry for SSM4567 codecHarsha Priya
Added INT343B ACPI ID for the SSM4567 codec Signed-off-by: Harsha Priya <harshapriya.n@intel.com> Signed-off-by: M Naveen <naveen.m@intel.com> Signed-off-by: M R Sathya Prakash <sathya.prakash.m.r@intel.com> Acked-by: Anatol Pomozov <anatol.pomozov@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-22ASoC: ssm4567: Keep TDM_BCLKS in ssm4567_set_dai_fmtBen Zhang
The regmap_write in ssm4567_set_dai_fmt accidentally clears the TDM_BCLKS field which was set earlier by ssm4567_set_tdm_slot. This patch fixes it by using regmap_update_bits with proper mask. Signed-off-by: Ben Zhang <benzh@chromium.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Anatol Pomozov <anatol.pomozov@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-05Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/ssm2518', ↵Mark Brown
'asoc/topic/ssm2602', 'asoc/topic/ssm4567' and 'asoc/topic/sta32x' into asoc-next
2015-05-04ASoC: ssm4567: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06ASoC: ssm4567: Add support for disabling the boost stageLars-Peter Clausen
This patch adds a switch to enable/disable boost stage of the output amplifier. Applications that know that they do not need the output amplifier boost stage can disable it to conserve a bit of power. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06ASoC: ssm4567: Add support for setting the DAI format and TDM configurationLars-Peter Clausen
The SSM4567 has support for a couple of different DAI formats. In TDM mode it is also possible to select the TDM slot. This patch adds support for this by implementing the set_fmt and set_tdm_slot callbacks. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06ASoC: ssm4567: Add DAC high-pass-filter controlLars-Peter Clausen
Add a switch which can be used to enable/disable the DAC high-pass-filter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-02ASoC: ssm4567: Remove duplicated else-if branchAnatol Pomozov
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-27ASoC: ssm4567: Add driver for Analog Devices SSM4567 amplifierAnatol Pomozov
Analog Devices SSM4567 is a boost class-D audio amplifier. Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>