ASoC updates for 2.6.31
Subsystems (5)
The following changes since commit 8a1f936acdfd53cb0a981f3f80483863dcd84fa9:
Peter Ujfalusi (1):
ASoC: TWL4030: Add 4 channel TDM support
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.31
Daniel Mack (3):
ASoC: add SOC_DOUBLE_EXT macro
ASoC: cs4270: fix Master Capture Switch polarity
ASoC: cs4270: add Master Playback Switch
Jon Smirl (3):
ASoC: Set the MPC5200 i2s driver to BROKEN status.
ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
ASoC: Rename the PSC functions to DMA
Jonathan Cameron (1):
ASoC WM8940 Driver
Joonyoung Shim (1):
ASoC: TWL4030: Fix gain control for earpiece amplifier
Mark Brown (10):
ASoC: Fix S3C64xx IIS device registration and support both ports
ASoC: S3C2412: Failing to get the I2S clock is an error
ASoC: Enforce symmetric rates for S3C64xx I2S interface
ASoC: Include WM8350 register definitions in CODEC header
ASoC: s3c-i2s-v2 diagnostic improvements
ASoC: Use our registration function for S3C64xx
ASoC: Fix logic in WM8350 master clocking check
Merge branch 'for-2.6.30' into for-2.6.31
ASoC: Staticise TLV values in WM8940
Merge branch 'for-2.6.30' into for-2.6.31
Peter Ujfalusi (1):
ASoC: Beagle: Add support for 4 channel
include/sound/soc.h | 8 + sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs4270.c | 44 ++- sound/soc/codecs/twl4030.c | 8 +- sound/soc/codecs/wm8350.c | 2 +- sound/soc/codecs/wm8350.h | 1 + sound/soc/codecs/wm8940.c | 955 +++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8940.h | 104 +++++ sound/soc/fsl/Kconfig | 6 +- sound/soc/fsl/Makefile | 2 + sound/soc/fsl/mpc5200_dma.c | 457 +++++++++++++++++++ sound/soc/fsl/mpc5200_dma.h | 81 ++++ sound/soc/fsl/mpc5200_psc_i2s.c | 644 ++++----------------------- sound/soc/omap/omap3beagle.c | 26 +- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- sound/soc/s3c24xx/s3c64xx-i2s.c | 148 ++++-- sound/soc/s3c24xx/s3c64xx-i2s.h | 2 +- 18 files changed, 1867 insertions(+), 629 deletions(-) create mode 100644 sound/soc/codecs/wm8940.c create mode 100644 sound/soc/codecs/wm8940.h create mode 100644 sound/soc/fsl/mpc5200_dma.c create mode 100644 sound/soc/fsl/mpc5200_dma.h
PATCH 1/17 ASoC: Beagle: Add support for 4 channel
From: Peter Ujfalusi <[email protected]>
This patch adds support for the four channel TDM mode on Beagle board.
Depending on the channel count, the interface needs to be configured differently (I2S for stereo DSP_A for four channels)
--- sound/soc/omap/omap3beagle.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-)
sound/soc/omap/omap3beagle.c +18 -8
@@ -41,23 +41,33 @@ static int omap3beagle_hw_params(struct snd_pcm_substream *substream,struct snd_soc_pcm_runtime *rtd = substream->private_data;struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; +unsigned int fmt;int ret; +switch (params_channels (params)) { +case 2 :/* Stereo I2S mode */ + fmt =SND_SOC_DAIFMT_I2S | +SND_SOC_DAIFMT_NB_NF | +SND_SOC_DAIFMT_CBM_CFM ; +break ; +case 4 :/* Four channel TDM mode */ + fmt =SND_SOC_DAIFMT_DSP_A | +SND_SOC_DAIFMT_IB_NF | +SND_SOC_DAIFMT_CBM_CFM ; +break ; +default : +return -EINVAL ; + } +/* Set codec DAI configuration */ - ret =snd_soc_dai_set_fmt (codec_dai, -SND_SOC_DAIFMT_I2S | -SND_SOC_DAIFMT_NB_NF | -SND_SOC_DAIFMT_CBM_CFM ); + ret =snd_soc_dai_set_fmt (codec_dai, fmt);if (ret <0 ) {printk (KERN_ERR "can't set codec DAI configuration\n" );return ret; }/* Set cpu DAI configuration */ - ret =snd_soc_dai_set_fmt (cpu_dai, -SND_SOC_DAIFMT_I2S | -SND_SOC_DAIFMT_NB_NF | -SND_SOC_DAIFMT_CBM_CFM ); + ret =snd_soc_dai_set_fmt (cpu_dai, fmt);if (ret <0 ) {printk (KERN_ERR "can't set cpu DAI configuration\n" );return ret;
Signature · 1 line
1.6.2.4
PATCH 2/17 ASoC: add SOC_DOUBLE_EXT macro
In reply to Mark BrownFrom: Daniel Mack <[email protected]>
Add a macro for double controls with special callback functions.
--- include/sound/soc.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
include/sound/soc.h +8 -0
@@ -118,6 +118,14 @@ .info = snd_soc_info_volsw, \ .get = xhandler_get, .put = xhandler_put, \ .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } +#define SOC_DOUBLE_EXT (xname, xreg, shift_left, shift_right, xmax, xinvert,\ + xhandler_get, xhandler_put) \ +{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ + .info = snd_soc_info_volsw, \ + .get = xhandler_get, .put = xhandler_put, \ + .private_value = (unsigned long)&(struct soc_mixer_control) \ + {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ + .max = xmax, .invert = xinvert} }#define SOC_SINGLE_EXT_TLV (xname, xreg, xshift, xmax, xinvert,\ xhandler_get, xhandler_put, tlv_array) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
Signature · 1 line
1.6.2.4
PATCH 3/17 ASoC: Fix S3C64xx IIS device registration and support both ports
In reply to Mark BrownThe S3C64xx IIS code had a number of problems with device registration. The hardware has two IIS ports of which the driver supported only one at once via a single exported DAI, attempting to identify the DAI to use based on the dev->id of the ASoC platform device. As well as limiting the driver to only supporting one IIS port at once this also meant that the ID of the soc-audio device (or in future the card device) had to match the IIS ID.
Fix both problems by converting the driver to register the DAIs based on probing of platform devices registered by the arch/arm code, using those platform devices to interact with the clock API.
--- sound/soc/s3c24xx/s3c64xx-i2s.c | 146 ++++++++++++++++++++++++++------------- sound/soc/s3c24xx/s3c64xx-i2s.h | 2 +- 2 files changed, 98 insertions(+), 50 deletions(-)
sound/soc/s3c24xx/s3c64xx-i2s.c +97 -49
@@ -120,36 +120,8 @@ EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clockrate);static int s3c64xx_i2s_probe (struct platform_device *pdev,struct snd_soc_dai *dai) { -struct device *dev = &pdev->dev; -struct s3c_i2sv2_info *i2s; -int ret; - -dev_dbg (dev,"%s: probing dai %d\n" , __func__, pdev->id); - -if (pdev->id <0 || pdev->id >ARRAY_SIZE (s3c64xx_i2s)) { -dev_err (dev,"id %d out of range\n" , pdev->id); -return -EINVAL ; - } - - i2s = &s3c64xx_i2s[pdev->id]; - - ret =s3c_i2sv2_probe (pdev, dai, i2s, - pdev->id ?S3C64XX_PA_IIS1 :S3C64XX_PA_IIS0 ); -if (ret) -return ret; - - i2s->dma_capture = &s3c64xx_i2s_pcm_stereo_in[pdev->id]; - i2s->dma_playback = &s3c64xx_i2s_pcm_stereo_out[pdev->id]; - - i2s->iis_cclk =clk_get (dev,"audio-bus" ); -if (IS_ERR (i2s->iis_cclk)) { -dev_err (dev,"failed to get audio-bus" ); -iounmap (i2s->regs); -return -ENODEV ; - } -/* configure GPIO for i2s port */ -switch (pdev->id) { +switch (dai->id) {case 0 :s3c_gpio_cfgpin (S3C64XX_GPD (0 ),S3C64XX_GPD0_I2S0_CLK );s3c_gpio_cfgpin (S3C64XX_GPD (1 ),S3C64XX_GPD1_I2S0_CDCLK );
@@ -181,35 +153,114 @@ static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops = { .set_sysclk = s3c64xx_i2s_set_sysclk, }; -struct snd_soc_dai s3c64xx_i2s_dai = { - .name ="s3c64xx-i2s" , - .id =0 , - .probe = s3c64xx_i2s_probe, - .playback = { - .channels_min =2 , - .channels_max =2 , - .rates =S3C64XX_I2S_RATES , - .formats =S3C64XX_I2S_FMTS , +struct snd_soc_dai s3c64xx_i2s_dai[] = { + { + .name ="s3c64xx-i2s" , + .id =0 , + .probe = s3c64xx_i2s_probe, + .playback = { + .channels_min =2 , + .channels_max =2 , + .rates =S3C64XX_I2S_RATES , + .formats =S3C64XX_I2S_FMTS , + }, + .capture = { + .channels_min =2 , + .channels_max =2 , + .rates =S3C64XX_I2S_RATES , + .formats =S3C64XX_I2S_FMTS , + }, + .ops = &s3c64xx_i2s_dai_ops, }, - .capture = { - .channels_min =2 , - .channels_max =2 , - .rates =S3C64XX_I2S_RATES , - .formats =S3C64XX_I2S_FMTS , + { + .name ="s3c64xx-i2s" , + .id =1 , + .probe = s3c64xx_i2s_probe, + .playback = { + .channels_min =2 , + .channels_max =2 , + .rates =S3C64XX_I2S_RATES , + .formats =S3C64XX_I2S_FMTS , + }, + .capture = { + .channels_min =2 , + .channels_max =2 , + .rates =S3C64XX_I2S_RATES , + .formats =S3C64XX_I2S_FMTS , + }, + .ops = &s3c64xx_i2s_dai_ops, }, - .ops = &s3c64xx_i2s_dai_ops, };EXPORT_SYMBOL_GPL (s3c64xx_i2s_dai); +static __devinit int s3c64xx_iis_dev_probe (struct platform_device *pdev) +{ +struct s3c_i2sv2_info *i2s; +struct snd_soc_dai *dai; +int ret; + +if (pdev->id >=ARRAY_SIZE (s3c64xx_i2s)) { +dev_err (&pdev->dev,"id %d out of range\n" , pdev->id); +return -EINVAL ; + } + + i2s = &s3c64xx_i2s[pdev->id]; + dai = &s3c64xx_i2s_dai[pdev->id]; + dai->dev = &pdev->dev; + + i2s->dma_capture = &s3c64xx_i2s_pcm_stereo_in[pdev->id]; + i2s->dma_playback = &s3c64xx_i2s_pcm_stereo_out[pdev->id]; + + i2s->iis_cclk =clk_get (&pdev->dev,"audio-bus" ); +if (IS_ERR (i2s->iis_cclk)) { +dev_err (&pdev->dev,"failed to get audio-bus" ); + ret =PTR_ERR (i2s->iis_cclk); + goto err; + } + + ret =s3c_i2sv2_probe (pdev, dai, i2s, + dai->id ?S3C64XX_PA_IIS1 :S3C64XX_PA_IIS0 ); +if (ret) + goto err_clk; + + ret =snd_soc_register_dai (dai); +if (ret !=0 ) + goto err_i2sv2; + +return 0 ; + +err_i2sv2: +/* Not implemented for I2Sv2 core yet */ +err_clk: +clk_put (i2s->iis_cclk); +err: +return ret; +} + +static __devexit int s3c64xx_iis_dev_remove(struct platform_device *pdev) +{ +dev_err (&pdev->dev,"Device removal not yet supported\n" ); +return 0 ; +} + +static struct platform_driver s3c64xx_iis_driver = { + .probe = s3c64xx_iis_dev_probe, + .remove = s3c64xx_iis_dev_remove, + .driver = { + .name ="s3c64xx-iis" , + .owner =THIS_MODULE , + }, +}; +static int __init s3c64xx_i2s_init (void ) { -return s3c_i2sv2_register_dai (&s3c64xx_i2s_dai); +return platform_driver_register (&s3c64xx_iis_driver); }module_init (s3c64xx_i2s_init); static void __exit s3c64xx_i2s_exit(void) { -snd_soc_unregister_dai (&s3c64xx_i2s_dai); +platform_driver_unregister (&s3c64xx_iis_driver); }module_exit (s3c64xx_i2s_exit);
@@ -217,6 +268,3 @@ module_exit(s3c64xx_i2s_exit);MODULE_AUTHOR ("Ben Dooks, <[email protected]>" );MODULE_DESCRIPTION ("S3C64XX I2S SoC Interface" );MODULE_LICENSE ("GPL" ); - - -
sound/soc/s3c24xx/s3c64xx-i2s.h +1 -1
@@ -24,7 +24,7 @@#define S3C64XX_CLKSRC_PCLK (0)#define S3C64XX_CLKSRC_MUX (1) -extern struct snd_soc_dai s3c64xx_i2s_dai; +extern struct snd_soc_dai s3c64xx_i2s_dai[];extern unsigned long s3c64xx_i2s_get_clockrate (struct snd_soc_dai *cpu_dai);
Signature · 1 line
1.6.2.4
PATCH 4/17 ASoC: S3C2412: Failing to get the I2S clock is an error
In reply to Mark Brown--- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/s3c24xx/s3c2412-i2s.c +1 -1
@@ -120,7 +120,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev, s3c2412_i2s.iis_cclk =clk_get (&pdev->dev,"i2sclk" );if (s3c2412_i2s.iis_cclk ==NULL ) { -pr_debug ("failed to get i2sclk clock\n" ); +pr_err ("failed to get i2sclk clock\n" );iounmap (s3c2412_i2s.regs);return -ENODEV ; }
Signature · 1 line
1.6.2.4
PATCH 5/17 ASoC: Enforce symmetric rates for S3C64xx I2S interface
In reply to Mark BrownThere is only one LRCLK pin on each interface.
--- sound/soc/s3c24xx/s3c64xx-i2s.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/s3c24xx/s3c64xx-i2s.c +2 -0
@@ -171,6 +171,7 @@ struct snd_soc_dai s3c64xx_i2s_dai[] = { .formats = S3C64XX_I2S_FMTS, }, .ops = &s3c64xx_i2s_dai_ops, + .symmetric_rates = 1, }, { .name = "s3c64xx-i2s",
@@ -189,6 +190,7 @@ struct snd_soc_dai s3c64xx_i2s_dai[] = { .formats = S3C64XX_I2S_FMTS, }, .ops = &s3c64xx_i2s_dai_ops, + .symmetric_rates = 1, }, };EXPORT_SYMBOL_GPL (s3c64xx_i2s_dai);
Signature · 1 line
1.6.2.4
PATCH 6/17 ASoC: Include WM8350 register definitions in CODEC header
In reply to Mark BrownIt's expected behaviour for the CODEC header to provide them but the WM8350 doesn't due to having all the registers together under drivers/mfd.
--- sound/soc/codecs/wm8350.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/codecs/wm8350.h +1 -0
@@ -13,6 +13,7 @@#define _WM8350_H#include <sound/soc.h> +#include <linux/mfd/wm8350/audio.h> extern struct snd_soc_dai wm8350_dai;extern struct snd_soc_codec_device soc_codec_dev_wm8350;
Signature · 1 line
1.6.2.4
PATCH 7/17 ASoC: s3c-i2s-v2 diagnostic improvements
In reply to Mark BrownSay what invalid values we're seeing when we see an invalid value and ensure that errors are displayed by default.
--- sound/soc/s3c24xx/s3c-i2s-v2.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-)
sound/soc/s3c24xx/s3c-i2s-v2.c +12 -6
@@ -105,7 +105,9 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"TXEN: Invalid MODE in IISMOD\n" ); +dev_err (i2s->dev,"TXEN: Invalid MODE %x in IISMOD\n" , + mod &S3C2412_IISMOD_MODE_MASK ); +break ; }writel (con, regs +S3C2412_IISCON );
@@ -132,7 +134,9 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"TXDIS: Invalid MODE in IISMOD\n" ); +dev_err (i2s->dev,"TXDIS: Invalid MODE %xin IISMOD\n" , + mod &S3C2412_IISMOD_MODE_MASK ); +break ; }writel (mod, regs +S3C2412_IISMOD );
@@ -175,7 +179,8 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"RXEN: Invalid MODE in IISMOD\n" ); +dev_err (i2s->dev,"RXEN: Invalid MODE %x in IISMOD\n" , + mod &S3C2412_IISMOD_MODE_MASK ); }writel (mod, regs +S3C2412_IISMOD );
@@ -199,7 +204,8 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"RXEN: Invalid MODE in IISMOD\n" ); +dev_err (i2s->dev,"RXEN: Invalid MODE %x in IISMOD\n" , + mod &S3C2412_IISMOD_MODE_MASK ); }writel (con, regs +S3C2412_IISCON );
@@ -281,7 +287,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai, iismod |=IISMOD_MASTER ;break ;default : -pr_debug ("unknwon master/slave format\n" ); +pr_err ("unknwon master/slave format\n" );return -EINVAL ; }
@@ -298,7 +304,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai, iismod |=S3C2412_IISMOD_SDF_IIS ;break ;default : -pr_debug ("Unknown data format\n" ); +pr_err ("Unknown data format\n" );return -EINVAL ; }
Signature · 1 line
1.6.2.4
PATCH 8/17 ASoC: Use our registration function for S3C64xx
In reply to Mark BrownMake sure we get the DAI operations initialised.
--- sound/soc/s3c24xx/s3c-i2s-v2.c | 18 ++++++------------ sound/soc/s3c24xx/s3c64xx-i2s.c | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-)
sound/soc/s3c24xx/s3c-i2s-v2.c +6 -12
@@ -105,9 +105,7 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"TXEN: Invalid MODE %x in IISMOD\n" , - mod &S3C2412_IISMOD_MODE_MASK ); -break ; +dev_err (i2s->dev,"TXEN: Invalid MODE in IISMOD\n" ); }writel (con, regs +S3C2412_IISCON );
@@ -134,9 +132,7 @@ void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"TXDIS: Invalid MODE %xin IISMOD\n" , - mod &S3C2412_IISMOD_MODE_MASK ); -break ; +dev_err (i2s->dev,"TXDIS: Invalid MODE in IISMOD\n" ); }writel (mod, regs +S3C2412_IISMOD );
@@ -179,8 +175,7 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"RXEN: Invalid MODE %x in IISMOD\n" , - mod &S3C2412_IISMOD_MODE_MASK ); +dev_err (i2s->dev,"RXEN: Invalid MODE in IISMOD\n" ); }writel (mod, regs +S3C2412_IISMOD );
@@ -204,8 +199,7 @@ void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on)break ;default : -dev_err (i2s->dev,"RXEN: Invalid MODE %x in IISMOD\n" , - mod &S3C2412_IISMOD_MODE_MASK ); +dev_err (i2s->dev,"RXEN: Invalid MODE in IISMOD\n" ); }writel (con, regs +S3C2412_IISCON );
@@ -287,7 +281,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai, iismod |=IISMOD_MASTER ;break ;default : -pr_err ("unknwon master/slave format\n" ); +pr_debug ("unknwon master/slave format\n" );return -EINVAL ; }
@@ -304,7 +298,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai, iismod |=S3C2412_IISMOD_SDF_IIS ;break ;default : -pr_err ("Unknown data format\n" ); +pr_debug ("Unknown data format\n" );return -EINVAL ; }
sound/soc/s3c24xx/s3c64xx-i2s.c +1 -1
@@ -225,7 +225,7 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)if (ret) goto err_clk; - ret =snd_soc_register_dai (dai); + ret =s3c_i2sv2_register_dai (dai);if (ret !=0 ) goto err_i2sv2;
Signature · 1 line
1.6.2.4
PATCH 9/17 ASoC WM8940 Driver
In reply to Mark BrownFrom: Jonathan Cameron <[email protected]>
--- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8940.c | 955 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8940.h | 104 +++++ 4 files changed, 1065 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/wm8940.c create mode 100644 sound/soc/codecs/wm8940.h
sound/soc/codecs/Kconfig +4 -0
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8753 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8900 if I2C select SND_SOC_WM8903 if I2C + select SND_SOC_WM8940 if I2C select SND_SOC_WM8960 if I2C select SND_SOC_WM8971 if I2C select SND_SOC_WM8988 if SND_SOC_I2C_AND_SPI
@@ -140,6 +141,9 @@ config SND_SOC_WM8900 config SND_SOC_WM8903 tristate +config SND_SOC_WM8940 + tristate + config SND_SOC_WM8960 tristate
sound/soc/codecs/Makefile +2 -0
@@ -23,6 +23,7 @@ snd-soc-wm8750-objs := wm8750.o snd-soc-wm8753-objs := wm8753.o snd-soc-wm8900-objs := wm8900.o snd-soc-wm8903-objs := wm8903.o +snd-soc-wm8940-objs := wm8940.o snd-soc-wm8960-objs := wm8960.o snd-soc-wm8971-objs := wm8971.o snd-soc-wm8988-objs := wm8988.o
@@ -57,6 +58,7 @@ obj-$(CONFIG_SND_SOC_WM8753) += snd-soc-wm8753.o obj-$(CONFIG_SND_SOC_WM8900) += snd-soc-wm8900.o obj-$(CONFIG_SND_SOC_WM8903) += snd-soc-wm8903.o obj-$(CONFIG_SND_SOC_WM8971) += snd-soc-wm8971.o +obj-$(CONFIG_SND_SOC_WM8940) += snd-soc-wm8940.o obj-$(CONFIG_SND_SOC_WM8960) += snd-soc-wm8960.o obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o
sound/soc/codecs/wm8940.c new file +955 -0
955 lines not on this page · raw message
sound/soc/codecs/wm8940.h new file +104 -0
104 lines not on this page · raw message
Signature · 1 line
1.6.2.4
PATCH 10/17 ASoC: cs4270: fix Master Capture Switch polarity
In reply to Mark BrownFrom: Daniel Mack <[email protected]>
The control modifies the MUTE register, hence the polarity must be inverted.
--- sound/soc/codecs/cs4270.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/cs4270.c +1 -1
@@ -486,7 +486,7 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = {SOC_SINGLE ("Zero Cross Switch" ,CS4270_TRANS ,5 ,1 ,0 ),SOC_SINGLE ("Popguard Switch" ,CS4270_MODE ,0 ,1 ,1 ),SOC_SINGLE ("Auto-Mute Switch" ,CS4270_MUTE ,5 ,1 ,0 ), - SOC_DOUBLE("Master Capture Switch", CS4270_MUTE, 3, 4, 1, 0) + SOC_DOUBLE("Master Capture Switch", CS4270_MUTE, 3, 4, 1, 1) };/*
Signature · 1 line
1.6.2.4
PATCH 11/17 ASoC: cs4270: add Master Playback Switch
In reply to Mark BrownFrom: Daniel Mack <[email protected]>
This adds a new control named 'Master Playback Switch' for cs4270 codecs. It is implemented using the new SOC_DOUBLE_EXT macro to catch the put function and store the information about manually set mute controls from userspace. When a manual mute is set, we don't want the soc core to un-mute the outputs.
Renamed cs4270_mute() to cs4270_dai_mute() to avoid confusion.
--- sound/soc/codecs/cs4270.c | 44 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 39 insertions(+), 5 deletions(-)
sound/soc/codecs/cs4270.c +39 -5
@@ -109,6 +109,7 @@ struct cs4270_private {unsigned int mclk;/* Input frequency of the MCLK pin */ unsigned int mode;/* The mode (I2S or left-justified) */ unsigned int slave_mode; +unsigned int manual_mute; };/**
@@ -453,7 +454,7 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream, }/** -* cs4270_mute - enable/disable the CS4270 external mute +* cs4270_dai_mute - enable/disable the CS4270 external mute * @dai: the SOC DAI * @mute: 0 = disable mute, 1 = enable mute *
@@ -462,21 +463,52 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,* board does not have the MUTEA or MUTEB pins connected to such circuitry, * then this function will do nothing. */ -static int cs4270_mute (struct snd_soc_dai *dai,int mute) +static int cs4270_dai_mute (struct snd_soc_dai *dai,int mute) {struct snd_soc_codec *codec = dai->codec; +struct cs4270_private *cs4270 = codec->private_data;int reg6; reg6 =snd_soc_read (codec,CS4270_MUTE );if (mute) reg6 |=CS4270_MUTE_DAC_A |CS4270_MUTE_DAC_B ; -else +else { reg6 &= ~(CS4270_MUTE_DAC_A |CS4270_MUTE_DAC_B ); + reg6 |= cs4270->manual_mute; + }return snd_soc_write (codec,CS4270_MUTE , reg6); } +/** +* cs4270_soc_put_mute - put callback for the 'Master Playback switch' +* alsa control. +* @kcontrol: mixer control +* @ucontrol: control element information +* +* This function basically passes the arguments on to the generic +* snd_soc_put_volsw() function and saves the mute information in +* our private data structure. This is because we want to prevent +* cs4270_dai_mute() neglecting the user's decision to manually +* mute the codec's output. +* +* Returns 0 for success. +*/ +static int cs4270_soc_put_mute (struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_value *ucontrol) +{ +struct snd_soc_codec *codec =snd_kcontrol_chip (kcontrol); +struct cs4270_private *cs4270 = codec->private_data; +int left = !ucontrol->value.integer.value[0 ]; +int right = !ucontrol->value.integer.value[1 ]; + + cs4270->manual_mute = (left ?CS4270_MUTE_DAC_A :0 ) | + (right ?CS4270_MUTE_DAC_B :0 ); + +return snd_soc_put_volsw (kcontrol, ucontrol); +} +/* A list of non-DAPM controls that the CS4270 supports */ static const struct snd_kcontrol_new cs4270_snd_controls[] = { SOC_DOUBLE_R("Master Playback Volume",
@@ -486,7 +518,9 @@ static const struct snd_kcontrol_new cs4270_snd_controls[] = {SOC_SINGLE ("Zero Cross Switch" ,CS4270_TRANS ,5 ,1 ,0 ),SOC_SINGLE ("Popguard Switch" ,CS4270_MODE ,0 ,1 ,1 ),SOC_SINGLE ("Auto-Mute Switch" ,CS4270_MUTE ,5 ,1 ,0 ), - SOC_DOUBLE("Master Capture Switch", CS4270_MUTE, 3, 4, 1, 1) +SOC_DOUBLE ("Master Capture Switch" ,CS4270_MUTE ,3 ,4 ,1 ,1 ), +SOC_DOUBLE_EXT ("Master Playback Switch" ,CS4270_MUTE ,0 ,1 ,1 ,1 , + snd_soc_get_volsw, cs4270_soc_put_mute), };/*
@@ -506,7 +540,7 @@ static struct snd_soc_dai_ops cs4270_dai_ops = { .hw_params = cs4270_hw_params, .set_sysclk = cs4270_set_dai_sysclk, .set_fmt = cs4270_set_dai_fmt, - .digital_mute = cs4270_mute, + .digital_mute = cs4270_dai_mute, };struct snd_soc_dai cs4270_dai = {
Signature · 1 line
1.6.2.4
PATCH 12/17 ASoC: Fix logic in WM8350 master clocking check
In reply to Mark BrownWe need to check only if the WM8350 is master and only when starting the stream so if either is not true then we can skip the check.
--- sound/soc/codecs/wm8350.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8350.c +1 -1
@@ -968,7 +968,7 @@ static int wm8350_pcm_trigger(struct snd_pcm_substream *substream,* required for LRC in master mode. The DACs or ADCs need a * valid audio path i.e. pin -> ADC or DAC -> pin before * the LRC will be enabled in master mode. */ -if (!master && cmd !=SNDRV_PCM_TRIGGER_START ) +if (!master || cmd !=SNDRV_PCM_TRIGGER_START )return 0 ;if (substream->stream ==SNDRV_PCM_STREAM_CAPTURE ) {
Signature · 1 line
1.6.2.4
PATCH 13/17 ASoC: Set the MPC5200 i2s driver to BROKEN status.
In reply to Mark BrownFrom: Jon Smirl <[email protected]>
--- sound/soc/fsl/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/fsl/Kconfig +1 -1
@@ -21,7 +21,7 @@ config SND_SOC_MPC8610_HPCD config SND_SOC_MPC5200_I2S tristate "Freescale MPC5200 PSC in I2S mode driver" - depends on PPC_MPC52xx && PPC_BESTCOMM + depends on PPC_MPC52xx && PPC_BESTCOMM && BROKEN select SND_SOC_OF_SIMPLE select PPC_BESTCOMM_GEN_BD help
Signature · 1 line
1.6.2.4
PATCH 14/17 ASoC: Staticise TLV values in WM8940
In reply to Mark Brown--- sound/soc/codecs/wm8940.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-)
sound/soc/codecs/wm8940.c +11 -11
@@ -168,16 +168,16 @@ static const char *wm8940_filter_mode_text[] = {"Audio", "Application"};static const struct soc_enum wm8940_filter_mode_enum =SOC_ENUM_SINGLE (WM8940_ADC ,7 ,2 , wm8940_filter_mode_text); -DECLARE_TLV_DB_SCALE (wm8940_spk_vol_tlv,-5700 ,100 ,1 ); -DECLARE_TLV_DB_SCALE (wm8940_att_tlv,-1000 ,1000 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_pga_vol_tlv,-1200 ,75 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_alc_min_tlv,-1200 ,600 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_alc_max_tlv,675 ,600 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_alc_tar_tlv,-2250 ,50 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_lim_boost_tlv,0 ,100 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_lim_thresh_tlv,-600 ,100 ,0 ); -DECLARE_TLV_DB_SCALE (wm8940_adc_tlv,-12750 ,50 ,1 ); -DECLARE_TLV_DB_SCALE (wm8940_capture_boost_vol_tlv,0 ,2000 ,0 ); +static DECLARE_TLV_DB_SCALE(wm8940_spk_vol_tlv, -5700, 100, 1); +static DECLARE_TLV_DB_SCALE(wm8940_att_tlv, -1000, 1000, 0); +static DECLARE_TLV_DB_SCALE(wm8940_pga_vol_tlv, -1200, 75, 0); +static DECLARE_TLV_DB_SCALE(wm8940_alc_min_tlv, -1200, 600, 0); +static DECLARE_TLV_DB_SCALE(wm8940_alc_max_tlv, 675, 600, 0); +static DECLARE_TLV_DB_SCALE(wm8940_alc_tar_tlv, -2250, 50, 0); +static DECLARE_TLV_DB_SCALE(wm8940_lim_boost_tlv, 0, 100, 0); +static DECLARE_TLV_DB_SCALE(wm8940_lim_thresh_tlv, -600, 100, 0); +static DECLARE_TLV_DB_SCALE(wm8940_adc_tlv, -12750, 50, 1); +static DECLARE_TLV_DB_SCALE(wm8940_capture_boost_vol_tlv, 0, 2000, 0);static const struct snd_kcontrol_new wm8940_snd_controls[] = { SOC_SINGLE("Digital Loopback Switch", WM8940_COMPANDINGCTL,
@@ -253,7 +253,7 @@ static const struct snd_kcontrol_new wm8940_mono_mixer_controls[] = { SOC_DAPM_SINGLE("PCM Playback Switch", WM8940_MONOMIX, 0, 1, 0), }; -DECLARE_TLV_DB_SCALE (wm8940_boost_vol_tlv,-1500 ,300 ,1 ); +static DECLARE_TLV_DB_SCALE(wm8940_boost_vol_tlv, -1500, 300, 1);static const struct snd_kcontrol_new wm8940_input_boost_controls[] = {SOC_DAPM_SINGLE ("Mic PGA Switch" ,WM8940_PGAGAIN ,6 ,1 ,1 ), SOC_DAPM_SINGLE_TLV("Aux Volume", WM8940_ADCBOOST,
Signature · 1 line
1.6.2.4
PATCH 15/17 ASoC: TWL4030: Fix gain control for earpiece amplifier
In reply to Mark BrownFrom: Joonyoung Shim <[email protected]>
The gain control for earpiece amplifier uses 0dB ~ 12dB according to the TRM, but the present code is implemented to -6dB ~ 6dB.
--- sound/soc/codecs/twl4030.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
sound/soc/codecs/twl4030.c +7 -1
@@ -836,6 +836,12 @@ static DECLARE_TLV_DB_SCALE(analog_tlv, -2400, 200, 0); static DECLARE_TLV_DB_SCALE(output_tvl, -1200, 600, 1);/* +* Gain control for earpiece amplifier +* 0 dB to 12 dB in 6 dB steps (mute instead of -6) +*/ +static DECLARE_TLV_DB_SCALE(output_ear_tvl, -600, 600, 1); + +/* * Capture gain after the ADCs * from 0 dB to 31 dB in 1 dB steps */
@@ -900,7 +906,7 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = { 4, 3, 0, output_tvl),SOC_SINGLE_TLV_TWL4030 ("Earpiece Playback Volume" , -TWL4030_REG_EAR_CTL ,4 ,3 ,0 , output_tvl), +TWL4030_REG_EAR_CTL ,4 ,3 ,0 , output_ear_tvl),/* Common capture gain controls */ SOC_DOUBLE_R_TLV("TX1 Digital Capture Volume",
Signature · 1 line
1.6.2.4
PATCH 16/17 ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Mark BrownFrom: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
--- sound/soc/fsl/Kconfig | 4 + sound/soc/fsl/Makefile | 2 + sound/soc/fsl/mpc5200_dma.c | 457 ++++++++++++++++++++++++++++++++++++ sound/soc/fsl/mpc5200_dma.h | 81 +++++++ sound/soc/fsl/mpc5200_psc_i2s.c | 484 +-------------------------------------- 5 files changed, 546 insertions(+), 482 deletions(-) create mode 100644 sound/soc/fsl/mpc5200_dma.c create mode 100644 sound/soc/fsl/mpc5200_dma.h
sound/soc/fsl/Kconfig +4 -0
@@ -1,6 +1,9 @@ config SND_SOC_OF_SIMPLE tristate +config SND_MPC52xx_DMA + tristate + # ASoC platform support for the Freescale MPC8610 SOC. This compiles drivers # for the SSI and the Elo DMA controller. You will still need to select # a platform driver and a codec driver.
@@ -23,6 +26,7 @@ config SND_SOC_MPC5200_I2S tristate "Freescale MPC5200 PSC in I2S mode driver" depends on PPC_MPC52xx && PPC_BESTCOMM && BROKEN select SND_SOC_OF_SIMPLE + select SND_MPC52xx_DMA select PPC_BESTCOMM_GEN_BD help Say Y here to support the MPC5200 PSCs in I2S mode.
sound/soc/fsl/Makefile +2 -0
@@ -10,5 +10,7 @@ snd-soc-fsl-ssi-objs := fsl_ssi.o snd-soc-fsl-dma-objs := fsl_dma.o obj-$(CONFIG_SND_SOC_MPC8610) += snd-soc-fsl-ssi.o snd-soc-fsl-dma.o +# MPC5200 Platform Support +obj-$(CONFIG_SND_MPC52xx_DMA) += mpc5200_dma.o obj-$(CONFIG_SND_SOC_MPC5200_I2S) += mpc5200_psc_i2s.o
sound/soc/fsl/mpc5200_dma.c new file +457 -0
457 lines not on this page · raw message
sound/soc/fsl/mpc5200_dma.h new file +81 -0
81 lines not on this page · raw message
sound/soc/fsl/mpc5200_psc_i2s.c +2 -482
508 lines not on this page · raw message
Signature · 1 line
1.6.2.4
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>
This patch conflicts with the last patch I merged to add SNDRV_PCM_INFO_BATCH to some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch
yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
Note that the info flag should contain SNDRV_PCM_INFO_BATCH unless the driver provides the precise position reporting in the pointer callback. The flag can be removed once after you implement that feature, of course.
thanks,
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in. Takashi is going to change the base mpc5200_i2c file and I am going to have to manually fix up up my 14 patches layered on top. Git handles file renames fine, but it doesn't handle the case of splitting a file very well. Once the patches that split the file are in the tree Git handles things ok.
Quoted 11 lines
Note that the info flag should contain
SNDRV_PCM_INFO_BATCHunless the driver provides the precise position reporting in the pointer callback. The flag can be removed once after you implement that feature, of course.thanks,
Takashi
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
At Tue, 28 Apr 2009 11:59:01 -0400,
Quoted 23 lines · Jon Smirl
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
Quoted 5 lines
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in.
And this is why I am against pulling now :)
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 25 lines · Takashi Iwai
At Tue, 28 Apr 2009 11:59:01 -0400,
Quoted 23 lines · Jon Smirl
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in.
And this is why I am against pulling now :)
I wanted the split files added to 2.6.30 not 2.6.31. If they had gone into 2.6.30 you would have patched after the split and everything would have propagated without merge conflicts. In general, changes in git that cross a file split will cause manual manual merges in everything pending past the split.
Quoted 4 lines
Takashi
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 32 lines · Jon Smirl
Quoted 31 lines · Takashi Iwai
At Tue, 28 Apr 2009 11:59:01 -0400,
Quoted 28 lines · Jon Smirl
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in.
Quoted 7 lines
Quoted 1 line
And this is why I am against pulling now :)
I wanted the split files added to 2.6.30 not 2.6.31. If they had gone into 2.6.30 you would have patched after the split and everything would have propagated without merge conflicts. In general, changes in git that cross a file split will cause manual manual merges in everything pending past the split.
BTW, pulling the split patches out of 2.6.31 is just going to move the merge mess onto my local patch stack. To eliminate the merge mess we need to get the split in and then start patching after the split.
Quoted 12 lines
Quoted 5 lines
Takashi
--
Jon Smirl
[email protected]
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
At Tue, 28 Apr 2009 13:14:09 -0400,
Quoted 42 lines · Jon Smirl
Quoted 32 lines · Jon Smirl
Quoted 31 lines · Takashi Iwai
At Tue, 28 Apr 2009 11:59:01 -0400,
Quoted 28 lines · Jon Smirl
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in.
Quoted 7 lines
Quoted 1 line
And this is why I am against pulling now :)
I wanted the split files added to 2.6.30 not 2.6.31. If they had gone into 2.6.30 you would have patched after the split and everything would have propagated without merge conflicts. In general, changes in git that cross a file split will cause manual manual merges in everything pending past the split.
Quoted 3 lines
BTW, pulling the split patches out of 2.6.31 is just going to move the merge mess onto my local patch stack. To eliminate the merge mess we need to get the split in and then start patching after the split.
I agree with that.
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 3 lines · Takashi Iwai
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
AFAICT all the currently posted patches are needed since they're only doing the refactoring of the code required to support AC97. They're only related to the fixes in that John's board doesn't have I2S but since the DMA is shared the fixes that John develops while making AC97 work will also fix I2S.
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 11 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
AFAICT all the currently posted patches are needed since they're only doing the refactoring of the code required to support AC97. They're only related to the fixes in that John's board doesn't have I2S but since the DMA is shared the fixes that John develops while making AC97 work will also fix I2S.
I purposely sent in refactoring changes that made no functional changes to the code.
I have been caught in this mess before. This isn't a simple case of resolving conflicts. What happens is that git isn't smart enough to track changes across a refactor. That results in big conflicts covering most of the contents of the files involved. The conflicts in the refactor then cascade into all of the other patches.
If we put the refactor in front of the fixes git will get everything right.
Why are people going to complain about patches to a driver marked broken? You can't even compile it without editing the Kconfig.
Quoted 1 line
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 13 lines · Jon Smirl
Quoted 11 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
AFAICT all the currently posted patches are needed since they're only doing the refactoring of the code required to support AC97. They're only related to the fixes in that John's board doesn't have I2S but since the DMA is shared the fixes that John develops while making AC97 work will also fix I2S.
Quoted 7 lines
I purposely sent in refactoring changes that made no functional changes to the code.
I have been caught in this mess before. This isn't a simple case of resolving conflicts. What happens is that git isn't smart enough to track changes across a refactor. That results in big conflicts covering most of the contents of the files involved. The conflicts in
Thinking about this for a couple minutes, what happens is the three way merge becomes a four or more way merge depending on how many new files were created in the the refactor. Git doesn't have an n-way merge tool so it just kicks the entire files out as conflicts.
Quoted 16 lines
the refactor then cascade into all of the other patches.
If we put the refactor in front of the fixes git will get everything right.
Why are people going to complain about patches to a driver marked broken? You can't even compile it without editing the
Kconfig.Quoted 1 line
--
Jon Smirl
[email protected]
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Jon SmirlQuoted 2 lines · Jon Smirl
Why are people going to complain about patches to a driver marked broken? You can't even compile it without editing the
Kconfig.
There is no problem with doing whatever to the driver for 2.6.31 but we do need to make sure we stay in sync with the other API work that's going on in 2.6.31.
For 2.6.30 we're outside the merge window so we need to send targetted fixes for bugs - if we sent your current patches upstream now the pushback would be that such large refactorings should be merged as part of the merge window and the bug fixes should be extracted from your refactoring and merged now. This is the kernel wide development policy, not an ALSA or ASoC specific one.
Ideally we wouldn't have to mark the driver broken but would instead be merging bug fixes to it into 2.6.30 - marking it as broken was an alternative to that.
For the merges the simplest thing would be to fix the current code before doing the refactoring, though from the sounds of it the final fixes required for 2.6.30 will be very small in the driver so I'd expect this can be resolved fairly simply. Changes made in the 2.6.30 branch get merged into the 2.6.31 branch very quickly so any divergence between the two branches shouldn't exist for long.
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Jon SmirlAt Tue, 28 Apr 2009 15:59:52 -0400,
Quoted 14 lines · Jon Smirl
Quoted 11 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
AFAICT all the currently posted patches are needed since they're only doing the refactoring of the code required to support AC97. They're only related to the fixes in that John's board doesn't have I2S but since the DMA is shared the fixes that John develops while making AC97 work will also fix I2S.
Quoted 5 lines
I purposely sent in refactoring changes that made no functional changes to the code.
I have been caught in this mess before. This isn't a simple case of resolving conflicts.
Why do you believe that this case will be like that, too?
Quoted 6 lines
What happens is that git isn't smart enough to
track changes across a refactor. That results in big conflicts covering most of the contents of the files involved. The conflicts in the refactor then cascade into all of the other patches.If we put the refactor in front of the fixes git will get everything right.
Well, you can do it by yourself on your local tree, too. topgit or other tools can serve well for such use cases.
Then either let Mark or me pull your tree, or straighten the patches to submit.
Quoted 2 lines
Why are people going to complain about patches to a driver marked broken? You can't even compile it without editing the
Kconfig.
Because we broke it.
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Mark BrownAt Tue, 28 Apr 2009 20:53:53 +0100,
Quoted 7 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
Also, we need to reconsider which of you change is really needed since the current problem of the PCM will be solved in the PCM core side soon later without the change of the driver side.
Quoted 5 lines
AFAICT all the currently posted patches are needed since they're only doing the refactoring of the code required to support AC97. They're only related to the fixes in that John's board doesn't have I2S but since the DMA is shared the fixes that John develops while making AC97 work will also fix I2S.
OK. I thought that he rewrote the pointer callback to return jiffies-based values and it could be superfluous. Other than that, it should be all fine.
Basically I don't mind to merge Jon's patch series now for 2.6.31 once after the current merge conflicts are resolved.
There won't be many changes on 2.6.30 for that driver any more. At most, a patch will be just to remove BROKEN from kconfig again (hopefully in time).
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Jon SmirlAt Tue, 28 Apr 2009 12:55:16 -0400,
Quoted 33 lines · Jon Smirl
Quoted 31 lines · Takashi Iwai
At Tue, 28 Apr 2009 11:59:01 -0400,
Quoted 28 lines · Jon Smirl
Quoted 21 lines · Takashi Iwai
At Tue, 28 Apr 2009 16:23:41 +0100,
Quoted 10 lines · Mark Brown
From: Jon Smirl <[email protected]>
Basic split of mpc5200 DMA code out from i2s into a standalone file.
[Fixed trailing whitespace -- broonie.]
Signed-off-by Jon Smirl <[email protected]>Acked-by Grant Likely <[email protected]>Signed-off-by Mark Brown <[email protected]>This patch conflicts with the last patch I merged to add
SNDRV_PCM_INFO_BATCHto some drivers including mpc5200. (It's in fix/pcm-info-batch branch and not merged to */asoc branch yet. Feel free to pull to your tree by yourself.)
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
This is why I was pushing so hard to get the patches that split the files in.
Quoted 7 lines
Quoted 1 line
And this is why I am against pulling now :)
I wanted the split files added to 2.6.30 not 2.6.31. If they had gone into 2.6.30 you would have patched after the split and everything would have propagated without merge conflicts. In general, changes in git that cross a file split will cause manual manual merges in everything pending past the split.
Not really so. The changes done in parallel repositories may conflict always. For example, this case would cause the conflict. The difference is only who resolves the conflict...
In addition, this split is certainly not appropriate for 2.6.30 since it itself has nothing to do with the fix.
Takashi
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Jon SmirlQuoted 5 lines · Jon Smirl
I wanted the split files added to 2.6.30 not 2.6.31. If they had gone into 2.6.30 you would have patched after the split and everything would have propagated without merge conflicts. In general, changes in git that cross a file split will cause manual manual merges in everything pending past the split.
It wouldn't have helped with the merge issues since bug fixes get merged up into the 2.6.31 branch very fast. In any case, we're in the -rc part of the development cycle - we should be merging targetted bug fixes only. Eyebrows would be raised by a diff of that size going in.
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Takashi IwaiQuoted 3 lines · Takashi Iwai
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
The refactoring is a largely orthogonal issue to the jiffies check - the refactoring is needed to split the DMA code out so that it can be shared with the AC97 driver John is writing.
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
Done:
The following changes since commit 8a1f936acdfd53cb0a981f3f80483863dcd84fa9:
Peter Ujfalusi (1):
ASoC: TWL4030: Add 4 channel TDM support
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.31
Daniel Mack (3):
ASoC: add SOC_DOUBLE_EXT macro
ASoC: cs4270: fix Master Capture Switch polarity
ASoC: cs4270: add Master Playback Switch
Jon Smirl (1):
ASoC: Set the MPC5200 i2s driver to BROKEN status.
Jonathan Cameron (1):
ASoC WM8940 Driver
Joonyoung Shim (1):
ASoC: TWL4030: Fix gain control for earpiece amplifier
Mark Brown (10):
ASoC: Fix S3C64xx IIS device registration and support both ports
ASoC: S3C2412: Failing to get the I2S clock is an error
ASoC: Enforce symmetric rates for S3C64xx I2S interface
ASoC: Include WM8350 register definitions in CODEC header
ASoC: s3c-i2s-v2 diagnostic improvements
ASoC: Use our registration function for S3C64xx
ASoC: Fix logic in WM8350 master clocking check
Merge branch 'for-2.6.30' into for-2.6.31
ASoC: Staticise TLV values in WM8940
Merge branch 'for-2.6.30' into for-2.6.31
Peter Ujfalusi (1):
ASoC: Beagle: Add support for 4 channel
include/sound/soc.h | 8 + sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs4270.c | 44 ++- sound/soc/codecs/twl4030.c | 8 +- sound/soc/codecs/wm8350.c | 2 +- sound/soc/codecs/wm8350.h | 1 + sound/soc/codecs/wm8940.c | 955 +++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8940.h | 104 +++++ sound/soc/fsl/Kconfig | 2 +- sound/soc/omap/omap3beagle.c | 26 +- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- sound/soc/s3c24xx/s3c64xx-i2s.c | 148 ++++-- sound/soc/s3c24xx/s3c64xx-i2s.h | 2 +- 14 files changed, 1241 insertions(+), 67 deletions(-) create mode 100644 sound/soc/codecs/wm8940.c create mode 100644 sound/soc/codecs/wm8940.h
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 6 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
Quoted 8 lines
The refactoring is a largely orthogonal issue to the jiffies check - the refactoring is needed to split the DMA code out so that it can be shared with the AC97 driver John is writing.
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
Done:
Now I get to deal with the merge mess in my patch stack. All this did was move the problem.
Quoted 60 lines
The following changes since commit
8a1f936acdfd53cb0a981f3f80483863dcd84fa9:
Peter Ujfalusi (1):
ASoC: TWL4030: Add 4 channel TDM supportare available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.31
Daniel Mack (3):
ASoC: addSOC_DOUBLE_EXTmacro
ASoC: cs4270: fix Master Capture Switch polarity
ASoC: cs4270: add Master Playback SwitchJon Smirl (1):
ASoC: Set the MPC5200 i2s driver to BROKEN status.Jonathan Cameron (1):
ASoC WM8940 DriverJoonyoung Shim (1):
ASoC: TWL4030: Fix gain control for earpiece amplifierMark Brown (10):
ASoC: Fix S3C64xx IIS device registration and support both ports
ASoC: S3C2412: Failing to get the I2S clock is an error
ASoC: Enforce symmetric rates for S3C64xx I2S interface
ASoC: Include WM8350 register definitions in CODEC header
ASoC: s3c-i2s-v2 diagnostic improvements
ASoC: Use our registration function for S3C64xx
ASoC: Fix logic in WM8350 master clocking check
Merge branch 'for-2.6.30' into for-2.6.31
ASoC: Staticise TLV values in WM8940
Merge branch 'for-2.6.30' into for-2.6.31Peter Ujfalusi (1):
ASoC: Beagle: Add support for 4 channelinclude/sound/soc.h | 8 +
sound/soc/codecs/Kconfig | 4 +sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs4270.c | 44 ++- sound/soc/codecs/twl4030.c | 8 +- sound/soc/codecs/wm8350.c | 2 +- sound/soc/codecs/wm8350.h | 1 + sound/soc/codecs/wm8940.c | 955 +++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8940.h | 104 +++++ sound/soc/fsl/Kconfig | 2 +- sound/soc/omap/omap3beagle.c | 26 +- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- sound/soc/s3c24xx/s3c64xx-i2s.c | 148 ++++-- sound/soc/s3c24xx/s3c64xx-i2s.h | 2 +- 14 files changed, 1241 insertions(+), 67 deletions(-)create mode 100644
sound/soc/codecs/wm8940.c
create mode 100644sound/soc/codecs/wm8940.h
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
Quoted 2 lines · Jon Smirl
Now I get to deal with the merge mess in my patch stack. All this did was move the problem.
Please send patches against:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git mpc5200
Re: [PATCH 16/17] ASoC: Basic split of mpc5200 DMA code out from mpc5200_psc_i2s
In reply to Mark BrownAt Tue, 28 Apr 2009 20:25:45 +0100,
Quoted 7 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
And, the jiffies check shall be anyway fixed in the upstream PCM core side, thus there is no big merit to hurry to merge the unfinished changes now.
Quoted 8 lines
The refactoring is a largely orthogonal issue to the jiffies check - the refactoring is needed to split the DMA code out so that it can be shared with the AC97 driver John is writing.
Quoted 2 lines
So, could you back off mpc5200 changes and wait for a while until the issue regarding PCM jiffies-check is resolved?
Done:
Thanks, pulled now.
Takashi
Quoted 55 lines
The following changes since commit
8a1f936acdfd53cb0a981f3f80483863dcd84fa9:
Peter Ujfalusi (1):
ASoC: TWL4030: Add 4 channel TDM supportare available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.gitfor-2.6.31Daniel Mack (3):
ASoC: addSOC_DOUBLE_EXTmacro
ASoC: cs4270: fix Master Capture Switch polarity
ASoC: cs4270: add Master Playback SwitchJon Smirl (1):
ASoC: Set the MPC5200 i2s driver to BROKEN status.Jonathan Cameron (1):
ASoC WM8940 DriverJoonyoung Shim (1):
ASoC: TWL4030: Fix gain control for earpiece amplifierMark Brown (10):
ASoC: Fix S3C64xx IIS device registration and support both ports
ASoC: S3C2412: Failing to get the I2S clock is an error
ASoC: Enforce symmetric rates for S3C64xx I2S interface
ASoC: Include WM8350 register definitions in CODEC header
ASoC: s3c-i2s-v2 diagnostic improvements
ASoC: Use our registration function for S3C64xx
ASoC: Fix logic in WM8350 master clocking check
Merge branch 'for-2.6.30' into for-2.6.31
ASoC: Staticise TLV values in WM8940
Merge branch 'for-2.6.30' into for-2.6.31Peter Ujfalusi (1):
ASoC: Beagle: Add support for 4 channelinclude/sound/soc.h | 8 + sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/cs4270.c | 44 ++- sound/soc/codecs/twl4030.c | 8 +- sound/soc/codecs/wm8350.c | 2 +- sound/soc/codecs/wm8350.h | 1 + sound/soc/codecs/wm8940.c | 955 +++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8940.h | 104 +++++ sound/soc/fsl/Kconfig | 2 +- sound/soc/omap/omap3beagle.c | 26 +- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- sound/soc/s3c24xx/s3c64xx-i2s.c | 148 ++++-- sound/soc/s3c24xx/s3c64xx-i2s.h | 2 +- 14 files changed, 1241 insertions(+), 67 deletions(-) create mode 100644 sound/soc/codecs/wm8940.c create mode 100644 sound/soc/codecs/wm8940.h
PATCH 17/17 ASoC: Rename the PSC functions to DMA
In reply to Mark BrownFrom: Jon Smirl <[email protected]>
Rename the functions in the mpc5200 DMA file from i2s to dma to reflect the file they are in.
Grant Likely <[email protected]>
--- sound/soc/fsl/mpc5200_dma.c | 194 +++++++++++++++++++------------------- sound/soc/fsl/mpc5200_dma.h | 26 +++--- sound/soc/fsl/mpc5200_psc_i2s.c | 160 ++++++++++++++++---------------- 3 files changed, 190 insertions(+), 190 deletions(-)
sound/soc/fsl/mpc5200_dma.c +97 -97
@@ -34,21 +34,21 @@ MODULE_LICENSE("GPL");/* * Interrupt handlers */ -static irqreturn_t psc_i2s_status_irq (int irq,void *_psc_i2s) +static irqreturn_t psc_dma_status_irq (int irq,void *_psc_dma) { -struct psc_i2s *psc_i2s = _psc_i2s; -struct mpc52xx_psc __iomem *regs = psc_i2s->psc_regs; +struct psc_dma *psc_dma = _psc_dma; +struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;u16 isr; isr =in_be16 (®s->mpc52xx_psc_isr);/* Playback underrun error */ -if (psc_i2s->playback.active && (isr & MPC52xx_PSC_IMR_TXEMP)) - psc_i2s->stats.underrun_count++; +if (psc_dma->playback.active && (isr & MPC52xx_PSC_IMR_TXEMP)) + psc_dma->stats.underrun_count++;/* Capture overrun error */ -if (psc_i2s->capture.active && (isr & MPC52xx_PSC_IMR_ORERR)) - psc_i2s->stats.overrun_count++; +if (psc_dma->capture.active && (isr & MPC52xx_PSC_IMR_ORERR)) + psc_dma->stats.overrun_count++;out_8 (®s->command,4 <<4 );/* reset the error status */
@@ -56,7 +56,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) }/** -* psc_i2s_bcom_enqueue_next_buffer - Enqueue another audio buffer +* psc_dma_bcom_enqueue_next_buffer - Enqueue another audio buffer * @s: pointer to stream private data structure * * Enqueues another audio period buffer into the bestcomm queue.
@@ -65,7 +65,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s)* the queue. Otherwise the enqueue will fail and the audio ring buffer * will get out of sync */ -static void psc_i2s_bcom_enqueue_next_buffer (struct psc_i2s_stream *s) +static void psc_dma_bcom_enqueue_next_buffer (struct psc_dma_stream *s) {struct bcom_bd *bd;
@@ -82,9 +82,9 @@ static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) }/* Bestcomm DMA irq handler */ -static irqreturn_t psc_i2s_bcom_irq (int irq,void *_psc_i2s_stream) +static irqreturn_t psc_dma_bcom_irq (int irq,void *_psc_dma_stream) { -struct psc_i2s_stream *s = _psc_i2s_stream; +struct psc_dma_stream *s = _psc_dma_stream;/* For each finished period, dequeue the completed period buffer * and enqueue a new one in it's place. */
@@ -93,7 +93,7 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) s->period_current_pt += s->period_bytes;if (s->period_current_pt >= s->period_end) s->period_current_pt = s->period_start; -psc_i2s_bcom_enqueue_next_buffer (s); +psc_dma_bcom_enqueue_next_buffer (s);bcom_enable (s->bcom_task); }
@@ -106,39 +106,39 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) }/** -* psc_i2s_startup: create a new substream +* psc_dma_startup: create a new substream * * This is the first function called when a stream is opened. * * If this is the first stream open, then grab the IRQ and program most of * the PSC registers. */ -int psc_i2s_startup (struct snd_pcm_substream *substream, +int psc_dma_startup (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;int rc; -dev_dbg (psc_i2s->dev,"psc_i2s_startup(substream=%p)\n" , substream); +dev_dbg (psc_dma->dev,"psc_dma_startup(substream=%p)\n" , substream); -if (!psc_i2s->playback.active && - !psc_i2s->capture.active) { +if (!psc_dma->playback.active && + !psc_dma->capture.active) {/* Setup the IRQs */ - rc =request_irq (psc_i2s->irq, &psc_i2s_status_irq,IRQF_SHARED , -"psc-i2s-status" , psc_i2s); - rc |=request_irq (psc_i2s->capture.irq, - &psc_i2s_bcom_irq,IRQF_SHARED , -"psc-i2s-capture" , &psc_i2s->capture); - rc |=request_irq (psc_i2s->playback.irq, - &psc_i2s_bcom_irq,IRQF_SHARED , -"psc-i2s-playback" , &psc_i2s->playback); + rc =request_irq (psc_dma->irq, &psc_dma_status_irq,IRQF_SHARED , +"psc-dma-status" , psc_dma); + rc |=request_irq (psc_dma->capture.irq, + &psc_dma_bcom_irq,IRQF_SHARED , +"psc-dma-capture" , &psc_dma->capture); + rc |=request_irq (psc_dma->playback.irq, + &psc_dma_bcom_irq,IRQF_SHARED , +"psc-dma-playback" , &psc_dma->playback);if (rc) { -free_irq (psc_i2s->irq, psc_i2s); -free_irq (psc_i2s->capture.irq, - &psc_i2s->capture); -free_irq (psc_i2s->playback.irq, - &psc_i2s->playback); +free_irq (psc_dma->irq, psc_dma); +free_irq (psc_dma->capture.irq, + &psc_dma->capture); +free_irq (psc_dma->playback.irq, + &psc_dma->playback);return -ENODEV ; } }
@@ -146,7 +146,7 @@ int psc_i2s_startup(struct snd_pcm_substream *substream,return 0 ; } -int psc_i2s_hw_free (struct snd_pcm_substream *substream, +int psc_dma_hw_free (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {snd_pcm_set_runtime_buffer (substream,NULL );
@@ -154,29 +154,29 @@ int psc_i2s_hw_free(struct snd_pcm_substream *substream, }/** -* psc_i2s_trigger: start and stop the DMA transfer. +* psc_dma_trigger: start and stop the DMA transfer. * * This function is called by ALSA to start, stop, pause, and resume the DMA * transfer of data. */ -int psc_i2s_trigger (struct snd_pcm_substream *substream,int cmd, +int psc_dma_trigger (struct snd_pcm_substream *substream,int cmd,struct snd_soc_dai *dai) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data;struct snd_pcm_runtime *runtime = substream->runtime; -struct psc_i2s_stream *s; -struct mpc52xx_psc __iomem *regs = psc_i2s->psc_regs; +struct psc_dma_stream *s; +struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;u16 imr;u8 psc_cmd;unsigned long flags;if (substream->pstr->stream ==SNDRV_PCM_STREAM_CAPTURE ) - s = &psc_i2s->capture; + s = &psc_dma->capture;else - s = &psc_i2s->playback; + s = &psc_dma->playback; -dev_dbg (psc_i2s->dev,"psc_i2s_trigger(substream=%p, cmd=%i)" +dev_dbg (psc_dma->dev,"psc_dma_trigger(substream=%p, cmd=%i)" " stream_id=%i\n" , substream, cmd, substream->pstr->stream);
@@ -207,14 +207,14 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,else bcom_gen_bd_tx_reset (s->bcom_task);while (!bcom_queue_full (s->bcom_task)) -psc_i2s_bcom_enqueue_next_buffer (s); +psc_dma_bcom_enqueue_next_buffer (s);bcom_enable (s->bcom_task); -/* Due to errata in the i2s mode; need to line up enabling +/* Due to errata in the dma mode; need to line up enabling * the transmitter with a transition on the frame sync * line */ -spin_lock_irqsave (&psc_i2s->lock, flags); +spin_lock_irqsave (&psc_dma->lock, flags);/* first make sure it is low */ while ((in_8 (®s->ipcr_acr.ipcr) &0x80 ) !=0 ) ;
@@ -228,7 +228,7 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,if (substream->pstr->stream ==SNDRV_PCM_STREAM_PLAYBACK ) psc_cmd |= MPC52xx_PSC_TX_ENABLE;out_8 (®s->command, psc_cmd); -spin_unlock_irqrestore (&psc_i2s->lock, flags); +spin_unlock_irqrestore (&psc_dma->lock, flags);break ;
@@ -236,7 +236,7 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,/* Turn off the PSC */ s->active =0 ;if (substream->pstr->stream ==SNDRV_PCM_STREAM_CAPTURE ) { -if (!psc_i2s->playback.active) { +if (!psc_dma->playback.active) {out_8 (®s->command,2 <<4 );/* reset rx */ out_8 (®s->command,3 <<4 );/* reset tx */ out_8 (®s->command,4 <<4 );/* reset err */
@@ -244,7 +244,7 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd, }else {out_8 (®s->command,3 <<4 );/* reset tx */ out_8 (®s->command,4 <<4 );/* reset err */ -if (!psc_i2s->capture.active) +if (!psc_dma->capture.active)out_8 (®s->command,2 <<4 );/* reset rx */ }
@@ -255,15 +255,15 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd,break ;default : -dev_dbg (psc_i2s->dev,"invalid command\n" ); +dev_dbg (psc_dma->dev,"invalid command\n" );return -EINVAL ; }/* Update interrupt enable settings */ imr =0 ; -if (psc_i2s->playback.active) +if (psc_dma->playback.active) imr |= MPC52xx_PSC_IMR_TXEMP; -if (psc_i2s->capture.active) +if (psc_dma->capture.active) imr |= MPC52xx_PSC_IMR_ORERR;out_be16 (®s->isr_imr.imr, imr);
@@ -271,36 +271,36 @@ int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd, }/** -* psc_i2s_shutdown: shutdown the data transfer on a stream +* psc_dma_shutdown: shutdown the data transfer on a stream * * Shutdown the PSC if there are no other substreams open. */ -void psc_i2s_shutdown (struct snd_pcm_substream *substream, +void psc_dma_shutdown (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data; -dev_dbg (psc_i2s->dev,"psc_i2s_shutdown(substream=%p)\n" , substream); +dev_dbg (psc_dma->dev,"psc_dma_shutdown(substream=%p)\n" , substream);/* * If this is the last active substream, disable the PSC and release * the IRQ. */ -if (!psc_i2s->playback.active && - !psc_i2s->capture.active) { +if (!psc_dma->playback.active && + !psc_dma->capture.active) {/* Disable all interrupts and reset the PSC */ -out_be16 (&psc_i2s->psc_regs->isr_imr.imr,0 ); -out_8 (&psc_i2s->psc_regs->command,3 <<4 );/* reset tx */ -out_8 (&psc_i2s->psc_regs->command,2 <<4 );/* reset rx */ -out_8 (&psc_i2s->psc_regs->command,1 <<4 );/* reset mode */ -out_8 (&psc_i2s->psc_regs->command,4 <<4 );/* reset error */ +out_be16 (&psc_dma->psc_regs->isr_imr.imr,0 ); +out_8 (&psc_dma->psc_regs->command,3 <<4 );/* reset tx */ +out_8 (&psc_dma->psc_regs->command,2 <<4 );/* reset rx */ +out_8 (&psc_dma->psc_regs->command,1 <<4 );/* reset mode */ +out_8 (&psc_dma->psc_regs->command,4 <<4 );/* reset error */ /* Release irqs */ -free_irq (psc_i2s->irq, psc_i2s); -free_irq (psc_i2s->capture.irq, &psc_i2s->capture); -free_irq (psc_i2s->playback.irq, &psc_i2s->playback); +free_irq (psc_dma->irq, psc_dma); +free_irq (psc_dma->capture.irq, &psc_dma->capture); +free_irq (psc_dma->playback.irq, &psc_dma->playback); } }
@@ -312,7 +312,7 @@ void psc_i2s_shutdown(struct snd_pcm_substream *substream,* interaction with the attached codec */ -static const struct snd_pcm_hardware psc_i2s_pcm_hardware = { +static const struct snd_pcm_hardware psc_dma_pcm_hardware = { .info =SNDRV_PCM_INFO_MMAP |SNDRV_PCM_INFO_MMAP_VALID |SNDRV_PCM_INFO_INTERLEAVED |SNDRV_PCM_INFO_BLOCK_TRANSFER , .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |
@@ -329,80 +329,80 @@ static const struct snd_pcm_hardware psc_i2s_pcm_hardware = { .fifo_size = 0, }; -static int psc_i2s_pcm_open (struct snd_pcm_substream *substream) +static int psc_dma_pcm_open (struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; -struct psc_i2s_stream *s; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data; +struct psc_dma_stream *s; -dev_dbg (psc_i2s->dev,"psc_i2s_pcm_open(substream=%p)\n" , substream); +dev_dbg (psc_dma->dev,"psc_dma_pcm_open(substream=%p)\n" , substream);if (substream->pstr->stream ==SNDRV_PCM_STREAM_CAPTURE ) - s = &psc_i2s->capture; + s = &psc_dma->capture;else - s = &psc_i2s->playback; + s = &psc_dma->playback; -snd_soc_set_runtime_hwparams (substream, &psc_i2s_pcm_hardware); +snd_soc_set_runtime_hwparams (substream, &psc_dma_pcm_hardware); s->stream = substream;return 0 ; } -static int psc_i2s_pcm_close (struct snd_pcm_substream *substream) +static int psc_dma_pcm_close (struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; -struct psc_i2s_stream *s; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data; +struct psc_dma_stream *s; -dev_dbg (psc_i2s->dev,"psc_i2s_pcm_close(substream=%p)\n" , substream); +dev_dbg (psc_dma->dev,"psc_dma_pcm_close(substream=%p)\n" , substream);if (substream->pstr->stream ==SNDRV_PCM_STREAM_CAPTURE ) - s = &psc_i2s->capture; + s = &psc_dma->capture;else - s = &psc_i2s->playback; + s = &psc_dma->playback; s->stream =NULL ;return 0 ; }static snd_pcm_uframes_t -psc_i2s_pcm_pointer (struct snd_pcm_substream *substream) +psc_dma_pcm_pointer (struct snd_pcm_substream *substream) {struct snd_soc_pcm_runtime *rtd = substream->private_data; -struct psc_i2s *psc_i2s = rtd->dai->cpu_dai->private_data; -struct psc_i2s_stream *s; +struct psc_dma *psc_dma = rtd->dai->cpu_dai->private_data; +struct psc_dma_stream *s;dma_addr_t count;if (substream->pstr->stream ==SNDRV_PCM_STREAM_CAPTURE ) - s = &psc_i2s->capture; + s = &psc_dma->capture;else - s = &psc_i2s->playback; + s = &psc_dma->playback; count = s->period_current_pt - s->period_start;return bytes_to_frames (substream->runtime, count); } -static struct snd_pcm_ops psc_i2s_pcm_ops = { - .open = psc_i2s_pcm_open, - .close = psc_i2s_pcm_close, +static struct snd_pcm_ops psc_dma_pcm_ops = { + .open = psc_dma_pcm_open, + .close = psc_dma_pcm_close, .ioctl = snd_pcm_lib_ioctl, - .pointer = psc_i2s_pcm_pointer, + .pointer = psc_dma_pcm_pointer, }; -static u64 psc_i2s_pcm_dmamask =0xffffffff ; -static int psc_i2s_pcm_new (struct snd_card *card,struct snd_soc_dai *dai, +static u64 psc_dma_pcm_dmamask =0xffffffff ; +static int psc_dma_pcm_new (struct snd_card *card,struct snd_soc_dai *dai,struct snd_pcm *pcm) {struct snd_soc_pcm_runtime *rtd = pcm->private_data; -size_t size = psc_i2s_pcm_hardware.buffer_bytes_max; +size_t size = psc_dma_pcm_hardware.buffer_bytes_max;int rc =0 ; -dev_dbg (rtd->socdev->dev,"psc_i2s_pcm_new(card=%p, dai=%p, pcm=%p)\n" , +dev_dbg (rtd->socdev->dev,"psc_dma_pcm_new(card=%p, dai=%p, pcm=%p)\n" , card, dai, pcm);if (!card->dev->dma_mask) - card->dev->dma_mask = &psc_i2s_pcm_dmamask; + card->dev->dma_mask = &psc_dma_pcm_dmamask;if (!card->dev->coherent_dma_mask) card->dev->coherent_dma_mask =0xffffffff ;
@@ -430,13 +430,13 @@ static int psc_i2s_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,return -ENOMEM ; } -static void psc_i2s_pcm_free (struct snd_pcm *pcm) +static void psc_dma_pcm_free (struct snd_pcm *pcm) {struct snd_soc_pcm_runtime *rtd = pcm->private_data;struct snd_pcm_substream *substream;int stream; -dev_dbg (rtd->socdev->dev,"psc_i2s_pcm_free(pcm=%p)\n" , pcm); +dev_dbg (rtd->socdev->dev,"psc_dma_pcm_free(pcm=%p)\n" , pcm);for (stream =0 ; stream <2 ; stream++) { substream = pcm->streams[stream].substream;
@@ -448,10 +448,10 @@ static void psc_i2s_pcm_free(struct snd_pcm *pcm) } } -struct snd_soc_platform psc_i2s_pcm_soc_platform = { +struct snd_soc_platform psc_dma_pcm_soc_platform = { .name ="mpc5200-psc-audio" , - .pcm_ops = &psc_i2s_pcm_ops, - .pcm_new = &psc_i2s_pcm_new, - .pcm_free = &psc_i2s_pcm_free, + .pcm_ops = &psc_dma_pcm_ops, + .pcm_new = &psc_dma_pcm_new, + .pcm_free = &psc_dma_pcm_free, };
sound/soc/fsl/mpc5200_dma.h +13 -13
@@ -6,9 +6,9 @@#define __SOUND_SOC_FSL_MPC5200_DMA_H__/** -* psc_i2s_stream - Data specific to a single stream (playback or capture) +* psc_dma_stream - Data specific to a single stream (playback or capture) * @active: flag indicating if the stream is active -* @psc_i2s: pointer back to parent psc_i2s data structure +* @psc_dma: pointer back to parent psc_dma data structure * @bcom_task: bestcomm task structure * @irq: irq number for bestcomm task * @period_start: physical address of start of DMA region
@@ -16,9 +16,9 @@* @period_next_pt: physical address of next DMA buffer to enqueue * @period_bytes: size of DMA period in bytes */ -struct psc_i2s_stream { +struct psc_dma_stream {int active; -struct psc_i2s *psc_i2s; +struct psc_dma *psc_dma;struct bcom_task *bcom_task;int irq;struct snd_pcm_substream *stream;
@@ -30,7 +30,7 @@ struct psc_i2s_stream { };/** -* psc_i2s - Private driver data +* psc_dma - Private driver data * @name: short name for this device ("PSC0", "PSC1", etc) * @psc_regs: pointer to the PSC's registers * @fifo_regs: pointer to the PSC's FIFO registers
@@ -42,7 +42,7 @@ struct psc_i2s_stream {* @playback: Playback stream context data * @capture: Capture stream context data */ -struct psc_i2s { +struct psc_dma {char name[32 ];struct mpc52xx_psc __iomem *psc_regs;struct mpc52xx_psc_fifo __iomem *fifo_regs;
@@ -53,8 +53,8 @@ struct psc_i2s {u32 sicr;/* per-stream data */ -struct psc_i2s_stream playback; -struct psc_i2s_stream capture; +struct psc_dma_stream playback; +struct psc_dma_stream capture;/* Statistics */ struct {
@@ -64,18 +64,18 @@ struct psc_i2s { }; -int psc_i2s_startup (struct snd_pcm_substream *substream, +int psc_dma_startup (struct snd_pcm_substream *substream,struct snd_soc_dai *dai); -int psc_i2s_hw_free (struct snd_pcm_substream *substream, +int psc_dma_hw_free (struct snd_pcm_substream *substream,struct snd_soc_dai *dai); -void psc_i2s_shutdown (struct snd_pcm_substream *substream, +void psc_dma_shutdown (struct snd_pcm_substream *substream,struct snd_soc_dai *dai); -int psc_i2s_trigger (struct snd_pcm_substream *substream,int cmd, +int psc_dma_trigger (struct snd_pcm_substream *substream,int cmd,struct snd_soc_dai *dai); -extern struct snd_soc_platform psc_i2s_pcm_soc_platform; +extern struct snd_soc_platform psc_dma_pcm_soc_platform;#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */
sound/soc/fsl/mpc5200_psc_i2s.c +80 -80
288 lines not on this page · raw message
Signature · 1 line
1.6.2.4