Some systems wish to use jacks as wake sources. Provide a wake flag in the
GPIO configuration which causes the driver to enable the IRQ as a wake
source.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
The only thing that should ever be calling this is soc-core and that is
built as part of the same module so doesn't need the export.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Pulseaudio doesnt work with current driver and it was root caused to absense of
hw_params function and malloc_pages in it.
This patch adds this and allows pa to work fine with these drivers
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch removes the old method of soc-audio device creation in mfld machine
and makes use of new soc_register_card API to register the card
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The tlv scale is defined as (min, step, mute). The mute is not supported here so
put the value to 0
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch makes the DMIC dynamically connect to TX Mux, earlier code had
erroneously made this as static path
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch makes the codec playback rails (headset and speaker) depend on
actual pins they control. This enables better power management of the codec
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The WM8903 interrupts are clear on read so if the WM8903 detection is
enabled from platform data when the IRQ is in use (rather than using a
direct signal from a GPIO) status may be lost during startup. Help users
spot this misconfiguration by adding a WARN_ON().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
With the appropriate MODULE_ALIAS in place, the audio modules will be
automatically loaded; there is no longer a need for manual modprobes.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Harmony has both an external mic (a regular mic jack) and an internal mic
(a 0.1" two-pin header on the board).
The external mic is connected to the WM8903's IN1L pin, and is supported
by the current driver.
The internal mic is connected to the WM8903's IN1R pin, and is not supported
by the current driver.
It appears that no Harmony systems were shipped with any internal mic
connected; users were expected to provide their own. This makes the
internal mic connection less interesting.
The WM8903's Mic Bias signal is used for both of these mics. For each mic,
a GPIO drives a transistor which gates whether the mic bias signal is
actively connected to that mic, or isolated from it.
The dual use of the mic bias for both mics makes a general-purpose complete
implementation of mic detection using the mic bias complex. So, for
simplicity, the internal mic is currently ignored by the driver.
This patch configures the relevant GPIOs to enable the mic bias connection
to the external mic, and disable the mic bias connection to the internal
mic. Note that in practice, this is the default state if these GPIOs aren't
configured.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Add jack definition for mic jack
* Request wm8903 to enable mic detection
* Force mic bias on, since it's required for mic detection
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
If a widget has been force enabled then not only do we need to keep the
widget itself enabled, we also need to keep any supplies the widget
requires enabled. The user could force all the individual widgets on but
this requires too much knowledge of device internals.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
On WM8994 revision D and earlier ensure proper playback robustness
as some rare use cases can trigger issues.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
Ensure that on disabling certain registers such as AIF1DAC1L,
AIF1DAC1R etc. the AIF1CLK and AIF2CLK remain enabled. Similarly
when enabling those registers, AIF1CLK and AIF2CLK will remain
disabled.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
The mic detection HW should be enabled when either mic or short detection
is required, not when only both are required.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
* There is no hysteresis enable field in the current datasheet.
* Mic detection threshold field is only 2 bits wide.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It is safe to use sleeping gpio in snd_soc_jack_gpio_detect as it is not
called from interrupt context. This avoids WARN_ON from __gpio_get_value
if sleeping gpio is registered for jack.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch modifies the mfld_machine to use the new jack apis for adding the
voltage zones for jack type detection. It also modifed TI sn95031 codec driver
to use these new apis
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This makes no real difference compared to the write sequencer sequence
that was previously used but can run without a clock being provided.
Also remove the write sequencer support code as this was the last use
of it.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
The write sequencer sequencer sequence takes longer than is desirable
as it brings up a full playback path which is not required at this
point. Open coding the sequence cuts the startup time by two thirds.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Content of the CX20442's snd_soc_codec_driver.reg_cache_default pointed
area, introduced with my recent NULL pointer dereferece fix (commit
f019ee5feb), occured wrong after further
testing, more thorough than just booting successfully. There are two
problems with it:
1) It should read
(1 << CX20442_TELOUT) | (1 << CX20442_MIC),
not
CX20442_TELOUT | CX20442_MIC.
2) While correctly matching actual codec hardware state on boot when
fixed per 1), a few more code modifications would still be required
to reflect that state not only into register cache, but also force
them into DAPM pins state, otherwise an inconsitency occures which
may prevent further codec state changes from being applied correctly.
As a result, the phone stops ringing after reboot, until someone
picks up the handset for the first time.
Revert that reg_cache_default content to a working, previous de facto
default value of 0, in hope this change can still be accepted as an rc
cycle fix.
Created and tested against linux-2.6.38-rc4
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Explicitly cache the DC servo offsets for digital paths in the driver,
allowing them to be preserved over suspend and resume, and ensure that
we recalibrate analogue outputs paths when they are in use so that we
cover any changes in the input offset.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This patch adds soc-jack support for adding voltage zones and for
detecting jack type
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC generally uses the register defaults for everything, but in some
cases the hardware will default to enabling some of the DAPM widgets
(clocks for example). Ensure that DAPM knows about the actual widget
state at initialisation by reading the enable bits after instantiating
the widgets so they don't get left enabled needlessly.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
The WM8903 register map does not mute the DAC by default at startup
so we need to explicitly do so.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This simplfies the code and slightly reduces the startup time.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
It causes noisy -codecs to appear in things like .codec_name.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This patch modifies the Davinci i2s and mcasp drivers to make use of
ioremap() instead of IO_ADDRESS()
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In case of any error in probe() function, clk_disable() and clk_put()
should be called if clk_enable() and clk_get() went through.
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch modifies the Davinci i2s and mcasp drivers
to make use of the resource_size() helper function for readability.
Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support to read the mic bias voltage
when a jack is inserted. It uses ADC to measure.
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support for registering jack interupt
and registering jack with core
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This patch adds support for jack detection and reporting in the codec
It however is not fully functional as it doesn't measure adc to figure
out what got inserted which will be added later
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Harsha Priya <priya.harsha@intel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The patch c358e640a6 "ASoC: soc-cache: Add trace event for
snd_soc_cache_sync()" introduced a dereference of "codec->cache_ops"
before we had checked it for NULL.
I pulled the check forward, and then pulled everything in an indent
level.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Move Chip Select control out of the CODEC code for CS4271.
Signed-off-by: Alexander Sverdlin <subaparts@yandex.ru>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The wm8753 codec supports switching between different DAI modes.
The current drivers tries to implement this by changing the DAI driver at
runtime. But to properly work this would require support from the ASoC core.
So this patch takes a different approch on how the DAI mode switching is
implemented.
The only difference, from a driver point of view, between the different DAI modes
is how to program the DAI format to the hardware. So what this patch is, it
stores the current format for each DAI in the drivers private struct and when
the DAI mode is changed the format gets simply reprogrammed according to the
new DAI mode.
Futhermore this patch restricts the changing of the DAI format to when the
codec is inactive.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>