Commit 503278c1 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

ASoC: samsung: remove unused drivers



The s3c24xx SoC platform was completely removed, as were most of the
s3c64xx based board files, leaving only the DT based machines as well
as the MACH_WLF_CRAGG_6410 machine. All other board specific ASoC
driver can can now be recycled.

Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 2e3ee090
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright 2008 Simtec Electronics
 *	http://armlinux.simtec.co.uk/
 *	Ben Dooks <ben@simtec.co.uk>
 *
 * Simtec Audio support.
*/

/**
 * struct s3c24xx_audio_simtec_pdata - platform data for simtec audio
 * @use_mpllin: Select codec clock from MPLLin
 * @output_cdclk: Need to output CDCLK to the codec
 * @have_mic: Set if we have a MIC socket
 * @have_lout: Set if we have a LineOut socket
 * @amp_gpio: GPIO pin to enable the AMP
 * @amp_gain: Option GPIO to control AMP gain
 */
struct s3c24xx_audio_simtec_pdata {
	unsigned int	use_mpllin:1;
	unsigned int	output_cdclk:1;

	unsigned int	have_mic:1;
	unsigned int	have_lout:1;

	int		amp_gpio;
	int		amp_gain[2];

	void	(*startup)(void);
};

include/sound/s3c24xx_uda134x.h

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _S3C24XX_UDA134X_H_
#define _S3C24XX_UDA134X_H_ 1

#include <sound/uda134x.h>

struct s3c24xx_uda134x_platform_data {
	int l3_clk;
	int l3_mode;
	int l3_data;
	int model;
};

#endif
+0 −93
Original line number Diff line number Diff line
@@ -11,16 +11,6 @@ menuconfig SND_SOC_SAMSUNG

if SND_SOC_SAMSUNG

config SND_S3C24XX_I2S
	tristate

config SND_S3C_I2SV2_SOC
	tristate

config SND_S3C2412_SOC_I2S
	tristate
	select SND_S3C_I2SV2_SOC

config SND_SAMSUNG_PCM
	tristate "Samsung PCM interface support"

@@ -31,35 +21,6 @@ config SND_SAMSUNG_SPDIF
config SND_SAMSUNG_I2S
	tristate "Samsung I2S interface support"

config SND_SOC_SAMSUNG_NEO1973_WM8753
	tristate "Audio support for Openmoko Neo1973 Smartphones (GTA02)"
	depends on MACH_NEO1973_GTA02 || COMPILE_TEST
	depends on SND_SOC_I2C_AND_SPI
	select SND_S3C24XX_I2S
	select SND_SOC_WM8753
	select SND_SOC_BT_SCO
	help
	  Say Y here to enable audio support for the Openmoko Neo1973
	  Smartphones.

config SND_SOC_SAMSUNG_JIVE_WM8750
	tristate "SoC I2S Audio support for Jive"
	depends on MACH_JIVE && I2C || COMPILE_TEST && ARM
	depends on SND_SOC_I2C_AND_SPI
	select SND_SOC_WM8750
	select SND_S3C2412_SOC_I2S
	help
	  Say Y if you want to add support for SoC audio on the Jive.

config SND_SOC_SAMSUNG_SMDK_WM8580
	tristate "SoC I2S Audio support for WM8580 on SMDK"
	depends on MACH_SMDK6410 || COMPILE_TEST
	depends on I2C
	select SND_SOC_WM8580
	select SND_SAMSUNG_I2S
	help
	  Say Y if you want to add support for SoC audio on the SMDKs.

config SND_SOC_SAMSUNG_SMDK_WM8994
	tristate "SoC I2S Audio support for WM8994 on SMDK"
	depends on I2C=y
@@ -69,60 +30,6 @@ config SND_SOC_SAMSUNG_SMDK_WM8994
	help
		Say Y if you want to add support for SoC audio on the SMDKs.

config SND_SOC_SAMSUNG_S3C24XX_UDA134X
	tristate "SoC I2S Audio support UDA134X wired to a S3C24XX"
	depends on ARCH_S3C24XX || COMPILE_TEST
	select SND_S3C24XX_I2S
	select SND_SOC_L3
	select SND_SOC_UDA134X

config SND_SOC_SAMSUNG_SIMTEC
	tristate
	help
	  Internal node for common S3C24XX/Simtec support.

config SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23
	tristate "SoC I2S Audio support for TLV320AIC23 on Simtec boards"
	depends on ARCH_S3C24XX || COMPILE_TEST
	depends on I2C
	select SND_S3C24XX_I2S
	select SND_SOC_TLV320AIC23_I2C
	select SND_SOC_SAMSUNG_SIMTEC

config SND_SOC_SAMSUNG_SIMTEC_HERMES
	tristate "SoC I2S Audio support for Simtec Hermes board"
	depends on ARCH_S3C24XX || COMPILE_TEST
	depends on I2C
	select SND_S3C24XX_I2S
	select SND_SOC_TLV320AIC3X
	select SND_SOC_SAMSUNG_SIMTEC

config SND_SOC_SAMSUNG_H1940_UDA1380
	tristate "Audio support for the HP iPAQ H1940"
	depends on ARCH_H1940 || COMPILE_TEST
	depends on I2C
	select SND_S3C24XX_I2S
	select SND_SOC_UDA1380
	help
	  This driver provides audio support for HP iPAQ h1940 PDA.

config SND_SOC_SAMSUNG_RX1950_UDA1380
	tristate "Audio support for the HP iPAQ RX1950"
	depends on MACH_RX1950 || COMPILE_TEST
	depends on I2C
	select SND_S3C24XX_I2S
	select SND_SOC_UDA1380
	help
	  This driver provides audio support for HP iPAQ RX1950 PDA.

config SND_SOC_SMARTQ
	tristate "SoC I2S Audio support for SmartQ board"
	depends on MACH_SMARTQ || COMPILE_TEST
	depends on GPIOLIB || COMPILE_TEST
	depends on I2C
	select SND_SAMSUNG_I2S
	select SND_SOC_WM8750

config SND_SOC_SAMSUNG_SMDK_SPDIF
	tristate "SoC S/PDIF Audio support for SMDK"
	select SND_SAMSUNG_SPDIF
+0 −26
Original line number Diff line number Diff line
@@ -2,35 +2,19 @@
# S3c24XX Platform Support
snd-soc-s3c-dma-objs := dmaengine.o
snd-soc-idma-objs := idma.o
snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o
snd-soc-s3c2412-i2s-objs := s3c2412-i2s.o
snd-soc-s3c-i2s-v2-objs := s3c-i2s-v2.o
snd-soc-samsung-spdif-objs := spdif.o
snd-soc-pcm-objs := pcm.o
snd-soc-i2s-objs := i2s.o

obj-$(CONFIG_SND_SOC_SAMSUNG) += snd-soc-s3c-dma.o
obj-$(CONFIG_SND_S3C24XX_I2S) += snd-soc-s3c24xx-i2s.o
obj-$(CONFIG_SND_S3C2412_SOC_I2S) += snd-soc-s3c2412-i2s.o
obj-$(CONFIG_SND_S3C_I2SV2_SOC) += snd-soc-s3c-i2s-v2.o
obj-$(CONFIG_SND_SAMSUNG_SPDIF) += snd-soc-samsung-spdif.o
obj-$(CONFIG_SND_SAMSUNG_PCM) += snd-soc-pcm.o
obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-i2s.o
obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-idma.o

# S3C24XX Machine Support
snd-soc-jive-wm8750-objs := jive_wm8750.o
snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o
snd-soc-s3c24xx-uda134x-objs := s3c24xx_uda134x.o
snd-soc-s3c24xx-simtec-objs := s3c24xx_simtec.o
snd-soc-s3c24xx-simtec-hermes-objs := s3c24xx_simtec_hermes.o
snd-soc-s3c24xx-simtec-tlv320aic23-objs := s3c24xx_simtec_tlv320aic23.o
snd-soc-h1940-uda1380-objs := h1940_uda1380.o
snd-soc-rx1950-uda1380-objs := rx1950_uda1380.o
snd-soc-smdk-wm8580-objs := smdk_wm8580.o
snd-soc-smdk-wm8994-objs := smdk_wm8994.o
snd-soc-snow-objs := snow.o
snd-soc-s3c64xx-smartq-wm8987-objs := smartq_wm8987.o
snd-soc-smdk-spdif-objs := smdk_spdif.o
snd-soc-smdk-wm8994pcm-objs := smdk_wm8994pcm.o
snd-soc-speyside-objs := speyside.o
@@ -44,18 +28,8 @@ snd-soc-tm2-wm5110-objs := tm2_wm5110.o
snd-soc-aries-wm8994-objs := aries_wm8994.o
snd-soc-midas-wm1811-objs := midas_wm1811.o

obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
obj-$(CONFIG_SND_SOC_SAMSUNG_S3C24XX_UDA134X) += snd-soc-s3c24xx-uda134x.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SIMTEC) += snd-soc-s3c24xx-simtec.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SIMTEC_HERMES) += snd-soc-s3c24xx-simtec-hermes.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23) += snd-soc-s3c24xx-simtec-tlv320aic23.o
obj-$(CONFIG_SND_SOC_SAMSUNG_H1940_UDA1380) += snd-soc-h1940-uda1380.o
obj-$(CONFIG_SND_SOC_SAMSUNG_RX1950_UDA1380) += snd-soc-rx1950-uda1380.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SMDK_WM8580) += snd-soc-smdk-wm8580.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SMDK_WM8994) += snd-soc-smdk-wm8994.o
obj-$(CONFIG_SND_SOC_SNOW) += snd-soc-snow.o
obj-$(CONFIG_SND_SOC_SMARTQ) += snd-soc-s3c64xx-smartq-wm8987.o
obj-$(CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF) += snd-soc-smdk-spdif.o
obj-$(CONFIG_SND_SOC_SMDK_WM8994_PCM) += snd-soc-smdk-wm8994pcm.o
obj-$(CONFIG_SND_SOC_SPEYSIDE) += snd-soc-speyside.o

sound/soc/samsung/h1940_uda1380.c

deleted100644 → 0
+0 −224
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+
//
// h1940_uda1380.c - ALSA SoC Audio Layer
//
// Copyright (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
// Copyright (c) 2010 Vasily Khoruzhick <anarsoul@gmail.com>
//
// Based on version from Arnaud Patard <arnaud.patard@rtp-net.org>

#include <linux/types.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>

#include <sound/soc.h>
#include <sound/jack.h>

#include "regs-iis.h"
#include "s3c24xx-i2s.h"

static const unsigned int rates[] = {
	11025,
	22050,
	44100,
};

static const struct snd_pcm_hw_constraint_list hw_rates = {
	.count = ARRAY_SIZE(rates),
	.list = rates,
};

static struct gpio_desc *gpiod_speaker_power;

static struct snd_soc_jack hp_jack;

static struct snd_soc_jack_pin hp_jack_pins[] = {
	{
		.pin	= "Headphone Jack",
		.mask	= SND_JACK_HEADPHONE,
	},
	{
		.pin	= "Speaker",
		.mask	= SND_JACK_HEADPHONE,
		.invert	= 1,
	},
};

static struct snd_soc_jack_gpio hp_jack_gpios[] = {
	{
		.name			= "hp-gpio",
		.report			= SND_JACK_HEADPHONE,
		.invert			= 1,
		.debounce_time		= 200,
	},
};

static int h1940_startup(struct snd_pcm_substream *substream)
{
	struct snd_pcm_runtime *runtime = substream->runtime;

	return snd_pcm_hw_constraint_list(runtime, 0,
					SNDRV_PCM_HW_PARAM_RATE,
					&hw_rates);
}

static int h1940_hw_params(struct snd_pcm_substream *substream,
				struct snd_pcm_hw_params *params)
{
	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
	struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
	int div;
	int ret;
	unsigned int rate = params_rate(params);

	switch (rate) {
	case 11025:
	case 22050:
	case 44100:
		div = s3c24xx_i2s_get_clockrate() / (384 * rate);
		if (s3c24xx_i2s_get_clockrate() % (384 * rate) > (192 * rate))
			div++;
		break;
	default:
		dev_err(rtd->dev, "%s: rate %d is not supported\n",
			__func__, rate);
		return -EINVAL;
	}

	/* select clock source */
	ret = snd_soc_dai_set_sysclk(cpu_dai, S3C24XX_CLKSRC_PCLK, rate,
			SND_SOC_CLOCK_OUT);
	if (ret < 0)
		return ret;

	/* set MCLK division for sample rate */
	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK,
		S3C2410_IISMOD_384FS);
	if (ret < 0)
		return ret;

	/* set BCLK division for sample rate */
	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_BCLK,
		S3C2410_IISMOD_32FS);
	if (ret < 0)
		return ret;

	/* set prescaler division for sample rate */
	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
		S3C24XX_PRESCALE(div, div));
	if (ret < 0)
		return ret;

	return 0;
}

static const struct snd_soc_ops h1940_ops = {
	.startup	= h1940_startup,
	.hw_params	= h1940_hw_params,
};

static int h1940_spk_power(struct snd_soc_dapm_widget *w,
				struct snd_kcontrol *kcontrol, int event)
{
	if (SND_SOC_DAPM_EVENT_ON(event))
		gpiod_set_value(gpiod_speaker_power, 1);
	else
		gpiod_set_value(gpiod_speaker_power, 0);

	return 0;
}

/* h1940 machine dapm widgets */
static const struct snd_soc_dapm_widget uda1380_dapm_widgets[] = {
	SND_SOC_DAPM_HP("Headphone Jack", NULL),
	SND_SOC_DAPM_MIC("Mic Jack", NULL),
	SND_SOC_DAPM_SPK("Speaker", h1940_spk_power),
};

/* h1940 machine audio_map */
static const struct snd_soc_dapm_route audio_map[] = {
	/* headphone connected to VOUTLHP, VOUTRHP */
	{"Headphone Jack", NULL, "VOUTLHP"},
	{"Headphone Jack", NULL, "VOUTRHP"},

	/* ext speaker connected to VOUTL, VOUTR  */
	{"Speaker", NULL, "VOUTL"},
	{"Speaker", NULL, "VOUTR"},

	/* mic is connected to VINM */
	{"VINM", NULL, "Mic Jack"},
};

static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd)
{
	snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack",
		SND_JACK_HEADPHONE,
		&hp_jack, hp_jack_pins, ARRAY_SIZE(hp_jack_pins));

	snd_soc_jack_add_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
		hp_jack_gpios);

	return 0;
}

/* s3c24xx digital audio interface glue - connects codec <--> CPU */
SND_SOC_DAILINK_DEFS(uda1380,
	DAILINK_COMP_ARRAY(COMP_CPU("s3c24xx-iis")),
	DAILINK_COMP_ARRAY(COMP_CODEC("uda1380-codec.0-001a", "uda1380-hifi")),
	DAILINK_COMP_ARRAY(COMP_PLATFORM("s3c24xx-iis")));

static struct snd_soc_dai_link h1940_uda1380_dai[] = {
	{
		.name		= "uda1380",
		.stream_name	= "UDA1380 Duplex",
		.init		= h1940_uda1380_init,
		.dai_fmt	= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
				  SND_SOC_DAIFMT_CBS_CFS,
		.ops		= &h1940_ops,
		SND_SOC_DAILINK_REG(uda1380),
	},
};

static struct snd_soc_card h1940_asoc = {
	.name = "h1940",
	.owner = THIS_MODULE,
	.dai_link = h1940_uda1380_dai,
	.num_links = ARRAY_SIZE(h1940_uda1380_dai),

	.dapm_widgets = uda1380_dapm_widgets,
	.num_dapm_widgets = ARRAY_SIZE(uda1380_dapm_widgets),
	.dapm_routes = audio_map,
	.num_dapm_routes = ARRAY_SIZE(audio_map),
};

static int h1940_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;

	h1940_asoc.dev = dev;
	hp_jack_gpios[0].gpiod_dev = dev;
	gpiod_speaker_power = devm_gpiod_get(&pdev->dev, "speaker-power",
					     GPIOD_OUT_LOW);

	if (IS_ERR(gpiod_speaker_power)) {
		dev_err(dev, "Could not get gpio\n");
		return PTR_ERR(gpiod_speaker_power);
	}

	return devm_snd_soc_register_card(dev, &h1940_asoc);
}

static struct platform_driver h1940_audio_driver = {
	.driver = {
		.name = "h1940-audio",
		.pm = &snd_soc_pm_ops,
	},
	.probe = h1940_probe,
};
module_platform_driver(h1940_audio_driver);

/* Module information */
MODULE_AUTHOR("Arnaud Patard, Vasily Khoruzhick");
MODULE_DESCRIPTION("ALSA SoC H1940");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:h1940-audio");
Loading