ALSA: hda - Enable auto-parser as default for Conexant codecs

Let's use auto-parser as default now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix unused variable warning

sound/pci/hda/patch_cmedia.c: In function ‘cmi9880_fill_multi_init’:
sound/pci/hda/patch_cmedia.c:401:15: warning: unused variable ‘len’

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix jack-detection on non-VT1708 VIA codecs

Move codec init verb which is only applicatable for VT1708.

I've found the root cause that jack plugged in can't be detected.
The verb in vt1708_init_verbs is used to power down jack detect circuit.
This verb is only applicable to VT1708. vt1708 didn't implement jack
detect function in hardware, so we should shut down this function to
avoid noise. But for other codecs, hardware implement jack detect
function. If sending this verb during initialization, jack detect will
be invalid. So I move this verb from via_parse_auto_config() to
patch_vt1708().

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
omap2+: fix build regression

board-generic.c now contains a reference to omap3_timer, but depends
only on ARCH_OMAP2, not on ARCH_OMAP3, which controls that symbol.
omap2_timer seems to be more appropriate anyway, so use that instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
ALSA: hda - Re-implementation of VIA Independent-HP sharing with side stream

This patch adds the re-implementation of Independent-HP mode in the
case where the DAC is shared between HP and side-channel streams.
Now the driver tries to parse the output-path using the pre-parsed
side-channel DAC for the independent HP output, too.

When a playback PCM stream is opened with this shared mode, the
Independent-HP mixer switch can't be changed for avoiding the conflict,
thus it returns -EBUSY error.

One remaining unintuitive issue is that the DAC volume is still
controlled as "Side" volume although it's shared by both independent-HP
and side streams.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix missing initialization in alc662 auto-parser

A missing initialization resulted in wrong DAC assignments in
ALC662 (and other) auto-parsers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix the silent front with independent-HP for VIA codecs

Unmute DAC on front speaker path when Independent HP is enabled.

When to enable Independent HP, the front speaker won't output any sound
for VT1708, VT1708B, VT1708S and VT1702.
I find the via_independent_hp_put() routine will mute DAC 0 path in Mixer 0.
For these codecs, when using Independent HP, there could have two
independent streams, one is from DAC0-->Mixer0-->Front Pin, the other is
from DAC3-->GainSW3-->Side Pin.
So I added a check for DAC-->Mixer path in activate_output_path().

If current path is DAC-->Mixer, no need to mute DAC index in Mixer.
In fact, to change connection of Headphone pin or Mux connected with HP
is enough.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix issue that front can't output sound for VT1718S

For VT1718S, Mixer 9 doesn't expose the connection to DAC 0. So when
building up a 'PCM Playback' amplifier control, it will fail since
getting DAC 0 index of Mixer 9 returned -1. So I added a dac_mixer_idx
to indicated the actual index of DAC 0 to Mixer 9. Following is the
patch and next mail is another.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix invalid multi-channel amplifiers for VT1718S

For VT1718S, the multi-channel path should be like following:
DAC 0-->Mixer 9(index 5)-->Mixer 0(index 1)-->Front Pin;
DAC 1-->Mixer 1(index 0)-->Surround Pin;
DAC 2-->C/LFE Pin;
DAC 3-->Mixer 2(index 0)-->Side Pin;

But current code built Surround and Side path through index 1 of
Mixer 1 and 2. So Adjusting Surround and Side channel amplifier is
invalid. This patch fixes the issue.

Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Define some constants in patch_via.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Create HP-vol control properly for VIA codecs

When the individual DAC is available for the headphone output, the driver
should create the DAC for its volume control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Don't add aa-mix for VIA surrounds

Since we now route the front DAC via aa-mix widget, adding the aa-mix
to surrounds will result in a mix-up of both front and surround PCM
signals.  For avoiding this, the aa-mix routes have to be disabled
for surround paths.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
OMAP: New twl-common for common TWL configuration

Introduce a new file, which will be used to configure
common pmic (TWL) devices, regulators, and TWL audio.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
OMAP4: Move common twl6030 configuration to twl-common

Reduce the amount of duplicated code by moving the common
configuration for TWL6030 (on OMAP4 platform) to the
twl-common file.
Use the omap4_pmic_get_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
OMAP3: Move common twl configuration to twl-common

Reduce the amount of duplicated code by moving the common
configuration for twl4030/5030/tpsxx to the twl-common file.
Use the omap3_pmic_get_config function from board files to
properly configure the PMIC with the common fields.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
OMAP3: Move common regulator configuration to twl-common

Some regulator config can be moved out from board files,
since they are close to identical.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
MFD: twl4030-codec: Rename internals from codec to audio

In preparation of renaming the driver from twl4030-codec
to twl4030-audio, first do some clean ups in the driver,
which does not cause any problems outside.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
MFD: twl4030-codec -> twl4030-audio: Rename the driver

Rename the driver, and header file from twl4030-codec to
twl4030-audio.
To avoid breakage change depending drivers at the same time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Misael Lopez Cruz <misael.lopez@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
MFD: twl4030-audio: Rename platform data

Allign the platform data names for twl4030 audio submodule:
twl4030_audio_data: for the core MFD driver
twl4030_codec_data: for ASoC codec driver
twl4030_vibra_data: for the input/ForceFeedback driver

To avoid breakage, change all depending drivers, files
to use the new types.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
mfd: twl6040: Add initial support

TWL6040 IC provides analog high-end audio codec functions for
handset applications. It contains several audio analog inputs
and outputs as well as vibrator support. It's connected to the
host processor via PDM interface for audio data communication.
The audio modules are controlled by internal registers that
can be accessed by I2C and PDM interface.

TWL6040 MFD will be registered as a child of TWL-CORE, and will
have two children of its own: twl6040-codec and twl6040-vibra.

This driver is based on TWL4030 and WM8350 MFD drivers.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>