mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
![Liam Girdwood](/assets/img/avatar_default.png)
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>
153 lines
5.3 KiB
C
153 lines
5.3 KiB
C
/*
|
|
* ak4671.h -- audio driver for AK4671
|
|
*
|
|
* Copyright (C) 2009 Samsung Electronics Co.Ltd
|
|
* Author: Joonyoung Shim <jy0922.shim@samsung.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
*/
|
|
|
|
#ifndef _AK4671_H
|
|
#define _AK4671_H
|
|
|
|
#define AK4671_AD_DA_POWER_MANAGEMENT 0x00
|
|
#define AK4671_PLL_MODE_SELECT0 0x01
|
|
#define AK4671_PLL_MODE_SELECT1 0x02
|
|
#define AK4671_FORMAT_SELECT 0x03
|
|
#define AK4671_MIC_SIGNAL_SELECT 0x04
|
|
#define AK4671_MIC_AMP_GAIN 0x05
|
|
#define AK4671_MIXING_POWER_MANAGEMENT0 0x06
|
|
#define AK4671_MIXING_POWER_MANAGEMENT1 0x07
|
|
#define AK4671_OUTPUT_VOLUME_CONTROL 0x08
|
|
#define AK4671_LOUT1_SIGNAL_SELECT 0x09
|
|
#define AK4671_ROUT1_SIGNAL_SELECT 0x0a
|
|
#define AK4671_LOUT2_SIGNAL_SELECT 0x0b
|
|
#define AK4671_ROUT2_SIGNAL_SELECT 0x0c
|
|
#define AK4671_LOUT3_SIGNAL_SELECT 0x0d
|
|
#define AK4671_ROUT3_SIGNAL_SELECT 0x0e
|
|
#define AK4671_LOUT1_POWER_MANAGERMENT 0x0f
|
|
#define AK4671_LOUT2_POWER_MANAGERMENT 0x10
|
|
#define AK4671_LOUT3_POWER_MANAGERMENT 0x11
|
|
#define AK4671_LCH_INPUT_VOLUME_CONTROL 0x12
|
|
#define AK4671_RCH_INPUT_VOLUME_CONTROL 0x13
|
|
#define AK4671_ALC_REFERENCE_SELECT 0x14
|
|
#define AK4671_DIGITAL_MIXING_CONTROL 0x15
|
|
#define AK4671_ALC_TIMER_SELECT 0x16
|
|
#define AK4671_ALC_MODE_CONTROL 0x17
|
|
#define AK4671_MODE_CONTROL1 0x18
|
|
#define AK4671_MODE_CONTROL2 0x19
|
|
#define AK4671_LCH_OUTPUT_VOLUME_CONTROL 0x1a
|
|
#define AK4671_RCH_OUTPUT_VOLUME_CONTROL 0x1b
|
|
#define AK4671_SIDETONE_A_CONTROL 0x1c
|
|
#define AK4671_DIGITAL_FILTER_SELECT 0x1d
|
|
#define AK4671_FIL3_COEFFICIENT0 0x1e
|
|
#define AK4671_FIL3_COEFFICIENT1 0x1f
|
|
#define AK4671_FIL3_COEFFICIENT2 0x20
|
|
#define AK4671_FIL3_COEFFICIENT3 0x21
|
|
#define AK4671_EQ_COEFFICIENT0 0x22
|
|
#define AK4671_EQ_COEFFICIENT1 0x23
|
|
#define AK4671_EQ_COEFFICIENT2 0x24
|
|
#define AK4671_EQ_COEFFICIENT3 0x25
|
|
#define AK4671_EQ_COEFFICIENT4 0x26
|
|
#define AK4671_EQ_COEFFICIENT5 0x27
|
|
#define AK4671_FIL1_COEFFICIENT0 0x28
|
|
#define AK4671_FIL1_COEFFICIENT1 0x29
|
|
#define AK4671_FIL1_COEFFICIENT2 0x2a
|
|
#define AK4671_FIL1_COEFFICIENT3 0x2b
|
|
#define AK4671_FIL2_COEFFICIENT0 0x2c
|
|
#define AK4671_FIL2_COEFFICIENT1 0x2d
|
|
#define AK4671_FIL2_COEFFICIENT2 0x2e
|
|
#define AK4671_FIL2_COEFFICIENT3 0x2f
|
|
#define AK4671_DIGITAL_FILTER_SELECT2 0x30
|
|
#define AK4671_E1_COEFFICIENT0 0x32
|
|
#define AK4671_E1_COEFFICIENT1 0x33
|
|
#define AK4671_E1_COEFFICIENT2 0x34
|
|
#define AK4671_E1_COEFFICIENT3 0x35
|
|
#define AK4671_E1_COEFFICIENT4 0x36
|
|
#define AK4671_E1_COEFFICIENT5 0x37
|
|
#define AK4671_E2_COEFFICIENT0 0x38
|
|
#define AK4671_E2_COEFFICIENT1 0x39
|
|
#define AK4671_E2_COEFFICIENT2 0x3a
|
|
#define AK4671_E2_COEFFICIENT3 0x3b
|
|
#define AK4671_E2_COEFFICIENT4 0x3c
|
|
#define AK4671_E2_COEFFICIENT5 0x3d
|
|
#define AK4671_E3_COEFFICIENT0 0x3e
|
|
#define AK4671_E3_COEFFICIENT1 0x3f
|
|
#define AK4671_E3_COEFFICIENT2 0x40
|
|
#define AK4671_E3_COEFFICIENT3 0x41
|
|
#define AK4671_E3_COEFFICIENT4 0x42
|
|
#define AK4671_E3_COEFFICIENT5 0x43
|
|
#define AK4671_E4_COEFFICIENT0 0x44
|
|
#define AK4671_E4_COEFFICIENT1 0x45
|
|
#define AK4671_E4_COEFFICIENT2 0x46
|
|
#define AK4671_E4_COEFFICIENT3 0x47
|
|
#define AK4671_E4_COEFFICIENT4 0x48
|
|
#define AK4671_E4_COEFFICIENT5 0x49
|
|
#define AK4671_E5_COEFFICIENT0 0x4a
|
|
#define AK4671_E5_COEFFICIENT1 0x4b
|
|
#define AK4671_E5_COEFFICIENT2 0x4c
|
|
#define AK4671_E5_COEFFICIENT3 0x4d
|
|
#define AK4671_E5_COEFFICIENT4 0x4e
|
|
#define AK4671_E5_COEFFICIENT5 0x4f
|
|
#define AK4671_EQ_CONTROL_250HZ_100HZ 0x50
|
|
#define AK4671_EQ_CONTROL_3500HZ_1KHZ 0x51
|
|
#define AK4671_EQ_CONTRO_10KHZ 0x52
|
|
#define AK4671_PCM_IF_CONTROL0 0x53
|
|
#define AK4671_PCM_IF_CONTROL1 0x54
|
|
#define AK4671_PCM_IF_CONTROL2 0x55
|
|
#define AK4671_DIGITAL_VOLUME_B_CONTROL 0x56
|
|
#define AK4671_DIGITAL_VOLUME_C_CONTROL 0x57
|
|
#define AK4671_SIDETONE_VOLUME_CONTROL 0x58
|
|
#define AK4671_DIGITAL_MIXING_CONTROL2 0x59
|
|
#define AK4671_SAR_ADC_CONTROL 0x5a
|
|
|
|
#define AK4671_CACHEREGNUM (AK4671_SAR_ADC_CONTROL + 1)
|
|
|
|
/* Bitfield Definitions */
|
|
|
|
/* AK4671_AD_DA_POWER_MANAGEMENT (0x00) Fields */
|
|
#define AK4671_PMVCM 0x01
|
|
|
|
/* AK4671_PLL_MODE_SELECT0 (0x01) Fields */
|
|
#define AK4671_PLL 0x0f
|
|
#define AK4671_PLL_11_2896MHZ (4 << 0)
|
|
#define AK4671_PLL_12_288MHZ (5 << 0)
|
|
#define AK4671_PLL_12MHZ (6 << 0)
|
|
#define AK4671_PLL_24MHZ (7 << 0)
|
|
#define AK4671_PLL_19_2MHZ (8 << 0)
|
|
#define AK4671_PLL_13_5MHZ (12 << 0)
|
|
#define AK4671_PLL_27MHZ (13 << 0)
|
|
#define AK4671_PLL_13MHZ (14 << 0)
|
|
#define AK4671_PLL_26MHZ (15 << 0)
|
|
#define AK4671_FS 0xf0
|
|
#define AK4671_FS_8KHZ (0 << 4)
|
|
#define AK4671_FS_12KHZ (1 << 4)
|
|
#define AK4671_FS_16KHZ (2 << 4)
|
|
#define AK4671_FS_24KHZ (3 << 4)
|
|
#define AK4671_FS_11_025KHZ (5 << 4)
|
|
#define AK4671_FS_22_05KHZ (7 << 4)
|
|
#define AK4671_FS_32KHZ (10 << 4)
|
|
#define AK4671_FS_48KHZ (11 << 4)
|
|
#define AK4671_FS_44_1KHZ (15 << 4)
|
|
|
|
/* AK4671_PLL_MODE_SELECT1 (0x02) Fields */
|
|
#define AK4671_PMPLL 0x01
|
|
#define AK4671_M_S 0x02
|
|
|
|
/* AK4671_FORMAT_SELECT (0x03) Fields */
|
|
#define AK4671_DIF 0x03
|
|
#define AK4671_DIF_DSP_MODE (0 << 0)
|
|
#define AK4671_DIF_MSB_MODE (2 << 0)
|
|
#define AK4671_DIF_I2S_MODE (3 << 0)
|
|
#define AK4671_BCKP 0x04
|
|
#define AK4671_MSBS 0x08
|
|
#define AK4671_SDOD 0x10
|
|
|
|
/* AK4671_LOUT2_POWER_MANAGEMENT (0x10) Fields */
|
|
#define AK4671_MUTEN 0x04
|
|
|
|
#endif
|