summaryrefslogtreecommitdiff
path: root/sound/pci/ac97/ac97_codec.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:38:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:38:47 -0700
commitc70929147a10fa4538886cb23b934b509c4c0e49 (patch)
treebd7c25f679b271fc81f2cedc7a70ef059586c353 /sound/pci/ac97/ac97_codec.c
parent4b1779c2cf030c68aefe939d946475e4136c1895 (diff)
parent69dd89fd2b9406603d218cab8996cfb232d5b8b9 (diff)
Merge tag 'sound-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "There have been lots of changes in ALSA core, HD-audio and ASoC, also most of PCI drivers touched by conversions of printks. All these resulted in a high volume and wide ranged patch sets in this release. Many changes are fairly trivial, but also lots of nice cleanups and refactors. There are a few new drivers, most notably, the Intel Haswell and Baytrail ASoC driver. Core changes: - A bit modernization; embed the device struct into snd_card struct, so that it may be referred from the beginning. A new snd_card_new() function is introduced for that, and all drivers have been converted. - Simplification in the device management code in ALSA core; now managed by a simple priority list instead - Converted many kernel messages to use the standard dev_err() & co; this would be the pretty visible difference, especially for HD-audio. HD-audio: - Conexant codecs use the auto-parser as default now; the old static code still remains in case of regressions. Some old quirks have been rewritten with the fixups for auto-parser. - C-Media codecs also use the auto-parser as default now, too. - A device struct is assigned to each HD-audio codec, and the formerly hwdep attributes are accessible over the codec sysfs, too. hwdep attributes still remain for compatibility. - Split the PCI-specific stuff for HD-audio controller into a separate module, ane make a helper module for the generic controller driver. This is a preliminary change for supporting Tegra HDMI controller in near future, which slipped from 3.15 merge. - Device-specific fixes: mute LED support for Lenovo Ideapad, mic LED fix for HP laptops, more ASUS subwoofer quirks, yet more Dell laptop headset quirks - Make the HD-audio codec response a bit more robust - A few improvements on Realtek ALC282 / 283 about the pop noises - A couple of Intel HDMI fixes ASoC: - Lots of cleanups for enumerations; refactored lots of error prone original codes to use more modern APIs - Elimination of the ASoC level wrappers for I2C and SPI moving us closer to converting to regmap completely and avoiding some randconfig hassle - Provide both manually and transparently locked DAPM APIs rather than a mix of the two fixing some concurrency issues - Start converting CODEC drivers to use separate bus interface drivers rather than having them all in one file helping avoid dependency issues - DPCM support for Intel Haswell and Bay Trail platforms, lots of fixes - Lots of work on improvements for simple-card, DaVinci and the Renesas rcar drivers. - New drivers for Analog Devices ADAU1977, TI PCM512x and parts of the CSR SiRF SoC, TLV320AIC31XXX, Armada 370 DB, Cirrus cs42xx8 - Fixes for the simple-card DAI format DT mess - DT support for a couple more devices. - Use of the tdm_slot mapping in a few drivers Others: - Support of reset_resume callback for improved S4 in USB-audio driver; the device with boot quirks have been little tested, which we need to watch out in this development cycle - Add PM support for ICE1712 driver (finally!); it's still pretty partial support, only for M-Audio devices" * tag 'sound-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (610 commits) ALSA: ice1712: Add suspend support for M-Audio ICE1712-based cards ALSA: ice1712: add suspend support for ICE1712 chip ALSA: hda - Enable beep for ASUS 1015E ALSA: asihpi: fix some indenting in snd_card_asihpi_pcm_new() ALSA: hda - add headset mic detect quirks for three Dell laptops ASoC: tegra: move AC97 clock handling to the machine driver ASoC: simple-card: Handle many DAI links ASoC: simple-card: Add DT documentation for multi-DAI links ASoC: simple-card: dynamically allocate the DAI link and properties ASoC: imx-ssi: Add .xlate_tdm_slot_mask() support. ASoC: fsl-esai: Add .xlate_tdm_slot_mask() support. ASoC: fsl-utils: Add fsl_asoc_xlate_tdm_slot_mask() support. ASoC: core: remove the 'of_' prefix of of_xlate_tdm_slot_mask. ASoC: rcar: subnode tidyup for renesas,rsnd.txt ASoC: Remove name_prefix unset during DAI link init hack ALSA: hda - Inform the unexpectedly ignored pins by auto-parser ASoC: rcar: bugfix: it cares about the non-src case ARM: bockw: fixup SND_SOC_DAIFMT_CBx_CFx flags ASoC: pcm: Drop incorrect double/extra frees ASoC: mfld_machine: Fix compile error ...
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r--sound/pci/ac97/ac97_codec.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index bf578ba2677e..14ad54b7928c 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -214,6 +214,12 @@ static void update_power_regs(struct snd_ac97 *ac97);
#define ac97_is_power_save_mode(ac97) 0
#endif
+#define ac97_err(ac97, fmt, args...) \
+ dev_err((ac97)->bus->card->dev, fmt, ##args)
+#define ac97_warn(ac97, fmt, args...) \
+ dev_warn((ac97)->bus->card->dev, fmt, ##args)
+#define ac97_dbg(ac97, fmt, args...) \
+ dev_dbg((ac97)->bus->card->dev, fmt, ##args)
/*
* I/O routines
@@ -1673,7 +1679,7 @@ static int snd_ac97_modem_build(struct snd_card *card, struct snd_ac97 * ac97)
int err, idx;
/*
- printk(KERN_DEBUG "AC97_GPIO_CFG = %x\n",
+ ac97_dbg(ac97, "AC97_GPIO_CFG = %x\n",
snd_ac97_read(ac97,AC97_GPIO_CFG));
*/
snd_ac97_write(ac97, AC97_GPIO_CFG, 0xffff & ~(AC97_GPIO_LINE1_OH));
@@ -1963,7 +1969,7 @@ static int snd_ac97_dev_register(struct snd_device *device)
ac97->bus->card->number, ac97->num,
snd_ac97_get_short_name(ac97));
if ((err = device_register(&ac97->dev)) < 0) {
- snd_printk(KERN_ERR "Can't register ac97 bus\n");
+ ac97_err(ac97, "Can't register ac97 bus\n");
ac97->dev.bus = NULL;
return err;
}
@@ -2089,7 +2095,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
msecs_to_jiffies(500), 1);
}
if (err < 0) {
- snd_printk(KERN_WARNING "AC'97 %d does not respond - RESET\n", ac97->num);
+ ac97_warn(ac97, "AC'97 %d does not respond - RESET\n",
+ ac97->num);
/* proceed anyway - it's often non-critical */
}
}
@@ -2098,7 +2105,9 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
ac97->id |= snd_ac97_read(ac97, AC97_VENDOR_ID2);
if (! (ac97->scaps & AC97_SCAP_DETECT_BY_VENDOR) &&
(ac97->id == 0x00000000 || ac97->id == 0xffffffff)) {
- snd_printk(KERN_ERR "AC'97 %d access is not valid [0x%x], removing mixer.\n", ac97->num, ac97->id);
+ ac97_err(ac97,
+ "AC'97 %d access is not valid [0x%x], removing mixer.\n",
+ ac97->num, ac97->id);
snd_ac97_free(ac97);
return -EIO;
}
@@ -2131,7 +2140,9 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
if (!ac97_is_audio(ac97) && !ac97_is_modem(ac97)) {
if (!(ac97->scaps & (AC97_SCAP_SKIP_AUDIO|AC97_SCAP_SKIP_MODEM)))
- snd_printk(KERN_ERR "AC'97 %d access error (not audio or modem codec)\n", ac97->num);
+ ac97_err(ac97,
+ "AC'97 %d access error (not audio or modem codec)\n",
+ ac97->num);
snd_ac97_free(ac97);
return -EACCES;
}
@@ -2156,7 +2167,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
goto __ready_ok;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- snd_printk(KERN_WARNING "AC'97 %d analog subsections not ready\n", ac97->num);
+ ac97_warn(ac97,
+ "AC'97 %d analog subsections not ready\n", ac97->num);
}
/* FIXME: add powerdown control */
@@ -2188,7 +2200,10 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
goto __ready_ok;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- snd_printk(KERN_WARNING "MC'97 %d converters and GPIO not ready (0x%x)\n", ac97->num, snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS));
+ ac97_warn(ac97,
+ "MC'97 %d converters and GPIO not ready (0x%x)\n",
+ ac97->num,
+ snd_ac97_read(ac97, AC97_EXTENDED_MSTATUS));
}
__ready_ok:
@@ -2723,7 +2738,7 @@ static int tune_ad_sharing(struct snd_ac97 *ac97)
{
unsigned short scfg;
if ((ac97->id & 0xffffff00) != 0x41445300) {
- snd_printk(KERN_ERR "ac97_quirk AD_SHARING is only for AD codecs\n");
+ ac97_err(ac97, "ac97_quirk AD_SHARING is only for AD codecs\n");
return -EINVAL;
}
/* Turn on OMS bit to route microphone to back panel */
@@ -2739,7 +2754,8 @@ AC97_SINGLE("Jack Detect", AC97_ALC650_CLOCK, 5, 1, 0);
static int tune_alc_jack(struct snd_ac97 *ac97)
{
if ((ac97->id & 0xffffff00) != 0x414c4700) {
- snd_printk(KERN_ERR "ac97_quirk ALC_JACK is only for Realtek codecs\n");
+ ac97_err(ac97,
+ "ac97_quirk ALC_JACK is only for Realtek codecs\n");
return -EINVAL;
}
snd_ac97_update_bits(ac97, 0x7a, 0x20, 0x20); /* select jack detect function */
@@ -2899,7 +2915,8 @@ int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, cons
if (override && strcmp(override, "-1") && strcmp(override, "default")) {
result = apply_quirk_str(ac97, override);
if (result < 0)
- snd_printk(KERN_ERR "applying quirk type %s failed (%d)\n", override, result);
+ ac97_err(ac97, "applying quirk type %s failed (%d)\n",
+ override, result);
return result;
}
@@ -2913,10 +2930,14 @@ int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, cons
quirk->subdevice == (quirk->mask & ac97->subsystem_device)) {
if (quirk->codec_id && quirk->codec_id != ac97->id)
continue;
- snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device);
+ ac97_dbg(ac97, "ac97 quirk for %s (%04x:%04x)\n",
+ quirk->name, ac97->subsystem_vendor,
+ ac97->subsystem_device);
result = apply_quirk(ac97, quirk->type);
if (result < 0)
- snd_printk(KERN_ERR "applying quirk type %d for %s failed (%d)\n", quirk->type, quirk->name, result);
+ ac97_err(ac97,
+ "applying quirk type %d for %s failed (%d)\n",
+ quirk->type, quirk->name, result);
return result;
}
}