summaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: don't register AC97 devices twiceMika Westerberg2010-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With generic AC97 ASoC glue driver (codec/ac97.c), we get following warning when the device is registered (slightly stripped the backtrace): kobject (c5a863e8): tried to init an initialized object, something is seriously wrong. [<c00254fc>] (unwind_backtrace+0x0/0xec) [<c014fad0>] (kobject_init+0x38/0x70) [<c0171e94>] (device_initialize+0x20/0x70) [<c017267c>] (device_register+0xc/0x18) [<bf20db70>] (snd_soc_instantiate_cards+0x924/0xacc [snd_soc_core]) [<bf20e0d0>] (snd_soc_register_platform+0x16c/0x198 [snd_soc_core]) [<c0175304>] (platform_drv_probe+0x18/0x1c) [<c0174454>] (driver_probe_device+0xb0/0x16c) [<c017456c>] (__driver_attach+0x5c/0x7c) [<c0173cec>] (bus_for_each_dev+0x48/0x78) [<c0173600>] (bus_add_driver+0x98/0x214) [<c0174834>] (driver_register+0xa4/0x130) [<c001f410>] (do_one_initcall+0xd0/0x1a4) [<c0062ddc>] (sys_init_module+0x12b0/0x1454) This happens because the generic AC97 glue driver creates its codec->ac97 via calling snd_ac97_mixer(). snd_ac97_mixer() provides own version of snd_device.register which handles the device registration when snd_card_register() is called. To avoid registering the AC97 device twice, we add a new flag to the snd_soc_codec: ac97_created which tells whether the AC97 device was created by SoC subsystem. Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Use delayed work for debounce of GPIO based jacksMark Brown2010-10-071-1/+1
| | | | | | | | | | | Rather than block the workqueue by sleeping to do the debounce use delayed work to implement the debounce time. This should also means that we extend the debounce time on each new bounce, potentially allowing shorter debounce times for clean insertions. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Swap bias level enumerationJarkko Nikula2010-08-311-3/+3
| | | | | | | | | Swapping the bias level enumeration is only meant to help debugging. It is easier if number 0 means bias off and bigger number means bigger bias level. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: multi-component - ASoC Multi-Component SupportLiam Girdwood2010-08-121-93/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the ASoC API to allow sound cards to have more than one CODEC and more than one platform DMA controller. This is achieved by dividing some current ASoC structures that contain both driver data and device data into structures that only either contain device data or driver data. i.e. struct snd_soc_codec ---> struct snd_soc_codec (device data) +-> struct snd_soc_codec_driver (driver data) struct snd_soc_platform ---> struct snd_soc_platform (device data) +-> struct snd_soc_platform_driver (driver data) struct snd_soc_dai ---> struct snd_soc_dai (device data) +-> struct snd_soc_dai_driver (driver data) struct snd_soc_device ---> deleted This now allows ASoC to be more tightly aligned with the Linux driver model and also means that every ASoC codec, platform and (platform) DAI is a kernel device. ASoC component private data is now stored as device private data. The ASoC sound card struct snd_soc_card has also been updated to store lists of it's components rather than a pointer to a codec and platform. The PCM runtime struct soc_pcm_runtime now has pointers to all its components. This patch adds DAPM support for ASoC multi-component and removes struct snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec or runtime PCM level basis rather than using snd_soc_socdev. Other notable multi-component changes:- * Stream operations now de-reference less structures. * close_delayed work() now runs on a DAI basis rather than looping all DAIs in a card. * PM suspend()/resume() operations can now handle N CODECs and Platforms per sound card. * Added soc_bind_dai_link() to bind the component devices to the sound card. * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove DAI link components. * sysfs entries can now be registered per component per card. * snd_soc_new_pcms() functionailty rolled into dai_link_probe(). * snd_soc_register_codec() now does all the codec list and mutex init. This patch changes the probe() and remove() of the CODEC drivers as follows:- o Make CODEC driver a platform driver o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core. o Removed all static codec pointers (drivers now support > 1 codec dev) o snd_soc_register_pcms() now done by core. o snd_soc_register_dai() folded into snd_soc_register_codec(). CS4270 portions: Acked-by: Timur Tabi <timur@freescale.com> Some TLV320aic23 and Cirrus platform fixes. Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> TI CODEC and OMAP fixes Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Samsung platform and misc fixes :- Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> MPC8610 and PPC fixes. Signed-off-by: Timur Tabi <timur@freescale.com> i.MX fixes and some core fixes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> J4740 platform fixes:- Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> CC: Tony Lindgren <tony@atomide.com> CC: Nicolas Ferre <nicolas.ferre@atmel.com> CC: Kevin Hilman <khilman@deeprootsystems.com> CC: Sascha Hauer <s.hauer@pengutronix.de> CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp> CC: Kuninori Morimoto <morimoto.kuninori@renesas.com> CC: Daniel Gloeckner <dg@emlix.com> CC: Manuel Lauss <mano@roarinelk.homelinux.net> CC: Mike Frysinger <vapier.adi@gmail.com> CC: Arnaud Patard <apatard@mandriva.com> CC: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Add SOC_DOUBLE_R_SX_TLV controlapatard@mandriva.com2010-05-161-0/+21
| | | | | | | | | | | | This patch is adding a new control which has the following capabilities: - tlv - variable data size (for instance, 7 ou 8 bit) - double mixer - data range centered around 0 Signed-off-by: Arnaud Patard <apatard@mandriva.com> Acked-by: Liam Girdwood <lrg@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: core: Fix for the volume limiting when invert is in usePeter Ujfalusi2010-05-111-11/+12
| | | | | | | | | | | | | | | | | | | | If the register for the volume needs invert, than the inversion need to be done from the chip maximum, and not from the platform dependent limit. Introduce soc_mixer_control.platform_max value, which initially equals to chip maximum. The snd_soc_limit_volume function only modify the platform_max, all volsw_info call returns this as well. The .max value holds the chip default (maximum), and it is used for the inversion, if it is needed. Additional check in the volsw_info call has been added to check the validity of the platform_max in case, when custom macros used by codec drivers are not initializing it correctly. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Allow DAI links to be kept active over suspendMark Brown2010-05-101-0/+3
| | | | | | | | | | | | | As well as allowing DAPM pins to be marked as ignoring suspend allow DAI links to be similarly marked. This is primarily intended for digital links between CODECs and non-CPU devices such as basebands in mobile phones and will suppress all suspend calls for the DAI link. It is likely that this will need to be revisited if used with devices which are part of the SoC CPU. Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: core: Support for limiting the volumePeter Ujfalusi2010-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | Add support for the core to limit the maximum volume on an existing control. The function will modify the soc_mixer_control.max value of the given control. The new value must be lower than the original one (chip maximum) If there is a need for limiting a gain on a given control, than machine drivers can do the following in their snd_soc_dai_link.init function: snd_soc_limit_volume(codec, "TPA6140A2 Headphone Playback Volume", 21); This will modify the original 31 (chip maximum) to 21, so user space will not be able to set the gain higher than this. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add indirection for CODEC private dataMark Brown2010-04-171-1/+12
| | | | | | | | | | | | | | | | One of the features of the multi CODEC work is that it embeds a struct device in the CODEC to provide diagnostics via a sysfs class rather than via the device tree, at which point it's much better to use the struct device private data rather than having two places to store it. Provide an accessor function to allow this change to be made more easily, and update all the CODEC drivers are updated. To ensure use of the accessor the private data structure member is renamed, meaning that if code developed with older an older core that still uses private_data is merged it will fail to build. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* Merge branch 'for-2.6.34' into for-2.6.35Mark Brown2010-04-051-1/+1
|\ | | | | | | | | Conflicts due to context changes next to the backported DMA data change: include/sound/soc.h
| * ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_streamDaniel Mack2010-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a memory corruption when ASoC devices are used in full-duplex mode. Specifically for pxa-ssp code, where this pointer is dynamically allocated for each direction and destroyed upon each stream start. All other platforms are fixed blindly, I couldn't even compile-test them. Sorry for any breakage I may have caused. [Note that this is a backported version for 2.6.34. Upstream commit is fd23b7dee] Signed-off-by: Daniel Mack <daniel@caiaq.de> Reported-by: Sven Neumann <s.neumann@raumfeld.com> Reported-by: Michael Hirsch <m.hirsch@raumfeld.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Add a notifier for jack status changesMark Brown2010-03-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Some systems provide both mechanical and electrical detection of jack status changes. On such systems power savings can be achieved by only enabling the electrical detection methods when physical insertion has been detected. Begin supporting such systems by providing a notifier for jack status changes which can be used to trigger any reconfiguration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* | ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_streamDaniel Mack2010-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a memory corruption when ASoC devices are used in full-duplex mode. Specifically for pxa-ssp code, where this pointer is dynamically allocated for each direction and destroyed upon each stream start. All other platforms are fixed blindly, I couldn't even compile-test them. Sorry for any breakage I may have caused. Reported-by: Sven Neumann <s.neumann@raumfeld.com> Reported-by: Michael Hirsch <m.hirsch@raumfeld.com> Signed-off-by: Daniel Mack <daniel@caiaq.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: core: Add delay operation to snd_soc_dai_opsPeter Ujfalusi2010-03-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The delay callback can be used by the core to query the delay on the dai caused by FIFO or delay in the platform side. In case if both CPU and CODEC dai has FIFO the delay reported by each will be added to form the full delay on the chain. If none of the dai has FIFO, than the delay will be kept as zero. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow mulitple usage count of codec and cpu daiJassi Brar2010-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | If we are to have a snd_soc_dai i.e, cpu_dai and codec_dai, shared among two or more dai_links we need to log the number of active users of the dai. For that, we change semantics of the snd_soc_dai.active flag from indicator to reference counter. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Pass dai_link as argument to platform suspend and resumejassi brar2010-02-221-2/+3
|/ | | | | | | | | | Passing pointer to relevant dai_link provides easier reach to the ASoC tree in suspend/resume of snd_soc_platform. It also provides direct access to the dai at the other end of the dai_link. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Make pmdown_time a longMark Brown2010-02-171-1/+1
| | | | | | | Fixes a warning. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Make pmdown_time a per-card settingMark Brown2010-02-161-0/+2
| | | | | | | | | | Make the pmdown_time a per-card setting rather than a global one, initialised before the card initialisation runs. This allows cards to override the default setting if it makes sense to do so (for example, due to an unavoidable pop). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Add a cache_sync bit to the CODEC structureMark Brown2010-02-041-0/+1
| | | | | | | | | | Add a bit to the CODEC structure indicating if a cache sync is required. By default this will be set if a cache only write is done to a soc-cache register cache. This allows us to avoid syncing the cache back after using cache only writes if there were no changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Allow CODECs to ask soc-cache to suppress physical writesMark Brown2010-02-031-0/+1
| | | | | | | | | | | Currently the soc-cache code will always write to the device, meaning that we need the device to be powered and active at pretty much all times the system is active. Allowing cache only writes lays some groundwork for future enhancements to allow devices to be put into a full off state when the audio subsystem is idle. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: add helper macros to declare struct soc_enum instancesGuennadi Liakhovetski2010-01-251-0/+17
| | | | | | | | | Several shortcuts for popular uses of some of SOC_ENUM_* and SOC_VALUE_ENUM_* macros. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Support turning off bias when the CODEC is idleMark Brown2010-01-211-0/+2
| | | | | | | | | | | | | | | | | | | | Currently ASoC always maintains the bias of the CODEC while the system is active. With older mobile CODECs this is required since the outputs are referenced to a non-zero voltage and enabling or disabling this voltage without audible pops or clicks in the output takes too long to do when starting or stopping audio. As a result of features such as ground referenced outputs and class D speaker drivers current generation devices are able to power on and off much more quickly without these system level issues so provide a new flag idle_bias_off in snd_soc_codec which will cause the core to turn off the CODEC bias. The distinction between STANDBY and OFF is still maintained. This is partly for consistency but also allows for potential future extensions such as per-machine overrides or deferring the bias removal. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Export snd_soc_update_bits_unlocked()Mark Brown2009-12-041-0/+3
| | | | | | | Allows custom controls to use it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Add BCLK calculation utility for TDM mode tooMark Brown2009-11-251-0/+1
| | | | | Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add jack_status_check callback function for GPIO jacksJoonyoung Shim2009-11-121-0/+2
| | | | | | | | | | | The jack_status_check callback function is the interface to check the status of the jack. Some target provides the method to distinguish what is the jack inserted - headphone jack, microphone jack, tvout jack, etc, so we can implement it using the jack_status_check function. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add bit clock rate calculator utility functionsMark Brown2009-11-121-0/+5
| | | | | | | | | | Many devices need to calculate the bit clock rate desired to work out the clock configuration required for the device. Provide utility functions to do this using both hw_params structures and raw numbers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
* ASoC: Factor out snd_soc_init_card()Mark Brown2009-11-031-1/+0
| | | | | | | | | snd_soc_init_card() is always called as the last part of the CODEC probe function so we can factor it out into the core card setup rather than have each CODEC replicate the code to do the initialiastation. This will be required to support multiple CODECs per card. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Remove snd_soc_suspend_device()Mark Brown2009-10-151-5/+0
| | | | | | | | The PM core will grow pm_link infrastructure in 2.6.33 which can be used to implement the intended functionality of the ASoC-specific device suspend and resume callbacks so drop them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: add support for multiple cards/codecs in debugfsPeter Ujfalusi2009-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | In order to support multiple codecs on the same system in the debugfs the directory hierarchy need to be changed by adding directory per codec under the asoc direcorty: debugfs/asoc/{dev_name(socdev->dev)}-{codec->name}/codec_reg /dapm_pop_time /dapm/{widgets} With the original implementation only the debugfs files are only created for the first codec, other codecs loaded later would fail to create the debugfs files (since they are already exist). Furthermore in this situation any of the codecs has been removed, would cause the debugfs entries to disappear, regardless if the codec, which created them are still loaded (the one which loaded first). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Remove unuused hw_read_tMark Brown2009-09-071-1/+0
| | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add DAPM widget power decision debugfs filesMark Brown2009-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | Currently when built with DEBUG DAPM will dump information about the power state decisions it is taking for each widget to dmesg. This isn't an ideal way of getting the information - it requires a kernel build to turn it on and off and for large hub CODECs the volume of information is so large as to be illegible. When the output goes to the console it can also cause a noticable impact on performance simply to print it out. Improve the situation by adding a dapm directory to our debugfs tree containing a file per widget with the same information in it. This still requires a decision to build with debugfs support but is easier to navigate and much less intrusive. In addition to the previously displayed information active streams are also shown in these files. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'reg-cache' into for-2.6.32Mark Brown2009-08-071-1/+10
|\
| * ASoC: Factor out I2C 8 bit address 16 bit data I/OMark Brown2009-08-031-1/+1
| | | | | | | | | | | | | | As part of this refactoring the type of the CODEC hw_read operation is changed to match the regular read operation. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Add I/O control bus information to factored out cache setupMark Brown2009-08-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | While writes tend to be able to use a fairly bus independant format to do the writes reads are all bus specific. To allow us to factor out this code include the bus type as a parameter when setting up the cache. Initially just use this to factor out hw_write_t for I2C. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: Begin to factor out register cache I/O functionsMark Brown2009-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of CODECs share the same register data formats and therefore replicate the code to manage access to and caching of the register map. In order to reduce code duplication centralised versions of this code will be introduced with drivers able to configure the use of the common code by calling the new snd_soc_codec_set_cache_io() API call during startup. As an initial user the 7 bit address/9 bit data format used by many Wolfson devices is supported for write only CODECs and the drivers with straightforward register cache implementations are converted to use it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow CODECs to flag invalid registersMark Brown2009-07-311-0/+1
| | | | | | | | | | | | | | This helps CODECs with sparse register maps work better with the register cache display interface. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: add SOC_DOUBLE_R_EXT_TLV control typeJoonyoung Shim2009-07-151-0/+11
| | | | | | | | | | | | | | | | | | This is a macro for double controls with special callback function and TLV. The SOC_DOUBLE_R_EXT_TLV needs two registers and one shift for double controls. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: add SOC_DOUBLE_EXT_TLV control typeJoonyoung Shim2009-07-151-0/+11
|/ | | | | | | | | This is a macro for double controls with special callback function and TLV. The SOC_DOUBLE_EXT_TLV needs one register and two shifts for double controls. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add CODEC volatile register operationMark Brown2009-07-051-0/+2
| | | | | | | | Add a volatile_register() operation to the CODEC structure providing a standard operation to query if a register is volatile. This will be used to factor out the register cache I/O operations for the CODECs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add stub suspend and resume calls for ASoC subdevicesMark Brown2009-06-131-0/+5
| | | | | | | | | | | | | | | | Now that ASoC subdevices can be regular devices they can have normal suspend and resume calls from their buses. However, suspending them individually is not desirable since this can lead to problems such as pops and clicks from devices being suspended with their signals being amplified or clocks being stopped suddenly. This will be resolved by having the normal device model suspend and resume calls call into ASoC which will suspend the entire card while any of its components are suspended. At present this is not yet implemented but in order to aid the transition of drivers to the standard device model this patch adds API calls for the notifications. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'dapm' into for-2.6.32Mark Brown2009-06-111-2/+0
|\
| * ASoC: Make DAPM power sequence lists local variablesMark Brown2009-06-081-2/+0
| | | | | | | | | | | | | | They are now only accessed within dapm_power_widgets() so can be local to that function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: Allow 32 bit registers for DAPMDaniel Ribeiro2009-06-081-2/+2
|/ | | | | | | | Replace the remaining unsigned shorts with unsigned ints. Tested with pcap2 codec (25 bits registers). Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* AsoC: Make snd_soc_read() and snd_soc_write() functionsMark Brown2009-05-221-4/+13
| | | | | | | Should be no impact on the generated code but it helps the compiler print clearer messages. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Integrate bias management with DAPM power managementMark Brown2009-05-181-0/+1
| | | | | | | | | | Rather than managing the bias level of the system based on if there is an active audio stream manage it based on there being an active DAPM widget. This simplifies the code a little, moving the power handling into one place, and improves audio performance for bypass paths when no playbacks or captures are active. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Split DAPM power checks from sequencing of power changesMark Brown2009-05-181-0/+2
| | | | | | | | | | | | | | | | | | DAPM has always applied any changes to the power state of widgets as soon as it has determined that they are required. Instead of doing this store all the changes that are required on lists of widgets to power up and down, then iterate over those lists and apply the changes. This changes the sequence in which changes are implemented, doing all power downs before power ups and always using the up/down sequences (previously they were only used when changes were due to DAC/ADC power events). The error handling is also changed so that we continue attempting to power widgets if some changes fail. The main benefit of this is to allow future changes to do optimisations over the whole power sequence and to reduce the number of walks of the widget graph required to check the power status of widgets. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: add SOC_DOUBLE_EXT macroDaniel Mack2009-04-241-0/+8
| | | | | | | Add a macro for double controls with special callback functions. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Provide core support for symmetric sample ratesMark Brown2009-04-071-0/+6
| | | | | | | | | | | | | | | Many devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to other shared playback and record configuration in the device. Start providing core support for this by allowing the DAIs or the machine to specify that the sample rates used should be kept symmetric. A flag symmetric_rates is provided in the snd_soc_dai and snd_soc_dai_link structures. If this is set in either of the DAIs or in the machine then a constraint will be applied when a stream is already open preventing any changes in sample rate. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Add GPIO support for jack reporting interfaceLopez Cruz, Misael2009-03-041-0/+32
| | | | | | | | | | | | | | | | | | Add GPIO support to jack reporting framework in ASoC using gpiolib calls. The gpio support exports two new functions: snd_soc_jack_add_gpios and snd_soc_jack_free_gpios. Client drivers using gpio feature must pass an array of jack_gpio pins belonging to a specific jack to the snd_soc_jack_add_gpios function. The framework will request the gpios, set the data direction and request irq. The framework will update power status of related jack_pins when an event on the gpio pins comes according to the reporting bits defined for each gpio. All gpio resources allocated when adding jack_gpio pins can be released using snd_soc_jack_free_gpios function. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Push the codec runtime storage into the card structureMark Brown2009-01-271-1/+2
| | | | | | | This is a further stage on the road to refactoring away the ASoC platform device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
OpenPOWER on IntegriCloud