]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branches 'topic/fix/asoc', 'topic/fix/hda', 'topic/fix/misc' and 'topic/pci...
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Oct 2008 16:08:11 +0000 (17:08 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Oct 2008 16:08:11 +0000 (17:08 +0100)
sound/aoa/soundbus/i2sbus/i2sbus-core.c
sound/arm/pxa2xx-pcm-lib.c
sound/oss/kahlua.c
sound/pci/cs5530.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/soc/blackfin/bf5xx-i2s.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/omap/omap-mcbsp.c
sound/sound_core.c

index e6beb92c6933f9df991af076f3ed17fb7b36b214..b4590df0746689c8e3d4493eb894c8442b583055 100644 (file)
@@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
        struct i2sbus_dev *dev;
        struct device_node *child = NULL, *sound = NULL;
        struct resource *r;
-       int i, layout = 0, rlen;
+       int i, layout = 0, rlen, ok = force;
        static const char *rnames[] = { "i2sbus: %s (control)",
                                        "i2sbus: %s (tx)",
                                        "i2sbus: %s (rx)" };
@@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
                        layout = *layout_id;
                        snprintf(dev->sound.modalias, 32,
                                 "sound-layout-%d", layout);
-                       force = 1;
+                       ok = 1;
                }
        }
        /* for the time being, until we can handle non-layout-id
@@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
         * When there are two i2s busses and only one has a layout-id,
         * then this depends on the order, but that isn't important
         * either as the second one in that case is just a modem. */
-       if (!force) {
+       if (!ok) {
                kfree(dev);
                return -ENODEV;
        }
index 1c93eb77cb99fe75856055f04d74d1e3c8007e81..75a0d746fb60ff50a8eccdefab76e67c380d3e9d 100644 (file)
@@ -194,7 +194,7 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
                goto out;
 
        ret = -ENOMEM;
-       rtd = kmalloc(sizeof(*rtd), GFP_KERNEL);
+       rtd = kzalloc(sizeof(*rtd), GFP_KERNEL);
        if (!rtd)
                goto out;
        rtd->dma_desc_array =
index eb9bc365530dde4107f1cf4f9de102bd66dac59b..c180598f1710498bf94ca0549622c798288fb675 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Initialisation code for Cyrix/NatSemi VSA1 softaudio
  *
- *     (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
+ *     (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
  *
  * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
  * The older version (VSA1) provides fairly good soundblaster emulation
index 4d9378d812000fbea40a422515d8e7b9e5a7c80e..6dea5b5cc77419814334addf8b22c06c5bee142c 100644 (file)
@@ -2,7 +2,7 @@
  * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio
  *
  *     (C) Copyright 2007 Ash Willis <ashwillis@programmer.net>
- *     (C) Copyright 2003 Red Hat Inc <alan@redhat.com>
+ *     (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
  *
  * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did
  * mess with it a bit. The chip seems to have to have trouble with full duplex
index e72707cb60a3394cd00334d94bb9a3c483f4bcea..4eceab9bd10985427d041a48c9401fae9cc271a4 100644 (file)
@@ -307,6 +307,13 @@ struct alc_spec {
        /* for PLL fix */
        hda_nid_t pll_nid;
        unsigned int pll_coef_idx, pll_coef_bit;
+
+#ifdef SND_HDA_NEEDS_RESUME
+#define ALC_MAX_PINS   16
+       unsigned int num_pins;
+       hda_nid_t pin_nids[ALC_MAX_PINS];
+       unsigned int pin_cfgs[ALC_MAX_PINS];
+#endif
 };
 
 /*
@@ -2778,6 +2785,64 @@ static void alc_free(struct hda_codec *codec)
        codec->spec = NULL; /* to be sure */
 }
 
+#ifdef SND_HDA_NEEDS_RESUME
+static void store_pin_configs(struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+       hda_nid_t nid, end_nid;
+
+       end_nid = codec->start_nid + codec->num_nodes;
+       for (nid = codec->start_nid; nid < end_nid; nid++) {
+               unsigned int wid_caps = get_wcaps(codec, nid);
+               unsigned int wid_type =
+                       (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
+               if (wid_type != AC_WID_PIN)
+                       continue;
+               if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
+                       break;
+               spec->pin_nids[spec->num_pins] = nid;
+               spec->pin_cfgs[spec->num_pins] =
+                       snd_hda_codec_read(codec, nid, 0,
+                                          AC_VERB_GET_CONFIG_DEFAULT, 0);
+               spec->num_pins++;
+       }
+}
+
+static void resume_pin_configs(struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+       int i;
+
+       for (i = 0; i < spec->num_pins; i++) {
+               hda_nid_t pin_nid = spec->pin_nids[i];
+               unsigned int pin_config = spec->pin_cfgs[i];
+               snd_hda_codec_write(codec, pin_nid, 0,
+                                   AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
+                                   pin_config & 0x000000ff);
+               snd_hda_codec_write(codec, pin_nid, 0,
+                                   AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
+                                   (pin_config & 0x0000ff00) >> 8);
+               snd_hda_codec_write(codec, pin_nid, 0,
+                                   AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
+                                   (pin_config & 0x00ff0000) >> 16);
+               snd_hda_codec_write(codec, pin_nid, 0,
+                                   AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
+                                   pin_config >> 24);
+       }
+}
+
+static int alc_resume(struct hda_codec *codec)
+{
+       resume_pin_configs(codec);
+       codec->patch_ops.init(codec);
+       snd_hda_codec_resume_amp(codec);
+       snd_hda_codec_resume_cache(codec);
+       return 0;
+}
+#else
+#define store_pin_configs(codec)
+#endif
+
 /*
  */
 static struct hda_codec_ops alc_patch_ops = {
@@ -2786,6 +2851,9 @@ static struct hda_codec_ops alc_patch_ops = {
        .init = alc_init,
        .free = alc_free,
        .unsol_event = alc_unsol_event,
+#ifdef SND_HDA_NEEDS_RESUME
+       .resume = alc_resume,
+#endif
 #ifdef CONFIG_SND_HDA_POWER_SAVE
        .check_power_status = alc_check_power_status,
 #endif
@@ -3832,6 +3900,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
        spec->num_mux_defs = 1;
        spec->input_mux = &spec->private_imux;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -4996,7 +5065,7 @@ static struct hda_verb alc260_test_init_verbs[] = {
  */
 
 static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
-                                       const char *pfx)
+                                       const char *pfx, int *vol_bits)
 {
        hda_nid_t nid_vol;
        unsigned long vol_val, sw_val;
@@ -5018,10 +5087,14 @@ static int alc260_add_playback_controls(struct alc_spec *spec, hda_nid_t nid,
        } else
                return 0; /* N/A */
 
-       snprintf(name, sizeof(name), "%s Playback Volume", pfx);
-       err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
-       if (err < 0)
-               return err;
+       if (!(*vol_bits & (1 << nid_vol))) {
+               /* first control for the volume widget */
+               snprintf(name, sizeof(name), "%s Playback Volume", pfx);
+               err = add_control(spec, ALC_CTL_WIDGET_VOL, name, vol_val);
+               if (err < 0)
+                       return err;
+               *vol_bits |= (1 << nid_vol);
+       }
        snprintf(name, sizeof(name), "%s Playback Switch", pfx);
        err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, sw_val);
        if (err < 0)
@@ -5035,6 +5108,7 @@ static int alc260_auto_create_multi_out_ctls(struct alc_spec *spec,
 {
        hda_nid_t nid;
        int err;
+       int vols = 0;
 
        spec->multiout.num_dacs = 1;
        spec->multiout.dac_nids = spec->private_dac_nids;
@@ -5042,21 +5116,22 @@ static int alc260_auto_create_multi_out_ctls(struct alc_spec *spec,
 
        nid = cfg->line_out_pins[0];
        if (nid) {
-               err = alc260_add_playback_controls(spec, nid, "Front");
+               err = alc260_add_playback_controls(spec, nid, "Front", &vols);
                if (err < 0)
                        return err;
        }
 
        nid = cfg->speaker_pins[0];
        if (nid) {
-               err = alc260_add_playback_controls(spec, nid, "Speaker");
+               err = alc260_add_playback_controls(spec, nid, "Speaker", &vols);
                if (err < 0)
                        return err;
        }
 
        nid = cfg->hp_pins[0];
        if (nid) {
-               err = alc260_add_playback_controls(spec, nid, "Headphone");
+               err = alc260_add_playback_controls(spec, nid, "Headphone",
+                                                  &vols);
                if (err < 0)
                        return err;
        }
@@ -5244,6 +5319,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
        }
        spec->num_mixers++;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -10307,6 +10383,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
        if (err < 0)
                return err;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -11441,6 +11518,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
        if (err < 0)
                return err;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -12224,6 +12302,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
        spec->mixers[spec->num_mixers] = alc269_capture_mixer;
        spec->num_mixers++;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -13310,6 +13389,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
        spec->mixers[spec->num_mixers] = alc861_capture_mixer;
        spec->num_mixers++;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -14421,6 +14501,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
        if (err < 0)
                return err;
 
+       store_pin_configs(codec);
        return 1;
 }
 
@@ -16252,6 +16333,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
 
        spec->mixers[spec->num_mixers] = alc662_capture_mixer;
        spec->num_mixers++;
+
+       store_pin_configs(codec);
        return 1;
 }
 
index a2ac7205d45de81706ef520e2c9dca69f5ce503d..788fdc6f326436d8388faf3294c86e5d91274d13 100644 (file)
@@ -1282,7 +1282,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
                        return err;
                spec->multiout.share_spdif = 1;
        }
-       if (spec->dig_in_nid && (!spec->gpio_dir & 0x01)) {
+       if (spec->dig_in_nid && !(spec->gpio_dir & 0x01)) {
                err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
                if (err < 0)
                        return err;
index 827587f08180de31774c0fdc79817189d2bf605b..e020c160ee441e815b6b6c59159cd30c77ed38ec 100644 (file)
@@ -70,12 +70,24 @@ static struct sport_param sport_params[2] = {
        }
 };
 
-static u16 sport_req[][7] = {
-               { P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
-                 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0},
-               { P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
-                 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0},
-};
+/*
+ * Setting the TFS pin selector for SPORT 0 based on whether the selected
+ * port id F or G. If the port is F then no conflict should exist for the
+ * TFS. When Port G is selected and EMAC then there is a conflict between
+ * the PHY interrupt line and TFS.  Current settings prevent the conflict
+ * by ignoring the TFS pin when Port G is selected. This allows both
+ * ssm2602 using Port G and EMAC concurrently.
+ */
+#ifdef CONFIG_BF527_SPORT0_PORTF
+#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
+#else
+#define LOCAL_SPORT0_TFS (0)
+#endif
+
+static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
+               P_SPORT0_DRPRI, P_SPORT0_RSCLK, LOCAL_SPORT0_TFS, 0},
+               {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, P_SPORT1_DRPRI,
+               P_SPORT1_RSCLK, P_SPORT1_TFS, 0} };
 
 static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                unsigned int fmt)
@@ -98,23 +110,21 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                ret = -EINVAL;
                break;
        default:
+               printk(KERN_ERR "%s: Unknown DAI format type\n", __func__);
                ret = -EINVAL;
                break;
        }
 
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
-       case SND_SOC_DAIFMT_CBS_CFS:
-               ret = -EINVAL;
-               break;
-       case SND_SOC_DAIFMT_CBM_CFS:
-               ret = -EINVAL;
-               break;
        case SND_SOC_DAIFMT_CBM_CFM:
                break;
+       case SND_SOC_DAIFMT_CBS_CFS:
+       case SND_SOC_DAIFMT_CBM_CFS:
        case SND_SOC_DAIFMT_CBS_CFM:
                ret = -EINVAL;
                break;
        default:
+               printk(KERN_ERR "%s: Unknown DAI master type\n", __func__);
                ret = -EINVAL;
                break;
        }
index 05336ed7e4935fdbd0d9f27a1f77e3b0c5c0bef2..cff276ee261e7a2ecca843b23bc74d4fec761df7 100644 (file)
@@ -863,17 +863,21 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
                return -EINVAL;
        }
 
-       /* interface format */
-       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
-       case SND_SOC_DAIFMT_I2S:
+       /*
+        * match both interface format and signal polarities since they
+        * are fixed
+        */
+       switch (fmt & (SND_SOC_DAIFMT_FORMAT_MASK |
+                      SND_SOC_DAIFMT_INV_MASK)) {
+       case (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF):
                break;
-       case SND_SOC_DAIFMT_DSP_A:
+       case (SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF):
                iface_breg |= (0x01 << 6);
                break;
-       case SND_SOC_DAIFMT_RIGHT_J:
+       case (SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_NB_NF):
                iface_breg |= (0x02 << 6);
                break;
-       case SND_SOC_DAIFMT_LEFT_J:
+       case (SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF):
                iface_breg |= (0x03 << 6);
                break;
        default:
index 853b33ae3435297f414eaee086b31bdf6a4b1333..8485a8a9d0ff0e89687eb73a62755d064c8177e6 100644 (file)
@@ -265,7 +265,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
                break;
        case SND_SOC_DAIFMT_DSP_A:
                regs->srgr2     |= FPER(wlen * 2 - 1);
-               regs->srgr1     |= FWID(0);
+               regs->srgr1     |= FWID(wlen * 2 - 2);
                break;
        }
 
@@ -284,7 +284,6 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
 {
        struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
        struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
-       unsigned int temp_fmt = fmt;
 
        if (mcbsp_data->configured)
                return 0;
@@ -307,8 +306,6 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                /* 0-bit data delay */
                regs->rcr2      |= RDATDLY(0);
                regs->xcr2      |= XDATDLY(0);
-               /* Invert bit clock and FS polarity configuration for DSP_A */
-               temp_fmt ^= SND_SOC_DAIFMT_IB_IF;
                break;
        default:
                /* Unsupported data format */
@@ -332,7 +329,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
        }
 
        /* Set bit clock (CLKX/CLKR) and FS polarities */
-       switch (temp_fmt & SND_SOC_DAIFMT_INV_MASK) {
+       switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
        case SND_SOC_DAIFMT_NB_NF:
                /*
                 * Normal BCLK + FS.
index faef87a9bc3fdbac4f5ed27040877de887db6783..a75b289a5d78465c25ccf2aab83958e3e8a0a67d 100644 (file)
@@ -57,7 +57,7 @@ module_exit(cleanup_soundcore);
 /*
  *     OSS sound core handling. Breaks out sound functions to submodules
  *     
- *     Author:         Alan Cox <alan.cox@linux.org>
+ *     Author:         Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
  *     Fixes:
  *