summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tas5086.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal1-1/+1
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>
2016-09-29Merge remote-tracking branches 'asoc/topic/tas5086', 'asoc/topic/tegra', ↵Mark Brown1-1/+1
'asoc/topic/tlv320aic31xx', 'asoc/topic/tlv320dac33' and 'asoc/topic/topology' into asoc-next
2016-08-24ASoC: tas5086: fix typo: "Inavlid" -> "Invalid"Colin Ian King1-1/+1
trivial typo fix in dev_err message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on tas5086Kuninori Morimoto1-6/+8
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>
2015-08-30Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown1-3/+7
'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
2015-07-23ASoC: tas5086: Improve the logic for de-emphasis sampling rate selectionAxel Lin1-3/+7
Slightly improve the logic for de-emphasis sampling rate selection by break out the loop if the rate is matched. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
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-03-10ASoC: tas5086: Fix wrong value references for boolean kctlTakashi Iwai1-2/+2
The correct values referred by a boolean control are value.integer.value[], not value.enumerated.item[]. The former is long while the latter is int, so it's even incompatible on 64bit architectures. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2014-08-04Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', ↵Mark Brown1-4/+4
'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
2014-07-31ASoC: tas5086: Convert to params_width()Mark Brown1-4/+4
The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-03ASoC: tas5086: add regulator consumer supportDaniel Mack1-9/+58
The TAS5086 has two power domains, DVDD and AVDD. Enable them both as long as the codec is in use. Also, switch on the power to identify the chip at device probe level, and switch it off again afterwards. The codec level will take care for power handling later. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen1-2/+2
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-25Merge tag 'asoc-v3.13' of ↵Takashi Iwai1-62/+109
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.13 - Further work on the dmaengine helpers, including support for configuring the parameters for DMA by reading the capabilities of the DMA controller which removes some guesswork and magic numbers fromm drivers. - A refresh of the documentation. - Conversions of many drivers to direct regmap API usage in order to allow the ASoC level register I/O code to be removed, this will hopefully be completed by v3.14. - Support for using async register I/O in DAPM, reducing the time taken to implement power transitions on systems that support it.
2013-10-16ASoC: tas5086: Include linux/of.h headerSachin Kamat1-0/+1
'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-14sound: Remove unnecessary semicolonsJoe Perches1-1/+1
These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-03ASoC: tas5086: add suspend callbackDaniel Mack1-2/+28
When going to suspend, shut down all channels and re-do the init procedure at resume time. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-03ASoC: tas5086: move initialization code to own functionsDaniel Mack1-56/+72
We'll need to call code to initialize and reset the codec again at resume time, so factor it out first. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-03ASoC: tas5086: move two variables into private structDaniel Mack1-9/+13
We need to access the charge_period and start_mid_z values from other places later, so move them to the private struct. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-28ASoC: tas5086: fix Mid-Z implementationDaniel Mack1-6/+9
It turns out that the TAS5086 doesn't like channel start parts to be empty, and if all channels are configured to Mid-Z, part 1 has to be used. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-28ASoC: tas5086: fix TAS5086_CLOCK_CONTROL register sizeDaniel Mack1-1/+1
The TAS5086_CLOCK_CONTROL also has a size of 1 byte. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25ASoC: tas5086: add support for pwm start mode configDaniel Mack1-0/+22
The TAS5086 has two alternative modes to start its PWM channels, Mid-Z and Low-Z. Which one to use depends on how the PWM power stages are connected to the TAS5086. This patch adds 6 optional boolean properties to the DT bindings of the driver which allow the user to configure each individual channel to the Mid-Z scheme, and leaves all the others to the default (Low-Z). Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25ASoC: tas5086: add DAPM mux controlsDaniel Mack1-0/+200
The TAS5086 has two muxes, one for connecting I2S inputs to internal channels, and another one for selecting which internal channel should be routed to which PWM output pin. This patch adds DAPM widgets and routes for this driver. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25ASoC: tas5086: add more register definesDaniel Mack1-3/+17
Add register definitions for input and output mux registers, and rewrite the tas5086_accessible_reg() function. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-25ASoC: tas5086: open-code I2C transfer routinesDaniel Mack1-1/+84
In order to support registers of unequal sizes, the I2C I/O has to be open-coded. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-03-13ASoC: tas5086: signedness bug in tas5086_hw_params()Dan Carpenter1-1/+1
"val" has to be signed for the error handling to work. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-12ASoC: tas5086: use module_i2c_driver to simplify the codeWei Yongjun1-11/+1
Use the module_i2c_driver() macro to make the code smaller and a bit simpler. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-08ALSA: ASoC: add codec driver for TI TAS5086Daniel Mack1-0/+601
This patch adds a driver for TI's TA5086 6-channel PWM processor. This chip has a very unusual register layout, specifically because the registers are of unequal size, and multi-byte registers require bulk writes to take effect. Regmap does not support these kind of mappings. Currently, the driver does not touch any of the registers >= 0x20, so it doesn't matter, because the register map is mapped to an 8-bit array. In case more features will be added in the future that require access to higher registers, the entire regmap H/W I/O routines have to be open-coded. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>