Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1cb9cd6 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'fix/asoc' into for-linus

parents 08d1e635 834eb6c5
Loading
Loading
Loading
Loading
+49 −49
Original line number Diff line number Diff line
@@ -7,15 +7,6 @@ config SND_BF5XX_I2S
	  mode (supports single stereo In/Out).
	  You will also need to select the audio interfaces to support below.

config SND_BF5XX_TDM
	tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip"
	depends on (BLACKFIN && SND_SOC)
	help
	  Say Y or M if you want to add support for codecs attached to
	  the Blackfin SPORT (synchronous serial ports) interface in TDM
	  mode.
	  You will also need to select the audio interfaces to support below.

config SND_BF5XX_SOC_SSM2602
	tristate "SoC SSM2602 Audio support for BF52x ezkit"
	depends on SND_BF5XX_I2S
@@ -41,6 +32,31 @@ config SND_BFIN_AD73311_SE
	  Enter the GPIO used to control AD73311's SE pin. Acceptable
	  values are 0 to 7

config SND_BF5XX_TDM
	tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip"
	depends on (BLACKFIN && SND_SOC)
	help
	  Say Y or M if you want to add support for codecs attached to
	  the Blackfin SPORT (synchronous serial ports) interface in TDM
	  mode.
	  You will also need to select the audio interfaces to support below.

config SND_BF5XX_SOC_AD1836
	tristate "SoC AD1836 Audio support for BF5xx"
	depends on SND_BF5XX_TDM
	select SND_BF5XX_SOC_TDM
	select SND_SOC_AD1836
	help
	  Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT.

config SND_BF5XX_SOC_AD1938
	tristate "SoC AD1938 Audio support for Blackfin"
	depends on SND_BF5XX_TDM
	select SND_BF5XX_SOC_TDM
	select SND_SOC_AD1938
	help
	  Say Y if you want to add support for AD1938 codec on Blackfin.

config SND_BF5XX_AC97
	tristate "SoC AC97 Audio for the ADI BF5xx chip"
	depends on BLACKFIN
@@ -71,6 +87,30 @@ config SND_BF5XX_MULTICHAN_SUPPORT
	  Say y if you want AC97 driver to support up to 5.1 channel audio.
	  this mode will consume much more memory for DMA.

config SND_BF5XX_HAVE_COLD_RESET
	bool "BOARD has COLD Reset GPIO"
	depends on SND_BF5XX_AC97
	default y if BFIN548_EZKIT
	default n if !BFIN548_EZKIT

config SND_BF5XX_RESET_GPIO_NUM
	int "Set a GPIO for cold reset"
	depends on SND_BF5XX_HAVE_COLD_RESET
	range 0 159
	default 19 if BFIN548_EZKIT
	default 5 if BFIN537_STAMP
	default 0
	help
	  Set the correct GPIO for RESET the sound chip.

config SND_BF5XX_SOC_AD1980
	tristate "SoC AD1980/1 Audio support for BF5xx"
	depends on SND_BF5XX_AC97
	select SND_BF5XX_SOC_AC97
	select SND_SOC_AD1980
	help
	  Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT.

config SND_BF5XX_SOC_SPORT
	tristate

@@ -88,30 +128,6 @@ config SND_BF5XX_SOC_AC97
	select SND_SOC_AC97_BUS
	select SND_BF5XX_SOC_SPORT

config SND_BF5XX_SOC_AD1836
	tristate "SoC AD1836 Audio support for BF5xx"
	depends on SND_BF5XX_TDM
	select SND_BF5XX_SOC_TDM
	select SND_SOC_AD1836
	help
	  Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT.

config SND_BF5XX_SOC_AD1980
	tristate "SoC AD1980/1 Audio support for BF5xx"
	depends on SND_BF5XX_AC97
	select SND_BF5XX_SOC_AC97
	select SND_SOC_AD1980
	help
	  Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT.

config SND_BF5XX_SOC_AD1938
        tristate "SoC AD1938 Audio support for Blackfin"
        depends on SND_BF5XX_TDM
        select SND_BF5XX_SOC_TDM
        select SND_SOC_AD1938
        help
          Say Y if you want to add support for AD1938 codec on Blackfin.

config SND_BF5XX_SPORT_NUM
	int "Set a SPORT for Sound chip"
	depends on (SND_BF5XX_I2S || SND_BF5XX_AC97 || SND_BF5XX_TDM)
@@ -120,19 +136,3 @@ config SND_BF5XX_SPORT_NUM
	default 0
	help
	  Set the correct SPORT for sound chip.

config SND_BF5XX_HAVE_COLD_RESET
	bool "BOARD has COLD Reset GPIO"
	depends on SND_BF5XX_AC97
	default y if BFIN548_EZKIT
	default n if !BFIN548_EZKIT

config SND_BF5XX_RESET_GPIO_NUM
	int "Set a GPIO for cold reset"
	depends on SND_BF5XX_HAVE_COLD_RESET
	range 0 159
	default 19 if BFIN548_EZKIT
	default 5 if BFIN537_STAMP
	default 0
	help
	  Set the correct GPIO for RESET the sound chip.
+8 −0
Original line number Diff line number Diff line
@@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
	if (!dai->active)
		return 0;

#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
	ret = sport_set_multichannel(sport, 16, 0x3FF, 1);
#else
	ret = sport_set_multichannel(sport, 16, 0x1F, 1);
#endif
	if (ret) {
		pr_err("SPORT is busy!\n");
		return -EBUSY;
@@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev,
		goto sport_err;
	}
	/*SPORT works in TDM mode to simulate AC97 transfers*/
#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
	ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1);
#else
	ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1);
#endif
	if (ret) {
		pr_err("SPORT is busy!\n");
		ret = -EBUSY;
+1 −1
Original line number Diff line number Diff line
/*
 * linux/sound/arm/bf5xx-ac97.h
 * sound/soc/blackfin/bf5xx-ac97.h
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
+13 −17
Original line number Diff line number Diff line
@@ -77,12 +77,12 @@ static struct sport_param sport_params[2] = {
 * TFS. When Port G is selected and EMAC then there is a conflict between
 * the PHY interrupt line and TFS.  Current settings prevent the conflict
 * by ignoring the TFS pin when Port G is selected. This allows both
 * ssm2602 using Port G and EMAC concurrently.
 * codecs and EMAC using Port G concurrently.
 */
#ifdef CONFIG_BF527_SPORT0_PORTF
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#else
#ifdef CONFIG_BF527_SPORT0_PORTG
#define LOCAL_SPORT0_TFS (0)
#else
#define LOCAL_SPORT0_TFS (P_SPORT0_TFS)
#endif

static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
@@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
	return 0;
}

static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
static void bf5xx_i2s_remove(struct platform_device *pdev,
			struct snd_soc_dai *dai)
{
	pr_debug("%s enter\n", __func__);
	peripheral_free_list(&sport_req[sport_num][0]);
@@ -236,36 +237,31 @@ static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
#ifdef CONFIG_PM
static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
{
	struct sport_device *sport =
		(struct sport_device *)dai->private_data;

	pr_debug("%s : sport %d\n", __func__, dai->id);
	if (!dai->active)
		return 0;

	if (dai->capture.active)
		sport_rx_stop(sport);
		sport_rx_stop(sport_handle);
	if (dai->playback.active)
		sport_tx_stop(sport);
		sport_tx_stop(sport_handle);
	return 0;
}

static int bf5xx_i2s_resume(struct snd_soc_dai *dai)
{
	int ret;
	struct sport_device *sport =
		(struct sport_device *)dai->private_data;

	pr_debug("%s : sport %d\n", __func__, dai->id);
	if (!dai->active)
		return 0;

	ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0);
	ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1,
				      bf5xx_i2s.rcr2, 0, 0);
	if (ret) {
		pr_err("SPORT is busy!\n");
		return -EBUSY;
	}

	ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0);
	ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1,
				      bf5xx_i2s.tcr2, 0, 0);
	if (ret) {
		pr_err("SPORT is busy!\n");
		return -EBUSY;
+1 −1
Original line number Diff line number Diff line
/*
 * linux/sound/arm/bf5xx-i2s.h
 * sound/soc/blackfin/bf5xx-i2s.h
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
Loading