Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7971b96d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix EAPD to low on CZC P10T tablet computer with ALC662
  ALSA: HDA: Add SKU ignore for another Thinkpad Edge 14
  ALSA: hda - Fix "unused variable" compile warning
  ALSA: hda - Add quirk for HP Z-series workstation
  Revert "ALSA: HDA: Create mixers on ALC887"
  ASoC: PXA: Fix codec address on Zipit Z2
  ASoC: PXA: Fix jack detection on Zipit Z2
  ASoC: Blackfin: fix DAI/SPORT config dependency issues
  ASoC: Blackfin TDM: use external frame syncs
  ASoC: Blackfin AC97: fix build error after multi-component update
  ASoC: Blackfin TDM: fix missed snd_soc_dai_get_drvdata update
  ASoC: documentation updates
  ALSA: ice1712 delta - initialize SPI clock
parents c745552a 842a2097
Loading
Loading
Loading
Loading
+21 −24
Original line number Diff line number Diff line
@@ -27,42 +27,38 @@ ASoC Codec driver breakdown

1 - Codec DAI and PCM configuration
-----------------------------------
Each codec driver must have a struct snd_soc_codec_dai to define its DAI and
Each codec driver must have a struct snd_soc_dai_driver to define its DAI and
PCM capabilities and operations. This struct is exported so that it can be
registered with the core by your machine driver.

e.g.

struct snd_soc_codec_dai wm8731_dai = {
	.name = "WM8731",
	/* playback capabilities */
static struct snd_soc_dai_ops wm8731_dai_ops = {
	.prepare	= wm8731_pcm_prepare,
	.hw_params	= wm8731_hw_params,
	.shutdown	= wm8731_shutdown,
	.digital_mute	= wm8731_mute,
	.set_sysclk	= wm8731_set_dai_sysclk,
	.set_fmt	= wm8731_set_dai_fmt,
};

struct snd_soc_dai_driver wm8731_dai = {
	.name = "wm8731-hifi",
	.playback = {
		.stream_name = "Playback",
		.channels_min = 1,
		.channels_max = 2,
		.rates = WM8731_RATES,
		.formats = WM8731_FORMATS,},
	/* capture capabilities */
	.capture = {
		.stream_name = "Capture",
		.channels_min = 1,
		.channels_max = 2,
		.rates = WM8731_RATES,
		.formats = WM8731_FORMATS,},
	/* pcm operations - see section 4 below */
	.ops = {
		.prepare = wm8731_pcm_prepare,
		.hw_params = wm8731_hw_params,
		.shutdown = wm8731_shutdown,
	},
	/* DAI operations - see DAI.txt */
	.dai_ops = {
		.digital_mute = wm8731_mute,
		.set_sysclk = wm8731_set_dai_sysclk,
		.set_fmt = wm8731_set_dai_fmt,
	}
	.ops = &wm8731_dai_ops,
	.symmetric_rates = 1,
};
EXPORT_SYMBOL_GPL(wm8731_dai);


2 - Codec control IO
@@ -186,13 +182,14 @@ when the mute is applied or freed.

i.e.

static int wm8974_mute(struct snd_soc_codec *codec,
	struct snd_soc_codec_dai *dai, int mute)
static int wm8974_mute(struct snd_soc_dai *dai, int mute)
{
	u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf;
	struct snd_soc_codec *codec = dai->codec;
	u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf;

	if (mute)
		wm8974_write(codec, WM8974_DAC, mute_reg | 0x40);
		snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40);
	else
		wm8974_write(codec, WM8974_DAC, mute_reg);
		snd_soc_write(codec, WM8974_DAC, mute_reg);
	return 0;
}
+9 −29
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ the following struct:-
struct snd_soc_card {
	char *name;

	...

	int (*probe)(struct platform_device *pdev);
	int (*remove)(struct platform_device *pdev);

@@ -22,12 +24,13 @@ struct snd_soc_card {
	int (*resume_pre)(struct platform_device *pdev);
	int (*resume_post)(struct platform_device *pdev);

	/* machine stream operations */
	struct snd_soc_ops *ops;
	...

	/* CPU <--> Codec DAI links  */
	struct snd_soc_dai_link *dai_link;
	int num_links;

	...
};

probe()/remove()
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs
and DMA is suspended and resumed. Optional.


Machine operations
------------------
The machine specific audio operations can be set here. Again this is optional.


Machine DAI Configuration
-------------------------
The machine DAI configuration glues all the codec and CPU DAIs together. It can
@@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
static struct snd_soc_dai_link corgi_dai = {
	.name = "WM8731",
	.stream_name = "WM8731",
	.cpu_dai = &pxa_i2s_dai,
	.codec_dai = &wm8731_dai,
	.cpu_dai_name = "pxa-is2-dai",
	.codec_dai_name = "wm8731-hifi",
	.platform_name = "pxa-pcm-audio",
	.codec_name = "wm8713-codec.0-001a",
	.init = corgi_wm8731_init,
	.ops = &corgi_ops,
};
@@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = {
};


Machine Audio Subsystem
-----------------------

The machine soc device glues the platform, machine and codec driver together.
Private data can also be set here. e.g.

/* corgi audio private data */
static struct wm8731_setup_data corgi_wm8731_setup = {
	.i2c_address = 0x1b,
};

/* corgi audio subsystem */
static struct snd_soc_device corgi_snd_devdata = {
	.machine = &snd_soc_corgi,
	.platform = &pxa2xx_soc_platform,
	.codec_dev = &soc_codec_dev_wm8731,
	.codec_data = &corgi_wm8731_setup,
};


Machine Power Map
-----------------

+10 −2
Original line number Diff line number Diff line
@@ -20,9 +20,10 @@ struct snd_soc_ops {
	int (*trigger)(struct snd_pcm_substream *, int);
};

The platform driver exports its DMA functionality via struct snd_soc_platform:-
The platform driver exports its DMA functionality via struct
snd_soc_platform_driver:-

struct snd_soc_platform {
struct snd_soc_platform_driver {
	char *name;

	int (*probe)(struct platform_device *pdev);
@@ -34,6 +35,13 @@ struct snd_soc_platform {
	int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
	void (*pcm_free)(struct snd_pcm *);

	/*
	 * For platform caused delay reporting.
	 * Optional.
	 */
	snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
		struct snd_soc_dai *);

	/* platform stream ops */
	struct snd_pcm_ops *pcm_ops;
};
+17 −9
Original line number Diff line number Diff line
@@ -1721,7 +1721,9 @@ static void alc_apply_fixup(struct hda_codec *codec, int action)
{
	struct alc_spec *spec = codec->spec;
	int id = spec->fixup_id;
#ifdef CONFIG_SND_DEBUG_VERBOSE
	const char *modelname = spec->fixup_name;
#endif
	int depth = 0;
	if (!spec->fixup_list)
@@ -10930,9 +10932,6 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)
	return 0;
}
static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
					     const struct auto_pin_cfg *cfg);
/* almost identical with ALC880 parser... */
static int alc882_parse_auto_config(struct hda_codec *codec)
{
@@ -10950,9 +10949,6 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
	err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
	if (err < 0)
		return err;
	if (codec->vendor_id == 0x10ec0887)
		err = alc861vd_auto_create_multi_out_ctls(spec, &spec->autocfg);
	else
	err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
	if (err < 0)
		return err;
@@ -12635,6 +12631,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
			   ALC262_HP_BPC),
	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
			   ALC262_HP_BPC),
	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
			   ALC262_HP_BPC),
	SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
			   ALC262_HP_BPC),
	SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -14957,6 +14955,7 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = {
	SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
	SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
	SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
	SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
@@ -17134,7 +17133,7 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
#define alc861vd_idx_to_mixer_switch(nid)	((nid) + 0x0c)
/* add playback controls from the parsed DAC table */
/* Based on ALC880 version. But ALC861VD and ALC887 have separate,
/* Based on ALC880 version. But ALC861VD has separate,
 * different NIDs for mute/unmute switch and volume control */
static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
					     const struct auto_pin_cfg *cfg)
@@ -19461,6 +19460,7 @@ enum {
	ALC662_FIXUP_ASPIRE,
	ALC662_FIXUP_IDEAPAD,
	ALC272_FIXUP_MARIO,
	ALC662_FIXUP_CZC_P10T,
};
static const struct alc_fixup alc662_fixups[] = {
@@ -19481,7 +19481,14 @@ static const struct alc_fixup alc662_fixups[] = {
	[ALC272_FIXUP_MARIO] = {
		.type = ALC_FIXUP_FUNC,
		.v.func = alc272_fixup_mario,
	},
	[ALC662_FIXUP_CZC_P10T] = {
		.type = ALC_FIXUP_VERBS,
		.v.verbs = (const struct hda_verb[]) {
			{0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
			{}
		}
	},
};
static struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -19489,6 +19496,7 @@ static struct snd_pci_quirk alc662_fixup_tbl[] = {
	SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
	SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
	SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
	{}
};
+7 −0
Original line number Diff line number Diff line
@@ -580,6 +580,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
{
	int err;
	struct snd_akm4xxx *ak;
	unsigned char tmp;

	if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 &&
	    ice->eeprom.gpiodir == 0x7b)
@@ -622,6 +623,12 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
		break;
	}

	/* initialize the SPI clock to high */
	tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
	tmp |= ICE1712_DELTA_AP_CCLK;
	snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
	udelay(5);

	/* initialize spdif */
	switch (ice->eeprom.subvendor) {
	case ICE1712_SUBDEVICE_AUDIOPHILE:
Loading