Commit graph

17 commits

Author SHA1 Message Date
Kuninori Morimoto 87869e4fad ASoC: codec duplicated callback function goes to component on es8328
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-08-08 11:57:57 +01:00
John Keeping ca0d879739 ASoC: es8328: Set symmetric rates
Although the ES8328 does support different rates for capture and
playback, only very limited combinations are supported (8kHz and 48kHz
or 8.0182kHz and 44.1kHz) with most rates required to be symmetric.

Instead of adding a lot of complexity for little gain, let's enforce
symmetric rates.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 45749c9181 ASoC: es8328: Support more sample rates
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 779e86a314 ASoC: es8328: Support more sample formats
The values are the same for the DAC and ADC so remove the specific
values and use values with shifts.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 8865c95e43 ASoC: es8328: Move sample size setup to hw_params
This is a refactor in preparation for supporting more sample sizes which
has no functional change.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping f2ed04a431 ASoC: es8328: Use single R/W for regmap
The chip only supports single reads and writes.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 57e41f3fb3 ASoC: es8328: Fix ADC format setup
The ADCCONTROL4 and DACCONTROL1 registers are similar but not identical,
with the DACCONTROL1 having each field starting one bit higher than
ADCCONTROL4.

Instead of introducing a magic shift, add new constants for the values
in ADCCONTROL4 and use a second variable to setup the ADC.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 420c470d6b ASoC: es8328: Move clock setup to hw_params
This ensures that the clock is setup after its frequency has been set;
the existing code in set_dai_fmt may be called before the clock rate has
been set resulting in an incorrect configuration.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-10 18:56:01 +01:00
John Keeping 352d52e244 ASoC: es8328: Fix shifts for mixer switches
These are all off by one; the playback and bypass switches are the top
two bits of the registers, which are at shifts 7 and 6 not 8 and 7.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-12 22:06:20 +00:00
John Keeping 84ebac4d04 ASoC: es8328: Fix deemphasis values
This is using completely the wrong mask and value when updating the
register.  Since the correct values are already defined in the header,
switch to using a table with explicit constants rather than shifting the
array index.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-12-09 20:42:19 +00:00
Dan Carpenter 7ab8a54ea7 ASoC: es8328: harmless underflow in es8328_put_deemph()
Valid values for "deemph" are zero and one but we accidentally allow
negative values as well.  It's harmless but it causes static checker
warnings and we may as well clean it up.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-22 13:58:04 +01:00
Lars-Peter Clausen 2aff57e333 ASoC: es8328: Replace direct snd_soc_codec dapm field access
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-05-11 17:33:31 +01:00
Lars-Peter Clausen f4bf8d770b ASoC: Move bias level update to the core
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>
2015-04-27 21:34:45 +01:00
Takashi Iwai d223b0e7fc ASoC: es8238: Fix wrong value references for boolean kctl
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>
2015-03-10 20:15:09 +00:00
Lars-Peter Clausen 8d01370f59 ASoC: es8328: Cleanup manual bias level transitions
Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-06 13:38:30 +01:00
Wei Yongjun 75c3daaad5 ASoC: es8328: fix error return code in es8328_codec_probe()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01 11:34:00 +01:00
Sean Cross 567e4f9892 ASoC: add es8328 codec driver
Add a codec driver for the Everest ES8328.  It supports two separate audio
outputs and two separate audio inputs.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16 17:17:13 -05:00