OSDN Git Service

Merge branch 'for-linus' into for-next
authorTakashi Iwai <tiwai@suse.de>
Mon, 27 Jul 2015 12:43:29 +0000 (14:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Jul 2015 12:43:29 +0000 (14:43 +0200)
... to make easier developing HDA ext code.

include/sound/hdaudio.h
sound/aoa/codecs/onyx.c
sound/aoa/codecs/tas.c
sound/hda/hdac_device.c
sound/hda/hdac_regmap.c
sound/hda/hdac_sysfs.c
sound/pci/emu10k1/emumixer.c
sound/pci/hda/hda_codec.c

index 4caf1fd..288c7fa 100644 (file)
@@ -164,15 +164,15 @@ static inline int snd_hdac_read_parm(struct hdac_device *codec, hda_nid_t nid,
 }
 
 #ifdef CONFIG_PM
-void snd_hdac_power_up(struct hdac_device *codec);
-void snd_hdac_power_down(struct hdac_device *codec);
-void snd_hdac_power_up_pm(struct hdac_device *codec);
-void snd_hdac_power_down_pm(struct hdac_device *codec);
+int snd_hdac_power_up(struct hdac_device *codec);
+int snd_hdac_power_down(struct hdac_device *codec);
+int snd_hdac_power_up_pm(struct hdac_device *codec);
+int snd_hdac_power_down_pm(struct hdac_device *codec);
 #else
-static inline void snd_hdac_power_up(struct hdac_device *codec) {}
-static inline void snd_hdac_power_down(struct hdac_device *codec) {}
-static inline void snd_hdac_power_up_pm(struct hdac_device *codec) {}
-static inline void snd_hdac_power_down_pm(struct hdac_device *codec) {}
+static inline int snd_hdac_power_up(struct hdac_device *codec) { return 0; }
+static inline int snd_hdac_power_down(struct hdac_device *codec) { return 0; }
+static inline int snd_hdac_power_up_pm(struct hdac_device *codec) { return 0; }
+static inline int snd_hdac_power_down_pm(struct hdac_device *codec) { return 0; }
 #endif
 
 /*
index 23c371e..a04edff 100644 (file)
@@ -1050,7 +1050,6 @@ MODULE_DEVICE_TABLE(i2c,onyx_i2c_id);
 static struct i2c_driver onyx_driver = {
        .driver = {
                .name = "aoa_codec_onyx",
-               .owner = THIS_MODULE,
        },
        .probe = onyx_i2c_probe,
        .remove = onyx_i2c_remove,
index 364c7c4..78ed1ff 100644 (file)
@@ -939,7 +939,6 @@ MODULE_DEVICE_TABLE(i2c,tas_i2c_id);
 static struct i2c_driver tas_driver = {
        .driver = {
                .name = "aoa_codec_tas",
-               .owner = THIS_MODULE,
        },
        .probe = tas_i2c_probe,
        .remove = tas_i2c_remove,
index cdee710..df7039e 100644 (file)
@@ -501,23 +501,27 @@ EXPORT_SYMBOL_GPL(snd_hdac_get_connections);
  * This function calls the runtime PM helper to power up the given codec.
  * Unlike snd_hdac_power_up_pm(), you should call this only for the code
  * path that isn't included in PM path.  Otherwise it gets stuck.
+ *
+ * Returns zero if successful, or a negative error code.
  */
-void snd_hdac_power_up(struct hdac_device *codec)
+int snd_hdac_power_up(struct hdac_device *codec)
 {
-       pm_runtime_get_sync(&codec->dev);
+       return pm_runtime_get_sync(&codec->dev);
 }
 EXPORT_SYMBOL_GPL(snd_hdac_power_up);
 
 /**
  * snd_hdac_power_down - power down the codec
  * @codec: the codec object
+ *
+ * Returns zero if successful, or a negative error code.
  */
-void snd_hdac_power_down(struct hdac_device *codec)
+int snd_hdac_power_down(struct hdac_device *codec)
 {
        struct device *dev = &codec->dev;
 
        pm_runtime_mark_last_busy(dev);
-       pm_runtime_put_autosuspend(dev);
+       return pm_runtime_put_autosuspend(dev);
 }
 EXPORT_SYMBOL_GPL(snd_hdac_power_down);
 
@@ -529,11 +533,14 @@ EXPORT_SYMBOL_GPL(snd_hdac_power_down);
  * which may be called by PM suspend/resume again.  OTOH, if a power-up
  * call must wake up the sleeper (e.g. in a kctl callback), use
  * snd_hdac_power_up() instead.
+ *
+ * Returns zero if successful, or a negative error code.
  */
-void snd_hdac_power_up_pm(struct hdac_device *codec)
+int snd_hdac_power_up_pm(struct hdac_device *codec)
 {
        if (!atomic_inc_not_zero(&codec->in_pm))
-               snd_hdac_power_up(codec);
+               return snd_hdac_power_up(codec);
+       return 0;
 }
 EXPORT_SYMBOL_GPL(snd_hdac_power_up_pm);
 
@@ -543,11 +550,14 @@ EXPORT_SYMBOL_GPL(snd_hdac_power_up_pm);
  *
  * Like snd_hdac_power_up_pm(), this function is used in a recursive
  * code path like init code which may be called by PM suspend/resume again.
+ *
+ * Returns zero if successful, or a negative error code.
  */
-void snd_hdac_power_down_pm(struct hdac_device *codec)
+int snd_hdac_power_down_pm(struct hdac_device *codec)
 {
        if (atomic_dec_if_positive(&codec->in_pm) < 0)
-               snd_hdac_power_down(codec);
+               return snd_hdac_power_down(codec);
+       return 0;
 }
 EXPORT_SYMBOL_GPL(snd_hdac_power_down_pm);
 #endif
index 1eabcdf..b0ed870 100644 (file)
@@ -410,8 +410,9 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg,
 
        err = reg_raw_write(codec, reg, val);
        if (err == -EAGAIN) {
-               snd_hdac_power_up_pm(codec);
-               err = reg_raw_write(codec, reg, val);
+               err = snd_hdac_power_up_pm(codec);
+               if (!err)
+                       err = reg_raw_write(codec, reg, val);
                snd_hdac_power_down_pm(codec);
        }
        return err;
@@ -442,8 +443,9 @@ int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg,
 
        err = reg_raw_read(codec, reg, val);
        if (err == -EAGAIN) {
-               snd_hdac_power_up_pm(codec);
-               err = reg_raw_read(codec, reg, val);
+               err = snd_hdac_power_up_pm(codec);
+               if (!err)
+                       err = reg_raw_read(codec, reg, val);
                snd_hdac_power_down_pm(codec);
        }
        return err;
index 0a6ce3b..089b35f 100644 (file)
@@ -321,8 +321,7 @@ static void widget_tree_free(struct hdac_device *codec)
                        free_widget_node(*p, &widget_node_group);
                kfree(tree->nodes);
        }
-       if (tree->root)
-               kobject_put(tree->root);
+       kobject_put(tree->root);
        kfree(tree);
        codec->widgets = NULL;
 }
index 55e5716..076b117 100644 (file)
@@ -1741,7 +1741,7 @@ static int snd_audigy_capture_boost_put(struct snd_kcontrol *kcontrol,
 static struct snd_kcontrol_new snd_audigy_capture_boost =
 {
        .iface =        SNDRV_CTL_ELEM_IFACE_MIXER,
-       .name =         "Analog Capture Boost",
+       .name =         "Mic Extra Boost",
        .info =         snd_audigy_capture_boost_info,
        .get =          snd_audigy_capture_boost_get,
        .put =          snd_audigy_capture_boost_put
@@ -1819,8 +1819,6 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                 * the Philips ADC for 24bit capture */
                "PCM Playback Switch",
                "PCM Playback Volume",
-               "Master Mono Playback Switch",
-               "Master Mono Playback Volume",
                "Master Playback Switch",
                "Master Playback Volume",
                "PCM Out Path & Mute",
@@ -1830,10 +1828,16 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                "Capture Switch",
                "Capture Volume",
                "Mic Select",
+               "Headphone Playback Switch",
+               "Headphone Playback Volume",
+               "3D Control - Center",
+               "3D Control - Depth",
+               "3D Control - Switch",
                "Video Playback Switch",
                "Video Playback Volume",
                "Mic Playback Switch",
                "Mic Playback Volume",
+               "External Amplifier",
                NULL
        };
        static char *audigy_rename_ctls[] = {
@@ -1842,6 +1846,8 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                /* "Wave Capture Volume", "PCM Capture Volume", */
                "Wave Master Playback Volume", "Master Playback Volume",
                "AMic Playback Volume", "Mic Playback Volume",
+               "Master Mono Playback Switch", "Phone Output Playback Switch",
+               "Master Mono Playback Volume", "Phone Output Playback Volume",
                NULL
        };
        static char *audigy_rename_ctls_i2c_adc[] = {
@@ -1867,8 +1873,6 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                 * the Philips ADC for 24bit capture */
                "PCM Playback Switch",
                "PCM Playback Volume",
-               "Master Mono Playback Switch",
-               "Master Mono Playback Volume",
                "Capture Source",
                "Capture Switch",
                "Capture Volume",
@@ -1900,7 +1904,8 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                "Aux Playback Volume", "Aux Capture Volume",
                "Video Playback Switch", "Video Capture Switch",
                "Video Playback Volume", "Video Capture Volume",
-
+               "Master Mono Playback Switch", "Phone Output Playback Switch",
+               "Master Mono Playback Volume", "Phone Output Playback Volume",
                NULL
        };
 
@@ -1935,6 +1940,9 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                        snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000);
                        /* set capture source to mic */
                        snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
+                       /* set mono output (TAD) to mic */
+                       snd_ac97_update_bits(emu->ac97, AC97_GENERAL_PURPOSE,
+                               0x0200, 0x0200);
                        if (emu->card_capabilities->adc_1361t)
                                c = audigy_remove_ctls_1361t_adc;
                        else 
@@ -1996,11 +2004,6 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu,
                rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume");
                rename_ctl(card, "Aux2 Capture Volume", "Line3 Capture Volume");
                rename_ctl(card, "Mic Capture Volume", "Unknown1 Capture Volume");
-               remove_ctl(card, "Headphone Playback Switch");
-               remove_ctl(card, "Headphone Playback Volume");
-               remove_ctl(card, "3D Control - Center");
-               remove_ctl(card, "3D Control - Depth");
-               remove_ctl(card, "3D Control - Switch");
        }
        if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
                return -ENOMEM;
index 5de3c5d..d78fa71 100644 (file)
@@ -975,7 +975,7 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
        if (codec->bus->modelname) {
                codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
                if (!codec->modelname) {
-                       err = -ENODEV;
+                       err = -ENOMEM;
                        goto error;
                }
        }