exynos5410: odroid-xu -- Better default configuration file
CHROMIUM: ASoC: samsung: add daisy_max98095.c board

Add the ASoC board plumbing for max98095 on daisy/snow.

Signed-off-by: Humberto Silva Naves <hsnaves@gmail.com>
CHROMIUM: ASoC: samsung: HP detect plumbing for snow

This adds HP detect through the external GPIO on Snow. I've hardcoded
the GPIO for now since we need to move the whole ASoC configuration to
device tree (a la tegra) and will move it to a proper gpio specifier
there when we do so.

BUG=none
TEST=start up, browse youtube, bring up an awesome music video, plug in
headphones, rock out.

Change-Id: I9b7d1452f43f68f1e17bc8868f1d9c56d09db87b
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27866
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
CHROMIUM: ASoC: samsung: Route clocks to i2s.

Configure the clocks so that the i2s block is driven with a clock that
can be divided to the current audio frequency.  The rate of epll is
already being adjusted to match the frame rate, but epll was not being
configured to drive the audio clocks.  At init, set the clock muxes to
route epll through the muxes.  This fixes audio on Daisy playing back
too fast (6% fast for 44.1, almost 2x for 48k).

BUG=chrome-os-partner:11225
TEST=Play sine waves of various frequencies and check they are rendered
correctly with a spectrum analyzer.

Change-Id: I46c5f466088a825942931007b49fcde2e40e9fc6
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28453
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: ASoC: samsung: daisy_max98095 is a platform driver.

Convert daisy_max98095 to a platform driver that is compatible with
'google,daisy-audio-max98095'.  This brings it more in line with other
machine drivers from the soc tree and provides the ability to add GPIO
specifiers to device tree in subsequent commits.

BUG=chrome-os-partner;12112
TEST=aplay <wav file>, arecord, youtube audio works.

Change-Id: I5624686178d89afaef911c9a3eb067b7fb4902a0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29625
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: ALSA: ASoC: Get snow hp/mic detect GPIOs from device tree.

Get the GPIOs used for hp and mic detect from the device tree.  Getting
them from device tree allows for the pull up/pull down to be properly
configured (it is disabled) and for mic detect to be inverted.

BUG=chrome-os-partner:10849
TEST=aplay/arecord on snow work.  evtest shows events for hp and mic
detection.

Signed-off-by: Dylan Reid <dgreid@chromium.org>

Change-Id: I93d994a2ec5c22683c6eb5fd502f6a54c8e8d964
Reviewed-on: https://gerrit.chromium.org/gerrit/29626
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>
CHROMIUM: ASOC: Samsung: Change MAX98095 MCLK input clk

This patch configures the codec system clock with xclkout.
with out this patch there is a error while playing 8,22.05,
32KHz sampling rate files. The error was

max98095 7-0011: Invalid master clock frequency
[ 46.194905] asoc: machine hw_params failed: -22
Stream error -22

BUG=chrome-os-partner:12733
TEST=Tested with all supported sampling frequencys in cramfs.
All are playing fine except 8KHz and 32KHz are playing with
some error messages like below

[ 1262.417869] exynos5_epll_set_rate: Invalid Clock EPLL Frequency
[ 1262.417885] failed to clk_set_rate of fout_epll for audio

Change-Id: I5891ac9bbae1eeb6befb6992699e59e3e8977c24
Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/30538
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
CHROMIUM: ASoC: samsung: Spring is using max98095 codec

Spring is also using the Maxim max98095 codec for audio.
Add it to the list of supported boards.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:14490
TEST=on Spring, plug a headset, play a video on Youtube and hear the
sound.

Change-Id: If17a3ba240943412acf03b24058218c40781944f
Reviewed-on: https://gerrit.chromium.org/gerrit/38205
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
CHROMIUM: ASoC: Samsung: change the clock instance name

clock instance name changed according to mainline code

Change-Id: Ic2486dc9055c8d7ec6e2d40697c432ab80756135
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
CHROMIUM: ASoC: Samsung: I2s Instance 0 Platform name changed

platform name changed to the name same as cpu dai for the I2S 0 instance.

Change-Id: I373d71d6c2df13d7c2f4ede2da6a746fe80b895b
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: R. Chandrasekar <rcsekar@samsung.com>
CHROMIUM: ASoC: Samsung: remove __devinit, __devexit annotations

The __devinit, __devexit annotations  are not supported on kernel v3.8.rc4
so remove them.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
CHROMIUM: ALSA: ASoC: daisy - Poll gpio jacks after resume.

After resume, poll the gpio jacks in case they changed while sleeping.

BUG=chrome-os-partner:14417
TEST=Plug headphones, play audio, suspend, unplug, resume, check audio
comes from speakers.

Change-Id: I32f47b19516094fccb253e6ec5e482f6890cecb9
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34048
Reviewed-by: Olof Johansson <olofj@chromium.org>
CHROMIUM: alsa/soc: adding support for hdmi audio to i2s card

This patch adds hdmi-audio plugin to i2s card. It also contains the changes
for DAPM changes and Error fixes from Sean and Vincent.

Change-Id: I25c7d9c23c91caccc6127301dc86be949fc92e63
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
sound: soc: exynos: Don't set jack_cb until jack is initialized

This patch defers setting the jack_cb function until the jack has been
initialized. This avoids a race where jack_report will try to lock the
jack's mutex before it has been initialized.

BUG=None
TEST=Boot snow with HDMI attached, no crashes

Change-Id: If47783c5809ac8a43d0fd952f1ffde1763aa4198
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57146
CHROMIUM: ASoC: samsung: remove unused platform device

The "daisy-pcm-audio" platform device isn't actually used for anything.
Remove it.

BUG=chrome-os-partner:19578
TEST=Build and boot on snow; audio still works once DT bindings and CCF
support for the daisy_max98095 driver are added.

Change-Id: Ie92b91be55db12f30095204399a666f447b28a1d
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
[abrestic: cleaned-up commit message; re-ordered in patch set]
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56188
Reviewed-by: Simon Glass <sjg@chromium.org>
CHROMIUM: exynos: dts: Start sound section for daisy/snow.

Daisy and Snow both use the MAX98095 audio codec.  Specify that here so
that the correct machine driver will be chosen.  Specify the GPIOs used
on snow to detect mic and headphone configure both as inputs and disable
internal pull up/down.

BUG=chrome-os-partner:12112
TEST=Still compiles, not used yet.

Signed-off-by: Dylan Reid <dgreid@chromium.org>

Change-Id: I645d5699428d6d5599bf7b80f4b9cec6c1518071
Reviewed-on: https://gerrit.chromium.org/gerrit/29624
Reviewed-by: Olof Johansson <olofj@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Dylan Reid <dgreid@chromium.org>

[HACK] Changed patch just to add the daisy-audio-max98095.txt file.
CHROMIUM: ASoC: samsung: Pass DAI link info from device tree

This patch adds the codec, cpu, and platform OF nodes to the DAI links
instead of relying on a name-based lookup of the DAI links.  This is
required because we don't have auxdata support which registered the i2s
interface as "samsung-i2s.0" instead of <ADDRESS>.i2s.  The i2s interface
and codec are now specified in the "i2s-controller" and "audio-codec"
device-tree properties.

BUG=chrome-os-partner:19578
TEST=Build and boot on snow

Change-Id: I2e5a1ef86a0b62648f268b2f24f7ab1f62c6527c
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
[abrestic: removed stream and DAI name from DT; added documentation]
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56187
Reviewed-by: Simon Glass <sjg@chromium.org>
CHROMIUM: ASoC: samsung: Change the audio clks according to CCF

This patch updates the daisy_max98095 machine driver to use the clocks
passed via the device-tree to setup the audio clock hierarchy and change
the EPLL rate.

BUG=chrome-os-partner:19578
TEST=Build and boot on snow

Change-Id: I5a8363f63454103db6b3dccc1d107b78a9042332
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
[abrestic: added documentation; re-worked so that all necessary audio clocks
 are specified via DT]
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56194
Reviewed-by: Doug Anderson <dianders@chromium.org>
CHROMIUM: ASoC: samsung: add support for Pit with max98090

This adds support for Peach-Pit with the max98090 codec to the
daisy_max98095 machine driver.  The main difference is that
microphone bias is controlled by the pin "MICBIAS" on the max98090
vs. "MICBIAS2" on the max98095.

BUG=chrome-os-partner:18720
TEST=Audio still works on snow.  daisy_max98095 driver probes on
peach-pit once DT bindings are added.

Change-Id: I44e4fac0e523957b842e605e55d6c0234c8808d8
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57707
CHROMIUM: ASoC: samsung: initialize pll and audio bus clock rate

In the daisy_max98095 driver we rely on EPLL being set to a rate below
the limit of the AudioSS block (192Mhz on 5250 and 200Mhz on 5420) and
the audio bus divider being set to 1.  On Pit, neither of these are
initialized correctly, so explicitly set fout_epll to a reasonable
rate and then set sclk_audio0 to that rate to ensure that the audio
bus divider is 1.

BUG=chrome-os-partner:18720
TEST=Audio still works on snow; peach-pit no longer hangs when
daisy_max98095 driver is probed.

Change-Id: I5dd811078d7964979e0c58d9937163e1d3a58850
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57708
Reviewed-by: Simon Glass <sjg@chromium.org>