workqueue: Document debugging tricks

It is not obvious how to debug run-away workers.

These are some tips given by Tejun on lkml.

Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
[media] DIB0700: fix typo in dib0700_devices.c

Fix typo introduced in b4d6046e841955be9cc49164b03b91c9524f9c2e.

Spotted by Dr. David Alan Gilbert. Thanks for that.

Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] FLEXCOP-PCI: fix __xlate_proc_name-warning for flexcop-pci

This patch fixes the warning about bad names for sys-fs and other kernel-things. The flexcop-pci driver was using '/'-characters in it, which is not good.
This has been fixed in several attempts by several people, but obviously never made it into the kernel.

Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Cc: Steffen Barszus <steffenbpunkt@googlemail.com>
Cc: Boris Cuber <me@boris64.net>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] dib0700: fix possible NULL pointer dereference

Seems like 'adap->fe' test for NULL was meant to be before we dereference
that pointer.

Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[media] Fix dependencies for Technisat USB2.0 DVB-S/S2

Device is based on STV0903 demod and STV6110x tuner

Signed-off-by: Oleg Roitburd <oroitburd@gmail.com>
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
ASoC: Tegra: Suspend/resume support

ASoC machine drivers that are their own platform_driver (as opposed to
those using the soc-audio platform_driver) need to explicitly set up
power-management operation callbacks.

To avoid cut/paste, snd_soc_pm_ops also needs to be exported.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: check channel mismatch between cpu_dai and codec_dai

Suppose we have:

	cpu_dai
		channels_min = 1
		channels_max = 1

	codec_dai
		channels_min = 2
		channels_max = 2

This is a mismatch that should not happen, however according to the current
code, the result of runtime->hw will be:

		channels_min = 2
		channels_max = 1

We better spot it early. This patch checks this mismatch.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: fix config error path

initialize ret to invalid value so that when we reach the config error path in
soc_pcm_open, it will return the correct error code. without this patch, though
config error path is executed, soc_pcm_open will return 0 in
snd_pcm_open_substream and then cause double release of substream.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Set left channel volume update bits for WM8994

Ensures that we apply volume updates that don't affect the right channel.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: WM8903: HP and Line out PGA/mixer DAPM fixes

Update the headphone and line out mixers and PGAs use the same logical
set of register bits and sequencing as the speaker mixer/PGA.

This allows ALSA controls for mute and volume on headphone and line out
to operate correctly.

Per conversation on alsa-devel, earlier datasheets indicated that the
POWER_MANAGEMENT_* register bits 0 and 1 were aliases to ANALOG_* register
bits 0 and 4, and hence only one copy of those bits was programmed.
However, later datasheets corrected this.

From: Dilan Lee <dilee@nvidia.com>
[swarren: Applied same change to headphone widgets]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
MAINTAINERS: Update Samsung ASoC maintainer's id

Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: fsi: take care in failing case of dai register

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: fsi: modify vague PM control on probe

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: fsi: driver safely remove for against irq

free_irq and pm_runtime_disable should be called before
snd_soc_unregister_xxx

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: sst_platform: Fix lock acquring

Fix the possible dead lock shown below:

spin_lock
sst_get_stream_status
sst_period_elapsed
intel_sst_interrupt
handle_IRQ_event
handle_fasteoi_irq
do_IRQ
common_interrupt
spin_lock
sst_set_stream_status
sst_platform_pcm_trigger

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: SAMSUNG: Fix the inverted clocks handling for pcm driver

Fix the inverted clocks handling for pcm cpu driver.
By using SND_SOC_DAIFMT_NB_NF, Audio noise can be generated on SMDK.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: sn95031: decorate function with __devexit_p()

According to the comments in include/linux/init.h:

"Pointers to __devexit functions must use __devexit_p(function_name), the
wrapper will insert either the function_name or NULL, depending on the config
options."

Fix this issue in codecs sn95031.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Fix output PGA enabling in wm_hubs CODECs

The output PGA was not being powered up in headphone and speaker paths,
removing the ability to offer volume control and mute with the output
PGA.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
ARM: imx: fix usb related build failure for mach-vpr200

This was broken by

	4bd597b (ARM i.MX ehci: do ehci init in board specific functions)

and fixes:

  CC      arch/arm/mach-mx3/mach-vpr200.o
arch/arm/mach-mx3/mach-vpr200.c:263: error: unknown field 'flags' specified in initializer
arch/arm/mach-mx3/mach-vpr200.c:264: warning: initialization makes pointer from integer without a cast

by just applying the change to mach-vpr200.c that the other machine files
got by 4bd597b.

LAKML-Reference: 1302257029-17397-1-git-send-email-u.kleine-koenig@pengutronix.de
Acked-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM: mxs/clock-mx28: fix up name##_set_rate

For the lcdif clock get_rate looks as follows:

	read div from HW_CLKCTRL_DIS_LCDIF.DIV
	return clk_get_rate(clk->parent) / div

with clk->parent being ref_pix_clk on my system.

ref_pix_clk's rate depends on HW_CLKCTRL_FRAC1.PIXFRAC.

The set_rate function for lcdif does:

	parent_rate = clk_get_rate(clk->parent);
	based on that calculate frac and div such that
	  parent_rate * 18 / frac / div is near the requested rate.
	HW_CLKCTRL_FRAC1.PIXFRAC is updated with frac
	HW_CLKCTRL_DIS_LCDIF.DIV is updated with div

For this calculation to be correct parent_rate needs to be
initialized not with the clock rate of lcdif's parent (i.e. ref_pix) but
that of its grandparent (i.e. ref_pix' parent == pll0_clk).

The obvious downside of this patch is that now set_rate(lcdif) changes
its parent's rate, too.  Still this is better than a wrong rate.

Acked-by: Shawn Guo <shawn.guo@freescale.com>
LAKML-Reference: 20110225084950.GA13684@S2101-09.ap.freescale.net
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>