/*
 * 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.
 */

#if 0
	{
		.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.3-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.3-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,
	},
#endif
	{
		.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[] = {
#if 0
	{
		.dev_name = "tlv320aic23-codec.3-001b",
		.name_prefix = "Display",
	},
#endif
	{
		.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");
