Commit 585a7c66 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: use linux/io.h to fix compile warnings
  ALSA: hda - Fix memory leaks in conexant jack arrays
  ASoC: CX20442: fix NULL pointer dereference
  ASoC: Amstrad Delta: fix const related build error
  ALSA: oxygen: fix output routing on Xonar DG
  sound: silent echo'ed messages in Makefile
  ASoC: Fix mask/val_mask confusion snd_soc_dapm_put_volsw()
  ASoC: DaVinci: fix kernel panic due to uninitialized platform_data
  ALSA: HDA: Fix microphone(s) on Lenovo Edge 13
  ASoC: Fix module refcount for auxiliary devices
  ALSA: HDA: cxt5066 - Use asus model for Asus U50F, select correct SPDIF output
  ALSA: HDA: Add a new model "asus" for Conexant 5066/205xx
  ALSA: HDA: Refactor some redundant code for Conexant 5066/205xx
parents 44f2c5c8 00e6a319
...@@ -296,6 +296,7 @@ Conexant 5066 ...@@ -296,6 +296,7 @@ Conexant 5066
============= =============
laptop Basic Laptop config (default) laptop Basic Laptop config (default)
hp-laptop HP laptops, e g G60 hp-laptop HP laptops, e g G60
asus Asus K52JU, Lenovo G560
dell-laptop Dell laptops dell-laptop Dell laptops
dell-vostro Dell Vostro dell-vostro Dell Vostro
olpc-xo-1_5 OLPC XO 1.5 olpc-xo-1_5 OLPC XO 1.5
......
...@@ -55,14 +55,13 @@ ...@@ -55,14 +55,13 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/io.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/initval.h> #include <sound/initval.h>
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/io.h>
/* /*
* globals * globals
*/ */
......
...@@ -87,7 +87,7 @@ ifeq ($(CONFIG_PSS_HAVE_BOOT),y) ...@@ -87,7 +87,7 @@ ifeq ($(CONFIG_PSS_HAVE_BOOT),y)
$(obj)/bin2hex pss_synth < $< > $@ $(obj)/bin2hex pss_synth < $< > $@
else else
$(obj)/pss_boot.h: $(obj)/pss_boot.h:
( \ $(Q)( \
echo 'static unsigned char * pss_synth = NULL;'; \ echo 'static unsigned char * pss_synth = NULL;'; \
echo 'static int pss_synthLen = 0;'; \ echo 'static int pss_synthLen = 0;'; \
) > $@ ) > $@
...@@ -102,7 +102,7 @@ ifeq ($(CONFIG_TRIX_HAVE_BOOT),y) ...@@ -102,7 +102,7 @@ ifeq ($(CONFIG_TRIX_HAVE_BOOT),y)
$(obj)/hex2hex -i trix_boot < $< > $@ $(obj)/hex2hex -i trix_boot < $< > $@
else else
$(obj)/trix_boot.h: $(obj)/trix_boot.h:
( \ $(Q)( \
echo 'static unsigned char * trix_boot = NULL;'; \ echo 'static unsigned char * trix_boot = NULL;'; \
echo 'static int trix_boot_len = 0;'; \ echo 'static int trix_boot_len = 0;'; \
) > $@ ) > $@
......
This diff is collapsed.
...@@ -92,6 +92,8 @@ struct oxygen_model { ...@@ -92,6 +92,8 @@ struct oxygen_model {
void (*update_dac_volume)(struct oxygen *chip); void (*update_dac_volume)(struct oxygen *chip);
void (*update_dac_mute)(struct oxygen *chip); void (*update_dac_mute)(struct oxygen *chip);
void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed);
unsigned int (*adjust_dac_routing)(struct oxygen *chip,
unsigned int play_routing);
void (*gpio_changed)(struct oxygen *chip); void (*gpio_changed)(struct oxygen *chip);
void (*uart_input)(struct oxygen *chip); void (*uart_input)(struct oxygen *chip);
void (*ac97_switch)(struct oxygen *chip, void (*ac97_switch)(struct oxygen *chip,
......
...@@ -180,6 +180,8 @@ void oxygen_update_dac_routing(struct oxygen *chip) ...@@ -180,6 +180,8 @@ void oxygen_update_dac_routing(struct oxygen *chip)
(1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) |
(2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) |
(3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT);
if (chip->model.adjust_dac_routing)
reg_value = chip->model.adjust_dac_routing(chip, reg_value);
oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value,
OXYGEN_PLAY_DAC0_SOURCE_MASK | OXYGEN_PLAY_DAC0_SOURCE_MASK |
OXYGEN_PLAY_DAC1_SOURCE_MASK | OXYGEN_PLAY_DAC1_SOURCE_MASK |
......
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
* *
* SPI 0 -> CS4245 * SPI 0 -> CS4245
* *
* I²S 1 -> CS4245
* I²S 2 -> CS4361 (center/LFE)
* I²S 3 -> CS4361 (surround)
* I²S 4 -> CS4361 (front)
*
* GPIO 3 <- ? * GPIO 3 <- ?
* GPIO 4 <- headphone detect * GPIO 4 <- headphone detect
* GPIO 5 -> route input jack to line-in (0) or mic-in (1) * GPIO 5 -> route input jack to line-in (0) or mic-in (1)
...@@ -36,6 +41,7 @@ ...@@ -36,6 +41,7 @@
* input 1 <- aux * input 1 <- aux
* input 2 <- front mic * input 2 <- front mic
* input 4 <- line/mic * input 4 <- line/mic
* DAC out -> headphones
* aux out -> front panel headphones * aux out -> front panel headphones
*/ */
...@@ -207,6 +213,35 @@ static void set_cs4245_adc_params(struct oxygen *chip, ...@@ -207,6 +213,35 @@ static void set_cs4245_adc_params(struct oxygen *chip,
cs4245_write_cached(chip, CS4245_ADC_CTRL, value); cs4245_write_cached(chip, CS4245_ADC_CTRL, value);
} }
static inline unsigned int shift_bits(unsigned int value,
unsigned int shift_from,
unsigned int shift_to,
unsigned int mask)
{
if (shift_from < shift_to)
return (value << (shift_to - shift_from)) & mask;
else
return (value >> (shift_from - shift_to)) & mask;
}
static unsigned int adjust_dg_dac_routing(struct oxygen *chip,
unsigned int play_routing)
{
return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) |
shift_bits(play_routing,
OXYGEN_PLAY_DAC2_SOURCE_SHIFT,
OXYGEN_PLAY_DAC1_SOURCE_SHIFT,
OXYGEN_PLAY_DAC1_SOURCE_MASK) |
shift_bits(play_routing,
OXYGEN_PLAY_DAC1_SOURCE_SHIFT,
OXYGEN_PLAY_DAC2_SOURCE_SHIFT,
OXYGEN_PLAY_DAC2_SOURCE_MASK) |
shift_bits(play_routing,
OXYGEN_PLAY_DAC0_SOURCE_SHIFT,
OXYGEN_PLAY_DAC3_SOURCE_SHIFT,
OXYGEN_PLAY_DAC3_SOURCE_MASK);
}
static int output_switch_info(struct snd_kcontrol *ctl, static int output_switch_info(struct snd_kcontrol *ctl,
struct snd_ctl_elem_info *info) struct snd_ctl_elem_info *info)
{ {
...@@ -557,6 +592,7 @@ struct oxygen_model model_xonar_dg = { ...@@ -557,6 +592,7 @@ struct oxygen_model model_xonar_dg = {
.resume = dg_resume, .resume = dg_resume,
.set_dac_params = set_cs4245_dac_params, .set_dac_params = set_cs4245_dac_params,
.set_adc_params = set_cs4245_adc_params, .set_adc_params = set_cs4245_adc_params,
.adjust_dac_routing = adjust_dg_dac_routing,
.dump_registers = dump_cs4245_registers, .dump_registers = dump_cs4245_registers,
.model_data_size = sizeof(struct dg), .model_data_size = sizeof(struct dg),
.device_config = PLAYBACK_0_TO_I2S | .device_config = PLAYBACK_0_TO_I2S |
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define __PDAUDIOCF_H #define __PDAUDIOCF_H
#include <sound/pcm.h> #include <sound/pcm.h>
#include <asm/io.h> #include <linux/io.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <pcmcia/cistpl.h> #include <pcmcia/cistpl.h>
#include <pcmcia/ds.h> #include <pcmcia/ds.h>
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/io.h>
#include <sound/core.h> #include <sound/core.h>
#include <asm/io.h>
#include "vxpocket.h" #include "vxpocket.h"
......
...@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec) ...@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec)
static int cq93vc_probe(struct snd_soc_codec *codec) static int cq93vc_probe(struct snd_soc_codec *codec)
{ {
struct davinci_vc *davinci_vc = codec->dev->platform_data; struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec);
davinci_vc->cq93vc.codec = codec; davinci_vc->cq93vc.codec = codec;
codec->control_data = davinci_vc; codec->control_data = davinci_vc;
......
...@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) ...@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec)
return 0; return 0;
} }
static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC;
static struct snd_soc_codec_driver cx20442_codec_dev = { static struct snd_soc_codec_driver cx20442_codec_dev = {
.probe = cx20442_codec_probe, .probe = cx20442_codec_probe,
.remove = cx20442_codec_remove, .remove = cx20442_codec_remove,
.reg_cache_default = &cx20442_reg,
.reg_cache_size = 1, .reg_cache_size = 1,
.reg_word_size = sizeof(u8), .reg_word_size = sizeof(u8),
.read = cx20442_read_reg_cache, .read = cx20442_read_reg_cache,
......
...@@ -507,8 +507,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) ...@@ -507,8 +507,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
/* Set up digital mute if not provided by the codec */ /* Set up digital mute if not provided by the codec */
if (!codec_dai->driver->ops) { if (!codec_dai->driver->ops) {
codec_dai->driver->ops = &ams_delta_dai_ops; codec_dai->driver->ops = &ams_delta_dai_ops;
} else if (!codec_dai->driver->ops->digital_mute) {
codec_dai->driver->ops->digital_mute = ams_delta_digital_mute;
} else { } else {
ams_delta_ops.startup = ams_delta_startup; ams_delta_ops.startup = ams_delta_startup;
ams_delta_ops.shutdown = ams_delta_shutdown; ams_delta_ops.shutdown = ams_delta_shutdown;
......
...@@ -1664,9 +1664,6 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num) ...@@ -1664,9 +1664,6 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num)
goto out; goto out;
found: found:
if (!try_module_get(codec->dev->driver->owner))
return -ENODEV;
ret = soc_probe_codec(card, codec); ret = soc_probe_codec(card, codec);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, ...@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
int max = mc->max; int max = mc->max;
unsigned int mask = (1 << fls(max)) - 1; unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert; unsigned int invert = mc->invert;
unsigned int val, val_mask; unsigned int val;
int connect, change; int connect, change;
struct snd_soc_dapm_update update; struct snd_soc_dapm_update update;
...@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, ...@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
if (invert) if (invert)
val = max - val; val = max - val;
val_mask = mask << shift; mask = mask << shift;
val = val << shift; val = val << shift;
mutex_lock(&widget->codec->mutex); mutex_lock(&widget->codec->mutex);
widget->value = val; widget->value = val;
change = snd_soc_test_bits(widget->codec, reg, val_mask, val); change = snd_soc_test_bits(widget->codec, reg, mask, val);
if (change) { if (change) {
if (val) if (val)
/* new connection */ /* new connection */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment