/*
 * tonka.c  --  SoC audio for Tonka
 *
 * Author: Misael Lopez Cruz <misael.lopez@ti.com>
 *         Liam Girdwood <lrg@ti.com>
 *
 * 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 published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/module.h>

#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/jack.h>
#include <sound/pcm_params.h>
#include <sound/soc-dapm.h>
#include <sound/soc-dsp.h>

#include <asm/mach-types.h>
#include <plat/hardware.h>
#include <plat/mux.h>
#include <plat/mcbsp.h>

#include "omap-pcm.h"
#include "omap-abe.h"
#include "omap-abe-dsp.h"
#include "omap-mcbsp.h"

static int tonka_mcbsp_hw_params(struct snd_pcm_substream *substream,
	struct snd_pcm_hw_params *params)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	int ret = 0;
	unsigned int channels, div;

	/* Codec reference clock. */
	ret = snd_soc_dai_set_sysclk(codec_dai, 0, 12000000, SND_SOC_CLOCK_IN);
	if (unlikely(ret < 0)) {
		dev_err(codec_dai->dev, "can't set reference clock\n");
		return ret;
	}

	if (params != NULL) {
		/* Configure McBSP internal buffer usage */
		/* this need to be done for playback and/or record */
		channels = params_channels(params);
		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
			omap_mcbsp_set_tx_threshold(cpu_dai->id, channels);
		else
			omap_mcbsp_set_rx_threshold(cpu_dai->id, channels);
	}

	/* Clock master mode; derive bit clock from FCLK. */
	ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK,
				     24576000, SND_SOC_CLOCK_IN);
	if (unlikely(ret < 0)) {
		dev_err(cpu_dai->dev, "can't set reference clock\n");
		return ret;
	}

	switch (params_rate(params)) {
	case 44100:	/* XXX 45176 */
		div = 17;
		break;
	case 48000:
		div = 16;
		break;
	default:
		dev_err(cpu_dai->dev, "unknown rate %d\n", params_rate(params));
		return -EINVAL;
	}
	ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, div);
	if (unlikely(ret < 0)) {
		dev_err(cpu_dai->dev, "can't set clock divider\n");
		return ret;
	}

	return 0;
}

static struct snd_soc_ops tonka_mcbsp_ops = {
	.hw_params = tonka_mcbsp_hw_params,
};

static int tonka_mcbsp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
			struct snd_pcm_hw_params *params)
{
	struct snd_interval *channels = hw_param_interval(params,
                                       SNDRV_PCM_HW_PARAM_CHANNELS);

	channels->min = 2;
	channels->max = 2;
	snd_mask_set(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT -
	                            SNDRV_PCM_HW_PARAM_FIRST_MASK],
	                            SNDRV_PCM_FORMAT_S16_LE);
	return 0;
}

static int sdp4430_stream_event(struct snd_soc_dapm_context *dapm, int event)
{
#if 0
	/*
	 * set DL1 gains dynamically according to the active output
	 * (Headset, Earpiece) and HSDAC power mode
	 */
	return sdp4430_set_pdm_dl1_gains(dapm);
#else
	return 0;
#endif
}

static const struct snd_kcontrol_new tonka_controls_display[] = {
};

static const struct snd_soc_dapm_widget tonka_dapm_widgets_display[] = {
};

static const struct snd_soc_dapm_route tonka_dapm_routes_display[] = {
};

static int tonka_display_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret;

	//snd_soc_dapm_nc_pin(dapm, "MIC3L");
	//…

	ret = snd_soc_add_controls(codec, tonka_controls_display,
				   ARRAY_SIZE(tonka_controls_display));
	if (unlikely(ret < 0))
		return ret;

	ret = snd_soc_dapm_new_controls(dapm, tonka_dapm_widgets_display,
					ARRAY_SIZE(tonka_dapm_widgets_display));
	if (unlikely(ret < 0))
		return ret;

	ret = snd_soc_dapm_add_routes(dapm, tonka_dapm_routes_display,
				      ARRAY_SIZE(tonka_dapm_routes_display));
	if (unlikely(ret < 0))
		return ret;

	return 0;
}

static const struct snd_kcontrol_new tonka_controls_speaker[] = {
};

static const struct snd_soc_dapm_widget tonka_dapm_widgets_speaker[] = {
	SND_SOC_DAPM_LINE("Line Out", NULL),
	SND_SOC_DAPM_HP("Headphone Jack", NULL),
	SND_SOC_DAPM_LINE("Line In", NULL),
	SND_SOC_DAPM_MIC("Mic In", NULL),
};

static const struct snd_soc_dapm_route tonka_dapm_routes_speaker[] = {
	{"Line Out", NULL, "Speaker LOUT"},
	{"Line Out", NULL, "Speaker ROUT"},
	{"Headphone Jack", NULL, "Speaker LHPOUT"},
	{"Headphone Jack", NULL, "Speaker RHPOUT"},
	{"Speaker LLINEIN", NULL, "Line In"},
	{"Speaker RLINEIN", NULL, "Line In"},
	{"Speaker MICIN", NULL, "Mic In"},
};

static int tonka_speaker_init(struct snd_soc_pcm_runtime *rtd)
{
	struct snd_soc_codec *codec = rtd->codec;
	struct snd_soc_dapm_context *dapm = &codec->dapm;
	int ret;

	//snd_soc_dapm_nc_pin(dapm, "MIC3L");
	//…

	ret = snd_soc_add_controls(codec, tonka_controls_speaker,
				   ARRAY_SIZE(tonka_controls_speaker));
	if (unlikely(ret < 0))
		return ret;

	ret = snd_soc_dapm_new_controls(dapm, tonka_dapm_widgets_speaker,
					ARRAY_SIZE(tonka_dapm_widgets_speaker));
	if (unlikely(ret < 0))
		return ret;

	ret = snd_soc_dapm_add_routes(dapm, tonka_dapm_routes_speaker,
				      ARRAY_SIZE(tonka_dapm_routes_speaker));
	if (unlikely(ret < 0))
		return ret;

	return 0;
}

static struct snd_soc_dsp_link fe_media = {
	.playback	= true,
	.capture	= true,
	.trigger =
		{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};

static struct snd_soc_dsp_link fe_media_capture = {
	.capture	= true,
	.trigger =
		{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};

static struct snd_soc_dsp_link fe_tones = {
	.playback	= true,
	.trigger =
		{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};

static struct snd_soc_dsp_link fe_lp_media = {
	.playback	= true,
	.trigger =
		{SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE},
};

static struct snd_soc_dai_link tonka_dai[] = {

/*
 * Frontend DAIs - i.e. userspace visible interfaces (ALSA PCMs)
 */

	{
		.name = "Tonka Media",
		.stream_name = "Multimedia",

		/* ABE components - MM-UL & MM_DL */
		.cpu_dai_name = "MultiMedia1",
		.platform_name = "omap-pcm-audio",

		.dynamic = 1, /* BE is dynamic */
		.dsp_link = &fe_media,
	},
	{
		.name = "Tonka Media Capture",
		.stream_name = "Multimedia Capture",

		/* ABE components - MM-UL2 */
		.cpu_dai_name = "MultiMedia2",
		.platform_name = "omap-pcm-audio",

		.dynamic = 1, /* BE is dynamic */
		.dsp_link = &fe_media_capture,
	},
	{
		.name = "Tonka Voice",
		.stream_name = "Voice",

		/* ABE components - VX-UL & VX-DL */
		.cpu_dai_name = "Voice",
		.platform_name = "omap-pcm-audio",

		.dynamic = 1, /* BE is dynamic */
		.dsp_link = &fe_media,
		.no_host_mode = SND_SOC_DAI_LINK_OPT_HOST,
	},
	{
		.name = "Tonka Tones Playback",
		.stream_name = "Tone Playback",

		/* ABE components - TONES_DL */
		.cpu_dai_name = "Tones",
		.platform_name = "omap-pcm-audio",

		.dynamic = 1, /* BE is dynamic */
		.dsp_link = &fe_tones,
	},
	{
		.name = "Tonka Media LP",
		.stream_name = "Multimedia",

		/* ABE components - MM-DL (mmap) */
		.cpu_dai_name = "MultiMedia1 LP",
		.platform_name = "aess",

		.dynamic = 1, /* BE is dynamic */
		.dsp_link = &fe_lp_media,
	},

/*
 * Backend DAIs - i.e. dynamically matched interfaces, invisible to userspace.
 * Matched to above interfaces at runtime, based upon use case.
 */

	{
		.name = OMAP_ABE_BE_BT_VX_UL,
		.stream_name = "BT Capture",

		/* ABE components - MCBSP2 - BT-VX */
		.cpu_dai_name = "omap-mcbsp-dai.1",
		.platform_name = "aess",

		/* Bluetooth */
		.codec_dai_name = "tlv320aic23-hifi",
		.codec_name = "tlv320aic23-codec.2-001b",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
			   SND_SOC_DAIFMT_CBS_CFS,
		.init = tonka_display_init,

		.no_pcm = 1, /* don't create ALSA pcm for this */
		.be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
		.ops = &tonka_mcbsp_ops,
		.be_id = OMAP_ABE_DAI_BT_VX,
	},
	{
		.name = OMAP_ABE_BE_BT_VX_DL,
		.stream_name = "BT Playback",

		/* ABE components - MCBSP2 - BT-VX */
		.cpu_dai_name = "omap-mcbsp-dai.1",
		.platform_name = "aess",

		/* Bluetooth */
		.codec_dai_name = "tlv320aic23-hifi",
		.codec_name = "tlv320aic23-codec.2-001b",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
			   SND_SOC_DAIFMT_CBS_CFS,
		//.init = tonka_display_init,

		.no_pcm = 1, /* don't create ALSA pcm for this */
		.be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
		.ops = &tonka_mcbsp_ops,
		.be_id = OMAP_ABE_DAI_BT_VX,
	},
	{
		.name = "MM-EXT-UL",
		.stream_name = "FM Capture",

		/* ABE components - MCBSP1 - MM-EXT */
		.cpu_dai_name = "omap-mcbsp-dai.0",
		.platform_name = "aess",

		/* FM */
		.codec_dai_name = "tlv320aic23-hifi",
		.codec_name = "tlv320aic23-codec.3-001a",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
			   SND_SOC_DAIFMT_CBS_CFS,
		.init = tonka_speaker_init,

		.no_pcm = 1, /* don't create ALSA pcm for this */
		.be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
		.ops = &tonka_mcbsp_ops,
		.be_id = OMAP_ABE_DAI_MM_FM,
	},
	{
		.name = "MM-EXT-DL",
		.stream_name = "FM Playback",

		/* ABE components - MCBSP1 - MM-EXT */
		.cpu_dai_name = "omap-mcbsp-dai.0",
		.platform_name = "aess",

		/* FM */
		.codec_dai_name = "tlv320aic23-hifi",
		.codec_name = "tlv320aic23-codec.3-001a",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
			   SND_SOC_DAIFMT_CBS_CFS,
		//.init = tonka_speaker_init,

		.no_pcm = 1, /* don't create ALSA pcm for this */
		.be_hw_params_fixup = tonka_mcbsp_be_hw_params_fixup,
		.ops = &tonka_mcbsp_ops,
		.be_id = OMAP_ABE_DAI_MM_FM,
	},
};

static struct snd_soc_codec_conf tonka_codec_conf[] = {
	{
		.dev_name = "tlv320aic23-codec.2-001b",
		.name_prefix = "Display",
	},
	{
		.dev_name = "tlv320aic23-codec.3-001a",
		.name_prefix = "Speaker",
	},
};

/* Audio machine driver */
static struct snd_soc_card snd_soc_tonka = {
	.name = "Tonka",
	.driver_name = "OMAP4",
	.long_name = "TI OMAP4 Board",
	.dai_link = tonka_dai,
	.num_links = ARRAY_SIZE(tonka_dai),
	.codec_conf = tonka_codec_conf,
	.num_configs = ARRAY_SIZE(tonka_codec_conf),

	.stream_event = sdp4430_stream_event,
};

static struct platform_device *tonka_snd_device;

static int __init tonka_soc_init(void)
{
	int ret;

	printk(KERN_INFO "Tonka SoC init\n");

	tonka_snd_device = platform_device_alloc("soc-audio", -1);
	if (!tonka_snd_device)
		return -ENOMEM;

	platform_set_drvdata(tonka_snd_device, &snd_soc_tonka);

	ret = platform_device_add(tonka_snd_device);
	if (ret)
		goto err;

	return 0;

err:
	platform_device_put(tonka_snd_device);
	return ret;
}
module_init(tonka_soc_init);

static void __exit tonka_soc_exit(void)
{
	platform_device_unregister(tonka_snd_device);
}
module_exit(tonka_soc_exit);

MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>");
MODULE_DESCRIPTION("ALSA SoC Tonka");
MODULE_LICENSE("GPL");
