Commit graph

10 commits

Author SHA1 Message Date
Mark Brown 480d060b9e Merge remote-tracking branches 'asoc/topic/da7218', 'asoc/topic/da7219' and 'asoc/topic/dpcm' into asoc-next 2016-09-29 12:44:21 -07:00
Adam Thomson 72dce36892 ASoC: da7218: Improve driver efficiency with regards to MCLK usage
Currently MCLK remains enabled during bias STANDBY state, and this
is not necessary. This patch updates the code to handle enabling
and disabling of MCLK, if provided, when moving between STANDBY
and PREPARE states, therefore saving power when no active streams
present.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 15:57:07 +01:00
Adam Thomson 8799af0d82 ASoC: da7218: Remove 32KHz PLL mode from driver
Functionality has been removed in latest silicon variants. This
patch removes the feature from the driver to align.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08 15:57:07 +01:00
Kuninori Morimoto 91985829cc ASoC: codec duplicated callback function goes to component on da7218
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
Adam Thomson ae48a35c40 ASoC: da7218: Update PLL ranges and dividers to improve locking
The expected MCLK frequency ranges and the associated dividers
are updated to improve PLL locking in a corner scenario, with low
MCLK frequency near an input divider change boundary.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-22 16:26:19 +01:00
Adam Thomson f644eb62fe ASoC: da7218: Correct BCLK inversion for DSP DAI format mode
By default the device latches data on the falling edge of the
BCLK in DSP mode, whereas the expectation for normal BCLK is to
latch on the rising edge. This updates the driver to invert the
BCLK configuration for DSP mode, to align with expected behaviour.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-05 18:27:13 +00:00
Adam Thomson e05c25a1af ASoC: da7218: Enable mic level detection reporting to user-space
This patch adds support to the codec driver to handle mic level
detect related IRQs, and report these to user-space using a uevent
variable.

The uevent variable string "EVENT=MIC_LEVEL_DETECT" is sent to
user-space, if the mic level detect feature is enabled, and the
audio captured at the chosen mic(s) is above a certain threshold.
User-space can then handle the event accordingly (e.g. process
audio capture stream).

This method was chosen over ALSA control notification for a couple
of reasons:

 1) There's no requirement here for a control to read state from.
    The event is the only thing that's required and of interest.
 2) tinyalsa support for control notifications does not exist so on
    platforms using this over alsa-lib there is a need to add code
    to support this event handling.

Another possible option would be to use the standard Jack reporting
framework but this really does not fit for this kind of event.

Finally, use of the input device framework is not being encouraged,
due to difficulties in enabling apps to access input devices, so
this has also been avoided.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-22 23:54:26 +00:00
Arnd Bergmann ff793af4ce ASoC: da7218: avoid 64-bit compile warning
When building the da7218 driver on a 64-bit architecture, we get
a harmless warning:

sound/soc/codecs/da7218.c: In function 'da7218_of_get_id':
sound/soc/codecs/da7218.c:2261:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

This changes the code to use uintptr_t to ensure we have an integer
type of the same size as a pointer and won't get a warning on any
architecture.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4d50934abd ("ASoC: da7218: Add da7218 codec driver")
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-08 18:18:59 +00:00
kbuild test robot 112446aa2e ASoC: da7218: fix boolreturn.cocci warnings
sound/soc/codecs/da7218.c:3214:9-10: WARNING: return of 0/1 in function 'da7218_volatile_register' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-01 19:29:09 +00:00
Adam Thomson 4d50934abd ASoC: da7218: Add da7218 codec driver
This adds support for DA7217 and DA7218 audio codecs.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30 12:24:12 +00:00