Commit Graph

276369 Commits

Author SHA1 Message Date
Mark Brown 6664ee115b ASoC: Don't fail if we can't read the IRQ type in WM8903
If we fail to read the IRQ type from the interrupt controller don't
fail, just assume a value and solider on - we may fail later when we try
to request the IRQ but it's possible we'll succeed.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:30:24 +00:00
Stephen Warren 5d680b3a84 ASoC: WM8903: Add device tree binding
Document the device tree binding for the WM8903 codec, and modify the
driver to extract platform data from the device tree, if present.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren 9d35f3e100 ASoC: WM8903: Get default irq_active_low from IRQ controller
If the WM8903 is hooked up to an interrupt, set the irq_active_low flag
in the default platform data based on the IRQ's IRQ_TYPE. Map IRQ_TYPE_NONE
(a lack of explicit configuration/restriction) to irq_active_low = false;
the previous default.

This code is mainly added to support device tree interrupt bindings,
although will work perfectly well in a non device tree system too.

Any interrupt controller that supports only a single IRQ_TYPE could
set each IRQ's type based on that restriction. This applies equally
with and without device tree. To cater for interrupt controllers
that don't do this, for which irqd_get_trigger_type() will return
IRQ_TYPE_NONE, the platform data irq_active_low field may be used
in systems that don't use device tree.

With device tree, every IRQ must have some IRQ_TYPE set.

Controllers that support DT and multiple IRQ_TYPEs must define the
interrupts property (as used in interrupt source nodes) such that it
defines the IRQ_TYPE to use. When the core DT setup code initializes
wm8903->irq, the interrupts property will be parsed, and as a side-
effect, set the IRQ's IRQ_TYPE for the WM8903 probe() function to read.

Controllers that support DT and a single IRQ_TYPE could arrange to
set the IRQ_TYPE somehow during their initialization, or hard-code
it during the processing of the child interrupts property.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren db81778409 ASoC: WM8903: Remove conditionals checking pdata != NULL
The pdata pointer is now always valid. Remove any conditions that check
its validity.

This patch is mostly just removing an indentation level. One variable had
to be moved due to the removal of a scope, and one comment was split into
two. Viewing the patch with git show/diff -b will show that it's actually
very small.

Note that WM8903_MIC_BIAS_CONTROL_0 is now written unconditionally,
whereas it used to be written only if pdata was supplied. Since
defpdata.micdet_cfg = 0, this unconditional write simply echos the HW
defaults in the case where pdata is not supplied.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Stephen Warren a0f203d384 ASoC: WM8903: Fix platform data gpio_cfg confusion
wm8903_platform_data.gpio_cfg[] was intended to be interpreted as follows:
0:       Don't touch this GPIO's configuration register
1..7fff: Write that value to the GPIO's configuration register
8000:    Write zero to the GPIO's configuration register
other:   Undefined (invalid)

The rationale is that platform data is usually global data, and a value of
zero means that the field wasn't explicitly set to anything (e.g. because
the field was new to the pdata type, and existing users weren't update to
initialize it) and hence the value zero should be ignored. 0x8000 is an
explicit way to get 0 in the register.

The code worked this way until commit 7cfe561 "ASoC: wm8903: Expose GPIOs
through gpiolib", where the behaviour was changed due to my lack of
awareness of the above rationale.

This patch reverts to the intended behaviour, and updates all in-tree users
to use the correct scheme. This also makes WM8903 consistent with other
devices that use a similar scheme.

WM8903_GPIO_NO_CONFIG is also renamed to WM8903_GPIO_CONFIG_ZERO so that
its name accurately reflects its purpose.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Colin Cross <ccross@android.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-06 10:29:22 +00:00
Mark Brown 102477b638 Merge branch 'for-3.2' into for-3.3 2011-12-06 10:09:55 +00:00
Mark Brown cefcc03ffc ASoC: Provide a more complete DMA driver stub
Allow userspace applications to do more parameter setting by providing a
more complete stub DMA driver specifying a wildcard set of formats and
channels and essentially random values for the DMA parameters. This is
required for useful runtime operation of the dummy DMA driver until we
are able to figure out how to power up links and do hw_params() from DAPM.

Sending to stable as without this the dummy driver is not terribly
useful.

Reported-by: Kyung-Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.com>
Tested-by: Kyung-Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-12-06 10:05:07 +00:00
Mark Brown a2760e4b36 Merge branch 'for-3.2' into for-3.3 2011-12-05 19:30:05 +00:00
Mark Brown 145294c359 ASoC: Remove references to corgi and spitz from machine driver document
They're not currently actively worked on, the hardware being rather
obsolete by now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 19:29:54 +00:00
Mark Brown 209a600623 regmap: Add irq_base accessor to regmap_irq
Allows devices to discover their own interrupt without having to remember
it themselves.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 16:13:31 +00:00
Vinod Koul 03c33042db ASoC: sst_platform: fix the dsp driver interface
lower level drivers typically register with upper layers.
So fix by exporting symbols from sst_platform driver for dsp driver to
register to sst platform driver

Now this driver doesnt depend on sst driver, so remove the dependency
and the header files

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 14:02:31 +00:00
Axel Lin f031efe940 ASoC: Fix reg_cache_size for stac9766
reg_cache_size is supposed to be the number of elements in the register cache,
not the size in bytes.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:30:39 +00:00
Axel Lin 68020db8ac ASoC: uda1380: Convert to gpio_request_one()
Using gpio_request_one can make the error handling simpler.

Also remove a redundant "Failed to issue reset" error message.
We already show the error message in uda1380_reset() error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:24:49 +00:00
Axel Lin aec60f51e5 ASoC: Convert e740_wm9705 to use gpio_request_one()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:24:48 +00:00
Mark Brown bf31517335 regmap: Allow drivers to reinitialise the register cache at runtime
Sometimes the register map information may change in ways that drivers can
discover at runtime. For example, new revisions of a device may add new
registers. Support runtime discovery by drivers by allowing the register
cache to be reinitialised with a new function regmap_reinit_cache() which
discards the existing cache and creates a new one.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-05 13:17:36 +00:00
Mark Brown b71951d63d Merge branch 'for-3.2' into for-3.3 2011-12-04 23:47:39 +00:00
Axel Lin 570a2429e9 ASoC: Make SND_SOC_MX27VIS_AIC32X4 depend on I2C
SND_SOC_MX27VIS_AIC32X4 selects SND_SOC_TLV320AIC32X4,
but SND_SOC_TLV320AIC32X4 needs CONFIG_I2C.
So we need to make SND_SOC_MX27VIS_AIC32X4 depend on I2C.
otherwise I got below build error if CONFIG_I2C is not selected.

  CC      sound/soc/codecs/tlv320aic32x4.o
sound/soc/codecs/tlv320aic32x4.c: In function 'aic32x4_read':
sound/soc/codecs/tlv320aic32x4.c:323: error: implicit declaration of function 'i2c_smbus_read_byte_data'
sound/soc/codecs/tlv320aic32x4.c: In function 'aic32x4_probe':
sound/soc/codecs/tlv320aic32x4.c:641: error: 'i2c_master_send' undeclared (first use in this function)
sound/soc/codecs/tlv320aic32x4.c:641: error: (Each undeclared identifier is reported only once
sound/soc/codecs/tlv320aic32x4.c:641: error: for each function it appears in.)
sound/soc/codecs/tlv320aic32x4.c: In function 'aic32x4_modinit':
sound/soc/codecs/tlv320aic32x4.c:763: error: implicit declaration of function 'i2c_add_driver'
sound/soc/codecs/tlv320aic32x4.c: In function 'aic32x4_exit':
sound/soc/codecs/tlv320aic32x4.c:774: error: implicit declaration of function 'i2c_del_driver'
make[3]: *** [sound/soc/codecs/tlv320aic32x4.o] Error 1
make[2]: *** [sound/soc/codecs] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-04 23:47:16 +00:00
Axel Lin b971c370a4 ASoC: Fix dependency for SND_SOC_RAUMFELD and SND_PXA2XX_SOC_HX4700
SND_SOC_RAUMFELD selects SND_SOC_CS4270 which needs CONFIG_I2C,
and also selects SND_SOC_AK4104 which needs SPI_MASTER.
Thus make SND_SOC_RAUMFELD depend on I2C && SPI_MASTER.

Add depend on SPI_MASTER to fix below build error if CONFIG_SPI_MASTER
is not selected.

  LD      .tmp_vmlinux1
sound/built-in.o: In function `ak4104_spi_write':
last.c:(.text+0x290cc): undefined reference to `spi_sync'
sound/built-in.o: In function `ak4104_probe':
last.c:(.text+0x292a0): undefined reference to `spi_write_then_read'
sound/built-in.o: In function `ak4104_spi_probe':
last.c:(.text+0x29398): undefined reference to `spi_setup'
sound/built-in.o: In function `ak4104_init':
last.c:(.init.text+0x4ec): undefined reference to `spi_register_driver'
make: *** [.tmp_vmlinux1] Error 1

Add depend on I2C to fix below build error if CONFIG_I2C is not selected:
  CC      sound/soc/codecs/cs4270.o
sound/soc/codecs/cs4270.c: In function 'cs4270_i2c_probe':
sound/soc/codecs/cs4270.c:657: error: implicit declaration of function 'i2c_smbus_read_byte_data'
sound/soc/codecs/cs4270.c: In function 'cs4270_init':
sound/soc/codecs/cs4270.c:730: error: implicit declaration of function 'i2c_add_driver'
sound/soc/codecs/cs4270.c: In function 'cs4270_exit':
sound/soc/codecs/cs4270.c:736: error: implicit declaration of function 'i2c_del_driver'
make[3]: *** [sound/soc/codecs/cs4270.o] Error 1
make[2]: *** [sound/soc/codecs] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

SND_PXA2XX_SOC_HX4700 selects SND_SOC_AK4641 which needs CONFIG_I2C.
Thus make SND_PXA2XX_SOC_HX4700 depend on I2C.

Add depend on I2C to fix below build error if CONFIG_I2C is not selected:
  CC      sound/soc/codecs/ak4641.o
sound/soc/codecs/ak4641.c: In function 'ak4641_modinit':
sound/soc/codecs/ak4641.c:646: error: implicit declaration of function 'i2c_add_driver'
sound/soc/codecs/ak4641.c: In function 'ak4641_exit':
sound/soc/codecs/ak4641.c:656: error: implicit declaration of function 'i2c_del_driver'
make[3]: *** [sound/soc/codecs/ak4641.o] Error 1
make[2]: *** [sound/soc/codecs] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-04 23:47:16 +00:00
Axel Lin ef1497707c ASoC: uda1380: Return proper error in uda1380_modinit failure path
Return proper error for uda1380_modinit if i2c_add_driver() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-04 23:47:15 +00:00
Axel Lin dd85ecc269 ASoC: Make SND_SOC_LITTLEMILL select MFD_WM8994
SND_SOC_LITTLEMILL selects SND_SOC_WM8994, but SND_SOC_WM8994 needs MFD_WM8994.
Thus we need to select MFD_WM8994 to fix below build error:

  LD      .tmp_vmlinux1
sound/built-in.o: In function `wm8994_write':
sound/soc/codecs/wm8994.c:201: undefined reference to `wm8994_reg_write'
sound/built-in.o: In function `wm8994_read':
sound/soc/codecs/wm8994.c:222: undefined reference to `wm8994_reg_read'
sound/built-in.o: In function `wm8994_resume':
sound/soc/codecs/wm8994.c:2847: undefined reference to `wm8994_reg_read'
sound/built-in.o: In function `wm8994_codec_probe':
sound/soc/codecs/wm8994.c:3501: undefined reference to `wm8994_reg_read'
sound/soc/codecs/wm8994.c:3660: undefined reference to `wm8994_reg_read'
sound/soc/codecs/wm8994.c:3672: undefined reference to `wm8994_reg_read'
sound/built-in.o: In function `wm8958_dsp2_fw':
sound/soc/codecs/wm8958-dsp2.c:154: undefined reference to `wm8994_bulk_write'
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-04 01:17:05 +00:00
Mark Brown 59792aa91f ASoC: Sort WM9090 in with the CODEC drivers
The driver itself has been a regular CODEC driver for a while now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:22 +00:00
Mark Brown 4911ccdb9d ASoC: Convert WM2000 into a standard CODEC driver
We've been able to handle external amps for a while now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:21 +00:00
Mark Brown 8aa1fe81c5 ASoC: Convert wm2000 to use regmap API
The driver wasn't even using the ASoC common code.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:20 +00:00
Mark Brown 012d12db0c ASoC: Remove unused struct wm2000_setup_data
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:19 +00:00
Mark Brown e41d5a3b7a ASoC: Convert WM8728 to table based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:18 +00:00
Mark Brown 2f5374d8cf ASoC: Convert WM8711 to table based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:17 +00:00
Mark Brown 0f185e3f8b ASoC: Convert WM8750 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:16 +00:00
Mark Brown 0e62780f5f ASoC: Convert WM8741 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:14 +00:00
Mark Brown f235c649c1 ASoC: Convert WM8580 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:13 +00:00
Mark Brown b6709f3bbd ASoC: Convert WM8510 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:12 +00:00
Mark Brown b4505ab141 ASoC: Convert WM8400 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:11 +00:00
Mark Brown e6c94e9f6d ASoC: Convert WM8350 to table based DAPM and control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:10 +00:00
Mark Brown 455b91bfe8 ASoC: Convert WM9090 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:09 +00:00
Mark Brown 2edaed82b7 ASoC: Convert WM8750 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:08 +00:00
Mark Brown 5aefb306e3 ASoC: Convert WM8741 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:07 +00:00
Mark Brown b903c0ed2e ASoC: Convert WM8400 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:06 +00:00
Mark Brown 0d1fe0d452 ASoC: Convert WM8350 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:05 +00:00
Mark Brown b03e96e4d6 ASoC: Convert WM2000 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:04 +00:00
Mark Brown 6cd4eb9592 ASoC: Remove unused AUDIO_NAME define from WM8960
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:03 +00:00
Mark Brown 3a0d077f3d ASoC: Remove I2C ifdefs from WM8960
The driver only supports I2C as the control interface.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:02 +00:00
Mark Brown 091edccf7f ASoC: Remove unused -codec from Wolfson device driver names
Devices that aren't MFDs don't need to distinguish this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 21:35:01 +00:00
Stephen Warren c0eb27cf84 ASoC: WM8903: Create default platform data structure
When no platform data is supplied, point pdata at a default platform
structure. This enables two future changes:

a) Defines the default platform data values in a single place.
b) There is always a valid pdata pointer, so some conditional code can
   be simplified by a later patch.

Based on work by John Bonesio, but significantly reworked since then.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03 11:19:08 +00:00
Mark Brown 672b0c6a37 Merge branch 'for-3.2' into for-3.3 2011-12-03 11:07:43 +00:00
Mark Brown 7d46a528c6 ASoC: Move initial WM8903 identification and reset to I2C probe
Get control of the device earlier and avoid trying to do an ASoC probe
on a card that won't work.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 11:00:10 +00:00
Mark Brown ee244ce4ea ASoC: Convert WM8903 to direct regmap API usage
Converting to an rbtree cache as regcache doesn't have a flat cache.
Since the top of the register map is fairly sparse this should be an
overall win.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 11:00:07 +00:00
Mark Brown 82ae55dbcc ASoC: Don't resync WM8903 register cache on reset
We only do this on initial power on so it's at best a waste of time as
the core will have already defaulted to the same values.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:45 +00:00
Mark Brown 45e967553f ASoC: Use a normal cache sync for WM8903
The driver used to use a complicated method to sync the register cache
after having brought the bias level up to standby in resume due to the
use of the write sequencer to manage the initial power up. Now that we
don't use the write sequencer there is no need for this and we can just
use snd_soc_cache_sync() directly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:45 +00:00
Mark Brown 88a1b12b9c ASoC: WM8903 only supports I2C so don't ifdef it
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:44 +00:00
Mark Brown f4a10837c9 ASoC: Use table based control init for WM8903
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:43 +00:00
Mark Brown 2950cd2208 ASoC: Convert WM8903 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
2011-12-03 10:59:32 +00:00