diff options
Diffstat (limited to 'sound/soc')
80 files changed, 45333 insertions, 1430 deletions
diff --git a/sound/soc/Makefile b/sound/soc/Makefile index 1ed61c5..0af7016 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -1,4 +1,4 @@ -snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o +snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o soc-dsp.o obj-$(CONFIG_SND_SOC) += snd-soc-core.o obj-$(CONFIG_SND_SOC) += codecs/ diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index d0e7532..42f699c 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -364,9 +364,11 @@ static struct snd_pcm_ops atmel_pcm_ops = { \*--------------------------------------------------------------------------*/ static u64 atmel_pcm_dmamask = 0xffffffff; -static int atmel_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index 10fdd28..20bb53a 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c @@ -319,10 +319,11 @@ static void au1xpsc_pcm_free_dma_buffers(struct snd_pcm *pcm) snd_pcm_lib_preallocate_free_for_all(pcm); } -static int au1xpsc_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int au1xpsc_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_pcm *pcm = rtd->pcm; + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, card->dev, AU1XPSC_BUFFER_MIN_BYTES, (4096 * 1024) - 1); diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c index 98b44b3..9e59f68 100644 --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c @@ -418,9 +418,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm) static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); -int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; pr_debug("%s enter\n", __func__); diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index f1fd95b..c42fb73 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c @@ -257,9 +257,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm) static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); -int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; pr_debug("%s enter\n", __func__); diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index 07cfc7a..c95cc03 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c @@ -283,9 +283,11 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm) static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); -static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 98175a0..0fb6ebe 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -240,6 +240,7 @@ config SND_SOC_TWL4030 tristate config SND_SOC_TWL6040 + select TWL6040_CODEC tristate config SND_SOC_UDA134X diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 4c33663..dff5381 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -29,6 +29,7 @@ #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/i2c/twl.h> +#include <linux/mfd/twl6040-codec.h> #include <sound/core.h> #include <sound/pcm.h> @@ -77,14 +78,18 @@ struct twl6040_jack_data { /* codec private data */ struct twl6040_data { - int audpwron; - int naudint; int codec_powered; int pll; int non_lp; + int power_mode_forced; + int headset_mode; + unsigned int clk_in; unsigned int sysclk; + u16 hs_left_step; + u16 hs_right_step; + u16 hf_left_step; + u16 hf_right_step; struct snd_pcm_hw_constraint_list *sysclk_constraints; - struct completion ready; struct twl6040_jack_data hs_jack; struct snd_soc_codec *codec; struct workqueue_struct *workqueue; @@ -239,12 +244,13 @@ static inline void twl6040_write_reg_cache(struct snd_soc_codec *codec, static int twl6040_read_reg_volatile(struct snd_soc_codec *codec, unsigned int reg) { + struct twl6040 *twl6040 = codec->control_data; u8 value; if (reg >= TWL6040_CACHEREGNUM) return -EIO; - twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &value, reg); + value = twl6040_reg_read(twl6040, reg); twl6040_write_reg_cache(codec, reg, value); return value; @@ -256,11 +262,13 @@ static int twl6040_read_reg_volatile(struct snd_soc_codec *codec, static int twl6040_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { + struct twl6040 *twl6040 = codec->control_data; + if (reg >= TWL6040_CACHEREGNUM) return -EIO; twl6040_write_reg_cache(codec, reg, value); - return twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, value, reg); + return twl6040_reg_write(twl6040, reg, value); } static void twl6040_init_vio_regs(struct snd_soc_codec *codec) @@ -268,15 +276,21 @@ static void twl6040_init_vio_regs(struct snd_soc_codec *codec) u8 *cache = codec->reg_cache; int reg, i; - /* allow registers to be accessed by i2c */ - twl6040_write(codec, TWL6040_REG_ACCCTL, cache[TWL6040_REG_ACCCTL]); - for (i = 0; i < TWL6040_VIOREGNUM; i++) { reg = twl6040_vio_reg[i]; - /* skip read-only registers (ASICID, ASICREV, STATUS) */ + /* + * skip read-only registers (ASICID, ASICREV, STATUS) + * and registers shared among MFD children + */ switch (reg) { case TWL6040_REG_ASICID: case TWL6040_REG_ASICREV: + case TWL6040_REG_INTID: + case TWL6040_REG_INTMR: + case TWL6040_REG_NCPCTL: + case TWL6040_REG_LDOCTL: + case TWL6040_REG_GPOCTL: + case TWL6040_REG_ACCCTL: case TWL6040_REG_STATUS: continue; default: @@ -293,6 +307,19 @@ static void twl6040_init_vdd_regs(struct snd_soc_codec *codec) for (i = 0; i < TWL6040_VDDREGNUM; i++) { reg = twl6040_vdd_reg[i]; + /* skip vibra and pll registers */ + switch (reg) { + case TWL6040_REG_VIBCTLL: + case TWL6040_REG_VIBDATL: + case TWL6040_REG_VIBCTLR: + case TWL6040_REG_VIBDATR: + case TWL6040_REG_HPPLLCTL: + case TWL6040_REG_LPPLLCTL: + case TWL6040_REG_LPPLLDIV: + continue; + default: + break; + } twl6040_write(codec, reg, cache[reg]); } } @@ -317,7 +344,11 @@ static inline int twl6040_hs_ramp_step(struct snd_soc_codec *codec, if (headset->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < headset->left_vol) { - val += left_step; + if (val + left_step > headset->left_vol) + val = headset->left_vol; + else + val += left_step; + reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, (reg | (~val & TWL6040_HSL_VOL_MASK))); @@ -327,7 +358,11 @@ static inline int twl6040_hs_ramp_step(struct snd_soc_codec *codec, } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0x0) { - val -= left_step; + if ((int)val - (int)left_step < 0) + val = 0; + else + val -= left_step; + reg &= ~TWL6040_HSL_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val & TWL6040_HSL_VOL_MASK)); @@ -344,7 +379,11 @@ static inline int twl6040_hs_ramp_step(struct snd_soc_codec *codec, if (headset->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < headset->right_vol) { - val += right_step; + if (val + right_step > headset->right_vol) + val = headset->right_vol; + else + val += right_step; + reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, (reg | (~val << TWL6040_HSR_VOL_SHIFT))); @@ -354,7 +393,11 @@ static inline int twl6040_hs_ramp_step(struct snd_soc_codec *codec, } else if (headset->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0x0) { - val -= right_step; + if ((int)val - (int)right_step < 0) + val = 0; + else + val -= right_step; + reg &= ~TWL6040_HSR_VOL_MASK; twl6040_write(codec, TWL6040_REG_HSGAIN, reg | (~val << TWL6040_HSR_VOL_SHIFT)); @@ -385,7 +428,11 @@ static inline int twl6040_hf_ramp_step(struct snd_soc_codec *codec, if (handsfree->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < handsfree->left_vol) { - val += left_step; + if (val + left_step > handsfree->left_vol) + val = handsfree->left_vol; + else + val += left_step; + reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFLGAIN, reg | (0x1D - val)); @@ -395,7 +442,11 @@ static inline int twl6040_hf_ramp_step(struct snd_soc_codec *codec, } else if (handsfree->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0) { - val -= left_step; + if ((int)val - (int)left_step < 0) + val = 0; + else + val -= left_step; + reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFLGAIN, reg | (0x1D - val)); @@ -412,7 +463,11 @@ static inline int twl6040_hf_ramp_step(struct snd_soc_codec *codec, if (handsfree->ramp == TWL6040_RAMP_UP) { /* ramp step up */ if (val < handsfree->right_vol) { - val += right_step; + if (val + right_step > handsfree->right_vol) + val = handsfree->right_vol; + else + val += right_step; + reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFRGAIN, reg | (0x1D - val)); @@ -422,7 +477,11 @@ static inline int twl6040_hf_ramp_step(struct snd_soc_codec *codec, } else if (handsfree->ramp == TWL6040_RAMP_DOWN) { /* ramp step down */ if (val > 0) { - val -= right_step; + if ((int)val - (int)right_step < 0) + val = 0; + else + val -= right_step; + reg &= ~TWL6040_HF_VOL_MASK; twl6040_write(codec, TWL6040_REG_HFRGAIN, reg | (0x1D - val)); @@ -451,11 +510,9 @@ static void twl6040_pga_hs_work(struct work_struct *work) /* HS PGA volumes have 4 bits of resolution to ramp */ for (i = 0; i <= 16; i++) { - headset_complete = 1; - if (headset->ramp != TWL6040_RAMP_NONE) - headset_complete = twl6040_hs_ramp_step(codec, - headset->left_step, - headset->right_step); + headset_complete = twl6040_hs_ramp_step(codec, + headset->left_step, + headset->right_step); /* ramp finished ? */ if (headset_complete) @@ -496,11 +553,9 @@ static void twl6040_pga_hf_work(struct work_struct *work) /* HF PGA volumes have 5 bits of resolution to ramp */ for (i = 0; i <= 32; i++) { - handsfree_complete = 1; - if (handsfree->ramp != TWL6040_RAMP_NONE) - handsfree_complete = twl6040_hf_ramp_step(codec, - handsfree->left_step, - handsfree->right_step); + handsfree_complete = twl6040_hf_ramp_step(codec, + handsfree->left_step, + handsfree->right_step); /* ramp finished ? */ if (handsfree_complete) @@ -541,12 +596,16 @@ static int pga_event(struct snd_soc_dapm_widget *w, out = &priv->headset; work = &priv->hs_delayed_work; queue = priv->hs_workqueue; + out->left_step = priv->hs_left_step; + out->right_step = priv->hs_right_step; out->step_delay = 5; /* 5 ms between volume ramp steps */ break; case 4: out = &priv->handsfree; work = &priv->hf_delayed_work; queue = priv->hf_workqueue; + out->left_step = priv->hf_left_step; + out->right_step = priv->hf_right_step; out->step_delay = 5; /* 5 ms between volume ramp steps */ if (SND_SOC_DAPM_EVENT_ON(event)) priv->non_lp++; @@ -579,8 +638,6 @@ static int pga_event(struct snd_soc_dapm_widget *w, if (!delayed_work_pending(work)) { /* use volume ramp for power-down */ - out->left_step = 1; - out->right_step = 1; out->ramp = TWL6040_RAMP_DOWN; INIT_COMPLETION(out->ramp_done); @@ -596,88 +653,6 @@ static int pga_event(struct snd_soc_dapm_widget *w, return 0; } -/* twl6040 codec manual power-up sequence */ -static void twl6040_power_up(struct snd_soc_codec *codec) -{ - u8 ncpctl, ldoctl, lppllctl, accctl; - - ncpctl = twl6040_read_reg_cache(codec, TWL6040_REG_NCPCTL); - ldoctl = twl6040_read_reg_cache(codec, TWL6040_REG_LDOCTL); - lppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_LPPLLCTL); - accctl = twl6040_read_reg_cache(codec, TWL6040_REG_ACCCTL); - - /* enable reference system */ - ldoctl |= TWL6040_REFENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - msleep(10); - /* enable internal oscillator */ - ldoctl |= TWL6040_OSCENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(10); - /* enable high-side ldo */ - ldoctl |= TWL6040_HSLDOENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(244); - /* enable negative charge pump */ - ncpctl |= TWL6040_NCPENA | TWL6040_NCPOPEN; - twl6040_write(codec, TWL6040_REG_NCPCTL, ncpctl); - udelay(488); - /* enable low-side ldo */ - ldoctl |= TWL6040_LSLDOENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(244); - /* enable low-power pll */ - lppllctl |= TWL6040_LPLLENA; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - /* reset state machine */ - accctl |= TWL6040_RESETSPLIT; - twl6040_write(codec, TWL6040_REG_ACCCTL, accctl); - mdelay(5); - accctl &= ~TWL6040_RESETSPLIT; - twl6040_write(codec, TWL6040_REG_ACCCTL, accctl); - /* disable internal oscillator */ - ldoctl &= ~TWL6040_OSCENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); -} - -/* twl6040 codec manual power-down sequence */ -static void twl6040_power_down(struct snd_soc_codec *codec) -{ - u8 ncpctl, ldoctl, lppllctl, accctl; - - ncpctl = twl6040_read_reg_cache(codec, TWL6040_REG_NCPCTL); - ldoctl = twl6040_read_reg_cache(codec, TWL6040_REG_LDOCTL); - lppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_LPPLLCTL); - accctl = twl6040_read_reg_cache(codec, TWL6040_REG_ACCCTL); - - /* enable internal oscillator */ - ldoctl |= TWL6040_OSCENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(10); - /* disable low-power pll */ - lppllctl &= ~TWL6040_LPLLENA; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - /* disable low-side ldo */ - ldoctl &= ~TWL6040_LSLDOENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(244); - /* disable negative charge pump */ - ncpctl &= ~(TWL6040_NCPENA | TWL6040_NCPOPEN); - twl6040_write(codec, TWL6040_REG_NCPCTL, ncpctl); - udelay(488); - /* disable high-side ldo */ - ldoctl &= ~TWL6040_HSLDOENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - udelay(244); - /* disable internal oscillator */ - ldoctl &= ~TWL6040_OSCENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - /* disable reference system */ - ldoctl &= ~TWL6040_REFENA; - twl6040_write(codec, TWL6040_REG_LDOCTL, ldoctl); - msleep(10); -} - /* set headset dac and driver power mode */ static int headset_power_mode(struct snd_soc_codec *codec, int high_perf) { @@ -713,15 +688,26 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w, { struct snd_soc_codec *codec = w->codec; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); + int ret = 0; - if (SND_SOC_DAPM_EVENT_ON(event)) + if (SND_SOC_DAPM_EVENT_ON(event)) { priv->non_lp++; - else + if (!strcmp(w->name, "Earphone Driver")) { + /* Earphone doesn't support low power mode */ + priv->power_mode_forced = 1; + ret = headset_power_mode(codec, 1); + } + } else { priv->non_lp--; + if (!strcmp(w->name, "Earphone Driver")) { + priv->power_mode_forced = 0; + ret = headset_power_mode(codec, priv->headset_mode); + } + } msleep(1); - return 0; + return ret; } static void twl6040_hs_jack_report(struct snd_soc_codec *codec, @@ -766,32 +752,18 @@ static void twl6040_accessory_work(struct work_struct *work) } /* audio interrupt handler */ -static irqreturn_t twl6040_naudint_handler(int irq, void *data) +static irqreturn_t twl6040_audio_handler(int irq, void *data) { struct snd_soc_codec *codec = data; + struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); u8 intid; - twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &intid, TWL6040_REG_INTID); - - if (intid & TWL6040_THINT) - dev_alert(codec->dev, "die temp over-limit detection\n"); + intid = twl6040_reg_read(twl6040, TWL6040_REG_INTID); if ((intid & TWL6040_PLUGINT) || (intid & TWL6040_UNPLUGINT)) queue_delayed_work(priv->workqueue, &priv->delayed_work, - msecs_to_jiffies(200)); - - if (intid & TWL6040_HOOKINT) - dev_info(codec->dev, "hook detection\n"); - - if (intid & TWL6040_HFINT) - dev_alert(codec->dev, "hf drivers over current detection\n"); - - if (intid & TWL6040_VIBINT) - dev_alert(codec->dev, "vib drivers over current detection\n"); - - if (intid & TWL6040_READYINT) - complete(&priv->ready); + msecs_to_jiffies(200)); return IRQ_HANDLED; } @@ -954,9 +926,9 @@ static DECLARE_TLV_DB_SCALE(mic_preamp_tlv, -600, 600, 0); /* * MICGAIN volume control: - * from -6 to 30 dB in 6 dB steps + * from 6 to 30 dB in 6 dB steps */ -static DECLARE_TLV_DB_SCALE(mic_amp_tlv, -600, 600, 0); +static DECLARE_TLV_DB_SCALE(mic_amp_tlv, 600, 600, 0); /* * AFMGAIN volume control: @@ -1040,6 +1012,44 @@ static const struct snd_kcontrol_new hfr_mux_controls = static const struct snd_kcontrol_new ep_driver_switch_controls = SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0); +/* Headset power mode */ +static const char *twl6040_headset_power_texts[] = { + "Low-Power", "High-Perfomance", +}; + +static const struct soc_enum twl6040_headset_power_enum = + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(twl6040_headset_power_texts), + twl6040_headset_power_texts); + +static int twl6040_headset_power_get_enum(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); + + ucontrol->value.enumerated.item[0] = priv->headset_mode; + + return 0; +} + +static int twl6040_headset_power_put_enum(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); + int high_perf = ucontrol->value.enumerated.item[0]; + int ret; + + if (priv->power_mode_forced) + return -EPERM; + + ret = headset_power_mode(codec, high_perf); + if (!ret) + priv->headset_mode = high_perf; + + return ret; +} + static const struct snd_kcontrol_new twl6040_snd_controls[] = { /* Capture gains */ SOC_DOUBLE_TLV("Capture Preamplifier Volume", @@ -1058,6 +1068,10 @@ static const struct snd_kcontrol_new twl6040_snd_controls[] = { TWL6040_REG_HFLGAIN, TWL6040_REG_HFRGAIN, 0, 0x1D, 1, hf_tlv), SOC_SINGLE_TLV("Earphone Playback Volume", TWL6040_REG_EARCTL, 1, 0xF, 1, ep_tlv), + + SOC_ENUM_EXT("Headset Power Mode", twl6040_headset_power_enum, + twl6040_headset_power_get_enum, + twl6040_headset_power_put_enum), }; static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = { @@ -1231,37 +1245,11 @@ static int twl6040_add_widgets(struct snd_soc_codec *codec) return 0; } -static int twl6040_power_up_completion(struct snd_soc_codec *codec, - int naudint) -{ - struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - int time_left; - u8 intid; - - time_left = wait_for_completion_timeout(&priv->ready, - msecs_to_jiffies(144)); - - if (!time_left) { - twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &intid, - TWL6040_REG_INTID); - if (!(intid & TWL6040_READYINT)) { - dev_err(codec->dev, "timeout waiting for READYINT\n"); - return -ETIMEDOUT; - } - } - - priv->codec_powered = 1; - - return 0; -} - static int twl6040_set_bias_level(struct snd_soc_codec *codec, enum snd_soc_bias_level level) { + struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - int audpwron = priv->audpwron; - int naudint = priv->naudint; - int ret; switch (level) { case SND_SOC_BIAS_ON: @@ -1272,24 +1260,8 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec, if (priv->codec_powered) break; - if (gpio_is_valid(audpwron)) { - /* use AUDPWRON line */ - gpio_set_value(audpwron, 1); - - /* wait for power-up completion */ - ret = twl6040_power_up_completion(codec, naudint); - if (ret) - return ret; - - /* sync registers updated during power-up sequence */ - twl6040_read_reg_volatile(codec, TWL6040_REG_NCPCTL); - twl6040_read_reg_volatile(codec, TWL6040_REG_LDOCTL); - twl6040_read_reg_volatile(codec, TWL6040_REG_LPPLLCTL); - } else { - /* use manual power-up sequence */ - twl6040_power_up(codec); - priv->codec_powered = 1; - } + twl6040_enable(twl6040); + priv->codec_powered = 1; /* initialize vdd/vss registers with reg_cache */ twl6040_init_vdd_regs(codec); @@ -1307,28 +1279,15 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec, if (!priv->codec_powered) break; - if (gpio_is_valid(audpwron)) { - /* use AUDPWRON line */ - gpio_set_value(audpwron, 0); - - /* power-down sequence latency */ - udelay(500); - - /* sync registers updated during power-down sequence */ - twl6040_read_reg_volatile(codec, TWL6040_REG_NCPCTL); - twl6040_read_reg_volatile(codec, TWL6040_REG_LDOCTL); - twl6040_write_reg_cache(codec, TWL6040_REG_LPPLLCTL, - 0x00); - } else { - /* use manual power-down sequence */ - twl6040_power_down(codec); - } - + twl6040_disable(twl6040); priv->codec_powered = 0; break; } codec->dapm.bias_level = level; + /* get pll and sysclk after power transition */ + priv->pll = twl6040_get_pll(twl6040); + priv->sysclk = twl6040_get_sysclk(twl6040); return 0; } @@ -1336,6 +1295,13 @@ static int twl6040_set_bias_level(struct snd_soc_codec *codec, /* set of rates for each pll: low-power and high-performance */ static unsigned int lp_rates[] = { + 8000, + 11250, + 16000, + 22500, + 32000, + 44100, + 48000, 88200, 96000, }; @@ -1346,6 +1312,10 @@ static struct snd_pcm_hw_constraint_list lp_constraints = { }; static unsigned int hp_rates[] = { + 8000, + 16000, + 32000, + 48000, 96000, }; @@ -1374,41 +1344,36 @@ static int twl6040_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_codec *codec = rtd->codec; + struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - u8 lppllctl; + unsigned int sysclk; int rate; /* nothing to do for high-perf pll, it supports only 48 kHz */ if (priv->pll == TWL6040_HPPLL_ID) return 0; - lppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_LPPLLCTL); - rate = params_rate(params); switch (rate) { case 11250: case 22500: case 44100: case 88200: - lppllctl |= TWL6040_LPLLFIN; - priv->sysclk = 17640000; + sysclk = 17640000; break; case 8000: case 16000: case 32000: case 48000: case 96000: - lppllctl &= ~TWL6040_LPLLFIN; - priv->sysclk = 19200000; + sysclk = 19200000; break; default: dev_err(codec->dev, "unsupported rate %d\n", rate); return -EINVAL; } - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - - return 0; + return twl6040_set_pll(twl6040, TWL6040_LPPLL_ID, priv->clk_in, sysclk); } static int twl6040_prepare(struct snd_pcm_substream *substream, @@ -1449,99 +1414,25 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, unsigned int freq, int dir) { struct snd_soc_codec *codec = codec_dai->codec; + struct twl6040 *twl6040 = codec->control_data; struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - u8 hppllctl, lppllctl; - - hppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_HPPLLCTL); - lppllctl = twl6040_read_reg_cache(codec, TWL6040_REG_LPPLLCTL); + int ret; switch (clk_id) { case TWL6040_SYSCLK_SEL_LPPLL: - switch (freq) { - case 32768: - /* headset dac and driver must be in low-power mode */ - headset_power_mode(codec, 0); - - /* clk32k input requires low-power pll */ - lppllctl |= TWL6040_LPLLENA; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - mdelay(5); - lppllctl &= ~TWL6040_HPLLSEL; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - hppllctl &= ~TWL6040_HPLLENA; - twl6040_write(codec, TWL6040_REG_HPPLLCTL, hppllctl); - break; - default: - dev_err(codec->dev, "unknown mclk freq %d\n", freq); - return -EINVAL; - } - - /* lppll divider */ - switch (priv->sysclk) { - case 17640000: - lppllctl |= TWL6040_LPLLFIN; - break; - case 19200000: - lppllctl &= ~TWL6040_LPLLFIN; - break; - default: - /* sysclk not yet configured */ - lppllctl &= ~TWL6040_LPLLFIN; - priv->sysclk = 19200000; - break; - } - - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); + ret = twl6040_set_pll(twl6040, TWL6040_LPPLL_ID, + freq, priv->sysclk); + if (ret) + return ret; - priv->pll = TWL6040_LPPLL_ID; priv->sysclk_constraints = &lp_constraints; break; case TWL6040_SYSCLK_SEL_HPPLL: - hppllctl &= ~TWL6040_MCLK_MSK; - - switch (freq) { - case 12000000: - /* mclk input, pll enabled */ - hppllctl |= TWL6040_MCLK_12000KHZ | - TWL6040_HPLLSQRBP | - TWL6040_HPLLENA; - break; - case 19200000: - /* mclk input, pll disabled */ - hppllctl |= TWL6040_MCLK_19200KHZ | - TWL6040_HPLLSQRENA | - TWL6040_HPLLBP; - break; - case 26000000: - /* mclk input, pll enabled */ - hppllctl |= TWL6040_MCLK_26000KHZ | - TWL6040_HPLLSQRBP | - TWL6040_HPLLENA; - break; - case 38400000: - /* clk slicer, pll disabled */ - hppllctl |= TWL6040_MCLK_38400KHZ | - TWL6040_HPLLSQRENA | - TWL6040_HPLLBP; - break; - default: - dev_err(codec->dev, "unknown mclk freq %d\n", freq); - return -EINVAL; - } - - /* headset dac and driver must be in high-performance mode */ - headset_power_mode(codec, 1); - - twl6040_write(codec, TWL6040_REG_HPPLLCTL, hppllctl); - udelay(500); - lppllctl |= TWL6040_HPLLSEL; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); - lppllctl &= ~TWL6040_LPLLENA; - twl6040_write(codec, TWL6040_REG_LPPLLCTL, lppllctl); + ret = twl6040_set_pll(twl6040, TWL6040_HPPLL_ID, freq, + priv->sysclk); + if (ret) + return ret; - /* high-performance pll can provide only 19.2 MHz */ - priv->pll = TWL6040_HPPLL_ID; - priv->sysclk = 19200000; priv->sysclk_constraints = &hp_constraints; break; default: @@ -1549,6 +1440,10 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai, return -EINVAL; } + priv->pll = twl6040_get_pll(twl6040); + priv->clk_in = freq; + priv->sysclk = twl6040_get_sysclk(twl6040); + return 0; } @@ -1559,23 +1454,51 @@ static struct snd_soc_dai_ops twl6040_dai_ops = { .set_sysclk = twl6040_set_dai_sysclk, }; -static struct snd_soc_dai_driver twl6040_dai = { - .name = "twl6040-hifi", +static struct snd_soc_dai_driver twl6040_dai[] = { +{ + .name = "twl6040-ul", + .capture = { + .stream_name = "Capture", + .channels_min = 1, + .channels_max = 2, + .rates = TWL6040_RATES, + .formats = TWL6040_FORMATS, + }, + .ops = &twl6040_dai_ops, +}, +{ + .name = "twl6040-dl1", .playback = { - .stream_name = "Playback", + .stream_name = "Headset Playback", .channels_min = 1, - .channels_max = 4, + .channels_max = 2, .rates = TWL6040_RATES, .formats = TWL6040_FORMATS, }, - .capture = { - .stream_name = "Capture", + .ops = &twl6040_dai_ops, +}, +{ + .name = "twl6040-dl2", + .playback = { + .stream_name = "Handsfree Playback", .channels_min = 1, .channels_max = 2, .rates = TWL6040_RATES, .formats = TWL6040_FORMATS, }, .ops = &twl6040_dai_ops, +}, +{ + .name = "twl6040-vib", + .playback = { + .stream_name = "Vibra Playback", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = TWL6040_FORMATS, + }, + .ops = &twl6040_dai_ops, +}, }; #ifdef CONFIG_PM @@ -1600,11 +1523,9 @@ static int twl6040_resume(struct snd_soc_codec *codec) static int twl6040_probe(struct snd_soc_codec *codec) { - struct twl4030_codec_data *twl_codec = codec->dev->platform_data; struct twl6040_data *priv; - int audpwron, naudint; + struct twl4030_codec_audio_data *pdata = dev_get_platdata(codec->dev); int ret = 0; - u8 icrev, intmr = TWL6040_ALLINT_MSK; priv = kzalloc(sizeof(struct twl6040_data), GFP_KERNEL); if (priv == NULL) @@ -1612,21 +1533,27 @@ static int twl6040_probe(struct snd_soc_codec *codec) snd_soc_codec_set_drvdata(codec, priv); priv->codec = codec; + codec->control_data = dev_get_drvdata(codec->dev->parent); - twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &icrev, TWL6040_REG_ASICREV); - - if (twl_codec && (icrev > 0)) - audpwron = twl_codec->audpwron_gpio; - else - audpwron = -EINVAL; + if (pdata && pdata->hs_left_step && pdata->hs_right_step) { + priv->hs_left_step = pdata->hs_left_step; + priv->hs_right_step = pdata->hs_right_step; + } else { + priv->hs_left_step = 1; + priv->hs_right_step = 1; + } - if (twl_codec) - naudint = twl_codec->naudint_irq; - else - naudint = 0; + if (pdata && pdata->hf_left_step && pdata->hf_right_step) { + priv->hf_left_step = pdata->hf_left_step; + priv->hf_right_step = pdata->hf_right_step; + } else { + priv->hf_left_step = 1; + priv->hf_right_step = 1; + } - priv->audpwron = audpwron; - priv->naudint = naudint; + /* default is high-performance mode */ + priv->headset_mode = 1; + priv->sysclk_constraints = &hp_constraints; priv->workqueue = create_singlethread_workqueue("twl6040-codec"); if (!priv->workqueue) { @@ -1638,56 +1565,34 @@ static int twl6040_probe(struct snd_soc_codec *codec) mutex_init(&priv->mutex); - init_completion(&priv->ready); init_completion(&priv->headset.ramp_done); init_completion(&priv->handsfree.ramp_done); - if (gpio_is_valid(audpwron)) { - ret = gpio_request(audpwron, "audpwron"); - if (ret) - goto gpio1_err; - - ret = gpio_direction_output(audpwron, 0); - if (ret) - goto gpio2_err; - - priv->codec_powered = 0; - - /* enable only codec ready interrupt */ - intmr &= ~(TWL6040_READYMSK | TWL6040_PLUGMSK); - - /* reset interrupt status to allow correct power up sequence */ - twl6040_read_reg_volatile(codec, TWL6040_REG_INTID); - } - twl6040_write(codec, TWL6040_REG_INTMR, intmr); - - if (naudint) { - /* audio interrupt */ - ret = request_threaded_irq(naudint, NULL, - twl6040_naudint_handler, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, - "twl6040_codec", codec); - if (ret) - goto gpio2_err; - } - - /* init vio registers */ - twl6040_init_vio_regs(codec); - priv->hf_workqueue = create_singlethread_workqueue("twl6040-hf"); if (priv->hf_workqueue == NULL) { ret = -ENOMEM; - goto irq_err; + goto hfwork_err; } priv->hs_workqueue = create_singlethread_workqueue("twl6040-hs"); if (priv->hs_workqueue == NULL) { ret = -ENOMEM; - goto wq_err; + goto hswork_err; } INIT_DELAYED_WORK(&priv->hs_delayed_work, twl6040_pga_hs_work); INIT_DELAYED_WORK(&priv->hf_delayed_work, twl6040_pga_hf_work); + ret = twl6040_request_irq(codec->control_data, TWL6040_IRQ_PLUG, + twl6040_audio_handler, "twl6040_irq_plug", + codec); + if (ret) { + dev_err(codec->dev, "PLUG IRQ request failed: %d\n", ret); + goto irq_err; + } + + /* init vio registers */ + twl6040_init_vio_regs(codec); + /* power on device */ ret = twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); if (ret) @@ -1700,16 +1605,12 @@ static int twl6040_probe(struct snd_soc_codec *codec) return 0; bias_err: + twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); +irq_err: destroy_workqueue(priv->hs_workqueue); -wq_err: +hswork_err: destroy_workqueue(priv->hf_workqueue); -irq_err: - if (naudint) - free_irq(naudint, codec); -gpio2_err: - if (gpio_is_valid(audpwron)) - gpio_free(audpwron); -gpio1_err: +hfwork_err: destroy_workqueue(priv->workqueue); work_err: kfree(priv); @@ -1719,17 +1620,9 @@ work_err: static int twl6040_remove(struct snd_soc_codec *codec) { struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); - int audpwron = priv->audpwron; - int naudint = priv->naudint; twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); - - if (gpio_is_valid(audpwron)) - gpio_free(audpwron); - - if (naudint) - free_irq(naudint, codec); - + twl6040_free_irq(codec->control_data, TWL6040_IRQ_PLUG, codec); destroy_workqueue(priv->workqueue); destroy_workqueue(priv->hf_workqueue); destroy_workqueue(priv->hs_workqueue); @@ -1754,7 +1647,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { static int __devinit twl6040_codec_probe(struct platform_device *pdev) { return snd_soc_register_codec(&pdev->dev, - &soc_codec_dev_twl6040, &twl6040_dai, 1); + &soc_codec_dev_twl6040, twl6040_dai, ARRAY_SIZE(twl6040_dai)); } static int __devexit twl6040_codec_remove(struct platform_device *pdev) diff --git a/sound/soc/codecs/twl6040.h b/sound/soc/codecs/twl6040.h index 23aeed0..105a6fd 100644 --- a/sound/soc/codecs/twl6040.h +++ b/sound/soc/codecs/twl6040.h @@ -22,123 +22,7 @@ #ifndef __TWL6040_H__ #define __TWL6040_H__ -#define TWL6040_REG_ASICID 0x01 -#define TWL6040_REG_ASICREV 0x02 -#define TWL6040_REG_INTID 0x03 -#define TWL6040_REG_INTMR 0x04 -#define TWL6040_REG_NCPCTL 0x05 -#define TWL6040_REG_LDOCTL 0x06 -#define TWL6040_REG_HPPLLCTL 0x07 -#define TWL6040_REG_LPPLLCTL 0x08 -#define TWL6040_REG_LPPLLDIV 0x09 -#define TWL6040_REG_AMICBCTL 0x0A -#define TWL6040_REG_DMICBCTL 0x0B -#define TWL6040_REG_MICLCTL 0x0C -#define TWL6040_REG_MICRCTL 0x0D -#define TWL6040_REG_MICGAIN 0x0E -#define TWL6040_REG_LINEGAIN 0x0F -#define TWL6040_REG_HSLCTL 0x10 -#define TWL6040_REG_HSRCTL 0x11 -#define TWL6040_REG_HSGAIN 0x12 -#define TWL6040_REG_EARCTL 0x13 -#define TWL6040_REG_HFLCTL 0x14 -#define TWL6040_REG_HFLGAIN 0x15 -#define TWL6040_REG_HFRCTL 0x16 -#define TWL6040_REG_HFRGAIN 0x17 -#define TWL6040_REG_VIBCTLL 0x18 -#define TWL6040_REG_VIBDATL 0x19 -#define TWL6040_REG_VIBCTLR 0x1A -#define TWL6040_REG_VIBDATR 0x1B -#define TWL6040_REG_HKCTL1 0x1C -#define TWL6040_REG_HKCTL2 0x1D -#define TWL6040_REG_GPOCTL 0x1E -#define TWL6040_REG_ALB 0x1F -#define TWL6040_REG_DLB 0x20 -#define TWL6040_REG_TRIM1 0x28 -#define TWL6040_REG_TRIM2 0x29 -#define TWL6040_REG_TRIM3 0x2A -#define TWL6040_REG_HSOTRIM 0x2B -#define TWL6040_REG_HFOTRIM 0x2C -#define TWL6040_REG_ACCCTL 0x2D -#define TWL6040_REG_STATUS 0x2E - -#define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1) - -#define TWL6040_VIOREGNUM 18 -#define TWL6040_VDDREGNUM 21 - -/* INTID (0x03) fields */ - -#define TWL6040_THINT 0x01 -#define TWL6040_PLUGINT 0x02 -#define TWL6040_UNPLUGINT 0x04 -#define TWL6040_HOOKINT 0x08 -#define TWL6040_HFINT 0x10 -#define TWL6040_VIBINT 0x20 -#define TWL6040_READYINT 0x40 - -/* INTMR (0x04) fields */ - -#define TWL6040_PLUGMSK 0x02 -#define TWL6040_READYMSK 0x40 -#define TWL6040_ALLINT_MSK 0x7B - -/* NCPCTL (0x05) fields */ - -#define TWL6040_NCPENA 0x01 -#define TWL6040_NCPOPEN 0x40 - -/* LDOCTL (0x06) fields */ - -#define TWL6040_LSLDOENA 0x01 -#define TWL6040_HSLDOENA 0x04 -#define TWL6040_REFENA 0x40 -#define TWL6040_OSCENA 0x80 - -/* HPPLLCTL (0x07) fields */ - -#define TWL6040_HPLLENA 0x01 -#define TWL6040_HPLLRST 0x02 -#define TWL6040_HPLLBP 0x04 -#define TWL6040_HPLLSQRENA 0x08 -#define TWL6040_HPLLSQRBP 0x10 -#define TWL6040_MCLK_12000KHZ (0 << 5) -#define TWL6040_MCLK_19200KHZ (1 << 5) -#define TWL6040_MCLK_26000KHZ (2 << 5) -#define TWL6040_MCLK_38400KHZ (3 << 5) -#define TWL6040_MCLK_MSK 0x60 - -/* LPPLLCTL (0x08) fields */ - -#define TWL6040_LPLLENA 0x01 -#define TWL6040_LPLLRST 0x02 -#define TWL6040_LPLLSEL 0x04 -#define TWL6040_LPLLFIN 0x08 -#define TWL6040_HPLLSEL 0x10 - -/* HSLCTL (0x10) fields */ - -#define TWL6040_HSDACMODEL 0x02 -#define TWL6040_HSDRVMODEL 0x08 - -/* HSRCTL (0x11) fields */ - -#define TWL6040_HSDACMODER 0x02 -#define TWL6040_HSDRVMODER 0x08 - -/* ACCCTL (0x2D) fields */ - -#define TWL6040_RESETSPLIT 0x04 - -#define TWL6040_SYSCLK_SEL_LPPLL 1 -#define TWL6040_SYSCLK_SEL_HPPLL 2 - -#define TWL6040_HPPLL_ID 1 -#define TWL6040_LPPLL_ID 2 - -/* STATUS (0x2E) fields */ - -#define TWL6040_PLUGCOMP 0x02 +#include <linux/mfd/twl6040-codec.h> void twl6040_hs_jack_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, int report); diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 9d35b8c..29759e1 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -811,9 +811,11 @@ static void davinci_pcm_free(struct snd_pcm *pcm) static u64 davinci_pcm_dmamask = 0xffffffff; -static int davinci_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret; if (!card->dev->dma_mask) diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index a456e49..e27c417 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c @@ -266,9 +266,11 @@ static void ep93xx_pcm_free_dma_buffers(struct snd_pcm *pcm) static u64 ep93xx_pcm_dmamask = 0xffffffff; -static int ep93xx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int ep93xx_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 6680c0b..5312d1b 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -294,9 +294,11 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id) * Regardless of where the memory is actually allocated, since the device can * technically DMA to any 36-bit address, we do need to set the DMA mask to 36. */ -static int fsl_dma_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; static u64 fsl_dma_dmamask = DMA_BIT_MASK(36); int ret; diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index fff695c..19ad0c1 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -299,10 +299,11 @@ static struct snd_pcm_ops psc_dma_ops = { }; static u64 psc_dma_dmamask = 0xffffffff; -static int psc_dma_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_pcm_runtime *rtd = pcm->private_data; + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(rtd->cpu_dai); size_t size = psc_dma_hardware.buffer_bytes_max; int rc = 0; diff --git a/sound/soc/imx/imx-pcm-fiq.c b/sound/soc/imx/imx-pcm-fiq.c index 413b78d..309c59e 100644 --- a/sound/soc/imx/imx-pcm-fiq.c +++ b/sound/soc/imx/imx-pcm-fiq.c @@ -238,12 +238,14 @@ static struct snd_pcm_ops imx_pcm_ops = { static int ssi_irq = 0; -static int imx_pcm_fiq_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int imx_pcm_fiq_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret; - ret = imx_pcm_new(card, dai, pcm); + ret = imx_pcm_new(rtd); if (ret) return ret; diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index 61fceb0..10a8e27 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c @@ -388,10 +388,11 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) static u64 imx_pcm_dmamask = DMA_BIT_MASK(32); -int imx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +int imx_pcm_new(struct snd_soc_pcm_runtime *rtd) { - + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/imx/imx-ssi.h b/sound/soc/imx/imx-ssi.h index dc8a875..0a84cec 100644 --- a/sound/soc/imx/imx-ssi.h +++ b/sound/soc/imx/imx-ssi.h @@ -225,8 +225,7 @@ struct snd_soc_platform *imx_ssi_dma_mx2_init(struct platform_device *pdev, struct imx_ssi *ssi); int snd_imx_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma); -int imx_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm); +int imx_pcm_new(struct snd_soc_pcm_runtime *rtd); void imx_pcm_free(struct snd_pcm *pcm); /* diff --git a/sound/soc/jz4740/jz4740-pcm.c b/sound/soc/jz4740/jz4740-pcm.c index fb1483f..a7c9578 100644 --- a/sound/soc/jz4740/jz4740-pcm.c +++ b/sound/soc/jz4740/jz4740-pcm.c @@ -299,9 +299,11 @@ static void jz4740_pcm_free(struct snd_pcm *pcm) static u64 jz4740_pcm_dmamask = DMA_BIT_MASK(32); -int jz4740_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index e13c6ce..cd33de1 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -312,9 +312,11 @@ static int kirkwood_dma_preallocate_dma_buffer(struct snd_pcm *pcm, return 0; } -static int kirkwood_dma_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret; if (!card->dev->dma_mask) diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 8263f56..d589ef1 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c @@ -315,9 +315,12 @@ static void nuc900_dma_free_dma_buffers(struct snd_pcm *pcm) } static u64 nuc900_pcm_dmamask = DMA_BIT_MASK(32); -static int nuc900_dma_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; + if (!card->dev->dma_mask) card->dev->dma_mask = &nuc900_pcm_dmamask; if (!card->dev->coherent_dma_mask) diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index 99054cf..6d2152a 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig @@ -2,6 +2,10 @@ config SND_OMAP_SOC tristate "SoC Audio for the Texas Instruments OMAP chips" depends on ARCH_OMAP +config SND_OMAP_SOC_ABE_DSP + tristate + select SND_DYNAMIC_MINORS + config SND_OMAP_SOC_MCBSP tristate select OMAP_MCBSP @@ -9,6 +13,9 @@ config SND_OMAP_SOC_MCBSP config SND_OMAP_SOC_MCPDM tristate +config SND_OMAP_SOC_ABE + tristate + config SND_OMAP_SOC_N810 tristate "SoC Audio support for Nokia N810" depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C @@ -92,13 +99,18 @@ config SND_OMAP_SOC_SDP3430 SDP3430. config SND_OMAP_SOC_SDP4430 - tristate "SoC Audio support for Texas Instruments SDP4430" - depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_4430SDP + tristate "SoC Audio support for Texas Instruments SDP4430 or PandaBoard" + depends on TWL4030_CORE && (MACH_OMAP_4430SDP || MACH_OMAP4_PANDA) select SND_OMAP_SOC_MCPDM select SND_SOC_TWL6040 + select SND_OMAP_SOC_ABE + select SND_OMAP_SOC_MCBSP + select SND_SOC_DMIC + select SND_OMAP_SOC_DMIC + select SND_OMAP_SOC_ABE_DSP help Say Y if you want to add support for SoC audio on Texas Instruments - SDP4430. + SDP4430 or PandaBoard. config SND_OMAP_SOC_OMAP3_PANDORA tristate "SoC Audio support for OMAP3 Pandora" diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile index 6c2c87e..0d90f64 100644 --- a/sound/soc/omap/Makefile +++ b/sound/soc/omap/Makefile @@ -1,11 +1,15 @@ # OMAP Platform Support snd-soc-omap-objs := omap-pcm.o snd-soc-omap-mcbsp-objs := omap-mcbsp.o -snd-soc-omap-mcpdm-objs := omap-mcpdm.o mcpdm.o +snd-soc-omap-mcpdm-objs := omap-mcpdm.o +snd-soc-omap-abe-objs := omap-abe.o +snd-soc-omap-abe-dsp-objs := omap-abe-dsp.o obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o +obj-$(CONFIG_SND_OMAP_SOC_ABE) += snd-soc-omap-abe.o +obj-$(CONFIG_SND_OMAP_SOC_ABE_DSP) += snd-soc-omap-abe-dsp.o abe/ # OMAP Machine Support snd-soc-n810-objs := n810.o diff --git a/sound/soc/omap/abe/Makefile b/sound/soc/omap/abe/Makefile new file mode 100644 index 0000000..0d5649b --- /dev/null +++ b/sound/soc/omap/abe/Makefile @@ -0,0 +1,14 @@ +snd-soc-abe-hal-objs += abe_main.o \ + abe_core.o \ + abe_gain.o \ + abe_port.o \ + abe_aess.o \ + abe_dbg.o \ + abe_dat.o \ + abe_ini.o \ + abe_irq.o \ + abe_seq.o \ + abe_asrc.o \ + port_mgr.o \ + +obj-$(CONFIG_SND_OMAP_SOC_ABE_DSP) += snd-soc-abe-hal.o diff --git a/sound/soc/omap/abe/abe.h b/sound/soc/omap/abe/abe.h new file mode 100644 index 0000000..c465764 --- /dev/null +++ b/sound/soc/omap/abe/abe.h @@ -0,0 +1,159 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_H_ +#define _ABE_H_ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> +#include <linux/io.h> + +#include "abe_def.h" +#include "abe_define.h" +#include "abe_fw.h" +#include "abe_ext.h" +#include "abe_dbg.h" + +/* + * BASIC TYPES + */ +#define MAX_UINT8 ((((1L << 7) - 1) << 1) + 1) +#define MAX_UINT16 ((((1L << 15) - 1) << 1) + 1) +#define MAX_UINT32 ((((1L << 31) - 1) << 1) + 1) + +#define s8 char +#define u8 unsigned char +#define s16 short +#define u16 unsigned short +#define s32 int +#define u32 unsigned int + +struct omap_abe_equ { + /* type of filter */ + u32 equ_type; + /* filter length */ + u32 equ_length; + union { + /* parameters are the direct and recursive coefficients in */ + /* Q6.26 integer fixed-point format. */ + s32 type1[NBEQ1]; + struct { + /* center frequency of the band [Hz] */ + s32 freq[NBEQ2]; + /* gain of each band. [dB] */ + s32 gain[NBEQ2]; + /* Q factor of this band [dB] */ + s32 q[NBEQ2]; + } type2; + } coef; + s32 equ_param3; +}; + +struct omap_abe { + void __iomem *io_base[5]; + u32 firmware_version_number; + u16 MultiFrame[PROCESSING_SLOTS][TASKS_IN_SLOT]; + u32 compensated_mixer_gain; + u8 muted_gains_indicator[MAX_NBGAIN_CMEM]; + u32 desired_gains_decibel[MAX_NBGAIN_CMEM]; + u32 muted_gains_decibel[MAX_NBGAIN_CMEM]; + u32 desired_gains_linear[MAX_NBGAIN_CMEM]; + u32 desired_ramp_delay_ms[MAX_NBGAIN_CMEM]; + struct mutex mutex; + u32 warm_boot; + + u32 irq_dbg_read_ptr; + + struct omap_abe_dbg dbg; +}; + +extern struct omap_abe *abe; + +void omap_abe_dbg_log(struct omap_abe *abe, u32 x, u32 y, u32 z, u32 t); +void omap_abe_dbg_error(struct omap_abe *abe, int level, int error); +int omap_abe_set_opp_processing(struct omap_abe *abe, u32 opp); +int omap_abe_connect_debug_trace(struct omap_abe *abe, + struct omap_abe_dma *dma2); + +int omap_abe_use_compensated_gain(struct omap_abe *abe, int on_off); +int omap_abe_write_equalizer(struct omap_abe *abe, + u32 id, struct omap_abe_equ *param); + +int omap_abe_disable_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_enable_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_mute_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_unmute_gain(struct omap_abe *abe, u32 id, u32 p); + +int omap_abe_write_gain(struct omap_abe *abe, + u32 id, s32 f_g, u32 ramp, u32 p); +int omap_abe_write_mixer(struct omap_abe *abe, + u32 id, s32 f_g, u32 f_ramp, u32 p); +int omap_abe_read_gain(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p); +int omap_abe_read_mixer(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p); + +/* + * MACROS + */ +#define _log(x, y, z, t) { if (x & abe->dbg.mask) omap_abe_dbg_log(abe, x, y, z, t); } + +#endif/* _ABE_H_ */ diff --git a/sound/soc/omap/abe/abe_aess.c b/sound/soc/omap/abe/abe_aess.c new file mode 100644 index 0000000..eb35b58 --- /dev/null +++ b/sound/soc/omap/abe/abe_aess.c @@ -0,0 +1,191 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dbg.h" +#include "abe.h" +#include "abe_mem.h" +#include "abe_aess.h" + +/** + * omap_abe_hw_configuration + * + */ +void omap_abe_hw_configuration(struct omap_abe *abe) +{ + /* enables the DMAreq from AESS AESS_DMAENABLE_SET = 255 */ + omap_abe_reg_writel(abe, AESS_DMAENABLE_SET, DMA_ENABLE_ALL); + /* enables the MCU IRQ from AESS to Cortex A9 */ + omap_abe_reg_writel(abe, AESS_MCU_IRQENABLE_SET, INT_SET); +} + +/** + * omap_abe_clear_irq - clear ABE interrupt + * @abe: Pointer on abe handle + * + * This subroutine is call to clear MCU Irq + */ +int omap_abe_clear_irq(struct omap_abe *abe) +{ + omap_abe_reg_writel(abe, ABE_MCU_IRQSTATUS, INT_CLR); + return 0; +} +EXPORT_SYMBOL(omap_abe_clear_irq); + +/** + * abe_write_event_generator - Selects event generator source + * @abe: Pointer on abe handle + * @e: Event Generation Counter, McPDM, DMIC or default. + * + * Loads the AESS event generator hardware source. + * Loads the firmware parameters accordingly. + * Indicates to the FW which data stream is the most important to preserve + * in case all the streams are asynchronous. + * If the parameter is "default", then HAL decides which Event source + * is the best appropriate based on the opened ports. + * + * When neither the DMIC and the McPDM are activated, the AE will have + * its EVENT generator programmed with the EVENT_COUNTER. + * The event counter will be tuned in order to deliver a pulse frequency higher + * than 96 kHz. + * The DPLL output at 100% OPP is MCLK = (32768kHz x6000) = 196.608kHz + * The ratio is (MCLK/96000)+(1<<1) = 2050 + * (1<<1) in order to have the same speed at 50% and 100% OPP + * (only 15 MSB bits are used at OPP50%) + */ +int omap_abe_write_event_generator(struct omap_abe *abe, u32 e) +{ + u32 event, selection; + u32 counter = EVENT_GENERATOR_COUNTER_DEFAULT; + + _log(ABE_ID_WRITE_EVENT_GENERATOR, e, 0, 0); + + switch (e) { + case EVENT_TIMER: + selection = EVENT_SOURCE_COUNTER; + event = 0; + break; + case EVENT_44100: + selection = EVENT_SOURCE_COUNTER; + event = 0; + counter = EVENT_GENERATOR_COUNTER_44100; + break; + default: + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, ABE_BLOCK_COPY_ERR); + } + omap_abe_reg_writel(abe, EVENT_GENERATOR_COUNTER, counter); + omap_abe_reg_writel(abe, EVENT_SOURCE_SELECTION, selection); + omap_abe_reg_writel(abe, EVENT_GENERATOR_START, EVENT_GENERATOR_ON); + omap_abe_reg_writel(abe, AUDIO_ENGINE_SCHEDULER, event); + return 0; +} +EXPORT_SYMBOL(omap_abe_write_event_generator); + +/** + * omap_abe_start_event_generator - Starts event generator source + * @abe: Pointer on abe handle + * + * Start the event genrator of AESS. No more event will be send to AESS engine. + * Upper layer must wait 1/96kHz to be sure that engine reaches + * the IDLE instruction. + */ +int omap_abe_start_event_generator(struct omap_abe *abe) +{ + /* Start the event Generator */ + omap_abe_reg_writel(abe, EVENT_GENERATOR_START, 1); + return 0; +} +EXPORT_SYMBOL(omap_abe_start_event_generator); + +/** + * omap_abe_stop_event_generator - Stops event generator source + * @abe: Pointer on abe handle + * + * Stop the event genrator of AESS. No more event will be send to AESS engine. + * Upper layer must wait 1/96kHz to be sure that engine reaches + * the IDLE instruction. + */ +int omap_abe_stop_event_generator(struct omap_abe *abe) +{ + /* Stop the event Generator */ + omap_abe_reg_writel(abe, EVENT_GENERATOR_START, 0); + return 0; +} +EXPORT_SYMBOL(omap_abe_stop_event_generator); + +/** + * omap_abe_disable_irq - disable MCU/DSP ABE interrupt + * @abe: Pointer on abe handle + * + * This subroutine is disabling ABE MCU/DSP Irq + */ +int omap_abe_disable_irq(struct omap_abe *abe) +{ + /* disables the DMAreq from AESS AESS_DMAENABLE_CLR = 127 + * DMA_Req7 will still be enabled as it is used for ABE trace */ + omap_abe_reg_writel(abe, AESS_DMAENABLE_CLR, 0x7F); + /* disables the MCU IRQ from AESS to Cortex A9 */ + omap_abe_reg_writel(abe, AESS_MCU_IRQENABLE_CLR, 0x01); + return 0; +} +EXPORT_SYMBOL(omap_abe_disable_irq); diff --git a/sound/soc/omap/abe/abe_aess.h b/sound/soc/omap/abe/abe_aess.h new file mode 100644 index 0000000..70c54f8e --- /dev/null +++ b/sound/soc/omap/abe/abe_aess.h @@ -0,0 +1,113 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_AESS_H_ +#define _ABE_AESS_H_ + +#define AESS_REVISION 0x00 +#define AESS_MCU_IRQSTATUS 0x28 +#define AESS_MCU_IRQENABLE_SET 0x3C +#define AESS_MCU_IRQENABLE_CLR 0x40 +#define AESS_DMAENABLE_SET 0x60 +#define AESS_DMAENABLE_CLR 0x64 +#define EVENT_GENERATOR_COUNTER 0x68 +#define EVENT_GENERATOR_START 0x6C +#define EVENT_SOURCE_SELECTION 0x70 +#define AUDIO_ENGINE_SCHEDULER 0x74 + +/* + * AESS_MCU_IRQSTATUS bit field + */ +#define INT_CLEAR 0x01 + +/* + * AESS_MCU_IRQENABLE_SET bit field + */ +#define INT_SET 0x01 + +/* + * AESS_MCU_IRQENABLE_CLR bit field + */ +#define INT_CLR 0x01 + +/* + * AESS_DMAENABLE_SET bit fields + */ +#define DMA_ENABLE_ALL 0xFF + +/* + * AESS_DMAENABLE_CLR bit fields + */ +#define DMA_DISABLE_ALL 0xFF + +/* + * EVENT_GENERATOR_COUNTER COUNTER_VALUE bit field + */ +/* PLL output/desired sampling rate = (32768 * 6000)/96000 */ +#define EVENT_GENERATOR_COUNTER_DEFAULT (2048-1) +/* PLL output/desired sampling rate = (32768 * 6000)/88200 */ +#define EVENT_GENERATOR_COUNTER_44100 (2228-1) + + +int omap_abe_start_event_generator(struct omap_abe *abe); +int omap_abe_stop_event_generator(struct omap_abe *abe); +int omap_abe_write_event_generator(struct omap_abe *abe, u32 e); + +void omap_abe_hw_configuration(struct omap_abe *abe); + +#endif/* _ABE_AESS_H_ */ diff --git a/sound/soc/omap/abe/abe_api.h b/sound/soc/omap/abe/abe_api.h new file mode 100644 index 0000000..ba3f7be --- /dev/null +++ b/sound/soc/omap/abe/abe_api.h @@ -0,0 +1,524 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_API_H_ +#define _ABE_API_H_ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dm_addr.h" +#include "abe_dbg.h" + +#define ABE_TASK_ID(ID) (OMAP_ABE_D_TASKSLIST_ADDR + sizeof(ABE_STask)*(ID)) + +#define TASK_ASRC_VX_DL_SLT 1 +#define TASK_ASRC_VX_DL_IDX 2 +#define TASK_VX_DL_SLT 1 +#define TASK_VX_DL_IDX 3 +#define TASK_VX_UL_SLT 12 +#define TASK_VX_UL_IDX 5 +#define TASK_BT_DL_48_8_SLT 14 +#define TASK_BT_DL_48_8_IDX 4 +#define TASK_ASRC_BT_UL_SLT 15 +#define TASK_ASRC_BT_UL_IDX 6 +#define TASK_ASRC_VX_UL_SLT 16 +#define TASK_ASRC_VX_UL_IDX 2 +#define TASK_BT_UL_8_48_SLT 17 +#define TASK_BT_UL_8_48_IDX 2 +#define TASK_IO_MM_DL_SLT 18 +#define TASK_IO_MM_DL_IDX 0 +#define TASK_ASRC_BT_DL_SLT 18 +#define TASK_ASRC_BT_DL_IDX 6 + +struct omap_abe { + void __iomem *io_base[5]; + u32 firmware_version_number; + u16 MultiFrame[PROCESSING_SLOTS][TASKS_IN_SLOT]; + u32 compensated_mixer_gain; + u8 muted_gains_indicator[MAX_NBGAIN_CMEM]; + u32 desired_gains_decibel[MAX_NBGAIN_CMEM]; + u32 muted_gains_decibel[MAX_NBGAIN_CMEM]; + u32 desired_gains_linear[MAX_NBGAIN_CMEM]; + u32 desired_ramp_delay_ms[MAX_NBGAIN_CMEM]; + struct mutex mutex; + u32 warm_boot; + + u32 irq_dbg_read_ptr; + u32 dbg_param; + + struct omap_abe_dbg dbg; +}; + +/** + * abe_reset_hal - reset the ABE/HAL + * @rdev: regulator source + * @constraints: constraints to apply + * + * Operations : reset the HAL by reloading the static variables and + * default AESS registers. + * Called after a PRCM cold-start reset of ABE + */ +abehal_status abe_reset_hal(void); +/** + * abe_load_fw_param - Load ABE Firmware memories + * @PMEM: Pointer of Program memory data + * @PMEM_SIZE: Size of PMEM data + * @CMEM: Pointer of Coeffients memory data + * @CMEM_SIZE: Size of CMEM data + * @SMEM: Pointer of Sample memory data + * @SMEM_SIZE: Size of SMEM data + * @DMEM: Pointer of Data memory data + * @DMEM_SIZE: Size of DMEM data + * + */ +abehal_status abe_load_fw_param(u32 *FW); +/** + * abe_reload_fw - Reload ABE Firmware after OFF mode + */ +abehal_status abe_reload_fw(void); +/** + * abe_load_fw - Load ABE Firmware and initialize memories + * + */ +abehal_status abe_load_fw(void); +/** + * abe_irq_processing - Process ABE interrupt + * + * This subroutine is call upon reception of "MA_IRQ_99 ABE_MPU_IRQ" Audio + * back-end interrupt. This subroutine will check the ATC Hrdware, the + * IRQ_FIFO from the AE and act accordingly. Some IRQ source are originated + * for the delivery of "end of time sequenced tasks" notifications, some are + * originated from the Ping-Pong protocols, some are generated from + * the embedded debugger when the firmware stops on programmable break-points, + * etc ... + */ +abehal_status abe_irq_processing(void); +/** + * abe_irq_clear - clear ABE interrupt + * + * This subroutine is call to clear MCU Irq + */ +abehal_status abe_clear_irq(void); +/** + * abe_disable_irq - disable MCU/DSP ABE interrupt + * + * This subroutine is disabling ABE MCU/DSP Irq + */ +abehal_status abe_disable_irq(void); +/* + * abe_check_activity - check all ports are closed + */ +u32 abe_check_activity(void); +/** + * abe_wakeup - Wakeup ABE + * + * Wakeup ABE in case of retention + */ +abehal_status abe_wakeup(void); +/** + * abe_start_event_generator - Stops event generator source + * + * Start the event genrator of AESS. No more event will be send to AESS engine. + * Upper layer must wait 1/96kHz to be sure that engine reaches + * the IDLE instruction. + */ +abehal_status abe_start_event_generator(void); +/** + * abe_stop_event_generator - Stops event generator source + * + * Stop the event genrator of AESS. No more event will be send to AESS engine. + * Upper layer must wait 1/96kHz to be sure that engine reaches + * the IDLE instruction. + */ +abehal_status abe_stop_event_generator(void); + +/** + * abe_write_event_generator - Selects event generator source + * @e: Event Generation Counter, McPDM, DMIC or default. + * + * Loads the AESS event generator hardware source. + * Loads the firmware parameters accordingly. + * Indicates to the FW which data stream is the most important to preserve + * in case all the streams are asynchronous. + * If the parameter is "default", then HAL decides which Event source + * is the best appropriate based on the opened ports. + * + * When neither the DMIC and the McPDM are activated, the AE will have + * its EVENT generator programmed with the EVENT_COUNTER. + * The event counter will be tuned in order to deliver a pulse frequency higher + * than 96 kHz. + * The DPLL output at 100% OPP is MCLK = (32768kHz x6000) = 196.608kHz + * The ratio is (MCLK/96000)+(1<<1) = 2050 + * (1<<1) in order to have the same speed at 50% and 100% OPP + * (only 15 MSB bits are used at OPP50%) + */ +abehal_status abe_write_event_generator(u32 e); +/** + * abe_set_opp_processing - Set OPP mode for ABE Firmware + * @opp: OOPP mode + * + * New processing network and OPP: + * 0: Ultra Lowest power consumption audio player (no post-processing, no mixer) + * 1: OPP 25% (simple multimedia features, including low-power player) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% (EANC, multimedia complex use-cases) + * + * Rearranges the FW task network to the corresponding OPP list of features. + * The corresponding AE ports are supposed to be set/reset accordingly before + * this switch. + * + */ +abehal_status abe_set_opp_processing(u32 opp); +/** + * abe_set_ping_pong_buffer + * @port: ABE port ID + * @n_bytes: Size of Ping/Pong buffer + * + * Updates the next ping-pong buffer with "size" bytes copied from the + * host processor. This API notifies the FW that the data transfer is done. + */ +abehal_status abe_set_ping_pong_buffer(u32 port, u32 n_bytes); +/** + * abe_read_next_ping_pong_buffer + * @port: ABE portID + * @p: Next buffer address (pointer) + * @n: Next buffer size (pointer) + * + * Tell the next base address of the next ping_pong Buffer and its size + */ +abehal_status abe_read_next_ping_pong_buffer(u32 port, u32 *p, u32 *n); +/** + * abe_init_ping_pong_buffer + * @id: ABE port ID + * @size_bytes:size of the ping pong + * @n_buffers:number of buffers (2 = ping/pong) + * @p:returned address of the ping-pong list of base address (byte offset + from DMEM start) + * + * Computes the base address of the ping_pong buffers + */ +abehal_status abe_init_ping_pong_buffer(u32 id, u32 size_bytes, u32 n_buffers, + u32 *p); +/** + * abe_read_offset_from_ping_buffer + * @id: ABE port ID + * @n: returned address of the offset + * from the ping buffer start address (in samples) + * + * Computes the current firmware ping pong read pointer location, + * expressed in samples, as the offset from the start address of ping buffer. + */ +abehal_status abe_read_offset_from_ping_buffer(u32 id, u32 *n); +/** + * abe_plug_subroutine + * @id: returned sequence index after plugging a new subroutine + * @f: subroutine address to be inserted + * @n: number of parameters of this subroutine + * @params: pointer on parameters + * + * register a list of subroutines for call-back purpose + */ +abehal_status abe_plug_subroutine(u32 *id, abe_subroutine2 f, u32 n, + u32 *params); +/** + * abe_set_sequence_time_accuracy + * @fast: fast counter + * @slow: slow counter + * + */ +abehal_status abe_set_sequence_time_accuracy(u32 fast, u32 slow); +/** + * abe_reset_port + * @id: ABE port ID + * + * stop the port activity and reload default parameters on the associated + * processing features. + * Clears the internal AE buffers. + */ +abehal_status abe_reset_port(u32 id); +/** + * abe_read_remaining_data + * @id: ABE port_ID + * @n: size pointer to the remaining number of 32bits words + * + * computes the remaining amount of data in the buffer. + */ +abehal_status abe_read_remaining_data(u32 port, u32 *n); +/** + * abe_disable_data_transfer + * @id: ABE port id + * + * disables the ATC descriptor and stop IO/port activities + * disable the IO task (@f = 0) + * clear ATC DMEM buffer, ATC enabled + */ +abehal_status abe_disable_data_transfer(u32 id); +/** + * abe_enable_data_transfer + * @ip: ABE port id + * + * enables the ATC descriptor + * reset ATC pointers + * enable the IO task (@f <> 0) + */ +abehal_status abe_enable_data_transfer(u32 id); +/** + * abe_set_dmic_filter + * @d: DMIC decimation ratio : 16/25/32/40 + * + * Loads in CMEM a specific list of coefficients depending on the DMIC sampling + * frequency (2.4MHz or 3.84MHz). This table compensates the DMIC decimator + * roll-off at 20kHz. + * The default table is loaded with the DMIC 2.4MHz recommended configuration. + */ +abehal_status abe_set_dmic_filter(u32 d); +/** + * abe_connect_cbpr_dmareq_port + * @id: port name + * @f: desired data format + * @d: desired dma_request line (0..7) + * @a: returned pointer to the base address of the CBPr register and number of + * samples to exchange during a DMA_request. + * + * enables the data echange between a DMA and the ABE through the + * CBPr registers of AESS. + */ +abehal_status abe_connect_cbpr_dmareq_port(u32 id, abe_data_format_t *f, u32 d, + abe_dma_t *returned_dma_t); +/** + * abe_connect_irq_ping_pong_port + * @id: port name + * @f: desired data format + * @I: index of the call-back subroutine to call + * @s: half-buffer (ping) size + * @p: returned base address of the first (ping) buffer) + * + * enables the data echanges between a direct access to the DMEM + * memory of ABE using cache flush. On each IRQ activation a subroutine + * registered with "abe_plug_subroutine" will be called. This subroutine + * will generate an amount of samples, send them to DMEM memory and call + * "abe_set_ping_pong_buffer" to notify the new amount of samples in the + * pong buffer. + */ +abehal_status abe_connect_irq_ping_pong_port(u32 id, abe_data_format_t *f, + u32 subroutine_id, u32 size, + u32 *sink, u32 dsp_mcu_flag); +/** + * abe_connect_serial_port() + * @id: port name + * @f: data format + * @i: peripheral ID (McBSP #1, #2, #3) + * + * Operations : enables the data echanges between a McBSP and an ATC buffer in + * DMEM. This API is used connect 48kHz McBSP streams to MM_DL and 8/16kHz + * voice streams to VX_UL, VX_DL, BT_VX_UL, BT_VX_DL. It abstracts the + * abe_write_port API. + */ +abehal_status abe_connect_serial_port(u32 id, abe_data_format_t *f, + u32 mcbsp_id); +/** + * abe_read_port_address + * @dma: output pointer to the DMA iteration and data destination pointer + * + * This API returns the address of the DMA register used on this audio port. + * Depending on the protocol being used, adds the base address offset L3 + * (DMA) or MPU (ARM) + */ +abehal_status abe_read_port_address(u32 port, abe_dma_t *dma2); +/** + * abe_write_equalizer + * @id: name of the equalizer + * @param : equalizer coefficients + * + * Load the coefficients in CMEM. + */ +abehal_status abe_write_equalizer(u32 id, abe_equ_t *param); +/** + * abe_write_asrc + * @id: name of the port + * @param: drift value to compensate [ppm] + * + * Load the drift variables to the FW memory. This API can be called only + * when the corresponding port has been already opened and the ASRC has + * been correctly initialized with API abe_init_asrc_... If this API is + * used such that the drift has been changed from positive to negative drift + * or vice versa, there will be click in the output signal. Loading the drift + * value with zero disables the feature. + */ +abehal_status abe_write_asrc(u32 port, s32 dppm); +/** + * abe_write_aps + * @id: name of the aps filter + * @param: table of filter coefficients + * + * Load the filters and thresholds coefficients in FW memory. This AP + * can be called when the corresponding APS is not activated. After + * reloading the firmware the default coefficients corresponds to "no APS + * activated". + * Loading all the coefficients value with zero disables the feature. + */ +abehal_status abe_write_aps(u32 id, struct abe_aps_t *param); +/** + * abe_write_mixer + * @id: name of the mixer + * @param: list of input gains of the mixer + * @p: list of port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's gain + * in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +abehal_status abe_write_gain(u32 id, s32 f_g, u32 ramp, u32 p); +abehal_status abe_use_compensated_gain(u32 on_off); +abehal_status abe_enable_gain(u32 id, u32 p); +abehal_status abe_disable_gain(u32 id, u32 p); +abehal_status abe_mute_gain(u32 id, u32 p); +abehal_status abe_unmute_gain(u32 id, u32 p); +/** + * abe_write_mixer + * @id: name of the mixer + * @param: input gains and delay ramp of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +abehal_status abe_write_mixer(u32 id, s32 f_g, u32 f_ramp, u32 p); +/** + * abe_read_gain + * @id: name of the mixer + * @param: list of input gains of the mixer + * @p: list of port corresponding to the above gains + * + */ +abehal_status abe_read_gain(u32 id, u32 *f_g, u32 p); +/** + * abe_read_mixer + * @id: name of the mixer + * @param: gains of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +abehal_status abe_read_mixer(u32 id, u32 *f_g, u32 p); +/** + * abe_set_router_configuration + * @Id: name of the router + * @Conf: id of the configuration + * @param: list of output index of the route + * + * The uplink router takes its input from DMIC (6 samples), AMIC (2 samples) + * and PORT1/2 (2 stereo ports). Each sample will be individually stored in + * an intermediate table of 10 elements. The intermediate table is used to + * route the samples to three directions : REC1 mixer, 2 EANC DMIC source of + * filtering and MM recording audio path. + */ +abehal_status abe_set_router_configuration(u32 id, u32 k, u32 *param); +/** + * ABE_READ_DEBUG_TRACE + * + * Parameters : + * @data: data destination pointer + * @n : max number of read data + * + * Operations : + * Reads the AE circular data pointer that holds pairs of debug data + + * timestamps, and stores the pairs, via linear addressing, to the parameter + * pointer. + * Stops the copy when the max parameter is reached or when the FIFO is empty. + * + * Return value : + * None. + */ +abehal_status abe_read_debug_trace(u32 *data, u32 *n); +/** + * abe_connect_debug_trace + * @dma2:pointer to the DMEM trace buffer + * + * returns the address and size of the real-time debug trace buffer, + * the content of which will vary from one firmware release to an other + */ +abehal_status abe_connect_debug_trace(abe_dma_t *dma2); +/** + * abe_set_debug_trace + * @debug: debug ID from a list to be defined + * + * load a mask which filters the debug trace to dedicated types of data + */ +abehal_status abe_set_debug_trace(abe_dbg_t debug); +/** + * abe_init_mem - Allocate Kernel space memory map for ABE + * + * Memory map of ABE memory space for PMEM/DMEM/SMEM/DMEM + */ +void abe_init_mem(void __iomem **_io_base); + +#endif/* _ABE_API_H_ */ diff --git a/sound/soc/omap/abe/abe_asrc.c b/sound/soc/omap/abe/abe_asrc.c new file mode 100644 index 0000000..bd49149 --- /dev/null +++ b/sound/soc/omap/abe/abe_asrc.c @@ -0,0 +1,1196 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_legacy.h" +#include "abe_dbg.h" + +#include "abe_typedef.h" +#include "abe_initxxx_labels.h" +#include "abe_dbg.h" +#include "abe_mem.h" +#include "abe_sm_addr.h" +#include "abe_cm_addr.h" + +/** + * abe_write_fifo + * @mem_bank: currently only ABE_DMEM supported + * @addr: FIFO descriptor address ( descriptor fields : READ ptr, WRITE ptr, + * FIFO START_ADDR, FIFO END_ADDR) + * @data: data to write to FIFO + * @number: number of 32-bit words to write to DMEM FIFO + * + * write DMEM FIFO and update FIFO descriptor, + * it is assumed that FIFO descriptor is located in DMEM + */ +void abe_write_fifo(u32 memory_bank, u32 descr_addr, u32 *data, u32 nb_data32) +{ + u32 fifo_addr[4]; + u32 i; + /* read FIFO descriptor from DMEM */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, descr_addr, + &fifo_addr[0], 4 * sizeof(u32)); + /* WRITE ptr < FIFO start address */ + if (fifo_addr[1] < fifo_addr[2]) + omap_abe_dbg_error(abe, OMAP_ABE_ERR_DBG, + ABE_FW_FIFO_WRITE_PTR_ERR); + /* WRITE ptr > FIFO end address */ + if (fifo_addr[1] > fifo_addr[3]) + omap_abe_dbg_error(abe, OMAP_ABE_ERR_DBG, + ABE_FW_FIFO_WRITE_PTR_ERR); + switch (memory_bank) { + case ABE_DMEM: + for (i = 0; i < nb_data32; i++) { + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (s32) fifo_addr[1], (u32 *) (data + i), + 4); + /* increment WRITE pointer */ + fifo_addr[1] = fifo_addr[1] + 4; + if (fifo_addr[1] > fifo_addr[3]) + fifo_addr[1] = fifo_addr[2]; + if (fifo_addr[1] == fifo_addr[0]) + omap_abe_dbg_error(abe, OMAP_ABE_ERR_DBG, + ABE_FW_FIFO_WRITE_PTR_ERR); + } + /* update WRITE pointer in DMEM */ + omap_abe_mem_write(abe, OMAP_ABE_DMEM, descr_addr + + sizeof(u32), &fifo_addr[1], 4); + break; + default: + break; + } +} + +/** + * abe_write_asrc + * @id: name of the port + * @param: drift value to compensate [ppm] + * + * Load the drift variables to the FW memory. This API can be called only + * when the corresponding port has been already opened and the ASRC has + * been correctly initialized with API abe_init_asrc_... If this API is + * used such that the drift has been changed from positive to negative drift + * or vice versa, there will be click in the output signal. Loading the drift + * value with zero disables the feature. + */ +abehal_status abe_write_asrc(u32 port, s32 dppm) +{ + s32 dtempvalue, adppm, drift_sign, drift_sign_addr, alpha_params_addr; + s32 alpha_params[3]; + _log(ABE_ID_WRITE_ASRC, port, dppm, dppm >> 8); + /* + * x = ppm + * + * - 1000000/x must be multiple of 16 + * - deltaalpha = round(2^20*x*16/1000000)=round(2^18/5^6*x) on 22 bits. + * then shifted by 2bits + * - minusdeltaalpha + * - oneminusepsilon = 1-deltaalpha/2. + * + * ppm = 250 + * - 1000000/250=4000 + * - deltaalpha = 4194.3 ~ 4195 => 0x00418c + */ + /* examples for -6250 ppm */ + /* atempvalue32[1] = -1; d_driftsign */ + /* atempvalue32[3] = 0x00066668; d_deltaalpha */ + /* atempvalue32[4] = 0xfff99998; d_minusdeltaalpha */ + /* atempvalue32[5] = 0x003ccccc; d_oneminusepsilon */ + /* example for 100 ppm */ + /* atempvalue32[1] = 1;* d_driftsign */ + /* atempvalue32[3] = 0x00001a38; d_deltaalpha */ + /* atempvalue32[4] = 0xffffe5c8; d_minusdeltaalpha */ + /* atempvalue32[5] = 0x003ccccc; d_oneminusepsilon */ + /* compute new value for the ppm */ + if (dppm >= 0) { + /* d_driftsign */ + drift_sign = 1; + adppm = dppm; + } else { + /* d_driftsign */ + drift_sign = -1; + adppm = (-1 * dppm); + } + if (dppm == 0) { + /* delta_alpha */ + alpha_params[0] = 0; + /* minusdelta_alpha */ + alpha_params[1] = 0; + /* one_minusepsilon */ + alpha_params[2] = 0x003ffff0; + } else { + dtempvalue = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* delta_alpha */ + alpha_params[0] = dtempvalue << 2; + /* minusdelta_alpha */ + alpha_params[1] = (-dtempvalue) << 2; + /* one_minusepsilon */ + alpha_params[2] = (0x00100000 - (dtempvalue / 2)) << 2; + } + switch (port) { + /* asynchronous sample-rate-converter for the uplink voice path */ + case OMAP_ABE_VX_DL_PORT: + drift_sign_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (1 * sizeof(s32)); + alpha_params_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (3 * sizeof(s32)); + break; + /* asynchronous sample-rate-converter for the downlink voice path */ + case OMAP_ABE_VX_UL_PORT: + drift_sign_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (1 * sizeof(s32)); + alpha_params_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (3 * sizeof(s32)); + break; + /* asynchronous sample-rate-converter for the BT_UL path */ + case OMAP_ABE_BT_VX_UL_PORT: + drift_sign_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (1 * sizeof(s32)); + alpha_params_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (3 * sizeof(s32)); + break; + /* asynchronous sample-rate-converter for the BT_DL path */ + case OMAP_ABE_BT_VX_DL_PORT: + drift_sign_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (1 * sizeof(s32)); + alpha_params_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (3 * sizeof(s32)); + break; + default: + /* asynchronous sample-rate-converter for the MM_EXT_IN path */ + case OMAP_ABE_MM_EXT_IN_PORT: + drift_sign_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (1 * sizeof(s32)); + alpha_params_addr = + OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (3 * sizeof(s32)); + break; + } + omap_abe_mem_write(abe, OMAP_ABE_DMEM, drift_sign_addr, + (u32 *) &drift_sign, 4); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, alpha_params_addr, + (u32 *) &alpha_params[0], 12); + return 0; +} +EXPORT_SYMBOL(abe_write_asrc); +/** + * abe_init_asrc_vx_dl + * + * Initialize the following ASRC VX_DL parameters : + * 1. DriftSign = D_AsrcVars[1] = 1 or -1 + * 2. Subblock = D_AsrcVars[2] = 0 + * 3. DeltaAlpha = D_AsrcVars[3] = + * (round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 4. MinusDeltaAlpha = D_AsrcVars[4] = + * (-round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 5. OneMinusEpsilon = D_AsrcVars[5] = 1 - DeltaAlpha/2 + * 6. AlphaCurrent = 0x000020 (CMEM), initial value of Alpha parameter + * 7. BetaCurrent = 0x3fffe0 (CMEM), initial value of Beta parameter + * AlphaCurrent + BetaCurrent = 1 (=0x400000 in CMEM = 2^20 << 2) + * 8. drift_ASRC = 0 & drift_io = 0 + * 9. SMEM for ASRC_DL_VX_Coefs pointer + * 10. CMEM for ASRC_DL_VX_Coefs pointer + * ASRC_DL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + * C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 + * 11. SMEM for XinASRC_DL_VX pointer + * 12. CMEM for XinASRC_DL_VX pointer + * XinASRC_DL_VX = S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/0/1/0/0/0/0 + * 13. SMEM for IO_VX_DL_ASRC pointer + * 14. CMEM for IO_VX_DL_ASRC pointer + * IO_VX_DL_ASRC = + * S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/ + * ASRC_DL_VX_FIR_L+ASRC_margin/1/0/0/0/0 + */ +void abe_init_asrc_vx_dl(s32 dppm) +{ + s32 el[45]; + s32 temp0, temp1, adppm, dtemp, mem_tag, mem_addr; + u32 i = 0; + u32 n_fifo_el = 42; + temp0 = 0; + temp1 = 1; + /* 1. DriftSign = D_AsrcVars[1] = 1 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (1 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm >= 0) { + el[i + 1] = 1; + adppm = dppm; + } else { + el[i + 1] = -1; + adppm = (-1 * dppm); + } + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + dtemp = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* 2. Subblock = D_AsrcVars[2] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (2 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 3. DeltaAlpha = D_AsrcVars[3] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (3 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = dtemp << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 4. MinusDeltaAlpha = D_AsrcVars[4] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (4 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = (-dtemp) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /*5. OneMinusEpsilon = D_AsrcVars[5] = 0x00400000 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_DL_VX_ADDR + (5 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0x00400000; + else + el[i + 1] = (0x00100000 - (dtemp / 2)) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 6. AlphaCurrent = 0x000020 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_ALPHACURRENT_DL_VX_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x00000020; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 7. BetaCurrent = 0x3fffe0 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_BETACURRENT_DL_VX_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x003fffe0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 8. drift_ASRC = 0 & drift_io = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_VX_DL_PORT * sizeof(struct ABE_SIODescriptor)) + + drift_asrc_; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 9. SMEM for ASRC_DL_VX_Coefs pointer */ + /* ASRC_DL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_SMEM; + mem_addr = ASRC_DL_VX_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_C_COEFASRC16_VX_ADDR >> 2; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_C_COEFASRC16_VX_SIZE >> 2); + el[i + 2] = OMAP_ABE_C_COEFASRC15_VX_ADDR >> 2; + el[i + 2] = (el[i + 2] << 8) + (OMAP_ABE_C_COEFASRC15_VX_SIZE >> 2); + i = i + 3; + /* 10. CMEM for ASRC_DL_VX_Coefs pointer */ + /* ASRC_DL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_CMEM; + mem_addr = ASRC_DL_VX_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp1; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 11. SMEM for XinASRC_DL_VX pointer */ + /* XinASRC_DL_VX = + S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = XinASRC_DL_VX_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_DL_VX_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_DL_VX_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 12. CMEM for XinASRC_DL_VX pointer */ + /* XinASRC_DL_VX = + S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = XinASRC_DL_VX_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 13. SMEM for IO_VX_DL_ASRC pointer */ + /* IO_VX_DL_ASRC = S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/ + ASRC_DL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = IO_VX_DL_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_DL_VX_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_DL_VX_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 14. CMEM for IO_VX_DL_ASRC pointer */ + /* IO_VX_DL_ASRC = S_XinASRC_DL_VX_ADDR/S_XinASRC_DL_VX_sizeof/ + ASRC_DL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = IO_VX_DL_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_DL_VX_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + abe_write_fifo(ABE_DMEM, OMAP_ABE_D_FWMEMINITDESCR_ADDR, (u32 *) &el[0], + n_fifo_el); +} +/** + * abe_init_asrc_vx_ul + * + * Initialize the following ASRC VX_UL parameters : + * 1. DriftSign = D_AsrcVars[1] = 1 or -1 + * 2. Subblock = D_AsrcVars[2] = 0 + * 3. DeltaAlpha = D_AsrcVars[3] = + * (round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 4. MinusDeltaAlpha = D_AsrcVars[4] = + * (-round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 5. OneMinusEpsilon = D_AsrcVars[5] = 1 - DeltaAlpha/2 + * 6. AlphaCurrent = 0x000020 (CMEM), initial value of Alpha parameter + * 7. BetaCurrent = 0x3fffe0 (CMEM), initial value of Beta parameter + * AlphaCurrent + BetaCurrent = 1 (=0x400000 in CMEM = 2^20 << 2) + * 8. drift_ASRC = 0 & drift_io = 0 + * 9. SMEM for ASRC_UL_VX_Coefs pointer + * 10. CMEM for ASRC_UL_VX_Coefs pointer + * ASRC_UL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + * C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 + * 11. SMEM for XinASRC_UL_VX pointer + * 12. CMEM for XinASRC_UL_VX pointer + * XinASRC_UL_VX = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/0/1/0/0/0/0 + * 13. SMEM for UL_48_8_DEC pointer + * 14. CMEM for UL_48_8_DEC pointer + * UL_48_8_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + * ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 + * 15. SMEM for UL_48_16_DEC pointer + * 16. CMEM for UL_48_16_DEC pointer + * UL_48_16_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + * ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 + */ +void abe_init_asrc_vx_ul(s32 dppm) +{ + s32 el[51]; + s32 temp0, temp1, adppm, dtemp, mem_tag, mem_addr; + u32 i = 0; + u32 n_fifo_el = 48; + temp0 = 0; + temp1 = 1; + /* 1. DriftSign = D_AsrcVars[1] = 1 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (1 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm >= 0) { + el[i + 1] = 1; + adppm = dppm; + } else { + el[i + 1] = -1; + adppm = (-1 * dppm); + } + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + dtemp = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* 2. Subblock = D_AsrcVars[2] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (2 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 3. DeltaAlpha = D_AsrcVars[3] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (3 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = dtemp << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 4. MinusDeltaAlpha = D_AsrcVars[4] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (4 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = (-dtemp) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 5. OneMinusEpsilon = D_AsrcVars[5] = 0x00400000 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_UL_VX_ADDR + (5 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0x00400000; + else + el[i + 1] = (0x00100000 - (dtemp / 2)) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 6. AlphaCurrent = 0x000020 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_ALPHACURRENT_UL_VX_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x00000020; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 7. BetaCurrent = 0x3fffe0 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_BETACURRENT_UL_VX_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x003fffe0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 8. drift_ASRC = 0 & drift_io = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_VX_UL_PORT * sizeof(struct ABE_SIODescriptor)) + + drift_asrc_; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 9. SMEM for ASRC_UL_VX_Coefs pointer */ + /* ASRC_UL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_SMEM; + mem_addr = ASRC_UL_VX_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_C_COEFASRC16_VX_ADDR >> 2; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_C_COEFASRC16_VX_SIZE >> 2); + el[i + 2] = OMAP_ABE_C_COEFASRC15_VX_ADDR >> 2; + el[i + 2] = (el[i + 2] << 8) + (OMAP_ABE_C_COEFASRC15_VX_SIZE >> 2); + i = i + 3; + /* 10. CMEM for ASRC_UL_VX_Coefs pointer */ + /* ASRC_UL_VX_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_CMEM; + mem_addr = ASRC_UL_VX_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp1; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 11. SMEM for XinASRC_UL_VX pointer */ + /* XinASRC_UL_VX = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/0/1/ + 0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = XinASRC_UL_VX_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_UL_VX_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_UL_VX_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 12. CMEM for XinASRC_UL_VX pointer */ + /* XinASRC_UL_VX = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/0/1/ + 0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = XinASRC_UL_VX_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 13. SMEM for UL_48_8_DEC pointer */ + /* UL_48_8_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = UL_48_8_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_UL_VX_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_UL_VX_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 14. CMEM for UL_48_8_DEC pointer */ + /* UL_48_8_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = UL_48_8_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_UL_VX_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 15. SMEM for UL_48_16_DEC pointer */ + /* UL_48_16_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = UL_48_16_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_UL_VX_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_UL_VX_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 16. CMEM for UL_48_16_DEC pointer */ + /* UL_48_16_DEC = S_XinASRC_UL_VX_ADDR/S_XinASRC_UL_VX_sizeof/ + ASRC_UL_VX_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = UL_48_16_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_UL_VX_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + abe_write_fifo(ABE_DMEM, OMAP_ABE_D_FWMEMINITDESCR_ADDR, (u32 *) &el[0], + n_fifo_el); +} +/** + * abe_init_asrc_mm_ext_in + * + * Initialize the following ASRC MM_EXT_IN parameters : + * 1. DriftSign = D_AsrcVars[1] = 1 or -1 + * 2. Subblock = D_AsrcVars[2] = 0 + * 3. DeltaAlpha = D_AsrcVars[3] = + * (round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 4. MinusDeltaAlpha = D_AsrcVars[4] = + * (-round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 5. OneMinusEpsilon = D_AsrcVars[5] = 1 - DeltaAlpha/2 + * 6. AlphaCurrent = 0x000020 (CMEM), initial value of Alpha parameter + * 7. BetaCurrent = 0x3fffe0 (CMEM), initial value of Beta parameter + * AlphaCurrent + BetaCurrent = 1 (=0x400000 in CMEM = 2^20 << 2) + * 8. drift_ASRC = 0 & drift_io = 0 + * 9. SMEM for ASRC_MM_EXT_IN_Coefs pointer + * 10. CMEM for ASRC_MM_EXT_IN_Coefs pointer + * ASRC_MM_EXT_IN_Coefs = C_CoefASRC16_MM_ADDR/C_CoefASRC16_MM_sizeof/0/1/ + * C_CoefASRC15_MM_ADDR/C_CoefASRC15_MM_sizeof/0/1 + * 11. SMEM for XinASRC_MM_EXT_IN pointer + * 12. CMEM for XinASRC_MM_EXT_IN pointer + * XinASRC_MM_EXT_IN = S_XinASRC_MM_EXT_IN_ADDR/S_XinASRC_MM_EXT_IN_sizeof/0/1/ + * 0/0/0/0 + * 13. SMEM for IO_MM_EXT_IN_ASRC pointer + * 14. CMEM for IO_MM_EXT_IN_ASRC pointer + * IO_MM_EXT_IN_ASRC = S_XinASRC_MM_EXT_IN_ADDR/S_XinASRC_MM_EXT_IN_sizeof/ + * ASRC_MM_EXT_IN_FIR_L+ASRC_margin+ASRC_N_48k/1/0/0/0/0 + */ +void abe_init_asrc_mm_ext_in(s32 dppm) +{ + s32 el[45]; + s32 temp0, temp1, adppm, dtemp, mem_tag, mem_addr; + u32 i = 0; + u32 n_fifo_el = 42; + temp0 = 0; + temp1 = 1; + /* 1. DriftSign = D_AsrcVars[1] = 1 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (1 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm >= 0) { + el[i + 1] = 1; + adppm = dppm; + } else { + el[i + 1] = -1; + adppm = (-1 * dppm); + } + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + dtemp = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* 2. Subblock = D_AsrcVars[2] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (2 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 3. DeltaAlpha = D_AsrcVars[3] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (3 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = dtemp << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 4. MinusDeltaAlpha = D_AsrcVars[4] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (4 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = (-dtemp) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 5. OneMinusEpsilon = D_AsrcVars[5] = 0x00400000 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR + (5 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0x00400000; + else + el[i + 1] = (0x00100000 - (dtemp / 2)) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 6. AlphaCurrent = 0x000020 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_ALPHACURRENT_MM_EXT_IN_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x00000020; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 7. BetaCurrent = 0x3fffe0 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_BETACURRENT_MM_EXT_IN_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x003fffe0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 8. drift_ASRC = 0 & drift_io = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_MM_EXT_IN_PORT * sizeof(struct ABE_SIODescriptor)) + + drift_asrc_; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 9. SMEM for ASRC_MM_EXT_IN_Coefs pointer */ + /* ASRC_MM_EXT_IN_Coefs = C_CoefASRC16_MM_ADDR/C_CoefASRC16_MM_sizeof/ + 0/1/C_CoefASRC15_MM_ADDR/C_CoefASRC15_MM_sizeof/0/1 */ + mem_tag = ABE_SMEM; + mem_addr = ASRC_MM_EXT_IN_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_C_COEFASRC16_MM_ADDR >> 2; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_C_COEFASRC16_MM_SIZE >> 2); + el[i + 2] = OMAP_ABE_C_COEFASRC15_MM_ADDR >> 2; + el[i + 2] = (el[i + 2] << 8) + (OMAP_ABE_C_COEFASRC15_MM_SIZE >> 2); + i = i + 3; + /*10. CMEM for ASRC_MM_EXT_IN_Coefs pointer */ + /* ASRC_MM_EXT_IN_Coefs = C_CoefASRC16_MM_ADDR/C_CoefASRC16_MM_sizeof/ + 0/1/C_CoefASRC15_MM_ADDR/C_CoefASRC15_MM_sizeof/0/1 */ + mem_tag = ABE_CMEM; + mem_addr = ASRC_MM_EXT_IN_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp1; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 11. SMEM for XinASRC_MM_EXT_IN pointer */ + /* XinASRC_MM_EXT_IN = S_XinASRC_MM_EXT_IN_ADDR/ + S_XinASRC_MM_EXT_IN_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = XinASRC_MM_EXT_IN_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_MM_EXT_IN_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_MM_EXT_IN_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 12. CMEM for XinASRC_MM_EXT_IN pointer */ + /* XinASRC_MM_EXT_IN = S_XinASRC_MM_EXT_IN_ADDR/ + S_XinASRC_MM_EXT_IN_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = XinASRC_MM_EXT_IN_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 13. SMEM for IO_MM_EXT_IN_ASRC pointer */ + /* IO_MM_EXT_IN_ASRC = + S_XinASRC_MM_EXT_IN_ADDR/S_XinASRC_MM_EXT_IN_sizeof/ + ASRC_MM_EXT_IN_FIR_L+ASRC_margin+ASRC_N_48k/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = IO_MM_EXT_IN_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_MM_EXT_IN_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_MM_EXT_IN_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 14. CMEM for IO_MM_EXT_IN_ASRC pointer */ + /* IO_MM_EXT_IN_ASRC = + S_XinASRC_MM_EXT_IN_ADDR/S_XinASRC_MM_EXT_IN_sizeof/ + ASRC_MM_EXT_IN_FIR_L+ASRC_margin+ASRC_N_48k/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = IO_MM_EXT_IN_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_MM_EXT_IN_FIR_L + ASRC_margin + ASRC_N_48k) << 16) + + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + abe_write_fifo(ABE_DMEM, OMAP_ABE_D_FWMEMINITDESCR_ADDR, (u32 *) &el[0], + n_fifo_el); +} +/** + * abe_init_asrc_bt_ul + * + * Initialize the following ASRC BT_UL parameters : + * 1. DriftSign = D_AsrcVars[1] = 1 or -1 + * 2. Subblock = D_AsrcVars[2] = 0 + * 3. DeltaAlpha = D_AsrcVars[3] = + * (round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 4. MinusDeltaAlpha = D_AsrcVars[4] = + * (-round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 5. OneMinusEpsilon = D_AsrcVars[5] = 1 - DeltaAlpha/2 + * 6. AlphaCurrent = 0x000020 (CMEM), initial value of Alpha parameter + * 7. BetaCurrent = 0x3fffe0 (CMEM), initial value of Beta parameter + * AlphaCurrent + BetaCurrent = 1 (=0x400000 in CMEM = 2^20 << 2) + * 8. drift_ASRC = 0 & drift_io = 0 + * 9. SMEM for ASRC_BT_UL_Coefs pointer + * 10. CMEM for ASRC_BT_UL_Coefs pointer + * ASRC_BT_UL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + * C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 + * 11. SMEM for XinASRC_BT_UL pointer + * 12. CMEM for XinASRC_BT_UL pointer + * XinASRC_BT_UL = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/0/1/0/0/0/0 + * 13. SMEM for IO_BT_UL_ASRC pointer + * 14. CMEM for IO_BT_UL_ASRC pointer + * IO_BT_UL_ASRC = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/ + * ASRC_BT_UL_FIR_L+ASRC_margin/1/0/0/0/0 + */ +void abe_init_asrc_bt_ul(s32 dppm) +{ + s32 el[45]; + s32 temp0, temp1, adppm, dtemp, mem_tag, mem_addr; + u32 i = 0; + u32 n_fifo_el = 42; + temp0 = 0; + temp1 = 1; + /* 1. DriftSign = D_AsrcVars[1] = 1 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (1 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm >= 0) { + el[i + 1] = 1; + adppm = dppm; + } else { + el[i + 1] = -1; + adppm = (-1 * dppm); + } + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + dtemp = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* 2. Subblock = D_AsrcVars[2] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (2 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 3. DeltaAlpha = D_AsrcVars[3] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (3 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = dtemp << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 4. MinusDeltaAlpha = D_AsrcVars[4] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (4 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = (-dtemp) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /*5. OneMinusEpsilon = D_AsrcVars[5] = 0x00400000 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_UL_ADDR + (5 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0x00400000; + else + el[i + 1] = (0x00100000 - (dtemp / 2)) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 6. AlphaCurrent = 0x000020 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_ALPHACURRENT_BT_UL_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x00000020; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 7. BetaCurrent = 0x3fffe0 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_BETACURRENT_BT_UL_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x003fffe0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 8. drift_ASRC = 0 & drift_io = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_BT_VX_UL_PORT * sizeof(struct ABE_SIODescriptor)) + + drift_asrc_; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 9. SMEM for ASRC_BT_UL_Coefs pointer */ + /* ASRC_BT_UL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_SMEM; + mem_addr = ASRC_BT_UL_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_C_COEFASRC16_VX_ADDR >> 2; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_C_COEFASRC16_VX_SIZE >> 2); + el[i + 2] = OMAP_ABE_C_COEFASRC15_VX_ADDR >> 2; + el[i + 2] = (el[i + 2] << 8) + (OMAP_ABE_C_COEFASRC15_VX_SIZE >> 2); + i = i + 3; + /* 10. CMEM for ASRC_BT_UL_Coefs pointer */ + /* ASRC_BT_UL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_CMEM; + mem_addr = ASRC_BT_UL_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp1; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 11. SMEM for XinASRC_BT_UL pointer */ + /* XinASRC_BT_UL = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/0/1/ + 0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = XinASRC_BT_UL_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_BT_UL_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_BT_UL_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 12. CMEM for XinASRC_BT_UL pointer */ + /* XinASRC_BT_UL = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/0/1/ + 0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = XinASRC_BT_UL_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 13. SMEM for IO_BT_UL_ASRC pointer */ + /* IO_BT_UL_ASRC = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/ + ASRC_BT_UL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = IO_BT_UL_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_BT_UL_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_BT_UL_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 14. CMEM for IO_BT_UL_ASRC pointer */ + /* IO_BT_UL_ASRC = S_XinASRC_BT_UL_ADDR/S_XinASRC_BT_UL_sizeof/ + ASRC_BT_UL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = IO_BT_UL_ASRC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_BT_UL_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + abe_write_fifo(ABE_DMEM, OMAP_ABE_D_FWMEMINITDESCR_ADDR, (u32 *) &el[0], + n_fifo_el); +} +/** + * abe_init_asrc_bt_dl + * + * Initialize the following ASRC BT_DL parameters : + * 1. DriftSign = D_AsrcVars[1] = 1 or -1 + * 2. Subblock = D_AsrcVars[2] = 0 + * 3. DeltaAlpha = D_AsrcVars[3] = + * (round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 4. MinusDeltaAlpha = D_AsrcVars[4] = + * (-round(nb_phases * drift[ppm] * 10^-6 * 2^20)) << 2 + * 5. OneMinusEpsilon = D_AsrcVars[5] = 1 - DeltaAlpha/2 + * 6. AlphaCurrent = 0x000020 (CMEM), initial value of Alpha parameter + * 7. BetaCurrent = 0x3fffe0 (CMEM), initial value of Beta parameter + * AlphaCurrent + BetaCurrent = 1 (=0x400000 in CMEM = 2^20 << 2) + * 8. drift_ASRC = 0 & drift_io = 0 + * 9. SMEM for ASRC_BT_DL_Coefs pointer + * 10. CMEM for ASRC_BT_DL_Coefs pointer + * ASRC_BT_DL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + * C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 + * 11. SMEM for XinASRC_BT_DL pointer + * 12. CMEM for XinASRC_BT_DL pointer + * XinASRC_BT_DL = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/0/1/0/0/0/0 + * 13. SMEM for DL_48_8_DEC pointer + * 14. CMEM for DL_48_8_DEC pointer + * DL_48_8_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + * ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 + * 15. SMEM for DL_48_16_DEC pointer + * 16. CMEM for DL_48_16_DEC pointer + * DL_48_16_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + * ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 + */ +void abe_init_asrc_bt_dl(s32 dppm) +{ + s32 el[51]; + s32 temp0, temp1, adppm, dtemp, mem_tag, mem_addr; + u32 i = 0; + u32 n_fifo_el = 48; + temp0 = 0; + temp1 = 1; + /* 1. DriftSign = D_AsrcVars[1] = 1 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (1 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm >= 0) { + el[i + 1] = 1; + adppm = dppm; + } else { + el[i + 1] = -1; + adppm = (-1 * dppm); + } + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + dtemp = (adppm << 4) + adppm - ((adppm * 3481L) / 15625L); + /* 2. Subblock = D_AsrcVars[2] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (2 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 3. DeltaAlpha = D_AsrcVars[3] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (3 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = dtemp << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 4. MinusDeltaAlpha = D_AsrcVars[4] = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (4 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0; + else + el[i + 1] = (-dtemp) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 5. OneMinusEpsilon = D_AsrcVars[5] = 0x00400000 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_ASRCVARS_BT_DL_ADDR + (5 * sizeof(s32)); + el[i] = (mem_tag << 16) + mem_addr; + if (dppm == 0) + el[i + 1] = 0x00400000; + else + el[i + 1] = (0x00100000 - (dtemp / 2)) << 2; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 6. AlphaCurrent = 0x000020 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_ALPHACURRENT_BT_DL_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x00000020; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 7. BetaCurrent = 0x3fffe0 (CMEM) */ + mem_tag = ABE_CMEM; + mem_addr = OMAP_ABE_C_BETACURRENT_BT_DL_ADDR; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = 0x003fffe0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 8. drift_ASRC = 0 & drift_io = 0 */ + mem_tag = ABE_DMEM; + mem_addr = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_BT_VX_DL_PORT * sizeof(struct ABE_SIODescriptor)) + + drift_asrc_; + el[i] = (mem_tag << 16) + mem_addr; + el[i + 1] = temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 9. SMEM for ASRC_BT_DL_Coefs pointer */ + /* ASRC_BT_DL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_SMEM; + mem_addr = ASRC_BT_DL_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_C_COEFASRC16_VX_ADDR >> 2; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_C_COEFASRC16_VX_SIZE >> 2); + el[i + 2] = OMAP_ABE_C_COEFASRC15_VX_ADDR >> 2; + el[i + 2] = (el[i + 2] << 8) + (OMAP_ABE_C_COEFASRC15_VX_SIZE >> 2); + i = i + 3; + /* 10. CMEM for ASRC_BT_DL_Coefs pointer */ + /* ASRC_BT_DL_Coefs = C_CoefASRC16_VX_ADDR/C_CoefASRC16_VX_sizeof/0/1/ + C_CoefASRC15_VX_ADDR/C_CoefASRC15_VX_sizeof/0/1 */ + mem_tag = ABE_CMEM; + mem_addr = ASRC_BT_DL_Coefs_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp1; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 11. SMEM for XinASRC_BT_DL pointer */ + /* XinASRC_BT_DL = + S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = XinASRC_BT_DL_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_BT_DL_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_BT_DL_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 12. CMEM for XinASRC_BT_DL pointer */ + /* XinASRC_BT_DL = + S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/0/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = XinASRC_BT_DL_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = (temp0 << 16) + (temp1 << 12) + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 13. SMEM for DL_48_8_DEC pointer */ + /* DL_48_8_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = DL_48_8_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_BT_DL_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_BT_DL_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 14. CMEM for DL_48_8_DEC pointer */ + /* DL_48_8_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = DL_48_8_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_BT_DL_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + i = i + 3; + /* 15. SMEM for DL_48_16_DEC pointer */ + /* DL_48_16_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_SMEM; + mem_addr = DL_48_16_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + el[i + 1] = OMAP_ABE_S_XINASRC_BT_DL_ADDR >> 3; + el[i + 1] = (el[i + 1] << 8) + (OMAP_ABE_S_XINASRC_BT_DL_SIZE >> 3); + el[i + 2] = temp0; + i = i + 3; + /* 16. CMEM for DL_48_16_DEC pointer */ + /* DL_48_16_DEC = S_XinASRC_BT_DL_ADDR/S_XinASRC_BT_DL_sizeof/ + ASRC_BT_DL_FIR_L+ASRC_margin/1/0/0/0/0 */ + mem_tag = ABE_CMEM; + mem_addr = DL_48_16_DEC_labelID; + el[i] = (mem_tag << 16) + (mem_addr << 2); + /* el[i+1] = iam1<<16 + inc1<<12 + iam2<<4 + inc2 */ + el[i + 1] = ((ASRC_BT_DL_FIR_L + ASRC_margin) << 16) + (temp1 << 12) + + (temp0 << 4) + temp0; + /* dummy field */ + el[i + 2] = temp0; + abe_write_fifo(ABE_DMEM, OMAP_ABE_D_FWMEMINITDESCR_ADDR, (u32 *) &el[0], + n_fifo_el); +} diff --git a/sound/soc/omap/abe/abe_cm_addr.h b/sound/soc/omap/abe/abe_cm_addr.h new file mode 100644 index 0000000..29f7f27 --- /dev/null +++ b/sound/soc/omap/abe/abe_cm_addr.h @@ -0,0 +1,317 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +#define OMAP_ABE_INIT_CM_ADDR 0x0 +#define OMAP_ABE_INIT_CM_SIZE 0x4DC + +#define OMAP_ABE_C_DATA_LSB_2_ADDR 0x4DC +#define OMAP_ABE_C_DATA_LSB_2_SIZE 0x4 + +#define OMAP_ABE_C_1_ALPHA_ADDR 0x4E0 +#define OMAP_ABE_C_1_ALPHA_SIZE 0x48 + +#define OMAP_ABE_C_ALPHA_ADDR 0x528 +#define OMAP_ABE_C_ALPHA_SIZE 0x48 + +#define OMAP_ABE_C_GAINSWRAMP_ADDR 0x570 +#define OMAP_ABE_C_GAINSWRAMP_SIZE 0x38 + +#define OMAP_ABE_C_GAINS_DL1M_ADDR 0x5A8 +#define OMAP_ABE_C_GAINS_DL1M_SIZE 0x10 + +#define OMAP_ABE_C_GAINS_DL2M_ADDR 0x5B8 +#define OMAP_ABE_C_GAINS_DL2M_SIZE 0x10 + +#define OMAP_ABE_C_GAINS_ECHOM_ADDR 0x5C8 +#define OMAP_ABE_C_GAINS_ECHOM_SIZE 0x8 + +#define OMAP_ABE_C_GAINS_SDTM_ADDR 0x5D0 +#define OMAP_ABE_C_GAINS_SDTM_SIZE 0x8 + +#define OMAP_ABE_C_GAINS_VXRECM_ADDR 0x5D8 +#define OMAP_ABE_C_GAINS_VXRECM_SIZE 0x10 + +#define OMAP_ABE_C_GAINS_ULM_ADDR 0x5E8 +#define OMAP_ABE_C_GAINS_ULM_SIZE 0x10 + +#define OMAP_ABE_C_GAINS_BTUL_ADDR 0x5F8 +#define OMAP_ABE_C_GAINS_BTUL_SIZE 0x8 + +#define OMAP_ABE_C_SDT_COEFS_ADDR 0x600 +#define OMAP_ABE_C_SDT_COEFS_SIZE 0x24 + +#define OMAP_ABE_C_COEFASRC1_VX_ADDR 0x624 +#define OMAP_ABE_C_COEFASRC1_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC2_VX_ADDR 0x670 +#define OMAP_ABE_C_COEFASRC2_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC3_VX_ADDR 0x6BC +#define OMAP_ABE_C_COEFASRC3_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC4_VX_ADDR 0x708 +#define OMAP_ABE_C_COEFASRC4_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC5_VX_ADDR 0x754 +#define OMAP_ABE_C_COEFASRC5_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC6_VX_ADDR 0x7A0 +#define OMAP_ABE_C_COEFASRC6_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC7_VX_ADDR 0x7EC +#define OMAP_ABE_C_COEFASRC7_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC8_VX_ADDR 0x838 +#define OMAP_ABE_C_COEFASRC8_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC9_VX_ADDR 0x884 +#define OMAP_ABE_C_COEFASRC9_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC10_VX_ADDR 0x8D0 +#define OMAP_ABE_C_COEFASRC10_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC11_VX_ADDR 0x91C +#define OMAP_ABE_C_COEFASRC11_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC12_VX_ADDR 0x968 +#define OMAP_ABE_C_COEFASRC12_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC13_VX_ADDR 0x9B4 +#define OMAP_ABE_C_COEFASRC13_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC14_VX_ADDR 0xA00 +#define OMAP_ABE_C_COEFASRC14_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC15_VX_ADDR 0xA4C +#define OMAP_ABE_C_COEFASRC15_VX_SIZE 0x4C + +#define OMAP_ABE_C_COEFASRC16_VX_ADDR 0xA98 +#define OMAP_ABE_C_COEFASRC16_VX_SIZE 0x4C + +#define OMAP_ABE_C_ALPHACURRENT_UL_VX_ADDR 0xAE4 +#define OMAP_ABE_C_ALPHACURRENT_UL_VX_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_UL_VX_ADDR 0xAE8 +#define OMAP_ABE_C_BETACURRENT_UL_VX_SIZE 0x4 + +#define OMAP_ABE_C_ALPHACURRENT_DL_VX_ADDR 0xAEC +#define OMAP_ABE_C_ALPHACURRENT_DL_VX_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_DL_VX_ADDR 0xAF0 +#define OMAP_ABE_C_BETACURRENT_DL_VX_SIZE 0x4 + +#define OMAP_ABE_C_COEFASRC1_MM_ADDR 0xAF4 +#define OMAP_ABE_C_COEFASRC1_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC2_MM_ADDR 0xB3C +#define OMAP_ABE_C_COEFASRC2_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC3_MM_ADDR 0xB84 +#define OMAP_ABE_C_COEFASRC3_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC4_MM_ADDR 0xBCC +#define OMAP_ABE_C_COEFASRC4_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC5_MM_ADDR 0xC14 +#define OMAP_ABE_C_COEFASRC5_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC6_MM_ADDR 0xC5C +#define OMAP_ABE_C_COEFASRC6_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC7_MM_ADDR 0xCA4 +#define OMAP_ABE_C_COEFASRC7_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC8_MM_ADDR 0xCEC +#define OMAP_ABE_C_COEFASRC8_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC9_MM_ADDR 0xD34 +#define OMAP_ABE_C_COEFASRC9_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC10_MM_ADDR 0xD7C +#define OMAP_ABE_C_COEFASRC10_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC11_MM_ADDR 0xDC4 +#define OMAP_ABE_C_COEFASRC11_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC12_MM_ADDR 0xE0C +#define OMAP_ABE_C_COEFASRC12_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC13_MM_ADDR 0xE54 +#define OMAP_ABE_C_COEFASRC13_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC14_MM_ADDR 0xE9C +#define OMAP_ABE_C_COEFASRC14_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC15_MM_ADDR 0xEE4 +#define OMAP_ABE_C_COEFASRC15_MM_SIZE 0x48 + +#define OMAP_ABE_C_COEFASRC16_MM_ADDR 0xF2C +#define OMAP_ABE_C_COEFASRC16_MM_SIZE 0x48 + +#define OMAP_ABE_C_ALPHACURRENT_MM_EXT_IN_ADDR 0xF74 +#define OMAP_ABE_C_ALPHACURRENT_MM_EXT_IN_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_MM_EXT_IN_ADDR 0xF78 +#define OMAP_ABE_C_BETACURRENT_MM_EXT_IN_SIZE 0x4 + +#define OMAP_ABE_C_DL2_L_COEFS_ADDR 0xF7C +#define OMAP_ABE_C_DL2_L_COEFS_SIZE 0x64 + +#define OMAP_ABE_C_DL2_R_COEFS_ADDR 0xFE0 +#define OMAP_ABE_C_DL2_R_COEFS_SIZE 0x64 + +#define OMAP_ABE_C_DL1_COEFS_ADDR 0x1044 +#define OMAP_ABE_C_DL1_COEFS_SIZE 0x64 + +#define OMAP_ABE_C_SRC_3_LP_COEFS_ADDR 0x10A8 +#define OMAP_ABE_C_SRC_3_LP_COEFS_SIZE 0x2C + +#define OMAP_ABE_C_SRC_3_LP_GAIN_COEFS_ADDR 0x10D4 +#define OMAP_ABE_C_SRC_3_LP_GAIN_COEFS_SIZE 0x2C + +#define OMAP_ABE_C_SRC_3_HP_COEFS_ADDR 0x1100 +#define OMAP_ABE_C_SRC_3_HP_COEFS_SIZE 0x14 + +#define OMAP_ABE_C_SRC_6_LP_COEFS_ADDR 0x1114 +#define OMAP_ABE_C_SRC_6_LP_COEFS_SIZE 0x2C + +#define OMAP_ABE_C_SRC_6_LP_GAIN_COEFS_ADDR 0x1140 +#define OMAP_ABE_C_SRC_6_LP_GAIN_COEFS_SIZE 0x2C + +#define OMAP_ABE_C_SRC_6_HP_COEFS_ADDR 0x116C +#define OMAP_ABE_C_SRC_6_HP_COEFS_SIZE 0x1C + +#define OMAP_ABE_C_APS_DL1_COEFFS1_ADDR 0x1188 +#define OMAP_ABE_C_APS_DL1_COEFFS1_SIZE 0x24 + +#define OMAP_ABE_C_APS_DL1_M_COEFFS2_ADDR 0x11AC +#define OMAP_ABE_C_APS_DL1_M_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_APS_DL1_C_COEFFS2_ADDR 0x11B8 +#define OMAP_ABE_C_APS_DL1_C_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_APS_DL2_L_COEFFS1_ADDR 0x11C4 +#define OMAP_ABE_C_APS_DL2_L_COEFFS1_SIZE 0x24 + +#define OMAP_ABE_C_APS_DL2_R_COEFFS1_ADDR 0x11E8 +#define OMAP_ABE_C_APS_DL2_R_COEFFS1_SIZE 0x24 + +#define OMAP_ABE_C_APS_DL2_L_M_COEFFS2_ADDR 0x120C +#define OMAP_ABE_C_APS_DL2_L_M_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_APS_DL2_R_M_COEFFS2_ADDR 0x1218 +#define OMAP_ABE_C_APS_DL2_R_M_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_APS_DL2_L_C_COEFFS2_ADDR 0x1224 +#define OMAP_ABE_C_APS_DL2_L_C_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_APS_DL2_R_C_COEFFS2_ADDR 0x1230 +#define OMAP_ABE_C_APS_DL2_R_C_COEFFS2_SIZE 0xC + +#define OMAP_ABE_C_ALPHACURRENT_ECHO_REF_ADDR 0x123C +#define OMAP_ABE_C_ALPHACURRENT_ECHO_REF_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_ECHO_REF_ADDR 0x1240 +#define OMAP_ABE_C_BETACURRENT_ECHO_REF_SIZE 0x4 + +#define OMAP_ABE_C_APS_DL1_EQ_ADDR 0x1244 +#define OMAP_ABE_C_APS_DL1_EQ_SIZE 0x24 + +#define OMAP_ABE_C_APS_DL2_L_EQ_ADDR 0x1268 +#define OMAP_ABE_C_APS_DL2_L_EQ_SIZE 0x24 + +#define OMAP_ABE_C_APS_DL2_R_EQ_ADDR 0x128C +#define OMAP_ABE_C_APS_DL2_R_EQ_SIZE 0x24 + +#define OMAP_ABE_C_VIBRA2_CONSTS_ADDR 0x12B0 +#define OMAP_ABE_C_VIBRA2_CONSTS_SIZE 0x10 + +#define OMAP_ABE_C_VIBRA1_COEFFS_ADDR 0x12C0 +#define OMAP_ABE_C_VIBRA1_COEFFS_SIZE 0x2C + +#define OMAP_ABE_C_48_96_LP_COEFS_ADDR 0x12EC +#define OMAP_ABE_C_48_96_LP_COEFS_SIZE 0x3C + +#define OMAP_ABE_C_96_48_AMIC_COEFS_ADDR 0x1328 +#define OMAP_ABE_C_96_48_AMIC_COEFS_SIZE 0x4C + +#define OMAP_ABE_C_96_48_DMIC_COEFS_ADDR 0x1374 +#define OMAP_ABE_C_96_48_DMIC_COEFS_SIZE 0x4C + +#define OMAP_ABE_C_INPUT_SCALE_ADDR 0x13C0 +#define OMAP_ABE_C_INPUT_SCALE_SIZE 0x4 + +#define OMAP_ABE_C_OUTPUT_SCALE_ADDR 0x13C4 +#define OMAP_ABE_C_OUTPUT_SCALE_SIZE 0x4 + +#define OMAP_ABE_C_MUTE_SCALING_ADDR 0x13C8 +#define OMAP_ABE_C_MUTE_SCALING_SIZE 0x4 + +#define OMAP_ABE_C_GAINS_0DB_ADDR 0x13CC +#define OMAP_ABE_C_GAINS_0DB_SIZE 0x8 + +#define OMAP_ABE_C_ALPHACURRENT_BT_UL_ADDR 0x13D4 +#define OMAP_ABE_C_ALPHACURRENT_BT_UL_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_BT_UL_ADDR 0x13D8 +#define OMAP_ABE_C_BETACURRENT_BT_UL_SIZE 0x4 + +#define OMAP_ABE_C_ALPHACURRENT_BT_DL_ADDR 0x13DC +#define OMAP_ABE_C_ALPHACURRENT_BT_DL_SIZE 0x4 + +#define OMAP_ABE_C_BETACURRENT_BT_DL_ADDR 0x13E0 +#define OMAP_ABE_C_BETACURRENT_BT_DL_SIZE 0x4 diff --git a/sound/soc/omap/abe/abe_core.c b/sound/soc/omap/abe/abe_core.c new file mode 100644 index 0000000..da24b7a --- /dev/null +++ b/sound/soc/omap/abe/abe_core.c @@ -0,0 +1,574 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dbg.h" +#include "abe.h" +#include "abe_gain.h" +#include "abe_aess.h" +#include "abe_port.h" +#include "abe_mem.h" + +#define OMAP_ABE_IRQ_FIFO_MASK ((OMAP_ABE_D_MCUIRQFIFO_SIZE >> 2) - 1) + +void abe_init_asrc_vx_dl(s32 dppm); +void abe_init_asrc_vx_ul(s32 dppm); +void abe_init_asrc_mm_ext_in(s32 dppm); +void abe_init_asrc_bt_ul(s32 dppm); +void abe_init_asrc_bt_dl(s32 dppm); + +void abe_irq_aps(u32 aps_info); +void abe_irq_ping_pong(void); +void abe_irq_check_for_sequences(u32 seq_info); +extern u32 abe_size_pingpong; +extern u32 abe_base_address_pingpong[]; + +void abe_add_subroutine(u32 *id, abe_subroutine2 f, u32 nparam, u32 *params); + + +/** + * abe_omap_abe_reset_hal - reset the ABE/HAL + * @abe: Pointer on abe handle + * + * Operations : reset the ABE by reloading the static variables and + * default AESS registers. + * Called after a PRCM cold-start reset of ABE + */ +int omap_abe_reset_hal(struct omap_abe *abe) +{ + u32 i; + + omap_abe_dbg_reset(&abe->dbg); + + _log(ABE_ID_RESET_HAL, 0, 0, 0); + + /* IRQ & DBG circular read pointer in DMEM */ + abe->irq_dbg_read_ptr = 0; + + /* default = disable the mixer's adaptive gain control */ + omap_abe_use_compensated_gain(abe, 0); + + /* reset the default gain values */ + for (i = 0; i < MAX_NBGAIN_CMEM; i++) { + abe->muted_gains_indicator[i] = 0; + abe->desired_gains_decibel[i] = (u32) GAIN_MUTE; + abe->desired_gains_linear[i] = 0; + abe->desired_ramp_delay_ms[i] = 0; + abe->muted_gains_decibel[i] = (u32) GAIN_TOOLOW; + } + omap_abe_hw_configuration(abe); + return 0; +} +EXPORT_SYMBOL(omap_abe_reset_hal); + +/** + * omap_abe_wakeup - Wakeup ABE + * @abe: Pointer on abe handle + * + * Wakeup ABE in case of retention + */ +int omap_abe_wakeup(struct omap_abe *abe) +{ + /* Restart event generator */ + omap_abe_write_event_generator(abe, EVENT_TIMER); + + /* reconfigure DMA Req and MCU Irq visibility */ + omap_abe_hw_configuration(abe); + return 0; +} +EXPORT_SYMBOL(omap_abe_wakeup); + +/** + * abe_monitoring + * + * checks the internal status of ABE and HAL + */ +void abe_monitoring(void) +{ +} + +/** + * omap_abe_irq_processing - Process ABE interrupt + * @abe: Pointer on abe handle + * + * This subroutine is call upon reception of "MA_IRQ_99 ABE_MPU_IRQ" Audio + * back-end interrupt. This subroutine will check the ATC Hrdware, the + * IRQ_FIFO from the AE and act accordingly. Some IRQ source are originated + * for the delivery of "end of time sequenced tasks" notifications, some are + * originated from the Ping-Pong protocols, some are generated from + * the embedded debugger when the firmware stops on programmable break-points, + * etc ... + */ +int omap_abe_irq_processing(struct omap_abe *abe) +{ + u32 abe_irq_dbg_write_ptr, i, cmem_src, sm_cm; + abe_irq_data_t IRQ_data; + + _log(ABE_ID_IRQ_PROCESSING, 0, 0, 0); + + /* extract the write pointer index from CMEM memory (INITPTR format) */ + /* CMEM address of the write pointer in bytes */ + cmem_src = MCU_IRQ_FIFO_ptr_labelID << 2; + omap_abe_mem_read(abe, OMAP_ABE_CMEM, cmem_src, + &sm_cm, sizeof(abe_irq_dbg_write_ptr)); + /* AESS left-pointer index located on MSBs */ + abe_irq_dbg_write_ptr = sm_cm >> 16; + abe_irq_dbg_write_ptr &= 0xFF; + /* loop on the IRQ FIFO content */ + for (i = 0; i < OMAP_ABE_D_MCUIRQFIFO_SIZE; i++) { + /* stop when the FIFO is empty */ + if (abe_irq_dbg_write_ptr == abe->irq_dbg_read_ptr) + break; + /* read the IRQ/DBG FIFO */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + (OMAP_ABE_D_MCUIRQFIFO_ADDR + + (abe->irq_dbg_read_ptr << 2)), + (u32 *) &IRQ_data, sizeof(IRQ_data)); + abe->irq_dbg_read_ptr = (abe->irq_dbg_read_ptr + 1) & OMAP_ABE_IRQ_FIFO_MASK; + /* select the source of the interrupt */ + switch (IRQ_data.tag) { + case IRQtag_APS: + _log(ABE_ID_IRQ_PROCESSING, IRQ_data.data, 0, 1); + abe_irq_aps(IRQ_data.data); + break; + case IRQtag_PP: + _log(ABE_ID_IRQ_PROCESSING, 0, 0, 2); + abe_irq_ping_pong(); + break; + case IRQtag_COUNT: + _log(ABE_ID_IRQ_PROCESSING, IRQ_data.data, 0, 3); + abe_irq_check_for_sequences(IRQ_data.data); + break; + default: + break; + } + } + abe_monitoring(); + return 0; +} +EXPORT_SYMBOL(omap_abe_irq_processing); + +/** + * oamp_abe_set_ping_pong_buffer + * @abe: Pointer on abe handle + * @port: ABE port ID + * @n_bytes: Size of Ping/Pong buffer + * + * Updates the next ping-pong buffer with "size" bytes copied from the + * host processor. This API notifies the FW that the data transfer is done. + */ +int omap_abe_set_ping_pong_buffer(struct omap_abe *abe, u32 port, u32 n_bytes) +{ + u32 sio_pp_desc_address, struct_offset, n_samples, datasize, + base_and_size, *src; + struct ABE_SPingPongDescriptor desc_pp; + + _log(ABE_ID_SET_PING_PONG_BUFFER, port, n_bytes, n_bytes >> 8); + + /* ping_pong is only supported on MM_DL */ + if (port != OMAP_ABE_MM_DL_PORT) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } + /* translates the number of bytes in samples */ + /* data size in DMEM words */ + datasize = omap_abe_dma_port_iter_factor((struct omap_abe_data_format *)&((abe_port[port]).format)); + /* data size in bytes */ + datasize = datasize << 2; + n_samples = n_bytes / datasize; + omap_abe_mem_read(abe, OMAP_ABE_DMEM, OMAP_ABE_D_PINGPONGDESC_ADDR, + (u32 *) &desc_pp, sizeof(desc_pp)); + /* + * read the port SIO descriptor and extract the current pointer + * address after reading the counter + */ + if ((desc_pp.counter & 0x1) == 0) { + struct_offset = (u32) &(desc_pp.nextbuff0_BaseAddr) - + (u32) &(desc_pp); + base_and_size = desc_pp.nextbuff0_BaseAddr; + } else { + struct_offset = (u32) &(desc_pp.nextbuff1_BaseAddr) - + (u32) &(desc_pp); + base_and_size = desc_pp.nextbuff1_BaseAddr; + } + base_and_size = (base_and_size & 0xFFFFL) + (n_samples << 16); + sio_pp_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR + struct_offset; + src = &base_and_size; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, sio_pp_desc_address, + (u32 *) &base_and_size, sizeof(u32)); + + return 0; +} +EXPORT_SYMBOL(omap_abe_set_ping_pong_buffer); + +/** + * omap_abe_read_next_ping_pong_buffer + * @abe: Pointer on abe handle + * @port: ABE portID + * @p: Next buffer address (pointer) + * @n: Next buffer size (pointer) + * + * Tell the next base address of the next ping_pong Buffer and its size + */ +int omap_abe_read_next_ping_pong_buffer(struct omap_abe *abe, u32 port, u32 *p, u32 *n) +{ + u32 sio_pp_desc_address; + struct ABE_SPingPongDescriptor desc_pp; + + _log(ABE_ID_READ_NEXT_PING_PONG_BUFFER, port, 0, 0); + + /* ping_pong is only supported on MM_DL */ + if (port != OMAP_ABE_MM_DL_PORT) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } + /* read the port SIO descriptor and extract the current pointer + address after reading the counter */ + sio_pp_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR; + omap_abe_mem_read(abe, OMAP_ABE_DMEM, sio_pp_desc_address, + (u32 *) &desc_pp, sizeof(struct ABE_SPingPongDescriptor)); + if ((desc_pp.counter & 0x1) == 0) { + _log(ABE_ID_READ_NEXT_PING_PONG_BUFFER, port, 0, 0); + *p = desc_pp.nextbuff0_BaseAddr; + } else { + _log(ABE_ID_READ_NEXT_PING_PONG_BUFFER, port, 1, 0); + *p = desc_pp.nextbuff1_BaseAddr; + } + /* translates the number of samples in bytes */ + *n = abe_size_pingpong; + + return 0; +} +EXPORT_SYMBOL(omap_abe_read_next_ping_pong_buffer); + +/** + * omap_abe_init_ping_pong_buffer + * @abe: Pointer on abe handle + * @id: ABE port ID + * @size_bytes:size of the ping pong + * @n_buffers:number of buffers (2 = ping/pong) + * @p:returned address of the ping-pong list of base addresses + * (byte offset from DMEM start) + * + * Computes the base address of the ping_pong buffers + */ +int omap_abe_init_ping_pong_buffer(struct omap_abe *abe, + u32 id, u32 size_bytes, u32 n_buffers, + u32 *p) +{ + u32 i, dmem_addr; + + _log(ABE_ID_INIT_PING_PONG_BUFFER, id, size_bytes, n_buffers); + + /* ping_pong is supported in 2 buffers configuration right now but FW + is ready for ping/pong/pung/pang... */ + if (id != OMAP_ABE_MM_DL_PORT || n_buffers > MAX_PINGPONG_BUFFERS) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } + for (i = 0; i < n_buffers; i++) { + dmem_addr = OMAP_ABE_D_PING_ADDR + (i * size_bytes); + /* base addresses of the ping pong buffers in U8 unit */ + abe_base_address_pingpong[i] = dmem_addr; + } + /* global data */ + abe_size_pingpong = size_bytes; + *p = (u32) OMAP_ABE_D_PING_ADDR; + return 0; +} +EXPORT_SYMBOL(omap_abe_init_ping_pong_buffer); + +/** + * omap_abe_read_offset_from_ping_buffer + * @abe: Pointer on abe handle + * @id: ABE port ID + * @n: returned address of the offset + * from the ping buffer start address (in samples) + * + * Computes the current firmware ping pong read pointer location, + * expressed in samples, as the offset from the start address of ping buffer. + */ +int omap_abe_read_offset_from_ping_buffer(struct omap_abe *abe, + u32 id, u32 *n) +{ + u32 sio_pp_desc_address; + struct ABE_SPingPongDescriptor desc_pp; + + /* ping_pong is only supported on MM_DL */ + if (OMAP_ABE_MM_DL_PORT != id) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } else { + /* read the port SIO ping pong descriptor */ + sio_pp_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR; + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + sio_pp_desc_address, (u32 *) &desc_pp, + sizeof(struct ABE_SPingPongDescriptor)); + /* extract the current ping pong buffer read pointer based on + the value of the counter */ + if ((desc_pp.counter & 0x1) == 0) { + /* the next is buffer0, hence the current is buffer1 */ + switch (abe_port[OMAP_ABE_MM_DL_PORT].format.samp_format) { + case MONO_MSB: + case MONO_RSHIFTED_16: + case STEREO_16_16: + *n = abe_size_pingpong / 4 + + desc_pp.nextbuff1_Samples - + desc_pp.workbuff_Samples; + break; + case STEREO_MSB: + case STEREO_RSHIFTED_16: + *n = abe_size_pingpong / 8 + + desc_pp.nextbuff1_Samples - + desc_pp.workbuff_Samples; + break; + default: + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + break; + } + } else { + /* the next is buffer1, hence the current is buffer0 */ + *n = desc_pp.nextbuff0_Samples - + desc_pp.workbuff_Samples; + } + } + + return 0; +} +EXPORT_SYMBOL(omap_abe_read_offset_from_ping_buffer); + +/** + * abe_set_router_configuration + * @Id: name of the router + * @Conf: id of the configuration + * @param: list of output index of the route + * + * The uplink router takes its input from DMIC (6 samples), AMIC (2 samples) + * and PORT1/2 (2 stereo ports). Each sample will be individually stored in + * an intermediate table of 10 elements. + * + * Example of router table parameter for voice uplink with phoenix microphones + * + * indexes 0 .. 9 = MM_UL description (digital MICs and MMEXTIN) + * DMIC1_L_labelID, DMIC1_R_labelID, DMIC2_L_labelID, DMIC2_R_labelID, + * MM_EXT_IN_L_labelID, MM_EXT_IN_R_labelID, ZERO_labelID, ZERO_labelID, + * ZERO_labelID, ZERO_labelID, + * indexes 10 .. 11 = MM_UL2 description (recording on DMIC3) + * DMIC3_L_labelID, DMIC3_R_labelID, + * indexes 12 .. 13 = VX_UL description (VXUL based on PDMUL data) + * AMIC_L_labelID, AMIC_R_labelID, + * indexes 14 .. 15 = RESERVED (NULL) + * ZERO_labelID, ZERO_labelID, + */ +int omap_abe_set_router_configuration(struct omap_abe *abe, + u32 id, u32 k, u32 *param) +{ + _log(ABE_ID_SET_ROUTER_CONFIGURATION, id, (u32) param, (u32) param >> 8); + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_AUPLINKROUTING_ADDR, + param, OMAP_ABE_D_AUPLINKROUTING_SIZE); + return 0; +} +EXPORT_SYMBOL(omap_abe_set_router_configuration); + +/** + * abe_set_opp_processing - Set OPP mode for ABE Firmware + * @opp: OOPP mode + * + * New processing network and OPP: + * 0: Ultra Lowest power consumption audio player (no post-processing, no mixer) + * 1: OPP 25% (simple multimedia features, including low-power player) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% ( multimedia complex use-cases) + * + * Rearranges the FW task network to the corresponding OPP list of features. + * The corresponding AE ports are supposed to be set/reset accordingly before + * this switch. + * + */ +int omap_abe_set_opp_processing(struct omap_abe *abe, u32 opp) +{ + u32 dOppMode32, sio_desc_address; + struct ABE_SIODescriptor sio_desc; + + _log(ABE_ID_SET_OPP_PROCESSING, opp, 0, 0); + + switch (opp) { + case ABE_OPP25: + /* OPP25% */ + dOppMode32 = DOPPMODE32_OPP25; + break; + case ABE_OPP50: + /* OPP50% */ + dOppMode32 = DOPPMODE32_OPP50; + break; + default: + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_BLOCK_COPY_ERR); + case ABE_OPP100: + /* OPP100% */ + dOppMode32 = DOPPMODE32_OPP100; + break; + } + /* Write Multiframe inside DMEM */ + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MAXTASKBYTESINSLOT_ADDR, &dOppMode32, sizeof(u32)); + sio_desc_address = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_MM_EXT_IN_PORT * + sizeof(struct ABE_SIODescriptor)); + omap_abe_mem_read(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + if (dOppMode32 == DOPPMODE32_OPP100) { + /* ASRC input buffer, size 40 */ + sio_desc.smem_addr1 = smem_mm_ext_in_opp100; + /* Init MM_EXT_IN ASRC and enable its adaptation */ + abe_init_asrc_mm_ext_in(250); + } else { + /* at OPP 50 or without ASRC */ + sio_desc.smem_addr1 = smem_mm_ext_in_opp50; + } + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + + sio_desc_address = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_BT_VX_UL_PORT * + sizeof(struct ABE_SIODescriptor)); + omap_abe_mem_read(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + if (dOppMode32 == DOPPMODE32_OPP100) { + /* ASRC input buffer, size 40 */ + sio_desc.smem_addr1 = smem_bt_vx_ul_opp100; + /* Init MM_EXT_IN ASRC and enable its adaptation */ + abe_init_asrc_bt_ul(250); + } else { + /* at OPP 50 or without ASRC */ + sio_desc.smem_addr1 = smem_bt_vx_ul_opp50; + } + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + + sio_desc_address = OMAP_ABE_D_IODESCR_ADDR + (OMAP_ABE_BT_VX_DL_PORT * + sizeof(struct ABE_SIODescriptor)); + omap_abe_mem_read(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + if (dOppMode32 == DOPPMODE32_OPP100) { + /* ASRC input buffer, size 40 */ + sio_desc.smem_addr1 = smem_bt_vx_dl_opp100; + /* Init MM_EXT_IN ASRC and enable its adaptation */ + abe_init_asrc_bt_dl(250); + } else { + /* at OPP 50 or without ASRC */ + sio_desc.smem_addr1 = smem_bt_vx_dl_opp50; + } + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, sio_desc_address, + (u32 *) &sio_desc, sizeof(sio_desc)); + + return 0; + +} +EXPORT_SYMBOL(omap_abe_set_opp_processing); + +/** + * omap_abe_check_activity - Check if some ABE activity. + * + * Check if any ABE ports are running. + * return 1: still activity on ABE + * return 0: no more activity on ABE. Event generator can be stopped + * + */ +int omap_abe_check_activity(struct omap_abe *abe) +{ + int i, ret = 0; + + for (i = 0; i < (LAST_PORT_ID - 1); i++) { + if (abe_port[abe_port_priority[i]].status == + OMAP_ABE_PORT_ACTIVITY_RUNNING) + break; + } + if (i < (LAST_PORT_ID - 1)) + ret = 1; + return ret; +} +EXPORT_SYMBOL(omap_abe_check_activity); + +/** + * abe_plug_subroutine + * @id: returned sequence index after plugging a new subroutine + * @f: subroutine address to be inserted + * @n: number of parameters of this subroutine + * @params: pointer on parameters + * + * register a list of subroutines for call-back purpose + */ +abehal_status abe_plug_subroutine(u32 *id, abe_subroutine2 f, u32 n, + u32 *params) +{ + _log(ABE_ID_PLUG_SUBROUTINE, (u32) (*id), (u32) f, n); + + abe_add_subroutine(id, (abe_subroutine2) f, n, (u32 *) params); + return 0; +} +EXPORT_SYMBOL(abe_plug_subroutine); diff --git a/sound/soc/omap/abe/abe_dat.c b/sound/soc/omap/abe/abe_dat.c new file mode 100644 index 0000000..62ec791 --- /dev/null +++ b/sound/soc/omap/abe/abe_dat.c @@ -0,0 +1,458 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include "abe_legacy.h" + +struct omap_abe *abe; + +/* + * HAL/FW ports status / format / sampling / protocol(call_back) / features + * / gain / name + */ +abe_port_t abe_port[LAST_PORT_ID]; /* list of ABE ports */ +const abe_port_t abe_port_init[LAST_PORT_ID] = { + /* Status Data Format Drift Call-Back Protocol+selector desc_addr; + buf_addr; buf_size; iter; irq_addr irq_data DMA_T $Features + reseted at start Port Name for the debug trace */ + /* DMIC */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {96000, SIX_MSB}, + NODRIFT, NOCALLBACK, 0, (DMIC_ITER/6), + { + SNK_P, DMIC_PORT_PROT, + {{dmem_dmic, dmem_dmic_size, DMIC_ITER} } + }, + {0, 0}, + {EQDMIC, 0}, "DMIC"}, + /* PDM_UL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {96000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_amic, (MCPDM_UL_ITER/2), + { + SNK_P, MCPDMUL_PORT_PROT, + {{dmem_amic, dmem_amic_size, MCPDM_UL_ITER} } + }, + {0, 0}, + {EQAMIC, 0}, "PDM_UL"}, + /* BT_VX_UL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {8000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_bt_vx_ul_opp50, 1, + { + SNK_P, SERIAL_PORT_PROT, {{ + (MCBSP1_DMA_TX*ATC_SIZE), + dmem_bt_vx_ul, + dmem_bt_vx_ul_size, + (1*SCHED_LOOP_8kHz) + } } + }, + {0, 0}, {0}, "BT_VX_UL"}, + /* MM_UL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_mm_ul, 1, + { + SRC_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX3*ATC_SIZE), + dmem_mm_ul, dmem_mm_ul_size, + (10*SCHED_LOOP_48kHz), + ABE_DMASTATUS_RAW, (1 << 3) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__3, 120}, + {UPROUTE, 0}, "MM_UL"}, + /* MM_UL2 */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_mm_ul2, 1, + { + SRC_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX4*ATC_SIZE), + dmem_mm_ul2, dmem_mm_ul2_size, + (2*SCHED_LOOP_48kHz), + ABE_DMASTATUS_RAW, (1 << 4) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__4, 24}, + {UPROUTE, 0}, "MM_UL2"}, + /* VX_UL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {8000, MONO_MSB}, + NODRIFT, NOCALLBACK, smem_vx_ul, 1, + { + SRC_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX2*ATC_SIZE), + dmem_vx_ul, dmem_vx_ul_size, + (1*SCHED_LOOP_8kHz), + ABE_DMASTATUS_RAW, (1 << 2) + } } + }, { + CIRCULAR_BUFFER_PERIPHERAL_R__2, 2}, + {ASRC2, 0}, "VX_UL"}, + /* MM_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_mm_dl, 1, + { + SNK_P, PINGPONG_PORT_PROT, {{ + (CBPr_DMA_RTX0*ATC_SIZE), + dmem_mm_dl, dmem_mm_dl_size, + (2*SCHED_LOOP_48kHz), + ABE_DMASTATUS_RAW, (1 << 0) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__0, 24}, + {ASRC3, 0}, "MM_DL"}, + /* VX_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {8000, MONO_MSB}, + NODRIFT, NOCALLBACK, smem_vx_dl, 1, + { + SNK_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX1*ATC_SIZE), + dmem_vx_dl, dmem_vx_dl_size, + (1*SCHED_LOOP_8kHz), + ABE_DMASTATUS_RAW, (1 << 1) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__1, 2}, + {ASRC1, 0}, "VX_DL"}, + /* TONES_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_tones_dl, 1, + { + SNK_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX5*ATC_SIZE), + dmem_tones_dl, + dmem_tones_dl_size, + (2*SCHED_LOOP_48kHz), + ABE_DMASTATUS_RAW, (1 << 5) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__5, 24}, + {0}, "TONES_DL"}, + /* VIB_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {24000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_vib, 1, + { + SNK_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX6*ATC_SIZE), + dmem_vib_dl, dmem_vib_dl_size, + (2*SCHED_LOOP_24kHz), + ABE_DMASTATUS_RAW, (1 << 6) + } } + }, + {CIRCULAR_BUFFER_PERIPHERAL_R__6, 12}, + {0}, "VIB_DL"}, + /* BT_VX_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {8000, MONO_MSB}, + NODRIFT, NOCALLBACK, smem_bt_vx_dl_opp50, 1, + { + SRC_P, SERIAL_PORT_PROT, {{ + (MCBSP1_DMA_RX*ATC_SIZE), + dmem_bt_vx_dl, + dmem_bt_vx_dl_size, + (1*SCHED_LOOP_8kHz), + } } + }, + {0, 0}, {0}, "BT_VX_DL"}, + /* PDM_DL */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {96000, SIX_MSB}, + NODRIFT, NOCALLBACK, 0, (MCPDM_DL_ITER/6), + {SRC_P, MCPDMDL_PORT_PROT, {{dmem_mcpdm, + dmem_mcpdm_size} } }, + {0, 0}, + {MIXDL1, EQ1, APS1, MIXDL2, EQ2L, EQ2R, APS2L, APS2R, 0}, + "PDM_DL"}, + /* MM_EXT_OUT */ + { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_mm_ext_out, 1, + { + SRC_P, SERIAL_PORT_PROT, {{ + (MCBSP1_DMA_TX*ATC_SIZE), + dmem_mm_ext_out, dmem_mm_ext_out_size, + (2*SCHED_LOOP_48kHz) + } } + }, {0, 0}, {0}, "MM_EXT_OUT"}, + /* MM_EXT_IN */ + { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, smem_mm_ext_in_opp100, 1, + { + SNK_P, SERIAL_PORT_PROT, {{ + (MCBSP1_DMA_RX*ATC_SIZE), + dmem_mm_ext_in, dmem_mm_ext_in_size, + (2*SCHED_LOOP_48kHz) + } } + }, + {0, 0}, {0}, "MM_EXT_IN"}, + /* PCM3_TX */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, 0, 1, + { + SRC_P, TDM_SERIAL_PORT_PROT, {{ + (MCBSP3_DMA_TX * + ATC_SIZE), + dmem_mm_ext_out, + dmem_mm_ext_out_size, + (2*SCHED_LOOP_48kHz) + } } + }, + {0, 0}, {0}, "TDM_OUT"}, + /* PCM3_RX */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, STEREO_MSB}, + NODRIFT, NOCALLBACK, 0, 1, + { + SRC_P, TDM_SERIAL_PORT_PROT, {{ + (MCBSP3_DMA_RX * + ATC_SIZE), + dmem_mm_ext_in, + dmem_mm_ext_in_size, + (2*SCHED_LOOP_48kHz) + } } + }, + {0, 0}, {0}, "TDM_IN"}, + /* SCHD_DBG_PORT */ { + OMAP_ABE_PORT_ACTIVITY_IDLE, {48000, MONO_MSB}, + NODRIFT, NOCALLBACK, 0, 1, + { + SRC_P, DMAREQ_PORT_PROT, {{ + (CBPr_DMA_RTX7 * + ATC_SIZE), + dmem_mm_trace, + dmem_mm_trace_size, + (2*SCHED_LOOP_48kHz), + ABE_DMASTATUS_RAW, + (1 << 4) + } } + }, {CIRCULAR_BUFFER_PERIPHERAL_R__7, 24}, + {FEAT_SEQ, FEAT_CTL, FEAT_GAINS, 0}, "SCHD_DBG"}, +}; +/* + * AESS/ATC destination and source address translation (except McASPs) + * from the original 64bits words address + */ +const u32 abe_atc_dstid[ABE_ATC_DESC_SIZE >> 3] = { + /* DMA_0 DMIC PDM_DL PDM_UL McB1TX McB1RX McB2TX McB2RX 0 .. 7 */ + 0, 0, 12, 0, 1, 0, 2, 0, + /* McB3TX McB3RX SLIMT0 SLIMT1 SLIMT2 SLIMT3 SLIMT4 SLIMT5 8 .. 15 */ + 3, 0, 4, 5, 6, 7, 8, 9, + /* SLIMT6 SLIMT7 SLIMR0 SLIMR1 SLIMR2 SLIMR3 SLIMR4 SLIMR5 16 .. 23 */ + 10, 11, 0, 0, 0, 0, 0, 0, + /* SLIMR6 SLIMR7 McASP1X ----- ----- McASP1R ----- ----- 24 .. 31 */ + 0, 0, 14, 0, 0, 0, 0, 0, + /* CBPrT0 CBPrT1 CBPrT2 CBPrT3 CBPrT4 CBPrT5 CBPrT6 CBPrT7 32 .. 39 */ + 63, 63, 63, 63, 63, 63, 63, 63, + /* CBP_T0 CBP_T1 CBP_T2 CBP_T3 CBP_T4 CBP_T5 CBP_T6 CBP_T7 40 .. 47 */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* CBP_T8 CBP_T9 CBP_T10 CBP_T11 CBP_T12 CBP_T13 CBP_T14 + CBP_T15 48 .. 63 */ + 0, 0, 0, 0, 0, 0, 0, 0, +}; +const u32 abe_atc_srcid[ABE_ATC_DESC_SIZE >> 3] = { + /* DMA_0 DMIC PDM_DL PDM_UL McB1TX McB1RX McB2TX McB2RX 0 .. 7 */ + 0, 12, 0, 13, 0, 1, 0, 2, + /* McB3TX McB3RX SLIMT0 SLIMT1 SLIMT2 SLIMT3 SLIMT4 SLIMT5 8 .. 15 */ + 0, 3, 0, 0, 0, 0, 0, 0, + /* SLIMT6 SLIMT7 SLIMR0 SLIMR1 SLIMR2 SLIMR3 SLIMR4 SLIMR5 16 .. 23 */ + 0, 0, 4, 5, 6, 7, 8, 9, + /* SLIMR6 SLIMR7 McASP1X ----- ----- McASP1R ----- ----- 24 .. 31 */ + 10, 11, 0, 0, 0, 14, 0, 0, + /* CBPrT0 CBPrT1 CBPrT2 CBPrT3 CBPrT4 CBPrT5 CBPrT6 CBPrT7 32 .. 39 */ + 63, 63, 63, 63, 63, 63, 63, 63, + /* CBP_T0 CBP_T1 CBP_T2 CBP_T3 CBP_T4 CBP_T5 CBP_T6 CBP_T7 40 .. 47 */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* CBP_T8 CBP_T9 CBP_T10 CBP_T11 CBP_T12 CBP_T13 CBP_T14 + CBP_T15 48 .. 63 */ + 0, 0, 0, 0, 0, 0, 0, 0, +}; +/* + * preset default routing configurations + * This is given as implementation EXAMPLES + * the programmer uses "abe_set_router_configuration" with its own tables + */ +const abe_router_t abe_router_ul_table_preset[NBROUTE_CONFIG][NBROUTE_UL] = { + /* VOICE UPLINK WITH PHOENIX MICROPHONES - UPROUTE_CONFIG_AMIC */ + { + /* 0 .. 9 = MM_UL */ + DMIC1_L_labelID, DMIC1_R_labelID, DMIC2_L_labelID, DMIC2_R_labelID, + MM_EXT_IN_L_labelID, MM_EXT_IN_R_labelID, AMIC_L_labelID, + AMIC_L_labelID, + ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + AMIC_L_labelID, AMIC_L_labelID, + /* 12 .. 13 = VX_UL */ + AMIC_L_labelID, AMIC_R_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, + /* VOICE UPLINK WITH THE FIRST DMIC PAIR - UPROUTE_CONFIG_DMIC1 */ + { + /* 0 .. 9 = MM_UL */ + DMIC2_L_labelID, DMIC2_R_labelID, DMIC3_L_labelID, DMIC3_R_labelID, + DMIC1_L_labelID, DMIC1_R_labelID, ZERO_labelID, ZERO_labelID, + ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + DMIC1_L_labelID, DMIC1_R_labelID, + /* 12 .. 13 = VX_UL */ + DMIC1_L_labelID, DMIC1_R_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, + /* VOICE UPLINK WITH THE SECOND DMIC PAIR - UPROUTE_CONFIG_DMIC2 */ + { + /* 0 .. 9 = MM_UL */ + DMIC3_L_labelID, DMIC3_R_labelID, DMIC1_L_labelID, DMIC1_R_labelID, + DMIC2_L_labelID, DMIC2_R_labelID, ZERO_labelID, ZERO_labelID, + ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + DMIC2_L_labelID, DMIC2_R_labelID, + /* 12 .. 13 = VX_UL */ + DMIC2_L_labelID, DMIC2_R_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, + /* VOICE UPLINK WITH THE LAST DMIC PAIR - UPROUTE_CONFIG_DMIC3 */ + { + /* 0 .. 9 = MM_UL */ + AMIC_L_labelID, AMIC_R_labelID, DMIC2_L_labelID, DMIC2_R_labelID, + DMIC3_L_labelID, DMIC3_R_labelID, ZERO_labelID, ZERO_labelID, + ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + DMIC3_L_labelID, DMIC3_R_labelID, + /* 12 .. 13 = VX_UL */ + DMIC3_L_labelID, DMIC3_R_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, + /* VOICE UPLINK WITH THE BT - UPROUTE_CONFIG_BT */ + { + /* 0 .. 9 = MM_UL */ + BT_UL_L_labelID, BT_UL_R_labelID, DMIC2_L_labelID, DMIC2_R_labelID, + DMIC3_L_labelID, DMIC3_R_labelID, DMIC1_L_labelID, DMIC1_R_labelID, + ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + AMIC_L_labelID, AMIC_R_labelID, + /* 12 .. 13 = VX_UL */ + BT_UL_L_labelID, BT_UL_R_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, + /* VOICE UPLINK WITH THE BT - UPROUTE_ECHO_MMUL2 */ + { + /* 0 .. 9 = MM_UL */ + MM_EXT_IN_L_labelID, MM_EXT_IN_R_labelID, BT_UL_L_labelID, + BT_UL_R_labelID, AMIC_L_labelID, AMIC_R_labelID, + ZERO_labelID, ZERO_labelID, ZERO_labelID, ZERO_labelID, + /* 10 .. 11 = MM_UL2 */ + EchoRef_L_labelID, EchoRef_R_labelID, + /* 12 .. 13 = VX_UL */ + AMIC_L_labelID, AMIC_L_labelID, + /* 14 .. 15 = RESERVED */ + ZERO_labelID, ZERO_labelID, + }, +}; +/* all default routing configurations */ +abe_router_t abe_router_ul_table[NBROUTE_CONFIG_MAX][NBROUTE_UL]; + +const abe_sequence_t seq_null = { + NOMASK, {CL_M1, 0, {0, 0, 0, 0}, 0}, {CL_M1, 0, {0, 0, 0, 0}, 0} +}; +/* table of new subroutines called in the sequence */ +abe_subroutine2 abe_all_subsubroutine[MAXNBSUBROUTINE]; +/* number of parameters per calls */ +u32 abe_all_subsubroutine_nparam[MAXNBSUBROUTINE]; +/* index of the subroutine */ +u32 abe_subroutine_id[MAXNBSUBROUTINE]; +/* paramters of the subroutine (if any) */ +u32 *abe_all_subroutine_params[MAXNBSUBROUTINE]; +u32 abe_subroutine_write_pointer; +/* table of all sequences */ +abe_sequence_t abe_all_sequence[MAXNBSEQUENCE]; +u32 abe_sequence_write_pointer; +/* current number of pending sequences (avoids to look in the table) */ +u32 abe_nb_pending_sequences; +/* pending sequences due to ressource collision */ +u32 abe_pending_sequences[MAXNBSEQUENCE]; +/* mask of unsharable ressources among other sequences */ +u32 abe_global_sequence_mask; +/* table of active sequences */ +abe_seq_t abe_active_sequence[MAXACTIVESEQUENCE][MAXSEQUENCESTEPS]; +/* index of the plugged subroutine doing ping-pong cache-flush DMEM accesses */ +u32 abe_irq_pingpong_player_id; +EXPORT_SYMBOL(abe_irq_pingpong_player_id); +/* index of the plugged subroutine doing acoustics protection adaptation */ +u32 abe_irq_aps_adaptation_id; +/* base addresses of the ping pong buffers in bytes addresses */ +u32 abe_base_address_pingpong[MAX_PINGPONG_BUFFERS]; +/* size of each ping/pong buffers */ +u32 abe_size_pingpong; +/* number of ping/pong buffer being used */ +u32 abe_nb_pingpong; +/* + * MAIN PORT SELECTION + */ +const u32 abe_port_priority[LAST_PORT_ID - 1] = { + OMAP_ABE_PDM_DL_PORT, + OMAP_ABE_PDM_UL_PORT, + OMAP_ABE_MM_EXT_OUT_PORT, + OMAP_ABE_MM_EXT_IN_PORT, + OMAP_ABE_DMIC_PORT, + OMAP_ABE_MM_UL_PORT, + OMAP_ABE_MM_UL2_PORT, + OMAP_ABE_MM_DL_PORT, + OMAP_ABE_TONES_DL_PORT, + OMAP_ABE_VX_UL_PORT, + OMAP_ABE_VX_DL_PORT, + OMAP_ABE_BT_VX_DL_PORT, + OMAP_ABE_BT_VX_UL_PORT, + OMAP_ABE_VIB_DL_PORT, +}; diff --git a/sound/soc/omap/abe/abe_dbg.c b/sound/soc/omap/abe/abe_dbg.c new file mode 100644 index 0000000..d1b160f --- /dev/null +++ b/sound/soc/omap/abe/abe_dbg.c @@ -0,0 +1,201 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dbg.h" +#include "abe.h" +#include "abe_mem.h" + +/** + * omap_abe_dbg_reset + * @dbg: Pointer on abe debug handle + * + * Called in order to reset Audio Back End debug global data. + * This ensures that ABE debug trace pointer is reset correctly. + */ +int omap_abe_dbg_reset(struct omap_abe_dbg *dbg) +{ + dbg->activity_log_write_pointer = 0; + dbg->mask = 0; + + return 0; +} + +/** + * omap_abe_connect_debug_trace + * @abe: Pointer on abe handle + * @dma2:pointer to the DMEM trace buffer + * + * returns the address and size of the real-time debug trace buffer, + * the content of which will vary from one firmware release to another + */ +int omap_abe_connect_debug_trace(struct omap_abe *abe, + struct omap_abe_dma *dma2) +{ + _log(ABE_ID_CONNECT_DEBUG_TRACE, 0, 0, 0); + + /* return tohe base address of the ping buffer in L3 and L4 spaces */ + (*dma2).data = (void *)(OMAP_ABE_D_DEBUG_FIFO_ADDR + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).l3_dmem = (void *)(OMAP_ABE_D_DEBUG_FIFO_ADDR + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).l4_dmem = (void *)(OMAP_ABE_D_DEBUG_FIFO_ADDR + + ABE_DEFAULT_BASE_ADDRESS_L4 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).iter = (OMAP_ABE_D_DEBUG_FIFO_SIZE + OMAP_ABE_D_DEBUG_FIFO_HAL_SIZE)>>2; + + return 0; +} +EXPORT_SYMBOL(omap_abe_connect_debug_trace); + +/** + * omap_abe_set_debug_trace + * @dbg: Pointer on abe debug handle + * @debug: debug log level + * + * Set the debug level for ABE trace. This level allows to manage the number + * of information put inside the ABE trace buffer. This buffer can contains + * both AESS firmware and MPU traces. + */ +int omap_abe_set_debug_trace(struct omap_abe_dbg *dbg, int debug) +{ + _log(ABE_ID_SET_DEBUG_TRACE, 0, 0, 0); + + dbg->mask = debug; + + return 0; +} +EXPORT_SYMBOL(omap_abe_set_debug_trace); + +/** + * omap_abe_dbg_log - Log ABE trace inside circular buffer + * @x: data to be logged + * @y: data to be logged + * @z: data to be logged + * @t: data to be logged + * Parameter : + * + * abe_dbg_activity_log : global circular buffer holding the data + * abe_dbg_activity_log_write_pointer : circular write pointer + * + * saves data in the log file + */ +void omap_abe_dbg_log(struct omap_abe *abe, u32 x, u32 y, u32 z, u32 t) +{ + u32 time_stamp, data; + struct omap_abe_dbg *dbg = &abe->dbg; + + if (dbg->activity_log_write_pointer >= + (OMAP_ABE_D_DEBUG_HAL_TASK_SIZE - 2)) + dbg->activity_log_write_pointer = 0; + + /* copy in DMEM trace buffer and CortexA9 local buffer and a small 7 + words circular buffer of the DMA trace ending with 0x55555555 + (tag for last word) */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, OMAP_ABE_D_LOOPCOUNTER_ADDR, + (u32 *) &time_stamp, sizeof(time_stamp)); + dbg->activity_log[dbg->activity_log_write_pointer] = time_stamp; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_DEBUG_HAL_TASK_ADDR + + (dbg->activity_log_write_pointer << 2), + (u32 *) &time_stamp, sizeof(time_stamp)); + dbg->activity_log_write_pointer++; + + data = ((x & MAX_UINT8) << 24) | ((y & MAX_UINT8) << 16) | + ((z & MAX_UINT8) << 8) + | (t & MAX_UINT8); + dbg->activity_log[dbg->activity_log_write_pointer] = data; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_DEBUG_HAL_TASK_ADDR + + (dbg->activity_log_write_pointer << 2), + (u32 *) &data, sizeof(data)); + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_DEBUG_FIFO_HAL_ADDR + + ((dbg->activity_log_write_pointer << 2) & + (OMAP_ABE_D_DEBUG_FIFO_HAL_SIZE - 1)), (u32 *) &data, + sizeof(data)); + + data = ABE_DBG_MAGIC_NUMBER; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_DEBUG_FIFO_HAL_ADDR + + (((dbg->activity_log_write_pointer + 1) << 2) & + (OMAP_ABE_D_DEBUG_FIFO_HAL_SIZE - 1)), + (u32 *) &data, sizeof(data)); + dbg->activity_log_write_pointer++; + + if (dbg->activity_log_write_pointer >= OMAP_ABE_D_DEBUG_HAL_TASK_SIZE) + dbg->activity_log_write_pointer = 0; +} + +/** + * omap_abe_dbg_error_log - Log ABE error + * @abe: Pointer on abe handle + * @level: level of error + * @error: error ID to log + * + * Log the ABE errors. + */ +void omap_abe_dbg_error(struct omap_abe *abe, int level, int error) +{ + omap_abe_dbg_log(abe, error, MAX_UINT8, MAX_UINT8, MAX_UINT8); +} diff --git a/sound/soc/omap/abe/abe_dbg.h b/sound/soc/omap/abe/abe_dbg.h new file mode 100644 index 0000000..2cdced9 --- /dev/null +++ b/sound/soc/omap/abe/abe_dbg.h @@ -0,0 +1,206 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_DBG_H_ +#define _ABE_DBG_H_ + +#include "abe_typ.h" +#include "abe_dm_addr.h" + +/* + * Debug trace format + * TIME 2 bytes from ABE : 4kHz period of the FW scheduler + * SUBID 1 byte : HAL API index + * From 0 to 16 bytes : parameters of the subroutine + * on every 32 dumps a tag is pushed on the debug trace : 0x55555555 + */ +#define dbg_bitfield_offset 8 +#define dbg_api_calls 0 +#define dbg_mapi (1L << (dbg_api_calls + dbg_bitfield_offset)) +#define dbg_external_data_access 1 +#define dbg_mdata (1L << (dbg_external_data_access + dbg_bitfield_offset)) +#define dbg_err_codes 2 +#define dbg_merr (1L << (dbg_api_calls + dbg_bitfield_offset)) +#define ABE_DBG_MAGIC_NUMBER 0x55555555 +/* + * IDs used for traces + */ +#define ABE_ID_RESET_HAL (1 + dbg_mapi) +#define ABE_ID_LOAD_FW (2 + dbg_mapi) +#define ABE_ID_DEFAULT_CONFIGURATION (3 + dbg_mapi) +#define ABE_ID_IRQ_PROCESSING (4 + dbg_mapi) +#define ABE_ID_EVENT_GENERATOR_SWITCH (5 + dbg_mapi) +#define ABE_ID_READ_HARDWARE_CONFIGURATION (6 + dbg_mapi) +#define ABE_ID_READ_LOWEST_OPP (7 + dbg_mapi) +#define ABE_ID_WRITE_GAIN (8 + dbg_mapi) +#define ABE_ID_SET_ASRC_DRIFT_CONTROL (9 + dbg_mapi) +#define ABE_ID_PLUG_SUBROUTINE (10 + dbg_mapi) +#define ABE_ID_UNPLUG_SUBROUTINE (11 + dbg_mapi) +#define ABE_ID_PLUG_SEQUENCE (12 + dbg_mapi) +#define ABE_ID_LAUNCH_SEQUENCE (13 + dbg_mapi) +#define ABE_ID_LAUNCH_SEQUENCE_param (14 + dbg_mapi) +#define ABE_ID_CONNECT_IRQ_PING_PONG_PORT (15 + dbg_mapi) +#define ABE_ID_READ_ANALOG_GAIN_DL (16 + dbg_mapi) +#define ABE_ID_READ_ANALOG_GAIN_UL (17 + dbg_mapi) +#define ABE_ID_ENABLE_DYN_UL_GAIN (18 + dbg_mapi) +#define ABE_ID_DISABLE_DYN_UL_GAIN (19 + dbg_mapi) +#define ABE_ID_ENABLE_DYN_EXTENSION (20 + dbg_mapi) +#define ABE_ID_DISABLE_DYN_EXTENSION (21 + dbg_mapi) +#define ABE_ID_NOTIFY_ANALOG_GAIN_CHANGED (22 + dbg_mapi) +#define ABE_ID_RESET_PORT (23 + dbg_mapi) +#define ABE_ID_READ_REMAINING_DATA (24 + dbg_mapi) +#define ABE_ID_DISABLE_DATA_TRANSFER (25 + dbg_mapi) +#define ABE_ID_ENABLE_DATA_TRANSFER (26 + dbg_mapi) +#define ABE_ID_READ_GLOBAL_COUNTER (27 + dbg_mapi) +#define ABE_ID_SET_DMIC_FILTER (28 + dbg_mapi) +#define ABE_ID_SET_OPP_PROCESSING (29 + dbg_mapi) +#define ABE_ID_SET_PING_PONG_BUFFER (30 + dbg_mapi) +#define ABE_ID_READ_PORT_ADDRESS (31 + dbg_mapi) +#define ABE_ID_LOAD_FW_param (32 + dbg_mapi) +#define ABE_ID_WRITE_HEADSET_OFFSET (33 + dbg_mapi) +#define ABE_ID_READ_GAIN_RANGES (34 + dbg_mapi) +#define ABE_ID_WRITE_EQUALIZER (35 + dbg_mapi) +#define ABE_ID_WRITE_ASRC (36 + dbg_mapi) +#define ABE_ID_WRITE_APS (37 + dbg_mapi) +#define ABE_ID_WRITE_MIXER (38 + dbg_mapi) +#define ABE_ID_WRITE_EANC (39 + dbg_mapi) +#define ABE_ID_WRITE_ROUTER (40 + dbg_mapi) +#define ABE_ID_READ_PORT_GAIN (41 + dbg_mapi) +#define ABE_ID_ASRC (42 + dbg_mapi) +#define ABE_ID_READ_APS (43 + dbg_mapi) +#define ABE_ID_READ_APS_energy (44 + dbg_mapi) +#define ABE_ID_READ_MIXER (45 + dbg_mapi) +#define ABE_READ_EANC (46 + dbg_mapi) +#define ABE_ID_READ_ROUTER (47 + dbg_mapi) +#define ABE_ID_READ_DEBUG_TRACE (48 + dbg_mapi) +#define ABE_ID_SET_SEQUENCE_TIME_ACCURACY (49 + dbg_mapi) +#define ABE_ID_SET_DEBUG_PINS (50 + dbg_mapi) +#define ABE_ID_SELECT_MAIN_PORT (51 + dbg_mapi) +#define ABE_ID_WRITE_EVENT_GENERATOR (52 + dbg_mapi) +#define ABE_ID_READ_USE_CASE_OPP (53 + dbg_mapi) +#define ABE_ID_SELECT_DATA_SOURCE (54 + dbg_mapi) +#define ABE_ID_READ_NEXT_PING_PONG_BUFFER (55 + dbg_mapi) +#define ABE_ID_INIT_PING_PONG_BUFFER (56 + dbg_mapi) +#define ABE_ID_CONNECT_CBPR_DMAREQ_PORT (57 + dbg_mapi) +#define ABE_ID_CONNECT_DMAREQ_PORT (58 + dbg_mapi) +#define ABE_ID_CONNECT_DMAREQ_PING_PONG_PORT (59 + dbg_mapi) +#define ABE_ID_CONNECT_SERIAL_PORT (60 + dbg_mapi) +#define ABE_ID_CONNECT_SLIMBUS_PORT (61 + dbg_mapi) +#define ABE_ID_READ_GAIN (62 + dbg_mapi) +#define ABE_ID_SET_ROUTER_CONFIGURATION (63 + dbg_mapi) +#define ABE_ID_CONNECT_DEBUG_TRACE (64 + dbg_mapi) +#define ABE_ID_SET_DEBUG_TRACE (65 + dbg_mapi) +#define ABE_ID_REMOTE_DEBUGGER_INTERFACE (66 + dbg_mapi) +#define ABE_ID_ENABLE_TEST_PATTERN (67 + dbg_mapi) +#define ABE_ID_CONNECT_TDM_PORT (68 + dbg_mapi) +/* + * IDs used for error codes + */ +#define NOERR 0 +#define ABE_SET_MEMORY_CONFIG_ERR (1 + dbg_merr) +#define ABE_BLOCK_COPY_ERR (2 + dbg_merr) +#define ABE_SEQTOOLONG (3 + dbg_merr) +#define ABE_BADSAMPFORMAT (4 + dbg_merr) +#define ABE_SET_ATC_ABE_BLOCK_COPY_ERR MEMORY_CONFIG_ERR (5 + dbg_merr) +#define ABE_PROTOCOL_ERROR (6 + dbg_merr) +#define ABE_PARAMETER_ERROR (7 + dbg_merr) +/* port programmed while still running */ +#define ABE_PORT_REPROGRAMMING (8 + dbg_merr) +#define ABE_READ_USE_CASE_OPP_ERR (9 + dbg_merr) +#define ABE_PARAMETER_OVERFLOW (10 + dbg_merr) +#define ABE_FW_FIFO_WRITE_PTR_ERR (11 + dbg_merr) + +/* + * IDs used for error codes + */ +#define OMAP_ABE_ERR_LIB (1 << 1) +#define OMAP_ABE_ERR_API (1 << 2) +#define OMAP_ABE_ERR_INI (1 << 3) +#define OMAP_ABE_ERR_SEQ (1 << 4) +#define OMAP_ABE_ERR_DBG (1 << 5) +#define OMAP_ABE_ERR_EXT (1 << 6) + +struct omap_abe_dbg { + /* Debug Data */ + u32 activity_log[OMAP_ABE_D_DEBUG_HAL_TASK_SIZE]; + u32 activity_log_write_pointer; + u32 mask; +}; + +struct omap_abe_dma { + /* OCP L3 pointer to the first address of the */ + void *data; + /* destination buffer (either DMA or Ping-Pong read/write pointers). */ + /* address L3 when addressing the DMEM buffer instead of CBPr */ + void *l3_dmem; + /* address L3 translated to L4 the ARM memory space */ + void *l4_dmem; + /* number of iterations for the DMA data moves. */ + u32 iter; +}; + +/** + * omap_abe_dbg_reset + * @dbg: Pointer on abe debug handle + * + * Called in order to reset Audio Back End debug global data. + * This ensures that ABE debug trace pointer is reset correctly. + */ +int omap_abe_dbg_reset(struct omap_abe_dbg *dbg); + +#endif /* _ABE_DBG_H_ */ diff --git a/sound/soc/omap/abe/abe_def.h b/sound/soc/omap/abe/abe_def.h new file mode 100644 index 0000000..2cce906 --- /dev/null +++ b/sound/soc/omap/abe/abe_def.h @@ -0,0 +1,307 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_DEF_H_ +#define _ABE_DEF_H_ +/* + * HARDWARE AND PERIPHERAL DEFINITIONS + */ +/* MM_DL */ +#define ABE_CBPR0_IDX 0 +/* VX_DL */ +#define ABE_CBPR1_IDX 1 +/* VX_UL */ +#define ABE_CBPR2_IDX 2 +/* MM_UL */ +#define ABE_CBPR3_IDX 3 +/* MM_UL2 */ +#define ABE_CBPR4_IDX 4 +/* TONES */ +#define ABE_CBPR5_IDX 5 +/* VIB */ +#define ABE_CBPR6_IDX 6 +/* DEBUG/CTL */ +#define ABE_CBPR7_IDX 7 +#define CIRCULAR_BUFFER_PERIPHERAL_R__0 (0x100 + ABE_CBPR0_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__1 (0x100 + ABE_CBPR1_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__2 (0x100 + ABE_CBPR2_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__3 (0x100 + ABE_CBPR3_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__4 (0x100 + ABE_CBPR4_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__5 (0x100 + ABE_CBPR5_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__6 (0x100 + ABE_CBPR6_IDX*4) +#define CIRCULAR_BUFFER_PERIPHERAL_R__7 (0x100 + ABE_CBPR7_IDX*4) +#define PING_PONG_WITH_MCU_IRQ 1 +#define PING_PONG_WITH_DSP_IRQ 2 +/* ID used for LIB memory copy subroutines */ +#define COPY_FROM_ABE_TO_HOST 1 +#define COPY_FROM_HOST_TO_ABE 2 +/* + * INTERNAL DEFINITIONS + */ +#define ABE_FIRMWARE_MAX_SIZE 26629 +/* 24 Q6.26 coefficients */ +#define NBEQ1 25 +/* 2x12 Q6.26 coefficients */ +#define NBEQ2 13 +/* TBD APS first set of parameters */ +#define NBAPS1 10 +/* TBD APS second set of parameters */ +#define NBAPS2 10 +/* Mixer used for sending tones to the uplink voice path */ +#define NBMIX_AUDIO_UL 2 +/* Main downlink mixer */ +#define NBMIX_DL1 4 +/* Handsfree downlink mixer */ +#define NBMIX_DL2 4 +/* Side-tone mixer */ +#define NBMIX_SDT 2 +/* Echo reference mixer */ +#define NBMIX_ECHO 2 +/* Voice record mixer */ +#define NBMIX_VXREC 4 +/* unsigned version of (-1) */ +#define CC_M1 0xFF +#define CS_M1 0xFFFF +#define CL_M1 0xFFFFFFFFL +/* + Mixer ID Input port ID Comments + DL1_MIXER 0 MMDL path + 1 MMUL2 path + 2 VXDL path + 3 TONES path + SDT_MIXER 0 Uplink path + 1 Downlink path + ECHO_MIXER 0 DL1_MIXER path + 1 DL2_MIXER path + AUDUL_MIXER 0 TONES_DL path + 1 Uplink path + 2 MM_DL path + VXREC_MIXER 0 TONES_DL path + 1 VX_DL path + 2 MM_DL path + 3 VX_UL path +*/ +#define MIX_VXUL_INPUT_MM_DL 0 +#define MIX_VXUL_INPUT_TONES 1 +#define MIX_VXUL_INPUT_VX_UL 2 +#define MIX_VXUL_INPUT_VX_DL 3 +#define MIX_DL1_INPUT_MM_DL 0 +#define MIX_DL1_INPUT_MM_UL2 1 +#define MIX_DL1_INPUT_VX_DL 2 +#define MIX_DL1_INPUT_TONES 3 +#define MIX_DL2_INPUT_MM_DL 0 +#define MIX_DL2_INPUT_MM_UL2 1 +#define MIX_DL2_INPUT_VX_DL 2 +#define MIX_DL2_INPUT_TONES 3 +#define MIX_SDT_INPUT_UP_MIXER 0 +#define MIX_SDT_INPUT_DL1_MIXER 1 +#define MIX_AUDUL_INPUT_MM_DL 0 +#define MIX_AUDUL_INPUT_TONES 1 +#define MIX_AUDUL_INPUT_UPLINK 2 +#define MIX_AUDUL_INPUT_VX_DL 3 +#define MIX_VXREC_INPUT_MM_DL 0 +#define MIX_VXREC_INPUT_TONES 1 +#define MIX_VXREC_INPUT_VX_UL 2 +#define MIX_VXREC_INPUT_VX_DL 3 +#define MIX_ECHO_DL1 0 +#define MIX_ECHO_DL2 1 +/* nb of samples to route */ +#define NBROUTE_UL 16 +/* 10 routing tables max */ +#define NBROUTE_CONFIG_MAX 10 +/* 5 pre-computed routing tables */ +#define NBROUTE_CONFIG 6 +/* AMIC on VX_UL */ +#define UPROUTE_CONFIG_AMIC 0 +/* DMIC first pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC1 1 +/* DMIC second pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC2 2 +/* DMIC last pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC3 3 +/* BT_UL on VX_UL */ +#define UPROUTE_CONFIG_BT 4 +/* ECHO_REF on MM_UL2 */ +#define UPROUTE_ECHO_MMUL2 5 +/* call-back indexes */ +#define MAXCALLBACK 100 +/* subroutines */ +#define MAXNBSUBROUTINE 100 +/* time controlled sequenced */ +#define MAXNBSEQUENCE 20 +/* maximum simultaneous active sequences */ +#define MAXACTIVESEQUENCE 20 +/* max number of steps in the sequences */ +#define MAXSEQUENCESTEPS 2 +/* max number of feature associated to a port */ +#define MAXFEATUREPORT 12 +#define SUB_0_PARAM 0 +/* number of parameters per sequence calls */ +#define SUB_1_PARAM 1 +#define SUB_2_PARAM 2 +#define SUB_3_PARAM 3 +#define SUB_4_PARAM 4 +/* active sequence mask = 0 means the line is free */ +#define FREE_LINE 0 +/* no ask for collision protection */ +#define NOMASK (1 << 0) +/* do not allow a PDM OFF during the execution of this sequence */ +#define MASK_PDM_OFF (1 << 1) +/* do not allow a PDM ON during the execution of this sequence */ +#define MASK_PDM_ON (1 << 2) +/* explicit name of the feature */ +#define NBCHARFEATURENAME 16 +/* explicit name of the port */ +#define NBCHARPORTNAME 16 +/* sink / input port from Host point of view (or AESS for DMIC/McPDM/.. */ +#define SNK_P ABE_ATC_DIRECTION_IN +/* source / ouptut port */ +#define SRC_P ABE_ATC_DIRECTION_OUT +/* no ASRC applied */ +#define NODRIFT 0 +/* for abe_set_asrc_drift_control */ +#define FORCED_DRIFT_CONTROL 1 +/* for abe_set_asrc_drift_control */ +#define ADPATIVE_DRIFT_CONTROL 2 +/* number of task/slot depending on the OPP value */ +#define DOPPMODE32_OPP100 (0x00000010) +#define DOPPMODE32_OPP50 (0x0000000C) +#define DOPPMODE32_OPP25 (0x0000004) +/* + * ABE CONST AREA FOR PARAMETERS TRANSLATION + */ +#define GAIN_MAXIMUM 3000L +#define GAIN_24dB 2400L +#define GAIN_18dB 1800L +#define GAIN_12dB 1200L +#define GAIN_6dB 600L +/* default gain = 1 */ +#define GAIN_0dB 0L +#define GAIN_M6dB -600L +#define GAIN_M12dB -1200L +#define GAIN_M18dB -1800L +#define GAIN_M24dB -2400L +#define GAIN_M30dB -3000L +#define GAIN_M40dB -4000L +#define GAIN_M50dB -5000L +/* muted gain = -120 decibels */ +#define MUTE_GAIN -12000L +#define GAIN_TOOLOW -13000L +#define GAIN_MUTE MUTE_GAIN +#define RAMP_MINLENGTH 3L +/* ramp_t is in milli- seconds */ +#define RAMP_0MS 0L +#define RAMP_1MS 1L +#define RAMP_2MS 2L +#define RAMP_5MS 5L +#define RAMP_10MS 10L +#define RAMP_20MS 20L +#define RAMP_50MS 50L +#define RAMP_100MS 100L +#define RAMP_200MS 200L +#define RAMP_500MS 500L +#define RAMP_1000MS 1000L +#define RAMP_MAXLENGTH 10000L +/* for abe_translate_gain_format */ +#define LINABE_TO_DECIBELS 1 +#define DECIBELS_TO_LINABE 2 +/* for abe_translate_ramp_format */ +#define IIRABE_TO_MICROS 1 +#define MICROS_TO_IIABE 2 +/* + * ABE CONST AREA FOR PERIPHERAL TUNING + */ +/* port idled IDLE_P */ +#define OMAP_ABE_PORT_ACTIVITY_IDLE 1 +/* port initialized, ready to be activated */ +#define OMAP_ABE_PORT_INITIALIZED 3 +/* port activated RUN_P */ +#define OMAP_ABE_PORT_ACTIVITY_RUNNING 2 +#define NOCALLBACK 0 +#define NOPARAMETER 0 +/* number of ATC access upon AMIC DMArequests, all the FIFOs are enabled */ +#define MCPDM_UL_ITER 4 +/* All the McPDM FIFOs are enabled simultaneously */ +#define MCPDM_DL_ITER 24 +/* All the DMIC FIFOs are enabled simultaneously */ +#define DMIC_ITER 12 +/* TBD later if needed */ +#define MAX_PINGPONG_BUFFERS 2 +/* + * Indexes to the subroutines + */ +#define SUB_WRITE_MIXER 1 +#define SUB_WRITE_PORT_GAIN 2 +/* OLD WAY */ +#define c_feat_init_eq 1 +#define c_feat_read_eq1 2 +#define c_write_eq1 3 +#define c_feat_read_eq2 4 +#define c_write_eq2 5 +#define c_feat_read_eq3 6 +#define c_write_eq3 7 +/* max number of gain to be controlled by HAL */ +#define MAX_NBGAIN_CMEM 36 +/* + * MACROS + */ +#define maximum(a, b) (((a) < (b)) ? (b) : (a)) +#define minimum(a, b) (((a) > (b)) ? (b) : (a)) +#define absolute(a) (((a) > 0) ? (a) : ((-1)*(a))) +#define HAL_VERSIONS 9 +#endif/* _ABE_DEF_H_ */ diff --git a/sound/soc/omap/abe/abe_define.h b/sound/soc/omap/abe/abe_define.h new file mode 100644 index 0000000..1dfa0a3 --- /dev/null +++ b/sound/soc/omap/abe/abe_define.h @@ -0,0 +1,104 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_DEFINE_H_ +#define _ABE_DEFINE_H_ + +#define ATC_DESCRIPTOR_NUMBER 64 +#define PROCESSING_SLOTS 25 +#define TASK_POOL_LENGTH 128 +#define MCU_IRQ 0x24 +#define MCU_IRQ_SHIFT2 0x90 +#define DMA_REQ_SHIFT2 0x210 +#define DSP_IRQ 0x4c +#define IRQtag_APS 0x000a +#define IRQtag_COUNT 0x000c +#define IRQtag_PP 0x000d +#define DMAreq_7 0x0080 +#define IRQ_FIFO_LENGTH 16 +#define SDT_EQ_ORDER 4 +#define DL_EQ_ORDER 12 +#define MIC_FILTER_ORDER 4 +#define GAINS_WITH_RAMP1 14 +#define GAINS_WITH_RAMP2 22 +#define GAINS_WITH_RAMP_TOTAL 36 +#define ASRC_MEMLENGTH 40 +#define ASRC_UL_VX_FIR_L 19 +#define ASRC_DL_VX_FIR_L 19 +#define ASRC_MM_EXT_IN_FIR_L 18 +#define ASRC_margin 2 +#define ASRC_N_8k 2 +#define ASRC_N_16k 4 +#define ASRC_N_48k 12 +#define VIBRA_N 5 +#define VIBRA1_IIR_MEMSIZE 11 +#define SAMP_LOOP_96K 24 +#define SAMP_LOOP_48K 12 +#define SAMP_LOOP_16K 4 +#define SAMP_LOOP_8K 2 +#define INPUT_SCALE_SHIFTM2 5056 +#define OUTPUT_SCALE_SHIFTM2 5060 +#define MUTE_SCALING 5064 +#define ABE_PMEM 1 +#define ABE_CMEM 2 +#define ABE_SMEM 3 +#define ABE_DMEM 4 +#define ABE_ATC 5 +#define ASRC_BT_UL_FIR_L 19 +#define ASRC_BT_DL_FIR_L 19 +#endif /* _ABE_DEFINE_H_ */ diff --git a/sound/soc/omap/abe/abe_dm_addr.h b/sound/soc/omap/abe/abe_dm_addr.h new file mode 100644 index 0000000..5d10e11 --- /dev/null +++ b/sound/soc/omap/abe/abe_dm_addr.h @@ -0,0 +1,360 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#define OMAP_ABE_D_ATCDESCRIPTORS_ADDR 0x0 +#define OMAP_ABE_D_ATCDESCRIPTORS_SIZE 0x200 + +#define OMAP_ABE_STACK_ADDR 0x200 +#define OMAP_ABE_STACK_SIZE 0x70 + +#define OMAP_ABE_D_VERSION_ADDR 0x270 +#define OMAP_ABE_D_VERSION_SIZE 0x4 + +#define OMAP_ABE_D_BT_DL_FIFO_ADDR 0x400 +#define OMAP_ABE_D_BT_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_BT_UL_FIFO_ADDR 0x600 +#define OMAP_ABE_D_BT_UL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MM_EXT_OUT_FIFO_ADDR 0x800 +#define OMAP_ABE_D_MM_EXT_OUT_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MM_EXT_IN_FIFO_ADDR 0xA00 +#define OMAP_ABE_D_MM_EXT_IN_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MM_UL2_FIFO_ADDR 0xC00 +#define OMAP_ABE_D_MM_UL2_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_VX_UL_FIFO_ADDR 0xE00 +#define OMAP_ABE_D_VX_UL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_VX_DL_FIFO_ADDR 0x1000 +#define OMAP_ABE_D_VX_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_DMIC_UL_FIFO_ADDR 0x1200 +#define OMAP_ABE_D_DMIC_UL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MM_UL_FIFO_ADDR 0x1400 +#define OMAP_ABE_D_MM_UL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MM_DL_FIFO_ADDR 0x1600 +#define OMAP_ABE_D_MM_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_TONES_DL_FIFO_ADDR 0x1800 +#define OMAP_ABE_D_TONES_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_VIB_DL_FIFO_ADDR 0x1A00 +#define OMAP_ABE_D_VIB_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MCPDM_DL_FIFO_ADDR 0x1C00 +#define OMAP_ABE_D_MCPDM_DL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_MCPDM_UL_FIFO_ADDR 0x1E00 +#define OMAP_ABE_D_MCPDM_UL_FIFO_SIZE 0x1E0 + +#define OMAP_ABE_D_DEBUG_FIFO_ADDR 0x1FE0 +#define OMAP_ABE_D_DEBUG_FIFO_SIZE 0x60 + +#define OMAP_ABE_D_DEBUG_FIFO_HAL_ADDR 0x2040 +#define OMAP_ABE_D_DEBUG_FIFO_HAL_SIZE 0x20 + +#define OMAP_ABE_D_IODESCR_ADDR 0x2060 +#define OMAP_ABE_D_IODESCR_SIZE 0x280 + +#define OMAP_ABE_D_ZERO_ADDR 0x22E0 +#define OMAP_ABE_D_ZERO_SIZE 0x4 + +#define OMAP_ABE_DBG_TRACE1_ADDR 0x22E4 +#define OMAP_ABE_DBG_TRACE1_SIZE 0x1 + +#define OMAP_ABE_DBG_TRACE2_ADDR 0x22E5 +#define OMAP_ABE_DBG_TRACE2_SIZE 0x1 + +#define OMAP_ABE_DBG_TRACE3_ADDR 0x22E6 +#define OMAP_ABE_DBG_TRACE3_SIZE 0x1 + +#define OMAP_ABE_D_MULTIFRAME_ADDR 0x22E8 +#define OMAP_ABE_D_MULTIFRAME_SIZE 0x190 + +#define OMAP_ABE_D_TASKSLIST_ADDR 0x2478 +#define OMAP_ABE_D_TASKSLIST_SIZE 0x800 + +#define OMAP_ABE_D_IDLETASK_ADDR 0x2C78 +#define OMAP_ABE_D_IDLETASK_SIZE 0x2 + +#define OMAP_ABE_D_TYPELENGTHCHECK_ADDR 0x2C7A +#define OMAP_ABE_D_TYPELENGTHCHECK_SIZE 0x2 + +#define OMAP_ABE_D_MAXTASKBYTESINSLOT_ADDR 0x2C7C +#define OMAP_ABE_D_MAXTASKBYTESINSLOT_SIZE 0x2 + +#define OMAP_ABE_D_REWINDTASKBYTES_ADDR 0x2C7E +#define OMAP_ABE_D_REWINDTASKBYTES_SIZE 0x2 + +#define OMAP_ABE_D_PCURRENTTASK_ADDR 0x2C80 +#define OMAP_ABE_D_PCURRENTTASK_SIZE 0x2 + +#define OMAP_ABE_D_PFASTLOOPBACK_ADDR 0x2C82 +#define OMAP_ABE_D_PFASTLOOPBACK_SIZE 0x2 + +#define OMAP_ABE_D_PNEXTFASTLOOPBACK_ADDR 0x2C84 +#define OMAP_ABE_D_PNEXTFASTLOOPBACK_SIZE 0x4 + +#define OMAP_ABE_D_PPCURRENTTASK_ADDR 0x2C88 +#define OMAP_ABE_D_PPCURRENTTASK_SIZE 0x2 + +#define OMAP_ABE_D_SLOTCOUNTER_ADDR 0x2C8C +#define OMAP_ABE_D_SLOTCOUNTER_SIZE 0x2 + +#define OMAP_ABE_D_LOOPCOUNTER_ADDR 0x2C90 +#define OMAP_ABE_D_LOOPCOUNTER_SIZE 0x4 + +#define OMAP_ABE_D_REWINDFLAG_ADDR 0x2C94 +#define OMAP_ABE_D_REWINDFLAG_SIZE 0x2 + +#define OMAP_ABE_D_SLOT23_CTRL_ADDR 0x2C98 +#define OMAP_ABE_D_SLOT23_CTRL_SIZE 0x4 + +#define OMAP_ABE_D_MCUIRQFIFO_ADDR 0x2C9C +#define OMAP_ABE_D_MCUIRQFIFO_SIZE 0x40 + +#define OMAP_ABE_D_PINGPONGDESC_ADDR 0x2CDC +#define OMAP_ABE_D_PINGPONGDESC_SIZE 0x18 + +#define OMAP_ABE_D_PP_MCU_IRQ_ADDR 0x2CF4 +#define OMAP_ABE_D_PP_MCU_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_CTRLPORTFIFO_ADDR 0x2D00 +#define OMAP_ABE_D_CTRLPORTFIFO_SIZE 0x10 + +#define OMAP_ABE_D_IDLE_STATE_ADDR 0x2D10 +#define OMAP_ABE_D_IDLE_STATE_SIZE 0x4 + +#define OMAP_ABE_D_STOP_REQUEST_ADDR 0x2D14 +#define OMAP_ABE_D_STOP_REQUEST_SIZE 0x4 + +#define OMAP_ABE_D_REF0_ADDR 0x2D18 +#define OMAP_ABE_D_REF0_SIZE 0x2 + +#define OMAP_ABE_D_DEBUGREGISTER_ADDR 0x2D1C +#define OMAP_ABE_D_DEBUGREGISTER_SIZE 0x8C + +#define OMAP_ABE_D_GCOUNT_ADDR 0x2DA8 +#define OMAP_ABE_D_GCOUNT_SIZE 0x2 + +#define OMAP_ABE_D_DCCOUNTER_ADDR 0x2DAC +#define OMAP_ABE_D_DCCOUNTER_SIZE 0x4 + +#define OMAP_ABE_D_DCSUM_ADDR 0x2DB0 +#define OMAP_ABE_D_DCSUM_SIZE 0x8 + +#define OMAP_ABE_D_FASTCOUNTER_ADDR 0x2DB8 +#define OMAP_ABE_D_FASTCOUNTER_SIZE 0x4 + +#define OMAP_ABE_D_SLOWCOUNTER_ADDR 0x2DBC +#define OMAP_ABE_D_SLOWCOUNTER_SIZE 0x4 + +#define OMAP_ABE_D_AUPLINKROUTING_ADDR 0x2DC0 +#define OMAP_ABE_D_AUPLINKROUTING_SIZE 0x20 + +#define OMAP_ABE_D_VIRTAUDIOLOOP_ADDR 0x2DE0 +#define OMAP_ABE_D_VIRTAUDIOLOOP_SIZE 0x4 + +#define OMAP_ABE_D_ASRCVARS_DL_VX_ADDR 0x2DE4 +#define OMAP_ABE_D_ASRCVARS_DL_VX_SIZE 0x20 + +#define OMAP_ABE_D_ASRCVARS_UL_VX_ADDR 0x2E04 +#define OMAP_ABE_D_ASRCVARS_UL_VX_SIZE 0x20 + +#define OMAP_ABE_D_COEFADDRESSES_VX_ADDR 0x2E24 +#define OMAP_ABE_D_COEFADDRESSES_VX_SIZE 0x20 + +#define OMAP_ABE_D_ASRCVARS_MM_EXT_IN_ADDR 0x2E44 +#define OMAP_ABE_D_ASRCVARS_MM_EXT_IN_SIZE 0x20 + +#define OMAP_ABE_D_COEFADDRESSES_MM_ADDR 0x2E64 +#define OMAP_ABE_D_COEFADDRESSES_MM_SIZE 0x20 + +#define OMAP_ABE_D_APS_DL1_M_THRESHOLDS_ADDR 0x2E84 +#define OMAP_ABE_D_APS_DL1_M_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL1_M_IRQ_ADDR 0x2E8C +#define OMAP_ABE_D_APS_DL1_M_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_APS_DL1_C_IRQ_ADDR 0x2E8E +#define OMAP_ABE_D_APS_DL1_C_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_TRACEBUFADR_ADDR 0x2E90 +#define OMAP_ABE_D_TRACEBUFADR_SIZE 0x2 + +#define OMAP_ABE_D_TRACEBUFOFFSET_ADDR 0x2E92 +#define OMAP_ABE_D_TRACEBUFOFFSET_SIZE 0x2 + +#define OMAP_ABE_D_TRACEBUFLENGTH_ADDR 0x2E94 +#define OMAP_ABE_D_TRACEBUFLENGTH_SIZE 0x2 + +#define OMAP_ABE_D_ASRCVARS_ECHO_REF_ADDR 0x2E98 +#define OMAP_ABE_D_ASRCVARS_ECHO_REF_SIZE 0x20 + +#define OMAP_ABE_D_PEMPTY_ADDR 0x2EB8 +#define OMAP_ABE_D_PEMPTY_SIZE 0x4 + +#define OMAP_ABE_D_APS_DL2_L_M_IRQ_ADDR 0x2EBC +#define OMAP_ABE_D_APS_DL2_L_M_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_APS_DL2_L_C_IRQ_ADDR 0x2EBE +#define OMAP_ABE_D_APS_DL2_L_C_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_APS_DL2_R_M_IRQ_ADDR 0x2EC0 +#define OMAP_ABE_D_APS_DL2_R_M_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_APS_DL2_R_C_IRQ_ADDR 0x2EC2 +#define OMAP_ABE_D_APS_DL2_R_C_IRQ_SIZE 0x2 + +#define OMAP_ABE_D_APS_DL1_C_THRESHOLDS_ADDR 0x2EC4 +#define OMAP_ABE_D_APS_DL1_C_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_L_M_THRESHOLDS_ADDR 0x2ECC +#define OMAP_ABE_D_APS_DL2_L_M_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_L_C_THRESHOLDS_ADDR 0x2ED4 +#define OMAP_ABE_D_APS_DL2_L_C_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_R_M_THRESHOLDS_ADDR 0x2EDC +#define OMAP_ABE_D_APS_DL2_R_M_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_R_C_THRESHOLDS_ADDR 0x2EE4 +#define OMAP_ABE_D_APS_DL2_R_C_THRESHOLDS_SIZE 0x8 + +#define OMAP_ABE_D_ECHO_REF_48_16_WRAP_ADDR 0x2EEC +#define OMAP_ABE_D_ECHO_REF_48_16_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_ECHO_REF_48_8_WRAP_ADDR 0x2EF4 +#define OMAP_ABE_D_ECHO_REF_48_8_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_BT_UL_16_48_WRAP_ADDR 0x2EFC +#define OMAP_ABE_D_BT_UL_16_48_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_BT_UL_8_48_WRAP_ADDR 0x2F04 +#define OMAP_ABE_D_BT_UL_8_48_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_BT_DL_48_16_WRAP_ADDR 0x2F0C +#define OMAP_ABE_D_BT_DL_48_16_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_BT_DL_48_8_WRAP_ADDR 0x2F14 +#define OMAP_ABE_D_BT_DL_48_8_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_VX_DL_16_48_WRAP_ADDR 0x2F1C +#define OMAP_ABE_D_VX_DL_16_48_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_VX_DL_8_48_WRAP_ADDR 0x2F24 +#define OMAP_ABE_D_VX_DL_8_48_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_VX_UL_48_16_WRAP_ADDR 0x2F2C +#define OMAP_ABE_D_VX_UL_48_16_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_VX_UL_48_8_WRAP_ADDR 0x2F34 +#define OMAP_ABE_D_VX_UL_48_8_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL1_IRQS_WRAP_ADDR 0x2F3C +#define OMAP_ABE_D_APS_DL1_IRQS_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_L_IRQS_WRAP_ADDR 0x2F44 +#define OMAP_ABE_D_APS_DL2_L_IRQS_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_APS_DL2_R_IRQS_WRAP_ADDR 0x2F4C +#define OMAP_ABE_D_APS_DL2_R_IRQS_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_NEXTMULTIFRAME_ADDR 0x2F54 +#define OMAP_ABE_D_NEXTMULTIFRAME_SIZE 0x8 + +#define OMAP_ABE_D_HW_TEST_ADDR 0x2F5C +#define OMAP_ABE_D_HW_TEST_SIZE 0x8 + +#define OMAP_ABE_D_TRACEBUFADR_HAL_ADDR 0x2F64 +#define OMAP_ABE_D_TRACEBUFADR_HAL_SIZE 0x4 + +#define OMAP_ABE_D_DEBUG_HAL_TASK_ADDR 0x3000 +#define OMAP_ABE_D_DEBUG_HAL_TASK_SIZE 0x800 + +#define OMAP_ABE_D_DEBUG_FW_TASK_ADDR 0x3800 +#define OMAP_ABE_D_DEBUG_FW_TASK_SIZE 0x100 + +#define OMAP_ABE_D_FWMEMINIT_ADDR 0x3900 +#define OMAP_ABE_D_FWMEMINIT_SIZE 0x3C0 + +#define OMAP_ABE_D_FWMEMINITDESCR_ADDR 0x3CC0 +#define OMAP_ABE_D_FWMEMINITDESCR_SIZE 0x10 + +#define OMAP_ABE_D_ASRCVARS_BT_UL_ADDR 0x3CD0 +#define OMAP_ABE_D_ASRCVARS_BT_UL_SIZE 0x20 + +#define OMAP_ABE_D_ASRCVARS_BT_DL_ADDR 0x3CF0 +#define OMAP_ABE_D_ASRCVARS_BT_DL_SIZE 0x20 + +#define OMAP_ABE_D_BT_DL_48_8_OPP100_WRAP_ADDR 0x3D10 +#define OMAP_ABE_D_BT_DL_48_8_OPP100_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_BT_DL_48_16_OPP100_WRAP_ADDR 0x3D18 +#define OMAP_ABE_D_BT_DL_48_16_OPP100_WRAP_SIZE 0x8 + +#define OMAP_ABE_D_PING_ADDR 0x4000 +#define OMAP_ABE_D_PING_SIZE 0x6000 + +#define OMAP_ABE_D_PONG_ADDR 0xA000 +#define OMAP_ABE_D_PONG_SIZE 0x6000 diff --git a/sound/soc/omap/abe/abe_ext.h b/sound/soc/omap/abe/abe_ext.h new file mode 100644 index 0000000..8fb1aac --- /dev/null +++ b/sound/soc/omap/abe/abe_ext.h @@ -0,0 +1,242 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_EXT_H_ +#define _ABE_EXT_H_ + +/* + * OS DEPENDENT MMU CONFIGURATION + */ +#define ABE_PMEM_BASE_OFFSET_MPU 0xe0000 +#define ABE_CMEM_BASE_OFFSET_MPU 0xa0000 +#define ABE_SMEM_BASE_OFFSET_MPU 0xc0000 +#define ABE_DMEM_BASE_OFFSET_MPU 0x80000 +#define ABE_ATC_BASE_OFFSET_MPU 0xf1000 +/* default base address for io_base */ +#define ABE_DEFAULT_BASE_ADDRESS_L3 0x49000000L +#define ABE_DEFAULT_BASE_ADDRESS_L4 0x40100000L +#define ABE_DEFAULT_BASE_ADDRESS_DEFAULT ABE_DEFAULT_BASE_ADDRESS_L3 +/* + * HARDWARE AND PERIPHERAL DEFINITIONS + */ +/* PMEM SIZE in bytes (1024 words of 64 bits: : #32bits words x 4)*/ +#define ABE_PMEM_SIZE 8192 +/* CMEM SIZE in bytes (2048 coeff : #32bits words x 4)*/ +#define ABE_CMEM_SIZE 8192 +/* SMEM SIZE in bytes (3072 stereo samples : #32bits words x 4)*/ +#define ABE_SMEM_SIZE 24576 +/* DMEM SIZE in bytes */ +#define ABE_DMEM_SIZE 65536L +/* ATC REGISTERS SIZE in bytes */ +#define ABE_ATC_DESC_SIZE 512 +/* holds the MCU Irq signal */ +#define ABE_MCU_IRQSTATUS_RAW 0x24 +/* status : clear the IRQ */ +#define ABE_MCU_IRQSTATUS 0x28 +/* holds the DSP Irq signal */ +#define ABE_DSP_IRQSTATUS_RAW 0x4C +/* holds the DMA req lines to the sDMA */ +#define ABE_DMASTATUS_RAW 0x84 +#define EVENT_GENERATOR_COUNTER 0x68 +/* PLL output/desired sampling rate = (32768 * 6000)/96000 */ +#define EVENT_GENERATOR_COUNTER_DEFAULT (2048-1) +/* PLL output/desired sampling rate = (32768 * 6000)/88200 */ +#define EVENT_GENERATOR_COUNTER_44100 (2228-1) +/* start / stop the EVENT generator */ +#define EVENT_GENERATOR_START 0x6C +#define EVENT_GENERATOR_ON 1 +#define EVENT_GENERATOR_OFF 0 +/* selection of the EVENT generator source */ +#define EVENT_SOURCE_SELECTION 0x70 +#define EVENT_SOURCE_DMA 0 +#define EVENT_SOURCE_COUNTER 1 +/* selection of the ABE DMA req line from ATC */ +#define AUDIO_ENGINE_SCHEDULER 0x74 +#define ABE_ATC_DMIC_DMA_REQ 1 +#define ABE_ATC_MCPDMDL_DMA_REQ 2 +#define ABE_ATC_MCPDMUL_DMA_REQ 3 +/* Direction=0 means input from ABE point of view */ +#define ABE_ATC_DIRECTION_IN 0 +/* Direction=1 means output from ABE point of view */ +#define ABE_ATC_DIRECTION_OUT 1 +/* + * DMA requests + */ +/*Internal connection doesn't connect at ABE boundary */ +#define External_DMA_0 0 +/*Transmit request digital microphone */ +#define DMIC_DMA_REQ 1 +/*Multichannel PDM downlink */ +#define McPDM_DMA_DL 2 +/*Multichannel PDM uplink */ +#define McPDM_DMA_UP 3 +/*MCBSP module 1 - transmit request */ +#define MCBSP1_DMA_TX 4 +/*MCBSP module 1 - receive request */ +#define MCBSP1_DMA_RX 5 +/*MCBSP module 2 - transmit request */ +#define MCBSP2_DMA_TX 6 +/*MCBSP module 2 - receive request */ +#define MCBSP2_DMA_RX 7 +/*MCBSP module 3 - transmit request */ +#define MCBSP3_DMA_TX 8 +/*MCBSP module 3 - receive request */ +#define MCBSP3_DMA_RX 9 +/*SLIMBUS module 1 - transmit request channel 0 */ +#define SLIMBUS1_DMA_TX0 10 +/*SLIMBUS module 1 - transmit request channel 1 */ +#define SLIMBUS1_DMA_TX1 11 +/*SLIMBUS module 1 - transmit request channel 2 */ +#define SLIMBUS1_DMA_TX2 12 +/*SLIMBUS module 1 - transmit request channel 3 */ +#define SLIMBUS1_DMA_TX3 13 +/*SLIMBUS module 1 - transmit request channel 4 */ +#define SLIMBUS1_DMA_TX4 14 +/*SLIMBUS module 1 - transmit request channel 5 */ +#define SLIMBUS1_DMA_TX5 15 +/*SLIMBUS module 1 - transmit request channel 6 */ +#define SLIMBUS1_DMA_TX6 16 +/*SLIMBUS module 1 - transmit request channel 7 */ +#define SLIMBUS1_DMA_TX7 17 +/*SLIMBUS module 1 - receive request channel 0 */ +#define SLIMBUS1_DMA_RX0 18 +/*SLIMBUS module 1 - receive request channel 1 */ +#define SLIMBUS1_DMA_RX1 19 +/*SLIMBUS module 1 - receive request channel 2 */ +#define SLIMBUS1_DMA_RX2 20 +/*SLIMBUS module 1 - receive request channel 3 */ +#define SLIMBUS1_DMA_RX3 21 +/*SLIMBUS module 1 - receive request channel 4 */ +#define SLIMBUS1_DMA_RX4 22 +/*SLIMBUS module 1 - receive request channel 5 */ +#define SLIMBUS1_DMA_RX5 23 +/*SLIMBUS module 1 - receive request channel 6 */ +#define SLIMBUS1_DMA_RX6 24 +/*SLIMBUS module 1 - receive request channel 7 */ +#define SLIMBUS1_DMA_RX7 25 +/*McASP - Data transmit DMA request line */ +#define McASP1_AXEVT 26 +/*McASP - Data receive DMA request line */ +#define McASP1_AREVT 29 +/*DUMMY FIFO @@@ */ +#define _DUMMY_FIFO_ 30 +/*DMA of the Circular buffer peripheral 0 */ +#define CBPr_DMA_RTX0 32 +/*DMA of the Circular buffer peripheral 1 */ +#define CBPr_DMA_RTX1 33 +/*DMA of the Circular buffer peripheral 2 */ +#define CBPr_DMA_RTX2 34 +/*DMA of the Circular buffer peripheral 3 */ +#define CBPr_DMA_RTX3 35 +/*DMA of the Circular buffer peripheral 4 */ +#define CBPr_DMA_RTX4 36 +/*DMA of the Circular buffer peripheral 5 */ +#define CBPr_DMA_RTX5 37 +/*DMA of the Circular buffer peripheral 6 */ +#define CBPr_DMA_RTX6 38 +/*DMA of the Circular buffer peripheral 7 */ +#define CBPr_DMA_RTX7 39 +/* + * ATC DESCRIPTORS - DESTINATIONS + */ +#define DEST_DMEM_access 0x00 +#define DEST_MCBSP1_ TX 0x01 +#define DEST_MCBSP2_ TX 0x02 +#define DEST_MCBSP3_TX 0x03 +#define DEST_SLIMBUS1_TX0 0x04 +#define DEST_SLIMBUS1_TX1 0x05 +#define DEST_SLIMBUS1_TX2 0x06 +#define DEST_SLIMBUS1_TX3 0x07 +#define DEST_SLIMBUS1_TX4 0x08 +#define DEST_SLIMBUS1_TX5 0x09 +#define DEST_SLIMBUS1_TX6 0x0A +#define DEST_SLIMBUS1_TX7 0x0B +#define DEST_MCPDM_DL 0x0C +#define DEST_MCASP_TX0 0x0D +#define DEST_MCASP_TX1 0x0E +#define DEST_MCASP_TX2 0x0F +#define DEST_MCASP_TX3 0x10 +#define DEST_EXTPORT0 0x11 +#define DEST_EXTPORT1 0x12 +#define DEST_EXTPORT2 0x13 +#define DEST_EXTPORT3 0x14 +#define DEST_MCPDM_ON 0x15 +#define DEST_CBP_CBPr 0x3F +/* + * ATC DESCRIPTORS - SOURCES + */ +#define SRC_DMEM_access 0x0 +#define SRC_MCBSP1_ RX 0x01 +#define SRC_MCBSP2_RX 0x02 +#define SRC_MCBSP3_RX 0x03 +#define SRC_SLIMBUS1_RX0 0x04 +#define SRC_SLIMBUS1_RX1 0x05 +#define SRC_SLIMBUS1_RX2 0x06 +#define SRC_SLIMBUS1_RX3 0x07 +#define SRC_SLIMBUS1_RX4 0x08 +#define SRC_SLIMBUS1_RX5 0x09 +#define SRC_SLIMBUS1_RX6 0x0A +#define SRC_SLIMBUS1_RX7 0x0B +#define SRC_DMIC_UP 0x0C +#define SRC_MCPDM_UP 0x0D +#define SRC_MCASP_RX0 0x0E +#define SRC_MCASP_RX1 0x0F +#define SRC_MCASP_RX2 0x10 +#define SRC_MCASP_RX3 0x11 +#define SRC_CBP_CBPr 0x3F +#endif/* _ABE_EXT_H_ */ diff --git a/sound/soc/omap/abe/abe_firmware.c b/sound/soc/omap/abe/abe_firmware.c new file mode 100644 index 0000000..b6b3d4d --- /dev/null +++ b/sound/soc/omap/abe/abe_firmware.c @@ -0,0 +1,24122 @@ +0x00009110, /* VERSION NUMBER */ +0x00002000, /* PMEM LENGTH IN BYTES */ +0x000013E4, /* CMEM LENGTH IN BYTES */ +0x00010000, /* DMEM LENGTH IN BYTES */ +0x000044F0, /* SMEM LENGTH IN BYTES */ +0x1600200f, +0x0a000670, +0x08200000, +0x08200000, +0x07800000, +0x1602d1ce, +0x014000e0, +0x014000e1, +0x014000e2, +0x014000e3, +0x014000e4, +0x014000e5, +0x014000e6, +0x014000e7, +0x014000e8, +0x014000e9, +0x014000ea, +0x014000eb, +0x014000ec, +0x014000ed, +0x014000ef, +0x014000ef, +0x144000e4, +0x9e000000, +0x0a200c40, +0x9e000040, +0x0a200c40, +0x9e000080, +0x0a200c40, +0x9e0000c0, +0x0a200c40, +0x9e080000, +0x0a200c40, +0x9e080100, +0x0a200c40, +0x9e080200, +0x0a200c40, +0x9e080300, +0x0a200c40, +0x9e080400, +0x0a200c40, +0x9e080500, +0x0a200c40, +0x9e080600, +0x0a200c40, +0x9e080700, +0x0a200c40, +0x9c050800, +0x0a200c40, +0x16000010, +0x16000001, +0x17000102, +0x01400042, +0x17800103, +0x01400043, +0x98020000, +0x9d0c8118, +0x07800000, +0x9f16001a, +0x9f12021a, +0x9f12031a, +0x9f12051a, +0x98800380, +0x9d0c8118, +0x08200000, +0x9d0c8118, +0x07800000, +0x9f15001a, +0x9f11041a, +0x98800410, +0x9d0c8118, +0x08200000, +0x400002c0, +0x048002ff, +0x000000c5, +0x000004c6, +0x9c028000, +0x400006c7, +0x12000155, +0x013ffefe, +0xc00008c4, +0x1e080000, +0x020005de, +0x00000ac3, +0xdc02b160, +0x04c3ff2d, +0xdc01ba70, +0x128002dd, +0xdc02a440, +0x048fffdd, +0x9c061830, +0x0b200000, +0x003ffefe, +0x000002c4, +0x400004c5, +0x048ffeff, +0x000006c6, +0x000008c7, +0x9d02a040, +0x9d02a950, +0x9d01b260, +0x9d02bc70, +0x08200000, +0x1602c7c6, +0x00000068, +0x16003fc5, +0x01000058, +0x1602c88a, +0x000000a9, +0x16003fc6, +0x00000068, +0x0400089b, +0x4000009c, +0x1602c80e, +0x410000ec, +0x0600000c, +0x1600274d, +0x0a800870, +0x1602e903, +0x00000030, +0x00000231, +0x00000435, +0x04800211, +0x04400511, +0x1602c944, +0x0000004e, +0x0300010e, +0x04800211, +0x04400511, +0x0300010c, +0x04800211, +0x04400511, +0x03000109, +0x01000231, +0x0a200480, +0x04800299, +0x410000a9, +0x05c00b90, +0x4ac00700, +0x04a01085, +0x1602c8c4, +0x40000047, +0x1602c94e, +0x04200599, +0x400000e1, +0x04800177, +0x010000a9, +0x41000047, +0x04a00111, +0x410000e1, +0x06000001, +0x4aa00a50, +0x1602c90d, +0x400000d6, +0x16022e89, +0x400002d7, +0x04800166, +0x410000a9, +0x04900077, +0x010000d6, +0x010002d7, +0x1602c7c6, +0x00000068, +0x16003fc5, +0x01000058, +0x1600c005, +0x1602d141, +0x16000002, +0x40000011, +0x1602d100, +0x9e0e0550, +0xdd140530, +0x160ffff4, +0x41000002, +0x06000001, +0x08400000, +0x01000004, +0x9d140550, +0x0a8006b0, +0x0a000a50, +0x048006ff, +0x013ffafb, +0x013ffcfc, +0x413ffefe, +0x04a0020b, +0x004002bc, +0x0600000c, +0x1600274d, +0x0a800bf0, +0x0a200480, +0x0a000b90, +0x003ffefe, +0x003ffcfc, +0x003ffafb, +0x048ffaff, +0x08200000, +0x07800000, +0x01400040, +0x01400041, +0x01400042, +0x01400043, +0x08200000, +0x160004a4, +0x160004b5, +0x160004c6, +0x16000007, +0x9c032040, +0x9c032950, +0x9c033260, +0x9e0f0070, +0x9e0f0170, +0x9e0f0270, +0x9d032040, +0x9d032950, +0x9d033260, +0x08200000, +0x9f158048, +0x07800000, +0x07800000, +0x9d088118, +0x98800d80, +0x08200000, +0x9f158048, +0x9f040040, +0x07800000, +0x9f03fc10, +0x07800000, +0x07800000, +0x07800000, +0x9d188148, +0x98800de0, +0x08200000, +0x9f158048, +0x07800000, +0x07800000, +0x9d188148, +0x9d188108, +0x98800e80, +0x08200000, +0x9f158048, +0x07800000, +0x07800000, +0x9d0e0040, +0x07800000, +0x07800000, +0x9d1e8148, +0x9d1e8108, +0x98800ef0, +0x08200000, +0x9f158018, +0x9f040010, +0x07800000, +0x9f03fc10, +0x07800000, +0x07800000, +0x07800000, +0x9d0e0010, +0x07800000, +0x07800000, +0x9d1e8108, +0x98800f90, +0x08200000, +0x9c080048, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8118, +0x98801060, +0x08200000, +0x9c180028, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8108, +0x988010d0, +0x08200000, +0x9c180068, +0x9c180028, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8148, +0x98801140, +0x08200000, +0x9c1e0048, +0x9c1e0008, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8148, +0x988011c0, +0x08200000, +0x9c1e0008, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8108, +0x98801240, +0x08200000, +0x160004a4, +0x160004b5, +0x160004c6, +0x160000bd, +0x9c032340, +0x9c032c50, +0x9c033560, +0x9c180028, +0x9c180068, +0x9f1d0010, +0x9c1800a8, +0x9c1800e8, +0x9f1d00b0, +0x07800000, +0x9d0c8318, +0x9d0c84b8, +0x9c180028, +0x9c180068, +0x9f1d0010, +0x07800000, +0x07800000, +0x9d0c8518, +0x98801320, +0x9d032340, +0x9d032c50, +0x9d033560, +0x08200000, +0x16000504, +0x16000515, +0x16000526, +0x9c03a440, +0x9c03ad50, +0x9c03b660, +0x160000bd, +0x9f158418, +0x9f1585b8, +0x07800000, +0x9d188108, +0x9d188148, +0x9d188188, +0x9c0c0618, +0x07800000, +0x9d1881c8, +0x9d188108, +0x9d188148, +0x988014d0, +0x9d032440, +0x9d032d50, +0x9d033660, +0x08200000, +0x1600000d, +0x9e0f00d0, +0x00800e0d, +0x9f158038, +0x07800000, +0x04a002dd, +0x9d188108, +0x9f158038, +0x07800000, +0x98801630, +0x9d188108, +0x08200000, +0x9e088100, +0x07800000, +0x07800000, +0x12800277, +0x04c0ff77, +0x04a00174, +0x12800266, +0x04c0ff66, +0x04000645, +0x060ffff4, +0x17000454, +0x12000244, +0x9e0f0140, +0x07800000, +0x07800000, +0x9c0c0118, +0x07800000, +0x07800000, +0x9d0c8118, +0x988017b0, +0x08200000, +0x08200000, +0x08200000, +0x08200000, +0x9c038600, +0x07800000, +0x07800000, +0x9c180770, +0xdc100348, +0x160fff05, +0x9f000810, +0x9f118412, +0x9f001010, +0x9f002810, +0x9c0c00b8, +0x160ffd80, +0x9d0c8410, +0x9f1d8012, +0x9f001810, +0x9f0400d0, +0x9c0c0210, +0x16000204, +0xdd0e00b0, +0x16000005, +0x9f1d80b2, +0x9f0000b0, +0x9f0020b0, +0x9f0400d0, +0x05800560, +0x0a8019d0, +0x9c0c0510, +0x0a0019e0, +0x9c0c0618, +0x16000014, +0x9d0c81e8, +0x9d0c8148, +0x0a801a50, +0x9c0c05b0, +0x9c0c0510, +0x0a001a70, +0x9c0c06b8, +0x9c0c0618, +0x07800000, +0x9d0c81e8, +0x9d0c8148, +0x98801850, +0x9d180750, +0x08200000, +0x9d019220, +0x048002ff, +0x14400004, +0x413ffefe, +0x16000040, +0x9c010910, +0x0a202e80, +0x14400040, +0x9c030810, +0x16000171, +0x9c009f30, +0x9c019220, +0x0a202980, +0x9c009830, +0x003ffefe, +0x048ffeff, +0x08200000, +0x40000024, +0x048002ff, +0x41000224, +0x16000005, +0x413ffefe, +0x04000400, +0x9e0f0150, +0x01000025, +0x0a201d80, +0x403ffefe, +0x16000007, +0x9e0f0170, +0x048ffeff, +0x08200000, +0x048002ff, +0x413ffefe, +0x16000005, +0x01000025, +0x0a201d80, +0x40000024, +0x16000005, +0x403ffefe, +0x04200454, +0x41000224, +0x048ffeff, +0x08200000, +0x048008ff, +0x413ff8f8, +0x1440000d, +0x9c038e10, +0x413ffaf9, +0x04a001dd, +0x413ffcfa, +0x16000001, +0x413ffefb, +0x160000f0, +0x9c100400, +0x9c100480, +0x9c1d06c4, +0x9f085030, +0x9c180674, +0x9c180650, +0x058001a0, +0x0aa02280, +0x04800144, +0x04400044, +0x05800040, +0x0aa01fc0, +0x05800160, +0x0ac01f60, +0x9e090000, +0x07800000, +0x07800000, +0x9e0d0500, +0x9d040508, +0x0a002150, +0x9d040008, +0x9e090000, +0x07800000, +0x9d040008, +0x9e0d0500, +0x0a002150, +0x9d040008, +0x9e090000, +0x07800000, +0x07800000, +0x9e0d0500, +0x1280010a, +0x048001a9, +0x05800940, +0x0aa02150, +0x05800160, +0x40000628, +0x160ffff9, +0x0ac020e0, +0x05800180, +0x0ae02150, +0x160ffff6, +0x160ffff7, +0x0a002120, +0x05800810, +0x0ae02150, +0x16000016, +0x16000007, +0x9d044690, +0x04a00144, +0x9d180674, +0x05800160, +0x9d180654, +0x0ac021c0, +0x0420040a, +0x04a001ab, +0x4a0021f0, +0x044000bb, +0x0480014b, +0x044000bb, +0x1440004a, +0x120001aa, +0x42000a38, +0x120001bb, +0x42000b39, +0x12000288, +0x12000299, +0x9e0e8280, +0xca002390, +0x1e0e8390, +0xdd040604, +0x05800160, +0x0ac02330, +0x9d040008, +0x9e090000, +0x07800000, +0x05800040, +0x9e0d0500, +0x0aa02390, +0x9d040508, +0x0a002390, +0x9e090000, +0x05800040, +0x9d040008, +0x9e0d0500, +0x0a802390, +0x9d040508, +0x9c1d06c4, +0xdc1d0644, +0x1f0400b0, +0x9c100700, +0xdc1d06c4, +0x1f040010, +0x9d108480, +0x9f0940b0, +0x9d108700, +0x00000cc9, +0x06000008, +0x0aa02590, +0xdc1d0684, +0x14400005, +0xdc1d0604, +0x160fff8a, +0x04a00255, +0xdd108480, +0x16000017, +0xdd108700, +0x160ffff8, +0x05800540, +0x0aa02550, +0x05800160, +0x0ac02540, +0x01000027, +0x0a002550, +0x01000028, +0x9e088000, +0xa0054dba, +0xa005c81a, +0x0a002620, +0x9e088000, +0xa0054dba, +0xa005c81a, +0x160fffaa, +0x9f1f80b0, +0x9f1e0010, +0x9f040020, +0x9f040070, +0x9f020810, +0x9d0446a0, +0x9e0f0070, +0x9d0c8118, +0x98801e20, +0x003ffefb, +0x003ffcfa, +0x003ffaf9, +0x003ff8f8, +0x048ff8ff, +0x08200000, +0x9c0c0018, +0x9f0b0010, +0x04a001dd, +0x07800000, +0x9d0c8318, +0x07800000, +0xa00602ba, +0x9c0c0018, +0x9f0b0010, +0x9d0c82b8, +0x07800000, +0x9d0c8318, +0x98802720, +0x07800000, +0xa00602ba, +0x9c0c0118, +0x16000015, +0x9d0c81b8, +0x9d0c82b8, +0x9f092010, +0x9f0920b0, +0x9c1d05c0, +0x9f0930c0, +0x9c1d0548, +0x9f093860, +0x06000006, +0x0aa028a0, +0x06000017, +0x0aa028a0, +0x07800000, +0x9c0c0118, +0x9c0c01b0, +0x9f082010, +0x9f0820b0, +0x9c1d05c0, +0x9f0830c0, +0x9c1d0548, +0x9f083860, +0x06000006, +0x0aa02970, +0x06000017, +0x0aa02970, +0x07800000, +0x08200000, +0x9c0c0018, +0x1440001d, +0x04a001dd, +0x9d0c8318, +0x07800000, +0x9c0c0018, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x988029d0, +0x07800000, +0xa00602ba, +0x07800000, +0x07800000, +0x9d0c81b8, +0x9d0c82b8, +0x08200000, +0x9c0c0018, +0x160000ad, +0x07800000, +0x9d0c8318, +0x07800000, +0x9c0c0018, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x07800000, +0x9c0c0018, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c02b8, +0x98802b00, +0x9c0c0018, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x07800000, +0xa00602ba, +0x07800000, +0x07800000, +0x9d0c02b8, +0x08200000, +0x9c0c0038, +0x1440001d, +0x04a001dd, +0x9d0c8338, +0x07800000, +0xa00602ba, +0xa006821a, +0x9c0c0038, +0x07800000, +0x9d0c8298, +0x9d0c8338, +0x9d0c8198, +0x98802ce0, +0x07800000, +0xa00602ba, +0xa006821a, +0x07800000, +0x07800000, +0x9d0c8298, +0x9d0c8198, +0x08200000, +0xdc0c0018, +0x04a00201, +0x04a001dd, +0xdd040008, +0x06000001, +0x04a00111, +0x0aa02e00, +0x9d0c8118, +0x98802de0, +0x08200000, +0x9c0c02b0, +0x9c0c0018, +0x04a00205, +0x07800000, +0x9d0c8118, +0xdd0c81b8, +0x06000005, +0x04a00155, +0x0aa02ed0, +0x98802e90, +0x08200000, +0x9c0c0018, +0x9e0e0620, +0x1600004d, +0x9d0c8318, +0x07800000, +0x9c0c0610, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x07800000, +0x9c0c0018, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x98802f80, +0x9c0c0610, +0xa00602ba, +0x07800000, +0x9d0c8318, +0x9d0c81b8, +0x9d0c02b8, +0x07800000, +0xa00602ba, +0x07800000, +0x07800000, +0x9d0c81b8, +0x9d0c82b8, +0x08200000, +0x9f160028, +0x9f168298, +0x04a001dd, +0x07800000, +0x9d0c8128, +0x07800000, +0x9f160028, +0x9f168298, +0x98803170, +0x9d0c8128, +0x08200000, +0x9f160020, +0x9f168098, +0x07800000, +0x9d0c8108, +0x9d0c8258, +0x988031e0, +0x08200000, +0x9f160010, +0x9f168068, +0x07800000, +0x07800000, +0x9d0c8128, +0x98803250, +0x08200000, +0x9d008810, +0x1280020d, +0x07800000, +0x9c038810, +0x9e0e0620, +0x04a001dd, +0x9f16801a, +0x9f12011a, +0x9f039810, +0x9f026810, +0x9f118610, +0x9f1680ba, +0x9f1201ba, +0x9f0398b0, +0x9f0268b0, +0x9f1186b0, +0x9d0c8718, +0x9d108248, +0x9d108208, +0x9d0c87b8, +0x9d1082c8, +0x9d108288, +0x98803320, +0x08200000, +0x00000003, +0x00000205, +0x1440001d, +0x9c039830, +0x9c03aa50, +0x07800000, +0x9c0c0018, +0x9c0c02b8, +0x07800000, +0x07800000, +0x9d0c8128, +0x988034a0, +0x08200000, +0x048002ff, +0x013ffefe, +0x00801605, +0x16002a63, +0x12000155, +0x0200035e, +0x0b200000, +0x00800405, +0x16002a63, +0x12000155, +0x0200035e, +0x0b200000, +0x00801705, +0x16002a63, +0x12000155, +0x0200035e, +0x0b200000, +0x003ffefe, +0x048ffeff, +0x07800000, +0x08200000, +0x048004ff, +0x16000181, +0x40800a0d, +0x04000101, +0x00800b03, +0x00000212, +0x00000017, +0x9e0e0420, +0x00000416, +0xdc180404, +0x06000003, +0x9c180480, +0x0aa03ae0, +0x9c052b20, +0x9c042820, +0x9c023970, +0x40800e04, +0x16000005, +0x40800503, +0x0600000d, +0x9d01b060, +0x4a803840, +0x0400033d, +0x04200427, +0x04200d77, +0x05800750, +0x0ae03840, +0x16000006, +0x16000145, +0x0a003ac0, +0x160fffd6, +0x05800420, +0x0ae039c0, +0x160fffe6, +0x04000344, +0x05800420, +0x0ae03ab0, +0x160ffff6, +0x04000344, +0x05800420, +0x0ae03ab0, +0x16000006, +0x04000344, +0x05800420, +0x0ae03ab0, +0x16000016, +0x04000344, +0x05800420, +0x0ae03ab0, +0x16000026, +0x04000344, +0x05800420, +0x0ae03ab0, +0x16000036, +0x013ffcf6, +0x12000132, +0x04000233, +0x9e088300, +0x40800e02, +0x16000005, +0x04000233, +0x12000233, +0x04200377, +0x05800570, +0x16001e02, +0x17800523, +0x04000377, +0x9e0f0070, +0x003ffcf6, +0x00800715, +0x01000606, +0x0a003ef0, +0x9c042b20, +0x9c052920, +0x9c023870, +0x07800000, +0x07800000, +0x9d00b360, +0x16000004, +0x16000005, +0x160fffb6, +0x00800503, +0x05800420, +0x0ae03df0, +0x160fffc6, +0x04000344, +0x05800420, +0x0ae03ed0, +0x160fffd6, +0x04000344, +0x05800420, +0x0ae03ed0, +0x160fffe6, +0x04000344, +0x05800420, +0x0ae03ed0, +0x160ffff6, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000006, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000016, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000026, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000036, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000046, +0x04000344, +0x05800420, +0x0ae03ed0, +0x16000056, +0x013ffcf6, +0x12000232, +0x04000233, +0x9e088300, +0x16000005, +0x12000233, +0x04000377, +0x04a1e077, +0x05800570, +0x16001e02, +0x17800523, +0x04000377, +0x9e0f0170, +0x003ffcf6, +0x01000606, +0x00800715, +0x16002a66, +0x413ffefe, +0x12000155, +0x00000202, +0x00800d04, +0x0200056e, +0x16013c06, +0x16013c47, +0x0400042d, +0x04a001dd, +0x9e0e0260, +0x9e0e0370, +0x0b200000, +0x00000806, +0x003ffefe, +0x0000021d, +0x9e0e0560, +0x40800b05, +0x048ffcff, +0x408007d7, +0x06000005, +0x40800f02, +0x04c07f77, +0x4a804120, +0x04500273, +0x00800a02, +0x9e088100, +0x00000011, +0x418007d3, +0x16000003, +0x12800277, +0x018003d7, +0x9d140530, +0x9d038810, +0x08200000, +0x00800a02, +0x9e088000, +0x00000011, +0x418007d3, +0x16000003, +0x12800277, +0x018000d7, +0x9d140530, +0x9d038910, +0x08200000, +0x00001807, +0x00801e02, +0x16000003, +0x9c01b970, +0x06000082, +0x17000233, +0x9e088100, +0x07800000, +0x12000c33, +0x04c3ff66, +0x04500366, +0x07800000, +0x16000003, +0x9e0c8100, +0x1602dc06, +0x00000064, +0x1600003d, +0x04a00122, +0x9c03a040, +0x04800266, +0x9e0f0130, +0x04800433, +0x06000002, +0x9c0c0038, +0x9c0c0078, +0x9c0c00b8, +0x9d0c810c, +0x9d0c815c, +0x9d0c81ac, +0x98804330, +0x0aa042b0, +0x9e0f0120, +0x08200000, +0x4080070d, +0x048002ff, +0x00800203, +0x00800905, +0x40000e04, +0x040003dd, +0x413ffefe, +0x06000004, +0x9c03a950, +0x4aa044d0, +0x144000d2, +0x0a204790, +0x40000e04, +0x1440002d, +0x06000004, +0x0a804610, +0x05800d40, +0x0ae04510, +0x0a204640, +0x0a0045c0, +0x042004d2, +0x1440004d, +0x0a204640, +0x0a204790, +0x06000002, +0x0a8045c0, +0x1440002d, +0x00000e04, +0x05800d40, +0x0ac04610, +0x0a204640, +0x003ffefe, +0x40800905, +0x048ffeff, +0x9d03a950, +0x08200000, +0x04a0012d, +0x0a201690, +0x0a0045c0, +0x16013c06, +0x40800605, +0x048002ff, +0x413ffefe, +0x144000d3, +0x16002a6e, +0x9e0e0260, +0x12000155, +0x420005ee, +0x04a001dd, +0x0b200000, +0x9e088000, +0x403ffefe, +0x16000006, +0x40000e05, +0x048ffeff, +0x9e0e8040, +0x9e0f0060, +0x04200355, +0x01000e05, +0x08200000, +0x40800b0d, +0x16000246, +0x40000403, +0x04c001d7, +0x06000007, +0x4a804880, +0x16000017, +0x00001604, +0x06000004, +0x0a8049a0, +0x40001405, +0x048001dd, +0x01000e04, +0x01000c05, +0x0a0048f0, +0x00001204, +0x06000004, +0x0a8049a0, +0x40001005, +0x048001dd, +0x01000e04, +0x01000c05, +0x9e0e8050, +0x41800b0d, +0x16000005, +0x40800a04, +0x05c00630, +0x0a804990, +0x12000233, +0x9e0e0530, +0x9d140550, +0x0a0049a0, +0x01800017, +0x08200000, +0x048008ff, +0x413ff8f8, +0x1440001d, +0x013ffaf9, +0x413ffcfa, +0x1602c909, +0x413ffefb, +0x1601fe02, +0x00000095, +0x00000296, +0x9c018201, +0x01000025, +0x41400226, +0x16020603, +0x04800122, +0x9e088200, +0x9e090300, +0x07800000, +0x12800277, +0x128002bb, +0x01c00127, +0x01c0012b, +0x9c018201, +0x98804aa0, +0x04800633, +0x1440001d, +0x00000034, +0x04802833, +0x01c00124, +0x98804b50, +0x1602e8ca, +0x16002102, +0x408000a4, +0x1602ebcd, +0x408001a5, +0x16000007, +0x9e0e0220, +0x408002a8, +0x16000806, +0x408003a9, +0x12000155, +0x410000a7, +0x04500544, +0x9d140270, +0x408000d5, +0x12000288, +0x410002a7, +0x04500844, +0x408001d8, +0x12000399, +0x408002d6, +0x04500944, +0x410000d7, +0x1602ec0a, +0x408003d9, +0x12000455, +0x410002d7, +0x04500544, +0x408000a5, +0x12000588, +0x408001a2, +0x04500844, +0x408002a8, +0x12000666, +0x410000a7, +0x04500644, +0x408003a6, +0x12000799, +0x410002a7, +0x04500944, +0x12000855, +0x04500544, +0x1602db8a, +0x1602dbcb, +0x12000922, +0x04500244, +0x12000a88, +0x04500844, +0x400000a8, +0x12000b66, +0x400000b9, +0x04500644, +0x04a00188, +0x04a00199, +0x16000005, +0x16000006, +0x06000008, +0x0aa04f50, +0x16000015, +0x000002a8, +0x06000009, +0x0aa04f90, +0x16000016, +0x000002b9, +0x1602cf42, +0x410000a8, +0x12000166, +0x410000b9, +0x04500655, +0x40800021, +0x1602c90d, +0x41800027, +0x06000004, +0x0aa05080, +0x06000005, +0x0aa05100, +0x06000001, +0x0aa05190, +0x0a005280, +0x160000a8, +0x400000d6, +0x12000c88, +0x04500487, +0x07800000, +0x06000005, +0x9d180078, +0x0a805170, +0x160000c8, +0x400000d6, +0x12000c88, +0x04500587, +0x07800000, +0x07800000, +0x9d180078, +0x06000001, +0x0a805200, +0x160000d8, +0x400000d6, +0x12000c88, +0x04500187, +0x07800000, +0x07800000, +0x9d180078, +0x16000903, +0x16000fa9, +0x16000016, +0x9e0e0530, +0x16000007, +0x9d03c890, +0x07800000, +0x9d140570, +0x1602c988, +0x40000280, +0x16000013, +0x00000084, +0x06000000, +0x40000049, +0x1602c942, +0x4a805320, +0x16000005, +0x04200959, +0x05800590, +0x41000045, +0x160ffff6, +0x17000353, +0x17800363, +0x04800233, +0x01000023, +0x1601fe02, +0x01004a23, +0x403ffefb, +0x16002202, +0x9e0e0220, +0x403ffcfa, +0x16000806, +0x003ffaf9, +0x003ff8f8, +0x9d140270, +0x048ff8ff, +0x08200000, +0x048008ff, +0x413ff8f8, +0x1601fe02, +0x013ffaf9, +0x013ffcfa, +0x413ffefb, +0x04803322, +0x1602e045, +0x16000dfd, +0x00000454, +0x00000856, +0x9c0768d0, +0x01c00124, +0x01c00126, +0x40000087, +0x16002b99, +0x0000028d, +0x40000c54, +0x12000299, +0x00000e56, +0x01c00127, +0x0180012d, +0x9e0e0490, +0x41400224, +0x16002ba8, +0x41400226, +0x12000288, +0x9c100480, +0x9f03e0b0, +0x9e0e0580, +0x9e010080, +0xdc1005c0, +0x1600060d, +0x9f03e0b0, +0x01400229, +0x9e0080c0, +0x0140022a, +0x9c01ead0, +0x01400225, +0x41400226, +0x16000633, +0x9e090200, +0x04800122, +0x9c029c30, +0x128002bb, +0x01c0012b, +0x160005bd, +0x9e088400, +0x07800000, +0x9c01ead0, +0x12800277, +0x01c00127, +0x9e090200, +0x16000023, +0x1600005d, +0x128002bb, +0x9c029c30, +0x01c0012b, +0x04800122, +0x9e088400, +0x9c01ead0, +0x07800000, +0x12800277, +0x9e090200, +0x07800000, +0x01c00127, +0x128002bb, +0x01c0012b, +0x04800222, +0x1602de45, +0x16000e1d, +0x00000454, +0x00000856, +0x9c0768d0, +0x01c00124, +0x01c00126, +0x40000087, +0x16002bb9, +0x0000028d, +0x40000c54, +0x12000299, +0x00000e56, +0x01c00127, +0x0180012d, +0x9e0e0490, +0x41400224, +0x16002bc8, +0x41400226, +0x12000288, +0x9c100480, +0x9f03e0b0, +0x9e0e0580, +0x9e010080, +0xdc1005c0, +0x1600009d, +0x9f03e0b0, +0x01400229, +0x9e0080c0, +0x0140022a, +0x9c01ead0, +0x01400225, +0x16000563, +0x01400226, +0x9e090200, +0x9c029c30, +0x07800000, +0x128002bb, +0x9e088400, +0x01c0022b, +0x07800000, +0x12800277, +0x01c00227, +0x003ffefb, +0x003ffcfa, +0x003ffaf9, +0x003ff8f8, +0x048ff8ff, +0x08200000, +0x00000004, +0x00000405, +0x00000806, +0x00000c07, +0x05c00540, +0x0b800000, +0x9e0e8040, +0x9c180034, +0x07800000, +0x07800000, +0x06000033, +0x9e0e8220, +0x0aa05cd0, +0x9c1d0004, +0x9c1d0044, +0x07800000, +0x9d0c0210, +0x0a005d80, +0x06000023, +0x0aa05d30, +0x9c1d0004, +0x9d040004, +0x9d100200, +0x0a005d80, +0x06000043, +0x0aa05d80, +0x9c180024, +0x9d040004, +0x9d180200, +0x04800c44, +0x05c00740, +0x17800644, +0x01000004, +0x0a005bf0, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x07800000, +0x07800000, +0x07800000, +0x08400000, +0x0a000000, +0x00000000, +0x00000000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00151000, +0x00201000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00000000, +0x00001011, +0x00001011, +0x00021031, +0x00041051, +0x00061071, +0x00081091, +0x000a10b1, +0x000c10d1, +0x00001001, +0x00001001, +0x00001000, +0x00001000, +0x00001001, +0x00001001, +0x00001011, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001041, +0x00001000, +0x00000000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00001001, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00001001, +0x00001000, +0x00001001, +0x00001001, +0x00001001, +0x00001001, +0x00001000, +0x00001001, +0x00001001, +0x00001001, +0x00001001, +0x00001001, +0x00001001, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00000000, +0x00000000, +0x00001000, +0x00001000, +0x00001000, +0x00000000, +0x00000000, +0x00000000, +0x00001000, +0x00001001, +0x00000001, +0x00001000, +0x00002e24, +0x00001000, +0x00001001, +0x00000001, +0x00001000, +0x00002e24, +0x00151000, +0x00002e24, +0x00002e24, +0x00151000, +0x00001000, +0x00001001, +0x00000001, +0x00001000, +0x00002e64, +0x00001000, +0x00001001, +0x00001000, +0x00001000, +0x00001001, +0x00001001, +0x000010c1, +0x00001000, +0x000010c1, +0x00001001, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001051, +0x00001031, +0x00001051, +0x00001021, +0x00001051, +0x00001031, +0x00001051, +0x00001021, +0x00001051, +0x00001031, +0x00001051, +0x00001021, +0x00001051, +0x00001031, +0x00001051, +0x00001021, +0x00001051, +0x00001031, +0x00001051, +0x00001021, +0x00151000, +0x00001000, +0x00001000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00001071, +0x00000000, +0x00001071, +0x00000000, +0x00001041, +0x00001001, +0x00000000, +0x00001000, +0x00001011, +0x00001001, +0x00000000, +0x00000000, +0x00000000, +0x00001000, +0x00001011, +0x00001001, +0x00000000, +0x00001041, +0x00001041, +0x00001000, +0x00001000, +0x00001000, +0x00001011, +0x00001001, +0x00001000, +0x00001011, +0x00001001, +0x00001000, +0x00001011, +0x00001001, +0x00000000, +0x00001000, +0x00001011, +0x00001001, +0x00000000, +0x00001000, +0x00001001, +0x00001001, +0x00001041, +0x00001000, +0x00001041, +0x00001001, +0x00001001, +0x00001000, +0x00001051, +0x00001000, +0x00001001, +0x00001051, +0x00001001, +0x000000c6, +0x00001000, +0x00001001, +0x00001001, +0x00001001, +0x00001001, +0x0000fff9, +0x00001000, +0x00001000, +0x00000000, +0x00001000, +0x00001091, +0x00001000, +0x00001000, +0x00000000, +0x00000000, +0x00001091, +0x00001091, +0x00001091, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00001000, +0x00000000, +0x00000000, +0x00000000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00001001, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00001000, +0x00001001, +0x00000000, +0x00011001, +0x00001000, +0x00151000, +0x00001001, +0x00000001, +0x00001000, +0x00002e24, +0x00002e24, +0x00001000, +0x00151000, +0x00151000, +0x00001000, +0x00001000, +0x00001000, +0x00001000, +0x00001001, +0x00000001, +0x00001000, +0x00002e24, +0x00002e24, +0x00000000, +0x00000000, +0x00000000, +0x00000008, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00700001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00100001, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00fc4793, +0x000a8b43, +0x00e7110b, +0x003411d3, +0x009d1cfb, +0x0002b6a8, +0x00fb8ca8, +0x0006dac8, +0x00f610e8, +0x000d8628, +0x00eed498, +0x0013f0e8, +0x00eb9d08, +0x000f02e8, +0x00056260, +0x00bf42f0, +0x006a9a5d, +0x005ed280, +0x00023c94, +0x00fb2e83, +0x000c8ac3, +0x00e408e3, +0x0037ceab, +0x0099fe5b, +0x0002b430, +0x00fbb618, +0x000661c0, +0x00f71850, +0x000b9710, +0x00f220d0, +0x000eb9d8, +0x00f37700, +0x0003c304, +0x00142c90, +0x00b09170, +0x0066c791, +0x006d23e0, +0x000208b8, +0x00fa9443, +0x000d8413, +0x00e2e293, +0x00386703, +0x009badeb, +0x000296d8, +0x00fc0144, +0x0005c418, +0x00f83d98, +0x0009a2c0, +0x00f53c30, +0x000a1678, +0x00fa10a0, +0x00fadbf0, +0x001ef5c0, +0x00a7ab80, +0x0061b101, +0x00782010, +0x000464a8, +0x00fa1fab, +0x000e2353, +0x00e28193, +0x003770b3, +0x00a04a0b, +0x000264f0, +0x00fc6e8c, +0x0004f108, +0x00f9b218, +0x00073f50, +0x00f8ea80, +0x0004be58, +0x005c1863, +0x00f141c8, +0x002a0528, +0x009fa4a8, +0x005b6439, +0x0042ccf5, +0x0005d8f0, +0x00f9f08b, +0x000e2e23, +0x00e33ce3, +0x00348833, +0x00a80de3, +0x00022008, +0x00fcf654, +0x0003fc0c, +0x00fb4d68, +0x0004b6b0, +0x00fcaf74, +0x00dcf75b, +0x000875d0, +0x00e88c00, +0x00334af8, +0x009a9170, +0x0053f3c9, +0x00498425, +0x0007d850, +0x00fa0193, +0x000db28b, +0x00e4f083, +0x0030005b, +0x00b24bfb, +0x007356ab, +0x00fd8f38, +0x0002f50c, +0x00fcf624, +0x00022f7c, +0x0014e623, +0x00fa8240, +0x000ec210, +0x00e12888, +0x003a6068, +0x00989408, +0x004b98d9, +0x004fdc61, +0x000aadb0, +0x00fa47fb, +0x000cc843, +0x00e76cb3, +0x002a3303, +0x00be6543, +0x005c437b, +0x008ca913, +0x007977d3, +0x00a7922b, +0x00ef1dc3, +0x0003bf5c, +0x00f604a8, +0x00143b08, +0x00db27e8, +0x003f50c0, +0x009968b8, +0x00427b21, +0x0055cb8d, +0x000e5198, +0x00faba2b, +0x000b83a3, +0x00ea894b, +0x00236a23, +0x00cbda13, +0x004398b3, +0x00b6e5bb, +0x003575db, +0x000eee5b, +0x00fd6ac0, +0x0006e2f8, +0x00f20c30, +0x0018d298, +0x00d68e40, +0x00423000, +0x009cd148, +0x00716ee8, +0x005b537d, +0x0012b270, +0x00fb4feb, +0x0009f65b, +0x00ee2313, +0x001be763, +0x00da372b, +0x002a1533, +0x00e15813, +0x00f2fbd3, +0x007127a3, +0x00fb4778, +0x0009ae08, +0x00eeab88, +0x001c7728, +0x00d365f8, +0x004306e0, +0x00a2a0d0, +0x005cd070, +0x00606a75, +0x0017d078, +0x00fc00bb, +0x0008330b, +0x00f2141b, +0x0013f29b, +0x00e8fcc3, +0x00108f73, +0x000aabc3, +0x00b409ab, +0x00032d94, +0x00f961f0, +0x000c0d48, +0x00ebf900, +0x001f1310, +0x00d1bd70, +0x0041db98, +0x00aaa7f0, +0x004768e0, +0x0064f695, +0x001db640, +0x00fcc40b, +0x00064cab, +0x00f635fb, +0x000bd423, +0x00f7ab83, +0x00f7da9b, +0x00319613, +0x00fdea24, +0x00046be0, +0x00f7c838, +0x000def88, +0x00ea0778, +0x002095b8, +0x00d19bf0, +0x003ebd10, +0x00b4aec0, +0x00318e40, +0x0068d739, +0x002477b8, +0x00fd9103, +0x000456bb, +0x00fa6163, +0x0003d51b, +0x0005c47b, +0x00e0c55b, +0x0054da23, +0x00fd2110, +0x000575e0, +0x00f68680, +0x000f46d0, +0x00e8e4e8, +0x0020f5c0, +0x00d2fe70, +0x0039c7a8, +0x00c06ee8, +0x001ba3e0, +0x006be82d, +0x002c29d8, +0x00fe5ef3, +0x000264b3, +0x00fe6f83, +0x00fc3c73, +0x0012cf0b, +0x00cc0f3b, +0x00735b43, +0x00fc7b10, +0x00064398, +0x00f5a608, +0x001009d8, +0x00e89830, +0x002033b8, +0x00d5d488, +0x003327e0, +0x00cd9208, +0x000617a0, +0x006e0619, +0x0034dcb8, +0x00ff2633, +0x0000878b, +0x00023efb, +0x00f54613, +0x001e683b, +0x00ba501b, +0x00023104, +0x00fbfc98, +0x0006cfe8, +0x00f52c00, +0x001034f8, +0x00e92088, +0x001e5960, +0x00da0390, +0x002b1358, +0x00dbbf58, +0x00f14c40, +0x006f129d, +0x003ea030, +0x00ffdfeb, +0x00feceb3, +0x0005b193, +0x00ef271b, +0x00283a63, +0x00ac06cb, +0x00027b84, +0x00fba8d8, +0x00071778, +0x00f51a98, +0x000fc900, +0x00ea7720, +0x001b7880, +0x00df6710, +0x0021ca50, +0x00ea95d0, +0x00dda780, +0x006ef2a5, +0x00497dd8, +0x00000003, +0x00fd4a6b, +0x0008a803, +0x00ea151b, +0x002ff333, +0x00a1a463, +0x0002aad0, +0x00fb81d8, +0x00071978, +0x00f56fc8, +0x000ecde0, +0x00ec89f0, +0x0017b2e0, +0x00e5c408, +0x0017aaa0, +0x00f99118, +0x00cbaf78, +0x006d93e5, +0x005561e0, +0x00000020, +0x003fffe0, +0x00000020, +0x003fffe0, +0x00069cf3, +0x00eda3d3, +0x00284343, +0x00b2821b, +0x000228bc, +0x00fc4508, +0x0006a660, +0x00f19bc0, +0x007f26c5, +0x00107398, +0x00f8cbc0, +0x0003fef8, +0x00fdafb8, +0x00539323, +0x00d40cc3, +0x0014740b, +0x00f855f3, +0x0001b16b, +0x000c0373, +0x00ddec9b, +0x004b880b, +0x00fdb6d0, +0x00041728, +0x00f8ede8, +0x000c8b38, +0x00e57730, +0x007ca649, +0x0022b568, +0x00f146b8, +0x00081d20, +0x00fb4da0, +0x0002a8ac, +0x00a5ff43, +0x002a4a93, +0x00efdbfb, +0x0003c6eb, +0x00101e33, +0x00d13c0b, +0x0068d11b, +0x00fcce9c, +0x0005bc08, +0x00f61488, +0x001185c8, +0x00dbb070, +0x00788dfd, +0x00367598, +0x00e9b5b8, +0x000c31f8, +0x00f8f1a0, +0x00040178, +0x00fdde98, +0x0040ab93, +0x00e6e21b, +0x0006309b, +0x0012ea3b, +0x00c7c91b, +0x007f746f, +0x00fc1754, +0x00070c10, +0x00f3cc50, +0x00157878, +0x00d45408, +0x0072f70d, +0x004b56d0, +0x00e26390, +0x001012a8, +0x00f6b500, +0x00054a20, +0x00fd2bf0, +0x0056a233, +0x00ddc993, +0x0008d62b, +0x00147503, +0x00c1a1c3, +0x00023c70, +0x00fb9490, +0x0007fff0, +0x00f221f8, +0x00185148, +0x00cf5d50, +0x006c0395, +0x0060f058, +0x00db9f08, +0x00139340, +0x00f4b188, +0x00067398, +0x00fc8844, +0x006b2573, +0x00d501e3, +0x000b96fb, +0x0014d9d3, +0x00beae3b, +0x00025f04, +0x00fb4790, +0x00089470, +0x00f11b68, +0x001a0988, +0x00ccb738, +0x0063ddc5, +0x0076d0d4, +0x00d5b880, +0x001688a8, +0x00f30060, +0x00076f18, +0x00fbfbf8, +0x007d228f, +0x00cd04b3, +0x000e4b13, +0x00143ecb, +0x00beb5b3, +0x000266a0, +0x00fb2f48, +0x0008ca48, +0x00f0b7e8, +0x001aa578, +0x00cc3da8, +0x005ab67d, +0x004640a1, +0x00d0ff50, +0x0018ca30, +0x00f1b920, +0x00082ea8, +0x00fb8f00, +0x00022e24, +0x00c650c3, +0x0010c49b, +0x0012d1ab, +0x00c1642b, +0x0002555c, +0x00fb48b0, +0x0008a5d0, +0x00f0f0a0, +0x001a3350, +0x00cdbf38, +0x0050c415, +0x0050c415, +0x00cdbf38, +0x001a3350, +0x00f0f0a0, +0x0008a5d0, +0x00fb48b0, +0x0002555c, +0x00c1642b, +0x0012d1ab, +0x0010c49b, +0x00c650c3, +0x00022e24, +0x00fb8f00, +0x00082ea8, +0x00f1b920, +0x0018ca30, +0x00d0ff50, +0x004640a1, +0x005ab67d, +0x00cc3da8, +0x001aa578, +0x00f0b7e8, +0x0008ca48, +0x00fb2f48, +0x000266a0, +0x00beb5b3, +0x00143ecb, +0x000e4b13, +0x00cd04b3, +0x007d228f, +0x00fbfbf8, +0x00076f18, +0x00f30060, +0x001688a8, +0x00d5b880, +0x0076d0d4, +0x0063ddc5, +0x00ccb738, +0x001a0988, +0x00f11b68, +0x00089470, +0x00fb4790, +0x00025f04, +0x00beae3b, +0x0014d9d3, +0x000b96fb, +0x00d501e3, +0x006b2573, +0x00fc8844, +0x00067398, +0x00f4b188, +0x00139340, +0x00db9f08, +0x0060f058, +0x006c0395, +0x00cf5d50, +0x00185148, +0x00f221f8, +0x0007fff0, +0x00fb9490, +0x00023c70, +0x00c1a1c3, +0x00147503, +0x0008d62b, +0x00ddc993, +0x0056a233, +0x00fd2bf0, +0x00054a20, +0x00f6b500, +0x001012a8, +0x00e26390, +0x004b56d0, +0x0072f70d, +0x00d45408, +0x00157878, +0x00f3cc50, +0x00070c10, +0x00fc1754, +0x007f746f, +0x00c7c91b, +0x0012ea3b, +0x0006309b, +0x00e6e21b, +0x0040ab93, +0x00fdde98, +0x00040178, +0x00f8f1a0, +0x000c31f8, +0x00e9b5b8, +0x00367598, +0x00788dfd, +0x00dbb070, +0x001185c8, +0x00f61488, +0x0005bc08, +0x00fcce9c, +0x0068d11b, +0x00d13c0b, +0x00101e33, +0x0003c6eb, +0x00efdbfb, +0x002a4a93, +0x00a5ff43, +0x0002a8ac, +0x00fb4da0, +0x00081d20, +0x00f146b8, +0x0022b568, +0x007ca649, +0x00e57730, +0x000c8b38, +0x00f8ede8, +0x00041728, +0x00fdb6d0, +0x004b880b, +0x00ddec9b, +0x000c0373, +0x0001b16b, +0x00f855f3, +0x0014740b, +0x00d40cc3, +0x00539323, +0x00fdafb8, +0x0003fef8, +0x00f8cbc0, +0x00107398, +0x007f26c5, +0x00f19bc0, +0x0006a660, +0x00fc4508, +0x000228bc, +0x00b2821b, +0x00284343, +0x00eda3d3, +0x00069cf3, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00040002, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000003, +0x00000020, +0x003fffe0, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x000695c4, +0x007cdb3b, +0x000870d8, +0x000870d8, +0x007cdb3b, +0x000695c4, +0x004470ec, +0x00fa825a, +0x000c7322, +0x00f02316, +0x000b4d9e, +0x0013c14c, +0x0005da48, +0x00195288, +0x00195288, +0x0005da48, +0x0013c14c, +0x004470ec, +0x00fa825a, +0x000c7322, +0x00f02316, +0x000b4d9e, +0x007de295, +0x00f821da, +0x007de295, +0x008431e5, +0x0007dde2, +0x000271f8, +0x00fb6e08, +0x0002d334, +0x0002d334, +0x00fb6e08, +0x000271f8, +0x00421c2d, +0x00f4e40e, +0x00188dd6, +0x00e410d6, +0x001066c6, +0x000eabd0, +0x00e49430, +0x0010f338, +0x0010f338, +0x00e49430, +0x000eabd0, +0x00421c2d, +0x00f4e40e, +0x00188dd6, +0x00e410d6, +0x001066c6, +0x008e3ba9, +0x000aaa6a, +0x00f5559a, +0x0071c459, +0x00651dd9, +0x00f5c6b6, +0x000b0ede, +0x00000003, +0x00000003, +0x0002c197, +0x0005832b, +0x0002c197, +0x00000003, +0x00000003, +0x0084a705, +0x0007da1a, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000003, +0x00000003, +0x0002c197, +0x0005832b, +0x0002c197, +0x00000003, +0x00000003, +0x0084a705, +0x0007da1a, +0x00000003, +0x00000003, +0x0002c197, +0x0005832b, +0x0002c197, +0x00000003, +0x00000003, +0x0084a705, +0x0007da1a, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000003, +0x000430ab, +0x007ff7a1, +0x00000020, +0x003fffe0, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00040002, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00269ec3, +0x000d0ff4, +0x00051eba, +0x00640001, +0x0002f290, +0x00fdd340, +0x0002a810, +0x0002a810, +0x00fdd340, +0x0002f290, +0x0045a895, +0x00f4a186, +0x0018a312, +0x00e445b2, +0x0010419e, +0x000b68e0, +0x0021f7f0, +0x0044471c, +0x005c5e48, +0x005c5e48, +0x0044471c, +0x0021f7f0, +0x000b68e0, +0x0020ff38, +0x00b24b3d, +0x00062d86, +0x00f4f6ea, +0x000d3f5a, +0x00f2ea1a, +0x00075f92, +0x00c1248b, +0x00fd1080, +0x00faca4c, +0x00fab048, +0x00fdb0ac, +0x00024f54, +0x00054fb8, +0x000535b4, +0x0002ef80, +0x003edb7b, +0x001d92ec, +0x00962b59, +0x000bd422, +0x00e48132, +0x002dbdc2, +0x00c7a94a, +0x0033fbe6, +0x00dd3502, +0x000fea26, +0x00c1248b, +0x00fd1080, +0x00faca4c, +0x00fab048, +0x00fdb0ac, +0x00024f54, +0x00054fb8, +0x000535b4, +0x0002ef80, +0x003edb7b, +0x001d92ec, +0x00962b59, +0x000bd422, +0x00e48132, +0x002dbdc2, +0x00c7a94a, +0x0033fbe6, +0x00dd3502, +0x000fea26, +0x003c0001, +0x00080002, +0x007f0001, +0x00040002, +0x00040002, +0x00000020, +0x003fffe0, +0x00000020, +0x003fffe0, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00009110, +0x03130298, +0x02DE031E, +0x004302E8, +0x0325003A, +0x032C0344, +0x043D02C9, +0x049B0351, +0x018100CA, +0x026C01AD, +0x00B402AB, +0x01BE01CC, +0x054505BB, +0x000202F3, +0x00DE00D8, +0x00EF00E8, +0x010600F9, +0x0124010D, +0x0114011C, +0x0146012B, +0x0003015D, +0x017F017E, +0x041C0180, +0x01690366, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00B90011, +0x009E009D, +0x00A0009F, +0x00000000, +0x002F0011, +0x00A400A3, +0x00A600A5, +0x00000000, +0x00BA0011, +0x00AC00AB, +0x00A100AD, +0x00000000, +0x00BA0011, +0x00B200B1, +0x00B400B3, +0x00000000, +0x00BB0011, +0x00AF00AE, +0x00A200B0, +0x00000000, +0x00BB0011, +0x00B600B5, +0x00B800B7, +0x00000000, +0x00560014, +0x00570003, +0x005A0058, +0x00000013, +0x00560014, +0x00570006, +0x00610058, +0x00000013, +0x00640014, +0x0065010C, +0x00680066, +0x00000012, +0x005B0015, +0x005C0002, +0x005F005D, +0x00000013, +0x005B0015, +0x005C0005, +0x0062005D, +0x00000013, +0x01040003, +0x0001008E, +0x00900001, +0x00000000, +0x01050003, +0x0001008F, +0x00910001, +0x00000000, +0x01060003, +0x0001012B, +0x00900001, +0x00000000, +0x01060003, +0x0001012C, +0x00910001, +0x00000000, +0x004D0003, +0x0001008E, +0x00900001, +0x00000000, +0x004D0003, +0x0001008F, +0x00910001, +0x00000000, +0x0032000A, +0x00710030, +0x004E0072, +0x00000000, +0x00BA0000, +0x00A700BA, +0x009C00A9, +0x00000000, +0x00BB0000, +0x00A800BB, +0x009C00AA, +0x00000000, +0x0030000A, +0x00BE0030, +0x009C00BF, +0x00000000, +0x00010013, +0x00010001, +0x010F0001, +0x00000000, +0x00010013, +0x00010001, +0x01100001, +0x00000000, +0x000D0009, +0x000F000E, +0x00110010, +0x00000000, +0x00280000, +0x002B002A, +0x002D002C, +0x00000000, +0x00240000, +0x00790024, +0x00920074, +0x00000000, +0x00030000, +0x007A0003, +0x00930075, +0x00000000, +0x00240000, +0x007B0024, +0x00940077, +0x00000000, +0x00060000, +0x007C0006, +0x00950078, +0x00000000, +0x00290000, +0x007D0104, +0x00920073, +0x00000000, +0x008E0000, +0x007E0060, +0x00930075, +0x00000000, +0x00290000, +0x007F0105, +0x00940076, +0x00000000, +0x008F0000, +0x00800063, +0x00950078, +0x00000000, +0x01070000, +0x00810107, +0x00920074, +0x00000000, +0x010A0000, +0x0082010A, +0x00930075, +0x00000000, +0x01070000, +0x00830107, +0x00940077, +0x00000000, +0x010B0000, +0x0084010B, +0x00950078, +0x00000000, +0x00310000, +0x00850106, +0x00920073, +0x00000000, +0x012B0000, +0x00860108, +0x00930075, +0x00000000, +0x00310000, +0x00870106, +0x00940076, +0x00000000, +0x012C0000, +0x00880109, +0x00950078, +0x00000000, +0x00270000, +0x008B004D, +0x00920073, +0x00000000, +0x008E0000, +0x008C008D, +0x00930075, +0x00000000, +0x00270000, +0x0089004D, +0x00940076, +0x00000000, +0x008F0000, +0x008A008D, +0x00950078, +0x00000000, +0x00310000, +0x006F002F, +0x004E0070, +0x00000000, +0x002F0000, +0x009A00B9, +0x009C009B, +0x00000000, +0x002F0000, +0x00BC002F, +0x009C00BD, +0x00000000, +0x00300018, +0x00980051, +0x009700D1, +0x00000000, +0x002F0018, +0x00960050, +0x009700D1, +0x00000000, +0x002E0007, +0x00010031, +0x00000017, +0x00000000, +0x00220007, +0x00010032, +0x00000018, +0x00000000, +0x00CF000B, +0x00010001, +0x00D00001, +0x00000000, +0x0001000C, +0x00010001, +0x00DA0001, +0x00000000, +0x0001000C, +0x00010001, +0x00DB0001, +0x00000000, +0x0001000C, +0x00010001, +0x00DC0001, +0x00000000, +0x0001000C, +0x00010001, +0x00DD0001, +0x00000000, +0x0001000C, +0x00010001, +0x00DE0001, +0x00000000, +0x0001000C, +0x00010001, +0x00DF0001, +0x00000000, +0x0001000C, +0x00010001, +0x00E00001, +0x00000000, +0x0001000C, +0x00010001, +0x00E10001, +0x00000000, +0x0001000C, +0x00010001, +0x00E20001, +0x00000000, +0x0001000C, +0x00010001, +0x00E30001, +0x00000000, +0x0001000C, +0x00010001, +0x00E40001, +0x00000000, +0x0001000C, +0x00010001, +0x00E50001, +0x00000000, +0x0001000C, +0x00010001, +0x00E60001, +0x00000000, +0x0001000C, +0x00010001, +0x00E70001, +0x00000000, +0x0001000C, +0x00010001, +0x00E80001, +0x00000000, +0x0001000C, +0x00010001, +0x00E90001, +0x00000000, +0x00FA000D, +0x00010001, +0x00FB0001, +0x00000000, +0x002F0005, +0x001C0027, +0x00000030, +0x00000000, +0x002A0005, +0x001D002E, +0x00000021, +0x00000000, +0x00080006, +0x00260021, +0x0000001A, +0x00000000, +0x00080006, +0x00260022, +0x0000001B, +0x00000000, +0x00080006, +0x006A0069, +0x0000001E, +0x00000000, +0x00080006, +0x006A0029, +0x0000001F, +0x00000000, +0x00C10001, +0x00C90052, +0x00000120, +0x00000000, +0x00030004, +0x000C0024, +0x00900001, +0x00000000, +0x00060004, +0x000C0024, +0x00910001, +0x00000000, +0x010A0004, +0x000C0107, +0x00900001, +0x00000000, +0x010B0004, +0x000C0107, +0x00910001, +0x00000000, +0x00300004, +0x00FD0051, +0x00FC0001, +0x00000000, +0x002F0004, +0x00FD0050, +0x00FC0001, +0x00000000, +0x00410002, +0x00430042, +0x00000016, +0x00000000, +0x00330002, +0x00350034, +0x00000013, +0x00000000, +0x00360002, +0x00380037, +0x00000014, +0x00000000, +0x00390002, +0x003B003A, +0x00000015, +0x00000000, +0x00690002, +0x006C006B, +0x00000019, +0x00000000, +0x01070002, +0x0040003F, +0x00000020, +0x00000000, +0x00080002, +0x00470046, +0x00000019, +0x00000000, +0x00300002, +0x00BB00BA, +0x00000019, +0x00000000, +0x00CE0002, +0x00C800C0, +0x00000019, +0x00000000, +0x010C0002, +0x010E010D, +0x00000019, +0x00000000, +0x00270002, +0x00450044, +0x00000019, +0x00000000, +0x003C0002, +0x003E003D, +0x00000019, +0x00000000, +0x00010008, +0x00010028, +0x00530001, +0x00000000, +0x00010008, +0x00010023, +0x00540001, +0x00000000, +0x00C00010, +0x00C200C1, +0x00C700C3, +0x00000000, +0x00C8000F, +0x00CA00C9, +0x00CD00CB, +0x00000000, +0x00010013, +0x00010001, +0x01110001, +0x00000000, +0x00010013, +0x00010001, +0x01120001, +0x00000000, +0x00010013, +0x00010001, +0x01130001, +0x00000000, +0x00010013, +0x00010001, +0x01140001, +0x00000000, +0x00010013, +0x00010001, +0x01150001, +0x00000000, +0x00010013, +0x00010001, +0x01160001, +0x00000000, +0x00010013, +0x00010001, +0x01170001, +0x00000000, +0x00010013, +0x00010001, +0x01180001, +0x00000000, +0x0001000E, +0x00010001, +0x00010001, +0x00000000, +0x00010013, +0x00010001, +0x01190001, +0x00000000, +0x00010013, +0x00010001, +0x011A0001, +0x00000000, +0x00010013, +0x00010001, +0x011B0001, +0x00000000, +0x00490012, +0x00D20041, +0x00D500D3, +0x00000000, +0x004A0012, +0x00D70033, +0x00D600D4, +0x00000000, +0x004B0012, +0x00D80036, +0x00D600D4, +0x00000000, +0x004C0012, +0x00D90039, +0x00D600D4, +0x00000000, +0x011D0016, +0x011E0001, +0x011F0001, +0x00000000, +0x00010017, +0x00010001, +0x00000001, +0x00000000, +0x01210014, +0x0123010A, +0x01260124, +0x00000013, +0x01210014, +0x0123010B, +0x01270124, +0x00000013, +0x01280015, +0x012F012D, +0x01320130, +0x00000013, +0x01280015, +0x012F012E, +0x01330130, +0x00000013, +0x012B0000, +0x00860129, +0x00930075, +0x00000000, +0x012C0000, +0x0088012A, +0x00950078, +0x00000000, +0x00010013, +0x00010001, +0x01340001, +0x00000000, +0x00010013, +0x00010001, +0x01350001, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000010, +0x00000000, +0x00000000, +0x000022E8, +0x00000000, +0x00000000, +0x00000018, +0x000022E0, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x0000000A, +0x00000000, +0x00000000, +0x00000000, +0x7FFF7FFF, +0x7FFF7FFF, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x019C0189, +0x01C201AF, +0x01E801D5, +0x020E01FB, +0x02340221, +0x025A0247, +0x0280026D, +0x02A60293, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x02CF02BD, +0x02F302E1, +0x03170305, +0x033B0329, +0x035F034D, +0x03830371, +0x03A70395, +0x03CB03B9, +0x00008363, +0x00000428, +0x00000000, +0x00003800, +0x000000FF, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x00000000, +0x00000000, +0x00000000, +0x000CE13D, +0x00006845, +0x00008363, +0x00000428, +0x000CE13D, +0x00006845, +0x00008363, +0x00000428, +0x000CE13D, +0x00006845, +0x25782728, +0x00002738, +0x25682708, +0x00002718, +0x297826B8, +0x000026A8, +0x29682698, +0x00002688, +0x255826E8, +0x000026F8, +0x254826C8, +0x000026D8, +0x29582638, +0x00002628, +0x29482618, +0x00002608, +0x25382668, +0x00002678, +0x25282648, +0x00002658, +0x27582488, +0x00002478, +0x259824A8, +0x00002498, +0x25A824C8, +0x000024B8, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00003000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00003900, +0x00003900, +0x00003900, +0x00003CBF, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x00000004, +0x00000001, +0x00000000, +0x00000000, +0x00000000, +0x003FFFF0, +0x00000000, +0x00400000, +0x254826C8, +0x00002C08, +0x255826E8, +0x00002C18, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00041603, +0x00000000, +0x00041902, +0x00000000, +0x00066A03, +0x00000000, +0x00046305, +0x00000000, +0x00046804, +0x00000000, +0x00066505, +0x00000000, +0x0001830C, +0x00000000, +0x00046C28, +0x00000000, +0x0004BC28, +0x00000000, +0x0006F206, +0x00000000, +0x00022A18, +0x00000000, +0x00013A12, +0x00000000, +0x00014C12, +0x00013700, +0x00015C24, +0x00013812, +0x00014A12, +0x00120024, +0x00057800, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015C0E, +0x00015F0C, +0x00016A04, +0x00015F0C, +0x00016E04, +0x00000000, +0x00017202, +0x00000000, +0x00017402, +0x00016B0C, +0x00017604, +0x00016B0C, +0x00017A04, +0x00017E02, +0x00017E02, +0x00000000, +0x00018F0C, +0x00000000, +0x00019B0C, +0x00000000, +0x0001770C, +0x00000000, +0x00016B0C, +0x00000000, +0x00015F0C, +0x00016B0C, +0x0001770C, +0x00000000, +0x0001A70C, +0x00000000, +0x0001BF0C, +0x00000000, +0x0001CB0C, +0x00000000, +0x0001FD0C, +0x00020909, +0x00020909, +0x00000000, +0x00018009, +0x000B0009, +0x00000000, +0x00000000, +0x0001B30C, +0x00000000, +0x00066D0C, +0x00000000, +0x0006790C, +0x00000000, +0x0006850C, +0x00000000, +0x0006910C, +0x00000000, +0x0002420C, +0x00022A18, +0x0002720C, +0x00022A18, +0x00027E0C, +0x00000000, +0x00024E0C, +0x00022A00, +0x00028A0C, +0x00022A00, +0x0002960C, +0x00000000, +0x00025A0C, +0x00022A18, +0x0002A20C, +0x00022A18, +0x0002AE0C, +0x00000000, +0x0008230C, +0x00022A18, +0x00082F0C, +0x00022A18, +0x00083B0C, +0x00022A18, +0x0002BA0C, +0x00022A18, +0x0002C60C, +0x00000000, +0x0002660C, +0x00022A18, +0x0002D20C, +0x00022A18, +0x0002DE0C, +0x00022A18, +0x0002EA0C, +0x00022A18, +0x0002F60C, +0x00022A18, +0x0003020C, +0x00022A18, +0x00030E0C, +0x00000000, +0x00031A78, +0x00000000, +0x00039218, +0x00000000, +0x0003AA18, +0x00000000, +0x0003C218, +0x00000000, +0x0003DA18, +0x00000000, +0x00040A0C, +0x000B0019, +0x00000000, +0x000B0009, +0x00000000, +0x00000000, +0x00041B18, +0x00000000, +0x00043318, +0x00000000, +0x00044B18, +0x000B2DD8, +0x00000000, +0x000B2DD4, +0x00000000, +0x000B2DC0, +0x00000000, +0x00000000, +0x00046C28, +0x00029313, +0x0002A613, +0x00046C28, +0x0002BB00, +0x0002BC00, +0x000B7900, +0x00590002, +0x00217800, +0x00000000, +0x00049428, +0x00029313, +0x0002A613, +0x00049428, +0x0002B900, +0x0002BA00, +0x000B8100, +0x005E0002, +0x00212800, +0x00000000, +0x00049428, +0x00590004, +0x00217800, +0x005E0004, +0x00212800, +0x00000000, +0x00049428, +0x00000000, +0x0004BC28, +0x0003B912, +0x0003CB12, +0x0004BC28, +0x0003DD00, +0x0003DE00, +0x000B9100, +0x0067000C, +0x00226800, +0x00000000, +0x0004E40C, +0x0001BF0C, +0x00015F0C, +0x00000000, +0x0004F00C, +0x00000000, +0x0004FC0C, +0x00022A18, +0x0005080C, +0x00022A18, +0x0005140C, +0x00053919, +0x00053919, +0x00000000, +0x00041119, +0x00052019, +0x00052019, +0x0003F819, +0x0003DF19, +0x00000000, +0x0004450B, +0x00000000, +0x0004500B, +0x00000000, +0x00045B07, +0x00000000, +0x00042A0B, +0x00000000, +0x0004350B, +0x00000000, +0x00044005, +0x0005760B, +0x0005760B, +0x00058107, +0x00058107, +0x0005880B, +0x0005880B, +0x00059305, +0x00059305, +0x0005980B, +0x0005980B, +0x0005A307, +0x0005A307, +0x0005AA0B, +0x0005AA0B, +0x0005B505, +0x0005B505, +0x0005BC0B, +0x0005BC0B, +0x0005C707, +0x0005C707, +0x0005CE0B, +0x0005CE0B, +0x0005D905, +0x0005D905, +0x0005DE0B, +0x0005DE0B, +0x0005E907, +0x0005E907, +0x0005F00B, +0x0005F00B, +0x0005FB05, +0x0005FB05, +0x0006120B, +0x0006120B, +0x00061D07, +0x00061D07, +0x0006000B, +0x0006000B, +0x00060B05, +0x00060B05, +0x00000000, +0x00063D28, +0x00000000, +0x00057002, +0x00000000, +0x00057204, +0x00000006, +0x00000000, +0x00000003, +0x00000000, +0x000B000B, +0x00000000, +0x00010007, +0x00000000, +0x000B000B, +0x00000000, +0x00030005, +0x00000000, +0x0005520F, +0x0005520F, +0x000B000F, +0x0008A800, +0x0005610F, +0x0005610F, +0x00030007, +0x00000000, +0x00062209, +0x00062209, +0x00046209, +0x00046209, +0x000B0009, +0x00000000, +0x00000000, +0x00063102, +0x00062B03, +0x00062B03, +0x000BA102, +0x00046B03, +0x00000003, +0x002E8C00, +0x00000003, +0x002EBC00, +0x00000003, +0x002EC000, +0x00000000, +0x00063302, +0x00062E03, +0x00062E03, +0x000BB102, +0x00046E03, +0x00000003, +0x002E8E00, +0x00069D09, +0x00069D09, +0x0006A609, +0x0006A609, +0x00000000, +0x00047109, +0x00000000, +0x00047A09, +0x00000000, +0x00063502, +0x0006AF03, +0x0006AF03, +0x000BB302, +0x00048303, +0x00000000, +0x00063902, +0x0006B203, +0x0006B203, +0x000BB702, +0x00048603, +0x00000000, +0x00063702, +0x0006B503, +0x0006B503, +0x000BB502, +0x00048903, +0x00000003, +0x002EBE00, +0x00000000, +0x00063B02, +0x0006B803, +0x0006B803, +0x000BB902, +0x00048C03, +0x00000003, +0x002EC200, +0x00000000, +0x0006BB0C, +0x00022A18, +0x0006C70C, +0x00022A18, +0x0006D30C, +0x0006DF09, +0x0006DF09, +0x00000000, +0x00049109, +0x0006E809, +0x0006E809, +0x0004A309, +0x00049A09, +0x00000000, +0x00072A06, +0x00022A00, +0x00074818, +0x0007600B, +0x0007600B, +0x00000000, +0x0004B00B, +0x00013700, +0x00073018, +0x0007600B, +0x0007600B, +0x00074818, +0x00072A06, +0x00C4000B, +0x0000C500, +0x00000000, +0x0006F806, +0x00022A18, +0x0006FF18, +0x0004AC04, +0x0006FE00, +0x00013700, +0x00071700, +0x000BAE00, +0x00071812, +0x00EA00CC, +0x000026FF, +0x00000000, +0x0006F206, +0x00000000, +0x00100020, +0x00F42CDC, +0x0000002C, +0x00000000, +0x0004BB0F, +0x00078313, +0x00078313, +0x00000000, +0x0004CA13, +0x00000000, +0x0004DD13, +0x00170013, +0x00000000, +0x00170013, +0x00000000, +0x00079613, +0x00079613, +0x0007A913, +0x0007A913, +0x0007BC13, +0x0007BC13, +0x00002060, +0x00000000, +0x00002088, +0x00000000, +0x000020B0, +0x00000000, +0x000020D8, +0x00000000, +0x00002100, +0x00000000, +0x00002128, +0x00000000, +0x00002150, +0x00000000, +0x00002178, +0x00000000, +0x000021A0, +0x00000000, +0x000021C8, +0x00000000, +0x000021F0, +0x00000000, +0x00002218, +0x00000000, +0x00002240, +0x00000000, +0x00002268, +0x00000000, +0x00002290, +0x00000000, +0x000022B8, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x000B2710, +0x000F00EA, +0x00000000, +0x00000002, +0x00000000, +0x00000000, +0x00013700, +0x00000000, +0x0001410C, +0x00000000, +0x0007CF02, +0x00000000, +0x0007D104, +0x00000000, +0x0007D506, +0x00000000, +0x0007DB0C, +0x00000000, +0x0007E748, +0x00000000, +0x0003F20C, +0x00000000, +0x0003FE0C, +0x00000000, +0x0001D70C, +0x00000000, +0x0001E30C, +0x00000000, +0x0001EF02, +0x00000000, +0x0001F204, +0x00000000, +0x0001F702, +0x00000000, +0x0001F904, +0x00000000, +0x0007FF0C, +0x00022A18, +0x00080B0C, +0x00022A18, +0x0008170C, +0x00002EEC, +0x00000000, +0x00002EF4, +0x00000000, +0x00002EFC, +0x00000000, +0x00002F04, +0x00000000, +0x00002F0C, +0x00000000, +0x00002F14, +0x00000000, +0x00002F1C, +0x00000000, +0x00002F24, +0x00000000, +0x00002F2C, +0x00000000, +0x00002F34, +0x00000000, +0x00002F3C, +0x00000000, +0x00002F44, +0x00000000, +0x00002F4C, +0x00000000, +0x00000000, +0x0008B800, +0x00000000, +0x000E4000, +0x0008B800, +0x00013700, +0x00003CC0, +0x00000000, +0x0004F300, +0x0004F301, +0x00000000, +0x00084828, +0x00000000, +0x00084828, +0x00029313, +0x0002A613, +0x00084828, +0x0004F500, +0x0004F600, +0x000F3400, +0x00250002, +0x0020B001, +0x00250004, +0x0020B001, +0x00000000, +0x00087028, +0x00000000, +0x00087028, +0x00000000, +0x00087028, +0x00000000, +0x00089802, +0x00000000, +0x00089A04, +0x00000000, +0x0001EF03, +0x00000000, +0x0001F205, +0x00029313, +0x0002A613, +0x00087028, +0x0004F700, +0x0004F800, +0x000F3C00, +0x00310002, +0x0021F001, +0x00310004, +0x0021F001, +0x00003D10, +0x00000000, +0x00003D18, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000001, +0x00000010, +0x00000000, +0x00000000, +0x00400000, +0x00400000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x0000001B, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000003, +0x00000000, +0x00000003, +0x00000000, +0x00000003, +0x00000000, +0x00000006, +0x00000000, +0x00000006, +0x00000000, +0x00000006, +0x00000000, +0x00000009, +0x00000000, +0x00000009, +0x00000000, +0x00000009, +0x00000000, +0x00000005, +0x00000000, +0x00000005, +0x00000000, +0x00000005, +0x00000000, +0x00000007, +0x00000000, +0x00000007, +0x00000000, +0x00000007, +0x00000000, +0x00000008, +0x00000000, +0x00000008, +0x00000000, +0x00000008, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00E66666, +0x00199999, +0x00199999, +0x00199999, +0x00000000, +0x00000000, +0x00E66666, +0x00E66666, +0x00FFFFFF, +0x00FFFFFF, +0x00199999, +0x00199999, +0x00F33333, +0x000CCCCC, +0x00F33333, +0x00F33333, +0x00199999, +0x00E66666, +0x00F33333, +0x00F33333, +0x00F33333, +0x000CCCCC, +0x00199999, +0x00199999, +0x000CCCCC, +0x00162B95, +0x00F33333, +0x000CCCCC, +0x00E66666, +0x00000000, +0x00F33333, +0x00F33333, +0x000CCCCC, +0x00E9D46A, +0x00199999, +0x00E66666, +0x000CCCCC, +0x00E9D46A, +0x00F33333, +0x00F33333, +0x00E66666, +0x00FFFFFF, +0x00F33333, +0x000CCCCC, +0x000CCCCC, +0x00162B95, +0x00199999, +0x00199999, +0x00162B95, +0x0018BA4A, +0x000CCCCC, +0x00162B95, +0x00000000, +0x00121A18, +0x00F33333, +0x000CCCCC, +0x00E9D46A, +0x0006A032, +0x00E66666, +0x00000000, +0x00E9D46A, +0x00F95FCD, +0x00F33333, +0x00F33333, +0x00FFFFFF, +0x00EDE5E7, +0x000CCCCC, +0x00E9D46A, +0x00162B95, +0x00E745B5, +0x00199999, +0x00E66666, +0x00162B95, +0x00E745B5, +0x000CCCCC, +0x00E9D46A, +0x00000000, +0x00EDE5E7, +0x00F33333, +0x00F33333, +0x00E9D46A, +0x00F95FCF, +0x00E66666, +0x00FFFFFF, +0x00E9D46A, +0x0006A032, +0x00F33333, +0x000CCCCC, +0x00FFFFFF, +0x00121A18, +0x000CCCCC, +0x00162B95, +0x00162B95, +0x0018BA4A, +0x00199999, +0x00199999, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00010000, +0x00010000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, +0x00000000, diff --git a/sound/soc/omap/abe/abe_functionsid.h b/sound/soc/omap/abe/abe_functionsid.h new file mode 100644 index 0000000..a2bf7dc --- /dev/null +++ b/sound/soc/omap/abe/abe_functionsid.h @@ -0,0 +1,113 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_FUNCTIONSID_H_ +#define _ABE_FUNCTIONSID_H_ +/* + * TASK function ID definitions + */ +#define C_ABE_FW_FUNCTION_IIR 0 +#define C_ABE_FW_FUNCTION_monoToStereoPack 1 +#define C_ABE_FW_FUNCTION_stereoToMonoSplit 2 +#define C_ABE_FW_FUNCTION_decimator 3 +#define C_ABE_FW_FUNCTION_OS0Fill 4 +#define C_ABE_FW_FUNCTION_mixer2 5 +#define C_ABE_FW_FUNCTION_mixer4 6 +#define C_ABE_FW_FUNCTION_inplaceGain 7 +#define C_ABE_FW_FUNCTION_StreamRouting 8 +#define C_ABE_FW_FUNCTION_gainConverge 9 +#define C_ABE_FW_FUNCTION_dualIir 10 +#define C_ABE_FW_FUNCTION_IO_DL_pp 11 +#define C_ABE_FW_FUNCTION_IO_generic 12 +#define C_ABE_FW_FUNCTION_irq_fifo_debug 13 +#define C_ABE_FW_FUNCTION_synchronize_pointers 14 +#define C_ABE_FW_FUNCTION_VIBRA2 15 +#define C_ABE_FW_FUNCTION_VIBRA1 16 +#define C_ABE_FW_FUNCTION_APS_core 17 +#define C_ABE_FW_FUNCTION_IIR_SRC_MIC 18 +#define C_ABE_FW_FUNCTION_wrappers 19 +#define C_ABE_FW_FUNCTION_ASRC_DL_wrapper 20 +#define C_ABE_FW_FUNCTION_ASRC_UL_wrapper 21 +#define C_ABE_FW_FUNCTION_mem_init 22 +#define C_ABE_FW_FUNCTION_debug_vx_asrc 23 +#define C_ABE_FW_FUNCTION_IIR_SRC2 24 +/* + * COPY function ID definitions + */ +#define NULL_COPY_CFPID 0 +#define S2D_STEREO_16_16_CFPID 1 +#define S2D_MONO_MSB_CFPID 2 +#define S2D_STEREO_MSB_CFPID 3 +#define S2D_STEREO_RSHIFTED_16_CFPID 4 +#define S2D_MONO_RSHIFTED_16_CFPID 5 +#define D2S_STEREO_16_16_CFPID 6 +#define D2S_MONO_MSB_CFPID 7 +#define D2S_MONO_RSHIFTED_16_CFPID 8 +#define D2S_STEREO_RSHIFTED_16_CFPID 9 +#define D2S_STEREO_MSB_CFPID 10 +#define COPY_DMIC_CFPID 11 +#define COPY_MCPDM_DL_CFPID 12 +#define COPY_MM_UL_CFPID 13 +#define SPLIT_SMEM_CFPID 14 +#define MERGE_SMEM_CFPID 15 +#define SPLIT_TDM_CFPID 16 +#define MERGE_TDM_CFPID 17 +#define ROUTE_MM_UL_CFPID 18 +#define IO_IP_CFPID 19 +#define COPY_UNDERFLOW_CFPID 20 +#endif /* _ABE_FUNCTIONSID_H_ */ diff --git a/sound/soc/omap/abe/abe_fw.h b/sound/soc/omap/abe/abe_fw.h new file mode 100644 index 0000000..a29dbb3 --- /dev/null +++ b/sound/soc/omap/abe/abe_fw.h @@ -0,0 +1,214 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_FW_H_ +#define _ABE_FW_H_ + +#include "abe_cm_addr.h" +#include "abe_sm_addr.h" +#include "abe_dm_addr.h" +#include "abe_typedef.h" +/* + * GLOBAL DEFINITION + */ +/* one scheduler loop = 4kHz = 12 samples at 48kHz */ +#define FW_SCHED_LOOP_FREQ 4000 +/* one scheduler loop = 4kHz = 12 samples at 48kHz */ +#define FW_SCHED_LOOP_FREQ_DIV1000 (FW_SCHED_LOOP_FREQ/1000) +#define EVENT_FREQUENCY 96000 +#define SLOTS_IN_SCHED_LOOP (96000/FW_SCHED_LOOP_FREQ) +#define SCHED_LOOP_8kHz (8000/FW_SCHED_LOOP_FREQ) +#define SCHED_LOOP_16kHz (16000/FW_SCHED_LOOP_FREQ) +#define SCHED_LOOP_24kHz (24000/FW_SCHED_LOOP_FREQ) +#define SCHED_LOOP_48kHz (48000/FW_SCHED_LOOP_FREQ) +#define TASKS_IN_SLOT 8 +/* + * DMEM AREA - SCHEDULER + */ +#define dmem_mm_trace OMAP_ABE_D_DEBUG_FIFO_ADDR +#define dmem_mm_trace_size ((OMAP_ABE_D_DEBUG_FIFO_SIZE)/4) +#define ATC_SIZE 8 /* 8 bytes per descriptors */ +struct omap_abe_atc_desc { + unsigned rdpt:7; /* first 32bits word of the descriptor */ + unsigned reserved0:1; + unsigned cbsize:7; + unsigned irqdest:1; + unsigned cberr:1; + unsigned reserved1:5; + unsigned cbdir:1; + unsigned nw:1; + unsigned wrpt:7; + unsigned reserved2:1; + unsigned badd:12; /* second 32bits word of the descriptor */ + unsigned iter:7; /* iteration field overlaps 16-bit boundary */ + unsigned srcid:6; + unsigned destid:6; + unsigned desen:1; +}; +/* + * Infinite counter incremented on each sheduler periods (~250 us) + * uint16 dmem_debug_time_stamp + */ +#define dmem_debug_time_stamp OMAP_ABE_D_LOOPCOUNTER_ADDR +/* + * ATC BUFFERS + IO TASKS SMEM buffers + */ +#define dmem_dmic OMAP_ABE_D_DMIC_UL_FIFO_ADDR +#define dmem_dmic_size (OMAP_ABE_D_DMIC_UL_FIFO_SIZE/4) +#define dmem_amic OMAP_ABE_D_MCPDM_UL_FIFO_ADDR +#define dmem_amic_size (OMAP_ABE_D_MCPDM_UL_FIFO_SIZE/4) +#define smem_amic AMIC_96_labelID +#define dmem_mcpdm OMAP_ABE_D_MCPDM_DL_FIFO_ADDR +#define dmem_mcpdm_size (OMAP_ABE_D_MCPDM_DL_FIFO_SIZE/4) +#define dmem_mm_ul OMAP_ABE_D_MM_UL_FIFO_ADDR +#define dmem_mm_ul_size (OMAP_ABE_D_MM_UL_FIFO_SIZE/4) +/* managed directly by the router */ +#define smem_mm_ul MM_UL_labelID +#define dmem_mm_ul2 OMAP_ABE_D_MM_UL2_FIFO_ADDR +#define dmem_mm_ul2_size (OMAP_ABE_D_MM_UL2_FIFO_SIZE/4) +/* managed directly by the router */ +#define smem_mm_ul2 MM_UL2_labelID +#define dmem_mm_dl OMAP_ABE_D_MM_DL_FIFO_ADDR +#define dmem_mm_dl_size (OMAP_ABE_D_MM_DL_FIFO_SIZE/4) +#define smem_mm_dl MM_DL_labelID +#define dmem_vx_dl OMAP_ABE_D_VX_DL_FIFO_ADDR +#define dmem_vx_dl_size (OMAP_ABE_D_VX_DL_FIFO_SIZE/4) +#define smem_vx_dl IO_VX_DL_ASRC_labelID /* Voice_16k_DL_labelID */ +#define dmem_vx_ul OMAP_ABE_D_VX_UL_FIFO_ADDR +#define dmem_vx_ul_size (OMAP_ABE_D_VX_UL_FIFO_SIZE/4) +#define smem_vx_ul Voice_8k_UL_labelID +#define dmem_tones_dl OMAP_ABE_D_TONES_DL_FIFO_ADDR +#define dmem_tones_dl_size (OMAP_ABE_D_TONES_DL_FIFO_SIZE/4) +#define smem_tones_dl Tones_labelID +#define dmem_vib_dl OMAP_ABE_D_VIB_DL_FIFO_ADDR +#define dmem_vib_dl_size (OMAP_ABE_D_VIB_DL_FIFO_SIZE/4) +#define smem_vib IO_VIBRA_DL_labelID +#define dmem_mm_ext_out OMAP_ABE_D_MM_EXT_OUT_FIFO_ADDR +#define dmem_mm_ext_out_size (OMAP_ABE_D_MM_EXT_OUT_FIFO_SIZE/4) +#define smem_mm_ext_out DL1_GAIN_out_labelID +#define dmem_mm_ext_in OMAP_ABE_D_MM_EXT_IN_FIFO_ADDR +#define dmem_mm_ext_in_size (OMAP_ABE_D_MM_EXT_IN_FIFO_SIZE/4) +/*IO_MM_EXT_IN_ASRC_labelID ASRC input buffer, size 40 */ +#define smem_mm_ext_in_opp100 IO_MM_EXT_IN_ASRC_labelID +/* at OPP 50 without ASRC */ +#define smem_mm_ext_in_opp50 MM_EXT_IN_labelID +#define dmem_bt_vx_dl OMAP_ABE_D_BT_DL_FIFO_ADDR +#define dmem_bt_vx_dl_size (OMAP_ABE_D_BT_DL_FIFO_SIZE/4) +#define smem_bt_vx_dl_opp50 BT_DL_8k_labelID +/*BT_DL_8k_opp100_labelID ASRC output buffer, size 40 */ +#define smem_bt_vx_dl_opp100 BT_DL_8k_opp100_labelID +#define dmem_bt_vx_ul OMAP_ABE_D_BT_UL_FIFO_ADDR +#define dmem_bt_vx_ul_size (OMAP_ABE_D_BT_UL_FIFO_SIZE/4) +#define smem_bt_vx_ul_opp50 BT_UL_8k_labelID +/*IO_BT_UL_ASRC_labelID ASRC input buffer, size 40 */ +#define smem_bt_vx_ul_opp100 IO_BT_UL_ASRC_labelID +/* + * SMEM AREA + */ +/* + * GAIN SMEM on PORT + * int32 smem_G0 [18] : desired gain on the ports + * format of G0 = 6 bits left shifted desired gain in linear 24bits format + * int24 stereo G0 [18] = G0 + * int24 stereo GI [18] current value of the gain in the same format of G0 + * List of smoothed gains : + * 6 DMIC 0 1 2 3 4 5 + * 2 AMIC L R + * 4 PORT1/2_RX L R + * 2 MM_EXT L R + * 2 MM_VX_DL L R + * 2 IHF L R + * --------------- + * 18 = TOTAL + */ +/* + * COEFFICIENTS AREA + */ +/* + * delay coefficients used in the IIR-1 filters + * int24 cmem_gain_delay_iir1[9 x 2] (a, (1-a)) + * + * 3 for 6 DMIC 0 1 2 3 4 5 + * 1 for 2 AMIC L R + * 2 for 4 PORT1/2_RX L R + * 1 for 2 MM_EXT L R + * 1 for 2 MM_VX_DL L R + * 1 for 2 IHF L R + */ +/* + * gain controls + */ +#define GAIN_LEFT_OFFSET 0 +#define GAIN_RIGHT_OFFSET 1 +/* stereo gains */ +#define dmic1_gains_offset 0 +#define dmic2_gains_offset 2 +#define dmic3_gains_offset 4 +#define amic_gains_offset 6 +#define dl1_gains_offset 8 +#define dl2_gains_offset 10 +#define splitters_gains_offset 12 +#define mixer_dl1_offset 14 +#define mixer_dl2_offset 18 +#define mixer_echo_offset 22 +#define mixer_sdt_offset 24 +#define mixer_vxrec_offset 26 +#define mixer_audul_offset 30 +#define btul_gains_offset 34 + +#endif/* _ABE_FW_H_ */ diff --git a/sound/soc/omap/abe/abe_gain.c b/sound/soc/omap/abe/abe_gain.c new file mode 100644 index 0000000..a31894d --- /dev/null +++ b/sound/soc/omap/abe/abe_gain.c @@ -0,0 +1,803 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dbg.h" +#include "abe.h" +#include "abe_gain.h" +#include "abe_mem.h" + +/* + * ABE CONST AREA FOR PARAMETERS TRANSLATION + */ +#define min_mdb (-12000) +#define max_mdb (3000) +#define sizeof_db2lin_table (1 + ((max_mdb - min_mdb)/100)) + +const u32 abe_db2lin_table[sizeof_db2lin_table] = { + 0x00000000, /* SMEM coding of -120 dB */ + 0x00000000, /* SMEM coding of -119 dB */ + 0x00000000, /* SMEM coding of -118 dB */ + 0x00000000, /* SMEM coding of -117 dB */ + 0x00000000, /* SMEM coding of -116 dB */ + 0x00000000, /* SMEM coding of -115 dB */ + 0x00000000, /* SMEM coding of -114 dB */ + 0x00000000, /* SMEM coding of -113 dB */ + 0x00000000, /* SMEM coding of -112 dB */ + 0x00000000, /* SMEM coding of -111 dB */ + 0x00000000, /* SMEM coding of -110 dB */ + 0x00000000, /* SMEM coding of -109 dB */ + 0x00000001, /* SMEM coding of -108 dB */ + 0x00000001, /* SMEM coding of -107 dB */ + 0x00000001, /* SMEM coding of -106 dB */ + 0x00000001, /* SMEM coding of -105 dB */ + 0x00000001, /* SMEM coding of -104 dB */ + 0x00000001, /* SMEM coding of -103 dB */ + 0x00000002, /* SMEM coding of -102 dB */ + 0x00000002, /* SMEM coding of -101 dB */ + 0x00000002, /* SMEM coding of -100 dB */ + 0x00000002, /* SMEM coding of -99 dB */ + 0x00000003, /* SMEM coding of -98 dB */ + 0x00000003, /* SMEM coding of -97 dB */ + 0x00000004, /* SMEM coding of -96 dB */ + 0x00000004, /* SMEM coding of -95 dB */ + 0x00000005, /* SMEM coding of -94 dB */ + 0x00000005, /* SMEM coding of -93 dB */ + 0x00000006, /* SMEM coding of -92 dB */ + 0x00000007, /* SMEM coding of -91 dB */ + 0x00000008, /* SMEM coding of -90 dB */ + 0x00000009, /* SMEM coding of -89 dB */ + 0x0000000A, /* SMEM coding of -88 dB */ + 0x0000000B, /* SMEM coding of -87 dB */ + 0x0000000D, /* SMEM coding of -86 dB */ + 0x0000000E, /* SMEM coding of -85 dB */ + 0x00000010, /* SMEM coding of -84 dB */ + 0x00000012, /* SMEM coding of -83 dB */ + 0x00000014, /* SMEM coding of -82 dB */ + 0x00000017, /* SMEM coding of -81 dB */ + 0x0000001A, /* SMEM coding of -80 dB */ + 0x0000001D, /* SMEM coding of -79 dB */ + 0x00000021, /* SMEM coding of -78 dB */ + 0x00000025, /* SMEM coding of -77 dB */ + 0x00000029, /* SMEM coding of -76 dB */ + 0x0000002E, /* SMEM coding of -75 dB */ + 0x00000034, /* SMEM coding of -74 dB */ + 0x0000003A, /* SMEM coding of -73 dB */ + 0x00000041, /* SMEM coding of -72 dB */ + 0x00000049, /* SMEM coding of -71 dB */ + 0x00000052, /* SMEM coding of -70 dB */ + 0x0000005D, /* SMEM coding of -69 dB */ + 0x00000068, /* SMEM coding of -68 dB */ + 0x00000075, /* SMEM coding of -67 dB */ + 0x00000083, /* SMEM coding of -66 dB */ + 0x00000093, /* SMEM coding of -65 dB */ + 0x000000A5, /* SMEM coding of -64 dB */ + 0x000000B9, /* SMEM coding of -63 dB */ + 0x000000D0, /* SMEM coding of -62 dB */ + 0x000000E9, /* SMEM coding of -61 dB */ + 0x00000106, /* SMEM coding of -60 dB */ + 0x00000126, /* SMEM coding of -59 dB */ + 0x0000014A, /* SMEM coding of -58 dB */ + 0x00000172, /* SMEM coding of -57 dB */ + 0x0000019F, /* SMEM coding of -56 dB */ + 0x000001D2, /* SMEM coding of -55 dB */ + 0x0000020B, /* SMEM coding of -54 dB */ + 0x0000024A, /* SMEM coding of -53 dB */ + 0x00000292, /* SMEM coding of -52 dB */ + 0x000002E2, /* SMEM coding of -51 dB */ + 0x0000033C, /* SMEM coding of -50 dB */ + 0x000003A2, /* SMEM coding of -49 dB */ + 0x00000413, /* SMEM coding of -48 dB */ + 0x00000492, /* SMEM coding of -47 dB */ + 0x00000521, /* SMEM coding of -46 dB */ + 0x000005C2, /* SMEM coding of -45 dB */ + 0x00000676, /* SMEM coding of -44 dB */ + 0x0000073F, /* SMEM coding of -43 dB */ + 0x00000822, /* SMEM coding of -42 dB */ + 0x00000920, /* SMEM coding of -41 dB */ + 0x00000A3D, /* SMEM coding of -40 dB */ + 0x00000B7D, /* SMEM coding of -39 dB */ + 0x00000CE4, /* SMEM coding of -38 dB */ + 0x00000E76, /* SMEM coding of -37 dB */ + 0x0000103A, /* SMEM coding of -36 dB */ + 0x00001235, /* SMEM coding of -35 dB */ + 0x0000146E, /* SMEM coding of -34 dB */ + 0x000016EC, /* SMEM coding of -33 dB */ + 0x000019B8, /* SMEM coding of -32 dB */ + 0x00001CDC, /* SMEM coding of -31 dB */ + 0x00002061, /* SMEM coding of -30 dB */ + 0x00002455, /* SMEM coding of -29 dB */ + 0x000028C4, /* SMEM coding of -28 dB */ + 0x00002DBD, /* SMEM coding of -27 dB */ + 0x00003352, /* SMEM coding of -26 dB */ + 0x00003995, /* SMEM coding of -25 dB */ + 0x0000409C, /* SMEM coding of -24 dB */ + 0x0000487E, /* SMEM coding of -23 dB */ + 0x00005156, /* SMEM coding of -22 dB */ + 0x00005B43, /* SMEM coding of -21 dB */ + 0x00006666, /* SMEM coding of -20 dB */ + 0x000072E5, /* SMEM coding of -19 dB */ + 0x000080E9, /* SMEM coding of -18 dB */ + 0x000090A4, /* SMEM coding of -17 dB */ + 0x0000A24B, /* SMEM coding of -16 dB */ + 0x0000B618, /* SMEM coding of -15 dB */ + 0x0000CC50, /* SMEM coding of -14 dB */ + 0x0000E53E, /* SMEM coding of -13 dB */ + 0x00010137, /* SMEM coding of -12 dB */ + 0x0001209A, /* SMEM coding of -11 dB */ + 0x000143D1, /* SMEM coding of -10 dB */ + 0x00016B54, /* SMEM coding of -9 dB */ + 0x000197A9, /* SMEM coding of -8 dB */ + 0x0001C967, /* SMEM coding of -7 dB */ + 0x00020137, /* SMEM coding of -6 dB */ + 0x00023FD6, /* SMEM coding of -5 dB */ + 0x00028619, /* SMEM coding of -4 dB */ + 0x0002D4EF, /* SMEM coding of -3 dB */ + 0x00032D64, /* SMEM coding of -2 dB */ + 0x000390A4, /* SMEM coding of -1 dB */ + 0x00040000, /* SMEM coding of 0 dB */ + 0x00047CF2, /* SMEM coding of 1 dB */ + 0x00050923, /* SMEM coding of 2 dB */ + 0x0005A670, /* SMEM coding of 3 dB */ + 0x000656EE, /* SMEM coding of 4 dB */ + 0x00071CF5, /* SMEM coding of 5 dB */ + 0x0007FB26, /* SMEM coding of 6 dB */ + 0x0008F473, /* SMEM coding of 7 dB */ + 0x000A0C2B, /* SMEM coding of 8 dB */ + 0x000B4606, /* SMEM coding of 9 dB */ + 0x000CA62C, /* SMEM coding of 10 dB */ + 0x000E314A, /* SMEM coding of 11 dB */ + 0x000FEC9E, /* SMEM coding of 12 dB */ + 0x0011DE0A, /* SMEM coding of 13 dB */ + 0x00140C28, /* SMEM coding of 14 dB */ + 0x00167E60, /* SMEM coding of 15 dB */ + 0x00193D00, /* SMEM coding of 16 dB */ + 0x001C515D, /* SMEM coding of 17 dB */ + 0x001FC5EB, /* SMEM coding of 18 dB */ + 0x0023A668, /* SMEM coding of 19 dB */ + 0x00280000, /* SMEM coding of 20 dB */ + 0x002CE178, /* SMEM coding of 21 dB */ + 0x00325B65, /* SMEM coding of 22 dB */ + 0x00388062, /* SMEM coding of 23 dB */ + 0x003F654E, /* SMEM coding of 24 dB */ + 0x00472194, /* SMEM coding of 25 dB */ + 0x004FCF7C, /* SMEM coding of 26 dB */ + 0x00598C81, /* SMEM coding of 27 dB */ + 0x006479B7, /* SMEM coding of 28 dB */ + 0x0070BC3D, /* SMEM coding of 29 dB */ + 0x007E7DB9, /* SMEM coding of 30 dB */ +}; + +const u32 abe_1_alpha_iir[64] = { + 0x040002, 0x040002, 0x040002, 0x040002, /* 0 */ + 0x50E955, 0x48CA65, 0x40E321, 0x72BE78, /* 1 [ms] */ + 0x64BA68, 0x57DF14, 0x4C3D60, 0x41D690, /* 2 */ + 0x38A084, 0x308974, 0x297B00, 0x235C7C, /* 4 */ + 0x1E14B0, 0x198AF0, 0x15A800, 0x125660, /* 8 */ + 0x0F82A0, 0x0D1B5C, 0x0B113C, 0x0956CC, /* 16 */ + 0x07E054, 0x06A3B8, 0x059844, 0x04B680, /* 32 */ + 0x03F80C, 0x035774, 0x02D018, 0x025E0C, /* 64 */ + 0x7F8057, 0x6B482F, 0x5A4297, 0x4BEECB, /* 128 */ + 0x3FE00B, 0x35BAA7, 0x2D3143, 0x2602AF, /* 256 */ + 0x1FF803, 0x1AE2FB, 0x169C9F, 0x13042B, /* 512 */ + 0x0FFE03, 0x0D72E7, 0x0B4F4F, 0x0982CB, /* 1.024 [s] */ + 0x07FF83, 0x06B9CF, 0x05A7E7, 0x04C193, /* 2.048 */ + 0x03FFE3, 0x035CFF, 0x02D403, 0x0260D7, /* 4.096 */ + 0x01FFFB, 0x01AE87, 0x016A07, 0x01306F, /* 8.192 */ + 0x00FFFF, 0x00D743, 0x00B503, 0x009837, +}; + +const u32 abe_alpha_iir[64] = { + 0x000000, 0x000000, 0x000000, 0x000000, /* 0 */ + 0x5E2D58, 0x6E6B3C, 0x7E39C0, 0x46A0C5, /* 1 [ms] */ + 0x4DA2CD, 0x541079, 0x59E151, 0x5F14B9, /* 2 */ + 0x63AFC1, 0x67BB45, 0x6B4281, 0x6E51C1, /* 4 */ + 0x70F5A9, 0x733A89, 0x752C01, 0x76D4D1, /* 8 */ + 0x783EB1, 0x797251, 0x7A7761, 0x7B549D, /* 16 */ + 0x7C0FD5, 0x7CAE25, 0x7D33DD, 0x7DA4C1, /* 32 */ + 0x7E03FD, 0x7E5449, 0x7E97F5, 0x7ED0F9, /* 64 */ + 0x7F0101, 0x7F2971, 0x7F4B7D, 0x7F6825, /* 128 */ + 0x7F8041, 0x7F948D, 0x7FA59D, 0x7FB3FD, /* 256 */ + 0x7FC011, 0x7FCA3D, 0x7FD2C9, 0x7FD9F9, /* 512 */ + 0x7FE005, 0x7FE51D, 0x7FE961, 0x7FECFD, /* 1.024 [s] */ + 0x7FF001, 0x7FF28D, 0x7FF4B1, 0x7FF67D, /* 2.048 */ + 0x7FF801, 0x7FF949, 0x7FFA59, 0x7FFB41, /* 4.096 */ + 0x7FFC01, 0x7FFCA5, 0x7FFD2D, 0x7FFDA1, /* 8.192 */ + 0x7FFE01, 0x7FFE51, 0x7FFE95, 0x7FFED1, +}; + +/** + * abe_int_2_float + * returns a mantissa on 16 bits and the exponent + * 0x4000.0000 leads to M=0x4000 X=15 + * 0x0004.0000 leads to M=0x4000 X=4 + * 0x0000.0001 leads to M=0x4000 X=-14 + * + */ +void abe_int_2_float16(u32 data, u32 *mantissa, u32 *exp) +{ + u32 i; + *exp = 0; + *mantissa = 0; + for (i = 0; i < 32; i++) { + if ((1 << i) > data) + break; + } + *exp = i - 15; + *mantissa = (*exp > 0) ? data >> (*exp) : data << (*exp); +} + +/** + * abe_use_compensated_gain + * @on_off: + * + * Selects the automatic Mixer's gain management + * on_off = 1 allows the "abe_write_gain" to adjust the overall + * gains of the mixer to be tuned not to create saturation + */ +int omap_abe_use_compensated_gain(struct omap_abe *abe, int on_off) +{ + abe->compensated_mixer_gain = on_off; + return 0; +} +EXPORT_SYMBOL(omap_abe_use_compensated_gain); + +/** + * omap_abe_gain_offset + * returns the offset to firmware data structures + * + */ +void omap_abe_gain_offset(struct omap_abe *abe, u32 id, u32 *mixer_offset) +{ + switch (id) { + default: + case GAINS_DMIC1: + *mixer_offset = dmic1_gains_offset; + break; + case GAINS_DMIC2: + *mixer_offset = dmic2_gains_offset; + break; + case GAINS_DMIC3: + *mixer_offset = dmic3_gains_offset; + break; + case GAINS_AMIC: + *mixer_offset = amic_gains_offset; + break; + case GAINS_DL1: + *mixer_offset = dl1_gains_offset; + break; + case GAINS_DL2: + *mixer_offset = dl2_gains_offset; + break; + case GAINS_SPLIT: + *mixer_offset = splitters_gains_offset; + break; + case MIXDL1: + *mixer_offset = mixer_dl1_offset; + break; + case MIXDL2: + *mixer_offset = mixer_dl2_offset; + break; + case MIXECHO: + *mixer_offset = mixer_echo_offset; + break; + case MIXSDT: + *mixer_offset = mixer_sdt_offset; + break; + case MIXVXREC: + *mixer_offset = mixer_vxrec_offset; + break; + case MIXAUDUL: + *mixer_offset = mixer_audul_offset; + break; + case GAINS_BTUL: + *mixer_offset = btul_gains_offset; + break; + } +} + +/** + * oamp_abe_write_equalizer + * @abe: Pointer on abe handle + * @id: name of the equalizer + * @param : equalizer coefficients + * + * Load the coefficients in CMEM. + */ +int omap_abe_write_equalizer(struct omap_abe *abe, + u32 id, struct omap_abe_equ *param) +{ + u32 eq_offset, length, *src, eq_mem, eq_mem_len; + _log(ABE_ID_WRITE_EQUALIZER, id, 0, 0); + switch (id) { + default: + case EQ1: + eq_offset = OMAP_ABE_C_DL1_COEFS_ADDR; + eq_mem = OMAP_ABE_S_DL1_M_EQ_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_DL1_M_EQ_DATA_SIZE; + break; + case EQ2L: + eq_offset = OMAP_ABE_C_DL2_L_COEFS_ADDR; + eq_mem = OMAP_ABE_S_DL2_M_LR_EQ_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_DL2_M_LR_EQ_DATA_SIZE; + break; + case EQ2R: + eq_offset = OMAP_ABE_C_DL2_R_COEFS_ADDR; + eq_mem = OMAP_ABE_S_DL2_M_LR_EQ_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_DL2_M_LR_EQ_DATA_SIZE; + break; + case EQSDT: + eq_offset = OMAP_ABE_C_SDT_COEFS_ADDR; + eq_mem = OMAP_ABE_S_SDT_F_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_SDT_F_DATA_SIZE; + break; + case EQAMIC: + eq_offset = OMAP_ABE_C_96_48_AMIC_COEFS_ADDR; + eq_mem = OMAP_ABE_S_AMIC_96_48_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_AMIC_96_48_DATA_SIZE; + break; + case EQDMIC: + eq_offset = OMAP_ABE_C_96_48_DMIC_COEFS_ADDR; + eq_mem = OMAP_ABE_S_DMIC0_96_48_DATA_ADDR; + eq_mem_len = OMAP_ABE_S_DMIC0_96_48_DATA_SIZE; + /* three DMIC are clear at the same time DMIC0 DMIC1 DMIC2 */ + eq_mem_len *= 3; + break; + case APS1: + eq_offset = OMAP_ABE_C_APS_DL1_COEFFS1_ADDR; + eq_mem = OMAP_ABE_S_APS_IIRMEM1_ADDR; + eq_mem_len = OMAP_ABE_S_APS_IIRMEM1_SIZE; + break; + case APS2L: + eq_offset = OMAP_ABE_C_APS_DL2_L_COEFFS1_ADDR; + eq_mem = OMAP_ABE_S_APS_M_IIRMEM2_ADDR; + eq_mem_len = OMAP_ABE_S_APS_M_IIRMEM2_SIZE; + break; + case APS2R: + eq_offset = OMAP_ABE_C_APS_DL2_R_COEFFS1_ADDR; + eq_mem = OMAP_ABE_S_APS_M_IIRMEM2_ADDR; + eq_mem_len = OMAP_ABE_S_APS_M_IIRMEM2_SIZE; + break; + } + /* reset SMEM buffers before the coefficients are loaded */ + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, eq_mem, eq_mem_len); + + length = param->equ_length; + src = (u32 *) ((param->coef).type1); + /* translate in bytes */ + length <<= 2; + omap_abe_mem_write(abe, OMAP_ABE_CMEM, eq_offset, src, length); + + /* reset SMEM buffers after the coefficients are loaded */ + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, eq_mem, eq_mem_len); + return 0; +} +EXPORT_SYMBOL(omap_abe_write_equalizer); + +/** + * omap_abe_disable_gain + * @abe: Pointer on abe handle + * Parameters: + * mixer id + * sub-port id + * + */ +int omap_abe_disable_gain(struct omap_abe *abe, u32 id, u32 p) +{ + u32 mixer_offset, f_g, ramp; + omap_abe_gain_offset(abe, id, &mixer_offset); + /* save the input parameters for mute/unmute */ + ramp = abe->desired_ramp_delay_ms[mixer_offset + p]; + f_g = GAIN_MUTE; + if (!(abe->muted_gains_indicator[mixer_offset + p] & + OMAP_ABE_GAIN_DISABLED)) { + /* Check if we are in mute */ + if (!(abe->muted_gains_indicator[mixer_offset + p] & + OMAP_ABE_GAIN_MUTED)) { + abe->muted_gains_decibel[mixer_offset + p] = + abe->desired_gains_decibel[mixer_offset + p]; + /* mute the gain */ + omap_abe_write_gain(abe, id, f_g, ramp, p); + } + abe->muted_gains_indicator[mixer_offset + p] |= + OMAP_ABE_GAIN_DISABLED; + } + return 0; +} +EXPORT_SYMBOL(omap_abe_disable_gain); + +/** + * omap_abe_enable_gain + * Parameters: + * mixer id + * sub-port id + * + */ +int omap_abe_enable_gain(struct omap_abe *abe, u32 id, u32 p) +{ + u32 mixer_offset, f_g, ramp; + omap_abe_gain_offset(abe, id, &mixer_offset); + if ((abe->muted_gains_indicator[mixer_offset + p] & + OMAP_ABE_GAIN_DISABLED)) { + /* restore the input parameters for mute/unmute */ + f_g = abe->muted_gains_decibel[mixer_offset + p]; + ramp = abe->desired_ramp_delay_ms[mixer_offset + p]; + abe->muted_gains_indicator[mixer_offset + p] &= + ~OMAP_ABE_GAIN_DISABLED; + /* unmute the gain */ + omap_abe_write_gain(abe, id, f_g, ramp, p); + } + return 0; +} +EXPORT_SYMBOL(omap_abe_enable_gain); +/** + * omap_abe_mute_gain + * Parameters: + * mixer id + * sub-port id + * + */ +int omap_abe_mute_gain(struct omap_abe *abe, u32 id, u32 p) +{ + u32 mixer_offset, f_g, ramp; + omap_abe_gain_offset(abe, id, &mixer_offset); + /* save the input parameters for mute/unmute */ + ramp = abe->desired_ramp_delay_ms[mixer_offset + p]; + f_g = GAIN_MUTE; + if (!abe->muted_gains_indicator[mixer_offset + p]) { + abe->muted_gains_decibel[mixer_offset + p] = + abe->desired_gains_decibel[mixer_offset + p]; + /* mute the gain */ + omap_abe_write_gain(abe, id, f_g, ramp, p); + } + abe->muted_gains_indicator[mixer_offset + p] |= OMAP_ABE_GAIN_MUTED; + return 0; +} +EXPORT_SYMBOL(omap_abe_mute_gain); +/** + * omap_abe_unmute_gain + * Parameters: + * mixer id + * sub-port id + * + */ +int omap_abe_unmute_gain(struct omap_abe *abe, u32 id, u32 p) +{ + u32 mixer_offset, f_g, ramp; + omap_abe_gain_offset(abe, id, &mixer_offset); + if ((abe->muted_gains_indicator[mixer_offset + p] & + OMAP_ABE_GAIN_MUTED)) { + /* restore the input parameters for mute/unmute */ + f_g = abe->muted_gains_decibel[mixer_offset + p]; + ramp = abe->desired_ramp_delay_ms[mixer_offset + p]; + abe->muted_gains_indicator[mixer_offset + p] &= + ~OMAP_ABE_GAIN_MUTED; + /* unmute the gain */ + omap_abe_write_gain(abe, id, f_g, ramp, p); + } + return 0; +} +EXPORT_SYMBOL(omap_abe_unmute_gain); + +/** + * omap_abe_write_gain + * @id: gain name or mixer name + * @f_g: list of input gains of the mixer + * @ramp: gain ramp speed factor + * @p: list of ports corresponding to the above gains + * + * Loads the gain coefficients to FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's gain + * in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +int omap_abe_write_gain(struct omap_abe *abe, + u32 id, s32 f_g, u32 ramp, u32 p) +{ + u32 lin_g, sum_g, mixer_target, mixer_offset, i, mean_gain, mean_exp; + u32 new_gain_linear[4]; + s32 gain_index; + u32 alpha, beta; + u32 ramp_index; + + _log(ABE_ID_WRITE_GAIN, id, f_g, p); + gain_index = ((f_g - min_mdb) / 100); + gain_index = maximum(gain_index, 0); + gain_index = minimum(gain_index, sizeof_db2lin_table); + lin_g = abe_db2lin_table[gain_index]; + omap_abe_gain_offset(abe, id, &mixer_offset); + /* save the input parameters for mute/unmute */ + abe->desired_gains_linear[mixer_offset + p] = lin_g; + abe->desired_gains_decibel[mixer_offset + p] = f_g; + abe->desired_ramp_delay_ms[mixer_offset + p] = ramp; + /* SMEM address in bytes */ + mixer_target = OMAP_ABE_S_GTARGET1_ADDR; + mixer_target += (mixer_offset<<2); + mixer_target += (p<<2); + + if (abe->compensated_mixer_gain) { + switch (id) { + case MIXDL1: + case MIXDL2: + case MIXVXREC: + case MIXAUDUL: + /* compute the sum of the gain of the mixer */ + for (sum_g = i = 0; i < 4; i++) + sum_g += abe->desired_gains_linear[mixer_offset + + i]; + /* lets avoid a division by 0 */ + if (sum_g == 0) + break; + /* if the sum is OK with less than 1, then + do not weight the gains */ + if (sum_g < 0x00040000) { /* REMOVE HARD CONST */ + /* recompute all gains from original + desired values */ + sum_g = 0x00040000; + } + /* translate it in Q16 format for the later division */ + abe_int_2_float16(sum_g, &mean_gain, &mean_exp); + mean_exp = 10 - mean_exp; + for (i = 0; i < 4; i++) { + /* new gain = desired gain divided by sum of gains */ + new_gain_linear[i] = + (abe->desired_gains_linear + [mixer_offset + i] + << 8) / mean_gain; + new_gain_linear[i] = (mean_exp > 0) ? + new_gain_linear[i] << mean_exp : + new_gain_linear[i] >> mean_exp; + } + /* load the whole adpated S_G_Target SMEM MIXER table */ + omap_abe_mem_write(abe, OMAP_ABE_SMEM, + mixer_target - (p << 2), + new_gain_linear, (4 * sizeof(lin_g))); + break; + default: + /* load the S_G_Target SMEM table */ + omap_abe_mem_write(abe, OMAP_ABE_SMEM, + mixer_target, + (u32 *) &lin_g, sizeof(lin_g)); + break; + } + } else { + if (!abe->muted_gains_indicator[mixer_offset + p]) + /* load the S_G_Target SMEM table */ + omap_abe_mem_write(abe, OMAP_ABE_SMEM, + mixer_target, (u32 *) &lin_g, + sizeof(lin_g)); + else + /* update muted gain with new value */ + abe->muted_gains_decibel[mixer_offset + p] = f_g; + } + ramp = maximum(minimum(RAMP_MAXLENGTH, ramp), RAMP_MINLENGTH); + /* ramp data should be interpolated in the table instead */ + ramp_index = 8; + if ((RAMP_5MS <= ramp) && (ramp < RAMP_50MS)) + ramp_index = 24; + if ((RAMP_50MS <= ramp) && (ramp < RAMP_500MS)) + ramp_index = 36; + if (ramp > RAMP_500MS) + ramp_index = 48; + beta = abe_alpha_iir[ramp_index]; + alpha = abe_1_alpha_iir[ramp_index]; + /* CMEM bytes address */ + mixer_target = OMAP_ABE_C_1_ALPHA_ADDR; + /* a pair of gains is updated once in the firmware */ + mixer_target += ((p + mixer_offset) >> 1) << 2; + /* load the ramp delay data */ + omap_abe_mem_write(abe, OMAP_ABE_CMEM, mixer_target, + (u32 *) &alpha, sizeof(alpha)); + /* CMEM bytes address */ + mixer_target = OMAP_ABE_C_ALPHA_ADDR; + /* a pair of gains is updated once in the firmware */ + mixer_target += ((p + mixer_offset) >> 1) << 2; + omap_abe_mem_write(abe, OMAP_ABE_CMEM, mixer_target, + (u32 *) &beta, sizeof(beta)); + return 0; +} +EXPORT_SYMBOL(omap_abe_write_gain); +/** + * omap_abe_write_mixer + * @id: name of the mixer + * @param: input gains and delay ramp of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +int omap_abe_write_mixer(struct omap_abe *abe, + u32 id, s32 f_g, u32 f_ramp, u32 p) +{ + _log(ABE_ID_WRITE_MIXER, id, f_ramp, p); + omap_abe_write_gain(abe, id, f_g, f_ramp, p); + return 0; +} +EXPORT_SYMBOL(omap_abe_write_mixer); + +/** + * omap_abe_read_gain + * @id: name of the mixer + * @param: list of input gains of the mixer + * @p: list of port corresponding to the above gains + * + */ +int omap_abe_read_gain(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p) +{ + u32 mixer_target, mixer_offset, i; + _log(ABE_ID_READ_GAIN, id, (u32) f_g, p); + omap_abe_gain_offset(abe, id, &mixer_offset); + /* SMEM bytes address */ + mixer_target = OMAP_ABE_S_GTARGET1_ADDR; + mixer_target += (mixer_offset<<2); + mixer_target += (p<<2); + if (!abe->muted_gains_indicator[mixer_offset + p]) { + /* load the S_G_Target SMEM table */ + omap_abe_mem_read(abe, OMAP_ABE_SMEM, mixer_target, + (u32 *) f_g, sizeof(*f_g)); + for (i = 0; i < sizeof_db2lin_table; i++) { + if (abe_db2lin_table[i] == *f_g) + goto found; + } + *f_g = 0; + return -1; + found: + *f_g = (i * 100) + min_mdb; + } else { + /* update muted gain with new value */ + *f_g = abe->muted_gains_decibel[mixer_offset + p]; + } + return 0; +} +EXPORT_SYMBOL(omap_abe_read_gain); + +/** + * abe_read_mixer + * @id: name of the mixer + * @param: gains of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +int omap_abe_read_mixer(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p) +{ + _log(ABE_ID_READ_MIXER, id, 0, p); + omap_abe_read_gain(abe, id, f_g, p); + return 0; +} +EXPORT_SYMBOL(omap_abe_read_mixer); + +/** + * abe_reset_gain_mixer + * @id: name of the mixer + * @p: list of port corresponding to the above gains + * + * restart the working gain value of the mixers when a port is enabled + */ +void omap_abe_reset_gain_mixer(struct omap_abe *abe, u32 id, u32 p) +{ + u32 lin_g, mixer_target, mixer_offset; + switch (id) { + default: + case GAINS_DMIC1: + mixer_offset = dmic1_gains_offset; + break; + case GAINS_DMIC2: + mixer_offset = dmic2_gains_offset; + break; + case GAINS_DMIC3: + mixer_offset = dmic3_gains_offset; + break; + case GAINS_AMIC: + mixer_offset = amic_gains_offset; + break; + case GAINS_DL1: + mixer_offset = dl1_gains_offset; + break; + case GAINS_DL2: + mixer_offset = dl2_gains_offset; + break; + case GAINS_SPLIT: + mixer_offset = splitters_gains_offset; + break; + case MIXDL1: + mixer_offset = mixer_dl1_offset; + break; + case MIXDL2: + mixer_offset = mixer_dl2_offset; + break; + case MIXECHO: + mixer_offset = mixer_echo_offset; + break; + case MIXSDT: + mixer_offset = mixer_sdt_offset; + break; + case MIXVXREC: + mixer_offset = mixer_vxrec_offset; + break; + case MIXAUDUL: + mixer_offset = mixer_audul_offset; + break; + case GAINS_BTUL: + mixer_offset = btul_gains_offset; + break; + } + /* SMEM bytes address for the CURRENT gain values */ + mixer_target = OMAP_ABE_S_GCURRENT_ADDR; + mixer_target += (mixer_offset<<2); + mixer_target += (p<<2); + lin_g = 0; + /* load the S_G_Target SMEM table */ + omap_abe_mem_write(abe, OMAP_ABE_SMEM, mixer_target, + (u32 *) &lin_g, sizeof(lin_g)); +} diff --git a/sound/soc/omap/abe/abe_gain.h b/sound/soc/omap/abe/abe_gain.h new file mode 100644 index 0000000..f332837 --- /dev/null +++ b/sound/soc/omap/abe/abe_gain.h @@ -0,0 +1,111 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_GAIN_H_ +#define _ABE_GAIN_H_ + +#include "abe_typ.h" +#include "abe_dm_addr.h" +#include "abe_sm_addr.h" +#include "abe_cm_addr.h" + +#define OMAP_ABE_GAIN_MUTED (0x0001<<0) +#define OMAP_ABE_GAIN_DISABLED (0x0001<<1) + +#define OMAP_ABE_GAIN_DMIC1_LEFT 0 +#define OMAP_ABE_GAIN_DMIC1_RIGTH 1 +#define OMAP_ABE_GAIN_DMIC2_LEFT 2 +#define OMAP_ABE_GAIN_DMIC2_RIGTH 3 +#define OMAP_ABE_GAIN_DMIC3_LEFT 4 +#define OMAP_ABE_GAIN_DMIC3_RIGTH 5 +#define OMAP_ABE_GAIN_AMIC_LEFT 6 +#define OMAP_ABE_GAIN_AMIC_RIGTH 7 +#define OMAP_ABE_GAIN_DL1_LEFT 8 +#define OMAP_ABE_GAIN_DL1_RIGTH 9 +#define OMAP_ABE_GAIN_DL2_LEFT 10 +#define OMAP_ABE_GAIN_DL2_RIGTH 11 +#define OMAP_ABE_GAIN_SPLIT_LEFT 12 +#define OMAP_ABE_GAIN_SPLIT_RIGTH 13 +#define OMAP_ABE_MIXDL1_MM_DL 14 +#define OMAP_ABE_MIXDL1_MM_UL2 15 +#define OMAP_ABE_MIXDL1_VX_DL 16 +#define OMAP_ABE_MIXDL1_TONES 17 +#define OMAP_ABE_MIXDL2_MM_DL 18 +#define OMAP_ABE_MIXDL2_MM_UL2 19 +#define OMAP_ABE_MIXDL2_VX_DL 20 +#define OMAP_ABE_MIXDL2_TONES 21 +#define OMAP_ABE_MIXECHO_DL1 22 +#define OMAP_ABE_MIXECHO_DL2 23 +#define OMAP_ABE_MIXSDT_UL 24 +#define OMAP_ABE_MIXECHO_DL 25 +#define OMAP_ABE_MIXVXREC_MM_DL 26 +#define OMAP_ABE_MIXVXREC_TONES 27 +#define OMAP_ABE_MIXVXREC_VX_UL 28 +#define OMAP_ABE_MIXVXREC_VX_DL 29 +#define OMAP_ABE_MIXAUDUL_MM_DL 30 +#define OMAP_ABE_MIXAUDUL_TONES 31 +#define OMAP_ABE_MIXAUDUL_UPLINK 32 +#define OMAP_ABE_MIXAUDUL_VX_DL 33 +#define OMAP_ABE_GAIN_BTUL_LEFT 34 +#define OMAP_ABE_GAIN_BTUL_RIGTH 35 + +void omap_abe_reset_gain_mixer(struct omap_abe *abe, u32 id, u32 p); + +void abe_int_2_float16(u32 data, u32 *mantissa, u32 *exp); + +#endif /* _ABE_GAIN_H_ */ diff --git a/sound/soc/omap/abe/abe_ini.c b/sound/soc/omap/abe/abe_ini.c new file mode 100644 index 0000000..5a2bf08 --- /dev/null +++ b/sound/soc/omap/abe/abe_ini.c @@ -0,0 +1,547 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_dbg.h" +#include "abe.h" +#include "abe_aess.h" +#include "abe_gain.h" +#include "abe_mem.h" +#include "abe_port.h" +#include "abe_seq.h" + +#include "abe_taskid.h" + + +#define ABE_TASK_ID(ID) (OMAP_ABE_D_TASKSLIST_ADDR + sizeof(ABE_STask)*(ID)) +void omap_abe_build_scheduler_table(struct omap_abe *abe); +void omap_abe_reset_all_ports(struct omap_abe *abe); + +const u32 abe_firmware_array[ABE_FIRMWARE_MAX_SIZE] = { +#include "abe_firmware.c" +}; + + +/* + * initialize the default values for call-backs to subroutines + * - FIFO IRQ call-backs for sequenced tasks + * - FIFO IRQ call-backs for audio player/recorders (ping-pong protocols) + * - Remote debugger interface + * - Error monitoring + * - Activity Tracing + */ + +/** + * abe_init_mem - Allocate Kernel space memory map for ABE + * + * Memory map of ABE memory space for PMEM/DMEM/SMEM/DMEM + */ +void abe_init_mem(void __iomem **_io_base) +{ + int i; + + abe = kzalloc(sizeof(struct omap_abe), GFP_KERNEL); + if (abe == NULL) + printk(KERN_ERR "ABE Allocation ERROR "); + + for (i = 0; i < 5; i++) + abe->io_base[i] = _io_base[i]; + + mutex_init(&abe->mutex); + +} +EXPORT_SYMBOL(abe_init_mem); + +/** + * abe_load_fw_param - Load ABE Firmware memories + * @PMEM: Pointer of Program memory data + * @PMEM_SIZE: Size of PMEM data + * @CMEM: Pointer of Coeffients memory data + * @CMEM_SIZE: Size of CMEM data + * @SMEM: Pointer of Sample memory data + * @SMEM_SIZE: Size of SMEM data + * @DMEM: Pointer of Data memory data + * @DMEM_SIZE: Size of DMEM data + * + */ +int abe_load_fw_param(u32 *ABE_FW) +{ + u32 pmem_size, dmem_size, smem_size, cmem_size; + u32 *pmem_ptr, *dmem_ptr, *smem_ptr, *cmem_ptr, *fw_ptr; + _log(ABE_ID_LOAD_FW_param, 0, 0, 0); +#define ABE_FW_OFFSET 5 + fw_ptr = ABE_FW; + abe->firmware_version_number = *fw_ptr++; + pmem_size = *fw_ptr++; + cmem_size = *fw_ptr++; + dmem_size = *fw_ptr++; + smem_size = *fw_ptr++; + pmem_ptr = fw_ptr; + cmem_ptr = pmem_ptr + (pmem_size >> 2); + dmem_ptr = cmem_ptr + (cmem_size >> 2); + smem_ptr = dmem_ptr + (dmem_size >> 2); + /* do not load PMEM */ + if (abe->warm_boot) { + /* Stop the event Generator */ + omap_abe_stop_event_generator(abe); + + /* Now we are sure the firmware is stalled */ + omap_abe_mem_write(abe, OMAP_ABE_CMEM, 0, cmem_ptr, + cmem_size); + omap_abe_mem_write(abe, OMAP_ABE_SMEM, 0, smem_ptr, + smem_size); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, 0, dmem_ptr, + dmem_size); + /* Restore the event Generator status */ + omap_abe_start_event_generator(abe); + } else { + omap_abe_mem_write(abe, OMAP_ABE_PMEM, 0, pmem_ptr, + pmem_size); + omap_abe_mem_write(abe, OMAP_ABE_CMEM, 0, cmem_ptr, + cmem_size); + omap_abe_mem_write(abe, OMAP_ABE_SMEM, 0, smem_ptr, + smem_size); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, 0, dmem_ptr, + dmem_size); + } + abe->warm_boot = 1; + return 0; +} +EXPORT_SYMBOL(abe_load_fw_param); + +/** + * omap_abe_load_fw - Load ABE Firmware and initialize memories + * @abe: Pointer on abe handle + * + */ +int omap_abe_load_fw(struct omap_abe *abe) +{ + _log(ABE_ID_LOAD_FW, 0, 0, 0); + abe_load_fw_param((u32 *) abe_firmware_array); + omap_abe_reset_all_ports(abe); + omap_abe_build_scheduler_table(abe); + omap_abe_reset_all_sequence(abe); + omap_abe_select_main_port(OMAP_ABE_PDM_DL_PORT); + return 0; +} +EXPORT_SYMBOL(omap_abe_load_fw); + +/** + * abe_reload_fw - Reload ABE Firmware after OFF mode + */ +int abe_reload_fw(void) +{ + abe->warm_boot = 0; + abe_load_fw_param((u32 *) abe_firmware_array); + omap_abe_build_scheduler_table(abe); + omap_abe_dbg_reset(&abe->dbg); + /* IRQ circular read pointer in DMEM */ + abe->irq_dbg_read_ptr = 0; + /* Restore Gains not managed by the drivers */ + omap_abe_write_gain(abe, GAINS_SPLIT, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_SPLIT, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL1, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL1, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL2, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL2, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + return 0; +} +EXPORT_SYMBOL(abe_reload_fw); + +/** + * abe_build_scheduler_table + * + */ +void omap_abe_build_scheduler_table(struct omap_abe *abe) +{ + u16 i, n; + u8 *ptr; + u16 aUplinkMuxing[NBROUTE_UL]; + + /* LOAD OF THE TASKS' MULTIFRAME */ + /* WARNING ON THE LOCATION OF IO_MM_DL WHICH IS PATCHED + IN "abe_init_io_tasks" */ + for (ptr = (u8 *) &(abe->MultiFrame[0][0]), i = 0; + i < sizeof(abe->MultiFrame); i++) + *ptr++ = 0; + + /* MultiFrame[0][0] = 0; */ + /* MultiFrame[0][1] = 0; */ + abe->MultiFrame[0][2] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_VX_DL)*/; + /* MultiFrame[0][3] = 0; */ + /* MultiFrame[0][4] = 0; */ + /* MultiFrame[0][5] = 0; */ + /* MultiFrame[0][6] = 0; */ + /* MultiFrame[0][7] = 0; */ + /* MultiFrame[1][0] = 0; */ + /* MultiFrame[1][1] = 0; */ + abe->MultiFrame[1][2] = ABE_TASK_ID(C_ABE_FW_TASK_ASRC_VX_DL_8); + abe->MultiFrame[1][3] = ABE_TASK_ID(C_ABE_FW_TASK_VX_DL_8_48); + /* MultiFrame[1][4] = 0; */ + /* MultiFrame[1][5] = 0; */ + abe->MultiFrame[1][6] = ABE_TASK_ID(C_ABE_FW_TASK_DL2Mixer); + abe->MultiFrame[1][7] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_VIB_DL)*/; + abe->MultiFrame[2][0] = ABE_TASK_ID(C_ABE_FW_TASK_DL1Mixer); + abe->MultiFrame[2][1] = ABE_TASK_ID(C_ABE_FW_TASK_SDTMixer); + /* MultiFrame[2][2] = 0; */ + /* MultiFrame[2][3] = 0; */ + /* MultiFrame[2][4] = 0; */ + abe->MultiFrame[2][5] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_DMIC)*/; + /* MultiFrame[2][6] = 0; */ + /* MultiFrame[2][7] = 0; */ + abe->MultiFrame[3][0] = ABE_TASK_ID(C_ABE_FW_TASK_DL1_GAIN); + /* MultiFrame[3][1] = 0; */ + /* MultiFrame[3][2] = 0; */ + /* MultiFrame[3][3] = 0; */ + /* MultiFrame[3][4] = 0; */ + /* MultiFrame[3][5] = 0; */ + abe->MultiFrame[3][6] = ABE_TASK_ID(C_ABE_FW_TASK_DL2_GAIN); + abe->MultiFrame[3][7] = ABE_TASK_ID(C_ABE_FW_TASK_DL2_EQ); + abe->MultiFrame[4][0] = ABE_TASK_ID(C_ABE_FW_TASK_DL1_EQ); + /* MultiFrame[4][1] = 0; */ + abe->MultiFrame[4][2] = ABE_TASK_ID(C_ABE_FW_TASK_VXRECMixer); + abe->MultiFrame[4][3] = ABE_TASK_ID(C_ABE_FW_TASK_VXREC_SPLIT); + /* MultiFrame[4][4] = 0; */ + /* MultiFrame[4][5] = 0; */ + abe->MultiFrame[4][6] = ABE_TASK_ID(C_ABE_FW_TASK_VIBRA1); + abe->MultiFrame[4][7] = ABE_TASK_ID(C_ABE_FW_TASK_VIBRA2); + abe->MultiFrame[5][0] = 0; + abe->MultiFrame[5][1] = ABE_TASK_ID(C_ABE_FW_TASK_EARP_48_96_LP); + abe->MultiFrame[5][2] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_UL)*/; + /* MultiFrame[5][3] = 0; */ + /* MultiFrame[5][4] = 0; */ + /* MultiFrame[5][5] = 0; */ + /* MultiFrame[5][6] = 0; */ + abe->MultiFrame[5][7] = ABE_TASK_ID(C_ABE_FW_TASK_VIBRA_SPLIT); + abe->MultiFrame[6][0] = ABE_TASK_ID(C_ABE_FW_TASK_EARP_48_96_LP); + /* MultiFrame[6][1] = 0; */ + /* MultiFrame[6][2] = 0; */ + /* MultiFrame[6][3] = 0; */ + /* MultiFrame[6][4] = 0; */ + abe->MultiFrame[6][5] = ABE_TASK_ID(C_ABE_FW_TASK_EchoMixer); + /* MultiFrame[6][6] = 0; */ + /* MultiFrame[6][7] = 0; */ + abe->MultiFrame[7][0] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_DL)*/; + /* MultiFrame[7][1] = 0; */ + abe->MultiFrame[7][2] = ABE_TASK_ID(C_ABE_FW_TASK_BT_UL_SPLIT); + abe->MultiFrame[7][3] = ABE_TASK_ID(C_ABE_FW_TASK_DBG_SYNC); + /* MultiFrame[7][4] = 0; */ + abe->MultiFrame[7][5] = ABE_TASK_ID(C_ABE_FW_TASK_ECHO_REF_SPLIT); + /* MultiFrame[7][6] = 0; */ + /* MultiFrame[7][7] = 0; */ + /* MultiFrame[8][0] = 0; */ + /* MultiFrame[8][1] = 0; */ + abe->MultiFrame[8][2] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC1_96_48_LP); + /* MultiFrame[8][3] = 0; */ + abe->MultiFrame[8][4] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC1_SPLIT); + /* MultiFrame[8][5] = 0; */ + /* MultiFrame[8][6] = 0; */ + /* MultiFrame[8][7] = 0; */ + /* MultiFrame[9][0] = 0; */ + /* MultiFrame[9][1] = 0; */ + abe->MultiFrame[9][2] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC2_96_48_LP); + /* MultiFrame[9][3] = 0; */ + abe->MultiFrame[9][4] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC2_SPLIT); + /* MultiFrame[9][5] = 0; */ + abe->MultiFrame[9][6] = 0; + abe->MultiFrame[9][7] = ABE_TASK_ID(C_ABE_FW_TASK_IHF_48_96_LP); + /* MultiFrame[10][0] = 0; */ + /* MultiFrame[10][1] = 0; */ + abe->MultiFrame[10][2] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC3_96_48_LP); + /* MultiFrame[10][3] = 0; */ + abe->MultiFrame[10][4] = ABE_TASK_ID(C_ABE_FW_TASK_DMIC3_SPLIT); + /* MultiFrame[10][5] = 0; */ + /* MultiFrame[10][6] = 0; */ + abe->MultiFrame[10][7] = ABE_TASK_ID(C_ABE_FW_TASK_IHF_48_96_LP); + /* MultiFrame[11][0] = 0; */ + /* MultiFrame[11][1] = 0; */ + abe->MultiFrame[11][2] = ABE_TASK_ID(C_ABE_FW_TASK_AMIC_96_48_LP); + /* MultiFrame[11][3] = 0; */ + abe->MultiFrame[11][4] = ABE_TASK_ID(C_ABE_FW_TASK_AMIC_SPLIT); + /* MultiFrame[11][5] = 0; */ + /* MultiFrame[11][6] = 0; */ + abe->MultiFrame[11][7] = ABE_TASK_ID(C_ABE_FW_TASK_VIBRA_PACK); + /* MultiFrame[12][0] = 0; */ + /* MultiFrame[12][1] = 0; */ + /* MultiFrame[12][2] = 0; */ + abe->MultiFrame[12][3] = ABE_TASK_ID(C_ABE_FW_TASK_VX_UL_ROUTING); + abe->MultiFrame[12][4] = ABE_TASK_ID(C_ABE_FW_TASK_ULMixer); + abe->MultiFrame[12][5] = ABE_TASK_ID(C_ABE_FW_TASK_VX_UL_48_8); + /* MultiFrame[12][6] = 0; */ + /* MultiFrame[12][7] = 0; */ + /* MultiFrame[13][0] = 0; */ + /* MultiFrame[13][1] = 0; */ + abe->MultiFrame[13][2] = ABE_TASK_ID(C_ABE_FW_TASK_MM_UL2_ROUTING); + abe->MultiFrame[13][3] = ABE_TASK_ID(C_ABE_FW_TASK_SideTone); + /* MultiFrame[13][4] = 0; */ + abe->MultiFrame[13][5] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_BT_VX_DL)*/; + /* MultiFrame[13][6] = 0; */ + /* MultiFrame[13][7] = 0; */ + /* MultiFrame[14][0] = 0; */ + /* MultiFrame[14][1] = 0; */ + /* MultiFrame[14][2] = 0; */ + abe->MultiFrame[14][3] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_DMIC)*/; + abe->MultiFrame[14][4] = ABE_TASK_ID(C_ABE_FW_TASK_BT_DL_48_8); + /* MultiFrame[14][5] = 0; */ + /* MultiFrame[14][6] = 0; */ + /* MultiFrame[14][7] = 0; */ + abe->MultiFrame[15][0] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_EXT_OUT)*/; + /* MultiFrame[15][1] = 0; */ + /* MultiFrame[15][2] = 0; */ + abe->MultiFrame[15][3] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_BT_VX_UL)*/; + /* MultiFrame[15][4] = 0; */ + /* MultiFrame[15][5] = 0; */ + abe->MultiFrame[15][6] = ABE_TASK_ID(C_ABE_FW_TASK_ASRC_BT_UL_8); + /* MultiFrame[15][7] = 0; */ + /* MultiFrame[16][0] = 0; */ + /* MultiFrame[16][1] = 0; */ + abe->MultiFrame[16][2] = ABE_TASK_ID(C_ABE_FW_TASK_ASRC_VX_UL_8); + abe->MultiFrame[16][3] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_VX_UL)*/; + /* MultiFrame[16][4] = 0; */ + /* MultiFrame[16][5] = 0; */ + /* MultiFrame[16][6] = 0; */ + /* MultiFrame[16][7] = 0; */ + /* MultiFrame[17][0] = 0; */ + /* MultiFrame[17][1] = 0; */ + abe->MultiFrame[17][2] = ABE_TASK_ID(C_ABE_FW_TASK_BT_UL_8_48); + abe->MultiFrame[17][3] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_UL2)*/; + /* MultiFrame[17][4] = 0; */ + /* MultiFrame[17][5] = 0; */ + /* MultiFrame[17][6] = 0; */ + /* MultiFrame[17][7] = 0; */ + abe->MultiFrame[18][0] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_DL)*/; + /* MultiFrame[18][1] = 0; */ + /* MultiFrame[18][2] = 0; */ + /* MultiFrame[18][3] = 0; */ + /* MultiFrame[18][4] = 0; */ + /* MultiFrame[18][5] = 0; */ + abe->MultiFrame[18][6] = ABE_TASK_ID(C_ABE_FW_TASK_ASRC_BT_DL_8); + /* MultiFrame[18][7] = 0; */ + abe->MultiFrame[19][0] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_DL)*/; + /* MultiFrame[19][1] = 0 */ + /* MultiFrame[19][2] = 0; */ + /* MultiFrame[19][3] = 0; */ + /* MultiFrame[19][4] = 0; */ + /* MultiFrame[19][5] = 0; */ + /* MM_UL is moved to OPP 100% */ + abe->MultiFrame[19][6] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_UL)*/; + /* MultiFrame[19][7] = 0; */ + abe->MultiFrame[20][0] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_TONES_DL)*/; + /* MultiFrame[20][1] = 0; */ + /* MultiFrame[20][2] = 0; */ + /* MultiFrame[20][3] = 0; */ + /* MultiFrame[20][4] = 0; */ + /* MultiFrame[20][5] = 0; */ + abe->MultiFrame[20][6] = ABE_TASK_ID(C_ABE_FW_TASK_ASRC_MM_EXT_IN); + /* MultiFrame[20][7] = 0; */ + /* MultiFrame[21][0] = 0; */ + abe->MultiFrame[21][1] = ABE_TASK_ID(C_ABE_FW_TASK_DEBUGTRACE_VX_ASRCs); + /* MultiFrame[21][2] = 0; */ + abe->MultiFrame[21][3] = 0/*ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_EXT_IN)*/; + /* MultiFrame[21][4] = 0; */ + /* MultiFrame[21][5] = 0; */ + /* MultiFrame[21][6] = 0; */ + /* MultiFrame[21][7] = 0; */ + /* MUST STAY ON SLOT 22 */ + abe->MultiFrame[22][0] = ABE_TASK_ID(C_ABE_FW_TASK_DEBUG_IRQFIFO); + abe->MultiFrame[22][1] = ABE_TASK_ID(C_ABE_FW_TASK_INIT_FW_MEMORY); + abe->MultiFrame[22][2] = 0; + /* MultiFrame[22][3] = 0; */ + /* MM_EXT_IN_SPLIT task must be after IO_MM_EXT_IN and before + ASRC_MM_EXT_IN in order to manage OPP50 <-> transitions */ + abe->MultiFrame[22][4] = ABE_TASK_ID(C_ABE_FW_TASK_MM_EXT_IN_SPLIT); + /* MultiFrame[22][5] = 0; */ + /* MultiFrame[22][6] = 0; */ + /* MultiFrame[22][7] = 0; */ + abe->MultiFrame[23][0] = ABE_TASK_ID(C_ABE_FW_TASK_GAIN_UPDATE); + /* MultiFrame[23][1] = 0; */ + /* MultiFrame[23][2] = 0; */ + /* MultiFrame[23][3] = 0; */ + /* MultiFrame[23][4] = 0; */ + /* MultiFrame[23][5] = 0; */ + /* MultiFrame[23][6] = 0; */ + /* MultiFrame[23][7] = 0; */ + /* MultiFrame[24][0] = 0; */ + /* MultiFrame[24][1] = 0; */ + /* MultiFrame[24][2] = 0; */ + /* MultiFrame[24][3] = 0; */ + /* MultiFrame[24][4] = 0; */ + /* MultiFrame[24][5] = 0; */ + /* MultiFrame[24][6] = 0; */ + /* MultiFrame[24][7] = 0; */ + omap_abe_mem_write(abe, OMAP_ABE_DMEM, OMAP_ABE_D_MULTIFRAME_ADDR, + (u32 *) abe->MultiFrame, sizeof(abe->MultiFrame)); + /* reset the uplink router */ + n = (OMAP_ABE_D_AUPLINKROUTING_SIZE) >> 1; + for (i = 0; i < n; i++) + aUplinkMuxing[i] = ZERO_labelID; + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, OMAP_ABE_D_AUPLINKROUTING_ADDR, + (u32 *) aUplinkMuxing, sizeof(aUplinkMuxing)); +} + +/** + * omap_abe_reset_port + * @id: ABE port ID + * + * stop the port activity and reload default parameters on the associated + * processing features. + * Clears the internal AE buffers. + */ +int omap_abe_reset_port(u32 id) +{ + _log(ABE_ID_RESET_PORT, id, 0, 0); + abe_port[id] = ((abe_port_t *) abe_port_init)[id]; + return 0; +} + +/** + * abe_reset_all_ports + * + * load default configuration for all features + */ +void omap_abe_reset_all_ports(struct omap_abe *abe) +{ + u16 i; + for (i = 0; i < LAST_PORT_ID; i++) + omap_abe_reset_port(i); + /* mixers' configuration */ + omap_abe_write_mixer(abe, MIXDL1, MUTE_GAIN, + RAMP_100MS, MIX_DL1_INPUT_MM_DL); + omap_abe_write_mixer(abe, MIXDL1, MUTE_GAIN, + RAMP_100MS, MIX_DL1_INPUT_MM_UL2); + omap_abe_write_mixer(abe, MIXDL1, MUTE_GAIN, + RAMP_100MS, MIX_DL1_INPUT_VX_DL); + omap_abe_write_mixer(abe, MIXDL1, MUTE_GAIN, + RAMP_100MS, MIX_DL1_INPUT_TONES); + omap_abe_write_mixer(abe, MIXDL2, MUTE_GAIN, + RAMP_100MS, MIX_DL2_INPUT_TONES); + omap_abe_write_mixer(abe, MIXDL2, MUTE_GAIN, + RAMP_100MS, MIX_DL2_INPUT_VX_DL); + omap_abe_write_mixer(abe, MIXDL2, MUTE_GAIN, + RAMP_100MS, MIX_DL2_INPUT_MM_DL); + omap_abe_write_mixer(abe, MIXDL2, MUTE_GAIN, + RAMP_100MS, MIX_DL2_INPUT_MM_UL2); + omap_abe_write_mixer(abe, MIXSDT, MUTE_GAIN, + RAMP_100MS, MIX_SDT_INPUT_UP_MIXER); + omap_abe_write_mixer(abe, MIXSDT, GAIN_0dB, + RAMP_100MS, MIX_SDT_INPUT_DL1_MIXER); + omap_abe_write_mixer(abe, MIXECHO, MUTE_GAIN, + RAMP_100MS, MIX_ECHO_DL1); + omap_abe_write_mixer(abe, MIXECHO, MUTE_GAIN, + RAMP_100MS, MIX_ECHO_DL2); + omap_abe_write_mixer(abe, MIXAUDUL, MUTE_GAIN, + RAMP_100MS, MIX_AUDUL_INPUT_MM_DL); + omap_abe_write_mixer(abe, MIXAUDUL, MUTE_GAIN, + RAMP_100MS, MIX_AUDUL_INPUT_TONES); + omap_abe_write_mixer(abe, MIXAUDUL, GAIN_0dB, + RAMP_100MS, MIX_AUDUL_INPUT_UPLINK); + omap_abe_write_mixer(abe, MIXAUDUL, MUTE_GAIN, + RAMP_100MS, MIX_AUDUL_INPUT_VX_DL); + omap_abe_write_mixer(abe, MIXVXREC, MUTE_GAIN, + RAMP_100MS, MIX_VXREC_INPUT_TONES); + omap_abe_write_mixer(abe, MIXVXREC, MUTE_GAIN, + RAMP_100MS, MIX_VXREC_INPUT_VX_DL); + omap_abe_write_mixer(abe, MIXVXREC, MUTE_GAIN, + RAMP_100MS, MIX_VXREC_INPUT_MM_DL); + omap_abe_write_mixer(abe, MIXVXREC, MUTE_GAIN, + RAMP_100MS, MIX_VXREC_INPUT_VX_UL); + omap_abe_write_gain(abe, GAINS_DMIC1, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DMIC1, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DMIC2, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DMIC2, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DMIC3, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DMIC3, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_AMIC, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_AMIC, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_SPLIT, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_SPLIT, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL1, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL1, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL2, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_DL2, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); + omap_abe_write_gain(abe, GAINS_BTUL, GAIN_0dB, + RAMP_100MS, GAIN_LEFT_OFFSET); + omap_abe_write_gain(abe, GAINS_BTUL, GAIN_0dB, + RAMP_100MS, GAIN_RIGHT_OFFSET); +} diff --git a/sound/soc/omap/abe/abe_initxxx_labels.h b/sound/soc/omap/abe/abe_initxxx_labels.h new file mode 100644 index 0000000..2331dfb --- /dev/null +++ b/sound/soc/omap/abe/abe_initxxx_labels.h @@ -0,0 +1,372 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_INITXXX_LABELS_H_ +#define _ABE_INITXXX_LABELS_H_ + +#define Dummy_Regs_labelID 0 +#define Dummy_AM_labelID 1 +#define Voice_8k_UL_labelID 2 +#define Voice_8k_DL_labelID 3 +#define ECHO_REF_8K_labelID 4 +#define Voice_16k_UL_labelID 5 +#define Voice_16k_DL_labelID 6 +#define ECHO_REF_16K_labelID 7 +#define MM_DL_labelID 8 +#define IO_VX_DL_ASRC_labelID 9 +#define IO_MM_EXT_IN_ASRC_labelID 10 +#define IO_VIBRA_DL_labelID 11 +#define ZERO_labelID 12 +#define GTarget_labelID 13 +#define GCurrent_labelID 14 +#define Gr_1_labelID 15 +#define Gr_2_labelID 16 +#define Gr_Regs_labelID 17 +#define DMIC0_Gain_labelID 18 +#define DMIC1_Gain_labelID 19 +#define DMIC2_Gain_labelID 20 +#define DMIC3_Gain_labelID 21 +#define AMIC_Gain_labelID 22 +#define MIXDL1_Gain_labelID 23 +#define MIXDL2_Gain_labelID 24 +#define DEFAULT_Gain_labelID 25 +#define DL1_M_G_Tones_labelID 26 +#define DL2_M_G_Tones_labelID 27 +#define Echo_M_G_labelID 28 +#define SDT_M_G_labelID 29 +#define VXREC_M_G_VX_DL_labelID 30 +#define UL_M_G_VX_DL_labelID 31 +#define BTUL_Gain_labelID 32 +#define DL1_M_labelID 33 +#define DL2_M_labelID 34 +#define MM_UL2_labelID 35 +#define VX_DL_labelID 36 +#define Tones_labelID 37 +#define DL_M_MM_UL2_VX_DL_labelID 38 +#define Echo_M_labelID 39 +#define VX_UL_labelID 40 +#define VX_UL_M_labelID 41 +#define SDT_F_labelID 42 +#define SDT_F_data_labelID 43 +#define SDT_Coef_labelID 44 +#define SDT_Regs_labelID 45 +#define SDT_M_labelID 46 +#define DL1_EQ_labelID 47 +#define DL2_EQ_labelID 48 +#define DL1_GAIN_out_labelID 49 +#define DL2_GAIN_out_labelID 50 +#define DMIC1_labelID 51 +#define DMIC1_L_labelID 52 +#define DMIC1_R_labelID 53 +#define DMIC2_labelID 54 +#define DMIC2_L_labelID 55 +#define DMIC2_R_labelID 56 +#define DMIC3_labelID 57 +#define DMIC3_L_labelID 58 +#define DMIC3_R_labelID 59 +#define MIC4_labelID 60 +#define MIC4_L_labelID 61 +#define MIC4_R_labelID 62 +#define BT_UL_L_labelID 63 +#define BT_UL_R_labelID 64 +#define AMIC_labelID 65 +#define AMIC_L_labelID 66 +#define AMIC_R_labelID 67 +#define EchoRef_L_labelID 68 +#define EchoRef_R_labelID 69 +#define MM_DL_L_labelID 70 +#define MM_DL_R_labelID 71 +#define MM_UL_labelID 72 +#define AMIC_96_labelID 73 +#define DMIC0_96_labelID 74 +#define DMIC1_96_labelID 75 +#define DMIC2_96_labelID 76 +#define UL_MIC_48K_labelID 77 +#define EQ_DL_48K_labelID 78 +#define EQ_48K_labelID 79 +#define McPDM_Out1_labelID 80 +#define McPDM_Out2_labelID 81 +#define McPDM_Out3_labelID 82 +#define VX_UL_MUX_labelID 83 +#define MM_UL2_MUX_labelID 84 +#define MM_UL_MUX_labelID 85 +#define XinASRC_DL_VX_labelID 86 +#define ASRC_DL_VX_Coefs_labelID 87 +#define ASRC_DL_VX_Alpha_labelID 88 +#define ASRC_DL_VX_VarsBeta_labelID 89 +#define ASRC_DL_VX_8k_Regs_labelID 90 +#define XinASRC_UL_VX_labelID 91 +#define ASRC_UL_VX_Coefs_labelID 92 +#define ASRC_UL_VX_Alpha_labelID 93 +#define ASRC_UL_VX_VarsBeta_labelID 94 +#define ASRC_UL_VX_8k_Regs_labelID 95 +#define UL_48_8_DEC_labelID 96 +#define ASRC_DL_VX_16k_Regs_labelID 97 +#define ASRC_UL_VX_16k_Regs_labelID 98 +#define UL_48_16_DEC_labelID 99 +#define XinASRC_MM_EXT_IN_labelID 100 +#define ASRC_MM_EXT_IN_Coefs_labelID 101 +#define ASRC_MM_EXT_IN_Alpha_labelID 102 +#define ASRC_MM_EXT_IN_VarsBeta_labelID 103 +#define ASRC_MM_EXT_IN_Regs_labelID 104 +#define VX_REC_labelID 105 +#define VXREC_UL_M_Tones_VX_UL_labelID 106 +#define VX_REC_L_labelID 107 +#define VX_REC_R_labelID 108 +#define DL2_M_L_labelID 109 +#define DL2_M_R_labelID 110 +#define DL1_M_data_labelID 111 +#define DL1_M_Coefs_labelID 112 +#define DL2_M_LR_data_labelID 113 +#define DL2_M_LR_Coefs_labelID 114 +#define SRC_6_LP_COEFS_labelID 115 +#define SRC_6_LP_GAIN_COEFS_labelID 116 +#define SRC_6_HP_COEFS_labelID 117 +#define SRC_3_LP_COEFS_labelID 118 +#define SRC_3_LP_GAIN_COEFS_labelID 119 +#define SRC_3_HP_COEFS_labelID 120 +#define VX_DL_8_48_LP_DATA_labelID 121 +#define VX_DL_8_48_HP_DATA_labelID 122 +#define VX_DL_16_48_LP_DATA_labelID 123 +#define VX_DL_16_48_HP_DATA_labelID 124 +#define VX_UL_48_8_LP_DATA_labelID 125 +#define VX_UL_48_8_HP_DATA_labelID 126 +#define VX_UL_48_16_LP_DATA_labelID 127 +#define VX_UL_48_16_HP_DATA_labelID 128 +#define BT_UL_8_48_LP_DATA_labelID 129 +#define BT_UL_8_48_HP_DATA_labelID 130 +#define BT_UL_16_48_LP_DATA_labelID 131 +#define BT_UL_16_48_HP_DATA_labelID 132 +#define BT_DL_48_8_LP_DATA_labelID 133 +#define BT_DL_48_8_HP_DATA_labelID 134 +#define BT_DL_48_16_LP_DATA_labelID 135 +#define BT_DL_48_16_HP_DATA_labelID 136 +#define ECHO_REF_48_16_LP_DATA_labelID 137 +#define ECHO_REF_48_16_HP_DATA_labelID 138 +#define ECHO_REF_48_8_LP_DATA_labelID 139 +#define ECHO_REF_48_8_HP_DATA_labelID 140 +#define ECHO_REF_DEC_labelID 141 +#define VX_UL_8_TEMP_labelID 142 +#define VX_UL_16_TEMP_labelID 143 +#define UP_DOWN_8_48_labelID 144 +#define UP_DOWN_16_48_labelID 145 +#define SRC_6_LP_48k_labelID 146 +#define SRC_6_HP_labelID 147 +#define SRC_3_LP_48k_labelID 148 +#define SRC_3_HP_labelID 149 +#define EARP_48_96_LP_DATA_labelID 150 +#define SRC_48_96_LP_labelID 151 +#define IHF_48_96_LP_DATA_labelID 152 +#define EQ_VX_UL_16K_labelID 153 +#define pAPS_iir1_p23_labelID 154 +#define pAPS_iir1_p45_labelID 155 +#define APS_IIR_Regs_labelID 156 +#define pAPS_core_DL1_p1_labelID 157 +#define pAPS_core_DL1_p23_labelID 158 +#define pAPS_core_DL1_p45_labelID 159 +#define pAPS_core_DL1_r_labelID 160 +#define pAPS_DL2L_core_r_labelID 161 +#define pAPS_DL2R_core_r_labelID 162 +#define pAPS_COIL_core_DL1_p1_labelID 163 +#define pAPS_COIL_core_DL1_p23_labelID 164 +#define pAPS_COIL_core_DL1_p45_labelID 165 +#define pAPS_COIL_core_DL1_r_labelID 166 +#define DL2_L_APS_IIR_p23_labelID 167 +#define DL2_R_APS_IIR_p23_labelID 168 +#define DL2_L_APS_IIR_p45_labelID 169 +#define DL2_R_APS_IIR_p45_labelID 170 +#define DL2_L_APS_CORE_p1_labelID 171 +#define DL2_L_APS_CORE_p23_labelID 172 +#define DL2_L_APS_CORE_p45_labelID 173 +#define DL2_R_APS_CORE_p1_labelID 174 +#define DL2_R_APS_CORE_p23_labelID 175 +#define DL2_R_APS_CORE_p45_labelID 176 +#define DL2_L_APS_COIL_CORE_p1_labelID 177 +#define DL2_L_APS_COIL_CORE_p23_labelID 178 +#define DL2_L_APS_COIL_CORE_p45_labelID 179 +#define pAPS_COIL_DL2L_core_r_labelID 180 +#define DL2_R_APS_COIL_CORE_p1_labelID 181 +#define DL2_R_APS_COIL_CORE_p23_labelID 182 +#define DL2_R_APS_COIL_CORE_p45_labelID 183 +#define pAPS_COIL_DL2R_core_r_labelID 184 +#define DL1_APS_labelID 185 +#define DL2_L_APS_labelID 186 +#define DL2_R_APS_labelID 187 +#define DL1_APS_EQ_p23_labelID 188 +#define DL1_APS_EQ_p45_labelID 189 +#define DL2_APS_EQ_p23_labelID 190 +#define DL2_APS_EQ_p45_labelID 191 +#define pVIBRA1_p0_labelID 192 +#define pVIBRA1_p1_labelID 193 +#define pVIBRA1_p23_labelID 194 +#define pVIBRA1_p45_labelID 195 +#define pVibra1_pR1_labelID 196 +#define pVibra1_pR2_labelID 197 +#define pVibra1_pR3_labelID 198 +#define pVIBRA1_r_labelID 199 +#define pVIBRA2_p0_labelID 200 +#define pVIBRA2_p1_labelID 201 +#define pVIBRA2_p23_labelID 202 +#define pVIBRA2_p45_labelID 203 +#define pCtrl_p67_labelID 204 +#define pVIBRA2_r_labelID 205 +#define VIBRA_labelID 206 +#define PING_labelID 207 +#define PING_Regs_labelID 208 +#define UP_48_96_LP_COEFS_labelID 209 +#define AMIC_96_48_data_labelID 210 +#define DOWN_96_48_AMIC_Coefs_labelID 211 +#define DOWN_96_48_DMIC_Coefs_labelID 212 +#define DOWN_96_48_AMIC_Regs_labelID 213 +#define DOWN_96_48_DMIC_Regs_labelID 214 +#define DMIC0_96_48_data_labelID 215 +#define DMIC1_96_48_data_labelID 216 +#define DMIC2_96_48_data_labelID 217 +#define SIO_DMIC_labelID 218 +#define SIO_PDM_UL_labelID 219 +#define SIO_BT_VX_UL_labelID 220 +#define SIO_MM_UL_labelID 221 +#define SIO_MM_UL2_labelID 222 +#define SIO_VX_UL_labelID 223 +#define SIO_MM_DL_labelID 224 +#define SIO_VX_DL_labelID 225 +#define SIO_TONES_DL_labelID 226 +#define SIO_VIB_DL_labelID 227 +#define SIO_BT_VX_DL_labelID 228 +#define SIO_PDM_DL_labelID 229 +#define SIO_MM_EXT_OUT_labelID 230 +#define SIO_MM_EXT_IN_labelID 231 +#define SIO_TDM_OUT_labelID 232 +#define SIO_TDM_IN_labelID 233 +#define DMIC_ATC_PTR_labelID 234 +#define MCPDM_UL_ATC_PTR_labelID 235 +#define BT_VX_UL_ATC_PTR_labelID 236 +#define MM_UL_ATC_PTR_labelID 237 +#define MM_UL2_ATC_PTR_labelID 238 +#define VX_UL_ATC_PTR_labelID 239 +#define MM_DL_ATC_PTR_labelID 240 +#define VX_DL_ATC_PTR_labelID 241 +#define TONES_DL_ATC_PTR_labelID 242 +#define VIB_DL_ATC_PTR_labelID 243 +#define BT_VX_DL_ATC_PTR_labelID 244 +#define PDM_DL_ATC_PTR_labelID 245 +#define MM_EXT_OUT_ATC_PTR_labelID 246 +#define MM_EXT_IN_ATC_PTR_labelID 247 +#define TDM_OUT_ATC_PTR_labelID 248 +#define TDM_IN_ATC_PTR_labelID 249 +#define MCU_IRQ_FIFO_ptr_labelID 250 +#define DEBUG_IRQ_FIFO_reg_labelID 251 +#define UP_DOWN_48_96_labelID 252 +#define OSR96_2_labelID 253 +#define DEBUG_GAINS_labelID 254 +#define DBG_8K_PATTERN_labelID 255 +#define DBG_16K_PATTERN_labelID 256 +#define DBG_24K_PATTERN_labelID 257 +#define DBG_48K_PATTERN_labelID 258 +#define DBG_96K_PATTERN_labelID 259 +#define UL_VX_UL_48_8K_labelID 260 +#define UL_VX_UL_48_16K_labelID 261 +#define BT_DL_labelID 262 +#define BT_UL_labelID 263 +#define BT_DL_8k_labelID 264 +#define BT_DL_16k_labelID 265 +#define BT_UL_8k_labelID 266 +#define BT_UL_16k_labelID 267 +#define MM_EXT_IN_labelID 268 +#define MM_EXT_IN_L_labelID 269 +#define MM_EXT_IN_R_labelID 270 +#define ECHO_REF_48_16_WRAP_labelID 271 +#define ECHO_REF_48_8_WRAP_labelID 272 +#define BT_UL_16_48_WRAP_labelID 273 +#define BT_UL_8_48_WRAP_labelID 274 +#define BT_DL_48_16_WRAP_labelID 275 +#define BT_DL_48_8_WRAP_labelID 276 +#define VX_DL_16_48_WRAP_labelID 277 +#define VX_DL_8_48_WRAP_labelID 278 +#define VX_UL_48_16_WRAP_labelID 279 +#define VX_UL_48_8_WRAP_labelID 280 +#define APS_DL1_IRQs_WRAP_labelID 281 +#define APS_DL2_L_IRQs_WRAP_labelID 282 +#define APS_DL2_R_IRQs_WRAP_labelID 283 +#define ATC_NULL_BUFFER_labelID 284 +#define MEM_INIT_hal_mem_labelID 285 +#define MEM_INIT_write_mem_labelID 286 +#define MEM_INIT_regs_labelID 287 +#define GAIN_0DB_labelID 288 +#define XinASRC_BT_UL_labelID 289 +#define IO_BT_UL_ASRC_labelID 290 +#define ASRC_BT_UL_Coefs_labelID 291 +#define ASRC_BT_UL_Alpha_labelID 292 +#define ASRC_BT_UL_VarsBeta_labelID 293 +#define ASRC_BT_UL_8k_Regs_labelID 294 +#define ASRC_BT_UL_16k_Regs_labelID 295 +#define XinASRC_BT_DL_labelID 296 +#define DL_48_8_DEC_labelID 297 +#define DL_48_16_DEC_labelID 298 +#define BT_DL_8k_TEMP_labelID 299 +#define BT_DL_16k_TEMP_labelID 300 +#define BT_DL_8k_opp100_labelID 301 +#define BT_DL_16k_opp100_labelID 302 +#define ASRC_BT_DL_Coefs_labelID 303 +#define ASRC_BT_DL_Alpha_labelID 304 +#define ASRC_BT_DL_VarsBeta_labelID 305 +#define ASRC_BT_DL_8k_Regs_labelID 306 +#define ASRC_BT_DL_16k_Regs_labelID 307 +#define BT_DL_48_8_OPP100_WRAP_labelID 308 +#define BT_DL_48_16_OPP100_WRAP_labelID 309 +#endif /* _ABE_INITXXXX_LABELS_H_ */ diff --git a/sound/soc/omap/abe/abe_irq.c b/sound/soc/omap/abe/abe_irq.c new file mode 100644 index 0000000..d639894 --- /dev/null +++ b/sound/soc/omap/abe/abe_irq.c @@ -0,0 +1,107 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include "abe_legacy.h" + +extern u32 abe_irq_pingpong_player_id; + +/* + * initialize the default values for call-backs to subroutines + * - FIFO IRQ call-backs for sequenced tasks + * - FIFO IRQ call-backs for audio player/recorders (ping-pong protocols) + * - Remote debugger interface + * - Error monitoring + * - Activity Tracing + */ +/** + * abe_irq_ping_pong + * + * Call the respective subroutine depending on the IRQ FIFO content: + * APS interrupts : IRQ_FIFO[31:28] = IRQtag_APS, + * IRQ_FIFO[27:16] = APS_IRQs, IRQ_FIFO[15:0] = loopCounter + * SEQ interrupts : IRQ_FIFO[31:28] = IRQtag_COUNT, + * IRQ_FIFO[27:16] = Count_IRQs, IRQ_FIFO[15:0] = loopCounter + * Ping-Pong Interrupts : IRQ_FIFO[31:28] = IRQtag_PP, + * IRQ_FIFO[27:16] = PP_MCU_IRQ, IRQ_FIFO[15:0] = loopCounter + */ +void abe_irq_ping_pong(void) +{ + abe_call_subroutine(abe_irq_pingpong_player_id, NOPARAMETER, + NOPARAMETER, NOPARAMETER, NOPARAMETER); +} +/** + * abe_irq_check_for_sequences +* @i: sequence ID + * + * check the active sequence list + * + */ +void abe_irq_check_for_sequences(u32 i) +{ +} +/** + * abe_irq_aps + * + * call the application subroutines that updates + * the acoustics protection filters + */ +void abe_irq_aps(u32 aps_info) +{ + abe_call_subroutine(abe_irq_aps_adaptation_id, NOPARAMETER, NOPARAMETER, + NOPARAMETER, NOPARAMETER); +} diff --git a/sound/soc/omap/abe/abe_legacy.h b/sound/soc/omap/abe/abe_legacy.h new file mode 100644 index 0000000..ca73dc2 --- /dev/null +++ b/sound/soc/omap/abe/abe_legacy.h @@ -0,0 +1,98 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_MAIN_H_ +#define _ABE_MAIN_H_ + +#include <linux/io.h> + +#include "abe_dm_addr.h" +#include "abe_sm_addr.h" +#include "abe_cm_addr.h" +#include "abe_define.h" +#include "abe_fw.h" +#include "abe_def.h" +#include "abe_typ.h" +#include "abe_ext.h" +#include "abe_dbg.h" +#include "abe_ref.h" +#include "abe_api.h" +#include "abe_typedef.h" +#include "abe_functionsid.h" +#include "abe_taskid.h" +#include "abe_initxxx_labels.h" +#include "abe_fw.h" + +/* pipe connection to the TARGET simulator */ +#define ABE_DEBUG_CHECKERS 0 +/* simulator data extracted from a text-file */ +#define ABE_DEBUG_HWFILE 0 +/* low-level log files */ +#define ABE_DEBUG_LL_LOG 0 + +extern struct omap_abe *abe; + +void omap_abe_dbg_log(struct omap_abe *abe, u32 x, u32 y, u32 z, u32 t); +void omap_abe_dbg_error(struct omap_abe *abe, int level, int error); + +/* + * MACROS + */ +#define _log(x, y, z, t) { if (x & abe->dbg.mask) omap_abe_dbg_log(abe, x, y, z, t); } + +#endif /* _ABE_MAIN_H_ */ diff --git a/sound/soc/omap/abe/abe_main.c b/sound/soc/omap/abe/abe_main.c new file mode 100644 index 0000000..1e874e6 --- /dev/null +++ b/sound/soc/omap/abe/abe_main.c @@ -0,0 +1,728 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/io.h> +#include <linux/module.h> +#include <linux/slab.h> + +#include "abe_legacy.h" +#include "abe_dbg.h" +#include "abe_port.h" + + +struct omap_abe_equ { + /* type of filter */ + u32 equ_type; + /* filter length */ + u32 equ_length; + union { + /* parameters are the direct and recursive coefficients in */ + /* Q6.26 integer fixed-point format. */ + s32 type1[NBEQ1]; + struct { + /* center frequency of the band [Hz] */ + s32 freq[NBEQ2]; + /* gain of each band. [dB] */ + s32 gain[NBEQ2]; + /* Q factor of this band [dB] */ + s32 q[NBEQ2]; + } type2; + } coef; + s32 equ_param3; +}; + +#include "abe_gain.h" +#include "abe_aess.h" +#include "abe_seq.h" + + +int omap_abe_connect_debug_trace(struct omap_abe *abe, + struct omap_abe_dma *dma2); + +int omap_abe_reset_hal(struct omap_abe *abe); +int omap_abe_load_fw(struct omap_abe *abe); +int omap_abe_wakeup(struct omap_abe *abe); +int omap_abe_irq_processing(struct omap_abe *abe); +int omap_abe_clear_irq(struct omap_abe *abe); +int omap_abe_disable_irq(struct omap_abe *abe); +int omap_abe_set_debug_trace(struct omap_abe_dbg *dbg, int debug); +int omap_abe_set_ping_pong_buffer(struct omap_abe *abe, + u32 port, u32 n_bytes); +int omap_abe_read_next_ping_pong_buffer(struct omap_abe *abe, + u32 port, u32 *p, u32 *n); +int omap_abe_init_ping_pong_buffer(struct omap_abe *abe, + u32 id, u32 size_bytes, u32 n_buffers, + u32 *p); +int omap_abe_read_offset_from_ping_buffer(struct omap_abe *abe, + u32 id, u32 *n); +int omap_abe_set_router_configuration(struct omap_abe *abe, + u32 id, u32 k, u32 *param); +int omap_abe_set_opp_processing(struct omap_abe *abe, u32 opp); +int omap_abe_disable_data_transfer(struct omap_abe *abe, u32 id); +int omap_abe_enable_data_transfer(struct omap_abe *abe, u32 id); +int omap_abe_connect_cbpr_dmareq_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 d, + abe_dma_t *returned_dma_t); +int omap_abe_connect_irq_ping_pong_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 subroutine_id, u32 size, + u32 *sink, u32 dsp_mcu_flag); +int omap_abe_connect_serial_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 mcbsp_id); +int omap_abe_read_port_address(struct omap_abe *abe, + u32 port, abe_dma_t *dma2); +int omap_abe_check_activity(struct omap_abe *abe); + +int omap_abe_use_compensated_gain(struct omap_abe *abe, int on_off); +int omap_abe_write_equalizer(struct omap_abe *abe, + u32 id, struct omap_abe_equ *param); + +int omap_abe_disable_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_enable_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_mute_gain(struct omap_abe *abe, u32 id, u32 p); +int omap_abe_unmute_gain(struct omap_abe *abe, u32 id, u32 p); + +int omap_abe_write_gain(struct omap_abe *abe, + u32 id, s32 f_g, u32 ramp, u32 p); +int omap_abe_write_mixer(struct omap_abe *abe, + u32 id, s32 f_g, u32 f_ramp, u32 p); +int omap_abe_read_gain(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p); +int omap_abe_read_mixer(struct omap_abe *abe, + u32 id, u32 *f_g, u32 p); + +extern struct omap_abe *abe; + +#if 0 +/** + * abe_init_mem - Allocate Kernel space memory map for ABE + * + * Memory map of ABE memory space for PMEM/DMEM/SMEM/DMEM + */ +void abe_init_mem(void __iomem *_io_base) +{ + omap_abe_init_mem(abe, _io_base); +} +EXPORT_SYMBOL(abe_init_mem); + +struct omap_abe* abe_probe_aess(void) +{ + return omap_abe_probe_aess(abe); +} +EXPORT_SYMBOL(abe_probe_aess); + +void abe_remove_aess(void) +{ + omap_abe_remove_aess(abe); +} +EXPORT_SYMBOL(abe_remove_aess); + +void abe_add_subroutine(u32 *id, abe_subroutine2 f, + u32 nparam, u32 *params) +{ + omap_abe_add_subroutine(abe, id, f, nparam, params); +} +EXPORT_SYMBOL(abe_add_subroutine); + +#endif + +/** + * abe_reset_hal - reset the ABE/HAL + * @rdev: regulator source + * @constraints: constraints to apply + * + * Operations : reset the HAL by reloading the static variables and + * default AESS registers. + * Called after a PRCM cold-start reset of ABE + */ +u32 abe_reset_hal(void) +{ + omap_abe_reset_hal(abe); + return 0; +} +EXPORT_SYMBOL(abe_reset_hal); + +/** + * abe_load_fw - Load ABE Firmware and initialize memories + * + */ +u32 abe_load_fw(void) +{ + omap_abe_load_fw(abe); + return 0; +} +EXPORT_SYMBOL(abe_load_fw); + +/** + * abe_wakeup - Wakeup ABE + * + * Wakeup ABE in case of retention + */ +u32 abe_wakeup(void) +{ + omap_abe_wakeup(abe); + return 0; +} +EXPORT_SYMBOL(abe_wakeup); + +/** + * abe_irq_processing - Process ABE interrupt + * + * This subroutine is call upon reception of "MA_IRQ_99 ABE_MPU_IRQ" Audio + * back-end interrupt. This subroutine will check the ATC Hrdware, the + * IRQ_FIFO from the AE and act accordingly. Some IRQ source are originated + * for the delivery of "end of time sequenced tasks" notifications, some are + * originated from the Ping-Pong protocols, some are generated from + * the embedded debugger when the firmware stops on programmable break-points, + * etc ... + */ +u32 abe_irq_processing(void) +{ + omap_abe_irq_processing(abe); + return 0; +} +EXPORT_SYMBOL(abe_irq_processing); + +/** + * abe_clear_irq - clear ABE interrupt + * + * This subroutine is call to clear MCU Irq + */ +u32 abe_clear_irq(void) +{ + omap_abe_clear_irq(abe); + return 0; +} +EXPORT_SYMBOL(abe_clear_irq); + +/** + * abe_disable_irq - disable MCU/DSP ABE interrupt + * + * This subroutine is disabling ABE MCU/DSP Irq + */ +u32 abe_disable_irq(void) +{ + omap_abe_disable_irq(abe); + + return 0; +} +EXPORT_SYMBOL(abe_disable_irq); + +/** + * abe_write_event_generator - Selects event generator source + * @e: Event Generation Counter, McPDM, DMIC or default. + * + * Loads the AESS event generator hardware source. + * Loads the firmware parameters accordingly. + * Indicates to the FW which data stream is the most important to preserve + * in case all the streams are asynchronous. + * If the parameter is "default", then HAL decides which Event source + * is the best appropriate based on the opened ports. + * + * When neither the DMIC and the McPDM are activated, the AE will have + * its EVENT generator programmed with the EVENT_COUNTER. + * The event counter will be tuned in order to deliver a pulse frequency higher + * than 96 kHz. + * The DPLL output at 100% OPP is MCLK = (32768kHz x6000) = 196.608kHz + * The ratio is (MCLK/96000)+(1<<1) = 2050 + * (1<<1) in order to have the same speed at 50% and 100% OPP + * (only 15 MSB bits are used at OPP50%) + */ +u32 abe_write_event_generator(u32 e) // should integarte abe as parameter +{ + omap_abe_write_event_generator(abe, e); + return 0; +} +EXPORT_SYMBOL(abe_write_event_generator); + +/** + * abe_start_event_generator - Starts event generator source + * + * Start the event genrator of AESS. No more event will be send to AESS engine. + * Upper layer must wait 1/96kHz to be sure that engine reaches + * the IDLE instruction. + */ +u32 abe_stop_event_generator(void) +{ + omap_abe_stop_event_generator(abe); + return 0; +} +EXPORT_SYMBOL(abe_stop_event_generator); + +/** + * abe_connect_debug_trace + * @dma2:pointer to the DMEM trace buffer + * + * returns the address and size of the real-time debug trace buffer, + * the content of which will vary from one firmware release to another + */ +u32 abe_connect_debug_trace(abe_dma_t *dma2) +{ + omap_abe_connect_debug_trace(abe, (struct omap_abe_dma *)dma2); + return 0; +} +EXPORT_SYMBOL(abe_connect_debug_trace); + +/** + * abe_set_debug_trace + * @debug: debug ID from a list to be defined + * + * loads a mask which filters the debug trace to dedicated types of data + */ +u32 abe_set_debug_trace(abe_dbg_t debug) +{ + omap_abe_set_debug_trace(&abe->dbg, (int)(debug)); + return 0; +} +EXPORT_SYMBOL(abe_set_debug_trace); + +/** + * abe_set_ping_pong_buffer + * @port: ABE port ID + * @n_bytes: Size of Ping/Pong buffer + * + * Updates the next ping-pong buffer with "size" bytes copied from the + * host processor. This API notifies the FW that the data transfer is done. + */ +u32 abe_set_ping_pong_buffer(u32 port, u32 n_bytes) +{ + omap_abe_set_ping_pong_buffer(abe, port, n_bytes); + return 0; +} +EXPORT_SYMBOL(abe_set_ping_pong_buffer); + +/** + * abe_read_next_ping_pong_buffer + * @port: ABE portID + * @p: Next buffer address (pointer) + * @n: Next buffer size (pointer) + * + * Tell the next base address of the next ping_pong Buffer and its size + */ +u32 abe_read_next_ping_pong_buffer(u32 port, u32 *p, u32 *n) +{ + omap_abe_read_next_ping_pong_buffer(abe, port, p, n); + return 0; +} +EXPORT_SYMBOL(abe_read_next_ping_pong_buffer); + +/** + * abe_init_ping_pong_buffer + * @id: ABE port ID + * @size_bytes:size of the ping pong + * @n_buffers:number of buffers (2 = ping/pong) + * @p:returned address of the ping-pong list of base addresses + * (byte offset from DMEM start) + * + * Computes the base address of the ping_pong buffers + */ +u32 abe_init_ping_pong_buffer(u32 id, u32 size_bytes, u32 n_buffers, + u32 *p) +{ + omap_abe_init_ping_pong_buffer(abe, id, size_bytes, n_buffers, p); + return 0; +} +EXPORT_SYMBOL(abe_init_ping_pong_buffer); + +/** + * abe_read_offset_from_ping_buffer + * @id: ABE port ID + * @n: returned address of the offset + * from the ping buffer start address (in samples) + * + * Computes the current firmware ping pong read pointer location, + * expressed in samples, as the offset from the start address of ping buffer. + */ +u32 abe_read_offset_from_ping_buffer(u32 id, u32 *n) +{ + omap_abe_read_offset_from_ping_buffer(abe, id, n); + return 0; +} +EXPORT_SYMBOL(abe_read_offset_from_ping_buffer); + +/** + * abe_write_equalizer + * @id: name of the equalizer + * @param : equalizer coefficients + * + * Load the coefficients in CMEM. + */ +u32 abe_write_equalizer(u32 id, abe_equ_t *param) +{ + omap_abe_write_equalizer(abe, id, (struct omap_abe_equ *)param); + return 0; +} +EXPORT_SYMBOL(abe_write_equalizer); +/** + * abe_disable_gain + * Parameters: + * mixer id + * sub-port id + * + */ +u32 abe_disable_gain(u32 id, u32 p) +{ + omap_abe_disable_gain(abe, id, p); + return 0; +} +EXPORT_SYMBOL(abe_disable_gain); +/** + * abe_enable_gain + * Parameters: + * mixer id + * sub-port id + * + */ +u32 abe_enable_gain(u32 id, u32 p) +{ + omap_abe_enable_gain(abe, id, p); + return 0; +} +EXPORT_SYMBOL(abe_enable_gain); + +/** + * abe_mute_gain + * Parameters: + * mixer id + * sub-port id + * + */ +u32 abe_mute_gain(u32 id, u32 p) +{ + omap_abe_mute_gain(abe, id, p); + return 0; +} +EXPORT_SYMBOL(abe_mute_gain); + +/** + * abe_unmute_gain + * Parameters: + * mixer id + * sub-port id + * + */ +u32 abe_unmute_gain(u32 id, u32 p) +{ + omap_abe_unmute_gain(abe, id, p); + return 0; +} +EXPORT_SYMBOL(abe_unmute_gain); + +/** + * abe_write_gain + * @id: gain name or mixer name + * @f_g: list of input gains of the mixer + * @ramp: gain ramp speed factor + * @p: list of ports corresponding to the above gains + * + * Loads the gain coefficients to FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's gain + * in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +u32 abe_write_gain(u32 id, s32 f_g, u32 ramp, u32 p) +{ + omap_abe_write_gain(abe, id, f_g, ramp, p); + return 0; +} +EXPORT_SYMBOL(abe_write_gain); + +/** + * abe_write_mixer + * @id: name of the mixer + * @param: input gains and delay ramp of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +u32 abe_write_mixer(u32 id, s32 f_g, u32 f_ramp, u32 p) +{ + omap_abe_write_gain(abe, id, f_g, f_ramp, p); + return 0; +} +EXPORT_SYMBOL(abe_write_mixer); + +/** + * abe_read_gain + * @id: name of the mixer + * @param: list of input gains of the mixer + * @p: list of port corresponding to the above gains + * + */ +u32 abe_read_gain(u32 id, u32 *f_g, u32 p) +{ + omap_abe_read_gain(abe, id, f_g, p); + return 0; +} +EXPORT_SYMBOL(abe_read_gain); + +/** + * abe_read_mixer + * @id: name of the mixer + * @param: gains of the mixer + * @p: port corresponding to the above gains + * + * Load the gain coefficients in FW memory. This API can be called when + * the corresponding MIXER is not activated. After reloading the firmware + * the default coefficients corresponds to "all input and output mixer's + * gain in mute state". A mixer is disabled with a network reconfiguration + * corresponding to an OPP value. + */ +u32 abe_read_mixer(u32 id, u32 *f_g, u32 p) +{ + omap_abe_read_gain(abe, id, f_g, p); + return 0; +} +EXPORT_SYMBOL(abe_read_mixer); + +/** + * abe_set_router_configuration + * @Id: name of the router + * @Conf: id of the configuration + * @param: list of output index of the route + * + * The uplink router takes its input from DMIC (6 samples), AMIC (2 samples) + * and PORT1/2 (2 stereo ports). Each sample will be individually stored in + * an intermediate table of 10 elements. + * + * Example of router table parameter for voice uplink with phoenix microphones + * + * indexes 0 .. 9 = MM_UL description (digital MICs and MMEXTIN) + * DMIC1_L_labelID, DMIC1_R_labelID, DMIC2_L_labelID, DMIC2_R_labelID, + * MM_EXT_IN_L_labelID, MM_EXT_IN_R_labelID, ZERO_labelID, ZERO_labelID, + * ZERO_labelID, ZERO_labelID, + * indexes 10 .. 11 = MM_UL2 description (recording on DMIC3) + * DMIC3_L_labelID, DMIC3_R_labelID, + * indexes 12 .. 13 = VX_UL description (VXUL based on PDMUL data) + * AMIC_L_labelID, AMIC_R_labelID, + * indexes 14 .. 15 = RESERVED (NULL) + * ZERO_labelID, ZERO_labelID, + */ +u32 abe_set_router_configuration(u32 id, u32 k, u32 *param) +{ + omap_abe_set_router_configuration(abe, id, k, param); + return 0; +} +EXPORT_SYMBOL(abe_set_router_configuration); + +/** + * abe_set_opp_processing - Set OPP mode for ABE Firmware + * @opp: OOPP mode + * + * New processing network and OPP: + * 0: Ultra Lowest power consumption audio player (no post-processing, no mixer) + * 1: OPP 25% (simple multimedia features, including low-power player) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% ( multimedia complex use-cases) + * + * Rearranges the FW task network to the corresponding OPP list of features. + * The corresponding AE ports are supposed to be set/reset accordingly before + * this switch. + * + */ +u32 abe_set_opp_processing(u32 opp) +{ + omap_abe_set_opp_processing(abe, opp); + return 0; +} +EXPORT_SYMBOL(abe_set_opp_processing); + +/** + * abe_disable_data_transfer + * @id: ABE port id + * + * disables the ATC descriptor and stop IO/port activities + * disable the IO task (@f = 0) + * clear ATC DMEM buffer, ATC enabled + */ +u32 abe_disable_data_transfer(u32 id) +{ + omap_abe_disable_data_transfer(abe, id); + return 0; +} +EXPORT_SYMBOL(abe_disable_data_transfer); + +/** + * abe_enable_data_transfer + * @ip: ABE port id + * + * enables the ATC descriptor + * reset ATC pointers + * enable the IO task (@f <> 0) + */ +u32 abe_enable_data_transfer(u32 id) +{ + omap_abe_enable_data_transfer(abe, id); + return 0; +} +EXPORT_SYMBOL(abe_enable_data_transfer); + +/** + * abe_connect_cbpr_dmareq_port + * @id: port name + * @f: desired data format + * @d: desired dma_request line (0..7) + * @a: returned pointer to the base address of the CBPr register and number of + * samples to exchange during a DMA_request. + * + * enables the data echange between a DMA and the ABE through the + * CBPr registers of AESS. + */ +u32 abe_connect_cbpr_dmareq_port(u32 id, abe_data_format_t *f, u32 d, + abe_dma_t *returned_dma_t) +{ + omap_abe_connect_cbpr_dmareq_port(abe, id, f, d, returned_dma_t); + return 0; +} +EXPORT_SYMBOL(abe_connect_cbpr_dmareq_port); + +/** + * abe_connect_irq_ping_pong_port + * @id: port name + * @f: desired data format + * @I: index of the call-back subroutine to call + * @s: half-buffer (ping) size + * @p: returned base address of the first (ping) buffer) + * + * enables the data echanges between a direct access to the DMEM + * memory of ABE using cache flush. On each IRQ activation a subroutine + * registered with "abe_plug_subroutine" will be called. This subroutine + * will generate an amount of samples, send them to DMEM memory and call + * "abe_set_ping_pong_buffer" to notify the new amount of samples in the + * pong buffer. + */ +u32 abe_connect_irq_ping_pong_port(u32 id, abe_data_format_t *f, + u32 subroutine_id, u32 size, + u32 *sink, u32 dsp_mcu_flag) +{ + omap_abe_connect_irq_ping_pong_port(abe, id, f, subroutine_id, size, + sink, dsp_mcu_flag); + return 0; +} +EXPORT_SYMBOL(abe_connect_irq_ping_pong_port); + +/** + * abe_connect_serial_port() + * @id: port name + * @f: data format + * @i: peripheral ID (McBSP #1, #2, #3) + * + * Operations : enables the data echanges between a McBSP and an ATC buffer in + * DMEM. This API is used connect 48kHz McBSP streams to MM_DL and 8/16kHz + * voice streams to VX_UL, VX_DL, BT_VX_UL, BT_VX_DL. It abstracts the + * abe_write_port API. + */ +u32 abe_connect_serial_port(u32 id, abe_data_format_t *f, + u32 mcbsp_id) +{ + omap_abe_connect_serial_port(abe, id, f, mcbsp_id); + return 0; +} +EXPORT_SYMBOL(abe_connect_serial_port); + +/** + * abe_read_port_address + * @dma: output pointer to the DMA iteration and data destination pointer + * + * This API returns the address of the DMA register used on this audio port. + * Depending on the protocol being used, adds the base address offset L3 + * (DMA) or MPU (ARM) + */ +u32 abe_read_port_address(u32 port, abe_dma_t *dma2) +{ + omap_abe_read_port_address(abe, port, dma2); + return 0; +} +EXPORT_SYMBOL(abe_read_port_address); + +/** + * abe_check_activity - Check if some ABE activity. + * + * Check if any ABE ports are running. + * return 1: still activity on ABE + * return 0: no more activity on ABE. Event generator can be stopped + * + */ +u32 abe_check_activity(void) +{ + return (u32)omap_abe_check_activity(abe); +} +EXPORT_SYMBOL(abe_check_activity); +/** + * abe_use_compensated_gain + * @on_off: + * + * Selects the automatic Mixer's gain management + * on_off = 1 allows the "abe_write_gain" to adjust the overall + * gains of the mixer to be tuned not to create saturation + */ +abehal_status abe_use_compensated_gain(u32 on_off) +{ + omap_abe_use_compensated_gain(abe, (int)(on_off)); + return 0; +} +EXPORT_SYMBOL(abe_use_compensated_gain); diff --git a/sound/soc/omap/abe/abe_main.h b/sound/soc/omap/abe/abe_main.h new file mode 100644 index 0000000..15f23cc --- /dev/null +++ b/sound/soc/omap/abe/abe_main.h @@ -0,0 +1,663 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_MAIN_H_ +#define _ABE_MAIN_H_ + +#include <linux/io.h> + +#include "abe_initxxx_labels.h" + +#define D_DEBUG_FIFO_ADDR 8160 +#define D_DEBUG_FIFO_ADDR_END 8255 + +#define SUB_0_PARAM 0 +#define SUB_1_PARAM 1 + +#define ABE_DEFAULT_BASE_ADDRESS_L3 0x49000000L +#define ABE_DMEM_BASE_ADDRESS_MPU 0x40180000L +#define ABE_DMEM_BASE_OFFSET_MPU 0x00080000L +#define ABE_DMEM_BASE_ADDRESS_L3 (ABE_DEFAULT_BASE_ADDRESS_L3 + \ + ABE_DMEM_BASE_OFFSET_MPU) + +/* + * HARDWARE AND PERIPHERAL DEFINITIONS + */ +/* MM_DL */ +#define ABE_CBPR0_IDX 0 +/* VX_DL */ +#define ABE_CBPR1_IDX 1 +/* VX_UL */ +#define ABE_CBPR2_IDX 2 +/* MM_UL */ +#define ABE_CBPR3_IDX 3 +/* MM_UL2 */ +#define ABE_CBPR4_IDX 4 +/* TONES */ +#define ABE_CBPR5_IDX 5 +/* VIB */ +#define ABE_CBPR6_IDX 6 +/* DEBUG/CTL */ +#define ABE_CBPR7_IDX 7 + +/* + * OPP TYPE + * + * 0: Ultra Lowest power consumption audio player + * 1: OPP 25% (simple multimedia features) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% (multimedia complex use-cases) + */ +#define ABE_OPP0 0 +#define ABE_OPP25 1 +#define ABE_OPP50 2 +#define ABE_OPP100 3 +/* + * SAMPLES TYPE + * + * mono 16 bit sample LSB aligned, 16 MSB bits are unused; + * mono right shifted to 16bits LSBs on a 32bits DMEM FIFO for McBSP + * TX purpose; + * mono sample MSB aligned (16/24/32bits); + * two successive mono samples in one 32bits container; + * Two L/R 16bits samples in a 32bits container; + * Two channels defined with two MSB aligned samples; + * Three channels defined with three MSB aligned samples (MIC); + * Four channels defined with four MSB aligned samples (MIC); + * . . . + * Eight channels defined with eight MSB aligned samples (MIC); + */ +#define MONO_MSB 1 +#define MONO_RSHIFTED_16 2 +#define STEREO_RSHIFTED_16 3 +#define STEREO_16_16 4 +#define STEREO_MSB 5 +#define THREE_MSB 6 +#define FOUR_MSB 7 +#define FIVE_MSB 8 +#define SIX_MSB 9 +#define SEVEN_MSB 10 +#define EIGHT_MSB 11 +#define NINE_MSB 12 +#define TEN_MSB 13 +/* + * PORT PROTOCOL TYPE - abe_port_protocol_switch_id + */ +#define SLIMBUS_PORT_PROT 1 +#define SERIAL_PORT_PROT 2 +#define TDM_SERIAL_PORT_PROT 3 +#define DMIC_PORT_PROT 4 +#define MCPDMDL_PORT_PROT 5 +#define MCPDMUL_PORT_PROT 6 +#define PINGPONG_PORT_PROT 7 +#define DMAREQ_PORT_PROT 8 +/* + * PORT IDs, this list is aligned with the FW data mapping + */ +#define DMIC_PORT 0 +#define PDM_UL_PORT 1 +#define BT_VX_UL_PORT 2 +#define MM_UL_PORT 3 +#define MM_UL2_PORT 4 +#define VX_UL_PORT 5 +#define MM_DL_PORT 6 +#define VX_DL_PORT 7 +#define TONES_DL_PORT 8 +#define VIB_DL_PORT 9 +#define BT_VX_DL_PORT 10 +#define PDM_DL_PORT 11 +#define MM_EXT_OUT_PORT 12 +#define MM_EXT_IN_PORT 13 +#define TDM_DL_PORT 14 +#define TDM_UL_PORT 15 +#define DEBUG_PORT 16 +#define LAST_PORT_ID 17 +/* definitions for the compatibility with HAL05xx */ +#define PDM_DL1_PORT 18 +#define PDM_DL2_PORT 19 +#define PDM_VIB_PORT 20 +/* There is only one DMIC port, always used with 6 samples + per 96kHz periods */ +#define DMIC_PORT1 DMIC_PORT +#define DMIC_PORT2 DMIC_PORT +#define DMIC_PORT3 DMIC_PORT +/* + * Signal processing module names - EQ APS MIX ROUT + */ +/* equalizer downlink path headset + earphone */ +#define FEAT_EQ1 1 +/* equalizer downlink path integrated handsfree LEFT */ +#define FEAT_EQ2L (FEAT_EQ1+1) +/* equalizer downlink path integrated handsfree RIGHT */ +#define FEAT_EQ2R (FEAT_EQ2L+1) +/* equalizer downlink path side-tone */ +#define FEAT_EQSDT (FEAT_EQ2R+1) +/* equalizer uplink path AMIC */ +#define FEAT_EQAMIC (FEAT_EQSDT+1) +/* equalizer uplink path DMIC */ +#define FEAT_EQDMIC (FEAT_EQAMIC+1) +/* Acoustic protection for headset */ +#define FEAT_APS1 (FEAT_EQDMIC+1) +/* acoustic protection high-pass filter for handsfree "Left" */ +#define FEAT_APS2 (FEAT_APS1+1) +/* acoustic protection high-pass filter for handsfree "Right" */ +#define FEAT_APS3 (FEAT_APS2+1) +/* asynchronous sample-rate-converter for the downlink voice path */ +#define FEAT_ASRC1 (FEAT_APS3+1) +/* asynchronous sample-rate-converter for the uplink voice path */ +#define FEAT_ASRC2 (FEAT_ASRC1+1) +/* asynchronous sample-rate-converter for the multimedia player */ +#define FEAT_ASRC3 (FEAT_ASRC2+1) +/* asynchronous sample-rate-converter for the echo reference */ +#define FEAT_ASRC4 (FEAT_ASRC3+1) +/* mixer of the headset and earphone path */ +#define FEAT_MIXDL1 (FEAT_ASRC4+1) +/* mixer of the hands-free path */ +#define FEAT_MIXDL2 (FEAT_MIXDL1+1) +/* mixer for audio being sent on the voice_ul path */ +#define FEAT_MIXAUDUL (FEAT_MIXDL2+1) +/* mixer for voice communication recording */ +#define FEAT_MIXVXREC (FEAT_MIXAUDUL+1) +/* mixer for side-tone */ +#define FEAT_MIXSDT (FEAT_MIXVXREC+1) +/* mixer for echo reference */ +#define FEAT_MIXECHO (FEAT_MIXSDT+1) +/* router of the uplink path */ +#define FEAT_UPROUTE (FEAT_MIXECHO+1) +/* all gains */ +#define FEAT_GAINS (FEAT_UPROUTE+1) +#define FEAT_GAINS_DMIC1 (FEAT_GAINS+1) +#define FEAT_GAINS_DMIC2 (FEAT_GAINS_DMIC1+1) +#define FEAT_GAINS_DMIC3 (FEAT_GAINS_DMIC2+1) +#define FEAT_GAINS_AMIC (FEAT_GAINS_DMIC3+1) +#define FEAT_GAINS_SPLIT (FEAT_GAINS_AMIC+1) +#define FEAT_GAINS_DL1 (FEAT_GAINS_SPLIT+1) +#define FEAT_GAINS_DL2 (FEAT_GAINS_DL1+1) +#define FEAT_GAIN_BTUL (FEAT_GAINS_DL2+1) +/* sequencing queue of micro tasks */ +#define FEAT_SEQ (FEAT_GAIN_BTUL+1) +/* Phoenix control queue through McPDM */ +#define FEAT_CTL (FEAT_SEQ+1) +/* list of features of the firmware -------------------------------*/ +#define MAXNBFEATURE FEAT_CTL +/* abe_equ_id */ +/* equalizer downlink path headset + earphone */ +#define EQ1 FEAT_EQ1 +/* equalizer downlink path integrated handsfree LEFT */ +#define EQ2L FEAT_EQ2L +#define EQ2R FEAT_EQ2R +/* equalizer downlink path side-tone */ +#define EQSDT FEAT_EQSDT +#define EQAMIC FEAT_EQAMIC +#define EQDMIC FEAT_EQDMIC +/* abe_aps_id */ +/* Acoustic protection for headset */ +#define APS1 FEAT_APS1 +#define APS2L FEAT_APS2 +#define APS2R FEAT_APS3 +/* abe_asrc_id */ +/* asynchronous sample-rate-converter for the downlink voice path */ +#define ASRC1 FEAT_ASRC1 +/* asynchronous sample-rate-converter for the uplink voice path */ +#define ASRC2 FEAT_ASRC2 +/* asynchronous sample-rate-converter for the multimedia player */ +#define ASRC3 FEAT_ASRC3 +/* asynchronous sample-rate-converter for the voice uplink echo_reference */ +#define ASRC4 FEAT_ASRC4 +/* abe_mixer_id */ +#define MIXDL1 FEAT_MIXDL1 +#define MIXDL2 FEAT_MIXDL2 +#define MIXSDT FEAT_MIXSDT +#define MIXECHO FEAT_MIXECHO +#define MIXAUDUL FEAT_MIXAUDUL +#define MIXVXREC FEAT_MIXVXREC +/* abe_router_id */ +/* there is only one router up to now */ +#define UPROUTE FEAT_UPROUTE +/* + * gain controls + */ +#define GAIN_LEFT_OFFSET 0 +#define GAIN_RIGHT_OFFSET 1 +/* + * GAIN IDs + */ +#define GAINS_DMIC1 FEAT_GAINS_DMIC1 +#define GAINS_DMIC2 FEAT_GAINS_DMIC2 +#define GAINS_DMIC3 FEAT_GAINS_DMIC3 +#define GAINS_AMIC FEAT_GAINS_AMIC +#define GAINS_SPLIT FEAT_GAINS_SPLIT +#define GAINS_DL1 FEAT_GAINS_DL1 +#define GAINS_DL2 FEAT_GAINS_DL2 +#define GAINS_BTUL FEAT_GAIN_BTUL +/* + * ABE CONST AREA FOR PARAMETERS TRANSLATION + */ +#define sizeof_alpha_iir_table 61 +#define sizeof_beta_iir_table 61 +#define GAIN_MAXIMUM 3000L +#define GAIN_24dB 2400L +#define GAIN_18dB 1800L +#define GAIN_12dB 1200L +#define GAIN_6dB 600L +/* default gain = 1 */ +#define GAIN_0dB 0L +#define GAIN_M6dB -600L +#define GAIN_M12dB -1200L +#define GAIN_M18dB -1800L +#define GAIN_M24dB -2400L +#define GAIN_M30dB -3000L +#define GAIN_M40dB -4000L +#define GAIN_M50dB -5000L +/* muted gain = -120 decibels */ +#define MUTE_GAIN -12000L +#define GAIN_TOOLOW -13000L +#define GAIN_MUTE MUTE_GAIN +#define RAMP_MINLENGTH 3L +/* ramp_t is in milli- seconds */ +#define RAMP_0MS 0L +#define RAMP_1MS 1L +#define RAMP_2MS 2L +#define RAMP_5MS 5L +#define RAMP_10MS 10L +#define RAMP_20MS 20L +#define RAMP_50MS 50L +#define RAMP_100MS 100L +#define RAMP_200MS 200L +#define RAMP_500MS 500L +#define RAMP_1000MS 1000L +#define RAMP_MAXLENGTH 10000L +/* for abe_translate_gain_format */ +#define LINABE_TO_DECIBELS 1 +#define DECIBELS_TO_LINABE 2 +/* for abe_translate_ramp_format */ +#define IIRABE_TO_MICROS 1 +#define MICROS_TO_IIABE 2 +/* + * EVENT GENERATORS - abe_event_id + */ +#define EVENT_TIMER 0 +#define EVENT_44100 1 +/* + * DMA requests + */ +/*Internal connection doesn't connect at ABE boundary */ +#define External_DMA_0 0 +/*Transmit request digital microphone */ +#define DMIC_DMA_REQ 1 +/*Multichannel PDM downlink */ +#define McPDM_DMA_DL 2 +/*Multichannel PDM uplink */ +#define McPDM_DMA_UP 3 +/*MCBSP module 1 - transmit request */ +#define MCBSP1_DMA_TX 4 +/*MCBSP module 1 - receive request */ +#define MCBSP1_DMA_RX 5 +/*MCBSP module 2 - transmit request */ +#define MCBSP2_DMA_TX 6 +/*MCBSP module 2 - receive request */ +#define MCBSP2_DMA_RX 7 +/*MCBSP module 3 - transmit request */ +#define MCBSP3_DMA_TX 8 +/*MCBSP module 3 - receive request */ +#define MCBSP3_DMA_RX 9 +/* + * SERIAL PORTS IDs - abe_mcbsp_id + */ +#define MCBSP1_TX MCBSP1_DMA_TX +#define MCBSP1_RX MCBSP1_DMA_RX +#define MCBSP2_TX MCBSP2_DMA_TX +#define MCBSP2_RX MCBSP2_DMA_RX +#define MCBSP3_TX MCBSP3_DMA_TX +#define MCBSP3_RX MCBSP3_DMA_RX + +#define PING_PONG_WITH_MCU_IRQ 1 +#define PING_PONG_WITH_DSP_IRQ 2 + +/* + Mixer ID Input port ID Comments + DL1_MIXER 0 MMDL path + 1 MMUL2 path + 2 VXDL path + 3 TONES path + SDT_MIXER 0 Uplink path + 1 Downlink path + ECHO_MIXER 0 DL1_MIXER path + 1 DL2_MIXER path + AUDUL_MIXER 0 TONES_DL path + 1 Uplink path + 2 MM_DL path + VXREC_MIXER 0 TONES_DL path + 1 VX_DL path + 2 MM_DL path + 3 VX_UL path +*/ +#define MIX_VXUL_INPUT_MM_DL 0 +#define MIX_VXUL_INPUT_TONES 1 +#define MIX_VXUL_INPUT_VX_UL 2 +#define MIX_VXUL_INPUT_VX_DL 3 +#define MIX_DL1_INPUT_MM_DL 0 +#define MIX_DL1_INPUT_MM_UL2 1 +#define MIX_DL1_INPUT_VX_DL 2 +#define MIX_DL1_INPUT_TONES 3 +#define MIX_DL2_INPUT_MM_DL 0 +#define MIX_DL2_INPUT_MM_UL2 1 +#define MIX_DL2_INPUT_VX_DL 2 +#define MIX_DL2_INPUT_TONES 3 +#define MIX_SDT_INPUT_UP_MIXER 0 +#define MIX_SDT_INPUT_DL1_MIXER 1 +#define MIX_AUDUL_INPUT_MM_DL 0 +#define MIX_AUDUL_INPUT_TONES 1 +#define MIX_AUDUL_INPUT_UPLINK 2 +#define MIX_AUDUL_INPUT_VX_DL 3 +#define MIX_VXREC_INPUT_MM_DL 0 +#define MIX_VXREC_INPUT_TONES 1 +#define MIX_VXREC_INPUT_VX_UL 2 +#define MIX_VXREC_INPUT_VX_DL 3 +#define MIX_ECHO_DL1 0 +#define MIX_ECHO_DL2 1 +/* nb of samples to route */ +#define NBROUTE_UL 16 +/* 10 routing tables max */ +#define NBROUTE_CONFIG_MAX 10 +/* 5 pre-computed routing tables */ +#define NBROUTE_CONFIG 6 +/* AMIC on VX_UL */ +#define UPROUTE_CONFIG_AMIC 0 +/* DMIC first pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC1 1 +/* DMIC second pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC2 2 +/* DMIC last pair on VX_UL */ +#define UPROUTE_CONFIG_DMIC3 3 +/* BT_UL on VX_UL */ +#define UPROUTE_CONFIG_BT 4 +/* ECHO_REF on MM_UL2 */ +#define UPROUTE_ECHO_MMUL2 5 + +/* + * DMA_T + * + * dma structure for easing programming + */ +typedef struct { + /* OCP L3 pointer to the first address of the */ + void *data; + /* destination buffer (either DMA or Ping-Pong read/write pointers). */ + /* address L3 when addressing the DMEM buffer instead of CBPr */ + void *l3_dmem; + /* address L3 translated to L4 the ARM memory space */ + void *l4_dmem; + /* number of iterations for the DMA data moves. */ + u32 iter; +} abe_dma_t; +typedef u32 abe_dbg_t; +/* + * ROUTER_T + * + * table of indexes in unsigned bytes + */ +typedef u16 abe_router_t; +/* + * DATA_FORMAT_T + * + * used in port declaration + */ +typedef struct { + /* Sampling frequency of the stream */ + u32 f; + /* Sample format type */ + u32 samp_format; +} abe_data_format_t; +/* + * PORT_PROTOCOL_T + * + * port declaration + */ +typedef struct { + /* Direction=0 means input from AESS point of view */ + u32 direction; + /* Protocol type (switch) during the data transfers */ + u32 protocol_switch; + union { + /* Slimbus peripheral connected to ATC */ + struct { + /* Address of ATC Slimbus descriptor's index */ + u32 desc_addr1; + /* DMEM address 1 in bytes */ + u32 buf_addr1; + /* DMEM buffer size size in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + /* Second ATC index for SlimBus reception (or NULL) */ + u32 desc_addr2; + /* DMEM address 2 in bytes */ + u32 buf_addr2; + } prot_slimbus; + /* McBSP/McASP peripheral connected to ATC */ + struct { + u32 desc_addr; + /* Address of ATC McBSP/McASP descriptor's in bytes */ + u32 buf_addr; + /* DMEM address in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + } prot_serial; + /* DMIC peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* Number of activated DMIC */ + u32 nbchan; + } prot_dmic; + /* McPDMDL peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM size in bytes */ + u32 buf_size; + /* Control allowed on McPDM DL */ + u32 control; + } prot_mcpdmdl; + /* McPDMUL peripheral connected to ATC */ + struct { + /* DMEM address size in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + } prot_mcpdmul; + /* Ping-Pong interface to the Host using cache-flush */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM size in bytes for each ping and pong buffers */ + u32 buf_size; + /* IRQ address (either DMA (0) MCU (1) or DSP(2)) */ + u32 irq_addr; + /* IRQ data content loaded in the AESS IRQ register */ + u32 irq_data; + /* Call-back function upon IRQ reception */ + u32 callback; + } prot_pingpong; + /* DMAreq line to CBPr */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer address in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } prot_dmareq; + /* Circular buffer - direct addressing to DMEM */ + struct { + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } prot_circular_buffer; + } p; +} abe_port_protocol_t; + +/* + * EQU_T + * + * coefficients of the equalizer + */ +/* 24 Q6.26 coefficients */ +#define NBEQ1 25 +/* 2x12 Q6.26 coefficients */ +#define NBEQ2 13 + +typedef struct { + /* type of filter */ + u32 equ_type; + /* filter length */ + u32 equ_length; + union { + /* parameters are the direct and recursive coefficients in */ + /* Q6.26 integer fixed-point format. */ + s32 type1[NBEQ1]; + struct { + /* center frequency of the band [Hz] */ + s32 freq[NBEQ2]; + /* gain of each band. [dB] */ + s32 gain[NBEQ2]; + /* Q factor of this band [dB] */ + s32 q[NBEQ2]; + } type2; + } coef; + s32 equ_param3; +} abe_equ_t; + + +/* subroutine with no parameter */ +typedef void (*abe_subroutine0) (void); +/* subroutine with one parameter */ +typedef void (*abe_subroutine1) (u32); +typedef void (*abe_subroutine2) (u32, u32); +typedef void (*abe_subroutine3) (u32, u32, u32); +typedef void (*abe_subroutine4) (u32, u32, u32, u32); + + +extern u32 abe_irq_pingpong_player_id; + + +void abe_init_mem(void __iomem **_io_base); +u32 abe_reset_hal(void); +u32 abe_load_fw(void); +u32 abe_reload_fw(void); +u32 abe_wakeup(void); +u32 abe_irq_processing(void); +u32 abe_clear_irq(void); +u32 abe_disable_irq(void); +u32 abe_write_event_generator(u32 e); +u32 abe_stop_event_generator(void); +u32 abe_connect_debug_trace(abe_dma_t *dma2); +u32 abe_set_debug_trace(abe_dbg_t debug); +u32 abe_set_ping_pong_buffer(u32 port, u32 n_bytes); +u32 abe_read_next_ping_pong_buffer(u32 port, u32 *p, u32 *n); +u32 abe_init_ping_pong_buffer(u32 id, u32 size_bytes, u32 n_buffers, + u32 *p); +u32 abe_read_offset_from_ping_buffer(u32 id, u32 *n); +u32 abe_write_equalizer(u32 id, abe_equ_t *param); +u32 abe_disable_gain(u32 id, u32 p); +u32 abe_enable_gain(u32 id, u32 p); +u32 abe_mute_gain(u32 id, u32 p); +u32 abe_unmute_gain(u32 id, u32 p); +u32 abe_write_gain(u32 id, s32 f_g, u32 ramp, u32 p); +u32 abe_write_mixer(u32 id, s32 f_g, u32 f_ramp, u32 p); +u32 abe_read_gain(u32 id, u32 *f_g, u32 p); +u32 abe_read_mixer(u32 id, u32 *f_g, u32 p); +u32 abe_set_router_configuration(u32 id, u32 k, u32 *param); +u32 abe_set_opp_processing(u32 opp); +u32 abe_disable_data_transfer(u32 id); +u32 abe_enable_data_transfer(u32 id); +u32 abe_connect_cbpr_dmareq_port(u32 id, abe_data_format_t *f, u32 d, + abe_dma_t *returned_dma_t); +u32 abe_connect_irq_ping_pong_port(u32 id, abe_data_format_t *f, + u32 subroutine_id, u32 size, + u32 *sink, u32 dsp_mcu_flag); +u32 abe_connect_serial_port(u32 id, abe_data_format_t *f, + u32 mcbsp_id); +u32 abe_read_port_address(u32 port, abe_dma_t *dma2); +void abe_add_subroutine(u32 *id, abe_subroutine2 f, u32 nparam, u32 *params); +u32 abe_read_next_ping_pong_buffer(u32 port, u32 *p, u32 *n); +u32 abe_check_activity(void); +void abe_add_subroutine(u32 *id, abe_subroutine2 f, + u32 nparam, u32 *params); + +u32 abe_plug_subroutine(u32 *id, abe_subroutine2 f, u32 n, + u32 *params); + +#endif /* _ABE_MAIN_H_ */ diff --git a/sound/soc/omap/abe/abe_mem.h b/sound/soc/omap/abe/abe_mem.h new file mode 100644 index 0000000..683968e --- /dev/null +++ b/sound/soc/omap/abe/abe_mem.h @@ -0,0 +1,99 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_MEM_H_ +#define _ABE_MEM_H_ + +#define OMAP_ABE_DMEM 0 +#define OMAP_ABE_CMEM 1 +#define OMAP_ABE_SMEM 2 +#define OMAP_ABE_PMEM 3 +#define OMAP_ABE_AESS 4 + +/* Distinction between Read and Write from/to ABE memory + * is useful for simulation tool */ +static inline void omap_abe_mem_write(struct omap_abe *abe, int bank, + u32 offset, u32 *src, size_t bytes) +{ + memcpy((abe->io_base[bank] + offset), src, bytes); +} + +static inline void omap_abe_mem_read(struct omap_abe *abe, int bank, + u32 offset, u32 *dest, size_t bytes) +{ + memcpy(dest, (abe->io_base[bank] + offset), bytes); +} + +static inline u32 omap_abe_reg_readl(struct omap_abe *abe, u32 offset) +{ + return __raw_readl(abe->io_base[OMAP_ABE_AESS] + offset); +} + +static inline void omap_abe_reg_writel(struct omap_abe *abe, + u32 offset, u32 val) +{ + __raw_writel(val, (abe->io_base[OMAP_ABE_AESS] + offset)); +} + +static inline void *omap_abe_reset_mem(struct omap_abe *abe, int bank, + u32 offset, size_t bytes) +{ + return memset(abe->io_base[bank] + offset, 0, bytes); +} + +#endif /*_ABE_MEM_H_*/ diff --git a/sound/soc/omap/abe/abe_port.c b/sound/soc/omap/abe/abe_port.c new file mode 100644 index 0000000..069791a --- /dev/null +++ b/sound/soc/omap/abe/abe_port.c @@ -0,0 +1,1581 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/err.h> +#include <linux/slab.h> + +#include "abe_legacy.h" +#include "abe_port.h" +#include "abe_dbg.h" +#include "abe_mem.h" +#include "abe_gain.h" + +/** + * abe_clean_temporay buffers + * + * clear temporary buffers + */ +void omap_abe_clean_temporary_buffers(struct omap_abe *abe, u32 id) +{ + switch (id) { + case OMAP_ABE_DMIC_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_DMIC_UL_FIFO_ADDR, + OMAP_ABE_D_DMIC_UL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_DMIC0_96_48_DATA_ADDR, + OMAP_ABE_S_DMIC0_96_48_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_DMIC1_96_48_DATA_ADDR, + OMAP_ABE_S_DMIC1_96_48_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_DMIC2_96_48_DATA_ADDR, + OMAP_ABE_S_DMIC2_96_48_DATA_SIZE); + /* reset working values of the gain, target gain is preserved */ + omap_abe_reset_gain_mixer(abe, GAINS_DMIC1, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DMIC1, GAIN_RIGHT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DMIC2, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DMIC2, GAIN_RIGHT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DMIC3, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DMIC3, GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_PDM_UL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MCPDM_UL_FIFO_ADDR, + OMAP_ABE_D_MCPDM_UL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_AMIC_96_48_DATA_ADDR, + OMAP_ABE_S_AMIC_96_48_DATA_SIZE); + /* reset working values of the gain, target gain is preserved */ + omap_abe_reset_gain_mixer(abe, GAINS_AMIC, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_AMIC, GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_BT_VX_UL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_BT_UL_FIFO_ADDR, + OMAP_ABE_D_BT_UL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_UL_ADDR, + OMAP_ABE_S_BT_UL_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_UL_8_48_HP_DATA_ADDR, + OMAP_ABE_S_BT_UL_8_48_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_UL_8_48_LP_DATA_ADDR, + OMAP_ABE_S_BT_UL_8_48_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_UL_16_48_HP_DATA_ADDR, + OMAP_ABE_S_BT_UL_16_48_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_UL_16_48_LP_DATA_ADDR, + OMAP_ABE_S_BT_UL_16_48_LP_DATA_SIZE); + /* reset working values of the gain, target gain is preserved */ + omap_abe_reset_gain_mixer(abe, GAINS_BTUL, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_BTUL, GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_MM_UL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MM_UL_FIFO_ADDR, + OMAP_ABE_D_MM_UL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_MM_UL_ADDR, + OMAP_ABE_S_MM_UL_SIZE); + break; + case OMAP_ABE_MM_UL2_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MM_UL2_FIFO_ADDR, + OMAP_ABE_D_MM_UL2_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_MM_UL2_ADDR, + OMAP_ABE_S_MM_UL2_SIZE); + break; + case OMAP_ABE_VX_UL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_VX_UL_FIFO_ADDR, + OMAP_ABE_D_VX_UL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_UL_ADDR, + OMAP_ABE_S_VX_UL_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_UL_48_8_HP_DATA_ADDR, + OMAP_ABE_S_VX_UL_48_8_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_UL_48_8_LP_DATA_ADDR, + OMAP_ABE_S_VX_UL_48_8_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_UL_48_16_HP_DATA_ADDR, + OMAP_ABE_S_VX_UL_48_16_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_UL_48_16_LP_DATA_ADDR, + OMAP_ABE_S_VX_UL_48_16_LP_DATA_SIZE); + omap_abe_reset_gain_mixer(abe, MIXAUDUL, MIX_AUDUL_INPUT_UPLINK); + break; + case OMAP_ABE_MM_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MM_DL_FIFO_ADDR, + OMAP_ABE_D_MM_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_MM_DL_ADDR, + OMAP_ABE_S_MM_DL_SIZE); + omap_abe_reset_gain_mixer(abe, MIXDL1, MIX_DL1_INPUT_MM_DL); + omap_abe_reset_gain_mixer(abe, MIXDL2, MIX_DL2_INPUT_MM_DL); + break; + case OMAP_ABE_VX_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_VX_DL_FIFO_ADDR, + OMAP_ABE_D_VX_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_DL_ADDR, + OMAP_ABE_S_VX_DL_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_DL_8_48_HP_DATA_ADDR, + OMAP_ABE_S_VX_DL_8_48_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_DL_8_48_LP_DATA_ADDR, + OMAP_ABE_S_VX_DL_8_48_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_DL_16_48_HP_DATA_ADDR, + OMAP_ABE_S_VX_DL_16_48_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VX_DL_16_48_LP_DATA_ADDR, + OMAP_ABE_S_VX_DL_16_48_LP_DATA_SIZE); + omap_abe_reset_gain_mixer(abe, MIXDL1, MIX_DL1_INPUT_VX_DL); + omap_abe_reset_gain_mixer(abe, MIXDL2, MIX_DL2_INPUT_VX_DL); + break; + case OMAP_ABE_TONES_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_TONES_DL_FIFO_ADDR, + OMAP_ABE_D_TONES_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_TONES_ADDR, + OMAP_ABE_S_TONES_SIZE); + omap_abe_reset_gain_mixer(abe, MIXDL1, MIX_DL1_INPUT_TONES); + omap_abe_reset_gain_mixer(abe, MIXDL2, MIX_DL2_INPUT_TONES); + break; + case OMAP_ABE_VIB_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_VIB_DL_FIFO_ADDR, + OMAP_ABE_D_VIB_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_VIBRA_ADDR, + OMAP_ABE_S_VIBRA_SIZE); + break; + case OMAP_ABE_BT_VX_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_BT_DL_FIFO_ADDR, + OMAP_ABE_D_BT_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_DL_ADDR, + OMAP_ABE_S_BT_DL_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_DL_48_8_HP_DATA_ADDR, + OMAP_ABE_S_BT_DL_48_8_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_DL_48_8_LP_DATA_ADDR, + OMAP_ABE_S_BT_DL_48_8_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_DL_48_16_HP_DATA_ADDR, + OMAP_ABE_S_BT_DL_48_16_HP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_BT_DL_48_16_LP_DATA_ADDR, + OMAP_ABE_S_BT_DL_48_16_LP_DATA_SIZE); + break; + case OMAP_ABE_PDM_DL_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MCPDM_DL_FIFO_ADDR, + OMAP_ABE_D_MCPDM_DL_FIFO_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_DL2_M_LR_EQ_DATA_ADDR, + OMAP_ABE_S_DL2_M_LR_EQ_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_DL1_M_EQ_DATA_ADDR, + OMAP_ABE_S_DL1_M_EQ_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_EARP_48_96_LP_DATA_ADDR, + OMAP_ABE_S_EARP_48_96_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_IHF_48_96_LP_DATA_ADDR, + OMAP_ABE_S_IHF_48_96_LP_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_APS_DL1_EQ_DATA_ADDR, + OMAP_ABE_S_APS_DL1_EQ_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_APS_DL2_EQ_DATA_ADDR, + OMAP_ABE_S_APS_DL2_EQ_DATA_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_APS_DL2_L_IIRMEM1_ADDR, + OMAP_ABE_S_APS_DL2_L_IIRMEM1_SIZE); + omap_abe_reset_mem(abe, OMAP_ABE_SMEM, + OMAP_ABE_S_APS_DL2_R_IIRMEM1_ADDR, + OMAP_ABE_S_APS_DL2_R_IIRMEM1_SIZE); + omap_abe_reset_gain_mixer(abe, GAINS_DL1, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DL1, GAIN_RIGHT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DL2, GAIN_LEFT_OFFSET); + omap_abe_reset_gain_mixer(abe, GAINS_DL2, GAIN_RIGHT_OFFSET); + omap_abe_reset_gain_mixer(abe, MIXSDT, MIX_SDT_INPUT_UP_MIXER); + omap_abe_reset_gain_mixer(abe, MIXSDT, MIX_SDT_INPUT_DL1_MIXER); + break; + case OMAP_ABE_MM_EXT_OUT_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MM_EXT_OUT_FIFO_ADDR, + OMAP_ABE_D_MM_EXT_OUT_FIFO_SIZE); + break; + case OMAP_ABE_MM_EXT_IN_PORT: + omap_abe_reset_mem(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MM_EXT_IN_FIFO_ADDR, + OMAP_ABE_D_MM_EXT_IN_FIFO_SIZE); + break; + } +} + +/** + * omap_abe_disable_enable_dma_request + * Parameter: + * Operations: + * Return value: + */ +void omap_abe_disable_enable_dma_request(struct omap_abe *abe, u32 id, + u32 on_off) +{ + u8 desc_third_word[4], irq_dmareq_field; + u32 sio_desc_address; + u32 struct_offset; + struct ABE_SIODescriptor sio_desc; + struct ABE_SPingPongDescriptor desc_pp; + + if (abe_port[id].protocol.protocol_switch == PINGPONG_PORT_PROT) { + irq_dmareq_field = + (u8) (on_off * + abe_port[id].protocol.p.prot_pingpong.irq_data); + sio_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR; + struct_offset = (u32) &(desc_pp.data_size) - (u32) &(desc_pp); + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + sio_desc_address + struct_offset, + (u32 *) desc_third_word, 4); + desc_third_word[2] = irq_dmareq_field; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + sio_desc_address + struct_offset, + (u32 *) desc_third_word, 4); + } else { + /* serial interface: sync ATC with Firmware activity */ + sio_desc_address = + OMAP_ABE_D_IODESCR_ADDR + + (id * sizeof(struct ABE_SIODescriptor)); + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + sio_desc_address, (u32 *) &sio_desc, + sizeof(sio_desc)); + if (on_off) { + sio_desc.atc_irq_data = + (u8) abe_port[id].protocol.p.prot_dmareq. + dma_data; + sio_desc.on_off = 0x80; + } else { + sio_desc.atc_irq_data = 0; + sio_desc.on_off = 0; + } + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + sio_desc_address, (u32 *) &sio_desc, + sizeof(sio_desc)); + } + +} + +/** + * omap_abe_enable_dma_request + * + * Parameter: + * Operations: + * Return value: + * + */ +void omap_abe_enable_dma_request(struct omap_abe *abe, u32 id) +{ + omap_abe_disable_enable_dma_request(abe, id, 1); +} + +/** + * omap_abe_disable_dma_request + * + * Parameter: + * Operations: + * Return value: + * + */ +void omap_abe_disable_dma_request(struct omap_abe *abe, u32 id) +{ + omap_abe_disable_enable_dma_request(abe, id, 0); +} + +/** + * abe_init_atc + * @id: ABE port ID + * + * load the DMEM ATC/AESS descriptors + */ +void omap_abe_init_atc(struct omap_abe *abe, u32 id) +{ + u8 iter; + s32 datasize; + struct omap_abe_atc_desc atc_desc; + +#define JITTER_MARGIN 4 + /* load default values of the descriptor */ + atc_desc.rdpt = 0; + atc_desc.wrpt = 0; + atc_desc.irqdest = 0; + atc_desc.cberr = 0; + atc_desc.desen = 0; + atc_desc.nw = 0; + atc_desc.reserved0 = 0; + atc_desc.reserved1 = 0; + atc_desc.reserved2 = 0; + atc_desc.srcid = 0; + atc_desc.destid = 0; + atc_desc.badd = 0; + atc_desc.iter = 0; + atc_desc.cbsize = 0; + datasize = abe_dma_port_iter_factor(&((abe_port[id]).format)); + iter = (u8) abe_dma_port_iteration(&((abe_port[id]).format)); + /* if the ATC FIFO is too small there will be two ABE firmware + utasks to do the copy this happems on DMIC and MCPDMDL */ + /* VXDL_8kMono = 4 = 2 + 2x1 */ + /* VXDL_16kstereo = 12 = 8 + 2x2 */ + /* MM_DL_1616 = 14 = 12 + 2x1 */ + /* DMIC = 84 = 72 + 2x6 */ + /* VXUL_8kMono = 2 */ + /* VXUL_16kstereo = 4 */ + /* MM_UL2_Stereo = 4 */ + /* PDMDL = 12 */ + /* IN from AESS point of view */ + if (abe_port[id].protocol.direction == ABE_ATC_DIRECTION_IN) + if (iter + 2 * datasize > 126) + atc_desc.wrpt = (iter >> 1) + + ((JITTER_MARGIN-1) * datasize); + else + atc_desc.wrpt = iter + ((JITTER_MARGIN-1) * datasize); + else + atc_desc.wrpt = 0 + ((JITTER_MARGIN+1) * datasize); + switch ((abe_port[id]).protocol.protocol_switch) { + case SLIMBUS_PORT_PROT: + atc_desc.cbdir = (abe_port[id]).protocol.direction; + atc_desc.cbsize = + (abe_port[id]).protocol.p.prot_slimbus.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_slimbus.buf_addr1) >> 4; + atc_desc.iter = (abe_port[id]).protocol.p.prot_slimbus.iter; + atc_desc.srcid = + abe_atc_srcid[(abe_port[id]).protocol.p.prot_slimbus. + desc_addr1 >> 3]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_slimbus. + desc_addr1, (u32 *) &atc_desc, sizeof(atc_desc)); + atc_desc.badd = + (abe_port[id]).protocol.p.prot_slimbus.buf_addr2; + atc_desc.srcid = + abe_atc_srcid[(abe_port[id]).protocol.p.prot_slimbus. + desc_addr2 >> 3]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_slimbus. + desc_addr2, (u32 *) &atc_desc, sizeof(atc_desc)); + break; + case SERIAL_PORT_PROT: + atc_desc.cbdir = (abe_port[id]).protocol.direction; + atc_desc.cbsize = + (abe_port[id]).protocol.p.prot_serial.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_serial.buf_addr) >> 4; + atc_desc.iter = (abe_port[id]).protocol.p.prot_serial.iter; + atc_desc.srcid = + abe_atc_srcid[(abe_port[id]).protocol.p.prot_serial. + desc_addr >> 3]; + atc_desc.destid = + abe_atc_dstid[(abe_port[id]).protocol.p.prot_serial. + desc_addr >> 3]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_serial.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + break; + case DMIC_PORT_PROT: + atc_desc.cbdir = ABE_ATC_DIRECTION_IN; + atc_desc.cbsize = (abe_port[id]).protocol.p.prot_dmic.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_dmic.buf_addr) >> 4; + atc_desc.iter = DMIC_ITER; + atc_desc.srcid = abe_atc_srcid[ABE_ATC_DMIC_DMA_REQ]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (ABE_ATC_DMIC_DMA_REQ*ATC_SIZE), + (u32 *) &atc_desc, sizeof(atc_desc)); + break; + case MCPDMDL_PORT_PROT: + atc_desc.cbdir = ABE_ATC_DIRECTION_OUT; + atc_desc.cbsize = + (abe_port[id]).protocol.p.prot_mcpdmdl.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_mcpdmdl.buf_addr) >> 4; + atc_desc.iter = MCPDM_DL_ITER; + atc_desc.destid = abe_atc_dstid[ABE_ATC_MCPDMDL_DMA_REQ]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (ABE_ATC_MCPDMDL_DMA_REQ*ATC_SIZE), + (u32 *) &atc_desc, sizeof(atc_desc)); + break; + case MCPDMUL_PORT_PROT: + atc_desc.cbdir = ABE_ATC_DIRECTION_IN; + atc_desc.cbsize = + (abe_port[id]).protocol.p.prot_mcpdmul.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_mcpdmul.buf_addr) >> 4; + atc_desc.iter = MCPDM_UL_ITER; + atc_desc.srcid = abe_atc_srcid[ABE_ATC_MCPDMUL_DMA_REQ]; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (ABE_ATC_MCPDMUL_DMA_REQ*ATC_SIZE), + (u32 *) &atc_desc, sizeof(atc_desc)); + break; + case PINGPONG_PORT_PROT: + /* software protocol, nothing to do on ATC */ + break; + case DMAREQ_PORT_PROT: + atc_desc.cbdir = (abe_port[id]).protocol.direction; + atc_desc.cbsize = + (abe_port[id]).protocol.p.prot_dmareq.buf_size; + atc_desc.badd = + ((abe_port[id]).protocol.p.prot_dmareq.buf_addr) >> 4; + /* CBPr needs ITER=1. + It is the job of eDMA to do the iterations */ + atc_desc.iter = 1; + /* input from ABE point of view */ + if (abe_port[id].protocol.direction == ABE_ATC_DIRECTION_IN) { + /* atc_atc_desc.rdpt = 127; */ + /* atc_atc_desc.wrpt = 0; */ + atc_desc.srcid = abe_atc_srcid + [(abe_port[id]).protocol.p.prot_dmareq. + desc_addr >> 3]; + } else { + /* atc_atc_desc.rdpt = 0; */ + /* atc_atc_desc.wrpt = 127; */ + atc_desc.destid = abe_atc_dstid + [(abe_port[id]).protocol.p.prot_dmareq. + desc_addr >> 3]; + } + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_dmareq.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + break; + } +} + +/** + * omap_abe_enable_pp_io_task + * @id: port_id + * + * + */ +void omap_abe_enable_pp_io_task(struct omap_abe *abe, u32 id) +{ + if (OMAP_ABE_MM_DL_PORT == id) { + /* MM_DL managed in ping-pong */ + abe->MultiFrame[TASK_IO_MM_DL_SLT][TASK_IO_MM_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_IO_PING_PONG); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MULTIFRAME_ADDR, (u32 *) abe->MultiFrame, + sizeof(abe->MultiFrame)); + } else { + /* ping_pong is only supported on MM_DL */ + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } +} +/** + * omap_abe_disable_pp_io_task + * @id: port_id + * + * + */ +void omap_abe_disable_pp_io_task(struct omap_abe *abe, u32 id) +{ + if (OMAP_ABE_MM_DL_PORT == id) { + /* MM_DL managed in ping-pong */ + abe->MultiFrame[TASK_IO_MM_DL_SLT][TASK_IO_MM_DL_IDX] = 0; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MULTIFRAME_ADDR, (u32 *) abe->MultiFrame, + sizeof(abe->MultiFrame)); + } else { + /* ping_pong is only supported on MM_DL */ + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } +} + +/** + * omap_abe_disable_data_transfer + * @id: ABE port id + * + * disables the ATC descriptor and stop IO/port activities + * disable the IO task (@f = 0) + * clear ATC DMEM buffer, ATC enabled + */ +int omap_abe_disable_data_transfer(struct omap_abe *abe, u32 id) +{ + + _log(ABE_ID_DISABLE_DATA_TRANSFER, id, 0, 0); + + /* MM_DL managed in ping-pong */ + if (id == OMAP_ABE_MM_DL_PORT) { + if (abe_port[OMAP_ABE_MM_DL_PORT].protocol.protocol_switch == PINGPONG_PORT_PROT) + omap_abe_disable_pp_io_task(abe, OMAP_ABE_MM_DL_PORT); + } + /* local host variable status= "port is running" */ + abe_port[id].status = OMAP_ABE_PORT_ACTIVITY_IDLE; + /* disable DMA requests */ + omap_abe_disable_dma_request(abe, id); + /* disable ATC transfers */ + omap_abe_init_atc(abe, id); + omap_abe_clean_temporary_buffers(abe, id); + /* select the main port based on the desactivation of this port */ + abe_decide_main_port(); + + return 0; +} +EXPORT_SYMBOL(omap_abe_disable_data_transfer); + +/** + * omap_abe_enable_data_transfer + * @ip: ABE port id + * + * enables the ATC descriptor + * reset ATC pointers + * enable the IO task (@f <> 0) + */ +int omap_abe_enable_data_transfer(struct omap_abe *abe, u32 id) +{ + abe_port_protocol_t *protocol; + abe_data_format_t format; + + _log(ABE_ID_ENABLE_DATA_TRANSFER, id, 0, 0); + omap_abe_clean_temporary_buffers(abe, id); + if (id == OMAP_ABE_PDM_UL_PORT) { + /* initializes the ABE ATC descriptors in DMEM - MCPDM_UL */ + protocol = &(abe_port[OMAP_ABE_PDM_UL_PORT].protocol); + format = abe_port[OMAP_ABE_PDM_UL_PORT].format; + omap_abe_init_atc(abe, OMAP_ABE_PDM_UL_PORT); + abe_init_io_tasks(OMAP_ABE_PDM_UL_PORT, &format, protocol); + } + if (id == OMAP_ABE_PDM_DL_PORT) { + /* initializes the ABE ATC descriptors in DMEM - MCPDM_DL */ + protocol = &(abe_port[OMAP_ABE_PDM_DL_PORT].protocol); + format = abe_port[OMAP_ABE_PDM_DL_PORT].format; + omap_abe_init_atc(abe, OMAP_ABE_PDM_DL_PORT); + abe_init_io_tasks(OMAP_ABE_PDM_DL_PORT, &format, protocol); + } + /* MM_DL managed in ping-pong */ + if (id == OMAP_ABE_MM_DL_PORT) { + protocol = &(abe_port[OMAP_ABE_MM_DL_PORT].protocol); + if (protocol->protocol_switch == PINGPONG_PORT_PROT) + omap_abe_enable_pp_io_task(abe, OMAP_ABE_MM_DL_PORT); + } + if (id == OMAP_ABE_DMIC_PORT) { + /* one DMIC port enabled = all DMICs enabled, + * since there is a single DMIC path for all DMICs */ + protocol = &(abe_port[OMAP_ABE_DMIC_PORT].protocol); + format = abe_port[OMAP_ABE_DMIC_PORT].format; + omap_abe_init_atc(abe, OMAP_ABE_DMIC_PORT); + abe_init_io_tasks(OMAP_ABE_DMIC_PORT, &format, protocol); + } + if (id == OMAP_ABE_VX_UL_PORT) { + /* Init VX_UL ASRC and enable its adaptation */ + abe_init_asrc_vx_ul(250); + } + if (id == OMAP_ABE_VX_DL_PORT) { + /* Init VX_DL ASRC and enable its adaptation */ + abe_init_asrc_vx_dl(250); + } + /* local host variable status= "port is running" */ + abe_port[id].status = OMAP_ABE_PORT_ACTIVITY_RUNNING; + /* enable DMA requests */ + omap_abe_enable_dma_request(abe, id); + /* select the main port based on the activation of this new port */ + abe_decide_main_port(); + + return 0; +} +EXPORT_SYMBOL(omap_abe_enable_data_transfer); + +/** + * omap_abe_connect_cbpr_dmareq_port + * @id: port name + * @f: desired data format + * @d: desired dma_request line (0..7) + * @a: returned pointer to the base address of the CBPr register and number of + * samples to exchange during a DMA_request. + * + * enables the data echange between a DMA and the ABE through the + * CBPr registers of AESS. + */ +int omap_abe_connect_cbpr_dmareq_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 d, + abe_dma_t *returned_dma_t) +{ + _log(ABE_ID_CONNECT_CBPR_DMAREQ_PORT, id, f->f, f->samp_format); + + abe_port[id] = ((abe_port_t *) abe_port_init)[id]; + (abe_port[id]).format = (*f); + abe_port[id].protocol.protocol_switch = DMAREQ_PORT_PROT; + abe_port[id].protocol.p.prot_dmareq.iter = abe_dma_port_iteration(f); + abe_port[id].protocol.p.prot_dmareq.dma_addr = ABE_DMASTATUS_RAW; + abe_port[id].protocol.p.prot_dmareq.dma_data = (1 << d); + abe_port[id].status = OMAP_ABE_PORT_INITIALIZED; + /* load the dma_t with physical information from AE memory mapping */ + abe_init_dma_t(id, &((abe_port[id]).protocol)); + /* load the micro-task parameters */ + abe_init_io_tasks(id, &((abe_port[id]).format), + &((abe_port[id]).protocol)); + /* load the ATC descriptors - disabled */ + omap_abe_init_atc(abe, id); + /* return the dma pointer address */ + abe_read_port_address(id, returned_dma_t); + return 0; +} +EXPORT_SYMBOL(omap_abe_connect_cbpr_dmareq_port); + +/** + * omap_abe_connect_irq_ping_pong_port + * @id: port name + * @f: desired data format + * @I: index of the call-back subroutine to call + * @s: half-buffer (ping) size + * @p: returned base address of the first (ping) buffer) + * + * enables the data echanges between a direct access to the DMEM + * memory of ABE using cache flush. On each IRQ activation a subroutine + * registered with "abe_plug_subroutine" will be called. This subroutine + * will generate an amount of samples, send them to DMEM memory and call + * "abe_set_ping_pong_buffer" to notify the new amount of samples in the + * pong buffer. + */ +int omap_abe_connect_irq_ping_pong_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 subroutine_id, u32 size, + u32 *sink, u32 dsp_mcu_flag) +{ + _log(ABE_ID_CONNECT_IRQ_PING_PONG_PORT, id, f->f, f->samp_format); + + /* ping_pong is only supported on MM_DL */ + if (id != OMAP_ABE_MM_DL_PORT) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } + abe_port[id] = ((abe_port_t *) abe_port_init)[id]; + (abe_port[id]).format = (*f); + (abe_port[id]).protocol.protocol_switch = PINGPONG_PORT_PROT; + (abe_port[id]).protocol.p.prot_pingpong.buf_addr = + OMAP_ABE_D_PING_ADDR; + (abe_port[id]).protocol.p.prot_pingpong.buf_size = size; + (abe_port[id]).protocol.p.prot_pingpong.irq_data = (1); + abe_init_ping_pong_buffer(OMAP_ABE_MM_DL_PORT, size, 2, sink); + if (dsp_mcu_flag == PING_PONG_WITH_MCU_IRQ) + (abe_port[id]).protocol.p.prot_pingpong.irq_addr = + ABE_MCU_IRQSTATUS_RAW; + if (dsp_mcu_flag == PING_PONG_WITH_DSP_IRQ) + (abe_port[id]).protocol.p.prot_pingpong.irq_addr = + ABE_DSP_IRQSTATUS_RAW; + abe_port[id].status = OMAP_ABE_PORT_INITIALIZED; + /* load the micro-task parameters */ + abe_init_io_tasks(id, &((abe_port[id]).format), + &((abe_port[id]).protocol)); + /* load the ATC descriptors - disabled */ + omap_abe_init_atc(abe, id); + *sink = (abe_port[id]).protocol.p.prot_pingpong.buf_addr; + return 0; +} +EXPORT_SYMBOL(omap_abe_connect_irq_ping_pong_port); + +/** + * omap_abe_connect_serial_port() + * @id: port name + * @f: data format + * @i: peripheral ID (McBSP #1, #2, #3) + * + * Operations : enables the data echanges between a McBSP and an ATC buffer in + * DMEM. This API is used connect 48kHz McBSP streams to MM_DL and 8/16kHz + * voice streams to VX_UL, VX_DL, BT_VX_UL, BT_VX_DL. It abstracts the + * abe_write_port API. + */ +int omap_abe_connect_serial_port(struct omap_abe *abe, + u32 id, abe_data_format_t *f, + u32 mcbsp_id) +{ + _log(ABE_ID_CONNECT_SERIAL_PORT, id, f->samp_format, mcbsp_id); + + abe_port[id] = ((abe_port_t *) abe_port_init)[id]; + (abe_port[id]).format = (*f); + (abe_port[id]).protocol.protocol_switch = SERIAL_PORT_PROT; + /* McBSP peripheral connected to ATC */ + (abe_port[id]).protocol.p.prot_serial.desc_addr = mcbsp_id*ATC_SIZE; + /* check the iteration of ATC */ + (abe_port[id]).protocol.p.prot_serial.iter = + abe_dma_port_iter_factor(f); + abe_port[id].status = OMAP_ABE_PORT_INITIALIZED; + /* load the micro-task parameters */ + abe_init_io_tasks(id, &((abe_port[id]).format), + &((abe_port[id]).protocol)); + /* load the ATC descriptors - disabled */ + omap_abe_init_atc(abe, id); + + return 0; +} +EXPORT_SYMBOL(omap_abe_connect_serial_port); + +/** + * omap_abe_read_port_address + * @dma: output pointer to the DMA iteration and data destination pointer + * + * This API returns the address of the DMA register used on this audio port. + * Depending on the protocol being used, adds the base address offset L3 + * (DMA) or MPU (ARM) + */ +int omap_abe_read_port_address(struct omap_abe *abe, + u32 port, abe_dma_t *dma2) +{ + abe_dma_t_offset dma1; + u32 protocol_switch; + + _log(ABE_ID_READ_PORT_ADDRESS, port, 0, 0); + + dma1 = (abe_port[port]).dma; + protocol_switch = abe_port[port].protocol.protocol_switch; + switch (protocol_switch) { + case PINGPONG_PORT_PROT: + /* return the base address of the buffer in L3 and L4 spaces */ + (*dma2).data = (void *)(dma1.data + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).l3_dmem = (void *)(dma1.data + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).l4_dmem = (void *)(dma1.data + + ABE_DEFAULT_BASE_ADDRESS_L4 + ABE_DMEM_BASE_OFFSET_MPU); + break; + case DMAREQ_PORT_PROT: + /* return the CBPr(L3), DMEM(L3), DMEM(L4) address */ + (*dma2).data = (void *)(dma1.data + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_ATC_BASE_OFFSET_MPU); + (*dma2).l3_dmem = + (void *)((abe_port[port]).protocol.p.prot_dmareq.buf_addr + + ABE_DEFAULT_BASE_ADDRESS_L3 + ABE_DMEM_BASE_OFFSET_MPU); + (*dma2).l4_dmem = + (void *)((abe_port[port]).protocol.p.prot_dmareq.buf_addr + + ABE_DEFAULT_BASE_ADDRESS_L4 + ABE_DMEM_BASE_OFFSET_MPU); + break; + default: + break; + } + (*dma2).iter = (dma1.iter); + + return 0; +} +EXPORT_SYMBOL(omap_abe_read_port_address); + +/** + * abe_init_dma_t + * @ id: ABE port ID + * @ prot: protocol being used + * + * load the dma_t with physical information from AE memory mapping + */ +void abe_init_dma_t(u32 id, abe_port_protocol_t *prot) +{ + abe_dma_t_offset dma; + u32 idx; + /* default dma_t points to address 0000... */ + dma.data = 0; + dma.iter = 0; + switch (prot->protocol_switch) { + case PINGPONG_PORT_PROT: + for (idx = 0; idx < 32; idx++) { + if (((prot->p).prot_pingpong.irq_data) == + (u32) (1 << idx)) + break; + } + (prot->p).prot_dmareq.desc_addr = + ((CBPr_DMA_RTX0 + idx)*ATC_SIZE); + /* translate byte address/size in DMEM words */ + dma.data = (prot->p).prot_pingpong.buf_addr >> 2; + dma.iter = (prot->p).prot_pingpong.buf_size >> 2; + break; + case DMAREQ_PORT_PROT: + for (idx = 0; idx < 32; idx++) { + if (((prot->p).prot_dmareq.dma_data) == + (u32) (1 << idx)) + break; + } + dma.data = (CIRCULAR_BUFFER_PERIPHERAL_R__0 + (idx << 2)); + dma.iter = (prot->p).prot_dmareq.iter; + (prot->p).prot_dmareq.desc_addr = + ((CBPr_DMA_RTX0 + idx)*ATC_SIZE); + break; + case SLIMBUS_PORT_PROT: + case SERIAL_PORT_PROT: + case DMIC_PORT_PROT: + case MCPDMDL_PORT_PROT: + case MCPDMUL_PORT_PROT: + default: + break; + } + /* upload the dma type */ + abe_port[id].dma = dma; +} + +/** + * abe_enable_atc + * Parameter: + * Operations: + * Return value: + */ +void abe_enable_atc(u32 id) +{ + struct omap_abe_atc_desc atc_desc; + + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_dmareq.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + atc_desc.desen = 1; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_dmareq.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + +} +/** + * abe_disable_atc + * Parameter: + * Operations: + * Return value: + */ +void abe_disable_atc(u32 id) +{ + struct omap_abe_atc_desc atc_desc; + + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_dmareq.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + atc_desc.desen = 0; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + (abe_port[id]).protocol.p.prot_dmareq.desc_addr, + (u32 *) &atc_desc, sizeof(atc_desc)); + +} +/** + * abe_init_io_tasks + * @prot : protocol being used + * + * load the micro-task parameters doing to DMEM <==> SMEM data moves + * + * I/O descriptors input parameters : + * For Read from DMEM usually THR1/THR2 = X+1/X-1 + * For Write to DMEM usually THR1/THR2 = 2/0 + * UP_1/2 =X+1/X-1 + */ +void abe_init_io_tasks(u32 id, abe_data_format_t *format, + abe_port_protocol_t *prot) +{ + u32 x_io, direction, iter_samples, smem1, smem2, smem3, io_sub_id, + io_flag; + u32 copy_func_index, before_func_index, after_func_index; + u32 dmareq_addr, dmareq_field; + u32 sio_desc_address, datasize, iter, nsamp, datasize2, dOppMode32; + u32 atc_ptr_saved, atc_ptr_saved2, copy_func_index1; + u32 copy_func_index2, atc_desc_address1, atc_desc_address2; + struct ABE_SPingPongDescriptor desc_pp; + struct ABE_SIODescriptor sio_desc; + + if (prot->protocol_switch == PINGPONG_PORT_PROT) { + /* ping_pong is only supported on MM_DL */ + if (OMAP_ABE_MM_DL_PORT != id) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_PARAMETER_ERROR); + } + smem1 = smem_mm_dl; + copy_func_index = (u8) abe_dma_port_copy_subroutine_id(id); + dmareq_addr = abe_port[id].protocol.p.prot_pingpong.irq_addr; + dmareq_field = abe_port[id].protocol.p.prot_pingpong.irq_data; + datasize = abe_dma_port_iter_factor(format); + /* number of "samples" either mono or stereo */ + iter = abe_dma_port_iteration(format); + iter_samples = (iter / datasize); + /* load the IO descriptor */ + /* no drift */ + desc_pp.drift_ASRC = 0; + /* no drift */ + desc_pp.drift_io = 0; + desc_pp.hw_ctrl_addr = (u16) dmareq_addr; + desc_pp.copy_func_index = (u8) copy_func_index; + desc_pp.smem_addr = (u8) smem1; + /* DMA req 0 is used for CBPr0 */ + desc_pp.atc_irq_data = (u8) dmareq_field; + /* size of block transfer */ + desc_pp.x_io = (u8) iter_samples; + desc_pp.data_size = (u8) datasize; + /* address comunicated in Bytes */ + desc_pp.workbuff_BaseAddr = + (u16) (abe_base_address_pingpong[1]); + /* size comunicated in XIO sample */ + desc_pp.workbuff_Samples = 0; + desc_pp.nextbuff0_BaseAddr = + (u16) (abe_base_address_pingpong[0]); + desc_pp.nextbuff1_BaseAddr = + (u16) (abe_base_address_pingpong[1]); + if (dmareq_addr == ABE_DMASTATUS_RAW) { + desc_pp.nextbuff0_Samples = + (u16) ((abe_size_pingpong >> 2) / datasize); + desc_pp.nextbuff1_Samples = + (u16) ((abe_size_pingpong >> 2) / datasize); + } else { + desc_pp.nextbuff0_Samples = 0; + desc_pp.nextbuff1_Samples = 0; + } + /* next buffer to send is B1, first IRQ fills B0 */ + desc_pp.counter = 0; + /* send a DMA req to fill B0 with N samples + abe_block_copy (COPY_FROM_HOST_TO_ABE, + ABE_ATC, + ABE_DMASTATUS_RAW, + &(abe_port[id].protocol.p.prot_pingpong.irq_data), + 4); */ + sio_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + sio_desc_address, (u32 *) &desc_pp, + sizeof(desc_pp)); + } else { + io_sub_id = dmareq_addr = ABE_DMASTATUS_RAW; + dmareq_field = 0; + atc_desc_address1 = atc_desc_address2 = 0; + /* default: repeat of the last downlink samples in case of + DMA errors, (disable=0x00) */ + io_flag = 0xFF; + datasize2 = datasize = abe_dma_port_iter_factor(format); + x_io = (u8) abe_dma_port_iteration(format); + nsamp = (x_io / datasize); + atc_ptr_saved2 = atc_ptr_saved = DMIC_ATC_PTR_labelID + id; + smem1 = abe_port[id].smem_buffer1; + smem3 = smem2 = abe_port[id].smem_buffer2; + copy_func_index1 = (u8) abe_dma_port_copy_subroutine_id(id); + before_func_index = after_func_index = + copy_func_index2 = NULL_COPY_CFPID; + switch (prot->protocol_switch) { + case DMIC_PORT_PROT: + /* DMIC port is read in two steps */ + x_io = x_io >> 1; + nsamp = nsamp >> 1; + atc_desc_address1 = (ABE_ATC_DMIC_DMA_REQ*ATC_SIZE); + io_sub_id = IO_IP_CFPID; + break; + case MCPDMDL_PORT_PROT: + /* PDMDL port is written to in two steps */ + x_io = x_io >> 1; + atc_desc_address1 = + (ABE_ATC_MCPDMDL_DMA_REQ*ATC_SIZE); + io_sub_id = IO_IP_CFPID; + break; + case MCPDMUL_PORT_PROT: + atc_desc_address1 = + (ABE_ATC_MCPDMUL_DMA_REQ*ATC_SIZE); + io_sub_id = IO_IP_CFPID; + break; + case SLIMBUS_PORT_PROT: + atc_desc_address1 = + abe_port[id].protocol.p.prot_slimbus.desc_addr1; + atc_desc_address2 = + abe_port[id].protocol.p.prot_slimbus.desc_addr2; + copy_func_index2 = NULL_COPY_CFPID; + /* @@@@@@ + #define SPLIT_SMEM_CFPID 9 + #define MERGE_SMEM_CFPID 10 + #define SPLIT_TDM_12_CFPID 11 + #define MERGE_TDM_12_CFPID 12 + */ + io_sub_id = IO_IP_CFPID; + break; + case SERIAL_PORT_PROT: /* McBSP/McASP */ + atc_desc_address1 = + (s16) abe_port[id].protocol.p.prot_serial. + desc_addr; + io_sub_id = IO_IP_CFPID; + break; + case DMAREQ_PORT_PROT: /* DMA w/wo CBPr */ + dmareq_addr = + abe_port[id].protocol.p.prot_dmareq.dma_addr; + dmareq_field = 0; + atc_desc_address1 = + abe_port[id].protocol.p.prot_dmareq.desc_addr; + io_sub_id = IO_IP_CFPID; + break; + } + /* special situation of the PING_PONG protocol which + has its own SIO descriptor format */ + /* + Sequence of operations on ping-pong buffers B0/B1 + -------------- time ---------------------------->>>> + Host Application is ready to send data from DDR to B0 + SDMA is initialized from "abe_connect_irq_ping_pong_port" to B0 + FIRMWARE starts with #12 B1 data, + sends IRQ/DMAreq, sends #pong B1 data, + sends IRQ/DMAreq, sends #ping B0, + sends B1 samples + ARM / SDMA | fills B0 | fills B1 ... | fills B0 ... + Counter 0 1 2 3 + */ + switch (id) { + case OMAP_ABE_PDM_DL_PORT: + abe->MultiFrame[7][0] = ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_DL); + abe->MultiFrame[19][0] = ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_DL); + break; + case OMAP_ABE_TONES_DL_PORT: + abe->MultiFrame[20][0] = ABE_TASK_ID(C_ABE_FW_TASK_IO_TONES_DL); + break; + case OMAP_ABE_PDM_UL_PORT: + abe->MultiFrame[5][2] = ABE_TASK_ID(C_ABE_FW_TASK_IO_PDM_UL); + break; + case OMAP_ABE_DMIC_PORT: + abe->MultiFrame[2][5] = ABE_TASK_ID(C_ABE_FW_TASK_IO_DMIC); + abe->MultiFrame[14][3] = ABE_TASK_ID(C_ABE_FW_TASK_IO_DMIC); + break; + case OMAP_ABE_MM_UL_PORT: + copy_func_index1 = COPY_MM_UL_CFPID; + before_func_index = ROUTE_MM_UL_CFPID; + abe->MultiFrame[19][6] = ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_UL); + break; + case OMAP_ABE_MM_UL2_PORT: + abe->MultiFrame[17][3] = ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_UL2); + break; + case OMAP_ABE_VX_DL_PORT: + /* check for 8kHz/16kHz */ + if (abe_port[id].format.f == 8000) { + abe->MultiFrame[TASK_ASRC_VX_DL_SLT] + [TASK_ASRC_VX_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ASRC_VX_DL_8); + abe->MultiFrame[TASK_VX_DL_SLT][TASK_VX_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_VX_DL_8_48); + /*Voice_8k_DL_labelID */ + smem1 = IO_VX_DL_ASRC_labelID; + } else { + abe->MultiFrame[TASK_ASRC_VX_DL_SLT] + [TASK_ASRC_VX_DL_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_ASRC_VX_DL_16); + abe->MultiFrame[TASK_VX_DL_SLT][TASK_VX_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_VX_DL_16_48); + /* Voice_16k_DL_labelID */ + smem1 = IO_VX_DL_ASRC_labelID; + } + abe->MultiFrame[0][2] = ABE_TASK_ID(C_ABE_FW_TASK_IO_VX_DL); + break; + case OMAP_ABE_VX_UL_PORT: + /* check for 8kHz/16kHz */ + if (abe_port[id].format.f == 8000) { + abe->MultiFrame[TASK_ASRC_VX_UL_SLT] + [TASK_ASRC_VX_UL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ASRC_VX_UL_8); + abe->MultiFrame[TASK_VX_UL_SLT][TASK_VX_UL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_VX_UL_48_8); + /* MultiFrame[TASK_ECHO_SLT][TASK_ECHO_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ECHO_REF_48_8); */ + smem1 = Voice_8k_UL_labelID; + } else { + abe->MultiFrame[TASK_ASRC_VX_UL_SLT] + [TASK_ASRC_VX_UL_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_ASRC_VX_UL_16); + abe->MultiFrame[TASK_VX_UL_SLT][TASK_VX_UL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_VX_UL_48_16); + /* MultiFrame[TASK_ECHO_SLT][TASK_ECHO_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ECHO_REF_48_16); */ + smem1 = Voice_16k_UL_labelID; + } + abe->MultiFrame[16][3] = ABE_TASK_ID(C_ABE_FW_TASK_IO_VX_UL); + break; + case OMAP_ABE_BT_VX_DL_PORT: + /* check for 8kHz/16kHz */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MAXTASKBYTESINSLOT_ADDR, &dOppMode32, + sizeof(u32)); + if (abe_port[id].format.f == 8000) { + abe->MultiFrame[TASK_ASRC_BT_DL_SLT] + [TASK_ASRC_BT_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ASRC_BT_DL_8); + if (dOppMode32 == DOPPMODE32_OPP100) { + abe->MultiFrame[TASK_BT_DL_48_8_SLT] + [TASK_BT_DL_48_8_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_BT_DL_48_8_OPP100); + smem1 = BT_DL_8k_opp100_labelID; + } else { + abe->MultiFrame[TASK_BT_DL_48_8_SLT] + [TASK_BT_DL_48_8_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_BT_DL_48_8); + smem1 = BT_DL_8k_labelID; + } + } else { + abe->MultiFrame[TASK_ASRC_BT_DL_SLT] + [TASK_ASRC_BT_DL_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_ASRC_BT_DL_16); + if (dOppMode32 == DOPPMODE32_OPP100) { + abe->MultiFrame[TASK_BT_DL_48_8_SLT] + [TASK_BT_DL_48_8_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_BT_DL_48_16_OPP100); + smem1 = BT_DL_16k_opp100_labelID; + } else { + abe->MultiFrame[TASK_BT_DL_48_8_SLT] + [TASK_BT_DL_48_8_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_BT_DL_48_16); + smem1 = BT_DL_16k_labelID; + } + } + abe->MultiFrame[13][5] = ABE_TASK_ID(C_ABE_FW_TASK_IO_BT_VX_DL); + break; + case OMAP_ABE_BT_VX_UL_PORT: + /* check for 8kHz/16kHz */ + /* set the SMEM buffer -- programming sequence */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MAXTASKBYTESINSLOT_ADDR, &dOppMode32, + sizeof(u32)); + if (abe_port[id].format.f == 8000) { + abe->MultiFrame[TASK_ASRC_BT_UL_SLT] + [TASK_ASRC_BT_UL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_ASRC_BT_UL_8); + abe->MultiFrame[TASK_BT_UL_8_48_SLT] + [TASK_BT_UL_8_48_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_BT_UL_8_48); + if (dOppMode32 == DOPPMODE32_OPP100) + /* ASRC input buffer, size 40 */ + smem1 = smem_bt_vx_ul_opp100; + else + /* at OPP 50 without ASRC */ + smem1 = BT_UL_8k_labelID; + } else { + abe->MultiFrame[TASK_ASRC_BT_UL_SLT] + [TASK_ASRC_BT_UL_IDX] = + ABE_TASK_ID + (C_ABE_FW_TASK_ASRC_BT_UL_16); + abe->MultiFrame[TASK_BT_UL_8_48_SLT] + [TASK_BT_UL_8_48_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_BT_UL_16_48); + if (dOppMode32 == DOPPMODE32_OPP100) + /* ASRC input buffer, size 40 */ + smem1 = smem_bt_vx_ul_opp100; + else + /* at OPP 50 without ASRC */ + smem1 = BT_UL_16k_labelID; + } + abe->MultiFrame[15][3] = ABE_TASK_ID(C_ABE_FW_TASK_IO_BT_VX_UL); + break; + case OMAP_ABE_MM_DL_PORT: + /* check for CBPr / serial_port / Ping-pong access */ + abe->MultiFrame[TASK_IO_MM_DL_SLT][TASK_IO_MM_DL_IDX] = + ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_DL); + smem1 = smem_mm_dl; + break; + case OMAP_ABE_MM_EXT_IN_PORT: + /* set the SMEM buffer -- programming sequence */ + omap_abe_mem_read(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MAXTASKBYTESINSLOT_ADDR, &dOppMode32, + sizeof(u32)); + if (dOppMode32 == DOPPMODE32_OPP100) + /* ASRC input buffer, size 40 */ + smem1 = smem_mm_ext_in_opp100; + else + /* at OPP 50 without ASRC */ + smem1 = smem_mm_ext_in_opp50; + + abe->MultiFrame[21][3] = ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_EXT_IN); + break; + case OMAP_ABE_MM_EXT_OUT_PORT: + abe->MultiFrame[15][0] = ABE_TASK_ID(C_ABE_FW_TASK_IO_MM_EXT_OUT); + break; + default: + break; + } + + if (abe_port[id].protocol.direction == ABE_ATC_DIRECTION_IN) + direction = 0; + else + /* offset of the write pointer in the ATC descriptor */ + direction = 3; + + sio_desc.drift_ASRC = 0; + sio_desc.drift_io = 0; + sio_desc.io_type_idx = (u8) io_sub_id; + sio_desc.samp_size = (u8) datasize; + sio_desc.hw_ctrl_addr = (u16) (dmareq_addr << 2); + sio_desc.atc_irq_data = (u8) dmareq_field; + sio_desc.flow_counter = (u16) 0; + sio_desc.direction_rw = (u8) direction; + sio_desc.repeat_last_samp = (u8) io_flag; + sio_desc.nsamp = (u8) nsamp; + sio_desc.x_io = (u8) x_io; + /* set ATC ON */ + sio_desc.on_off = 0x80; + sio_desc.split_addr1 = (u16) smem1; + sio_desc.split_addr2 = (u16) smem2; + sio_desc.split_addr3 = (u16) smem3; + sio_desc.before_f_index = (u8) before_func_index; + sio_desc.after_f_index = (u8) after_func_index; + sio_desc.smem_addr1 = (u16) smem1; + sio_desc.atc_address1 = (u16) atc_desc_address1; + sio_desc.atc_pointer_saved1 = (u16) atc_ptr_saved; + sio_desc.data_size1 = (u8) datasize; + sio_desc.copy_f_index1 = (u8) copy_func_index1; + sio_desc.smem_addr2 = (u16) smem2; + sio_desc.atc_address2 = (u16) atc_desc_address2; + sio_desc.atc_pointer_saved2 = (u16) atc_ptr_saved2; + sio_desc.data_size2 = (u8) datasize2; + sio_desc.copy_f_index2 = (u8) copy_func_index2; + sio_desc_address = OMAP_ABE_D_IODESCR_ADDR + (id * + sizeof(struct ABE_SIODescriptor)); + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + sio_desc_address, (u32 *) &sio_desc, + sizeof(sio_desc)); + + omap_abe_mem_write(abe, OMAP_ABE_DMEM, + OMAP_ABE_D_MULTIFRAME_ADDR, (u32 *) abe->MultiFrame, + sizeof(abe->MultiFrame)); + } + +} + +/** + * omap_abe_select_main_port - Select stynchronization port for Event generator. + * @id: audio port name + * + * tells the FW which is the reference stream for adjusting + * the processing on 23/24/25 slots + */ +int omap_abe_select_main_port(u32 id) +{ + u32 selection; + + _log(ABE_ID_SELECT_MAIN_PORT, id, 0, 0); + + /* flow control */ + selection = OMAP_ABE_D_IODESCR_ADDR + id * sizeof(struct ABE_SIODescriptor) + + flow_counter_; + /* when the main port is a sink port from AESS point of view + the sign the firmware task analysis must be changed */ + selection &= 0xFFFFL; + if (abe_port[id].protocol.direction == ABE_ATC_DIRECTION_IN) + selection |= 0x80000; + omap_abe_mem_write(abe, OMAP_ABE_DMEM, OMAP_ABE_D_SLOT23_CTRL_ADDR, + &selection, 4); + return 0; +} +/** + * abe_decide_main_port - Select stynchronization port for Event generator. + * @id: audio port name + * + * tells the FW which is the reference stream for adjusting + * the processing on 23/24/25 slots + * + * takes the first port in a list which is slave on the data interface + */ +u32 abe_valid_port_for_synchro(u32 id) +{ + if ((abe_port[id].protocol.protocol_switch == + DMAREQ_PORT_PROT) || + (abe_port[id].protocol.protocol_switch == + PINGPONG_PORT_PROT) || + (abe_port[id].status != OMAP_ABE_PORT_ACTIVITY_RUNNING)) + return 0; + else + return 1; +} +void abe_decide_main_port(void) +{ + u32 id, id_not_found; + id_not_found = 1; + for (id = 0; id < LAST_PORT_ID - 1; id++) { + if (abe_valid_port_for_synchro(abe_port_priority[id])) { + id_not_found = 0; + break; + } + } + /* if no port is currently activated, the default one is PDM_DL */ + if (id_not_found) + omap_abe_select_main_port(OMAP_ABE_PDM_DL_PORT); + else + omap_abe_select_main_port(abe_port_priority[id]); +} +/** + * abe_format_switch + * @f: port format + * @iter: port iteration + * @mulfac: multiplication factor + * + * translates the sampling and data length to ITER number for the DMA + * and the multiplier factor to apply during data move with DMEM + * + */ +void abe_format_switch(abe_data_format_t *f, u32 *iter, u32 *mulfac) +{ + u32 n_freq; +#if FW_SCHED_LOOP_FREQ == 4000 + switch (f->f) { + /* nb of samples processed by scheduling loop */ + case 8000: + n_freq = 2; + break; + case 16000: + n_freq = 4; + break; + case 24000: + n_freq = 6; + break; + case 44100: + n_freq = 12; + break; + case 96000: + n_freq = 24; + break; + default/*case 48000 */ : + n_freq = 12; + break; + } +#else + /* erroneous cases */ + n_freq = 0; +#endif + switch (f->samp_format) { + case MONO_MSB: + case MONO_RSHIFTED_16: + case STEREO_16_16: + *mulfac = 1; + break; + case STEREO_MSB: + case STEREO_RSHIFTED_16: + *mulfac = 2; + break; + case THREE_MSB: + *mulfac = 3; + break; + case FOUR_MSB: + *mulfac = 4; + break; + case FIVE_MSB: + *mulfac = 5; + break; + case SIX_MSB: + *mulfac = 6; + break; + case SEVEN_MSB: + *mulfac = 7; + break; + case EIGHT_MSB: + *mulfac = 8; + break; + case NINE_MSB: + *mulfac = 9; + break; + default: + *mulfac = 1; + break; + } + *iter = (n_freq * (*mulfac)); +} +/** + * abe_dma_port_iteration + * @f: port format + * + * translates the sampling and data length to ITER number for the DMA + */ +u32 abe_dma_port_iteration(abe_data_format_t *f) +{ + u32 iter, mulfac; + abe_format_switch(f, &iter, &mulfac); + return iter; +} +/** + * abe_dma_port_iter_factor + * @f: port format + * + * returns the multiplier factor to apply during data move with DMEM + */ +u32 abe_dma_port_iter_factor(abe_data_format_t *f) +{ + u32 iter, mulfac; + abe_format_switch(f, &iter, &mulfac); + return mulfac; +} +/** + * omap_abe_dma_port_iter_factor + * @f: port format + * + * returns the multiplier factor to apply during data move with DMEM + */ +u32 omap_abe_dma_port_iter_factor(struct omap_abe_data_format *f) +{ + u32 iter, mulfac; + abe_format_switch((abe_data_format_t *)f, &iter, &mulfac); + return mulfac; +} +/** + * abe_dma_port_copy_subroutine_id + * + * @port_id: ABE port ID + * + * returns the index of the function doing the copy in I/O tasks + */ +u32 abe_dma_port_copy_subroutine_id(u32 port_id) +{ + u32 sub_id; + if (abe_port[port_id].protocol.direction == ABE_ATC_DIRECTION_IN) { + switch (abe_port[port_id].format.samp_format) { + case MONO_MSB: + sub_id = D2S_MONO_MSB_CFPID; + break; + case MONO_RSHIFTED_16: + sub_id = D2S_MONO_RSHIFTED_16_CFPID; + break; + case STEREO_RSHIFTED_16: + sub_id = D2S_STEREO_RSHIFTED_16_CFPID; + break; + case STEREO_16_16: + sub_id = D2S_STEREO_16_16_CFPID; + break; + case STEREO_MSB: + sub_id = D2S_STEREO_MSB_CFPID; + break; + case SIX_MSB: + if (port_id == OMAP_ABE_DMIC_PORT) { + sub_id = COPY_DMIC_CFPID; + break; + } + default: + sub_id = NULL_COPY_CFPID; + break; + } + } else { + switch (abe_port[port_id].format.samp_format) { + case MONO_MSB: + sub_id = S2D_MONO_MSB_CFPID; + break; + case MONO_RSHIFTED_16: + sub_id = S2D_MONO_RSHIFTED_16_CFPID; + break; + case STEREO_RSHIFTED_16: + sub_id = S2D_STEREO_RSHIFTED_16_CFPID; + break; + case STEREO_16_16: + sub_id = S2D_STEREO_16_16_CFPID; + break; + case STEREO_MSB: + sub_id = S2D_STEREO_MSB_CFPID; + break; + case SIX_MSB: + if (port_id == OMAP_ABE_PDM_DL_PORT) { + sub_id = COPY_MCPDM_DL_CFPID; + break; + } + if (port_id == OMAP_ABE_MM_UL_PORT) { + sub_id = COPY_MM_UL_CFPID; + break; + } + case THREE_MSB: + case FOUR_MSB: + case FIVE_MSB: + case SEVEN_MSB: + case EIGHT_MSB: + case NINE_MSB: + sub_id = COPY_MM_UL_CFPID; + break; + default: + sub_id = NULL_COPY_CFPID; + break; + } + } + return sub_id; +} + +/** + * abe_read_remaining_data + * @id: ABE port_ID + * @n: size pointer to the remaining number of 32bits words + * + * computes the remaining amount of data in the buffer. + */ +abehal_status abe_read_remaining_data(u32 port, u32 *n) +{ + u32 sio_pp_desc_address; + struct ABE_SPingPongDescriptor desc_pp; + + _log(ABE_ID_READ_REMAINING_DATA, port, 0, 0); + + /* + * read the port SIO descriptor and extract the + * current pointer address after reading the counter + */ + sio_pp_desc_address = OMAP_ABE_D_PINGPONGDESC_ADDR; + omap_abe_mem_read(abe, OMAP_ABE_DMEM, sio_pp_desc_address, + (u32 *) &desc_pp, sizeof(struct ABE_SPingPongDescriptor)); + *n = desc_pp.workbuff_Samples; + + return 0; +} +EXPORT_SYMBOL(abe_read_remaining_data); diff --git a/sound/soc/omap/abe/abe_port.h b/sound/soc/omap/abe/abe_port.h new file mode 100644 index 0000000..290f8b5 --- /dev/null +++ b/sound/soc/omap/abe/abe_port.h @@ -0,0 +1,161 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_PORT_H_ +#define _ABE_PORT_H_ + +struct omap_abe_data_format { + /* Sampling frequency of the stream */ + u32 f; + /* Sample format type */ + u32 samp_format; +}; + +struct omap_abe_port_protocol { + /* Direction=0 means input from AESS point of view */ + u32 direction; + /* Protocol type (switch) during the data transfers */ + u32 protocol_switch; + union { + /* McBSP/McASP peripheral connected to ATC */ + struct { + u32 desc_addr; + /* Address of ATC McBSP/McASP descriptor's in bytes */ + u32 buf_addr; + /* DMEM address in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + } serial; + /* DMIC peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* Number of activated DMIC */ + u32 nbchan; + } dmic; + /* McPDMDL peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM size in bytes */ + u32 buf_size; + /* Control allowed on McPDM DL */ + u32 control; + } mcpdmdl; + /* McPDMUL peripheral connected to ATC */ + struct { + /* DMEM address size in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + } mcpdmul; + /* Ping-Pong interface to the Host using cache-flush */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM size in bytes for each ping and pong buffers */ + u32 buf_size; + /* IRQ address (either DMA (0) MCU (1) or DSP(2)) */ + u32 irq_addr; + /* IRQ data content loaded in the AESS IRQ register */ + u32 irq_data; + /* Call-back function upon IRQ reception */ + u32 callback; + } pingpong; + /* DMAreq line to CBPr */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer address in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } dmareq; + /* Circular buffer - direct addressing to DMEM */ + struct { + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } circular_buffer; + } port; +}; + +extern const abe_port_t abe_port_init[]; +extern abe_port_t abe_port[]; +extern const u32 abe_port_priority[]; + +int omap_abe_select_main_port(u32 id); +u32 omap_abe_dma_port_iter_factor(struct omap_abe_data_format *f); + +#endif/* _ABE_PORT_H_ */ diff --git a/sound/soc/omap/abe/abe_ref.h b/sound/soc/omap/abe/abe_ref.h new file mode 100644 index 0000000..4c8a9bb --- /dev/null +++ b/sound/soc/omap/abe/abe_ref.h @@ -0,0 +1,152 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_REF_H_ +#define _ABE_REF_H_ + +#include "abe_api.h" + +/* + * 'ABE_PRO.H' all non-API prototypes for INI, IRQ, SEQ ... + */ +/* + * HAL EXTERNAL AP + */ +/* + * HAL INTERNAL AP + */ +void abe_decide_main_port(void); +void abe_reset_all_ports(void); +void abe_reset_all_fifo(void); +void abe_reset_all_sequence(void); +u32 abe_dma_port_iteration(abe_data_format_t *format); +void abe_read_sys_clock(u32 *time); +void abe_enable_atc(u32 id); +void abe_disable_atc(u32 id); +void abe_init_io_tasks(u32 id, abe_data_format_t *format, + abe_port_protocol_t *prot); +void abe_init_dma_t(u32 id, abe_port_protocol_t *prot); +u32 abe_dma_port_iter_factor(abe_data_format_t *f); +u32 abe_dma_port_copy_subroutine_id(u32 i); +void abe_call_subroutine(u32 idx, u32 p1, u32 p2, u32 p3, u32 p4); +void abe_monitoring(void); +void abe_add_subroutine(u32 *id, abe_subroutine2 f, u32 nparam, u32 *params); +abehal_status abe_read_next_ping_pong_buffer(u32 port, u32 *p, u32 *n); +void abe_irq_ping_pong(void); +void abe_irq_check_for_sequences(u32 seq_info); +void abe_default_irq_pingpong_player(void); +void abe_default_irq_pingpong_player_32bits(void); +void abe_rshifted16_irq_pingpong_player_32bits(void); +void abe_1616_irq_pingpong_player_1616bits(void); +void abe_default_irq_aps_adaptation(void); +void abe_irq_aps(u32 aps_info); +void abe_dbg_error_log(u32 x); +void abe_init_asrc_vx_dl(s32 dppm); +void abe_init_asrc_vx_ul(s32 dppm); +void abe_init_asrc_mm_ext_in(s32 dppm); +void abe_init_asrc_bt_ul(s32 dppm); +void abe_init_asrc_bt_dl(s32 dppm); + +void omap_abe_hw_configuration(struct omap_abe *abe); +void omap_abe_gain_offset(struct omap_abe *abe, u32 id, u32 *mixer_offset); +int omap_abe_use_compensated_gain(struct omap_abe *abe, int on_off); + +/* + * HAL INTERNAL DATA + */ +extern const u32 abe_port_priority[LAST_PORT_ID - 1]; +extern const u32 abe_firmware_array[ABE_FIRMWARE_MAX_SIZE]; +extern const u32 abe_atc_srcid[]; +extern const u32 abe_atc_dstid[]; +extern const abe_port_t abe_port_init[]; +extern const abe_seq_t all_sequence_init[]; +extern const abe_router_t abe_router_ul_table_preset + [NBROUTE_CONFIG][NBROUTE_UL]; +extern const abe_sequence_t seq_null; + +extern abe_port_t abe_port[]; +extern abe_seq_t all_sequence[]; +extern abe_router_t abe_router_ul_table[NBROUTE_CONFIG_MAX][NBROUTE_UL]; +/* table of new subroutines called in the sequence */ +extern abe_subroutine2 abe_all_subsubroutine[MAXNBSUBROUTINE]; +/* number of parameters per calls */ +extern u32 abe_all_subsubroutine_nparam[MAXNBSUBROUTINE]; +extern u32 abe_subroutine_id[MAXNBSUBROUTINE]; +extern u32 *abe_all_subroutine_params[MAXNBSUBROUTINE]; +extern u32 abe_subroutine_write_pointer; +extern abe_sequence_t abe_all_sequence[MAXNBSEQUENCE]; +extern u32 abe_sequence_write_pointer; +/* current number of pending sequences (avoids to look in the table) */ +extern u32 abe_nb_pending_sequences; +/* pending sequences due to ressource collision */ +extern u32 abe_pending_sequences[MAXNBSEQUENCE]; +/* mask of unsharable ressources among other sequences */ +extern u32 abe_global_sequence_mask; +/* table of active sequences */ +extern abe_seq_t abe_active_sequence[MAXACTIVESEQUENCE][MAXSEQUENCESTEPS]; +/* index of the plugged subroutine doing ping-pong cache-flush + DMEM accesses */ +extern u32 abe_irq_aps_adaptation_id; +/* base addresses of the ping pong buffers */ +extern u32 abe_base_address_pingpong[MAX_PINGPONG_BUFFERS]; +/* size of each ping/pong buffers */ +extern u32 abe_size_pingpong; +/* number of ping/pong buffer being used */ +extern u32 abe_nb_pingpong; + +#endif/* _ABE_REF_H_ */ diff --git a/sound/soc/omap/abe/abe_seq.c b/sound/soc/omap/abe/abe_seq.c new file mode 100644 index 0000000..6ae2aa5 --- /dev/null +++ b/sound/soc/omap/abe/abe_seq.c @@ -0,0 +1,308 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include "abe_legacy.h" + +#include "abe_mem.h" + +extern struct omap_abe *abe; +extern u32 abe_irq_pingpong_player_id; + +/** + * abe_null_subroutine + * + */ +void abe_null_subroutine_0(void) +{ +} +void abe_null_subroutine_2(u32 a, u32 b) +{ +} +void abe_null_subroutine_4(u32 a, u32 b, u32 c, u32 d) +{ +} +/** + * abe_init_subroutine_table - initializes the default table of pointers + * to subroutines + * + * initializes the default table of pointers to subroutines + * + */ +void abe_init_subroutine_table(void) +{ + u32 id; + /* reset the table's pointers */ + abe_subroutine_write_pointer = 0; + /* the first index is the NULL task */ + abe_add_subroutine(&id, (abe_subroutine2) abe_null_subroutine_2, + SUB_0_PARAM, (u32 *) 0); + /* write mixer has 4 parameters */ + abe_add_subroutine(&(abe_subroutine_id[SUB_WRITE_MIXER]), + (abe_subroutine2) abe_write_mixer, SUB_4_PARAM, + (u32 *) 0); + /* ping-pong player IRQ */ + abe_add_subroutine(&abe_irq_pingpong_player_id, + (abe_subroutine2) abe_null_subroutine_0, SUB_0_PARAM, + (u32 *) 0); +} +/** + * abe_add_subroutine + * @id: ABE port id + * @f: pointer to the subroutines + * @nparam: number of parameters + * @params: pointer to the psrameters + * + * add one function pointer more and returns the index to it + */ +void abe_add_subroutine(u32 *id, abe_subroutine2 f, u32 nparam, u32 *params) +{ + u32 i, i_found; + if ((abe_subroutine_write_pointer >= MAXNBSUBROUTINE) || + ((u32) f == 0)) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_SEQ, + ABE_PARAMETER_OVERFLOW); + } else { + /* search if this subroutine address was not already + * declared, then return the previous index + */ + for (i_found = abe_subroutine_write_pointer, i = 0; + i < abe_subroutine_write_pointer; i++) { + if (f == abe_all_subsubroutine[i]) + i_found = i; + } + if (i_found == abe_subroutine_write_pointer) { + *id = abe_subroutine_write_pointer; + abe_all_subsubroutine + [abe_subroutine_write_pointer] = (f); + abe_all_subroutine_params + [abe_subroutine_write_pointer] = params; + abe_all_subsubroutine_nparam + [abe_subroutine_write_pointer] = nparam; + abe_subroutine_write_pointer++; + } else { + abe_all_subroutine_params[i_found] = params; + *id = i_found; + } + } +} +/** + * abe_add_sequence + * @id: returned sequence index after pluging a new sequence + * (index in the tables) + * @s: sequence to be inserted + * + * Load a time-sequenced operations. + */ +void abe_add_sequence(u32 *id, abe_sequence_t *s) +{ + abe_seq_t *seq_src, *seq_dst; + u32 i, no_end_of_sequence_found; + seq_src = &(s->seq1); + seq_dst = &((abe_all_sequence[abe_sequence_write_pointer]).seq1); + if ((abe_sequence_write_pointer >= MAXNBSEQUENCE) || ((u32) s == 0)) { + omap_abe_dbg_error(abe, OMAP_ABE_ERR_SEQ, + ABE_PARAMETER_OVERFLOW); + } else { + *id = abe_subroutine_write_pointer; + /* copy the mask */ + (abe_all_sequence[abe_sequence_write_pointer]).mask = s->mask; + for (no_end_of_sequence_found = 1, i = 0; i < MAXSEQUENCESTEPS; + i++, seq_src++, seq_dst++) { + /* sequence copied line by line */ + (*seq_dst) = (*seq_src); + /* stop when the line start with time=(-1) */ + if ((*(s32 *) seq_src) == (-1)) { + /* stop when the line start with time=(-1) */ + no_end_of_sequence_found = 0; + break; + } + } + abe_subroutine_write_pointer++; + if (no_end_of_sequence_found) + omap_abe_dbg_error(abe, OMAP_ABE_ERR_API, + ABE_SEQTOOLONG); + } +} +/** + * abe_reset_one_sequence + * @id: sequence ID + * + * load default configuration for that sequence + * kill running activities + */ +void abe_reset_one_sequence(u32 id) +{ +} +/** + * abe_reset_all_sequence + * + * load default configuration for all sequences + * kill any running activities + */ +void omap_abe_reset_all_sequence(struct omap_abe *abe) +{ + u32 i; + abe_init_subroutine_table(); + /* arrange to have the first sequence index=0 to the NULL operation + sequence */ + abe_add_sequence(&i, (abe_sequence_t *) &seq_null); + /* reset the the collision protection mask */ + abe_global_sequence_mask = 0; + /* reset the pending sequences list */ + for (abe_nb_pending_sequences = i = 0; i < MAXNBSEQUENCE; i++) + abe_pending_sequences[i] = 0; +} +/** + * abe_call_subroutine + * @idx: index to the table of all registered Call-backs and subroutines + * + * run and log a subroutine + */ +void abe_call_subroutine(u32 idx, u32 p1, u32 p2, u32 p3, u32 p4) +{ + abe_subroutine0 f0; + abe_subroutine1 f1; + abe_subroutine2 f2; + abe_subroutine3 f3; + abe_subroutine4 f4; + u32 *params; + if (idx > MAXNBSUBROUTINE) + return; + switch (idx) { + /* call the subroutines defined at compilation time + (const .. sequences) */ +#if 0 + case SUB_WRITE_MIXER_DL1: + abe_write_mixer_dl1(p1, p2, p3) + abe_fprintf("write_mixer"); + break; +#endif + /* call the subroutines defined at execution time + (dynamic sequences) */ + default: + switch (abe_all_subsubroutine_nparam[idx]) { + case SUB_0_PARAM: + f0 = (abe_subroutine0) abe_all_subsubroutine[idx]; + (*f0) (); + break; + case SUB_1_PARAM: + f1 = (abe_subroutine1) abe_all_subsubroutine[idx]; + params = abe_all_subroutine_params + [abe_irq_pingpong_player_id]; + if (params != (u32 *) 0) + p1 = params[0]; + (*f1) (p1); + break; + case SUB_2_PARAM: + f2 = abe_all_subsubroutine[idx]; + params = abe_all_subroutine_params + [abe_irq_pingpong_player_id]; + if (params != (u32 *) 0) { + p1 = params[0]; + p2 = params[1]; + } + (*f2) (p1, p2); + break; + case SUB_3_PARAM: + f3 = (abe_subroutine3) abe_all_subsubroutine[idx]; + params = abe_all_subroutine_params + [abe_irq_pingpong_player_id]; + if (params != (u32 *) 0) { + p1 = params[0]; + p2 = params[1]; + p3 = params[2]; + } + (*f3) (p1, p2, p3); + break; + case SUB_4_PARAM: + f4 = (abe_subroutine4) abe_all_subsubroutine[idx]; + params = abe_all_subroutine_params + [abe_irq_pingpong_player_id]; + if (params != (u32 *) 0) { + p1 = params[0]; + p2 = params[1]; + p3 = params[2]; + p4 = params[3]; + } + (*f4) (p1, p2, p3, p4); + break; + default: + break; + } + } +} + +/** + * abe_set_sequence_time_accuracy + * @fast: fast counter + * @slow: slow counter + * + */ +abehal_status abe_set_sequence_time_accuracy(u32 fast, u32 slow) +{ + u32 data; + _log(ABE_ID_SET_SEQUENCE_TIME_ACCURACY, fast, slow, 0); + data = minimum(MAX_UINT16, fast / FW_SCHED_LOOP_FREQ_DIV1000); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, OMAP_ABE_D_FASTCOUNTER_ADDR, + &data, sizeof(data)); + data = minimum(MAX_UINT16, slow / FW_SCHED_LOOP_FREQ_DIV1000); + omap_abe_mem_write(abe, OMAP_ABE_DMEM, OMAP_ABE_D_SLOWCOUNTER_ADDR, + &data, sizeof(data)); + return 0; +} +EXPORT_SYMBOL(abe_set_sequence_time_accuracy); diff --git a/sound/soc/omap/abe/abe_seq.h b/sound/soc/omap/abe/abe_seq.h new file mode 100644 index 0000000..e5047ad --- /dev/null +++ b/sound/soc/omap/abe/abe_seq.h @@ -0,0 +1,64 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_SEQ_H_ +#define _ABE_SEQ_H_ + +void omap_abe_reset_all_sequence(struct omap_abe *abe); + +#endif /* _ABE_SEQ_H_ */ diff --git a/sound/soc/omap/abe/abe_sm_addr.h b/sound/soc/omap/abe/abe_sm_addr.h new file mode 100644 index 0000000..ad2295f --- /dev/null +++ b/sound/soc/omap/abe/abe_sm_addr.h @@ -0,0 +1,537 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#define OMAP_ABE_INIT_SM_ADDR 0x0 +#define OMAP_ABE_INIT_SM_SIZE 0x9B8 + +#define OMAP_ABE_S_DATA0_ADDR 0x9B8 +#define OMAP_ABE_S_DATA0_SIZE 0x8 + +#define OMAP_ABE_S_TEMP_ADDR 0x9C0 +#define OMAP_ABE_S_TEMP_SIZE 0x8 + +#define OMAP_ABE_S_PHOENIXOFFSET_ADDR 0x9C8 +#define OMAP_ABE_S_PHOENIXOFFSET_SIZE 0x8 + +#define OMAP_ABE_S_GTARGET1_ADDR 0x9D0 +#define OMAP_ABE_S_GTARGET1_SIZE 0x38 + +#define OMAP_ABE_S_GTARGET_DL1_ADDR 0xA08 +#define OMAP_ABE_S_GTARGET_DL1_SIZE 0x10 + +#define OMAP_ABE_S_GTARGET_DL2_ADDR 0xA18 +#define OMAP_ABE_S_GTARGET_DL2_SIZE 0x10 + +#define OMAP_ABE_S_GTARGET_ECHO_ADDR 0xA28 +#define OMAP_ABE_S_GTARGET_ECHO_SIZE 0x8 + +#define OMAP_ABE_S_GTARGET_SDT_ADDR 0xA30 +#define OMAP_ABE_S_GTARGET_SDT_SIZE 0x8 + +#define OMAP_ABE_S_GTARGET_VXREC_ADDR 0xA38 +#define OMAP_ABE_S_GTARGET_VXREC_SIZE 0x10 + +#define OMAP_ABE_S_GTARGET_UL_ADDR 0xA48 +#define OMAP_ABE_S_GTARGET_UL_SIZE 0x10 + +#define OMAP_ABE_S_GTARGET_BTUL_ADDR 0xA58 +#define OMAP_ABE_S_GTARGET_BTUL_SIZE 0x8 + +#define OMAP_ABE_S_GCURRENT_ADDR 0xA60 +#define OMAP_ABE_S_GCURRENT_SIZE 0x90 + +#define OMAP_ABE_S_GAIN_ONE_ADDR 0xAF0 +#define OMAP_ABE_S_GAIN_ONE_SIZE 0x8 + +#define OMAP_ABE_S_TONES_ADDR 0xAF8 +#define OMAP_ABE_S_TONES_SIZE 0x60 + +#define OMAP_ABE_S_VX_DL_ADDR 0xB58 +#define OMAP_ABE_S_VX_DL_SIZE 0x60 + +#define OMAP_ABE_S_MM_UL2_ADDR 0xBB8 +#define OMAP_ABE_S_MM_UL2_SIZE 0x60 + +#define OMAP_ABE_S_MM_DL_ADDR 0xC18 +#define OMAP_ABE_S_MM_DL_SIZE 0x60 + +#define OMAP_ABE_S_DL1_M_OUT_ADDR 0xC78 +#define OMAP_ABE_S_DL1_M_OUT_SIZE 0x60 + +#define OMAP_ABE_S_DL2_M_OUT_ADDR 0xCD8 +#define OMAP_ABE_S_DL2_M_OUT_SIZE 0x60 + +#define OMAP_ABE_S_ECHO_M_OUT_ADDR 0xD38 +#define OMAP_ABE_S_ECHO_M_OUT_SIZE 0x60 + +#define OMAP_ABE_S_SDT_M_OUT_ADDR 0xD98 +#define OMAP_ABE_S_SDT_M_OUT_SIZE 0x60 + +#define OMAP_ABE_S_VX_UL_ADDR 0xDF8 +#define OMAP_ABE_S_VX_UL_SIZE 0x60 + +#define OMAP_ABE_S_VX_UL_M_ADDR 0xE58 +#define OMAP_ABE_S_VX_UL_M_SIZE 0x60 + +#define OMAP_ABE_S_BT_DL_ADDR 0xEB8 +#define OMAP_ABE_S_BT_DL_SIZE 0x60 + +#define OMAP_ABE_S_BT_UL_ADDR 0xF18 +#define OMAP_ABE_S_BT_UL_SIZE 0x60 + +#define OMAP_ABE_S_BT_DL_8K_ADDR 0xF78 +#define OMAP_ABE_S_BT_DL_8K_SIZE 0x18 + +#define OMAP_ABE_S_BT_DL_16K_ADDR 0xF90 +#define OMAP_ABE_S_BT_DL_16K_SIZE 0x28 + +#define OMAP_ABE_S_BT_UL_8K_ADDR 0xFB8 +#define OMAP_ABE_S_BT_UL_8K_SIZE 0x10 + +#define OMAP_ABE_S_BT_UL_16K_ADDR 0xFC8 +#define OMAP_ABE_S_BT_UL_16K_SIZE 0x20 + +#define OMAP_ABE_S_SDT_F_ADDR 0xFE8 +#define OMAP_ABE_S_SDT_F_SIZE 0x60 + +#define OMAP_ABE_S_SDT_F_DATA_ADDR 0x1048 +#define OMAP_ABE_S_SDT_F_DATA_SIZE 0x48 + +#define OMAP_ABE_S_MM_DL_OSR_ADDR 0x1090 +#define OMAP_ABE_S_MM_DL_OSR_SIZE 0xC0 + +#define OMAP_ABE_S_24_ZEROS_ADDR 0x1150 +#define OMAP_ABE_S_24_ZEROS_SIZE 0xC0 + +#define OMAP_ABE_S_DMIC1_ADDR 0x1210 +#define OMAP_ABE_S_DMIC1_SIZE 0x60 + +#define OMAP_ABE_S_DMIC2_ADDR 0x1270 +#define OMAP_ABE_S_DMIC2_SIZE 0x60 + +#define OMAP_ABE_S_DMIC3_ADDR 0x12D0 +#define OMAP_ABE_S_DMIC3_SIZE 0x60 + +#define OMAP_ABE_S_AMIC_ADDR 0x1330 +#define OMAP_ABE_S_AMIC_SIZE 0x60 + +#define OMAP_ABE_S_DMIC1_L_ADDR 0x1390 +#define OMAP_ABE_S_DMIC1_L_SIZE 0x60 + +#define OMAP_ABE_S_DMIC1_R_ADDR 0x13F0 +#define OMAP_ABE_S_DMIC1_R_SIZE 0x60 + +#define OMAP_ABE_S_DMIC2_L_ADDR 0x1450 +#define OMAP_ABE_S_DMIC2_L_SIZE 0x60 + +#define OMAP_ABE_S_DMIC2_R_ADDR 0x14B0 +#define OMAP_ABE_S_DMIC2_R_SIZE 0x60 + +#define OMAP_ABE_S_DMIC3_L_ADDR 0x1510 +#define OMAP_ABE_S_DMIC3_L_SIZE 0x60 + +#define OMAP_ABE_S_DMIC3_R_ADDR 0x1570 +#define OMAP_ABE_S_DMIC3_R_SIZE 0x60 + +#define OMAP_ABE_S_BT_UL_L_ADDR 0x15D0 +#define OMAP_ABE_S_BT_UL_L_SIZE 0x60 + +#define OMAP_ABE_S_BT_UL_R_ADDR 0x1630 +#define OMAP_ABE_S_BT_UL_R_SIZE 0x60 + +#define OMAP_ABE_S_AMIC_L_ADDR 0x1690 +#define OMAP_ABE_S_AMIC_L_SIZE 0x60 + +#define OMAP_ABE_S_AMIC_R_ADDR 0x16F0 +#define OMAP_ABE_S_AMIC_R_SIZE 0x60 + +#define OMAP_ABE_S_ECHOREF_L_ADDR 0x1750 +#define OMAP_ABE_S_ECHOREF_L_SIZE 0x60 + +#define OMAP_ABE_S_ECHOREF_R_ADDR 0x17B0 +#define OMAP_ABE_S_ECHOREF_R_SIZE 0x60 + +#define OMAP_ABE_S_MM_DL_L_ADDR 0x1810 +#define OMAP_ABE_S_MM_DL_L_SIZE 0x60 + +#define OMAP_ABE_S_MM_DL_R_ADDR 0x1870 +#define OMAP_ABE_S_MM_DL_R_SIZE 0x60 + +#define OMAP_ABE_S_MM_UL_ADDR 0x18D0 +#define OMAP_ABE_S_MM_UL_SIZE 0x3C0 + +#define OMAP_ABE_S_AMIC_96K_ADDR 0x1C90 +#define OMAP_ABE_S_AMIC_96K_SIZE 0xC0 + +#define OMAP_ABE_S_DMIC0_96K_ADDR 0x1D50 +#define OMAP_ABE_S_DMIC0_96K_SIZE 0xC0 + +#define OMAP_ABE_S_DMIC1_96K_ADDR 0x1E10 +#define OMAP_ABE_S_DMIC1_96K_SIZE 0xC0 + +#define OMAP_ABE_S_DMIC2_96K_ADDR 0x1ED0 +#define OMAP_ABE_S_DMIC2_96K_SIZE 0xC0 + +#define OMAP_ABE_S_UL_VX_UL_48_8K_ADDR 0x1F90 +#define OMAP_ABE_S_UL_VX_UL_48_8K_SIZE 0x60 + +#define OMAP_ABE_S_UL_VX_UL_48_16K_ADDR 0x1FF0 +#define OMAP_ABE_S_UL_VX_UL_48_16K_SIZE 0x60 + +#define OMAP_ABE_S_UL_MIC_48K_ADDR 0x2050 +#define OMAP_ABE_S_UL_MIC_48K_SIZE 0x60 + +#define OMAP_ABE_S_VOICE_8K_UL_ADDR 0x20B0 +#define OMAP_ABE_S_VOICE_8K_UL_SIZE 0x18 + +#define OMAP_ABE_S_VOICE_8K_DL_ADDR 0x20C8 +#define OMAP_ABE_S_VOICE_8K_DL_SIZE 0x10 + +#define OMAP_ABE_S_MCPDM_OUT1_ADDR 0x20D8 +#define OMAP_ABE_S_MCPDM_OUT1_SIZE 0xC0 + +#define OMAP_ABE_S_MCPDM_OUT2_ADDR 0x2198 +#define OMAP_ABE_S_MCPDM_OUT2_SIZE 0xC0 + +#define OMAP_ABE_S_MCPDM_OUT3_ADDR 0x2258 +#define OMAP_ABE_S_MCPDM_OUT3_SIZE 0xC0 + +#define OMAP_ABE_S_VOICE_16K_UL_ADDR 0x2318 +#define OMAP_ABE_S_VOICE_16K_UL_SIZE 0x28 + +#define OMAP_ABE_S_VOICE_16K_DL_ADDR 0x2340 +#define OMAP_ABE_S_VOICE_16K_DL_SIZE 0x20 + +#define OMAP_ABE_S_XINASRC_DL_VX_ADDR 0x2360 +#define OMAP_ABE_S_XINASRC_DL_VX_SIZE 0x140 + +#define OMAP_ABE_S_XINASRC_UL_VX_ADDR 0x24A0 +#define OMAP_ABE_S_XINASRC_UL_VX_SIZE 0x140 + +#define OMAP_ABE_S_XINASRC_MM_EXT_IN_ADDR 0x25E0 +#define OMAP_ABE_S_XINASRC_MM_EXT_IN_SIZE 0x140 + +#define OMAP_ABE_S_VX_REC_ADDR 0x2720 +#define OMAP_ABE_S_VX_REC_SIZE 0x60 + +#define OMAP_ABE_S_VX_REC_L_ADDR 0x2780 +#define OMAP_ABE_S_VX_REC_L_SIZE 0x60 + +#define OMAP_ABE_S_VX_REC_R_ADDR 0x27E0 +#define OMAP_ABE_S_VX_REC_R_SIZE 0x60 + +#define OMAP_ABE_S_DL2_M_L_ADDR 0x2840 +#define OMAP_ABE_S_DL2_M_L_SIZE 0x60 + +#define OMAP_ABE_S_DL2_M_R_ADDR 0x28A0 +#define OMAP_ABE_S_DL2_M_R_SIZE 0x60 + +#define OMAP_ABE_S_DL2_M_LR_EQ_DATA_ADDR 0x2900 +#define OMAP_ABE_S_DL2_M_LR_EQ_DATA_SIZE 0xC8 + +#define OMAP_ABE_S_DL1_M_EQ_DATA_ADDR 0x29C8 +#define OMAP_ABE_S_DL1_M_EQ_DATA_SIZE 0xC8 + +#define OMAP_ABE_S_EARP_48_96_LP_DATA_ADDR 0x2A90 +#define OMAP_ABE_S_EARP_48_96_LP_DATA_SIZE 0x78 + +#define OMAP_ABE_S_IHF_48_96_LP_DATA_ADDR 0x2B08 +#define OMAP_ABE_S_IHF_48_96_LP_DATA_SIZE 0x78 + +#define OMAP_ABE_S_VX_UL_8_TEMP_ADDR 0x2B80 +#define OMAP_ABE_S_VX_UL_8_TEMP_SIZE 0x10 + +#define OMAP_ABE_S_VX_UL_16_TEMP_ADDR 0x2B90 +#define OMAP_ABE_S_VX_UL_16_TEMP_SIZE 0x20 + +#define OMAP_ABE_S_VX_DL_8_48_LP_DATA_ADDR 0x2BB0 +#define OMAP_ABE_S_VX_DL_8_48_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_VX_DL_8_48_HP_DATA_ADDR 0x2C08 +#define OMAP_ABE_S_VX_DL_8_48_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_VX_DL_16_48_LP_DATA_ADDR 0x2C40 +#define OMAP_ABE_S_VX_DL_16_48_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_VX_DL_16_48_HP_DATA_ADDR 0x2C98 +#define OMAP_ABE_S_VX_DL_16_48_HP_DATA_SIZE 0x28 + +#define OMAP_ABE_S_VX_UL_48_8_LP_DATA_ADDR 0x2CC0 +#define OMAP_ABE_S_VX_UL_48_8_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_VX_UL_48_8_HP_DATA_ADDR 0x2D18 +#define OMAP_ABE_S_VX_UL_48_8_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_VX_UL_48_16_LP_DATA_ADDR 0x2D50 +#define OMAP_ABE_S_VX_UL_48_16_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_VX_UL_48_16_HP_DATA_ADDR 0x2DA8 +#define OMAP_ABE_S_VX_UL_48_16_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_BT_UL_8_48_LP_DATA_ADDR 0x2DE0 +#define OMAP_ABE_S_BT_UL_8_48_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_BT_UL_8_48_HP_DATA_ADDR 0x2E38 +#define OMAP_ABE_S_BT_UL_8_48_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_BT_UL_16_48_LP_DATA_ADDR 0x2E70 +#define OMAP_ABE_S_BT_UL_16_48_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_BT_UL_16_48_HP_DATA_ADDR 0x2EC8 +#define OMAP_ABE_S_BT_UL_16_48_HP_DATA_SIZE 0x28 + +#define OMAP_ABE_S_BT_DL_48_8_LP_DATA_ADDR 0x2EF0 +#define OMAP_ABE_S_BT_DL_48_8_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_BT_DL_48_8_HP_DATA_ADDR 0x2F48 +#define OMAP_ABE_S_BT_DL_48_8_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_BT_DL_48_16_LP_DATA_ADDR 0x2F80 +#define OMAP_ABE_S_BT_DL_48_16_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_BT_DL_48_16_HP_DATA_ADDR 0x2FD8 +#define OMAP_ABE_S_BT_DL_48_16_HP_DATA_SIZE 0x28 + +#define OMAP_ABE_S_ECHO_REF_48_8_LP_DATA_ADDR 0x3000 +#define OMAP_ABE_S_ECHO_REF_48_8_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_ECHO_REF_48_8_HP_DATA_ADDR 0x3058 +#define OMAP_ABE_S_ECHO_REF_48_8_HP_DATA_SIZE 0x38 + +#define OMAP_ABE_S_ECHO_REF_48_16_LP_DATA_ADDR 0x3090 +#define OMAP_ABE_S_ECHO_REF_48_16_LP_DATA_SIZE 0x58 + +#define OMAP_ABE_S_ECHO_REF_48_16_HP_DATA_ADDR 0x30E8 +#define OMAP_ABE_S_ECHO_REF_48_16_HP_DATA_SIZE 0x28 + +#define OMAP_ABE_S_APS_IIRMEM1_ADDR 0x3110 +#define OMAP_ABE_S_APS_IIRMEM1_SIZE 0x48 + +#define OMAP_ABE_S_APS_M_IIRMEM2_ADDR 0x3158 +#define OMAP_ABE_S_APS_M_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_APS_C_IIRMEM2_ADDR 0x3170 +#define OMAP_ABE_S_APS_C_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_APS_DL1_OUTSAMPLES_ADDR 0x3188 +#define OMAP_ABE_S_APS_DL1_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_APS_DL1_COIL_OUTSAMPLES_ADDR 0x3198 +#define OMAP_ABE_S_APS_DL1_COIL_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_APS_DL2_L_OUTSAMPLES_ADDR 0x31A8 +#define OMAP_ABE_S_APS_DL2_L_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_APS_DL2_L_COIL_OUTSAMPLES_ADDR 0x31B8 +#define OMAP_ABE_S_APS_DL2_L_COIL_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_APS_DL2_R_OUTSAMPLES_ADDR 0x31C8 +#define OMAP_ABE_S_APS_DL2_R_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_APS_DL2_R_COIL_OUTSAMPLES_ADDR 0x31D8 +#define OMAP_ABE_S_APS_DL2_R_COIL_OUTSAMPLES_SIZE 0x10 + +#define OMAP_ABE_S_XINASRC_ECHO_REF_ADDR 0x31E8 +#define OMAP_ABE_S_XINASRC_ECHO_REF_SIZE 0x140 + +#define OMAP_ABE_S_ECHO_REF_16K_ADDR 0x3328 +#define OMAP_ABE_S_ECHO_REF_16K_SIZE 0x28 + +#define OMAP_ABE_S_ECHO_REF_8K_ADDR 0x3350 +#define OMAP_ABE_S_ECHO_REF_8K_SIZE 0x18 + +#define OMAP_ABE_S_DL1_EQ_ADDR 0x3368 +#define OMAP_ABE_S_DL1_EQ_SIZE 0x60 + +#define OMAP_ABE_S_DL2_EQ_ADDR 0x33C8 +#define OMAP_ABE_S_DL2_EQ_SIZE 0x60 + +#define OMAP_ABE_S_DL1_GAIN_OUT_ADDR 0x3428 +#define OMAP_ABE_S_DL1_GAIN_OUT_SIZE 0x60 + +#define OMAP_ABE_S_DL2_GAIN_OUT_ADDR 0x3488 +#define OMAP_ABE_S_DL2_GAIN_OUT_SIZE 0x60 + +#define OMAP_ABE_S_APS_DL2_L_IIRMEM1_ADDR 0x34E8 +#define OMAP_ABE_S_APS_DL2_L_IIRMEM1_SIZE 0x48 + +#define OMAP_ABE_S_APS_DL2_R_IIRMEM1_ADDR 0x3530 +#define OMAP_ABE_S_APS_DL2_R_IIRMEM1_SIZE 0x48 + +#define OMAP_ABE_S_APS_DL2_L_M_IIRMEM2_ADDR 0x3578 +#define OMAP_ABE_S_APS_DL2_L_M_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_APS_DL2_R_M_IIRMEM2_ADDR 0x3590 +#define OMAP_ABE_S_APS_DL2_R_M_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_APS_DL2_L_C_IIRMEM2_ADDR 0x35A8 +#define OMAP_ABE_S_APS_DL2_L_C_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_APS_DL2_R_C_IIRMEM2_ADDR 0x35C0 +#define OMAP_ABE_S_APS_DL2_R_C_IIRMEM2_SIZE 0x18 + +#define OMAP_ABE_S_DL1_APS_ADDR 0x35D8 +#define OMAP_ABE_S_DL1_APS_SIZE 0x60 + +#define OMAP_ABE_S_DL2_L_APS_ADDR 0x3638 +#define OMAP_ABE_S_DL2_L_APS_SIZE 0x60 + +#define OMAP_ABE_S_DL2_R_APS_ADDR 0x3698 +#define OMAP_ABE_S_DL2_R_APS_SIZE 0x60 + +#define OMAP_ABE_S_APS_DL1_EQ_DATA_ADDR 0x36F8 +#define OMAP_ABE_S_APS_DL1_EQ_DATA_SIZE 0x48 + +#define OMAP_ABE_S_APS_DL2_EQ_DATA_ADDR 0x3740 +#define OMAP_ABE_S_APS_DL2_EQ_DATA_SIZE 0x48 + +#define OMAP_ABE_S_DC_DCVALUE_ADDR 0x3788 +#define OMAP_ABE_S_DC_DCVALUE_SIZE 0x8 + +#define OMAP_ABE_S_VIBRA_ADDR 0x3790 +#define OMAP_ABE_S_VIBRA_SIZE 0x30 + +#define OMAP_ABE_S_VIBRA2_IN_ADDR 0x37C0 +#define OMAP_ABE_S_VIBRA2_IN_SIZE 0x30 + +#define OMAP_ABE_S_VIBRA2_ADDR_ADDR 0x37F0 +#define OMAP_ABE_S_VIBRA2_ADDR_SIZE 0x8 + +#define OMAP_ABE_S_VIBRACTRL_FORRIGHTSM_ADDR 0x37F8 +#define OMAP_ABE_S_VIBRACTRL_FORRIGHTSM_SIZE 0xC0 + +#define OMAP_ABE_S_RNOISE_MEM_ADDR 0x38B8 +#define OMAP_ABE_S_RNOISE_MEM_SIZE 0x8 + +#define OMAP_ABE_S_CTRL_ADDR 0x38C0 +#define OMAP_ABE_S_CTRL_SIZE 0x90 + +#define OMAP_ABE_S_VIBRA1_IN_ADDR 0x3950 +#define OMAP_ABE_S_VIBRA1_IN_SIZE 0x30 + +#define OMAP_ABE_S_VIBRA1_TEMP_ADDR 0x3980 +#define OMAP_ABE_S_VIBRA1_TEMP_SIZE 0xC0 + +#define OMAP_ABE_S_VIBRACTRL_FORLEFTSM_ADDR 0x3A40 +#define OMAP_ABE_S_VIBRACTRL_FORLEFTSM_SIZE 0xC0 + +#define OMAP_ABE_S_VIBRA1_MEM_ADDR 0x3B00 +#define OMAP_ABE_S_VIBRA1_MEM_SIZE 0x58 + +#define OMAP_ABE_S_VIBRACTRL_STEREO_ADDR 0x3B58 +#define OMAP_ABE_S_VIBRACTRL_STEREO_SIZE 0xC0 + +#define OMAP_ABE_S_AMIC_96_48_DATA_ADDR 0x3C18 +#define OMAP_ABE_S_AMIC_96_48_DATA_SIZE 0x98 + +#define OMAP_ABE_S_DMIC0_96_48_DATA_ADDR 0x3CB0 +#define OMAP_ABE_S_DMIC0_96_48_DATA_SIZE 0x98 + +#define OMAP_ABE_S_DMIC1_96_48_DATA_ADDR 0x3D48 +#define OMAP_ABE_S_DMIC1_96_48_DATA_SIZE 0x98 + +#define OMAP_ABE_S_DMIC2_96_48_DATA_ADDR 0x3DE0 +#define OMAP_ABE_S_DMIC2_96_48_DATA_SIZE 0x98 + +#define OMAP_ABE_S_DBG_8K_PATTERN_ADDR 0x3E78 +#define OMAP_ABE_S_DBG_8K_PATTERN_SIZE 0x10 + +#define OMAP_ABE_S_DBG_16K_PATTERN_ADDR 0x3E88 +#define OMAP_ABE_S_DBG_16K_PATTERN_SIZE 0x20 + +#define OMAP_ABE_S_DBG_24K_PATTERN_ADDR 0x3EA8 +#define OMAP_ABE_S_DBG_24K_PATTERN_SIZE 0x30 + +#define OMAP_ABE_S_DBG_48K_PATTERN_ADDR 0x3ED8 +#define OMAP_ABE_S_DBG_48K_PATTERN_SIZE 0x60 + +#define OMAP_ABE_S_DBG_96K_PATTERN_ADDR 0x3F38 +#define OMAP_ABE_S_DBG_96K_PATTERN_SIZE 0xC0 + +#define OMAP_ABE_S_MM_EXT_IN_ADDR 0x3FF8 +#define OMAP_ABE_S_MM_EXT_IN_SIZE 0x60 + +#define OMAP_ABE_S_MM_EXT_IN_L_ADDR 0x4058 +#define OMAP_ABE_S_MM_EXT_IN_L_SIZE 0x60 + +#define OMAP_ABE_S_MM_EXT_IN_R_ADDR 0x40B8 +#define OMAP_ABE_S_MM_EXT_IN_R_SIZE 0x60 + +#define OMAP_ABE_S_MIC4_ADDR 0x4118 +#define OMAP_ABE_S_MIC4_SIZE 0x60 + +#define OMAP_ABE_S_MIC4_L_ADDR 0x4178 +#define OMAP_ABE_S_MIC4_L_SIZE 0x60 + +#define OMAP_ABE_S_MIC4_R_ADDR 0x41D8 +#define OMAP_ABE_S_MIC4_R_SIZE 0x60 + +#define OMAP_ABE_S_HW_TEST_ADDR 0x4238 +#define OMAP_ABE_S_HW_TEST_SIZE 0x8 + +#define OMAP_ABE_S_XINASRC_BT_UL_ADDR 0x4240 +#define OMAP_ABE_S_XINASRC_BT_UL_SIZE 0x140 + +#define OMAP_ABE_S_XINASRC_BT_DL_ADDR 0x4380 +#define OMAP_ABE_S_XINASRC_BT_DL_SIZE 0x140 + +#define OMAP_ABE_S_BT_DL_8K_TEMP_ADDR 0x44C0 +#define OMAP_ABE_S_BT_DL_8K_TEMP_SIZE 0x10 + +#define OMAP_ABE_S_BT_DL_16K_TEMP_ADDR 0x44D0 +#define OMAP_ABE_S_BT_DL_16K_TEMP_SIZE 0x20 diff --git a/sound/soc/omap/abe/abe_taskid.h b/sound/soc/omap/abe/abe_taskid.h new file mode 100644 index 0000000..f55caba --- /dev/null +++ b/sound/soc/omap/abe/abe_taskid.h @@ -0,0 +1,188 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_TASKID_H_ +#define _ABE_TASKID_H_ + +#define C_ABE_FW_TASK_DL1_APS_CORE 0 +#define C_ABE_FW_TASK_DL1_APS_COIL_CORE 1 +#define C_ABE_FW_TASK_DL2_L_APS_CORE 2 +#define C_ABE_FW_TASK_DL2_L_APS_COIL_CORE 3 +#define C_ABE_FW_TASK_DL2_R_APS_CORE 4 +#define C_ABE_FW_TASK_DL2_R_APS_COIL_CORE 5 +#define C_ABE_FW_TASK_ASRC_VX_DL_8 6 +#define C_ABE_FW_TASK_ASRC_VX_DL_16 7 +#define C_ABE_FW_TASK_ASRC_MM_EXT_IN 8 +#define C_ABE_FW_TASK_ASRC_VX_UL_8 9 +#define C_ABE_FW_TASK_ASRC_VX_UL_16 10 +#define C_ABE_FW_TASK_VX_UL_48_8_DEC 11 +#define C_ABE_FW_TASK_VX_UL_48_16_DEC 12 +#define C_ABE_FW_TASK_BT_DL_48_8_DEC 13 +#define C_ABE_FW_TASK_BT_DL_48_16_DEC 14 +#define C_ABE_FW_TASK_ECHO_REF_48_8_DEC 15 +#define C_ABE_FW_TASK_ECHO_REF_48_16_DEC 16 +#define C_ABE_FW_TASK_DL2_EQ 17 +#define C_ABE_FW_TASK_DL2_L_APS_IIR 18 +#define C_ABE_FW_TASK_DL2_R_APS_IIR 19 +#define C_ABE_FW_TASK_DL2_APS_EQ 20 +#define C_ABE_FW_TASK_ECHO_REF_48_16 21 +#define C_ABE_FW_TASK_ECHO_REF_48_8 22 +#define C_ABE_FW_TASK_GAIN_UPDATE 23 +#define C_ABE_FW_TASK_SideTone 24 +#define C_ABE_FW_TASK_VX_DL_8_48_LP 25 +#define C_ABE_FW_TASK_VX_DL_8_48_HP 26 +#define C_ABE_FW_TASK_VX_DL_16_48_LP 27 +#define C_ABE_FW_TASK_VX_DL_16_48_HP 28 +#define C_ABE_FW_TASK_VX_UL_48_8_LP 29 +#define C_ABE_FW_TASK_VX_UL_48_8_HP 30 +#define C_ABE_FW_TASK_VX_UL_48_16_LP 31 +#define C_ABE_FW_TASK_VX_UL_48_16_HP 32 +#define C_ABE_FW_TASK_BT_UL_8_48_LP 33 +#define C_ABE_FW_TASK_BT_UL_8_48_HP 34 +#define C_ABE_FW_TASK_BT_UL_16_48_LP 35 +#define C_ABE_FW_TASK_BT_UL_16_48_HP 36 +#define C_ABE_FW_TASK_BT_DL_48_8_LP 37 +#define C_ABE_FW_TASK_BT_DL_48_8_HP 38 +#define C_ABE_FW_TASK_BT_DL_48_16_LP 39 +#define C_ABE_FW_TASK_BT_DL_48_16_HP 40 +#define C_ABE_FW_TASK_ECHO_REF_48_8_LP 41 +#define C_ABE_FW_TASK_ECHO_REF_48_8_HP 42 +#define C_ABE_FW_TASK_ECHO_REF_48_16_LP 43 +#define C_ABE_FW_TASK_ECHO_REF_48_16_HP 44 +#define C_ABE_FW_TASK_DL1_EQ 45 +#define C_ABE_FW_TASK_DL1_APS_IIR 46 +#define C_ABE_FW_TASK_DL1_APS_EQ 47 +#define C_ABE_FW_TASK_IHF_48_96_LP 48 +#define C_ABE_FW_TASK_EARP_48_96_LP 49 +#define C_ABE_FW_TASK_DL1_GAIN 50 +#define C_ABE_FW_TASK_DL2_GAIN 51 +#define C_ABE_FW_TASK_IO_PING_PONG 52 +#define C_ABE_FW_TASK_IO_DMIC 53 +#define C_ABE_FW_TASK_IO_PDM_UL 54 +#define C_ABE_FW_TASK_IO_BT_VX_UL 55 +#define C_ABE_FW_TASK_IO_MM_UL 56 +#define C_ABE_FW_TASK_IO_MM_UL2 57 +#define C_ABE_FW_TASK_IO_VX_UL 58 +#define C_ABE_FW_TASK_IO_MM_DL 59 +#define C_ABE_FW_TASK_IO_VX_DL 60 +#define C_ABE_FW_TASK_IO_TONES_DL 61 +#define C_ABE_FW_TASK_IO_VIB_DL 62 +#define C_ABE_FW_TASK_IO_BT_VX_DL 63 +#define C_ABE_FW_TASK_IO_PDM_DL 64 +#define C_ABE_FW_TASK_IO_MM_EXT_OUT 65 +#define C_ABE_FW_TASK_IO_MM_EXT_IN 66 +#define C_ABE_FW_TASK_IO_TDM_OUT 67 +#define C_ABE_FW_TASK_IO_TDM_IN 68 +#define C_ABE_FW_TASK_DEBUG_IRQFIFO 69 +#define C_ABE_FW_TASK_EchoMixer 70 +#define C_ABE_FW_TASK_SDTMixer 71 +#define C_ABE_FW_TASK_DL1Mixer 72 +#define C_ABE_FW_TASK_DL2Mixer 73 +#define C_ABE_FW_TASK_VXRECMixer 74 +#define C_ABE_FW_TASK_ULMixer 75 +#define C_ABE_FW_TASK_VIBRA_PACK 76 +#define C_ABE_FW_TASK_VX_DL_8_48_0SR 77 +#define C_ABE_FW_TASK_VX_DL_16_48_0SR 78 +#define C_ABE_FW_TASK_BT_UL_8_48_0SR 79 +#define C_ABE_FW_TASK_BT_UL_16_48_0SR 80 +#define C_ABE_FW_TASK_IHF_48_96_0SR 81 +#define C_ABE_FW_TASK_EARP_48_96_0SR 82 +#define C_ABE_FW_TASK_AMIC_SPLIT 83 +#define C_ABE_FW_TASK_DMIC1_SPLIT 84 +#define C_ABE_FW_TASK_DMIC2_SPLIT 85 +#define C_ABE_FW_TASK_DMIC3_SPLIT 86 +#define C_ABE_FW_TASK_VXREC_SPLIT 87 +#define C_ABE_FW_TASK_BT_UL_SPLIT 88 +#define C_ABE_FW_TASK_MM_SPLIT 89 +#define C_ABE_FW_TASK_DL2_APS_SPLIT 90 +#define C_ABE_FW_TASK_VIBRA_SPLIT 91 +#define C_ABE_FW_TASK_MM_EXT_IN_SPLIT 92 +#define C_ABE_FW_TASK_ECHO_REF_SPLIT 93 +#define C_ABE_FW_TASK_MIC4_SPLIT 94 +#define C_ABE_FW_TASK_VX_UL_ROUTING 95 +#define C_ABE_FW_TASK_MM_UL2_ROUTING 96 +#define C_ABE_FW_TASK_VIBRA1 97 +#define C_ABE_FW_TASK_VIBRA2 98 +#define C_ABE_FW_TASK_BT_UL_16_48 99 +#define C_ABE_FW_TASK_BT_UL_8_48 100 +#define C_ABE_FW_TASK_BT_DL_48_16 101 +#define C_ABE_FW_TASK_BT_DL_48_8 102 +#define C_ABE_FW_TASK_VX_DL_16_48 103 +#define C_ABE_FW_TASK_VX_DL_8_48 104 +#define C_ABE_FW_TASK_VX_UL_48_16 105 +#define C_ABE_FW_TASK_VX_UL_48_8 106 +#define C_ABE_FW_TASK_DBG_SYNC 107 +#define C_ABE_FW_TASK_APS_DL1_IRQs 108 +#define C_ABE_FW_TASK_APS_DL2_L_IRQs 109 +#define C_ABE_FW_TASK_APS_DL2_R_IRQs 110 +#define C_ABE_FW_TASK_AMIC_96_48_LP 111 +#define C_ABE_FW_TASK_DMIC1_96_48_LP 112 +#define C_ABE_FW_TASK_DMIC2_96_48_LP 113 +#define C_ABE_FW_TASK_DMIC3_96_48_LP 114 +#define C_ABE_FW_TASK_INIT_FW_MEMORY 115 +#define C_ABE_FW_TASK_DEBUGTRACE_VX_ASRCs 116 +#define C_ABE_FW_TASK_ASRC_BT_UL_8 117 +#define C_ABE_FW_TASK_ASRC_BT_UL_16 118 +#define C_ABE_FW_TASK_ASRC_BT_DL_8 119 +#define C_ABE_FW_TASK_ASRC_BT_DL_16 120 +#define C_ABE_FW_TASK_BT_DL_48_8_HP_OPP100 121 +#define C_ABE_FW_TASK_BT_DL_48_16_HP_OPP100 122 +#define C_ABE_FW_TASK_BT_DL_48_8_OPP100 123 +#define C_ABE_FW_TASK_BT_DL_48_16_OPP100 124 + +#endif /* _ABE_TASKID_H_ */ diff --git a/sound/soc/omap/abe/abe_typ.h b/sound/soc/omap/abe/abe_typ.h new file mode 100644 index 0000000..650d043 --- /dev/null +++ b/sound/soc/omap/abe/abe_typ.h @@ -0,0 +1,654 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include "abe_def.h" +#include "abe_initxxx_labels.h" + +#ifndef _ABE_TYP_H_ +#define _ABE_TYP_H_ +/* + * BASIC TYPES + */ +#define MAX_UINT8 ((((1L << 7) - 1) << 1) + 1) +#define MAX_UINT16 ((((1L << 15) - 1) << 1) + 1) +#define MAX_UINT32 ((((1L << 31) - 1) << 1) + 1) +#define s8 char +#define u8 unsigned char +#define s16 short +#define u16 unsigned short +#define s32 int +#define u32 unsigned int +/* returned status from HAL APIs */ +#define abehal_status u32 +/* 4 bytes Bit field indicating the type of informations to be traced */ +typedef u32 abe_dbg_mask_t; +/* scheduling task loops (250us / 272us with respectively 48kHz / + 44.1kHz on Phoenix). */ +typedef u32 abe_dbg_t; +/* Index to the table of sequences */ +typedef u32 abe_seq_code_t; +/* Index to the table of subroutines called in the sequence */ +typedef u32 abe_sub_code_t; +/* subroutine with no parameter */ +typedef void (*abe_subroutine0) (void); +/* subroutine with one parameter */ +typedef void (*abe_subroutine1) (u32); +typedef void (*abe_subroutine2) (u32, u32); +typedef void (*abe_subroutine3) (u32, u32, u32); +typedef void (*abe_subroutine4) (u32, u32, u32, u32); +/* + * CODE PORTABILITY - FUTURE PATCHES + * + * 32bits field for having the code compatible with future revisions of + * the hardware (audio integration) or evolution of the software + * partitionning. Used for the highest level APIs (launch_sequences) + */ +typedef u32 abe_patch_rev; +/* + * ENUMS + */ +/* + * MEMORY CONFIG TYPE + * + * 0: Ultra Lowest power consumption audio player + * 1: OPP 25% (simple multimedia features) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% (multimedia complex use-cases) + */ +#define ABE_AUDIO_PLAYER_ON_HEADSET_OR_EARPHONE 1 +#define ABE_DRIFT_MANAGEMENT_FOR_AUDIO_PLAYER 2 +#define ABE_DRIFT_MANAGEMENT_FOR_VOICE_CALL 3 +#define ABE_VOICE_CALL_ON_HEADSET_OR_EARPHONE_OR_BT 4 +#define ABE_MULTIMEDIA_AUDIO_RECORDER 5 +#define ABE_VIBRATOR_OR_HAPTICS 6 +#define ABE_VOICE_CALL_ON_HANDS_FREE_SPEAKER 7 +#define ABE_RINGER_TONES 8 +#define ABE_VOICE_CALL_WITH_EARPHONE_ACTIVE_NOISE_CANCELLER 9 +#define ABE_LAST_USE_CASE 10 +/* + * OPP TYPE + * + * 0: Ultra Lowest power consumption audio player + * 1: OPP 25% (simple multimedia features) + * 2: OPP 50% (multimedia and voice calls) + * 3: OPP100% (multimedia complex use-cases) + */ +#define ABE_OPP0 0 +#define ABE_OPP25 1 +#define ABE_OPP50 2 +#define ABE_OPP100 3 +/* + * DMIC DECIMATION RATIO + * + */ +#define ABE_DEC16 16 +#define ABE_DEC25 25 +#define ABE_DEC32 32 +#define ABE_DEC40 40 +/* + * SAMPLES TYPE + * + * mono 16 bit sample LSB aligned, 16 MSB bits are unused; + * mono right shifted to 16bits LSBs on a 32bits DMEM FIFO for McBSP + * TX purpose; + * mono sample MSB aligned (16/24/32bits); + * two successive mono samples in one 32bits container; + * Two L/R 16bits samples in a 32bits container; + * Two channels defined with two MSB aligned samples; + * Three channels defined with three MSB aligned samples (MIC); + * Four channels defined with four MSB aligned samples (MIC); + * . . . + * Eight channels defined with eight MSB aligned samples (MIC); + */ +#define MONO_MSB 1 +#define MONO_RSHIFTED_16 2 +#define STEREO_RSHIFTED_16 3 +#define STEREO_16_16 4 +#define STEREO_MSB 5 +#define THREE_MSB 6 +#define FOUR_MSB 7 +#define FIVE_MSB 8 +#define SIX_MSB 9 +#define SEVEN_MSB 10 +#define EIGHT_MSB 11 +#define NINE_MSB 12 +#define TEN_MSB 13 +/* + * PORT PROTOCOL TYPE - abe_port_protocol_switch_id + */ +#define SLIMBUS_PORT_PROT 1 +#define SERIAL_PORT_PROT 2 +#define TDM_SERIAL_PORT_PROT 3 +#define DMIC_PORT_PROT 4 +#define MCPDMDL_PORT_PROT 5 +#define MCPDMUL_PORT_PROT 6 +#define PINGPONG_PORT_PROT 7 +#define DMAREQ_PORT_PROT 8 +/* + * PORT IDs, this list is aligned with the FW data mapping + */ +#define OMAP_ABE_DMIC_PORT 0 +#define OMAP_ABE_PDM_UL_PORT 1 +#define OMAP_ABE_BT_VX_UL_PORT 2 +#define OMAP_ABE_MM_UL_PORT 3 +#define OMAP_ABE_MM_UL2_PORT 4 +#define OMAP_ABE_VX_UL_PORT 5 +#define OMAP_ABE_MM_DL_PORT 6 +#define OMAP_ABE_VX_DL_PORT 7 +#define OMAP_ABE_TONES_DL_PORT 8 +#define OMAP_ABE_VIB_DL_PORT 9 +#define OMAP_ABE_BT_VX_DL_PORT 10 +#define OMAP_ABE_PDM_DL_PORT 11 +#define OMAP_ABE_MM_EXT_OUT_PORT 12 +#define OMAP_ABE_MM_EXT_IN_PORT 13 +#define TDM_DL_PORT 14 +#define TDM_UL_PORT 15 +#define DEBUG_PORT 16 +#define LAST_PORT_ID 17 +/* definitions for the compatibility with HAL05xx */ +#define PDM_DL1_PORT 18 +#define PDM_DL2_PORT 19 +#define PDM_VIB_PORT 20 +/* There is only one DMIC port, always used with 6 samples + per 96kHz periods */ +#define DMIC_PORT1 DMIC_PORT +#define DMIC_PORT2 DMIC_PORT +#define DMIC_PORT3 DMIC_PORT +/* + * ABE_DL_SRC_ID source of samples + */ +#define SRC_DL1_MIXER_OUTPUT DL1_M_labelID +#define SRC_SDT_MIXER_OUTPUT SDT_M_labelID +#define SRC_DL1_GAIN_OUTPUT DL1_GAIN_out_labelID +#define SRC_DL1_EQ_OUTPUT DL1_EQ_labelID +#define SRC_DL2_GAIN_OUTPUT DL2_GAIN_out_labelID +#define SRC_DL2_EQ_OUTPUT DL2_EQ_labelID +#define SRC_MM_DL MM_DL_labelID +#define SRC_TONES_DL Tones_labelID +#define SRC_VX_DL VX_DL_labelID +#define SRC_VX_UL VX_UL_labelID +#define SRC_MM_UL2 MM_UL2_labelID +#define SRC_MM_UL MM_UL_labelID +/* + * abe_patched_pattern_id + * selection of the audio engine signal to + * replace by a precomputed pattern + */ +#define DBG_PATCH_AMIC 1 +#define DBG_PATCH_DMIC1 2 +#define DBG_PATCH_DMIC2 3 +#define DBG_PATCH_DMIC3 4 +#define DBG_PATCH_VX_REC 5 +#define DBG_PATCH_BT_UL 6 +#define DBG_PATCH_MM_DL 7 +#define DBG_PATCH_DL2_EQ 8 +#define DBG_PATCH_VIBRA 9 +#define DBG_PATCH_MM_EXT_IN 10 +#define DBG_PATCH_EANC_FBK_Out 11 +#define DBG_PATCH_MIC4 12 +#define DBG_PATCH_MM_DL_MIXDL1 13 +#define DBG_PATCH_MM_DL_MIXDL2 14 +/* + * Signal processing module names - EQ APS MIX ROUT + */ +/* equalizer downlink path headset + earphone */ +#define FEAT_EQ1 1 +/* equalizer downlink path integrated handsfree LEFT */ +#define FEAT_EQ2L (FEAT_EQ1+1) +/* equalizer downlink path integrated handsfree RIGHT */ +#define FEAT_EQ2R (FEAT_EQ2L+1) +/* equalizer downlink path side-tone */ +#define FEAT_EQSDT (FEAT_EQ2R+1) +/* equalizer uplink path AMIC */ +#define FEAT_EQAMIC (FEAT_EQSDT+1) +/* equalizer uplink path DMIC */ +#define FEAT_EQDMIC (FEAT_EQAMIC+1) +/* Acoustic protection for headset */ +#define FEAT_APS1 (FEAT_EQDMIC+1) +/* acoustic protection high-pass filter for handsfree "Left" */ +#define FEAT_APS2 (FEAT_APS1+1) +/* acoustic protection high-pass filter for handsfree "Right" */ +#define FEAT_APS3 (FEAT_APS2+1) +/* asynchronous sample-rate-converter for the downlink voice path */ +#define FEAT_ASRC1 (FEAT_APS3+1) +/* asynchronous sample-rate-converter for the uplink voice path */ +#define FEAT_ASRC2 (FEAT_ASRC1+1) +/* asynchronous sample-rate-converter for the multimedia player */ +#define FEAT_ASRC3 (FEAT_ASRC2+1) +/* asynchronous sample-rate-converter for the echo reference */ +#define FEAT_ASRC4 (FEAT_ASRC3+1) +/* mixer of the headset and earphone path */ +#define FEAT_MIXDL1 (FEAT_ASRC4+1) +/* mixer of the hands-free path */ +#define FEAT_MIXDL2 (FEAT_MIXDL1+1) +/* mixer for audio being sent on the voice_ul path */ +#define FEAT_MIXAUDUL (FEAT_MIXDL2+1) +/* mixer for voice communication recording */ +#define FEAT_MIXVXREC (FEAT_MIXAUDUL+1) +/* mixer for side-tone */ +#define FEAT_MIXSDT (FEAT_MIXVXREC+1) +/* mixer for echo reference */ +#define FEAT_MIXECHO (FEAT_MIXSDT+1) +/* router of the uplink path */ +#define FEAT_UPROUTE (FEAT_MIXECHO+1) +/* all gains */ +#define FEAT_GAINS (FEAT_UPROUTE+1) +#define FEAT_GAINS_DMIC1 (FEAT_GAINS+1) +#define FEAT_GAINS_DMIC2 (FEAT_GAINS_DMIC1+1) +#define FEAT_GAINS_DMIC3 (FEAT_GAINS_DMIC2+1) +#define FEAT_GAINS_AMIC (FEAT_GAINS_DMIC3+1) +#define FEAT_GAINS_SPLIT (FEAT_GAINS_AMIC+1) +#define FEAT_GAINS_DL1 (FEAT_GAINS_SPLIT+1) +#define FEAT_GAINS_DL2 (FEAT_GAINS_DL1+1) +#define FEAT_GAIN_BTUL (FEAT_GAINS_DL2+1) +/* sequencing queue of micro tasks */ +#define FEAT_SEQ (FEAT_GAIN_BTUL+1) +/* Phoenix control queue through McPDM */ +#define FEAT_CTL (FEAT_SEQ+1) +/* list of features of the firmware -------------------------------*/ +#define MAXNBFEATURE FEAT_CTL +/* abe_equ_id */ +/* equalizer downlink path headset + earphone */ +#define EQ1 FEAT_EQ1 +/* equalizer downlink path integrated handsfree LEFT */ +#define EQ2L FEAT_EQ2L +#define EQ2R FEAT_EQ2R +/* equalizer downlink path side-tone */ +#define EQSDT FEAT_EQSDT +#define EQAMIC FEAT_EQAMIC +#define EQDMIC FEAT_EQDMIC +/* abe_aps_id */ +/* Acoustic protection for headset */ +#define APS1 FEAT_APS1 +#define APS2L FEAT_APS2 +#define APS2R FEAT_APS3 +/* abe_asrc_id */ +/* asynchronous sample-rate-converter for the downlink voice path */ +#define ASRC1 FEAT_ASRC1 +/* asynchronous sample-rate-converter for the uplink voice path */ +#define ASRC2 FEAT_ASRC2 +/* asynchronous sample-rate-converter for the multimedia player */ +#define ASRC3 FEAT_ASRC3 +/* asynchronous sample-rate-converter for the voice uplink echo_reference */ +#define ASRC4 FEAT_ASRC4 +/* abe_mixer_id */ +#define MIXDL1 FEAT_MIXDL1 +#define MIXDL2 FEAT_MIXDL2 +#define MIXSDT FEAT_MIXSDT +#define MIXECHO FEAT_MIXECHO +#define MIXAUDUL FEAT_MIXAUDUL +#define MIXVXREC FEAT_MIXVXREC +/* abe_router_id */ +/* there is only one router up to now */ +#define UPROUTE FEAT_UPROUTE +/* + * GAIN IDs + */ +#define GAINS_DMIC1 FEAT_GAINS_DMIC1 +#define GAINS_DMIC2 FEAT_GAINS_DMIC2 +#define GAINS_DMIC3 FEAT_GAINS_DMIC3 +#define GAINS_AMIC FEAT_GAINS_AMIC +#define GAINS_SPLIT FEAT_GAINS_SPLIT +#define GAINS_DL1 FEAT_GAINS_DL1 +#define GAINS_DL2 FEAT_GAINS_DL2 +#define GAINS_BTUL FEAT_GAIN_BTUL +/* + * EVENT GENERATORS - abe_event_id + */ +#define EVENT_TIMER 0 +#define EVENT_44100 1 +/* + * SERIAL PORTS IDs - abe_mcbsp_id + */ +#define MCBSP1_TX MCBSP1_DMA_TX +#define MCBSP1_RX MCBSP1_DMA_RX +#define MCBSP2_TX MCBSP2_DMA_TX +#define MCBSP2_RX MCBSP2_DMA_RX +#define MCBSP3_TX MCBSP3_DMA_TX +#define MCBSP3_RX MCBSP3_DMA_RX +/* + * SERIAL PORTS IDs - abe_slimbus_id; + */ +#define SLIMBUS1_TX0 SLIMBUS1_DMA_TX0 +#define SLIMBUS1_TX1 SLIMBUS1_DMA_TX1 +#define SLIMBUS1_TX2 SLIMBUS1_DMA_TX2 +#define SLIMBUS1_TX3 SLIMBUS1_DMA_TX3 +#define SLIMBUS1_TX4 SLIMBUS1_DMA_TX4 +#define SLIMBUS1_TX5 SLIMBUS1_DMA_TX5 +#define SLIMBUS1_TX6 SLIMBUS1_DMA_TX6 +#define SLIMBUS1_TX7 SLIMBUS1_DMA_TX7 +#define SLIMBUS1_RX0 SLIMBUS1_DMA_RX0 +#define SLIMBUS1_RX1 SLIMBUS1_DMA_RX1 +#define SLIMBUS1_RX2 SLIMBUS1_DMA_RX2 +#define SLIMBUS1_RX3 SLIMBUS1_DMA_RX3 +#define SLIMBUS1_RX4 SLIMBUS1_DMA_RX4 +#define SLIMBUS1_RX5 SLIMBUS1_DMA_RX5 +#define SLIMBUS1_RX6 SLIMBUS1_DMA_RX6 +#define SLIMBUS1_RX7 SLIMBUS1_DMA_RX7 +#define SLIMBUS_UNUSED _DUMMY_FIFO_ +/* + * ----------------- TYPES USED FOR APIS --------------- + */ + +/* + * EQU_T + * + * coefficients of the equalizer + */ +typedef struct { + /* type of filter */ + u32 equ_type; + /* filter length */ + u32 equ_length; + union { + /* parameters are the direct and recursive coefficients in */ + /* Q6.26 integer fixed-point format. */ + s32 type1[NBEQ1]; + struct { + /* center frequency of the band [Hz] */ + s32 freq[NBEQ2]; + /* gain of each band. [dB] */ + s32 gain[NBEQ2]; + /* Q factor of this band [dB] */ + s32 q[NBEQ2]; + } type2; + } coef; + s32 equ_param3; +} abe_equ_t; + +/* + * APS_T + * + * coefficients of the Acoustics Protection and Safety + */ +struct abe_aps_t { + s32 coef1[NBAPS1]; + s32 coef2[NBAPS2]; +}; + +struct abe_aps_energy_t { + /* structure of two energy_t estimation for coil and membrane */ + u32 e1; + u32 e2; +}; +/* + * ROUTER_T + * + * table of indexes in unsigned bytes + */ +typedef u16 abe_router_t; +/* + * DATA_FORMAT_T + * + * used in port declaration + */ +typedef struct { + /* Sampling frequency of the stream */ + u32 f; + /* Sample format type */ + u32 samp_format; +} abe_data_format_t; +/* + * PORT_PROTOCOL_T + * + * port declaration + */ +typedef struct { + /* Direction=0 means input from AESS point of view */ + u32 direction; + /* Protocol type (switch) during the data transfers */ + u32 protocol_switch; + union { + /* Slimbus peripheral connected to ATC */ + struct { + /* Address of ATC Slimbus descriptor's index */ + u32 desc_addr1; + /* DMEM address 1 in bytes */ + u32 buf_addr1; + /* DMEM buffer size size in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + /* Second ATC index for SlimBus reception (or NULL) */ + u32 desc_addr2; + /* DMEM address 2 in bytes */ + u32 buf_addr2; + } prot_slimbus; + /* McBSP/McASP peripheral connected to ATC */ + struct { + u32 desc_addr; + /* Address of ATC McBSP/McASP descriptor's in bytes */ + u32 buf_addr; + /* DMEM address in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + } prot_serial; + /* DMIC peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* Number of activated DMIC */ + u32 nbchan; + } prot_dmic; + /* McPDMDL peripheral connected to ATC */ + struct { + /* DMEM address in bytes */ + u32 buf_addr; + /* DMEM size in bytes */ + u32 buf_size; + /* Control allowed on McPDM DL */ + u32 control; + } prot_mcpdmdl; + /* McPDMUL peripheral connected to ATC */ + struct { + /* DMEM address size in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + } prot_mcpdmul; + /* Ping-Pong interface to the Host using cache-flush */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM size in bytes for each ping and pong buffers */ + u32 buf_size; + /* IRQ address (either DMA (0) MCU (1) or DSP(2)) */ + u32 irq_addr; + /* IRQ data content loaded in the AESS IRQ register */ + u32 irq_data; + /* Call-back function upon IRQ reception */ + u32 callback; + } prot_pingpong; + /* DMAreq line to CBPr */ + struct { + /* Address of ATC descriptor's */ + u32 desc_addr; + /* DMEM buffer address in bytes */ + u32 buf_addr; + /* DMEM buffer size size in bytes */ + u32 buf_size; + /* ITERation on each DMAreq signals */ + u32 iter; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } prot_dmareq; + /* Circular buffer - direct addressing to DMEM */ + struct { + /* DMEM buffer base address in bytes */ + u32 buf_addr; + /* DMEM buffer size in bytes */ + u32 buf_size; + /* DMAreq address */ + u32 dma_addr; + /* DMA/AESS = 1 << #DMA */ + u32 dma_data; + } prot_circular_buffer; + } p; +} abe_port_protocol_t; +/* + * DMA_T + * + * dma structure for easing programming + */ +typedef struct { + /* OCP L3 pointer to the first address of the */ + void *data; + /* destination buffer (either DMA or Ping-Pong read/write pointers). */ + /* address L3 when addressing the DMEM buffer instead of CBPr */ + void *l3_dmem; + /* address L3 translated to L4 the ARM memory space */ + void *l4_dmem; + /* number of iterations for the DMA data moves. */ + u32 iter; +} abe_dma_t; + +typedef struct { + /* Offset to the first address of the */ + u32 data; + /* number of iterations for the DMA data moves. */ + u32 iter; +} abe_dma_t_offset; +/* + * SEQ_T + * + * struct { + * micros_t time; Waiting time before executing next line + * seq_code_t code Subroutine index interpreted in the HAL + * and translated to FW subroutine codes + * in case of ABE tasks + * int32 param[2] Two parameters + * } seq_t + * + */ +typedef struct { + u32 delta_time; + u32 code; + u32 param[4]; + u8 tag; +} abe_seq_t; + +typedef struct { + u32 mask; + abe_seq_t seq1; + abe_seq_t seq2; +} abe_sequence_t; +/* + * DRIFT_T abe_drift_t = s32 + * + * ASRC drift parameter in [ppm] value + */ +/* + * -------------------- INTERNAL DATA TYPES --------------------- + */ +/* + * ABE_IRQ_DATA_T + * + * IRQ FIFO content declaration + * APS interrupts : IRQ_FIFO[31:28] = IRQtag_APS, + * IRQ_FIFO[27:16] = APS_IRQs, IRQ_FIFO[15:0] = loopCounter + * SEQ interrupts : IRQ_FIFO[31:28] IRQtag_COUNT, + * IRQ_FIFO[27:16] = Count_IRQs, IRQ_FIFO[15:0] = loopCounter + * Ping-Pong Interrupts : IRQ_FIFO[31:28] = IRQtag_PP, + * IRQ_FIFO[27:16] = PP_MCU_IRQ, IRQ_FIFO[15:0] = loopCounter + */ +typedef struct { + unsigned int counter:16; + unsigned int data:12; + unsigned int tag:4; +} abe_irq_data_t; +/* + * ABE_PORT_T status / format / sampling / protocol(call_back) / + * features / gain / name .. + * + */ +typedef struct { + /* running / idled */ + u16 status; + /* Sample format type */ + abe_data_format_t format; + /* API : for ASRC */ + s32 drift; + /* optionnal call-back index for errors and ack */ + u16 callback; + /* IO tasks buffers */ + u16 smem_buffer1; + u16 smem_buffer2; + abe_port_protocol_t protocol; + /* pointer and iteration counter of the xDMA */ + abe_dma_t_offset dma; + /* list of features associated to a port (EQ, APS, ... , ends with 0) */ + u16 feature_index[MAXFEATUREPORT]; + char name[NBCHARPORTNAME]; +} abe_port_t; +/* + * ABE_SUBROUTINE_T + * + */ +typedef struct { + u32 sub_id; + s32 param[4]; +} abe_subroutine_t; + +#endif/* ifndef _ABE_TYP_H_ */ diff --git a/sound/soc/omap/abe/abe_typedef.h b/sound/soc/omap/abe/abe_typedef.h new file mode 100644 index 0000000..59d7221 --- /dev/null +++ b/sound/soc/omap/abe/abe_typedef.h @@ -0,0 +1,232 @@ +/* + + This file is provided under a dual BSD/GPLv2 license. When using or + redistributing this file, you may do so under either license. + + GPL LICENSE SUMMARY + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License 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. + The full GNU General Public License is included in this distribution + in the file called LICENSE.GPL. + + BSD LICENSE + + Copyright(c) 2010-2011 Texas Instruments Incorporated, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Texas Instruments Incorporated nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef _ABE_TYPEDEF_H_ +#define _ABE_TYPEDEF_H_ + +#include "abe_define.h" +#include "abe_typ.h" + +/* + * Basic types definition + */ +/* + * Commonly used structures + */ +typedef struct abetaskTag { + /* 0 ... Index of called function */ + u16 iF; + /* 2 ... for INITPTR of A0 */ + u16 A0; + /* 4 ... for INITPTR of A1 */ + u16 A1; + /* 6 ... for INITPTR of A2 & A3 */ + u16 A2_3; + /* 8 ... for INITPTR of A4 & A5 */ + u16 A4_5; + /* 10 ... for INITREG of R0, R1, R2, R3 */ + u16 R; + /* 12 */ + u16 misc0; + /* 14 */ + u16 misc1; +} ABE_STask; +typedef ABE_STask *pABE_STask; +typedef ABE_STask **ppABE_STask; + +struct ABE_SIODescriptor { + /* 0 */ + u16 drift_ASRC; + /* 2 */ + u16 drift_io; + /* 4 "Function index" of XLS sheet "Functions" */ + u8 io_type_idx; + /* 5 1 = MONO or Stereo1616, 2= STEREO, ... */ + u8 samp_size; + /* 6 drift "issues" for ASRC */ + s16 flow_counter; + /* 8 address for IRQ or DMArequests */ + u16 hw_ctrl_addr; + /* 10 DMA request bit-field or IRQ (DSP/MCU) */ + u8 atc_irq_data; + /* 11 0 = Read, 3 = Write */ + u8 direction_rw; + /* 12 */ + u8 repeat_last_samp; + /* 13 12 at 48kHz, ... */ + u8 nsamp; + /* 14 nsamp x samp_size */ + u8 x_io; + /* 15 ON = 0x80, OFF = 0x00 */ + u8 on_off; + /* 16 For Slimbus and TDM purpose */ + u16 split_addr1; + /* 18 */ + u16 split_addr2; + /* 20 */ + u16 split_addr3; + /* 22 */ + u8 before_f_index; + /* 23 */ + u8 after_f_index; + /* 24 SM/CM INITPTR field */ + u16 smem_addr1; + /* 26 in bytes */ + u16 atc_address1; + /* 28 DMIC_ATC_PTR, MCPDM_UL_ATC_PTR, ... */ + u16 atc_pointer_saved1; + /* 30 samp_size (except in TDM or Slimbus) */ + u8 data_size1; + /* 31 "Function index" of XLS sheet "Functions" */ + u8 copy_f_index1; + /* 32 For Slimbus and TDM purpose */ + u16 smem_addr2; + /* 34 */ + u16 atc_address2; + /* 36 */ + u16 atc_pointer_saved2; + /* 38 */ + u8 data_size2; + /* 39 */ + u8 copy_f_index2; +}; + +/* [w] asrc output used for the next asrc call (+/- 1 / 0) */ +#define drift_asrc_ 0 +/* [w] asrc output used for controlling the number of samples to be + exchanged (+/- 1 / 0) */ +#define drift_io_ 2 +/* address of the IO subroutine */ +#define io_type_idx_ 4 +#define samp_size_ 5 +/* flow error counter */ +#define flow_counter_ 6 +/* dmareq address or host irq buffer address (atc address) */ +#define hw_ctrl_addr_ 8 +/* data content to be loaded to "hw_ctrl_addr" */ +#define atc_irq_data_ 10 +/* read dmem =0, write dmem =3 (atc offset of the access pointer) */ +#define direction_rw_ 11 +/* flag set to allow repeating the last sample on downlink paths */ +#define repeat_last_samp_ 12 +/* number of samples (either mono stereo...) */ +#define nsamp_ 13 +/* x number of raw DMEM data moved */ +#define x_io_ 14 +#define on_off_ 15 +/* internal smem buffer initptr pointer index */ +#define split_addr1_ 16 +/* internal smem buffer initptr pointer index */ +#define split_addr2_ 18 +/* internal smem buffer initptr pointer index */ +#define split_addr3_ 20 +/* index of the copy subroutine */ +#define before_f_index_ 22 +/* index of the copy subroutine */ +#define after_f_index_ 23 +#define minidesc1_ 24 +/* internal smem buffer initptr pointer index */ +#define rel_smem_ 0 +/* atc descriptor address (byte address x4) */ +#define rel_atc_ 2 +/* location of the saved ATC pointer (+debug info) */ +#define rel_atc_saved 4 +/* size of each sample (1:mono/1616 2:stereo ... ) */ +#define rel_size_ 6 +/* index of the copy subroutine */ +#define rel_f_ 7 +#define s_mem_mm_ul 24 +#define s_mm_ul_size 30 +#define minidesc2_ 32 +#define Struct_Size 40 + +struct ABE_SPingPongDescriptor { + /* 0: [W] asrc output used for the next ASRC call (+/- 1 / 0) */ + u16 drift_ASRC; + /* 2: [W] asrc output used for controlling the number of + samples to be exchanged (+/- 1 / 0) */ + u16 drift_io; + /* 4: DMAReq address or HOST IRQ buffer address (ATC ADDRESS) */ + u16 hw_ctrl_addr; + /* 6: index of the copy subroutine */ + u8 copy_func_index; + /* 7: X number of SMEM samples to move */ + u8 x_io; + /* 8: 0 for mono data, 1 for stereo data */ + u8 data_size; + /* 9: internal SMEM buffer INITPTR pointer index */ + u8 smem_addr; + /* 10: data content to be loaded to "hw_ctrl_addr" */ + u8 atc_irq_data; + /* 11: ping/pong buffer flag */ + u8 counter; + /* 12: current Base address of the working buffer */ + u16 workbuff_BaseAddr; + /* 14: samples left in the working buffer */ + u16 workbuff_Samples; + /* 16: Base address of the ping/pong buffer 0 */ + u16 nextbuff0_BaseAddr; + /* 18: samples available in the ping/pong buffer 0 */ + u16 nextbuff0_Samples; + /* 20: Base address of the ping/pong buffer 1 */ + u16 nextbuff1_BaseAddr; + /* 22: samples available in the ping/pong buffer 1 */ + u16 nextbuff1_Samples; +}; + +#endif/* _ABE_TYPEDEF_H_ */ diff --git a/sound/soc/omap/abe/port_mgr.c b/sound/soc/omap/abe/port_mgr.c new file mode 100644 index 0000000..dd2faa4 --- /dev/null +++ b/sound/soc/omap/abe/port_mgr.c @@ -0,0 +1,341 @@ +/* + * ALSA SoC OMAP ABE port manager + * + * Author: Liam Girdwood <lrg@slimlogic.co.uk> + * + * 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 + */ + +//#define DEBUG + +#include <linux/module.h> +#include <linux/init.h> +#include <linux/slab.h> +#include <linux/errno.h> +#include <linux/spinlock.h> +#include <linux/list.h> +#include <linux/debugfs.h> +#include <linux/device.h> +#include "port_mgr.h" +#include "abe_main.h" + +#ifdef CONFIG_DEBUG_FS +/* this must match logical ID numbers in port_mgr.h */ +static const char *lport_name[] = { + "dmic0", "dmic1", "dmic2", "pdmdl1", "pdmdl2", "pdmvib", + "pdmul1", "bt_vx_dl", "bt_vx_ul", "mm_ext_ul", "mm_ext_dl", + "mm_dl1", "mm_ul1", "mm_ul2", "vx_dl", "vx_ul", "vib", "tones" +}; +#endif + +static DEFINE_MUTEX(port_mgr_mutex); +static struct abe *the_abe = NULL; +static int users = 0; + +/* + * Get the Physical port ID based on the logical port ID + * + * FE and BE ports have unique ID's within the driver but share + * ID's within the ABE. This maps a driver port ID to an ABE port ID. + */ +static int get_physical_id(int logical_id) +{ + switch (logical_id) { + /* backend ports */ + case OMAP_ABE_BE_PORT_DMIC0: + case OMAP_ABE_BE_PORT_DMIC1: + case OMAP_ABE_BE_PORT_DMIC2: + return DMIC_PORT; + case OMAP_ABE_BE_PORT_PDM_DL1: + case OMAP_ABE_BE_PORT_PDM_DL2: + return PDM_DL_PORT; + case OMAP_ABE_BE_PORT_PDM_VIB: + return VIB_DL_PORT; + case OMAP_ABE_BE_PORT_PDM_UL1: + return PDM_UL_PORT; + case OMAP_ABE_BE_PORT_BT_VX_DL: + return BT_VX_DL_PORT; + case OMAP_ABE_BE_PORT_BT_VX_UL: + return BT_VX_UL_PORT; + case OMAP_ABE_BE_PORT_MM_EXT_UL: + return MM_EXT_OUT_PORT; + case OMAP_ABE_BE_PORT_MM_EXT_DL: + return MM_EXT_IN_PORT; + /* front end ports */ + case OMAP_ABE_FE_PORT_MM_DL1: + return MM_DL_PORT; + case OMAP_ABE_FE_PORT_MM_UL1: + return MM_UL_PORT; + case OMAP_ABE_FE_PORT_MM_UL2: + return MM_UL2_PORT; + case OMAP_ABE_FE_PORT_VX_DL: + return VX_DL_PORT; + case OMAP_ABE_FE_PORT_VX_UL: + return VX_UL_PORT; + case OMAP_ABE_FE_PORT_VIB: + return VIB_DL_PORT; + case OMAP_ABE_FE_PORT_TONES: + return TONES_DL_PORT; + } + return -EINVAL; +} + +/* + * Get the number of enabled users of the physical port shared by this client. + * Locks held by callers. + */ +static int port_get_num_users(struct abe *abe, struct omap_abe_port *port) +{ + struct omap_abe_port *p; + int users = 0; + + list_for_each_entry(p, &abe->ports, list) { + if (p->physical_id == port->physical_id && p->state == PORT_ENABLED) + users++; + } + return users; +} + +static int port_is_open(struct abe *abe, int phy_port) +{ + struct omap_abe_port *p; + + list_for_each_entry(p, &abe->ports, list) { + if (p->physical_id == phy_port && p->state == PORT_ENABLED) + return 1; + } + return 0; +} + +/* + * Check whether the physical port is enabled for this PHY port ID. + * Locks held by callers. + */ +int omap_abe_port_is_enabled(struct abe *abe, struct omap_abe_port *port) +{ + struct omap_abe_port *p; + unsigned long flags; + + spin_lock_irqsave(&abe->lock, flags); + + list_for_each_entry(p, &abe->ports, list) { + if (p->physical_id == port->physical_id && p->state == PORT_ENABLED) { + spin_unlock_irqrestore(&abe->lock, flags); + return 1; + } + } + + spin_unlock_irqrestore(&abe->lock, flags); + return 0; +} +EXPORT_SYMBOL(omap_abe_port_is_enabled); + +/* + * omap_abe_port_enable - enable ABE logical port + * + * @abe - ABE. + * @port - logical ABE port ID to be enabled. + */ +int omap_abe_port_enable(struct abe *abe, struct omap_abe_port *port) +{ + int ret = 0; + unsigned long flags; + + /* only enable the physical port iff it is disabled */ + pr_debug("port %s increment count %d\n", + lport_name[port->logical_id], port->users); + + spin_lock_irqsave(&abe->lock, flags); + if (port->users == 0 && port_get_num_users(abe, port) == 0) { + + /* enable the physical port */ + pr_debug("port %s phy port %d enabled\n", + lport_name[port->logical_id], port->physical_id); + abe_enable_data_transfer(port->physical_id); + } + + port->state = PORT_ENABLED; + port->users++; + spin_unlock_irqrestore(&abe->lock, flags); + return ret; +} +EXPORT_SYMBOL(omap_abe_port_enable); + +/* + * omap_abe_port_disable - disable ABE logical port + * + * @abe - ABE. + * @port - logical ABE port ID to be disabled. + */ +int omap_abe_port_disable(struct abe *abe, struct omap_abe_port *port) +{ + int ret = 0; + unsigned long flags; + + /* only disable the port iff no other users are using it */ + pr_debug("port %s decrement count %d\n", + lport_name[port->logical_id], port->users); + + spin_lock_irqsave(&abe->lock, flags); + if (port->users == 1 && port_get_num_users(abe, port) == 1) { + /* disable the physical port */ + pr_debug("port %s phy port %d disabled\n", + lport_name[port->logical_id], port->physical_id); + + abe_disable_data_transfer(port->physical_id); + } + + port->state = PORT_DISABLED; + port->users--; + spin_unlock_irqrestore(&abe->lock, flags); + return ret; +} +EXPORT_SYMBOL(omap_abe_port_disable); + +/* + * omap_abe_port_open - open ABE logical port + * + * @abe - ABE. + * @logical_id - logical ABE port ID to be opened. + */ +struct omap_abe_port *omap_abe_port_open(struct abe *abe, int logical_id) +{ + struct omap_abe_port *port; + unsigned long flags; + +#ifdef CONFIG_DEBUG_FS + char debug_fs_name[32]; +#endif + + if (logical_id < 0 || logical_id > OMAP_ABE_MAX_PORT_ID) + return NULL; + + if (port_is_open(abe, logical_id)) + return NULL; + + port = kzalloc(sizeof(struct omap_abe_port), GFP_KERNEL); + if (port == NULL) + return NULL; + + port->logical_id = logical_id; + port->physical_id = get_physical_id(logical_id); + port->state = PORT_DISABLED; + port->abe = abe; + + spin_lock_irqsave(&abe->lock, flags); + list_add(&port->list, &abe->ports); + spin_unlock_irqrestore(&abe->lock, flags); + port->physical_users = port_get_num_users(abe, port); + +#ifdef CONFIG_DEBUG_FS + sprintf(debug_fs_name, "%s_state", lport_name[logical_id]); + port->debugfs_lstate = debugfs_create_u32(debug_fs_name, 0644, + abe->debugfs_root, &port->state); + sprintf(debug_fs_name, "%s_phy", lport_name[logical_id]); + port->debugfs_lphy = debugfs_create_u32(debug_fs_name, 0644, + abe->debugfs_root, &port->physical_id); + sprintf(debug_fs_name, "%s_users", lport_name[logical_id]); + port->debugfs_lusers = debugfs_create_u32(debug_fs_name, 0644, + abe->debugfs_root, &port->users); +#endif + + pr_debug("opened port %s\n", lport_name[logical_id]); + return port; +} +EXPORT_SYMBOL(omap_abe_port_open); + +/* + * omap_abe_port_close - close ABE logical port + * + * @port - logical ABE port to be closed (and disabled). + */ +void omap_abe_port_close(struct abe *abe, struct omap_abe_port *port) +{ + unsigned long flags; + + /* disable the port */ + omap_abe_port_disable(abe, port); + + spin_lock_irqsave(&abe->lock, flags); + list_del(&port->list); + spin_unlock_irqrestore(&abe->lock, flags); + + pr_debug("closed port %s\n", lport_name[port->logical_id]); + kfree(port); +} +EXPORT_SYMBOL(omap_abe_port_close); + +static struct abe *omap_abe_port_mgr_init(void) +{ + struct abe *abe; + + abe = kzalloc(sizeof(struct abe), GFP_KERNEL); + if (abe == NULL) + return NULL; + + spin_lock_init(&abe->lock); + + INIT_LIST_HEAD(&abe->ports); + the_abe = abe; + +#ifdef CONFIG_DEBUG_FS + abe->debugfs_root = debugfs_create_dir("abe_port", NULL); + if (!abe->debugfs_root) { + pr_debug( "Failed to create port manager debugfs directory\n"); + } +#endif + return abe; +} + +static void omap_abe_port_mgr_free(struct abe *abe) +{ + debugfs_remove_recursive(abe->debugfs_root); + kfree(abe); + the_abe = NULL; +} + +struct abe *omap_abe_port_mgr_get(void) +{ + struct abe * abe; + + mutex_lock(&port_mgr_mutex); + + if (the_abe) + abe = the_abe; + else + abe = omap_abe_port_mgr_init(); + + users++; + mutex_unlock(&port_mgr_mutex); + return abe; +} +EXPORT_SYMBOL(omap_abe_port_mgr_get); + +void omap_abe_port_mgr_put(struct abe *abe) +{ + mutex_lock(&port_mgr_mutex); + + if (users == 0) + goto out; + + if (--users == 0) + omap_abe_port_mgr_free(abe); + +out: + mutex_unlock(&port_mgr_mutex); +} +EXPORT_SYMBOL(omap_abe_port_mgr_put); + +MODULE_LICENSE("GPL"); diff --git a/sound/soc/omap/abe/port_mgr.h b/sound/soc/omap/abe/port_mgr.h new file mode 100644 index 0000000..a65b0d3 --- /dev/null +++ b/sound/soc/omap/abe/port_mgr.h @@ -0,0 +1,98 @@ +/* + * ABE Port manager + * + * Author: Liam Girdwood <lrg@slimlogic.co.uk> + * + * 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. + */ + +#ifndef __LINUX_SND_SOC_OMAP_PORT_MGR_H +#define __LINUX_SND_SOC_OMAP_PORT_MGR_H + +#include <linux/debugfs.h> + +/* + * TODO: These structures, enums and port ID macros should be moved to the + * new public ABE API header. + */ + +/* Logical PORT IDs - Backend */ +#define OMAP_ABE_BE_PORT_DMIC0 0 +#define OMAP_ABE_BE_PORT_DMIC1 1 +#define OMAP_ABE_BE_PORT_DMIC2 2 +#define OMAP_ABE_BE_PORT_PDM_DL1 3 +#define OMAP_ABE_BE_PORT_PDM_DL2 4 +#define OMAP_ABE_BE_PORT_PDM_VIB 5 +#define OMAP_ABE_BE_PORT_PDM_UL1 6 +#define OMAP_ABE_BE_PORT_BT_VX_DL 7 +#define OMAP_ABE_BE_PORT_BT_VX_UL 8 +#define OMAP_ABE_BE_PORT_MM_EXT_UL 9 +#define OMAP_ABE_BE_PORT_MM_EXT_DL 10 + +/* Logical PORT IDs - Frontend */ +#define OMAP_ABE_FE_PORT_MM_DL1 11 +#define OMAP_ABE_FE_PORT_MM_UL1 12 +#define OMAP_ABE_FE_PORT_MM_UL2 13 +#define OMAP_ABE_FE_PORT_VX_DL 14 +#define OMAP_ABE_FE_PORT_VX_UL 15 +#define OMAP_ABE_FE_PORT_VIB 16 +#define OMAP_ABE_FE_PORT_TONES 17 + +#define OMAP_ABE_MAX_PORT_ID OMAP_ABE_FE_PORT_TONES + +/* ports can either be enabled or disabled */ +enum port_state { + PORT_DISABLED = 0, + PORT_ENABLED, +}; + +/* structure used for client port info */ +struct omap_abe_port { + + /* logical and physical port IDs that correspond this port */ + int logical_id; + int physical_id; + int physical_users; + + /* enabled or disabled */ + enum port_state state; + + /* logical port ref count */ + int users; + + struct list_head list; + struct abe *abe; + +#ifdef CONFIG_DEBUG_FS + struct dentry *debugfs_lstate; + struct dentry *debugfs_lphy; + struct dentry *debugfs_lusers; +#endif +}; + +/* main ABE structure */ +struct abe { + + /* List of open ABE logical ports */ + struct list_head ports; + + /* spinlock */ + spinlock_t lock; + + +#ifdef CONFIG_DEBUG_FS + struct dentry *debugfs_root; +#endif +}; + +struct omap_abe_port *omap_abe_port_open(struct abe *abe, int logical_id); +void omap_abe_port_close(struct abe *abe, struct omap_abe_port *port); +int omap_abe_port_enable(struct abe *abe, struct omap_abe_port *port); +int omap_abe_port_disable(struct abe *abe, struct omap_abe_port *port); +int omap_abe_port_is_enabled(struct abe *abe, struct omap_abe_port *port); +struct abe *omap_abe_port_mgr_get(void); +void omap_abe_port_mgr_put(struct abe *abe); + +#endif /* __LINUX_SND_SOC_OMAP_PORT_MGR_H */ diff --git a/sound/soc/omap/mcpdm.c b/sound/soc/omap/mcpdm.c deleted file mode 100644 index 928f037..0000000 --- a/sound/soc/omap/mcpdm.c +++ /dev/null @@ -1,470 +0,0 @@ -/* - * mcpdm.c -- McPDM interface driver - * - * Author: Jorge Eduardo Candelaria <x0107209@ti.com> - * Copyright (C) 2009 - Texas Instruments, Inc. - * - * 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/module.h> -#include <linux/init.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <linux/wait.h> -#include <linux/slab.h> -#include <linux/interrupt.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/delay.h> -#include <linux/io.h> -#include <linux/irq.h> - -#include "mcpdm.h" - -static struct omap_mcpdm *mcpdm; - -static inline void omap_mcpdm_write(u16 reg, u32 val) -{ - __raw_writel(val, mcpdm->io_base + reg); -} - -static inline int omap_mcpdm_read(u16 reg) -{ - return __raw_readl(mcpdm->io_base + reg); -} - -static void omap_mcpdm_reg_dump(void) -{ - dev_dbg(mcpdm->dev, "***********************\n"); - dev_dbg(mcpdm->dev, "IRQSTATUS_RAW: 0x%04x\n", - omap_mcpdm_read(MCPDM_IRQSTATUS_RAW)); - dev_dbg(mcpdm->dev, "IRQSTATUS: 0x%04x\n", - omap_mcpdm_read(MCPDM_IRQSTATUS)); - dev_dbg(mcpdm->dev, "IRQENABLE_SET: 0x%04x\n", - omap_mcpdm_read(MCPDM_IRQENABLE_SET)); - dev_dbg(mcpdm->dev, "IRQENABLE_CLR: 0x%04x\n", - omap_mcpdm_read(MCPDM_IRQENABLE_CLR)); - dev_dbg(mcpdm->dev, "IRQWAKE_EN: 0x%04x\n", - omap_mcpdm_read(MCPDM_IRQWAKE_EN)); - dev_dbg(mcpdm->dev, "DMAENABLE_SET: 0x%04x\n", - omap_mcpdm_read(MCPDM_DMAENABLE_SET)); - dev_dbg(mcpdm->dev, "DMAENABLE_CLR: 0x%04x\n", - omap_mcpdm_read(MCPDM_DMAENABLE_CLR)); - dev_dbg(mcpdm->dev, "DMAWAKEEN: 0x%04x\n", - omap_mcpdm_read(MCPDM_DMAWAKEEN)); - dev_dbg(mcpdm->dev, "CTRL: 0x%04x\n", - omap_mcpdm_read(MCPDM_CTRL)); - dev_dbg(mcpdm->dev, "DN_DATA: 0x%04x\n", - omap_mcpdm_read(MCPDM_DN_DATA)); - dev_dbg(mcpdm->dev, "UP_DATA: 0x%04x\n", - omap_mcpdm_read(MCPDM_UP_DATA)); - dev_dbg(mcpdm->dev, "FIFO_CTRL_DN: 0x%04x\n", - omap_mcpdm_read(MCPDM_FIFO_CTRL_DN)); - dev_dbg(mcpdm->dev, "FIFO_CTRL_UP: 0x%04x\n", - omap_mcpdm_read(MCPDM_FIFO_CTRL_UP)); - dev_dbg(mcpdm->dev, "DN_OFFSET: 0x%04x\n", - omap_mcpdm_read(MCPDM_DN_OFFSET)); - dev_dbg(mcpdm->dev, "***********************\n"); -} - -/* - * Takes the McPDM module in and out of reset state. - * Uplink and downlink can be reset individually. - */ -static void omap_mcpdm_reset_capture(int reset) -{ - int ctrl = omap_mcpdm_read(MCPDM_CTRL); - - if (reset) - ctrl |= SW_UP_RST; - else - ctrl &= ~SW_UP_RST; - - omap_mcpdm_write(MCPDM_CTRL, ctrl); -} - -static void omap_mcpdm_reset_playback(int reset) -{ - int ctrl = omap_mcpdm_read(MCPDM_CTRL); - - if (reset) - ctrl |= SW_DN_RST; - else - ctrl &= ~SW_DN_RST; - - omap_mcpdm_write(MCPDM_CTRL, ctrl); -} - -/* - * Enables the transfer through the PDM interface to/from the Phoenix - * codec by enabling the corresponding UP or DN channels. - */ -void omap_mcpdm_start(int stream) -{ - int ctrl = omap_mcpdm_read(MCPDM_CTRL); - - if (stream) - ctrl |= mcpdm->up_channels; - else - ctrl |= mcpdm->dn_channels; - - omap_mcpdm_write(MCPDM_CTRL, ctrl); -} - -/* - * Disables the transfer through the PDM interface to/from the Phoenix - * codec by disabling the corresponding UP or DN channels. - */ -void omap_mcpdm_stop(int stream) -{ - int ctrl = omap_mcpdm_read(MCPDM_CTRL); - - if (stream) - ctrl &= ~mcpdm->up_channels; - else - ctrl &= ~mcpdm->dn_channels; - - omap_mcpdm_write(MCPDM_CTRL, ctrl); -} - -/* - * Configures McPDM uplink for audio recording. - * This function should be called before omap_mcpdm_start. - */ -int omap_mcpdm_capture_open(struct omap_mcpdm_link *uplink) -{ - int irq_mask = 0; - int ctrl; - - if (!uplink) - return -EINVAL; - - mcpdm->uplink = uplink; - - /* Enable irq request generation */ - irq_mask |= uplink->irq_mask & MCPDM_UPLINK_IRQ_MASK; - omap_mcpdm_write(MCPDM_IRQENABLE_SET, irq_mask); - - /* Configure uplink threshold */ - if (uplink->threshold > UP_THRES_MAX) - uplink->threshold = UP_THRES_MAX; - - omap_mcpdm_write(MCPDM_FIFO_CTRL_UP, uplink->threshold); - - /* Configure DMA controller */ - omap_mcpdm_write(MCPDM_DMAENABLE_SET, DMA_UP_ENABLE); - - /* Set pdm out format */ - ctrl = omap_mcpdm_read(MCPDM_CTRL); - ctrl &= ~PDMOUTFORMAT; - ctrl |= uplink->format & PDMOUTFORMAT; - - /* Uplink channels */ - mcpdm->up_channels = uplink->channels & (PDM_UP_MASK | PDM_STATUS_MASK); - - omap_mcpdm_write(MCPDM_CTRL, ctrl); - - return 0; -} - -/* - * Configures McPDM downlink for audio playback. - * This function should be called before omap_mcpdm_start. - */ -int omap_mcpdm_playback_open(struct omap_mcpdm_link *downlink) -{ - int irq_mask = 0; - int ctrl; - - if (!downlink) - return -EINVAL; - - mcpdm->downlink = downlink; - - /* Enable irq request generation */ - irq_mask |= downlink->irq_mask & MCPDM_DOWNLINK_IRQ_MASK; - omap_mcpdm_write(MCPDM_IRQENABLE_SET, irq_mask); - - /* Configure uplink threshold */ - if (downlink->threshold > DN_THRES_MAX) - downlink->threshold = DN_THRES_MAX; - - omap_mcpdm_write(MCPDM_FIFO_CTRL_DN, downlink->threshold); - - /* Enable DMA request generation */ - omap_mcpdm_write(MCPDM_DMAENABLE_SET, DMA_DN_ENABLE); - - /* Set pdm out format */ - ctrl = omap_mcpdm_read(MCPDM_CTRL); - ctrl &= ~PDMOUTFORMAT; - ctrl |= downlink->format & PDMOUTFORMAT; - - /* Downlink channels */ - mcpdm->dn_channels = downlink->channels & (PDM_DN_MASK | PDM_CMD_MASK); - - omap_mcpdm_write(MCPDM_CTRL, ctrl); - - return 0; -} - -/* - * Cleans McPDM uplink configuration. - * This function should be called when the stream is closed. - */ -int omap_mcpdm_capture_close(struct omap_mcpdm_link *uplink) -{ - int irq_mask = 0; - - if (!uplink) - return -EINVAL; - - /* Disable irq request generation */ - irq_mask |= uplink->irq_mask & MCPDM_UPLINK_IRQ_MASK; - omap_mcpdm_write(MCPDM_IRQENABLE_CLR, irq_mask); - - /* Disable DMA request generation */ - omap_mcpdm_write(MCPDM_DMAENABLE_CLR, DMA_UP_ENABLE); - - /* Clear Downlink channels */ - mcpdm->up_channels = 0; - - mcpdm->uplink = NULL; - - return 0; -} - -/* - * Cleans McPDM downlink configuration. - * This function should be called when the stream is closed. - */ -int omap_mcpdm_playback_close(struct omap_mcpdm_link *downlink) -{ - int irq_mask = 0; - - if (!downlink) - return -EINVAL; - - /* Disable irq request generation */ - irq_mask |= downlink->irq_mask & MCPDM_DOWNLINK_IRQ_MASK; - omap_mcpdm_write(MCPDM_IRQENABLE_CLR, irq_mask); - - /* Disable DMA request generation */ - omap_mcpdm_write(MCPDM_DMAENABLE_CLR, DMA_DN_ENABLE); - - /* clear Downlink channels */ - mcpdm->dn_channels = 0; - - mcpdm->downlink = NULL; - - return 0; -} - -static irqreturn_t omap_mcpdm_irq_handler(int irq, void *dev_id) -{ - struct omap_mcpdm *mcpdm_irq = dev_id; - int irq_status; - - irq_status = omap_mcpdm_read(MCPDM_IRQSTATUS); - - /* Acknowledge irq event */ - omap_mcpdm_write(MCPDM_IRQSTATUS, irq_status); - - if (irq & MCPDM_DN_IRQ_FULL) { - dev_err(mcpdm_irq->dev, "DN FIFO error %x\n", irq_status); - omap_mcpdm_reset_playback(1); - omap_mcpdm_playback_open(mcpdm_irq->downlink); - omap_mcpdm_reset_playback(0); - } - - if (irq & MCPDM_DN_IRQ_EMPTY) { - dev_err(mcpdm_irq->dev, "DN FIFO error %x\n", irq_status); - omap_mcpdm_reset_playback(1); - omap_mcpdm_playback_open(mcpdm_irq->downlink); - omap_mcpdm_reset_playback(0); - } - - if (irq & MCPDM_DN_IRQ) { - dev_dbg(mcpdm_irq->dev, "DN write request\n"); - } - - if (irq & MCPDM_UP_IRQ_FULL) { - dev_err(mcpdm_irq->dev, "UP FIFO error %x\n", irq_status); - omap_mcpdm_reset_capture(1); - omap_mcpdm_capture_open(mcpdm_irq->uplink); - omap_mcpdm_reset_capture(0); - } - - if (irq & MCPDM_UP_IRQ_EMPTY) { - dev_err(mcpdm_irq->dev, "UP FIFO error %x\n", irq_status); - omap_mcpdm_reset_capture(1); - omap_mcpdm_capture_open(mcpdm_irq->uplink); - omap_mcpdm_reset_capture(0); - } - - if (irq & MCPDM_UP_IRQ) { - dev_dbg(mcpdm_irq->dev, "UP write request\n"); - } - - return IRQ_HANDLED; -} - -int omap_mcpdm_request(void) -{ - int ret; - - clk_enable(mcpdm->clk); - - spin_lock(&mcpdm->lock); - - if (!mcpdm->free) { - dev_err(mcpdm->dev, "McPDM interface is in use\n"); - spin_unlock(&mcpdm->lock); - ret = -EBUSY; - goto err; - } - mcpdm->free = 0; - - spin_unlock(&mcpdm->lock); - - /* Disable lines while request is ongoing */ - omap_mcpdm_write(MCPDM_CTRL, 0x00); - - ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler, - 0, "McPDM", (void *)mcpdm); - if (ret) { - dev_err(mcpdm->dev, "Request for McPDM IRQ failed\n"); - goto err; - } - - return 0; - -err: - clk_disable(mcpdm->clk); - return ret; -} - -void omap_mcpdm_free(void) -{ - spin_lock(&mcpdm->lock); - if (mcpdm->free) { - dev_err(mcpdm->dev, "McPDM interface is already free\n"); - spin_unlock(&mcpdm->lock); - return; - } - mcpdm->free = 1; - spin_unlock(&mcpdm->lock); - - clk_disable(mcpdm->clk); - - free_irq(mcpdm->irq, (void *)mcpdm); -} - -/* Enable/disable DC offset cancelation for the analog - * headset path (PDM channels 1 and 2). - */ -int omap_mcpdm_set_offset(int offset1, int offset2) -{ - int offset; - - if ((offset1 > DN_OFST_MAX) || (offset2 > DN_OFST_MAX)) - return -EINVAL; - - offset = (offset1 << DN_OFST_RX1) | (offset2 << DN_OFST_RX2); - - /* offset cancellation for channel 1 */ - if (offset1) - offset |= DN_OFST_RX1_EN; - else - offset &= ~DN_OFST_RX1_EN; - - /* offset cancellation for channel 2 */ - if (offset2) - offset |= DN_OFST_RX2_EN; - else - offset &= ~DN_OFST_RX2_EN; - - omap_mcpdm_write(MCPDM_DN_OFFSET, offset); - - return 0; -} - -int __devinit omap_mcpdm_probe(struct platform_device *pdev) -{ - struct resource *res; - int ret = 0; - - mcpdm = kzalloc(sizeof(struct omap_mcpdm), GFP_KERNEL); - if (!mcpdm) { - ret = -ENOMEM; - goto exit; - } - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { - dev_err(&pdev->dev, "no resource\n"); - goto err_resource; - } - - spin_lock_init(&mcpdm->lock); - mcpdm->free = 1; - mcpdm->io_base = ioremap(res->start, resource_size(res)); - if (!mcpdm->io_base) { - ret = -ENOMEM; - goto err_resource; - } - - mcpdm->irq = platform_get_irq(pdev, 0); - - mcpdm->clk = clk_get(&pdev->dev, "pdm_ck"); - if (IS_ERR(mcpdm->clk)) { - ret = PTR_ERR(mcpdm->clk); - dev_err(&pdev->dev, "unable to get pdm_ck: %d\n", ret); - goto err_clk; - } - - mcpdm->dev = &pdev->dev; - platform_set_drvdata(pdev, mcpdm); - - return 0; - -err_clk: - iounmap(mcpdm->io_base); -err_resource: - kfree(mcpdm); -exit: - return ret; -} - -int __devexit omap_mcpdm_remove(struct platform_device *pdev) -{ - struct omap_mcpdm *mcpdm_ptr = platform_get_drvdata(pdev); - - platform_set_drvdata(pdev, NULL); - - clk_put(mcpdm_ptr->clk); - - iounmap(mcpdm_ptr->io_base); - - mcpdm_ptr->clk = NULL; - mcpdm_ptr->free = 0; - mcpdm_ptr->dev = NULL; - - kfree(mcpdm_ptr); - - return 0; -} - diff --git a/sound/soc/omap/mcpdm.h b/sound/soc/omap/mcpdm.h deleted file mode 100644 index df3e16f..0000000 --- a/sound/soc/omap/mcpdm.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * mcpdm.h -- Defines for McPDM driver - * - * Author: Jorge Eduardo Candelaria <x0107209@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 - * - */ - -/* McPDM registers */ - -#define MCPDM_REVISION 0x00 -#define MCPDM_SYSCONFIG 0x10 -#define MCPDM_IRQSTATUS_RAW 0x24 -#define MCPDM_IRQSTATUS 0x28 -#define MCPDM_IRQENABLE_SET 0x2C -#define MCPDM_IRQENABLE_CLR 0x30 -#define MCPDM_IRQWAKE_EN 0x34 -#define MCPDM_DMAENABLE_SET 0x38 -#define MCPDM_DMAENABLE_CLR 0x3C -#define MCPDM_DMAWAKEEN 0x40 -#define MCPDM_CTRL 0x44 -#define MCPDM_DN_DATA 0x48 -#define MCPDM_UP_DATA 0x4C -#define MCPDM_FIFO_CTRL_DN 0x50 -#define MCPDM_FIFO_CTRL_UP 0x54 -#define MCPDM_DN_OFFSET 0x58 - -/* - * MCPDM_IRQ bit fields - * IRQSTATUS_RAW, IRQSTATUS, IRQENABLE_SET, IRQENABLE_CLR - */ - -#define MCPDM_DN_IRQ (1 << 0) -#define MCPDM_DN_IRQ_EMPTY (1 << 1) -#define MCPDM_DN_IRQ_ALMST_EMPTY (1 << 2) -#define MCPDM_DN_IRQ_FULL (1 << 3) - -#define MCPDM_UP_IRQ (1 << 8) -#define MCPDM_UP_IRQ_EMPTY (1 << 9) -#define MCPDM_UP_IRQ_ALMST_FULL (1 << 10) -#define MCPDM_UP_IRQ_FULL (1 << 11) - -#define MCPDM_DOWNLINK_IRQ_MASK 0x00F -#define MCPDM_UPLINK_IRQ_MASK 0xF00 - -/* - * MCPDM_DMAENABLE bit fields - */ - -#define DMA_DN_ENABLE 0x1 -#define DMA_UP_ENABLE 0x2 - -/* - * MCPDM_CTRL bit fields - */ - -#define PDM_UP1_EN 0x0001 -#define PDM_UP2_EN 0x0002 -#define PDM_UP3_EN 0x0004 -#define PDM_DN1_EN 0x0008 -#define PDM_DN2_EN 0x0010 -#define PDM_DN3_EN 0x0020 -#define PDM_DN4_EN 0x0040 -#define PDM_DN5_EN 0x0080 -#define PDMOUTFORMAT 0x0100 -#define CMD_INT 0x0200 -#define STATUS_INT 0x0400 -#define SW_UP_RST 0x0800 -#define SW_DN_RST 0x1000 -#define PDM_UP_MASK 0x007 -#define PDM_DN_MASK 0x0F8 -#define PDM_CMD_MASK 0x200 -#define PDM_STATUS_MASK 0x400 - - -#define PDMOUTFORMAT_LJUST (0 << 8) -#define PDMOUTFORMAT_RJUST (1 << 8) - -/* - * MCPDM_FIFO_CTRL bit fields - */ - -#define UP_THRES_MAX 0xF -#define DN_THRES_MAX 0xF - -/* - * MCPDM_DN_OFFSET bit fields - */ - -#define DN_OFST_RX1_EN 0x0001 -#define DN_OFST_RX2_EN 0x0100 - -#define DN_OFST_RX1 1 -#define DN_OFST_RX2 9 -#define DN_OFST_MAX 0x1F - -#define MCPDM_UPLINK 1 -#define MCPDM_DOWNLINK 2 - -struct omap_mcpdm_link { - int irq_mask; - int threshold; - int format; - int channels; -}; - -struct omap_mcpdm_platform_data { - unsigned long phys_base; - u16 irq; -}; - -struct omap_mcpdm { - struct device *dev; - unsigned long phys_base; - void __iomem *io_base; - u8 free; - int irq; - - spinlock_t lock; - struct omap_mcpdm_platform_data *pdata; - struct clk *clk; - struct omap_mcpdm_link *downlink; - struct omap_mcpdm_link *uplink; - struct completion irq_completion; - - int dn_channels; - int up_channels; -}; - -extern void omap_mcpdm_start(int stream); -extern void omap_mcpdm_stop(int stream); -extern int omap_mcpdm_capture_open(struct omap_mcpdm_link *uplink); -extern int omap_mcpdm_playback_open(struct omap_mcpdm_link *downlink); -extern int omap_mcpdm_capture_close(struct omap_mcpdm_link *uplink); -extern int omap_mcpdm_playback_close(struct omap_mcpdm_link *downlink); -extern int omap_mcpdm_request(void); -extern void omap_mcpdm_free(void); -extern int omap_mcpdm_set_offset(int offset1, int offset2); -int __devinit omap_mcpdm_probe(struct platform_device *pdev); -int __devexit omap_mcpdm_remove(struct platform_device *pdev); diff --git a/sound/soc/omap/omap-abe-dsp.c b/sound/soc/omap/omap-abe-dsp.c new file mode 100644 index 0000000..b5c7e8a --- /dev/null +++ b/sound/soc/omap/omap-abe-dsp.c @@ -0,0 +1,2427 @@ +/* + * omap-abe-dsp.c + * + * 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 + * + * Copyright (C) 2010 Texas Instruments Inc. + * + * Authors: Liam Girdwood <lrg@ti.com> + * Misael Lopez Cruz <misael.lopez@ti.com> + * Sebastien Guiriec <s-guiriec@ti.com> + * + */ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/delay.h> +#include <linux/pm.h> +#include <linux/i2c.h> +#include <linux/gpio.h> +#include <linux/platform_device.h> +#include <linux/workqueue.h> +#include <linux/i2c/twl.h> +#include <linux/clk.h> +#include <linux/err.h> +#include <linux/slab.h> +#include <linux/pm_runtime.h> +#include <linux/dma-mapping.h> +#include <linux/wait.h> +#include <linux/firmware.h> +#include <linux/debugfs.h> + +#include <plat/omap_hwmod.h> +#include <plat/omap_device.h> +#include <plat/dma.h> + +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/initval.h> +#include <sound/tlv.h> +#include <sound/omap-abe-dsp.h> + +#include "omap-abe-dsp.h" +#include "omap-abe.h" +#include "abe/abe_main.h" +#include "abe/port_mgr.h" + +#warning need omap_device_set_rate +#define omap_device_set_rate(x, y, z) + +static const char *abe_memory_bank[5] = { + "dmem", + "cmem", + "smem", + "pmem", + "mpu" +}; + + +/* + * ABE loadable coefficients. + * The coefficient and their mixer configurations are loaded with the firmware + * blob duing probe(). + */ + +struct coeff_config { + char name[ABE_COEFF_NAME_SIZE]; + u32 count; + u32 coeff; + char texts[ABE_COEFF_NUM_TEXTS][ABE_COEFF_TEXT_SIZE]; +}; + +/* + * ABE Firmware Header. + * The ABE firmware blob has a header that describes each data section. This + * way we can store coefficients etc in the firmware. + */ +struct fw_header { + u32 magic; /* magic number */ + u32 crc; /* optional crc */ + u32 firmware_size; /* payload size */ + u32 coeff_size; /* payload size */ + u32 coeff_version; /* coefficent version */ + u32 firmware_version; /* min version of ABE firmware required */ + u32 num_equ; /* number of equalizers */ +}; + +/* + * ABE private data. + */ +struct abe_data { + struct omap4_abe_dsp_pdata *abe_pdata; + struct device *dev; + struct snd_soc_platform *platform; + struct delayed_work delayed_work; + struct mutex mutex; + struct mutex opp_mutex; + struct clk *clk; + void __iomem *io_base[5]; + int irq; + int opp; + int active; + + /* coefficients */ + struct fw_header hdr; + s32 *equ[ABE_MAX_EQU]; + int equ_profile[ABE_MAX_EQU]; + struct soc_enum equalizer_enum[ABE_MAX_EQU]; + struct snd_kcontrol_new equalizer_control[ABE_MAX_EQU]; + struct coeff_config *equ_texts; + + /* DAPM mixer config - TODO: some of this can be replaced with HAL update */ + u32 widget_opp[ABE_NUM_DAPM_REG + 1]; + + u16 router[16]; + int loss_count; + + struct snd_pcm_substream *ping_pong_substream; + int first_irq; + + struct snd_pcm_substream *psubs; + +#ifdef CONFIG_DEBUG_FS + /* ABE runtime debug config */ + + /* its intended we can switch on/off individual debug items */ + u32 dbg_format1; /* TODO: match flag names here to debug format flags */ + u32 dbg_format2; + u32 dbg_format3; + + u32 dbg_buffer_bytes; + u32 dbg_circular; + u32 dbg_buffer_msecs; /* size of buffer in secs */ + u32 dbg_elem_bytes; + dma_addr_t dbg_buffer_addr; + wait_queue_head_t wait; + int dbg_reader_offset; + int dbg_dma_offset; + int dbg_complete; + struct dentry *debugfs_root; + struct dentry *debugfs_fmt1; + struct dentry *debugfs_fmt2; + struct dentry *debugfs_fmt3; + struct dentry *debugfs_size; + struct dentry *debugfs_data; + struct dentry *debugfs_circ; + struct dentry *debugfs_elem_bytes; + struct dentry *debugfs_opp_level; + char *dbg_buffer; + struct omap_pcm_dma_data *dma_data; + int dma_ch; + int dma_req; +#endif +}; + +static struct abe_data *the_abe; + +// TODO: map to the new version of HAL +static unsigned int abe_dsp_read(struct snd_soc_platform *platform, + unsigned int reg) +{ + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + + BUG_ON(reg > ABE_NUM_DAPM_REG); + return abe->widget_opp[reg]; +} + +static int abe_dsp_write(struct snd_soc_platform *platform, unsigned int reg, + unsigned int val) +{ + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + + BUG_ON(reg > ABE_NUM_DAPM_REG); + abe->widget_opp[reg] = val; + return 0; +} + +static void abe_irq_pingpong_subroutine(u32 *data) +{ + struct abe_data *abe = (struct abe_data *)data; + u32 dst, n_bytes; + + abe_read_next_ping_pong_buffer(MM_DL_PORT, &dst, &n_bytes); + abe_set_ping_pong_buffer(MM_DL_PORT, n_bytes); + + /* Do not call ALSA function for first IRQ */ + if (the_abe->first_irq) { + the_abe->first_irq = 0; + } else { + if (the_abe->ping_pong_substream) + snd_pcm_period_elapsed(the_abe->ping_pong_substream); + } +} + +static irqreturn_t abe_irq_handler(int irq, void *dev_id) +{ + struct abe_data *abe = dev_id; + + /* TODO: handle underruns/overruns/errors */ + pm_runtime_get_sync(abe->dev); + abe_clear_irq(); // TODO: why is IRQ not cleared after processing ? + abe_irq_processing(); + pm_runtime_put_sync(abe->dev); + return IRQ_HANDLED; +} + +// TODO: these should really be called internally since we will know the McPDM state +void abe_dsp_pm_get(void) +{ + pm_runtime_get_sync(the_abe->dev); +} +EXPORT_SYMBOL_GPL(abe_dsp_pm_get); + +void abe_dsp_pm_put(void) +{ + pm_runtime_put_sync(the_abe->dev); +} +EXPORT_SYMBOL_GPL(abe_dsp_pm_put); + +void abe_dsp_shutdown(void) +{ + if (!the_abe->active && !abe_check_activity()) { + abe_set_opp_processing(ABE_OPP25); + the_abe->opp = 25; + abe_stop_event_generator(); + udelay(250); + omap_device_set_rate(the_abe->dev, the_abe->dev, 0); + } +} +EXPORT_SYMBOL_GPL(abe_dsp_shutdown); + +/* + * These TLV settings will need fine tuned for each individual control + */ + +/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(mm_dl1_tlv, -12000, 100, 3000); + +/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(tones_dl1_tlv, -12000, 100, 3000); + +/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(voice_dl1_tlv, -12000, 100, 3000); + +/* Media DL1 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(capture_dl1_tlv, -12000, 100, 3000); + +/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(mm_dl2_tlv, -12000, 100, 3000); + +/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(tones_dl2_tlv, -12000, 100, 3000); + +/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(voice_dl2_tlv, -12000, 100, 3000); + +/* Media DL2 volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(capture_dl2_tlv, -12000, 100, 3000); + +/* SDT volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(sdt_ul_tlv, -12000, 100, 3000); + +/* SDT volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(sdt_dl_tlv, -12000, 100, 3000); + +/* AUDUL volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(audul_mm_tlv, -12000, 100, 3000); + +/* AUDUL volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(audul_tones_tlv, -12000, 100, 3000); + +/* AUDUL volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(audul_vx_ul_tlv, -12000, 100, 3000); + +/* AUDUL volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(audul_vx_dl_tlv, -12000, 100, 3000); + +/* VXREC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(vxrec_mm_dl_tlv, -12000, 100, 3000); + +/* VXREC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(vxrec_tones_tlv, -12000, 100, 3000); + +/* VXREC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(vxrec_vx_dl_tlv, -12000, 100, 3000); + +/* VXREC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(vxrec_vx_ul_tlv, -12000, 100, 3000); + +/* DMIC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(dmic_tlv, -12000, 100, 3000); + +/* BT UL volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(btul_tlv, -12000, 100, 3000); + +/* AMIC volume control from -120 to 30 dB in 1 dB steps */ +static DECLARE_TLV_DB_SCALE(amic_tlv, -12000, 100, 3000); + +//TODO: we have to use the shift value atm to represent register id due to current HAL +static int dl1_put_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + // TODO: optimise all of these to call HAL abe_enable_gain(mixer, enable) + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + abe_enable_gain(MIXDL1, mc->reg); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + abe_disable_gain(MIXDL1, mc->reg); + } + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int dl2_put_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + abe_enable_gain(MIXDL2, mc->reg); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + abe_disable_gain(MIXDL2, mc->reg); + } + + pm_runtime_put_sync(the_abe->dev); + return 1; +} + +static int audio_ul_put_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + abe_enable_gain(MIXAUDUL, mc->reg); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + abe_disable_gain(MIXAUDUL, mc->reg); + } + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int vxrec_put_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + abe_enable_gain(MIXVXREC, mc->reg); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + abe_disable_gain(MIXVXREC, mc->reg); + } + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int sdt_put_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + abe_enable_gain(MIXSDT, mc->reg); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + abe_disable_gain(MIXSDT, mc->reg); + } + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int abe_get_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + ucontrol->value.integer.value[0] = the_abe->widget_opp[mc->shift]; + return 0; +} + +/* router IDs that match our mixer strings */ +static const abe_router_t router[] = { + ZERO_labelID, /* strangely this is not 0 */ + DMIC1_L_labelID, DMIC1_R_labelID, + DMIC2_L_labelID, DMIC2_R_labelID, + DMIC3_L_labelID, DMIC3_R_labelID, + BT_UL_L_labelID, BT_UL_R_labelID, + MM_EXT_IN_L_labelID, MM_EXT_IN_R_labelID, + AMIC_L_labelID, AMIC_R_labelID, + VX_REC_L_labelID, VX_REC_R_labelID, +}; + +static int ul_mux_put_route(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; + int mux = ucontrol->value.enumerated.item[0]; + int reg = e->reg - ABE_MUX(0); + + pm_runtime_get_sync(the_abe->dev); + + if (mux > ABE_ROUTES_UL) + return 0; + + // TODO: get all this via firmware + if (reg < 8) { + /* 0 .. 9 = MM_UL */ + the_abe->router[reg] = router[mux]; + } else if (reg < 12) { + /* 10 .. 11 = MM_UL2 */ + /* 12 .. 13 = VX_UL */ + the_abe->router[reg + 2] = router[mux]; + } + + /* 2nd arg here is unused */ + abe_set_router_configuration(UPROUTE, 0, (u32 *)the_abe->router); + + if (router[mux] != ZERO_labelID) + the_abe->widget_opp[e->reg] = e->shift_l; + else + the_abe->widget_opp[e->reg] = 0; + + snd_soc_dapm_mux_update_power(widget, kcontrol, 1, mux, e); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int ul_mux_get_route(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_enum *e = + (struct soc_enum *)kcontrol->private_value; + int reg = e->reg - ABE_MUX(0), i, rval = 0; + + // TODO: get all this via firmware + if (reg < 8) { + /* 0 .. 9 = MM_UL */ + rval = the_abe->router[reg]; + } else if (reg < 12) { + /* 10 .. 11 = MM_UL2 */ + /* 12 .. 13 = VX_UL */ + rval = the_abe->router[reg + 2]; + } + + for (i = 0; i < ARRAY_SIZE(router); i++) { + if (router[i] == rval) { + ucontrol->value.integer.value[0] = i; + return 0; + } + } + + return 1; +} + + +static int abe_put_switch(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); + struct snd_soc_dapm_widget *widget = wlist->widgets[0]; + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + if (ucontrol->value.integer.value[0]) { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 1); + } else { + the_abe->widget_opp[mc->shift] = ucontrol->value.integer.value[0]; + snd_soc_dapm_mixer_update_power(widget, kcontrol, 0); + } + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + + +static int volume_put_sdt_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + + abe_write_mixer(MIXSDT, abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_0MS, mc->reg); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_put_audul_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + abe_write_mixer(MIXAUDUL, abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_0MS, mc->reg); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_put_vxrec_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + abe_write_mixer(MIXVXREC, abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_0MS, mc->reg); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_put_dl1_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + abe_write_mixer(MIXDL1, abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_0MS, mc->reg); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_put_dl2_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + abe_write_mixer(MIXDL2, abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_0MS, mc->reg); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_put_gain(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + + pm_runtime_get_sync(the_abe->dev); + abe_write_gain(mc->reg, + abe_val_to_gain(ucontrol->value.integer.value[0]), + RAMP_20MS, mc->shift); + abe_write_gain(mc->reg, + -12000 + (ucontrol->value.integer.value[1] * 100), + RAMP_20MS, mc->rshift); + pm_runtime_put_sync(the_abe->dev); + + return 1; +} + +static int volume_get_dl1_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_mixer(MIXDL1, &val, mc->reg); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int volume_get_dl2_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_mixer(MIXDL2, &val, mc->reg); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int volume_get_audul_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_mixer(MIXAUDUL, &val, mc->reg); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int volume_get_vxrec_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_mixer(MIXVXREC, &val, mc->reg); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int volume_get_sdt_mixer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_mixer(MIXSDT, &val, mc->reg); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int volume_get_gain(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; + u32 val; + + pm_runtime_get_sync(the_abe->dev); + abe_read_gain(mc->reg, &val, mc->shift); + ucontrol->value.integer.value[0] = abe_gain_to_val(val); + abe_read_gain(mc->reg, &val, mc->rshift); + ucontrol->value.integer.value[1] = abe_gain_to_val(val); + pm_runtime_put_sync(the_abe->dev); + + return 0; +} + +static int abe_get_equalizer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + struct soc_enum *eqc = (struct soc_enum *)kcontrol->private_value; + + ucontrol->value.integer.value[0] = the_abe->equ_profile[eqc->reg]; +#endif + return 0; +} + +static int abe_put_equalizer(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + struct soc_enum *eqc = (struct soc_enum *)kcontrol->private_value; + u16 val = ucontrol->value.enumerated.item[0]; + abe_equ_t equ_params; + int size; + + if (val >= the_abe->hdr.num_equ) + return -EINVAL; + + equ_params.equ_length = the_abe->equ_texts[eqc->reg].coeff; + size = the_abe->equ_texts[eqc->reg].coeff * sizeof(s32); + memcpy(equ_params.coef.type1, the_abe->equ[eqc->reg] + val * size, size); + the_abe->equ_profile[eqc->reg] = val; + + pm_runtime_get_sync(the_abe->dev); + abe_write_equalizer(eqc->reg, &equ_params); + pm_runtime_put_sync(the_abe->dev); +#endif + return 1; +} + +int snd_soc_info_enum_ext1(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; + + uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; + uinfo->count = 1; + uinfo->value.enumerated.items = e->max; + + if (uinfo->value.enumerated.item > e->max - 1) + uinfo->value.enumerated.item = e->max - 1; + strcpy(uinfo->value.enumerated.name, + snd_soc_get_enum_text(e, uinfo->value.enumerated.item)); + + return 0; +} + +static const char *route_ul_texts[] = { + "None", "DMic0L", "DMic0R", "DMic1L", "DMic1R", "DMic2L", "DMic2R", + "BT Left", "BT Right", "MMExt Left", "MMExt Right", "AMic0", "AMic1", + "VX Left", "VX Right" +}; + +/* ROUTE_UL Mux table */ +static const struct soc_enum abe_enum[] = { + SOC_ENUM_SINGLE(MUX_MM_UL10, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL11, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL12, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL13, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL14, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL15, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL16, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL17, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL20, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_MM_UL21, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_VX_UL0, 0, 15, route_ul_texts), + SOC_ENUM_SINGLE(MUX_VX_UL1, 0, 15, route_ul_texts), +}; + +static const struct snd_kcontrol_new mm_ul00_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[0], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul01_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[1], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul02_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[2], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul03_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[3], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul04_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[4], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul05_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[5], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul06_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[6], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul07_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[7], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul10_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[8], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_ul11_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[9], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_vx0_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[10], + ul_mux_get_route, ul_mux_put_route); + +static const struct snd_kcontrol_new mm_vx1_control = + SOC_DAPM_ENUM_EXT("Route", abe_enum[11], + ul_mux_get_route, ul_mux_put_route); + +/* DL1 mixer paths */ +static const struct snd_kcontrol_new dl1_mixer_controls[] = { + SOC_SINGLE_EXT("Tones", MIX_DL1_INPUT_TONES, MIX_DL1_TONES, 1, 0, + abe_get_mixer, dl1_put_mixer), + SOC_SINGLE_EXT("Voice", MIX_DL1_INPUT_VX_DL, MIX_DL1_VOICE, 1, 0, + abe_get_mixer, dl1_put_mixer), + SOC_SINGLE_EXT("Capture", MIX_DL1_INPUT_MM_UL2, MIX_DL1_CAPTURE, 1, 0, + abe_get_mixer, dl1_put_mixer), + SOC_SINGLE_EXT("Multimedia", MIX_DL1_INPUT_MM_DL, MIX_DL1_MEDIA, 1, 0, + abe_get_mixer, dl1_put_mixer), +}; + +/* DL2 mixer paths */ +static const struct snd_kcontrol_new dl2_mixer_controls[] = { + SOC_SINGLE_EXT("Tones", MIX_DL2_INPUT_TONES, MIX_DL2_TONES, 1, 0, + abe_get_mixer, dl2_put_mixer), + SOC_SINGLE_EXT("Voice", MIX_DL2_INPUT_VX_DL, MIX_DL2_VOICE, 1, 0, + abe_get_mixer, dl2_put_mixer), + SOC_SINGLE_EXT("Capture", MIX_DL2_INPUT_MM_UL2, MIX_DL2_CAPTURE, 1, 0, + abe_get_mixer, dl2_put_mixer), + SOC_SINGLE_EXT("Multimedia", MIX_DL2_INPUT_MM_DL, MIX_DL2_MEDIA, 1, 0, + abe_get_mixer, dl2_put_mixer), +}; + +/* AUDUL ("Voice Capture Mixer") mixer paths */ +static const struct snd_kcontrol_new audio_ul_mixer_controls[] = { + SOC_SINGLE_EXT("Tones Playback", MIX_AUDUL_INPUT_TONES, MIX_AUDUL_TONES, 1, 0, + abe_get_mixer, audio_ul_put_mixer), + SOC_SINGLE_EXT("Media Playback", MIX_AUDUL_INPUT_MM_DL, MIX_AUDUL_MEDIA, 1, 0, + abe_get_mixer, audio_ul_put_mixer), + SOC_SINGLE_EXT("Capture", MIX_AUDUL_INPUT_UPLINK, MIX_AUDUL_CAPTURE, 1, 0, + abe_get_mixer, audio_ul_put_mixer), +}; + +/* VXREC ("Capture Mixer") mixer paths */ +static const struct snd_kcontrol_new vx_rec_mixer_controls[] = { + SOC_SINGLE_EXT("Tones", MIX_VXREC_INPUT_TONES, MIX_VXREC_TONES, 1, 0, + abe_get_mixer, vxrec_put_mixer), + SOC_SINGLE_EXT("Voice Playback", MIX_VXREC_INPUT_VX_DL, + MIX_VXREC_VOICE_PLAYBACK, 1, 0, abe_get_mixer, vxrec_put_mixer), + SOC_SINGLE_EXT("Voice Capture", MIX_VXREC_INPUT_VX_UL, + MIX_VXREC_VOICE_CAPTURE, 1, 0, abe_get_mixer, vxrec_put_mixer), + SOC_SINGLE_EXT("Media Playback", MIX_VXREC_INPUT_MM_DL, + MIX_VXREC_MEDIA, 1, 0, abe_get_mixer, vxrec_put_mixer), +}; + +/* SDT ("Sidetone Mixer") mixer paths */ +static const struct snd_kcontrol_new sdt_mixer_controls[] = { + SOC_SINGLE_EXT("Capture", MIX_SDT_INPUT_UP_MIXER, MIX_SDT_CAPTURE, 1, 0, + abe_get_mixer, sdt_put_mixer), + SOC_SINGLE_EXT("Playback", MIX_SDT_INPUT_DL1_MIXER, MIX_SDT_PLAYBACK, 1, 0, + abe_get_mixer, sdt_put_mixer), +}; + +/* Virtual PDM_DL Switch */ +static const struct snd_kcontrol_new pdm_dl1_switch_controls = + SOC_SINGLE_EXT("Switch", ABE_VIRTUAL_SWITCH, MIX_SWITCH_PDM_DL, 1, 0, + abe_get_mixer, abe_put_switch); + +/* Virtual BT_VX_DL Switch */ +static const struct snd_kcontrol_new bt_vx_dl_switch_controls = + SOC_SINGLE_EXT("Switch", ABE_VIRTUAL_SWITCH, MIX_SWITCH_BT_VX_DL, 1, 0, + abe_get_mixer, abe_put_switch); + +/* Virtual MM_EXT_DL Switch */ +static const struct snd_kcontrol_new mm_ext_dl_switch_controls = + SOC_SINGLE_EXT("Switch", ABE_VIRTUAL_SWITCH, MIX_SWITCH_MM_EXT_DL, 1, 0, + abe_get_mixer, abe_put_switch); + +static const struct snd_kcontrol_new abe_controls[] = { + /* DL1 mixer gains */ + SOC_SINGLE_EXT_TLV("DL1 Media Playback Volume", + MIX_DL1_INPUT_MM_DL, 0, 149, 0, + volume_get_dl1_mixer, volume_put_dl1_mixer, mm_dl1_tlv), + SOC_SINGLE_EXT_TLV("DL1 Tones Playback Volume", + MIX_DL1_INPUT_TONES, 0, 149, 0, + volume_get_dl1_mixer, volume_put_dl1_mixer, tones_dl1_tlv), + SOC_SINGLE_EXT_TLV("DL1 Voice Playback Volume", + MIX_DL1_INPUT_VX_DL, 0, 149, 0, + volume_get_dl1_mixer, volume_put_dl1_mixer, voice_dl1_tlv), + SOC_SINGLE_EXT_TLV("DL1 Capture Playback Volume", + MIX_DL1_INPUT_MM_UL2, 0, 149, 0, + volume_get_dl1_mixer, volume_put_dl1_mixer, capture_dl1_tlv), + + /* DL2 mixer gains */ + SOC_SINGLE_EXT_TLV("DL2 Media Playback Volume", + MIX_DL2_INPUT_MM_DL, 0, 149, 0, + volume_get_dl2_mixer, volume_put_dl2_mixer, mm_dl2_tlv), + SOC_SINGLE_EXT_TLV("DL2 Tones Playback Volume", + MIX_DL2_INPUT_TONES, 0, 149, 0, + volume_get_dl2_mixer, volume_put_dl2_mixer, tones_dl2_tlv), + SOC_SINGLE_EXT_TLV("DL2 Voice Playback Volume", + MIX_DL2_INPUT_VX_DL, 0, 149, 0, + volume_get_dl2_mixer, volume_put_dl2_mixer, voice_dl2_tlv), + SOC_SINGLE_EXT_TLV("DL2 Capture Playback Volume", + MIX_DL2_INPUT_MM_UL2, 0, 149, 0, + volume_get_dl2_mixer, volume_put_dl2_mixer, capture_dl2_tlv), + + /* VXREC mixer gains */ + SOC_SINGLE_EXT_TLV("VXREC Media Volume", + MIX_VXREC_INPUT_MM_DL, 0, 149, 0, + volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_mm_dl_tlv), + SOC_SINGLE_EXT_TLV("VXREC Tones Volume", + MIX_VXREC_INPUT_TONES, 0, 149, 0, + volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_tones_tlv), + SOC_SINGLE_EXT_TLV("VXREC Voice DL Volume", + MIX_VXREC_INPUT_VX_UL, 0, 149, 0, + volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_dl_tlv), + SOC_SINGLE_EXT_TLV("VXREC Voice UL Volume", + MIX_VXREC_INPUT_VX_DL, 0, 149, 0, + volume_get_vxrec_mixer, volume_put_vxrec_mixer, vxrec_vx_ul_tlv), + + /* AUDUL mixer gains */ + SOC_SINGLE_EXT_TLV("AUDUL Media Volume", + MIX_AUDUL_INPUT_MM_DL, 0, 149, 0, + volume_get_audul_mixer, volume_put_audul_mixer, audul_mm_tlv), + SOC_SINGLE_EXT_TLV("AUDUL Tones Volume", + MIX_AUDUL_INPUT_TONES, 0, 149, 0, + volume_get_audul_mixer, volume_put_audul_mixer, audul_tones_tlv), + SOC_SINGLE_EXT_TLV("AUDUL Voice UL Volume", + MIX_AUDUL_INPUT_UPLINK, 0, 149, 0, + volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_ul_tlv), + SOC_SINGLE_EXT_TLV("AUDUL Voice DL Volume", + MIX_AUDUL_INPUT_VX_DL, 0, 149, 0, + volume_get_audul_mixer, volume_put_audul_mixer, audul_vx_dl_tlv), + + /* SDT mixer gains */ + SOC_SINGLE_EXT_TLV("SDT UL Volume", + MIX_SDT_INPUT_UP_MIXER, 0, 149, 0, + volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_ul_tlv), + SOC_SINGLE_EXT_TLV("SDT DL Volume", + MIX_SDT_INPUT_DL1_MIXER, 0, 149, 0, + volume_get_sdt_mixer, volume_put_sdt_mixer, sdt_dl_tlv), + + /* DMIC gains */ + SOC_DOUBLE_EXT_TLV("DMIC1 UL Volume", + GAINS_DMIC1, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0, + volume_get_gain, volume_put_gain, dmic_tlv), + + SOC_DOUBLE_EXT_TLV("DMIC2 UL Volume", + GAINS_DMIC2, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0, + volume_get_gain, volume_put_gain, dmic_tlv), + + SOC_DOUBLE_EXT_TLV("DMIC3 UL Volume", + GAINS_DMIC3, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0, + volume_get_gain, volume_put_gain, dmic_tlv), + + SOC_DOUBLE_EXT_TLV("AMIC UL Volume", + GAINS_AMIC, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0, + volume_get_gain, volume_put_gain, amic_tlv), + + SOC_DOUBLE_EXT_TLV("BT UL Volume", + GAINS_BTUL, GAIN_LEFT_OFFSET, GAIN_RIGHT_OFFSET, 149, 0, + volume_get_gain, volume_put_gain, btul_tlv), +}; + +static const struct snd_soc_dapm_widget abe_dapm_widgets[] = { + + /* Frontend AIFs */ + SND_SOC_DAPM_AIF_IN("TONES_DL", "Tones Playback", 0, + W_AIF_TONES_DL, ABE_OPP_25, 0), + SND_SOC_DAPM_AIF_IN("VX_DL", "Voice Playback", 0, + W_AIF_VX_DL, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_OUT("VX_UL", "Voice Capture", 0, + W_AIF_VX_UL, ABE_OPP_50, 0), + /* the MM_UL mapping is intentional */ + SND_SOC_DAPM_AIF_OUT("MM_UL1", "MultiMedia1 Capture", 0, + W_AIF_MM_UL1, ABE_OPP_100, 0), + SND_SOC_DAPM_AIF_OUT("MM_UL2", "MultiMedia2 Capture", 0, + W_AIF_MM_UL2, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_IN("MM_DL", " MultiMedia1 Playback", 0, + W_AIF_MM_DL, ABE_OPP_25, 0), + SND_SOC_DAPM_AIF_IN("MM_DL_LP", " MultiMedia1 LP Playback", 0, + W_AIF_MM_DL_LP, ABE_OPP_25, 0), + SND_SOC_DAPM_AIF_IN("VIB_DL", "Vibra Playback", 0, + W_AIF_VIB_DL, ABE_OPP_100, 0), + SND_SOC_DAPM_AIF_IN("MODEM_DL", "MODEM Playback", 0, + W_AIF_MODEM_DL, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_OUT("MODEM_UL", "MODEM Capture", 0, + W_AIF_MODEM_UL, ABE_OPP_50, 0), + + /* Backend DAIs */ + SND_SOC_DAPM_AIF_IN("PDM_UL1", "Analog Capture", 0, + W_AIF_PDM_UL1, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_OUT("PDM_DL1", "HS Playback", 0, + W_AIF_PDM_DL1, ABE_OPP_25, 0), + SND_SOC_DAPM_AIF_OUT("PDM_DL2", "HF Playback", 0, + W_AIF_PDM_DL2, ABE_OPP_100, 0), + SND_SOC_DAPM_AIF_OUT("PDM_VIB", "Vibra Playback", 0, + W_AIF_PDM_VIB, ABE_OPP_100, 0), + SND_SOC_DAPM_AIF_IN("BT_VX_UL", "BT Capture", 0, + W_AIF_BT_VX_UL, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_OUT("BT_VX_DL", "BT Playback", 0, + W_AIF_BT_VX_DL, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_IN("MM_EXT_UL", "FM Capture", 0, + W_AIF_MM_EXT_UL, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_OUT("MM_EXT_DL", "FM Playback", 0, + W_AIF_MM_EXT_DL, ABE_OPP_25, 0), + SND_SOC_DAPM_AIF_IN("DMIC0", "DMIC0 Capture", 0, + W_AIF_DMIC0, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_IN("DMIC1", "DMIC1 Capture", 0, + W_AIF_DMIC1, ABE_OPP_50, 0), + SND_SOC_DAPM_AIF_IN("DMIC2", "DMIC2 Capture", 0, + W_AIF_DMIC2, ABE_OPP_50, 0), + + /* ROUTE_UL Capture Muxes */ + SND_SOC_DAPM_MUX("MUX_UL00", + W_MUX_UL00, ABE_OPP_50, 0, &mm_ul00_control), + SND_SOC_DAPM_MUX("MUX_UL01", + W_MUX_UL01, ABE_OPP_50, 0, &mm_ul01_control), + SND_SOC_DAPM_MUX("MUX_UL02", + W_MUX_UL02, ABE_OPP_50, 0, &mm_ul02_control), + SND_SOC_DAPM_MUX("MUX_UL03", + W_MUX_UL03, ABE_OPP_50, 0, &mm_ul03_control), + SND_SOC_DAPM_MUX("MUX_UL04", + W_MUX_UL04, ABE_OPP_50, 0, &mm_ul04_control), + SND_SOC_DAPM_MUX("MUX_UL05", + W_MUX_UL05, ABE_OPP_50, 0, &mm_ul05_control), + SND_SOC_DAPM_MUX("MUX_UL06", + W_MUX_UL06, ABE_OPP_50, 0, &mm_ul06_control), + SND_SOC_DAPM_MUX("MUX_UL07", + W_MUX_UL07, ABE_OPP_50, 0, &mm_ul07_control), + SND_SOC_DAPM_MUX("MUX_UL10", + W_MUX_UL10, ABE_OPP_50, 0, &mm_ul10_control), + SND_SOC_DAPM_MUX("MUX_UL11", + W_MUX_UL11, ABE_OPP_50, 0, &mm_ul11_control), + SND_SOC_DAPM_MUX("MUX_VX0", + W_MUX_VX00, ABE_OPP_50, 0, &mm_vx0_control), + SND_SOC_DAPM_MUX("MUX_VX1", + W_MUX_VX01, ABE_OPP_50, 0, &mm_vx1_control), + + /* DL1 & DL2 Playback Mixers */ + SND_SOC_DAPM_MIXER("DL1 Mixer", + W_MIXER_DL1, ABE_OPP_25, 0, dl1_mixer_controls, + ARRAY_SIZE(dl1_mixer_controls)), + SND_SOC_DAPM_MIXER("DL2 Mixer", + W_MIXER_DL2, ABE_OPP_100, 0, dl2_mixer_controls, + ARRAY_SIZE(dl2_mixer_controls)), + + /* DL1 Mixer Input volumes ?????*/ + SND_SOC_DAPM_PGA("DL1 Media Volume", + W_VOLUME_DL1, 0, 0, NULL, 0), + + /* AUDIO_UL_MIXER */ + SND_SOC_DAPM_MIXER("Voice Capture Mixer", + W_MIXER_AUDIO_UL, ABE_OPP_50, 0, audio_ul_mixer_controls, + ARRAY_SIZE(audio_ul_mixer_controls)), + + /* VX_REC_MIXER */ + SND_SOC_DAPM_MIXER("Capture Mixer", + W_MIXER_VX_REC, ABE_OPP_50, 0, vx_rec_mixer_controls, + ARRAY_SIZE(vx_rec_mixer_controls)), + + /* SDT_MIXER - TODO: shoult this not be OPP25 ??? */ + SND_SOC_DAPM_MIXER("Sidetone Mixer", + W_MIXER_SDT, ABE_OPP_25, 0, sdt_mixer_controls, + ARRAY_SIZE(sdt_mixer_controls)), + + /* + * The Following three are virtual switches to select the output port + * after DL1 Gain. + */ + + /* Virtual PDM_DL1 Switch */ + SND_SOC_DAPM_MIXER("DL1 PDM", + W_VSWITCH_DL1_PDM, ABE_OPP_25, 0, &pdm_dl1_switch_controls, 1), + + /* Virtual BT_VX_DL Switch */ + SND_SOC_DAPM_MIXER("DL1 BT_VX", + W_VSWITCH_DL1_BT_VX, ABE_OPP_50, 0, &bt_vx_dl_switch_controls, 1), + + /* Virtual MM_EXT_DL Switch TODO: confrm OPP level here */ + SND_SOC_DAPM_MIXER("DL1 MM_EXT", + W_VSWITCH_DL1_MM_EXT, ABE_OPP_50, 0, &mm_ext_dl_switch_controls, 1), + + /* Virtuals to join our capture sources */ + SND_SOC_DAPM_MIXER("Sidetone Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + SND_SOC_DAPM_MIXER("Voice Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + SND_SOC_DAPM_MIXER("DL1 Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + SND_SOC_DAPM_MIXER("DL2 Capture VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + + /* Join our MM_DL and MM_DL_LP playback */ + SND_SOC_DAPM_MIXER("MM_DL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + + /* Virtual MODEM and VX_UL mixer */ + SND_SOC_DAPM_MIXER("VX UL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + SND_SOC_DAPM_MIXER("VX DL VMixer", SND_SOC_NOPM, 0, 0, NULL, 0), + + /* Virtual Pins to force backends ON atm */ + SND_SOC_DAPM_OUTPUT("BE_OUT"), + SND_SOC_DAPM_INPUT("BE_IN"), +}; + +static const struct snd_soc_dapm_route intercon[] = { + + /* MUX_UL00 - ROUTE_UL - Chan 0 */ + {"MUX_UL00", "DMic0L", "DMIC0"}, + {"MUX_UL00", "DMic0R", "DMIC0"}, + {"MUX_UL00", "DMic1L", "DMIC1"}, + {"MUX_UL00", "DMic1R", "DMIC1"}, + {"MUX_UL00", "DMic2L", "DMIC2"}, + {"MUX_UL00", "DMic2R", "DMIC2"}, + {"MUX_UL00", "BT Left", "BT_VX_UL"}, + {"MUX_UL00", "BT Right", "BT_VX_UL"}, + {"MUX_UL00", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL00", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL00", "AMic0", "PDM_UL1"}, + {"MUX_UL00", "AMic1", "PDM_UL1"}, + {"MUX_UL00", "VX Left", "Capture Mixer"}, + {"MUX_UL00", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL00"}, + + /* MUX_UL01 - ROUTE_UL - Chan 1 */ + {"MUX_UL01", "DMic0L", "DMIC0"}, + {"MUX_UL01", "DMic0R", "DMIC0"}, + {"MUX_UL01", "DMic1L", "DMIC1"}, + {"MUX_UL01", "DMic1R", "DMIC1"}, + {"MUX_UL01", "DMic2L", "DMIC2"}, + {"MUX_UL01", "DMic2R", "DMIC2"}, + {"MUX_UL01", "BT Left", "BT_VX_UL"}, + {"MUX_UL01", "BT Right", "BT_VX_UL"}, + {"MUX_UL01", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL01", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL01", "AMic0", "PDM_UL1"}, + {"MUX_UL01", "AMic1", "PDM_UL1"}, + {"MUX_UL01", "VX Left", "Capture Mixer"}, + {"MUX_UL01", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL01"}, + + /* MUX_UL02 - ROUTE_UL - Chan 2 */ + {"MUX_UL02", "DMic0L", "DMIC0"}, + {"MUX_UL02", "DMic0R", "DMIC0"}, + {"MUX_UL02", "DMic1L", "DMIC1"}, + {"MUX_UL02", "DMic1R", "DMIC1"}, + {"MUX_UL02", "DMic2L", "DMIC2"}, + {"MUX_UL02", "DMic2R", "DMIC2"}, + {"MUX_UL02", "BT Left", "BT_VX_UL"}, + {"MUX_UL02", "BT Right", "BT_VX_UL"}, + {"MUX_UL02", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL02", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL02", "AMic0", "PDM_UL1"}, + {"MUX_UL02", "AMic1", "PDM_UL1"}, + {"MUX_UL02", "VX Left", "Capture Mixer"}, + {"MUX_UL02", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL02"}, + + /* MUX_UL03 - ROUTE_UL - Chan 3 */ + {"MUX_UL03", "DMic0L", "DMIC0"}, + {"MUX_UL03", "DMic0R", "DMIC0"}, + {"MUX_UL03", "DMic1L", "DMIC1"}, + {"MUX_UL03", "DMic1R", "DMIC1"}, + {"MUX_UL03", "DMic2L", "DMIC2"}, + {"MUX_UL03", "DMic2R", "DMIC2"}, + {"MUX_UL03", "BT Left", "BT_VX_UL"}, + {"MUX_UL03", "BT Right", "BT_VX_UL"}, + {"MUX_UL03", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL03", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL03", "AMic0", "PDM_UL1"}, + {"MUX_UL03", "AMic1", "PDM_UL1"}, + {"MUX_UL03", "VX Left", "Capture Mixer"}, + {"MUX_UL03", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL03"}, + + /* MUX_UL04 - ROUTE_UL - Chan 4 */ + {"MUX_UL04", "DMic0L", "DMIC0"}, + {"MUX_UL04", "DMic0R", "DMIC0"}, + {"MUX_UL04", "DMic1L", "DMIC1"}, + {"MUX_UL04", "DMic1R", "DMIC1"}, + {"MUX_UL04", "DMic2L", "DMIC2"}, + {"MUX_UL04", "DMic2R", "DMIC2"}, + {"MUX_UL04", "BT Left", "BT_VX_UL"}, + {"MUX_UL04", "BT Right", "BT_VX_UL"}, + {"MUX_UL04", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL04", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL04", "AMic0", "PDM_UL1"}, + {"MUX_UL04", "AMic1", "PDM_UL1"}, + {"MUX_UL04", "VX Left", "Capture Mixer"}, + {"MUX_UL04", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL04"}, + + /* MUX_UL05 - ROUTE_UL - Chan 5 */ + {"MUX_UL05", "DMic0L", "DMIC0"}, + {"MUX_UL05", "DMic0R", "DMIC0"}, + {"MUX_UL05", "DMic1L", "DMIC1"}, + {"MUX_UL05", "DMic1R", "DMIC1"}, + {"MUX_UL05", "DMic2L", "DMIC2"}, + {"MUX_UL05", "DMic2R", "DMIC2"}, + {"MUX_UL05", "BT Left", "BT_VX_UL"}, + {"MUX_UL05", "BT Right", "BT_VX_UL"}, + {"MUX_UL05", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL05", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL05", "AMic0", "PDM_UL1"}, + {"MUX_UL05", "AMic1", "PDM_UL1"}, + {"MUX_UL05", "VX Left", "Capture Mixer"}, + {"MUX_UL05", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL05"}, + + /* MUX_UL06 - ROUTE_UL - Chan 6 */ + {"MUX_UL06", "DMic0L", "DMIC0"}, + {"MUX_UL06", "DMic0R", "DMIC0"}, + {"MUX_UL06", "DMic1L", "DMIC1"}, + {"MUX_UL06", "DMic1R", "DMIC1"}, + {"MUX_UL06", "DMic2L", "DMIC2"}, + {"MUX_UL06", "DMic2R", "DMIC2"}, + {"MUX_UL06", "BT Left", "BT_VX_UL"}, + {"MUX_UL06", "BT Right", "BT_VX_UL"}, + {"MUX_UL06", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL06", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL06", "AMic0", "PDM_UL1"}, + {"MUX_UL06", "AMic1", "PDM_UL1"}, + {"MUX_UL06", "VX Left", "Capture Mixer"}, + {"MUX_UL06", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL06"}, + + /* MUX_UL07 - ROUTE_UL - Chan 7 */ + {"MUX_UL07", "DMic0L", "DMIC0"}, + {"MUX_UL07", "DMic0R", "DMIC0"}, + {"MUX_UL07", "DMic1L", "DMIC1"}, + {"MUX_UL07", "DMic1R", "DMIC1"}, + {"MUX_UL07", "DMic2L", "DMIC2"}, + {"MUX_UL07", "DMic2R", "DMIC2"}, + {"MUX_UL07", "BT Left", "BT_VX_UL"}, + {"MUX_UL07", "BT Right", "BT_VX_UL"}, + {"MUX_UL07", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL07", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL07", "AMic0", "PDM_UL1"}, + {"MUX_UL07", "AMic1", "PDM_UL1"}, + {"MUX_UL07", "VX Left", "Capture Mixer"}, + {"MUX_UL07", "VX Right", "Capture Mixer"}, + {"MM_UL1", NULL, "MUX_UL07"}, + + /* MUX_UL10 - ROUTE_UL - Chan 10 */ + {"MUX_UL10", "DMic0L", "DMIC0"}, + {"MUX_UL10", "DMic0R", "DMIC0"}, + {"MUX_UL10", "DMic1L", "DMIC1"}, + {"MUX_UL10", "DMic1R", "DMIC1"}, + {"MUX_UL10", "DMic2L", "DMIC2"}, + {"MUX_UL10", "DMic2R", "DMIC2"}, + {"MUX_UL10", "BT Left", "BT_VX_UL"}, + {"MUX_UL10", "BT Right", "BT_VX_UL"}, + {"MUX_UL10", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL10", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL10", "AMic0", "PDM_UL1"}, + {"MUX_UL10", "AMic1", "PDM_UL1"}, + {"MUX_UL10", "VX Left", "Capture Mixer"}, + {"MUX_UL10", "VX Right", "Capture Mixer"}, + {"MM_UL2", NULL, "MUX_UL10"}, + + /* MUX_UL11 - ROUTE_UL - Chan 11 */ + {"MUX_UL11", "DMic0L", "DMIC0"}, + {"MUX_UL11", "DMic0R", "DMIC0"}, + {"MUX_UL11", "DMic1L", "DMIC1"}, + {"MUX_UL11", "DMic1R", "DMIC1"}, + {"MUX_UL11", "DMic2L", "DMIC2"}, + {"MUX_UL11", "DMic2R", "DMIC2"}, + {"MUX_UL11", "BT Left", "BT_VX_UL"}, + {"MUX_UL11", "BT Right", "BT_VX_UL"}, + {"MUX_UL11", "MMExt Left", "MM_EXT_UL"}, + {"MUX_UL11", "MMExt Right", "MM_EXT_UL"}, + {"MUX_UL11", "AMic0", "PDM_UL1"}, + {"MUX_UL11", "AMic1", "PDM_UL1"}, + {"MUX_UL11", "VX Left", "Capture Mixer"}, + {"MUX_UL11", "VX Right", "Capture Mixer"}, + {"MM_UL2", NULL, "MUX_UL11"}, + + /* MUX_VX0 - ROUTE_UL - Chan 20 */ + {"MUX_VX0", "DMic0L", "DMIC0"}, + {"MUX_VX0", "DMic0R", "DMIC0"}, + {"MUX_VX0", "DMic1L", "DMIC1"}, + {"MUX_VX0", "DMic1R", "DMIC1"}, + {"MUX_VX0", "DMic2L", "DMIC2"}, + {"MUX_VX0", "DMic2R", "DMIC2"}, + {"MUX_VX0", "BT Left", "BT_VX_UL"}, + {"MUX_VX0", "BT Right", "BT_VX_UL"}, + {"MUX_VX0", "MMExt Left", "MM_EXT_UL"}, + {"MUX_VX0", "MMExt Right", "MM_EXT_UL"}, + {"MUX_VX0", "AMic0", "PDM_UL1"}, + {"MUX_VX0", "AMic1", "PDM_UL1"}, + {"MUX_VX0", "VX Left", "Capture Mixer"}, + {"MUX_VX0", "VX Right", "Capture Mixer"}, + + /* MUX_VX1 - ROUTE_UL - Chan 20 */ + {"MUX_VX1", "DMic0L", "DMIC0"}, + {"MUX_VX1", "DMic0R", "DMIC0"}, + {"MUX_VX1", "DMic1L", "DMIC1"}, + {"MUX_VX1", "DMic1R", "DMIC1"}, + {"MUX_VX1", "DMic2L", "DMIC2"}, + {"MUX_VX1", "DMic2R", "DMIC2"}, + {"MUX_VX1", "BT Left", "BT_VX_UL"}, + {"MUX_VX1", "BT Right", "BT_VX_UL"}, + {"MUX_VX1", "MMExt Left", "MM_EXT_UL"}, + {"MUX_VX1", "MMExt Right", "MM_EXT_UL"}, + {"MUX_VX1", "AMic0", "PDM_UL1"}, + {"MUX_VX1", "AMic1", "PDM_UL1"}, + {"MUX_VX1", "VX Left", "Capture Mixer"}, + {"MUX_VX1", "VX Right", "Capture Mixer"}, + + /* Headset (DL1) playback path */ + {"DL1 Mixer", "Tones", "TONES_DL"}, + {"DL1 Mixer", "Voice", "VX DL VMixer"}, + {"DL1 Mixer", "Capture", "DL1 Capture VMixer"}, + {"DL1 Capture VMixer", NULL, "MUX_UL10"}, + {"DL1 Capture VMixer", NULL, "MUX_UL11"}, + {"DL1 Mixer", "Multimedia", "MM_DL VMixer"}, + {"MM_DL VMixer", NULL, "MM_DL"}, + {"MM_DL VMixer", NULL, "MM_DL_LP"}, + + /* Sidetone Mixer */ + {"Sidetone Mixer", "Playback", "DL1 Mixer"}, + {"Sidetone Mixer", "Capture", "Sidetone Capture VMixer"}, + {"Sidetone Capture VMixer", NULL, "MUX_VX0"}, + {"Sidetone Capture VMixer", NULL, "MUX_VX1"}, + + /* Playback Output selection after DL1 Gain */ + {"DL1 BT_VX", "Switch", "Sidetone Mixer"}, + {"DL1 MM_EXT", "Switch", "Sidetone Mixer"}, + {"DL1 PDM", "Switch", "Sidetone Mixer"}, + {"PDM_DL1", NULL, "DL1 PDM"}, + {"BT_VX_DL", NULL, "DL1 BT_VX"}, + {"MM_EXT_DL", NULL, "DL1 MM_EXT"}, + + /* Handsfree (DL2) playback path */ + {"DL2 Mixer", "Tones", "TONES_DL"}, + {"DL2 Mixer", "Voice", "VX DL VMixer"}, + {"DL2 Mixer", "Capture", "DL2 Capture VMixer"}, + {"DL2 Capture VMixer", NULL, "MUX_UL10"}, + {"DL2 Capture VMixer", NULL, "MUX_UL11"}, + {"DL2 Mixer", "Multimedia", "MM_DL VMixer"}, + {"MM_DL VMixer", NULL, "MM_DL"}, + {"MM_DL VMixer", NULL, "MM_DL_LP"}, + {"PDM_DL2", NULL, "DL2 Mixer"}, + + /* VxREC Mixer */ + {"Capture Mixer", "Tones", "TONES_DL"}, + {"Capture Mixer", "Voice Playback", "VX DL VMixer"}, + {"Capture Mixer", "Voice Capture", "VX UL VMixer"}, + {"Capture Mixer", "Media Playback", "MM_DL VMixer"}, + {"MM_DL VMixer", NULL, "MM_DL"}, + {"MM_DL VMixer", NULL, "MM_DL_LP"}, + + /* Audio UL mixer */ + {"Voice Capture Mixer", "Tones Playback", "TONES_DL"}, + {"Voice Capture Mixer", "Media Playback", "MM_DL VMixer"}, + {"MM_DL VMixer", NULL, "MM_DL"}, + {"MM_DL VMixer", NULL, "MM_DL_LP"}, + {"Voice Capture Mixer", "Capture", "Voice Capture VMixer"}, + {"Voice Capture VMixer", NULL, "MUX_VX0"}, + {"Voice Capture VMixer", NULL, "MUX_VX1"}, + + /* BT */ + {"VX UL VMixer", NULL, "Voice Capture Mixer"}, + + /* Vibra */ + {"PDM_VIB", NULL, "VIB_DL"}, + + /* VX and MODEM */ + {"VX_UL", NULL, "VX UL VMixer"}, + {"MODEM_UL", NULL, "VX UL VMixer"}, + {"VX DL VMixer", NULL, "VX_DL"}, + {"VX DL VMixer", NULL, "MODEM_DL"}, + + /* Backend Enablement - TODO: maybe re-work*/ + {"BE_OUT", NULL, "PDM_DL1"}, + {"BE_OUT", NULL, "PDM_DL2"}, + {"BE_OUT", NULL, "PDM_VIB"}, + {"BE_OUT", NULL, "MM_EXT_DL"}, + {"BE_OUT", NULL, "BT_VX_DL"}, + {"PDM_UL1", NULL, "BE_IN"}, + {"BT_VX_UL", NULL, "BE_IN"}, + {"MM_EXT_UL", NULL, "BE_IN"}, + {"DMIC0", NULL, "BE_IN"}, + {"DMIC1", NULL, "BE_IN"}, + {"DMIC2", NULL, "BE_IN"}, +}; + +#ifdef CONFIG_DEBUG_FS + +static int abe_dbg_get_dma_pos(struct abe_data *abe) +{ + return omap_get_dma_dst_pos(abe->dma_ch) - abe->dbg_buffer_addr; +} + +static void abe_dbg_dma_irq(int ch, u16 stat, void *data) +{ +} + +static int abe_dbg_start_dma(struct abe_data *abe, int circular) +{ + struct omap_dma_channel_params dma_params; + int err; + + /* TODO: start the DMA in either :- + * + * 1) circular buffer mode where the DMA will restart when it get to + * the end of the buffer. + * 2) default mode, where DMA stops at the end of the buffer. + */ + + abe->dma_req = OMAP44XX_DMA_ABE_REQ_7; + err = omap_request_dma(abe->dma_req, "ABE debug", + abe_dbg_dma_irq, abe, &abe->dma_ch); + if (abe->dbg_circular) { + /* + * Link channel with itself so DMA doesn't need any + * reprogramming while looping the buffer + */ + omap_dma_link_lch(abe->dma_ch, abe->dma_ch); + } + + memset(&dma_params, 0, sizeof(dma_params)); + dma_params.data_type = OMAP_DMA_DATA_TYPE_S32; + dma_params.trigger = abe->dma_req; + dma_params.sync_mode = OMAP_DMA_SYNC_FRAME; + dma_params.src_amode = OMAP_DMA_AMODE_DOUBLE_IDX; + dma_params.dst_amode = OMAP_DMA_AMODE_POST_INC; + dma_params.src_or_dst_synch = OMAP_DMA_SRC_SYNC; + dma_params.src_start = D_DEBUG_FIFO_ADDR + ABE_DMEM_BASE_ADDRESS_L3; + dma_params.dst_start = abe->dbg_buffer_addr; + dma_params.src_port = OMAP_DMA_PORT_MPUI; + dma_params.src_ei = 1; + dma_params.src_fi = 1 - abe->dbg_elem_bytes; + + dma_params.elem_count = abe->dbg_elem_bytes >> 2; /* 128 bytes shifted into words */ + dma_params.frame_count = abe->dbg_buffer_bytes / abe->dbg_elem_bytes; + omap_set_dma_params(abe->dma_ch, &dma_params); + + omap_enable_dma_irq(abe->dma_ch, OMAP_DMA_FRAME_IRQ); + omap_set_dma_src_burst_mode(abe->dma_ch, OMAP_DMA_DATA_BURST_16); + omap_set_dma_dest_burst_mode(abe->dma_ch, OMAP_DMA_DATA_BURST_16); + + abe->dbg_reader_offset = 0; + + pm_runtime_get_sync(abe->dev); + omap_start_dma(abe->dma_ch); + return 0; +} + +static void abe_dbg_stop_dma(struct abe_data *abe) +{ + while (omap_get_dma_active_status(abe->dma_ch)) + omap_stop_dma(abe->dma_ch); + + if (abe->dbg_circular) + omap_dma_unlink_lch(abe->dma_ch, abe->dma_ch); + omap_free_dma(abe->dma_ch); + pm_runtime_put_sync(abe->dev); +} + +static int abe_open_data(struct inode *inode, struct file *file) +{ + struct abe_data *abe = inode->i_private; + + abe->dbg_elem_bytes = 128; /* size of debug data per tick */ + + if (abe->dbg_format1) + abe->dbg_elem_bytes += ABE_DBG_FLAG1_SIZE; + if (abe->dbg_format2) + abe->dbg_elem_bytes += ABE_DBG_FLAG2_SIZE; + if (abe->dbg_format3) + abe->dbg_elem_bytes += ABE_DBG_FLAG3_SIZE; + + abe->dbg_buffer_bytes = abe->dbg_elem_bytes * 4 * + abe->dbg_buffer_msecs; + + abe->dbg_buffer = dma_alloc_writecombine(abe->dev, + abe->dbg_buffer_bytes, &abe->dbg_buffer_addr, GFP_KERNEL); + if (abe->dbg_buffer == NULL) + return -ENOMEM; + + file->private_data = inode->i_private; + abe->dbg_complete = 0; + abe_dbg_start_dma(abe, abe->dbg_circular); + + return 0; +} + +static int abe_release_data(struct inode *inode, struct file *file) +{ + struct abe_data *abe = inode->i_private; + + abe_dbg_stop_dma(abe); + + dma_free_writecombine(abe->dev, abe->dbg_buffer_bytes, + abe->dbg_buffer, abe->dbg_buffer_addr); + return 0; +} + +static ssize_t abe_copy_to_user(struct abe_data *abe, char __user *user_buf, + size_t count) +{ + /* check for reader buffer wrap */ + if (abe->dbg_reader_offset + count > abe->dbg_buffer_bytes) { + int size = abe->dbg_buffer_bytes - abe->dbg_reader_offset; + + /* wrap */ + if (copy_to_user(user_buf, + abe->dbg_buffer + abe->dbg_reader_offset, size)) + return -EFAULT; + + /* need to just return if non circular */ + if (!abe->dbg_circular) { + abe->dbg_complete = 1; + return count; + } + + if (copy_to_user(user_buf, + abe->dbg_buffer, count - size)) + return -EFAULT; + abe->dbg_reader_offset = count - size; + return count; + } else { + /* no wrap */ + if (copy_to_user(user_buf, + abe->dbg_buffer + abe->dbg_reader_offset, count)) + return -EFAULT; + abe->dbg_reader_offset += count; + + if (!abe->dbg_circular && + abe->dbg_reader_offset == abe->dbg_buffer_bytes) + abe->dbg_complete = 1; + + return count; + } +} + +static ssize_t abe_read_data(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + ssize_t ret = 0; + struct abe_data *abe = file->private_data; + DECLARE_WAITQUEUE(wait, current); + int dma_offset, bytes; + + add_wait_queue(&abe->wait, &wait); + do { + set_current_state(TASK_INTERRUPTIBLE); + /* TODO: Check if really needed. Or adjust sleep delay + * If not delay trace is not working */ + msleep_interruptible(1); + dma_offset = abe_dbg_get_dma_pos(abe); + + /* is DMA finished ? */ + if (abe->dbg_complete) + break; + + /* get maximum amount of debug bytes we can read */ + if (dma_offset >= abe->dbg_reader_offset) { + /* dma ptr is ahead of reader */ + bytes = dma_offset - abe->dbg_reader_offset; + } else { + /* dma ptr is behind reader */ + bytes = dma_offset + abe->dbg_buffer_bytes - + abe->dbg_reader_offset; + } + + if (count > bytes) + count = bytes; + + if (count > 0) { + ret = abe_copy_to_user(abe, user_buf, count); + break; + } + + if (file->f_flags & O_NONBLOCK) { + ret = -EAGAIN; + break; + } + + if (signal_pending(current)) { + ret = -ERESTARTSYS; + break; + } + + schedule(); + + } while (1); + + __set_current_state(TASK_RUNNING); + remove_wait_queue(&abe->wait, &wait); + + return ret; +} + +static const struct file_operations abe_data_fops = { + .open = abe_open_data, + .read = abe_read_data, + .release = abe_release_data, +}; + +static void abe_init_debugfs(struct abe_data *abe) +{ + abe->debugfs_root = debugfs_create_dir("omap4-abe", NULL); + if (!abe->debugfs_root) { + printk(KERN_WARNING "ABE: Failed to create debugfs directory\n"); + return; + } + + abe->debugfs_fmt1 = debugfs_create_bool("format1", 0644, + abe->debugfs_root, + &abe->dbg_format1); + if (!abe->debugfs_fmt1) + printk(KERN_WARNING "ABE: Failed to create format1 debugfs file\n"); + + abe->debugfs_fmt2 = debugfs_create_bool("format2", 0644, + abe->debugfs_root, + &abe->dbg_format2); + if (!abe->debugfs_fmt2) + printk(KERN_WARNING "ABE: Failed to create format2 debugfs file\n"); + + abe->debugfs_fmt3 = debugfs_create_bool("format3", 0644, + abe->debugfs_root, + &abe->dbg_format3); + if (!abe->debugfs_fmt3) + printk(KERN_WARNING "ABE: Failed to create format3 debugfs file\n"); + + abe->debugfs_elem_bytes = debugfs_create_u32("element_bytes", 0604, + abe->debugfs_root, + &abe->dbg_elem_bytes); + if (!abe->debugfs_elem_bytes) + printk(KERN_WARNING "ABE: Failed to create element size debugfs file\n"); + + abe->debugfs_size = debugfs_create_u32("msecs", 0644, + abe->debugfs_root, + &abe->dbg_buffer_msecs); + if (!abe->debugfs_size) + printk(KERN_WARNING "ABE: Failed to create buffer size debugfs file\n"); + + abe->debugfs_circ = debugfs_create_bool("circular", 0644, + abe->debugfs_root, + &abe->dbg_circular); + if (!abe->debugfs_size) + printk(KERN_WARNING "ABE: Failed to create circular mode debugfs file\n"); + + abe->debugfs_data = debugfs_create_file("debug", 0644, + abe->debugfs_root, + abe, &abe_data_fops); + if (!abe->debugfs_data) + printk(KERN_WARNING "ABE: Failed to create data debugfs file\n"); + + abe->debugfs_opp_level = debugfs_create_u32("opp_level", 0604, + abe->debugfs_root, + &abe->opp); + if (!abe->debugfs_opp_level) + printk(KERN_WARNING "ABE: Failed to create OPP level debugfs file\n"); + + abe->dbg_buffer_msecs = 500; + init_waitqueue_head(&abe->wait); +} + +static void abe_cleanup_debugfs(struct abe_data *abe) +{ + debugfs_remove_recursive(abe->debugfs_root); +} + +#else + +static inline void abe_init_debugfs(struct abe_data *abe) +{ +} + +static inline void abe_cleanup_debugfs(struct abe_data *abe) +{ +} +#endif + +static const struct snd_pcm_hardware omap_abe_hardware = { + .info = SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .period_bytes_min = 4 * 1024, + .period_bytes_max = 24 * 1024, + .periods_min = 2, + .periods_max = 2, + .buffer_bytes_max = 24 * 1024 * 2, +}; + + +static int abe_set_opp_mode(struct abe_data *abe) +{ + int i, opp = 0; + + /* now calculate OPP level based upon DAPM widget status */ + for (i = 0; i < ABE_NUM_WIDGETS; i++) { + if (abe->widget_opp[ABE_WIDGET(i)]) { + dev_dbg(abe->dev, "OPP: id %d = %d%%\n", i, + abe->widget_opp[ABE_WIDGET(i)] * 25); + opp |= abe->widget_opp[ABE_WIDGET(i)]; + } + } + opp = (1 << (fls(opp) - 1)) * 25; + + if (abe->opp > opp) { + /* Decrease OPP mode - no need of OPP100% */ + switch (opp) { + case 25: + abe_set_opp_processing(ABE_OPP25); + udelay(250); + omap_device_set_rate(abe->dev, abe->dev, 49150000); + break; + case 50: + default: + abe_set_opp_processing(ABE_OPP50); + udelay(250); + omap_device_set_rate(abe->dev, abe->dev, 98300000); + break; + } + } else if (abe->opp < opp) { + /* Increase OPP mode */ + switch (opp) { + case 25: + omap_device_set_rate(abe->dev, abe->dev, 49000000); + abe_set_opp_processing(ABE_OPP25); + break; + case 50: + omap_device_set_rate(abe->dev, abe->dev, 98300000); + abe_set_opp_processing(ABE_OPP50); + break; + case 100: + default: + omap_device_set_rate(abe->dev, abe->dev, 196600000); + abe_set_opp_processing(ABE_OPP100); + break; + } + } + abe->opp = opp; + dev_dbg(abe->dev, "new OPP level is %d\n", opp); + + return 0; +} + +static int aess_set_runtime_opp_level(struct abe_data *abe) +{ + mutex_lock(&abe->opp_mutex); + + pm_runtime_get_sync(abe->dev); + abe_set_opp_mode(abe); + pm_runtime_put_sync(abe->dev); + + mutex_unlock(&abe->opp_mutex); + + return 0; +} + +static int aess_save_context(struct abe_data *abe) +{ + struct omap4_abe_dsp_pdata *pdata = abe->abe_pdata; + + /* TODO: Find a better way to save/retore gains after OFF mode */ + + abe_mute_gain(MIXSDT, MIX_SDT_INPUT_UP_MIXER); + abe_mute_gain(MIXSDT, MIX_SDT_INPUT_DL1_MIXER); + abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_MM_DL); + abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_TONES); + abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_UPLINK); + abe_mute_gain(MIXAUDUL, MIX_AUDUL_INPUT_VX_DL); + abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_TONES); + abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_DL); + abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_MM_DL); + abe_mute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_UL); + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL); + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_MM_UL2); + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL); + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_TONES); + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_TONES); + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL); + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL); + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_MM_UL2); + abe_mute_gain(MIXECHO, MIX_ECHO_DL1); + abe_mute_gain(MIXECHO, MIX_ECHO_DL2); + abe_mute_gain(GAINS_DMIC1, GAIN_LEFT_OFFSET); + abe_mute_gain(GAINS_DMIC1, GAIN_RIGHT_OFFSET); + abe_mute_gain(GAINS_DMIC2, GAIN_LEFT_OFFSET); + abe_mute_gain(GAINS_DMIC2, GAIN_RIGHT_OFFSET); + abe_mute_gain(GAINS_DMIC3, GAIN_LEFT_OFFSET); + abe_mute_gain(GAINS_DMIC3, GAIN_RIGHT_OFFSET); + abe_mute_gain(GAINS_AMIC, GAIN_LEFT_OFFSET); + abe_mute_gain(GAINS_AMIC, GAIN_RIGHT_OFFSET); + + if (pdata->get_context_loss_count) + abe->loss_count = pdata->get_context_loss_count(abe->dev); + + return 0; +} + +static int aess_restore_context(struct abe_data *abe) +{ + struct omap4_abe_dsp_pdata *pdata = abe->abe_pdata; + int loss_count = 0; + + omap_device_set_rate(&abe->dev, &abe->dev, 98000000); + + if (pdata->get_context_loss_count) + loss_count = pdata->get_context_loss_count(abe->dev); + + if (loss_count != the_abe->loss_count) + abe_reload_fw(); + + /* TODO: Find a better way to save/retore gains after dor OFF mode */ + abe_unmute_gain(MIXSDT, MIX_SDT_INPUT_UP_MIXER); + abe_unmute_gain(MIXSDT, MIX_SDT_INPUT_DL1_MIXER); + abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_MM_DL); + abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_TONES); + abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_UPLINK); + abe_unmute_gain(MIXAUDUL, MIX_AUDUL_INPUT_VX_DL); + abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_TONES); + abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_DL); + abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_MM_DL); + abe_unmute_gain(MIXVXREC, MIX_VXREC_INPUT_VX_UL); + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL); + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_MM_UL2); + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL); + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_TONES); + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_TONES); + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL); + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL); + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_MM_UL2); + abe_unmute_gain(MIXECHO, MIX_ECHO_DL1); + abe_unmute_gain(MIXECHO, MIX_ECHO_DL2); + abe_unmute_gain(GAINS_DMIC1, GAIN_LEFT_OFFSET); + abe_unmute_gain(GAINS_DMIC1, GAIN_RIGHT_OFFSET); + abe_unmute_gain(GAINS_DMIC2, GAIN_LEFT_OFFSET); + abe_unmute_gain(GAINS_DMIC2, GAIN_RIGHT_OFFSET); + abe_unmute_gain(GAINS_DMIC3, GAIN_LEFT_OFFSET); + abe_unmute_gain(GAINS_DMIC3, GAIN_RIGHT_OFFSET); + abe_unmute_gain(GAINS_AMIC, GAIN_LEFT_OFFSET); + abe_unmute_gain(GAINS_AMIC, GAIN_RIGHT_OFFSET); + + abe_set_router_configuration(UPROUTE, 0, (u32 *)abe->router); + + return 0; +} + +static int aess_open(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_platform *platform = rtd->platform; + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + struct snd_soc_dai *dai = rtd->cpu_dai; + int ret = 0; + + mutex_lock(&abe->mutex); + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + pm_runtime_get_sync(abe->dev); + + if (!abe->active++) { + abe->opp = 0; + aess_restore_context(abe); + abe_set_opp_mode(abe); + abe_wakeup(); + } + + switch (dai->id) { + case ABE_FRONTEND_DAI_MODEM: + break; + case ABE_FRONTEND_DAI_LP_MEDIA: + snd_soc_set_runtime_hwparams(substream, &omap_abe_hardware); + ret = snd_pcm_hw_constraint_step(substream->runtime, 0, + SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 1024); + break; + default: + break; + } + + mutex_unlock(&abe->mutex); + return ret; +} + +static int aess_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_platform *platform = rtd->platform; + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + struct snd_soc_dai *dai = rtd->cpu_dai; + abe_data_format_t format; + size_t period_size; + u32 dst; + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (dai->id != ABE_FRONTEND_DAI_LP_MEDIA) + return 0; + + /*Storing substream pointer for irq*/ + abe->ping_pong_substream = substream; + + format.f = params_rate(params); + if (params_format(params) == SNDRV_PCM_FORMAT_S32_LE) + format.samp_format = STEREO_MSB; + else + format.samp_format = STEREO_16_16; + + if (format.f == 44100) + abe_write_event_generator(EVENT_44100); + + period_size = params_period_bytes(params); + + /*Adding ping pong buffer subroutine*/ + abe_plug_subroutine(&abe_irq_pingpong_player_id, + (abe_subroutine2) abe_irq_pingpong_subroutine, + SUB_1_PARAM, (u32 *)abe); + + /* Connect a Ping-Pong cache-flush protocol to MM_DL port */ + abe_connect_irq_ping_pong_port(MM_DL_PORT, &format, + abe_irq_pingpong_player_id, + period_size, &dst, + PING_PONG_WITH_MCU_IRQ); + + /* Memory mapping for hw params */ + runtime->dma_area = abe->io_base[0] + dst; + runtime->dma_addr = 0; + runtime->dma_bytes = period_size * 2; + + /* Need to set the first buffer in order to get interrupt */ + abe_set_ping_pong_buffer(MM_DL_PORT, period_size); + abe->first_irq = 1; + + return 0; +} + +static int aess_prepare(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_platform *platform = rtd->platform; + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + struct snd_soc_dai *dai = rtd->cpu_dai; + + mutex_lock(&abe->mutex); + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + aess_set_runtime_opp_level(abe); + mutex_unlock(&abe->mutex); + return 0; +} + +static int aess_close(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_platform *platform = rtd->platform; + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + struct snd_soc_dai *dai = rtd->cpu_dai; + + mutex_lock(&abe->mutex); + aess_set_runtime_opp_level(abe); + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (!--abe->active) { + abe_disable_irq(); + aess_save_context(abe); + abe_dsp_shutdown(); + } + + pm_runtime_put_sync(abe->dev); + + mutex_unlock(&abe->mutex); + return 0; +} + +static int aess_mmap(struct snd_pcm_substream *substream, + struct vm_area_struct *vma) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *dai = rtd->cpu_dai; + int offset, size, err; + + if (dai->id != ABE_FRONTEND_DAI_LP_MEDIA) + return -EINVAL; + + vma->vm_flags |= VM_IO | VM_RESERVED; + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + size = vma->vm_end - vma->vm_start; + offset = vma->vm_pgoff << PAGE_SHIFT; + + err = io_remap_pfn_range(vma, vma->vm_start, + (ABE_DMEM_BASE_ADDRESS_MPU + + ABE_DMEM_BASE_OFFSET_PING_PONG + offset) >> PAGE_SHIFT, + size, vma->vm_page_prot); + + if (err) + return -EAGAIN; + + return 0; +} + +static snd_pcm_uframes_t aess_pointer(struct snd_pcm_substream *substream) +{ + snd_pcm_uframes_t offset; + u32 pingpong; + + abe_read_offset_from_ping_buffer(MM_DL_PORT, &pingpong); + offset = (snd_pcm_uframes_t)pingpong; + + return offset; +} + +static struct snd_pcm_ops omap_aess_pcm_ops = { + .open = aess_open, + .hw_params = aess_hw_params, + .prepare = aess_prepare, + .close = aess_close, + .pointer = aess_pointer, + .mmap = aess_mmap, +}; + +#if CONFIG_PM +static int aess_suspend(struct device *dev) +{ + struct abe_data *abe = dev_get_drvdata(dev); + + pm_runtime_get_sync(abe->dev); + + aess_save_context(abe); + + pm_runtime_put_sync(abe->dev); + + return 0; +} + +static int aess_resume(struct device *dev) +{ + struct abe_data *abe = dev_get_drvdata(dev); + + pm_runtime_get_sync(abe->dev); + + aess_restore_context(abe); + + pm_runtime_put_sync(abe->dev); + + return 0; +} + +#else +#define aess_suspend NULL +#define aess_resume NULL +#endif + +static const struct dev_pm_ops aess_pm_ops = { + .suspend = aess_suspend, + .resume = aess_resume, +}; + +static int aess_stream_event(struct snd_soc_dapm_context *dapm) +{ + struct snd_soc_platform *platform = dapm->platform; + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + + pm_runtime_get_sync(abe->dev); + + if (abe->active) + aess_set_runtime_opp_level(abe); + + pm_runtime_put_sync(abe->dev); + + return 0; +} + +static int abe_add_widgets(struct snd_soc_platform *platform) +{ + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + struct fw_header *hdr = &abe->hdr; + int i, j; + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + /* create equalizer controls */ + for (i = 0; i < hdr->num_equ; i++) { + struct soc_enum *equalizer_enum = &abe->equalizer_enum[i]; + struct snd_kcontrol_new *equalizer_control = + &abe->equalizer_control[i]; + + equalizer_enum->reg = i; + equalizer_enum->max = abe->equ_texts[i].count; + for (j = 0; j < abe->equ_texts[i].count; j++) + equalizer_enum->dtexts[j] = abe->equ_texts[i].texts[j]; + + equalizer_control->name = abe->equ_texts[i].name; + equalizer_control->private_value = (unsigned long)equalizer_enum; + equalizer_control->get = abe_get_equalizer; + equalizer_control->put = abe_put_equalizer; + equalizer_control->info = snd_soc_info_enum_ext1; + equalizer_control->iface = SNDRV_CTL_ELEM_IFACE_MIXER; + + dev_dbg(platform->dev, "added EQU mixer: %s profiles %d\n", + abe->equ_texts[i].name, abe->equ_texts[i].count); + + for (j = 0; j < abe->equ_texts[i].count; j++) + dev_dbg(platform->dev, " %s\n", equalizer_enum->dtexts[j]); + } + + snd_soc_add_platform_controls(platform, abe->equalizer_control, + hdr->num_equ); +#endif + + snd_soc_add_platform_controls(platform, abe_controls, + ARRAY_SIZE(abe_controls)); + + snd_soc_dapm_new_controls(&platform->dapm, abe_dapm_widgets, + ARRAY_SIZE(abe_dapm_widgets)); + + snd_soc_dapm_add_routes(&platform->dapm, intercon, ARRAY_SIZE(intercon)); + + snd_soc_dapm_new_widgets(&platform->dapm); + + return 0; +} + +static int abe_probe(struct snd_soc_platform *platform) +{ + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + const struct firmware *fw; +#ifndef CONFIG_PM_RUNTIME + struct omap4_abe_dsp_pdata *pdata = priv->abe_pdata; +#endif + int ret = 0, i, offset = 0; + + abe->platform = platform; + + pm_runtime_enable(abe->dev); + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + /* request firmware & coefficients */ + ret = request_firmware(&fw, "omap4_abe", platform->dev); + if (ret != 0) { + dev_err(abe->dev, "Failed to load firmware: %d\n", ret); + return ret; + } + + /* get firmware and coefficients header info */ + memcpy(&abe->hdr, fw->data, sizeof(struct fw_header)); + if (abe->hdr.firmware_size > ABE_MAX_FW_SIZE) { + dev_err(abe->dev, "Firmware too large at %d bytes: %d\n", + abe->hdr.firmware_size, ret); + ret = -EINVAL; + goto err_fw; + } + dev_dbg(abe->dev, "ABE firmware size %d bytes\n", abe->hdr.firmware_size); + + if (abe->hdr.coeff_size > ABE_MAX_COEFF_SIZE) { + dev_err(abe->dev, "Coefficients too large at %d bytes: %d\n", + abe->hdr.coeff_size, ret); + ret = -EINVAL; + goto err_fw; + } + dev_dbg(abe->dev, "ABE coefficients size %d bytes\n", abe->hdr.coeff_size); + + /* get coefficient EQU mixer strings */ + if (abe->hdr.num_equ >= ABE_MAX_EQU) { + dev_err(abe->dev, "Too many equalizers got %d\n", abe->hdr.num_equ); + ret = -EINVAL; + goto err_fw; + } + abe->equ_texts = kzalloc(abe->hdr.num_equ * sizeof(struct coeff_config), + GFP_KERNEL); + if (abe->equ_texts == NULL) { + ret = -ENOMEM; + goto err_fw; + } + offset = sizeof(struct fw_header); + memcpy(abe->equ_texts, fw->data + offset, + abe->hdr.num_equ * sizeof(struct coeff_config)); + + /* get coefficients from firmware */ + abe->equ[0] = kmalloc(abe->hdr.coeff_size, GFP_KERNEL); + if (abe->equ[0] == NULL) { + ret = -ENOMEM; + goto err_equ; + } + offset += abe->hdr.num_equ * sizeof(struct coeff_config); + memcpy(abe->equ[0], fw->data + offset, abe->hdr.coeff_size); + + /* allocate coefficient mixer texts */ + dev_dbg(abe->dev, "loaded %d equalizers\n", abe->hdr.num_equ); + for (i = 0; i < abe->hdr.num_equ; i++) { + dev_dbg(abe->dev, "equ %d: %s profiles %d\n", i, + abe->equ_texts[i].name, abe->equ_texts[i].count); + if (abe->equ_texts[i].count >= ABE_MAX_PROFILES) { + dev_err(abe->dev, "Too many profiles got %d for equ %d\n", + abe->equ_texts[i].count, i); + ret = -EINVAL; + goto err_texts; + } + abe->equalizer_enum[i].dtexts = + kzalloc(abe->equ_texts[i].count * sizeof(char *), GFP_KERNEL); + if (abe->equalizer_enum[i].dtexts == NULL) { + ret = -ENOMEM; + goto err_texts; + } + } + + /* initialise coefficient equalizers */ + for (i = 1; i < abe->hdr.num_equ; i++) { + abe->equ[i] = abe->equ[i - 1] + + abe->equ_texts[i - 1].count * abe->equ_texts[i - 1].coeff * sizeof(s32); + } +#endif + ret = request_irq(abe->irq, abe_irq_handler, 0, "ABE", (void *)abe); + if (ret) { + dev_err(platform->dev, "request for ABE IRQ %d failed %d\n", + abe->irq, ret); + goto err_texts; + } + + /* aess_clk has to be enabled to access hal register. + * Disable the clk after it has been used. + */ + pm_runtime_get_sync(abe->dev); + + abe_init_mem(abe->io_base); + + abe_reset_hal(); + +#if 0 +#warning fixup load fw args + //abe_load_fw(fw->data + sizeof(struct fw_header) + abe->hdr.coeff_size); +#else + abe_load_fw(); +#endif + /* Config OPP 100 for now */ + abe_set_opp_processing(ABE_OPP100); + + /* "tick" of the audio engine */ + abe_write_event_generator(EVENT_TIMER); + /* Stop the engine */ + abe_stop_event_generator(); + abe_disable_irq(); + + pm_runtime_put_sync(abe->dev); + abe_add_widgets(platform); + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + release_firmware(fw); +#endif + return ret; + +err_texts: +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + for (i = 0; i < abe->hdr.num_equ; i++) + kfree(abe->equalizer_enum[i].texts); + kfree(abe->equ[0]); +err_equ: + kfree(abe->equ_texts); +err_fw: + release_firmware(fw); +#endif + return ret; +} + +static int abe_remove(struct snd_soc_platform *platform) +{ + struct abe_data *abe = snd_soc_platform_get_drvdata(platform); + int i; + + free_irq(abe->irq, (void *)abe); + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + for (i = 0; i < abe->hdr.num_equ; i++) + kfree(abe->equalizer_enum[i].texts); + + kfree(abe->equ[0]); + kfree(abe->equ_texts); +#endif + pm_runtime_disable(abe->dev); + + return 0; +} + +static struct snd_soc_platform_driver omap_aess_platform = { + .ops = &omap_aess_pcm_ops, + .probe = abe_probe, + .remove = abe_remove, + .read = abe_dsp_read, + .write = abe_dsp_write, + .stream_event = aess_stream_event, +}; + +static int __devinit abe_engine_probe(struct platform_device *pdev) +{ + struct resource *res; + struct omap4_abe_dsp_pdata *pdata = pdev->dev.platform_data; + struct abe_data *abe; + int ret = -EINVAL, i, k; + + abe = kzalloc(sizeof(struct abe_data), GFP_KERNEL); + if (abe == NULL) + return -ENOMEM; + dev_set_drvdata(&pdev->dev, abe); + the_abe = abe; + + /* ZERO_labelID should really be 0 */ + for (i = 0; i < ABE_ROUTES_UL + 2; i++) + abe->router[i] = ZERO_labelID; + + for (i = 0; i < 5; i++) { + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + abe_memory_bank[i]); + if (res == NULL) { + dev_err(&pdev->dev, "no resource %s\n", + abe_memory_bank[i]); + goto err; + } + abe->io_base[i] = ioremap(res->start, resource_size(res)); + if (!abe->io_base[i]) { + ret = -ENOMEM; + goto err; + } + } + + abe->irq = platform_get_irq(pdev, 0); + if (abe->irq < 0) { + ret = abe->irq; + goto err; + } + + abe->abe_pdata = pdata; + abe->dev = &pdev->dev; + mutex_init(&abe->mutex); + mutex_init(&abe->opp_mutex); + + ret = snd_soc_register_platform(abe->dev, + &omap_aess_platform); + if (ret < 0) + return ret; + + abe_init_debugfs(abe); + return ret; + +err: + for (--i; i >= 0; i--) + iounmap(abe->io_base[i]); + kfree(abe); + return ret; +} + +static int __devexit abe_engine_remove(struct platform_device *pdev) +{ + struct abe_data *abe = dev_get_drvdata(&pdev->dev); + int i; + + abe_cleanup_debugfs(abe); + snd_soc_unregister_platform(&pdev->dev); + for (i = 0; i < 5; i++) + iounmap(abe->io_base[i]); + kfree(abe); + return 0; +} + +static struct platform_driver omap_aess_driver = { + .driver = { + .name = "aess", + .owner = THIS_MODULE, + .pm = &aess_pm_ops, + }, + .probe = abe_engine_probe, + .remove = __devexit_p(abe_engine_remove), +}; + +static int __init abe_engine_init(void) +{ + return platform_driver_register(&omap_aess_driver); +} +module_init(abe_engine_init); + +static void __exit abe_engine_exit(void) +{ + platform_driver_unregister(&omap_aess_driver); +} +module_exit(abe_engine_exit); + +MODULE_DESCRIPTION("ASoC OMAP4 ABE"); +MODULE_AUTHOR("Liam Girdwood <lrg@ti.com>"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/omap/omap-abe-dsp.h b/sound/soc/omap/omap-abe-dsp.h new file mode 100644 index 0000000..5d7016e --- /dev/null +++ b/sound/soc/omap/omap-abe-dsp.h @@ -0,0 +1,163 @@ +/* + * omap-abe-dsp.h + * + * Copyright (C) 2010 Texas Instruments + * + * Contact: 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 + * + */ + +#ifndef __OMAP_ABE_DSP_H__ +#define __OMAP_ABE_DSP_H__ + +#define ABE_MIXER(x) (x) + +#define MIX_DL1_TONES ABE_MIXER(0) +#define MIX_DL1_VOICE ABE_MIXER(1) +#define MIX_DL1_CAPTURE ABE_MIXER(2) +#define MIX_DL1_MEDIA ABE_MIXER(3) +#define MIX_DL2_TONES ABE_MIXER(4) +#define MIX_DL2_VOICE ABE_MIXER(5) +#define MIX_DL2_CAPTURE ABE_MIXER(6) +#define MIX_DL2_MEDIA ABE_MIXER(7) +#define MIX_AUDUL_TONES ABE_MIXER(8) +#define MIX_AUDUL_MEDIA ABE_MIXER(9) +#define MIX_AUDUL_CAPTURE ABE_MIXER(10) +#define MIX_VXREC_TONES ABE_MIXER(11) +#define MIX_VXREC_VOICE_PLAYBACK ABE_MIXER(12) +#define MIX_VXREC_VOICE_CAPTURE ABE_MIXER(13) +#define MIX_VXREC_MEDIA ABE_MIXER(14) +#define MIX_SDT_CAPTURE ABE_MIXER(15) +#define MIX_SDT_PLAYBACK ABE_MIXER(16) +#define MIX_SWITCH_PDM_DL ABE_MIXER(17) +#define MIX_SWITCH_BT_VX_DL ABE_MIXER(18) +#define MIX_SWITCH_MM_EXT_DL ABE_MIXER(19) + +#define ABE_NUM_MIXERS (MIX_SWITCH_MM_EXT_DL + 1) + +#define ABE_MUX(x) (x + ABE_NUM_MIXERS) + +#define MUX_MM_UL10 ABE_MUX(0) +#define MUX_MM_UL11 ABE_MUX(1) +#define MUX_MM_UL12 ABE_MUX(2) +#define MUX_MM_UL13 ABE_MUX(3) +#define MUX_MM_UL14 ABE_MUX(4) +#define MUX_MM_UL15 ABE_MUX(5) +#define MUX_MM_UL16 ABE_MUX(6) +#define MUX_MM_UL17 ABE_MUX(7) +#define MUX_MM_UL20 ABE_MUX(8) +#define MUX_MM_UL21 ABE_MUX(9) +#define MUX_VX_UL0 ABE_MUX(10) +#define MUX_VX_UL1 ABE_MUX(11) + +#define ABE_NUM_MUXES (MUX_VX_UL1 - MUX_MM_UL10) + +#define ABE_WIDGET(x) (x + ABE_NUM_MIXERS + ABE_NUM_MUXES) + +/* ABE AIF Frontend Widgets */ +#define W_AIF_TONES_DL ABE_WIDGET(0) +#define W_AIF_VX_DL ABE_WIDGET(1) +#define W_AIF_VX_UL ABE_WIDGET(2) +#define W_AIF_MM_UL1 ABE_WIDGET(3) +#define W_AIF_MM_UL2 ABE_WIDGET(4) +#define W_AIF_MM_DL ABE_WIDGET(5) +#define W_AIF_MM_DL_LP W_AIF_MM_DL +#define W_AIF_VIB_DL ABE_WIDGET(6) +#define W_AIF_MODEM_DL ABE_WIDGET(7) +#define W_AIF_MODEM_UL ABE_WIDGET(8) + +/* ABE AIF Backend Widgets */ +#define W_AIF_PDM_UL1 ABE_WIDGET(9) +#define W_AIF_PDM_DL1 ABE_WIDGET(10) +#define W_AIF_PDM_DL2 ABE_WIDGET(11) +#define W_AIF_PDM_VIB ABE_WIDGET(12) +#define W_AIF_BT_VX_UL ABE_WIDGET(13) +#define W_AIF_BT_VX_DL ABE_WIDGET(14) +#define W_AIF_MM_EXT_UL ABE_WIDGET(15) +#define W_AIF_MM_EXT_DL ABE_WIDGET(16) +#define W_AIF_DMIC0 ABE_WIDGET(17) +#define W_AIF_DMIC1 ABE_WIDGET(18) +#define W_AIF_DMIC2 ABE_WIDGET(19) + +/* ABE ROUTE_UL MUX Widgets */ +#define W_MUX_UL00 ABE_WIDGET(20) +#define W_MUX_UL01 ABE_WIDGET(21) +#define W_MUX_UL02 ABE_WIDGET(22) +#define W_MUX_UL03 ABE_WIDGET(23) +#define W_MUX_UL04 ABE_WIDGET(24) +#define W_MUX_UL05 ABE_WIDGET(25) +#define W_MUX_UL06 ABE_WIDGET(26) +#define W_MUX_UL07 ABE_WIDGET(27) +#define W_MUX_UL10 ABE_WIDGET(28) +#define W_MUX_UL11 ABE_WIDGET(29) +#define W_MUX_VX00 ABE_WIDGET(30) +#define W_MUX_VX01 ABE_WIDGET(31) + +/* ABE Volume and Mixer Widgets */ +#define W_MIXER_DL1 ABE_WIDGET(32) +#define W_MIXER_DL2 ABE_WIDGET(33) +#define W_VOLUME_DL1 ABE_WIDGET(34) +#define W_MIXER_AUDIO_UL ABE_WIDGET(35) +#define W_MIXER_VX_REC ABE_WIDGET(36) +#define W_MIXER_SDT ABE_WIDGET(37) +#define W_VSWITCH_DL1_PDM ABE_WIDGET(38) +#define W_VSWITCH_DL1_BT_VX ABE_WIDGET(39) +#define W_VSWITCH_DL1_MM_EXT ABE_WIDGET(40) + +#define ABE_NUM_WIDGETS (W_VSWITCH_DL1_MM_EXT - W_AIF_TONES_DL) +#define ABE_WIDGET_LAST W_VSWITCH_DL1_MM_EXT + +#define ABE_NUM_DAPM_REG \ + (ABE_NUM_MIXERS + ABE_NUM_MUXES + ABE_NUM_WIDGETS) + +#define ABE_VIRTUAL_SWITCH 0 +#define ABE_ROUTES_UL 14 + +// TODO: OPP bitmask - Use HAL version after update +#define ABE_OPP_25 0 +#define ABE_OPP_50 1 +#define ABE_OPP_100 2 + +/* TODO: size in bytes of debug options */ +#define ABE_DBG_FLAG1_SIZE 0 +#define ABE_DBG_FLAG2_SIZE 0 +#define ABE_DBG_FLAG3_SIZE 0 + +/* TODO: Pong start offset of DMEM */ +/* Ping pong buffer DMEM offset */ +#define ABE_DMEM_BASE_OFFSET_PING_PONG 0x4000 + +/* Gain value conversion */ +#define ABE_MAX_GAIN 12000 +#define ABE_GAIN_SCALE 100 +#define abe_gain_to_val(gain) ((val + ABE_MAX_GAIN) / ABE_GAIN_SCALE) +#define abe_val_to_gain(val) (-ABE_MAX_GAIN + (val * ABE_GAIN_SCALE)) + +/* Firmware coefficients and equalizers */ +#define ABE_MAX_FW_SIZE (1024 * 128) +#define ABE_MAX_COEFF_SIZE (1024 * 4) +#define ABE_COEFF_NAME_SIZE 20 +#define ABE_COEFF_TEXT_SIZE 20 +#define ABE_COEFF_NUM_TEXTS 10 +#define ABE_MAX_EQU 10 +#define ABE_MAX_PROFILES 30 + +void abe_dsp_shutdown(void); +void abe_dsp_pm_get(void); +void abe_dsp_pm_put(void); + +#endif /* End of __OMAP_ABE_DSP_H__ */ diff --git a/sound/soc/omap/omap-abe.c b/sound/soc/omap/omap-abe.c new file mode 100644 index 0000000..56ecf4e --- /dev/null +++ b/sound/soc/omap/omap-abe.c @@ -0,0 +1,1259 @@ +/* + * omap-abe.c -- OMAP ALSA SoC DAI driver using Audio Backend + * + * Copyright (C) 2010 Texas Instruments + * + * Contact: Liam Girdwood <lrg@ti.com> + * Misael Lopez Cruz <misael.lopez@ti.com> + * Sebastien Guiriec <s-guiriec@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/init.h> +#include <linux/module.h> +#include <linux/device.h> +#include <linux/slab.h> +#include <linux/platform_device.h> +#include <linux/delay.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> +#include <sound/initval.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/soc-dsp.h> + +#include <plat/dma-44xx.h> +#include <plat/dma.h> +#include "omap-pcm.h" +#include "omap-abe.h" +#include "omap-abe-dsp.h" +#include "abe/abe_main.h" +#include "abe/port_mgr.h" + +#define OMAP_ABE_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) + +struct omap_abe_data { + /* MODEM FE*/ + struct snd_pcm_substream *modem_substream[2]; + struct snd_soc_dai *modem_dai; + + struct abe *abe; + + /* BE & FE Ports */ + struct omap_abe_port *port[OMAP_ABE_MAX_PORT_ID + 1]; +}; + +/* + * Stream DMA parameters + */ +static struct omap_pcm_dma_data omap_abe_dai_dma_params[7][2] = { +{ + { + .name = "Media Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_0, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, + { + .name = "Media Capture1", + .dma_req = OMAP44XX_DMA_ABE_REQ_3, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, +}, +{ + {}, + { + .name = "Media Capture2", + .dma_req = OMAP44XX_DMA_ABE_REQ_4, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, +}, +{ + { + .name = "Voice Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_1, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, + { + .name = "Voice Capture", + .dma_req = OMAP44XX_DMA_ABE_REQ_2, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, +}, +{ + { + .name = "Tones Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_5, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + },{}, +}, +{ + { + .name = "Vibra Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_6, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + },{}, +}, +{ + { + .name = "MODEM Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_1, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, + { + .name = "MODEM Capture", + .dma_req = OMAP44XX_DMA_ABE_REQ_2, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + }, +}, +{ + { + .name = "Low Power Playback", + .dma_req = OMAP44XX_DMA_ABE_REQ_0, + .data_type = OMAP_DMA_DATA_TYPE_S32, + .sync_mode = OMAP_DMA_SYNC_PACKET, + },{}, +},}; + +static int modem_get_dai(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + struct snd_soc_pcm_runtime *modem_rtd; + + abe_priv->modem_substream[substream->stream] = + snd_soc_get_dai_substream(rtd->card, + OMAP_ABE_BE_MM_EXT1, substream->stream); + + if (abe_priv->modem_substream[substream->stream] == NULL) + return -ENODEV; + + modem_rtd = abe_priv->modem_substream[substream->stream]->private_data; + abe_priv->modem_substream[substream->stream]->runtime = substream->runtime; + abe_priv->modem_dai = modem_rtd->cpu_dai; + + return 0; +} + +static void mute_be(struct snd_soc_pcm_runtime *be, + struct snd_soc_dai *dai, int stream) +{ + dev_dbg(&be->dev, "%s: %s %d\n", __func__, be->cpu_dai->name, stream); + + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (be->dai_link->be_id) { + case OMAP_ABE_DAI_PDM_DL1: + abe_write_gain(GAINS_DL1, MUTE_GAIN, RAMP_5MS, + GAIN_LEFT_OFFSET); + abe_write_gain(GAINS_DL1, MUTE_GAIN, RAMP_5MS, + GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_DAI_PDM_DL2: + abe_write_gain(GAINS_DL2, MUTE_GAIN, RAMP_5MS, + GAIN_LEFT_OFFSET); + abe_write_gain(GAINS_DL2, MUTE_GAIN, RAMP_5MS, + GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_DAI_PDM_VIB: + case OMAP_ABE_DAI_BT_VX: + case OMAP_ABE_DAI_MM_FM: + case OMAP_ABE_DAI_MODEM: + break; + } + } else { + switch (be->dai_link->be_id) { + case OMAP_ABE_DAI_PDM_UL: + break; + case OMAP_ABE_DAI_BT_VX: + case OMAP_ABE_DAI_MM_FM: + case OMAP_ABE_DAI_MODEM: + case OMAP_ABE_DAI_DMIC0: + case OMAP_ABE_DAI_DMIC1: + case OMAP_ABE_DAI_DMIC2: + break; + } + } +} + +static void unmute_be(struct snd_soc_pcm_runtime *be, + struct snd_soc_dai *dai, int stream) +{ + dev_dbg(&be->dev, "%s: %s %d\n", __func__, be->cpu_dai->name, stream); + + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + switch (be->dai_link->be_id) { + case OMAP_ABE_DAI_PDM_DL1: + abe_write_gain(GAINS_DL1, GAIN_0dB, RAMP_5MS, + GAIN_LEFT_OFFSET); + abe_write_gain(GAINS_DL1, GAIN_0dB, RAMP_5MS, + GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_DAI_PDM_DL2: + abe_write_gain(GAINS_DL2, GAIN_0dB, RAMP_5MS, + GAIN_LEFT_OFFSET); + abe_write_gain(GAINS_DL2, GAIN_0dB, RAMP_5MS, + GAIN_RIGHT_OFFSET); + break; + case OMAP_ABE_DAI_PDM_VIB: + case OMAP_ABE_DAI_BT_VX: + case OMAP_ABE_DAI_MM_FM: + case OMAP_ABE_DAI_MODEM: + break; + } + } else { + + switch (be->dai_link->be_id) { + case OMAP_ABE_DAI_PDM_UL: + break; + case OMAP_ABE_DAI_BT_VX: + case OMAP_ABE_DAI_MM_FM: + case OMAP_ABE_DAI_MODEM: + case OMAP_ABE_DAI_DMIC0: + case OMAP_ABE_DAI_DMIC1: + case OMAP_ABE_DAI_DMIC2: + break; + } + } +} + +static void enable_be_port(struct snd_soc_pcm_runtime *be, + struct snd_soc_dai *dai, int stream) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + abe_data_format_t format; + + dev_dbg(&be->dev, "%s: %s %d\n", __func__, be->cpu_dai->name, stream); + + switch (be->dai_link->be_id) { + /* McPDM Downlink is special case and handled by McPDM driver */ + case OMAP_ABE_DAI_PDM_DL1: + case OMAP_ABE_DAI_PDM_DL2: + case OMAP_ABE_DAI_PDM_VIB: + break; + case OMAP_ABE_DAI_PDM_UL: + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_UL1]); + break; + case OMAP_ABE_DAI_BT_VX: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + + /* port can only be configured if it's not running */ + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_DL])) + return; + + /* BT_DL connection to McBSP 1 ports */ + format.f = 8000; + format.samp_format = MONO_RSHIFTED_16; + abe_connect_serial_port(BT_VX_DL_PORT, &format, MCBSP1_TX); + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_DL]); + } else { + + /* port can only be configured if it's not running */ + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_UL])) + return; + + /* BT_UL connection to McBSP 1 ports */ + format.f = 8000; + format.samp_format = MONO_RSHIFTED_16; + abe_connect_serial_port(BT_VX_UL_PORT, &format, MCBSP1_RX); + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_UL]); + } + break; + case OMAP_ABE_DAI_MM_FM: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + + /* port can only be configured if it's not running */ + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_DL])) + return; + + /* MM_EXT connection to McBSP 2 ports */ + format.f = 48000; + format.samp_format = STEREO_RSHIFTED_16; + abe_connect_serial_port(MM_EXT_OUT_PORT, &format, MCBSP2_TX); + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_DL]); + } else { + + /* port can only be configured if it's not running */ + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_UL])) + return; + + /* MM_EXT connection to McBSP 2 ports */ + format.f = 48000; + format.samp_format = STEREO_RSHIFTED_16; + abe_connect_serial_port(MM_EXT_IN_PORT, &format, MCBSP2_RX); + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_UL]); + } + break; + case OMAP_ABE_DAI_DMIC0: + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC0]); + break; + case OMAP_ABE_DAI_DMIC1: + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC1]); + break; + case OMAP_ABE_DAI_DMIC2: + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC2]); + break; + } +} + +static void enable_fe_port(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int stream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, dai->name, stream); + + switch(dai->id) { + case ABE_FRONTEND_DAI_MEDIA: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_DL1]); + else + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_UL1]); + break; + case ABE_FRONTEND_DAI_LP_MEDIA: + abe_enable_data_transfer(MM_DL_PORT); + break; + case ABE_FRONTEND_DAI_MEDIA_CAPTURE: + if (stream == SNDRV_PCM_STREAM_CAPTURE) + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_UL2]); + break; + case ABE_FRONTEND_DAI_MODEM: + case ABE_FRONTEND_DAI_VOICE: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VX_DL]); + else + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VX_UL]); + break; + case ABE_FRONTEND_DAI_TONES: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_TONES]); + break; + case ABE_FRONTEND_DAI_VIBRA: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_enable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VIB]); + break; + } +} + +static void disable_be_port(struct snd_soc_pcm_runtime *be, + struct snd_soc_dai *dai, int stream) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(&be->dev, "%s: %s %d\n", __func__, be->cpu_dai->name, stream); + + switch (be->dai_link->be_id) { + /* McPDM Downlink is special case and handled by McPDM driver */ + case OMAP_ABE_DAI_PDM_DL1: + case OMAP_ABE_DAI_PDM_DL2: + case OMAP_ABE_DAI_PDM_VIB: + break; + case OMAP_ABE_DAI_PDM_UL: + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_UL1]); + break; + case OMAP_ABE_DAI_BT_VX: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_DL]); + else + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_BT_VX_UL]); + break; + case OMAP_ABE_DAI_MM_FM: + case OMAP_ABE_DAI_MODEM: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_DL]); + else + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_MM_EXT_UL]); + break; + case OMAP_ABE_DAI_DMIC0: + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC0]); + break; + case OMAP_ABE_DAI_DMIC1: + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC1]); + break; + case OMAP_ABE_DAI_DMIC2: + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_DMIC2]); + break; + } +} + +static void disable_fe_port(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int stream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, dai->name, stream); + + switch(dai->id) { + case ABE_FRONTEND_DAI_MEDIA: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_DL1]); + else + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_UL1]); + break; + case ABE_FRONTEND_DAI_LP_MEDIA: + abe_disable_data_transfer(MM_DL_PORT); + break; + case ABE_FRONTEND_DAI_MEDIA_CAPTURE: + if (stream == SNDRV_PCM_STREAM_CAPTURE) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_MM_UL2]); + break; + case ABE_FRONTEND_DAI_MODEM: + case ABE_FRONTEND_DAI_VOICE: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VX_DL]); + else + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VX_UL]); + break; + case ABE_FRONTEND_DAI_TONES: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_TONES]); + break; + case ABE_FRONTEND_DAI_VIBRA: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + omap_abe_port_disable(abe_priv->abe, + abe_priv->port[OMAP_ABE_FE_PORT_VIB]); + break; + } +} + +static void mute_fe_port(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int stream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, dai->name, stream); + + switch(dai->id) { + case ABE_FRONTEND_DAI_MEDIA: + case ABE_FRONTEND_DAI_LP_MEDIA: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL); + break; + case ABE_FRONTEND_DAI_VOICE: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL); + break; + case ABE_FRONTEND_DAI_TONES: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_mute_gain(MIXDL2, MIX_DL2_INPUT_TONES); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_mute_gain(MIXDL1, MIX_DL1_INPUT_TONES); + break; + case ABE_FRONTEND_DAI_VIBRA: + case ABE_FRONTEND_DAI_MEDIA_CAPTURE: + break; + } +} + +static void unmute_fe_port(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int stream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, dai->name, stream); + + switch(dai->id) { + case ABE_FRONTEND_DAI_MEDIA: + case ABE_FRONTEND_DAI_LP_MEDIA: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_MM_DL); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_MM_DL); + break; + case ABE_FRONTEND_DAI_VOICE: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_VX_DL); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_VX_DL); + break; + case ABE_FRONTEND_DAI_TONES: + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL2])) + abe_unmute_gain(MIXDL2, MIX_DL2_INPUT_TONES); + if (omap_abe_port_is_enabled(abe_priv->abe, + abe_priv->port[OMAP_ABE_BE_PORT_PDM_DL1])) + abe_unmute_gain(MIXDL1, MIX_DL1_INPUT_TONES); + break; + case ABE_FRONTEND_DAI_VIBRA: + case ABE_FRONTEND_DAI_MEDIA_CAPTURE: + break; + } +} + +static void capture_trigger(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int cmd) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct snd_soc_dsp_params *dsp_params; + struct snd_pcm_substream *be_substream; + int stream = substream->stream; + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, fe->cpu_dai->name, stream); + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + + /* mute and enable BE ports */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_params->be; + + /* does this trigger() apply to this BE and stream ? */ + if (!snd_soc_dsp_is_trigger_for_be(fe, be, stream)) + continue; + + /* is the BE already in the trigger START state ? */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_START) + continue; + + be_substream = snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* mute the BE port */ + mute_be(be, dai, stream); + + /* enable the BE port */ + enable_be_port(be, dai, stream); + + /* DAI work must be started/stopped at least 250us after ABE */ + udelay(250); + + /* trigger the BE port */ + snd_soc_dai_trigger(be_substream, cmd, be->cpu_dai); + } + + /* does this trigger() apply to the FE ? */ + if (snd_soc_dsp_is_trigger_for_fe(fe, stream)) { + /* Enable Frontend sDMA */ + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + enable_fe_port(substream, dai, stream); + } + + /* Restore ABE GAINS AMIC */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_params->be; + + /* does this trigger() apply to this BE and stream ? */ + if (!snd_soc_dsp_is_trigger_for_be(fe, be, stream)) + continue; + + /* unmute this BE port */ + unmute_be(be, dai, stream); + } + break; + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + /* Enable sDMA */ + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + enable_fe_port(substream, dai, stream); + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + /* Disable sDMA */ + disable_fe_port(substream, dai, stream); + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + break; + case SNDRV_PCM_TRIGGER_STOP: + + /* does this trigger() apply to the FE ? */ + if (snd_soc_dsp_is_trigger_for_fe(fe, stream)) { + /* Disable sDMA */ + disable_fe_port(substream, dai, stream); + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + } + + /* disable BE ports */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_params->be; + + /* does this trigger() apply to this BE and stream ? */ + if (!snd_soc_dsp_is_trigger_for_be(fe, be, stream)) + continue; + + /* only STOP BE in FREE state */ + /* REVISIT: Investigate the appropriate state to check against */ + //if (dsp_params->state != SND_SOC_DSP_LINK_STATE_FREE) + // continue; + + be_substream = snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* disable the BE port */ + disable_be_port(be, dai, stream); + + /* DAI work must be started/stopped at least 250us after ABE */ + udelay(250); + + /* trigger BE port */ + snd_soc_dai_trigger(be_substream, cmd, be->cpu_dai); + } + break; + default: + break; + } +} + +static void playback_trigger(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai, int cmd) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct snd_soc_dsp_params *dsp_params; + struct snd_pcm_substream *be_substream; + int stream = substream->stream; + + dev_dbg(&fe->dev, "%s: %s %d\n", __func__, fe->cpu_dai->name, stream); + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + + /* mute and enable ports */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_params->be; + + /* does this trigger() apply to the FE ? */ + if (!snd_soc_dsp_is_trigger_for_be(fe, be, stream)) + continue; + + /* is the BE already in the trigger START state ? */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_START) + continue; + + be_substream = snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* mute BE port */ + mute_be(be, dai, stream); + + /* enabled BE port */ + enable_be_port(be, dai, stream); + + /* DAI work must be started/stopped at least 250us after ABE */ + udelay(250); + + /* trigger BE port */ + snd_soc_dai_trigger(be_substream, cmd, be->cpu_dai); + + /* unmute the BE port */ + unmute_be(be, dai, stream); + } + + /* does this trigger() apply to the FE ? */ + if (snd_soc_dsp_is_trigger_for_fe(fe, stream)) { + + /* Enable Frontend sDMA */ + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + enable_fe_port(substream, dai, stream); + + /* unmute FE port */ + unmute_fe_port(substream, dai, stream); + } + break; + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + /* Enable Frontend sDMA */ + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + enable_fe_port(substream, dai, stream); + + /* unmute FE port */ + unmute_fe_port(substream, dai, stream); + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + /* disable Frontend sDMA */ + disable_fe_port(substream, dai, stream); + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + + /* mute FE port */ + mute_fe_port(substream, dai, stream); + break; + case SNDRV_PCM_TRIGGER_STOP: + + /* does this trigger() apply to the FE ? */ + if (snd_soc_dsp_is_trigger_for_fe(fe, stream)) { + + /* disable the transfer */ + disable_fe_port(substream, dai, stream); + snd_soc_dsp_platform_trigger(substream, cmd, fe->platform); + + /* mute FE port */ + mute_fe_port(substream, dai, stream); + } + + /* disable BE ports */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_params->be; + + /* does this trigger() apply to this BE and stream ? */ + if (!snd_soc_dsp_is_trigger_for_be(fe, be, stream)) + continue; + + /* only STOP BE in FREE state */ + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_FREE) + continue; + + be_substream = snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* disable the BE */ + disable_be_port(be, dai, stream); + + /* DAI work must be started/stopped at least 250us after ABE */ + udelay(250); + + /* trigger the BE port */ + snd_soc_dai_trigger(be_substream, cmd, be->cpu_dai); + } + break; + default: + break; + } +} + +static int omap_abe_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + int ret = 0; + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + + ret = modem_get_dai(substream, dai); + if (ret < 0) { + dev_err(dai->dev, "failed to get MODEM DAI\n"); + return ret; + } + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d\n", + __func__, substream->stream); + + ret = snd_soc_dai_startup(abe_priv->modem_substream[substream->stream], + abe_priv->modem_dai); + if (ret < 0) { + dev_err(abe_priv->modem_dai->dev, "failed to open DAI %d\n", ret); + return ret; + } + } + + return ret; +} + +static int omap_abe_dai_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, + struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + abe_data_format_t format; + abe_dma_t dma_sink; + abe_dma_t dma_params; + int ret; + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + switch (params_channels(params)) { + case 1: + if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE) + format.samp_format = MONO_RSHIFTED_16; + else + format.samp_format = MONO_MSB; + break; + case 2: + if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE) + format.samp_format = STEREO_16_16; + else + format.samp_format = STEREO_MSB; + break; + case 3: + format.samp_format = THREE_MSB; + break; + case 4: + format.samp_format = FOUR_MSB; + break; + case 5: + format.samp_format = FIVE_MSB; + break; + case 6 : + format.samp_format = SIX_MSB; + break; + case 7 : + format.samp_format = SEVEN_MSB; + break; + case 8: + format.samp_format = EIGHT_MSB; + break; + default: + dev_err(dai->dev, "%d channels not supported", + params_channels(params)); + return -EINVAL; + } + + format.f = params_rate(params); + + switch (dai->id) { + case ABE_FRONTEND_DAI_MEDIA: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + abe_connect_cbpr_dmareq_port(MM_DL_PORT, &format, ABE_CBPR0_IDX, + &dma_sink); + abe_read_port_address(MM_DL_PORT, &dma_params); + } else { + abe_connect_cbpr_dmareq_port(MM_UL_PORT, &format, ABE_CBPR3_IDX, + &dma_sink); + abe_read_port_address(MM_UL_PORT, &dma_params); + } + break; + case ABE_FRONTEND_DAI_LP_MEDIA: + return 0; + break; + case ABE_FRONTEND_DAI_MEDIA_CAPTURE: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + return -EINVAL; + else { + abe_connect_cbpr_dmareq_port(MM_UL2_PORT, &format, ABE_CBPR4_IDX, + &dma_sink); + abe_read_port_address(MM_UL2_PORT, &dma_params); + } + break; + case ABE_FRONTEND_DAI_VOICE: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + abe_connect_cbpr_dmareq_port(VX_DL_PORT, &format, ABE_CBPR1_IDX, + &dma_sink); + abe_read_port_address(VX_DL_PORT, &dma_params); + } else { + abe_connect_cbpr_dmareq_port(VX_UL_PORT, &format, ABE_CBPR2_IDX, + &dma_sink); + abe_read_port_address(VX_UL_PORT, &dma_params); + } + break; + case ABE_FRONTEND_DAI_TONES: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + abe_connect_cbpr_dmareq_port(TONES_DL_PORT, &format, ABE_CBPR5_IDX, + &dma_sink); + abe_read_port_address(TONES_DL_PORT, &dma_params); + } else + return -EINVAL; + break; + case ABE_FRONTEND_DAI_VIBRA: + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + abe_connect_cbpr_dmareq_port(VIB_DL_PORT, &format, ABE_CBPR6_IDX, + &dma_sink); + abe_read_port_address(VIB_DL_PORT, &dma_params); + } else + return -EINVAL; + break; + case ABE_FRONTEND_DAI_MODEM: + /* MODEM is special case where data IO is performed by McBSP2 + * directly onto VX_DL and VX_UL (instead of SDMA). + */ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + /* Vx_DL connection to McBSP 2 ports */ + format.samp_format = STEREO_RSHIFTED_16; + abe_connect_serial_port(VX_DL_PORT, &format, MCBSP2_RX); + abe_read_port_address(VX_DL_PORT, &dma_params); + } else { + /* Vx_UL connection to McBSP 2 ports */ + format.samp_format = STEREO_RSHIFTED_16; + abe_connect_serial_port(VX_UL_PORT, &format, MCBSP2_TX); + abe_read_port_address(VX_UL_PORT, &dma_params); + } + break; + } + + /* configure frontend SDMA data */ + omap_abe_dai_dma_params[dai->id][substream->stream].port_addr = + (unsigned long)dma_params.data; + omap_abe_dai_dma_params[dai->id][substream->stream].packet_size = + dma_params.iter; + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + /* call hw_params on McBSP with correct DMA data */ + snd_soc_dai_set_dma_data(abe_priv->modem_dai, substream, + &omap_abe_dai_dma_params[dai->id][substream->stream]); + + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d\n", + __func__, substream->stream); + + ret = snd_soc_dai_hw_params(abe_priv->modem_substream[substream->stream], + params, abe_priv->modem_dai); + if (ret < 0) + dev_err(abe_priv->modem_dai->dev, "MODEM hw_params failed\n"); + return ret; + } + + snd_soc_dai_set_dma_data(dai, substream, + &omap_abe_dai_dma_params[dai->id][substream->stream]); + + return 0; +} + +static int omap_abe_dai_prepare(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + int ret = 0; + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + ret = snd_soc_dai_prepare(abe_priv->modem_substream[substream->stream], + abe_priv->modem_dai); + + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d\n", + __func__, substream->stream); + + if (ret < 0) { + dev_err(abe_priv->modem_dai->dev, "MODEM prepare failed\n"); + return ret; + } + } + return ret; +} + +static int omap_abe_dai_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + int ret = 0; + + dev_dbg(dai->dev, "%s: %s cmd %d\n", __func__, dai->name, cmd); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d cmd %d\n", + __func__, substream->stream, cmd); + + ret = snd_soc_dai_trigger(abe_priv->modem_substream[substream->stream], + cmd, abe_priv->modem_dai); + if (ret < 0) { + dev_err(abe_priv->modem_dai->dev, "MODEM trigger failed\n"); + return ret; + } + } + + return ret; +} + +static int omap_abe_dai_bespoke_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + int ret = 0; + + dev_dbg(dai->dev, "%s: %s cmd %d\n", __func__, dai->name, cmd); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d cmd %d\n", + __func__, substream->stream, cmd); + + ret = snd_soc_dai_trigger(abe_priv->modem_substream[substream->stream], + cmd, abe_priv->modem_dai); + if (ret < 0) { + dev_err(abe_priv->modem_dai->dev, "MODEM trigger failed\n"); + return ret; + } + } + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + playback_trigger(substream, dai, cmd); + else + capture_trigger(substream, dai, cmd); + + return ret; +} + +static int omap_abe_dai_hw_free(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + int ret = 0; + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d\n", + __func__, substream->stream); + + ret = snd_soc_dai_hw_free(abe_priv->modem_substream[substream->stream], + abe_priv->modem_dai); + if (ret < 0) { + dev_err(abe_priv->modem_dai->dev, "MODEM hw_free failed\n"); + return ret; + } + } + return ret; +} + +static void omap_abe_dai_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + + if (dai->id == ABE_FRONTEND_DAI_MODEM) { + dev_dbg(abe_priv->modem_dai->dev, "%s: MODEM stream %d\n", + __func__, substream->stream); + + snd_soc_dai_shutdown(abe_priv->modem_substream[substream->stream], + abe_priv->modem_dai); + } +} + +static int omap_abe_dai_probe(struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv; + int i; + + abe_priv = kzalloc(sizeof(struct omap_abe_data), GFP_KERNEL); + if (abe_priv == NULL) + return -ENOMEM; + + abe_priv->abe = omap_abe_port_mgr_get(); + if (!abe_priv->abe) + goto err; + + for (i = 0; i <= OMAP_ABE_MAX_PORT_ID; i++) { + + abe_priv->port[i] = omap_abe_port_open(abe_priv->abe, i); + if (abe_priv->port[i] == NULL) { + for (--i; i >= 0; i--) + omap_abe_port_close(abe_priv->abe, abe_priv->port[i]); + + goto err_port; + } + } + + snd_soc_dai_set_drvdata(dai, abe_priv); + return 0; + +err_port: + omap_abe_port_mgr_put(abe_priv->abe); +err: + kfree(abe_priv); + return -ENOMEM; +} + +static int omap_abe_dai_remove(struct snd_soc_dai *dai) +{ + struct omap_abe_data *abe_priv = snd_soc_dai_get_drvdata(dai); + + omap_abe_port_mgr_put(abe_priv->abe); + kfree(abe_priv); + return 0; +} + +static struct snd_soc_dai_ops omap_abe_dai_ops = { + .startup = omap_abe_dai_startup, + .shutdown = omap_abe_dai_shutdown, + .hw_params = omap_abe_dai_hw_params, + .hw_free = omap_abe_dai_hw_free, + .prepare = omap_abe_dai_prepare, + .trigger = omap_abe_dai_trigger, + .bespoke_trigger = omap_abe_dai_bespoke_trigger, +}; + +static struct snd_soc_dai_driver omap_abe_dai[] = { + { /* Multimedia Playback and Capture */ + .name = "MultiMedia1", + .probe = omap_abe_dai_probe, + .remove = omap_abe_dai_remove, + .playback = { + .stream_name = "MultiMedia1 Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = OMAP_ABE_FORMATS, + }, + .capture = { + .stream_name = "MultiMedia1 Capture", + .channels_min = 2, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_48000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* Multimedia Capture */ + .name = "MultiMedia2", + .capture = { + .stream_name = "MultiMedia2 Capture", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* Voice Playback and Capture */ + .name = "Voice", + .playback = { + .stream_name = "Voice Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, + .formats = OMAP_ABE_FORMATS, + }, + .capture = { + .stream_name = "Voice Capture", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* Tones Playback */ + .name = "Tones", + .playback = { + .stream_name = "Tones Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* Vibra */ + .name = "Vibra", + .playback = { + .stream_name = "Vibra Playback", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* MODEM Voice Playback and Capture */ + .name = "MODEM", + .playback = { + .stream_name = "Voice Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, + .formats = OMAP_ABE_FORMATS, + }, + .capture = { + .stream_name = "Voice Capture", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, + { /* Low Power HiFi Playback */ + .name = "MultiMedia1 LP", + .playback = { + .stream_name = "MultiMedia1 LP Playback", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, + .formats = OMAP_ABE_FORMATS, + }, + .ops = &omap_abe_dai_ops, + }, +}; + +static int __devinit omap_abe_probe(struct platform_device *pdev) +{ + return snd_soc_register_dais(&pdev->dev, omap_abe_dai, + ARRAY_SIZE(omap_abe_dai)); +} + +static int __devexit omap_abe_remove(struct platform_device *pdev) +{ + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(omap_abe_dai)); + return 0; +} + +static struct platform_driver omap_abe_driver = { + .driver = { + .name = "omap-abe-dai", + .owner = THIS_MODULE, + }, + .probe = omap_abe_probe, + .remove = __devexit_p(omap_abe_remove), +}; + +static int __init omap_abe_init(void) +{ + return platform_driver_register(&omap_abe_driver); +} +module_init(omap_abe_init); + +static void __exit omap_abe_exit(void) +{ + platform_driver_unregister(&omap_abe_driver); +} +module_exit(omap_abe_exit); + +MODULE_AUTHOR("Liam Girdwood <lrg@ti.com>"); +MODULE_DESCRIPTION("OMAP ABE SoC Interface"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/omap/omap-abe.h b/sound/soc/omap/omap-abe.h new file mode 100644 index 0000000..f6fad97 --- /dev/null +++ b/sound/soc/omap/omap-abe.h @@ -0,0 +1,59 @@ +/* + * omap-abe.h + * + * Copyright (C) 2010 Texas Instruments + * + * Contact: 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 + * + */ + +#ifndef __OMAP_ABE_H__ +#define __OMAP_ABE_H__ + +#define ABE_FRONTEND_DAI_MEDIA 0 +#define ABE_FRONTEND_DAI_MEDIA_CAPTURE 1 +#define ABE_FRONTEND_DAI_VOICE 2 +#define ABE_FRONTEND_DAI_TONES 3 +#define ABE_FRONTEND_DAI_VIBRA 4 +#define ABE_FRONTEND_DAI_MODEM 5 +#define ABE_FRONTEND_DAI_LP_MEDIA 6 + +/* This must currently match the BE order in DSP */ +#define OMAP_ABE_DAI_PDM_UL 0 +#define OMAP_ABE_DAI_PDM_DL1 1 +#define OMAP_ABE_DAI_PDM_DL2 2 +#define OMAP_ABE_DAI_PDM_VIB 3 +#define OMAP_ABE_DAI_BT_VX 4 +#define OMAP_ABE_DAI_MM_FM 5 +#define OMAP_ABE_DAI_MODEM 6 +#define OMAP_ABE_DAI_DMIC0 7 +#define OMAP_ABE_DAI_DMIC1 8 +#define OMAP_ABE_DAI_DMIC2 9 + +#define OMAP_ABE_BE_PDM_DL1 "PDM-DL1" +#define OMAP_ABE_BE_PDM_UL1 "PDM-UL1" +#define OMAP_ABE_BE_PDM_DL2 "PDM-DL2" +#define OMAP_ABE_BE_PDM_VIB "PDM-VIB" +#define OMAP_ABE_BE_BT_VX "BT-VX" +#define OMAP_ABE_BE_MM_EXT0 "FM-EXT" +#define OMAP_ABE_BE_MM_EXT1 "MODEM-EXT" +#define OMAP_ABE_BE_DMIC0 "DMIC0" +#define OMAP_ABE_BE_DMIC1 "DMIC1" +#define OMAP_ABE_BE_DMIC2 "DMIC2" + + +#endif /* End of __OMAP_MCPDM_H__ */ diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 07b7723..36d1cae 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -258,7 +258,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, default: return -EINVAL; } - if (cpu_is_omap34xx()) { + if (cpu_is_omap34xx() || cpu_is_omap44xx()) { dma_data->set_threshold = omap_mcbsp_set_threshold; /* TODO: Currently, MODE_ELEMENT == MODE_FRAME */ if (omap_mcbsp_get_dma_op_mode(bus_id) == diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index bed09c2..3a15869 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -25,7 +25,16 @@ #include <linux/init.h> #include <linux/module.h> -#include <linux/device.h> +#include <linux/platform_device.h> +#include <linux/wait.h> +#include <linux/interrupt.h> +#include <linux/err.h> +#include <linux/delay.h> +#include <linux/io.h> +#include <linux/irq.h> +#include <linux/slab.h> +#include <linux/pm_runtime.h> + #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> @@ -33,33 +42,49 @@ #include <sound/soc.h> #include <plat/dma.h> -#include <plat/mcbsp.h> -#include "mcpdm.h" +#include <plat/omap_hwmod.h> +#include "omap-mcpdm.h" #include "omap-pcm.h" - -struct omap_mcpdm_data { - struct omap_mcpdm_link *links; +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) ||\ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) +#include "omap-abe-dsp.h" +#include "abe/abe_main.h" +#include "abe/port_mgr.h" +#endif + +#define MCPDM_LEGACY_DAI_DL1 0 +#define MCPDM_LEGACY_DAI_UL1 1 +#define MCPDM_ABE_DAI_DL1 2 +#define MCPDM_ABE_DAI_DL2 3 +#define MCPDM_ABE_DAI_VIB 4 +#define MCPDM_ABE_DAI_UL1 5 + +struct omap_mcpdm { + struct device *dev; + unsigned long phys_base; + void __iomem *io_base; + int irq; + struct delayed_work delayed_work; + + struct mutex mutex; + struct omap_mcpdm_platform_data *pdata; + struct completion irq_completion; + struct abe *abe; + struct omap_abe_port *dl_port; + struct omap_abe_port *ul_port; + + /* channel data */ + u32 dn_channels; + u32 up_channels; + int dl_active; + int ul_active; int active; -}; - -static struct omap_mcpdm_link omap_mcpdm_links[] = { - /* downlink */ - { - .irq_mask = MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL, - .threshold = 1, - .format = PDMOUTFORMAT_LJUST, - }, - /* uplink */ - { - .irq_mask = MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL, - .threshold = 1, - .format = PDMOUTFORMAT_LJUST, - }, -}; + int abe_enabled; + int abe_mode[2]; -static struct omap_mcpdm_data mcpdm_data = { - .links = omap_mcpdm_links, - .active = 0, + /* DC offset */ + unsigned long dl1_offset; + unsigned long dl2_offset; }; /* @@ -84,64 +109,427 @@ static struct omap_pcm_dma_data omap_mcpdm_dai_dma_params[] = { }, }; +static inline void omap_mcpdm_write(struct omap_mcpdm *mcpdm, + u16 reg, u32 val) +{ + __raw_writel(val, mcpdm->io_base + reg); +} + +static inline int omap_mcpdm_read(struct omap_mcpdm *mcpdm, u16 reg) +{ + return __raw_readl(mcpdm->io_base + reg); +} + +#ifdef DEBUG +static void omap_mcpdm_reg_dump(struct omap_mcpdm *mcpdm) +{ + dev_dbg(mcpdm->dev, "***********************\n"); + dev_dbg(mcpdm->dev, "IRQSTATUS_RAW: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_IRQSTATUS_RAW)); + dev_dbg(mcpdm->dev, "IRQSTATUS: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_IRQSTATUS)); + dev_dbg(mcpdm->dev, "IRQENABLE_SET: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_IRQENABLE_SET)); + dev_dbg(mcpdm->dev, "IRQENABLE_CLR: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_IRQENABLE_CLR)); + dev_dbg(mcpdm->dev, "IRQWAKE_EN: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_IRQWAKE_EN)); + dev_dbg(mcpdm->dev, "DMAENABLE_SET: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_DMAENABLE_SET)); + dev_dbg(mcpdm->dev, "DMAENABLE_CLR: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_DMAENABLE_CLR)); + dev_dbg(mcpdm->dev, "DMAWAKEEN: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_DMAWAKEEN)); + dev_dbg(mcpdm->dev, "CTRL: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_CTRL)); + dev_dbg(mcpdm->dev, "DN_DATA: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_DN_DATA)); + dev_dbg(mcpdm->dev, "UP_DATA: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_UP_DATA)); + dev_dbg(mcpdm->dev, "FIFO_CTRL_DN: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_FIFO_CTRL_DN)); + dev_dbg(mcpdm->dev, "FIFO_CTRL_UP: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_FIFO_CTRL_UP)); + dev_dbg(mcpdm->dev, "DN_OFFSET: 0x%04x\n", + omap_mcpdm_read(mcpdm, MCPDM_DN_OFFSET)); + dev_dbg(mcpdm->dev, "***********************\n"); +} +#else +static void omap_mcpdm_reg_dump(struct omap_mcpdm *mcpdm) {} +#endif + +/* + * Enables the transfer through the PDM interface to/from the Phoenix + * codec by enabling the corresponding UP or DN channels. + */ +static void omap_mcpdm_start(struct omap_mcpdm *mcpdm, int stream) +{ + u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_CTRL); + + if (stream) { + ctrl |= SW_UP_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl |= mcpdm->up_channels; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~SW_UP_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + } else { + ctrl |= SW_DN_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl |= mcpdm->dn_channels; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~SW_DN_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + } +} + +/* + * Disables the transfer through the PDM interface to/from the Phoenix + * codec by disabling the corresponding UP or DN channels. + */ +static void omap_mcpdm_stop(struct omap_mcpdm *mcpdm, int stream) +{ + u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_CTRL); + + if (stream) { + ctrl |= SW_UP_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~mcpdm->up_channels; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~SW_UP_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + } else { + ctrl |= SW_DN_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~mcpdm->dn_channels; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + ctrl &= ~SW_DN_RST; + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl); + } + +} + +/* + * Is the physical McPDM interface active. + */ +static inline int omap_mcpdm_active(struct omap_mcpdm *mcpdm) +{ + return omap_mcpdm_read(mcpdm, MCPDM_CTRL) & (PDM_DN_MASK | PDM_UP_MASK); +} + +/* + * Configures McPDM uplink for audio recording. + * This function should be called before omap_mcpdm_start. + */ +static void omap_mcpdm_capture_open(struct omap_mcpdm *mcpdm) +{ + /* Enable irq request generation */ + omap_mcpdm_write(mcpdm, MCPDM_IRQENABLE_SET, + MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL); + + /* Configure uplink threshold */ + omap_mcpdm_write(mcpdm, MCPDM_FIFO_CTRL_UP, 2); + + /* Configure DMA controller */ + omap_mcpdm_write(mcpdm, MCPDM_DMAENABLE_SET, DMA_UP_ENABLE); +} + +/* + * Configures McPDM downlink for audio playback. + * This function should be called before omap_mcpdm_start. + */ +static void omap_mcpdm_playback_open(struct omap_mcpdm *mcpdm) +{ + /* Enable irq request generation */ + omap_mcpdm_write(mcpdm, MCPDM_IRQENABLE_SET, + MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL); + + /* Configure uplink threshold */ + omap_mcpdm_write(mcpdm, MCPDM_FIFO_CTRL_DN, 2); + + /* Enable DMA request generation */ + omap_mcpdm_write(mcpdm, MCPDM_DMAENABLE_SET, DMA_DN_ENABLE); +} + +/* + * Cleans McPDM uplink configuration. + * This function should be called when the stream is closed. + */ +static void omap_mcpdm_capture_close(struct omap_mcpdm *mcpdm) +{ + /* Disable irq request generation */ + omap_mcpdm_write(mcpdm, MCPDM_IRQENABLE_CLR, + MCPDM_UP_IRQ_EMPTY | MCPDM_UP_IRQ_FULL); + + /* Disable DMA request generation */ + omap_mcpdm_write(mcpdm, MCPDM_DMAENABLE_CLR, DMA_UP_ENABLE); +} + +/* + * Cleans McPDM downlink configuration. + * This function should be called when the stream is closed. + */ +static void omap_mcpdm_playback_close(struct omap_mcpdm *mcpdm) +{ + /* Disable irq request generation */ + omap_mcpdm_write(mcpdm, MCPDM_IRQENABLE_CLR, + MCPDM_DN_IRQ_EMPTY | MCPDM_DN_IRQ_FULL); + + /* Disable DMA request generation */ + omap_mcpdm_write(mcpdm, MCPDM_DMAENABLE_CLR, DMA_DN_ENABLE); +} + +static irqreturn_t omap_mcpdm_irq_handler(int irq, void *dev_id) +{ + struct omap_mcpdm *mcpdm = dev_id; + int irq_status; + + irq_status = omap_mcpdm_read(mcpdm, MCPDM_IRQSTATUS); + + /* Acknowledge irq event */ + omap_mcpdm_write(mcpdm, MCPDM_IRQSTATUS, irq_status); + + if (irq & MCPDM_DN_IRQ_FULL) + dev_err(mcpdm->dev, "DN FIFO error %x\n", irq_status); + + if (irq & MCPDM_DN_IRQ_EMPTY) + dev_err(mcpdm->dev, "DN FIFO error %x\n", irq_status); + + if (irq & MCPDM_DN_IRQ) + dev_dbg(mcpdm->dev, "DN write request\n"); + + if (irq & MCPDM_UP_IRQ_FULL) + dev_err(mcpdm->dev, "UP FIFO error %x\n", irq_status); + + if (irq & MCPDM_UP_IRQ_EMPTY) + dev_err(mcpdm->dev, "UP FIFO error %x\n", irq_status); + + if (irq & MCPDM_UP_IRQ) + dev_dbg(mcpdm->dev, "UP write request\n"); + + return IRQ_HANDLED; +} + +/* Enable/disable DC offset cancelation for the analog + * headset path (PDM channels 1 and 2). + */ +static void omap_mcpdm_set_offset(struct omap_mcpdm *mcpdm) +{ + int offset; + + if (mcpdm->dl1_offset > DN_OFST_MAX) { + dev_err(mcpdm->dev, "DC DL1 offset out of range\n"); + return; + } + + if (mcpdm->dl2_offset > DN_OFST_MAX) { + dev_err(mcpdm->dev, "DC DL2 offset out of range\n"); + return; + } + + offset = (mcpdm->dl1_offset << DN_OFST_RX1) | + (mcpdm->dl2_offset << DN_OFST_RX2); + + /* offset cancellation for channel 1 */ + if (mcpdm->dl1_offset) + offset |= DN_OFST_RX1_EN; + else + offset &= ~DN_OFST_RX1_EN; + + /* offset cancellation for channel 2 */ + if (mcpdm->dl2_offset) + offset |= DN_OFST_RX2_EN; + else + offset &= ~DN_OFST_RX2_EN; + + omap_mcpdm_write(mcpdm, MCPDM_DN_OFFSET, offset); +} + +static ssize_t mcpdm_dl1_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct omap_mcpdm *mcpdm = dev_get_drvdata(dev); + + return sprintf(buf, "%ld\n", mcpdm->dl1_offset); +} + +static ssize_t mcpdm_dl1_set(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct omap_mcpdm *mcpdm = dev_get_drvdata(dev); + int ret; + unsigned long value; + + ret = strict_strtol(buf, 10, &value); + if (ret) + return ret; + + if (value > DN_OFST_MAX) + return -EINVAL; + + mcpdm->dl1_offset = value; + return count; +} + +static ssize_t mcpdm_dl2_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct omap_mcpdm *mcpdm = dev_get_drvdata(dev); + + return sprintf(buf, "%ld\n", mcpdm->dl2_offset); +} + +static ssize_t mcpdm_dl2_set(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct omap_mcpdm *mcpdm = dev_get_drvdata(dev); + int ret; + unsigned long value; + + ret = strict_strtol(buf, 10, &value); + if (ret) + return ret; + + if (value > DN_OFST_MAX) + return -EINVAL; + + mcpdm->dl2_offset = value; + return count; +} + +static DEVICE_ATTR(dl1, 0644, mcpdm_dl1_show, mcpdm_dl1_set); +static DEVICE_ATTR(dl2, 0644, mcpdm_dl2_show, mcpdm_dl2_set); + static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); + u32 ctrl; int err = 0; - if (!dai->active) - err = omap_mcpdm_request(); + dev_dbg(dai->dev, "%s: active %d\n", __func__, dai->active); + + /* make sure we stop any pre-existing shutdown */ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + cancel_delayed_work(&mcpdm->delayed_work); + + mutex_lock(&mcpdm->mutex); + + if (!dai->active) { + if (!mcpdm->active) { + pm_runtime_get_sync(mcpdm->dev); + mcpdm->active = 1; + } + + omap_mcpdm_set_offset(mcpdm); + + /* Enable McPDM watch dog for ES above ES 1.0 to avoid saturation */ + if (omap_rev() != OMAP4430_REV_ES1_0) { + ctrl = omap_mcpdm_read(mcpdm, MCPDM_CTRL); + omap_mcpdm_write(mcpdm, MCPDM_CTRL, ctrl | WD_EN); + } + } + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + mcpdm->dl_active++; + omap_mcpdm_playback_open(mcpdm); + } else { + mcpdm->ul_active++; + omap_mcpdm_capture_open(mcpdm); + } + + if (dai->id > 1) + mcpdm->abe_mode[substream->stream] = 1; + else + mcpdm->abe_mode[substream->stream] = 0; + + mutex_unlock(&mcpdm->mutex); return err; } -static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) +/* work to delay McPDM shutdown */ +static void playback_work(struct work_struct *work) { - if (!dai->active) - omap_mcpdm_free(); + struct omap_mcpdm *mcpdm = + container_of(work, struct omap_mcpdm, delayed_work.work); + + mutex_lock(&mcpdm->mutex); + + if (!mcpdm->dl_active) { + /* ABE playback stop handled by delayed work */ + if (mcpdm->abe_mode[SNDRV_PCM_STREAM_PLAYBACK]) { + if (mcpdm->abe_enabled) { + omap_abe_port_disable(mcpdm->abe, mcpdm->dl_port); + udelay(250); + omap_mcpdm_stop(mcpdm, SNDRV_PCM_STREAM_PLAYBACK); + abe_dsp_shutdown(); + abe_dsp_pm_put(); + } + omap_mcpdm_playback_close(mcpdm); + mcpdm->abe_enabled = 0; + } else + omap_mcpdm_playback_close(mcpdm); + } + + if (!omap_mcpdm_active(mcpdm)) { + pm_runtime_put_sync(mcpdm->dev); + mcpdm->active = 0; + } + + mutex_unlock(&mcpdm->mutex); } -static int omap_mcpdm_dai_trigger(struct snd_pcm_substream *substream, int cmd, - struct snd_soc_dai *dai) +static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { - struct omap_mcpdm_data *mcpdm_priv = snd_soc_dai_get_drvdata(dai); - int stream = substream->stream; - int err = 0; + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - case SNDRV_PCM_TRIGGER_RESUME: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (!mcpdm_priv->active++) - omap_mcpdm_start(stream); - break; + dev_dbg(dai->dev, "%s: active %d\n", __func__, dai->active); - case SNDRV_PCM_TRIGGER_STOP: - case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (!--mcpdm_priv->active) - omap_mcpdm_stop(stream); - break; - default: - err = -EINVAL; + mutex_lock(&mcpdm->mutex); + + if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (!--mcpdm->ul_active) { + omap_mcpdm_capture_close(mcpdm); + + /* power down if McPDM is not running */ + if (!omap_mcpdm_active(mcpdm)) { + pm_runtime_put_sync(mcpdm->dev); + mcpdm->active = 0; + } + } + } else { + if (!--mcpdm->dl_active) + schedule_delayed_work(&mcpdm->delayed_work, + msecs_to_jiffies(1000)); /* TODO: pdata ? */ } - return err; + mutex_unlock(&mcpdm->mutex); } static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct omap_mcpdm_data *mcpdm_priv = snd_soc_dai_get_drvdata(dai); - struct omap_mcpdm_link *mcpdm_links = mcpdm_priv->links; + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); int stream = substream->stream; - int channels, err, link_mask = 0; + int channels, link_mask = 0; snd_soc_dai_set_dma_data(dai, substream, &omap_mcpdm_dai_dma_params[stream]); + /* ABE DAIs have fixed channels and IDs > MCPDM_LEGACY_DAI_DL1 */ + if (dai->id > MCPDM_LEGACY_DAI_DL1) { + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + mcpdm->dn_channels = PDM_DN_MASK | PDM_CMD_MASK; + else + mcpdm->up_channels = PDM_UP1_EN | PDM_UP2_EN; + return 0; + } + channels = params_channels(params); switch (channels) { case 4: @@ -164,58 +552,149 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - mcpdm_links[stream].channels = link_mask << 3; - err = omap_mcpdm_playback_open(&mcpdm_links[stream]); - } else { - mcpdm_links[stream].channels = link_mask << 0; - err = omap_mcpdm_capture_open(&mcpdm_links[stream]); - } + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + /* Downlink channels */ + mcpdm->dn_channels = (link_mask << 3) & (PDM_DN_MASK | PDM_CMD_MASK); + else + /* Uplink channels */ + mcpdm->up_channels = link_mask & (PDM_UP_MASK | PDM_STATUS_MASK); - return err; + return 0; } -static int omap_mcpdm_dai_hw_free(struct snd_pcm_substream *substream, +static int omap_mcpdm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct omap_mcpdm_data *mcpdm_priv = snd_soc_dai_get_drvdata(dai); - struct omap_mcpdm_link *mcpdm_links = mcpdm_priv->links; + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); + + /* We only need to prepare for ABE playback */ + if (dai->id < MCPDM_ABE_DAI_DL1) + return 0; + + mutex_lock(&mcpdm->mutex); + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + + /* Check if ABE McPDM DL is already started */ + if (omap_abe_port_is_enabled(mcpdm->abe, mcpdm->dl_port)) + goto out; + + abe_dsp_pm_get(); + + /* start ATC before McPDM IP */ + omap_abe_port_enable(mcpdm->abe, mcpdm->dl_port); + + /* wait 250us for ABE tick */ + udelay(250); + + mcpdm->abe_enabled = 1; + + omap_mcpdm_start(mcpdm, SNDRV_PCM_STREAM_PLAYBACK); + } + +out: + mutex_unlock(&mcpdm->mutex); + return 0; +} + +static int omap_mcpdm_dai_trigger(struct snd_pcm_substream *substream, + int cmd, struct snd_soc_dai *dai) +{ + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); int stream = substream->stream; - int err; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - err = omap_mcpdm_playback_close(&mcpdm_links[stream]); - else - err = omap_mcpdm_capture_close(&mcpdm_links[stream]); + dev_dbg(dai->dev, "cmd %d\n", cmd); - return err; + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + /* ABE playback start handled by hw_params to prevent pop-noise */ + if (dai->id == MCPDM_ABE_DAI_DL1 || + dai->id == MCPDM_ABE_DAI_DL2 || + dai->id == MCPDM_ABE_DAI_VIB) + return 0; + omap_mcpdm_start(mcpdm, stream); + break; + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + break; + case SNDRV_PCM_TRIGGER_STOP: + /* ABE playback stop handled by delayed work */ + if (dai->id == MCPDM_ABE_DAI_DL1 || + dai->id == MCPDM_ABE_DAI_DL2 || + dai->id == MCPDM_ABE_DAI_VIB) + return 0; + omap_mcpdm_stop(mcpdm, stream); + break; + default: + break; + } + omap_mcpdm_reg_dump(mcpdm); + return 0; } static struct snd_soc_dai_ops omap_mcpdm_dai_ops = { .startup = omap_mcpdm_dai_startup, .shutdown = omap_mcpdm_dai_shutdown, - .trigger = omap_mcpdm_dai_trigger, .hw_params = omap_mcpdm_dai_hw_params, - .hw_free = omap_mcpdm_dai_hw_free, + .prepare = omap_mcpdm_prepare, + .trigger = omap_mcpdm_dai_trigger, }; -#define OMAP_MCPDM_RATES (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) -#define OMAP_MCPDM_FORMATS (SNDRV_PCM_FMTBIT_S32_LE) +static int omap_mcpdm_probe(struct snd_soc_dai *dai) +{ + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); + int ret; + + pm_runtime_enable(mcpdm->dev); + + /* Disable lines while request is ongoing */ + pm_runtime_get_sync(mcpdm->dev); + omap_mcpdm_write(mcpdm, MCPDM_CTRL, 0x00); + + ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler, + 0, "McPDM", (void *)mcpdm); + if (ret) + dev_err(mcpdm->dev, "Request for McPDM IRQ failed\n"); -static int omap_mcpdm_dai_probe(struct snd_soc_dai *dai) + pm_runtime_put_sync(mcpdm->dev); + return ret; +} + +static int omap_mcpdm_remove(struct snd_soc_dai *dai) { - snd_soc_dai_set_drvdata(dai, &mcpdm_data); + struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); + + free_irq(mcpdm->irq, (void *)mcpdm); + pm_runtime_disable(mcpdm->dev); + return 0; } -static struct snd_soc_dai_driver omap_mcpdm_dai = { - .probe = omap_mcpdm_dai_probe, +#define OMAP_MCPDM_RATES (SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) +#define OMAP_MCPDM_FORMATS SNDRV_PCM_FMTBIT_S32_LE + +static struct snd_soc_dai_driver omap_mcpdm_dai[] = { +{ + .name = "mcpdm-dl", + .id = MCPDM_LEGACY_DAI_DL1, + .probe = omap_mcpdm_probe, + .remove = omap_mcpdm_remove, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, .playback = { .channels_min = 1, .channels_max = 4, .rates = OMAP_MCPDM_RATES, .formats = OMAP_MCPDM_FORMATS, }, + .ops = &omap_mcpdm_dai_ops, +}, +{ + .name = "mcpdm-ul", + .id = MCPDM_LEGACY_DAI_UL1, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, .capture = { .channels_min = 1, .channels_max = 2, @@ -223,31 +702,166 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = { .formats = OMAP_MCPDM_FORMATS, }, .ops = &omap_mcpdm_dai_ops, -}; +}, +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) ||\ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) +{ + .name = "mcpdm-dl1", + .id = MCPDM_ABE_DAI_DL1, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, + .playback = { + .channels_min = 1, + .channels_max = 2, + .rates = OMAP_MCPDM_RATES, + .formats = OMAP_MCPDM_FORMATS, + }, + .ops = &omap_mcpdm_dai_ops, +}, +{ + .name = "mcpdm-dl2", + .id = MCPDM_ABE_DAI_DL2, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, + .playback = { + .channels_min = 1, + .channels_max = 2, + .rates = OMAP_MCPDM_RATES, + .formats = OMAP_MCPDM_FORMATS, + }, + .ops = &omap_mcpdm_dai_ops, +}, +{ + .name = "mcpdm-vib", + .id = MCPDM_ABE_DAI_VIB, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, + .playback = { + .channels_min = 1, + .channels_max = 2, + .rates = OMAP_MCPDM_RATES, + .formats = OMAP_MCPDM_FORMATS, + }, + .ops = &omap_mcpdm_dai_ops, +}, +{ + .name = "mcpdm-ul1", + .id = MCPDM_ABE_DAI_UL1, + .probe_order = SND_SOC_COMP_ORDER_LATE, + .remove_order = SND_SOC_COMP_ORDER_EARLY, + .capture = { + .channels_min = 1, + .channels_max = 2, + .rates = OMAP_MCPDM_RATES, + .formats = OMAP_MCPDM_FORMATS, + }, + .ops = &omap_mcpdm_dai_ops, +}, +#endif + }; static __devinit int asoc_mcpdm_probe(struct platform_device *pdev) { - int ret; + struct omap_mcpdm *mcpdm; + struct resource *res; + int ret = 0, err; - ret = omap_mcpdm_probe(pdev); - if (ret < 0) - return ret; - ret = snd_soc_register_dai(&pdev->dev, &omap_mcpdm_dai); - if (ret < 0) - omap_mcpdm_remove(pdev); + mcpdm = kzalloc(sizeof(struct omap_mcpdm), GFP_KERNEL); + if (!mcpdm) + return -ENOMEM; + + platform_set_drvdata(pdev, mcpdm); + + mutex_init(&mcpdm->mutex); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res == NULL) { + dev_err(&pdev->dev, "no resource\n"); + goto err_res; + } + + mcpdm->io_base = ioremap(res->start, resource_size(res)); + if (!mcpdm->io_base) { + ret = -ENOMEM; + goto err_iomap; + } + + mcpdm->irq = platform_get_irq(pdev, 0); + if (mcpdm->irq < 0) { + ret = mcpdm->irq; + goto err_irq; + } + + mcpdm->dev = &pdev->dev; + + /* DL1 and DL2 DC offset values will be different for each device */ + mcpdm->dl1_offset = DN_OFST_MAX >> 1; + mcpdm->dl2_offset = DN_OFST_MAX >> 1; + err = device_create_file(mcpdm->dev, &dev_attr_dl1); + if (err < 0) + dev_err(mcpdm->dev,"failed to DL1 DC offset sysfs: %d\n", err); + err = device_create_file(mcpdm->dev, &dev_attr_dl2); + if (err < 0) + dev_err(mcpdm->dev,"failed to DL2 DC offset sysfs: %d\n", err); + + INIT_DELAYED_WORK(&mcpdm->delayed_work, playback_work); + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) ||\ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + + mcpdm->abe = omap_abe_port_mgr_get(); + + mcpdm->dl_port = omap_abe_port_open(mcpdm->abe, OMAP_ABE_BE_PORT_PDM_DL1); + if (mcpdm->dl_port == NULL) + goto err_irq; +#endif + + ret = snd_soc_register_dais(&pdev->dev, omap_mcpdm_dai, + ARRAY_SIZE(omap_mcpdm_dai)); + if (ret == 0) + return 0; + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) ||\ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + omap_abe_port_close(mcpdm->abe, mcpdm->dl_port); +#endif +err_irq: + iounmap(mcpdm->io_base); +err_iomap: + release_mem_region(res->start, resource_size(res)); +err_res: + kfree(mcpdm); return ret; } static int __devexit asoc_mcpdm_remove(struct platform_device *pdev) { - snd_soc_unregister_dai(&pdev->dev); - omap_mcpdm_remove(pdev); + struct omap_mcpdm *mcpdm = platform_get_drvdata(pdev); + struct resource *res; + + flush_delayed_work_sync(&mcpdm->delayed_work); + + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(omap_mcpdm_dai)); + + device_remove_file(&pdev->dev, &dev_attr_dl1); + device_remove_file(&pdev->dev, &dev_attr_dl2); + +#if defined(CONFIG_SND_OMAP_SOC_ABE_DSP) ||\ + defined(CONFIG_SND_OMAP_SOC_ABE_DSP_MODULE) + omap_abe_port_close(mcpdm->abe, mcpdm->dl_port); + omap_abe_port_mgr_put(mcpdm->abe); +#endif + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + iounmap(mcpdm->io_base); + + kfree(mcpdm); return 0; } static struct platform_driver asoc_mcpdm_driver = { .driver = { - .name = "omap-mcpdm-dai", + .name = "omap-mcpdm", .owner = THIS_MODULE, }, diff --git a/sound/soc/omap/omap-mcpdm.h b/sound/soc/omap/omap-mcpdm.h new file mode 100644 index 0000000..79fdf30 --- /dev/null +++ b/sound/soc/omap/omap-mcpdm.h @@ -0,0 +1,119 @@ +/* + * omap-mcpdm.h + * + * Copyright (C) 2009 Texas Instruments + * + * Contact: Misael Lopez Cruz <x0052729@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 + * + */ + +#ifndef __OMAP_MCPDM_H__ +#define __OMAP_MCPDM_H__ + +#include <linux/platform_device.h> + +#define MCPDM_REVISION 0x00 +#define MCPDM_SYSCONFIG 0x10 +#define MCPDM_IRQSTATUS_RAW 0x24 +#define MCPDM_IRQSTATUS 0x28 +#define MCPDM_IRQENABLE_SET 0x2C +#define MCPDM_IRQENABLE_CLR 0x30 +#define MCPDM_IRQWAKE_EN 0x34 +#define MCPDM_DMAENABLE_SET 0x38 +#define MCPDM_DMAENABLE_CLR 0x3C +#define MCPDM_DMAWAKEEN 0x40 +#define MCPDM_CTRL 0x44 +#define MCPDM_DN_DATA 0x48 +#define MCPDM_UP_DATA 0x4C +#define MCPDM_FIFO_CTRL_DN 0x50 +#define MCPDM_FIFO_CTRL_UP 0x54 +#define MCPDM_DN_OFFSET 0x58 + +/* + * MCPDM_IRQ bit fields + * IRQSTATUS_RAW, IRQSTATUS, IRQENABLE_SET, IRQENABLE_CLR + */ + +#define MCPDM_DN_IRQ (1 << 0) +#define MCPDM_DN_IRQ_EMPTY (1 << 1) +#define MCPDM_DN_IRQ_ALMST_EMPTY (1 << 2) +#define MCPDM_DN_IRQ_FULL (1 << 3) + +#define MCPDM_UP_IRQ (1 << 8) +#define MCPDM_UP_IRQ_EMPTY (1 << 9) +#define MCPDM_UP_IRQ_ALMST_FULL (1 << 10) +#define MCPDM_UP_IRQ_FULL (1 << 11) + +#define MCPDM_DOWNLINK_IRQ_MASK 0x00F +#define MCPDM_UPLINK_IRQ_MASK 0xF00 + +/* + * MCPDM_DMAENABLE bit fields + */ + +#define DMA_DN_ENABLE 0x1 +#define DMA_UP_ENABLE 0x2 + +/* + * MCPDM_CTRL bit fields + */ + +#define PDM_UP1_EN 0x0001 +#define PDM_UP2_EN 0x0002 +#define PDM_UP3_EN 0x0004 +#define PDM_DN1_EN 0x0008 +#define PDM_DN2_EN 0x0010 +#define PDM_DN3_EN 0x0020 +#define PDM_DN4_EN 0x0040 +#define PDM_DN5_EN 0x0080 +#define PDMOUTFORMAT 0x0100 +#define CMD_INT 0x0200 +#define STATUS_INT 0x0400 +#define SW_UP_RST 0x0800 +#define SW_DN_RST 0x1000 +#define WD_EN 0x4000 +#define PDM_UP_MASK 0x007 +#define PDM_DN_MASK 0x0F8 +#define PDM_CMD_MASK 0x200 +#define PDM_STATUS_MASK 0x400 + + +#define PDMOUTFORMAT_LJUST (0 << 8) +#define PDMOUTFORMAT_RJUST (1 << 8) + +/* + * MCPDM_FIFO_CTRL bit fields + */ + +#define UP_THRES_MAX 0xF +#define DN_THRES_MAX 0xF + +/* + * MCPDM_DN_OFFSET bit fields + */ + +#define DN_OFST_RX1_EN 0x0001 +#define DN_OFST_RX2_EN 0x0100 + +#define DN_OFST_RX1 1 +#define DN_OFST_RX2 9 +#define DN_OFST_MAX 0x1F + +#define MCPDM_UPLINK 1 +#define MCPDM_DOWNLINK 2 + +#endif /* End of __OMAP_MCPDM_H__ */ diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index e6a6b99..28cc3a6 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -235,6 +235,11 @@ static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_PAUSE_PUSH: prtd->period_index = -1; omap_stop_dma(prtd->dma_ch); + /* Since we are using self linking, there is a + chance that the DMA as re-enabled the channel + just after disabling it */ + while (omap_get_dma_active_status(prtd->dma_ch)) + omap_stop_dma(prtd->dma_ch); break; default: ret = -EINVAL; @@ -280,6 +285,15 @@ static int omap_pcm_open(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_PERIODS); if (ret < 0) goto out; + if (cpu_is_omap44xx()) { + /* ABE needs a step of 24 * 4 data bits, and HDMI 32 * 4 + * Ensure buffer size satisfies both constraints. + */ + ret = snd_pcm_hw_constraint_step(runtime, 0, + SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 384); + if (ret < 0) + goto out; + } prtd = kzalloc(sizeof(*prtd), GFP_KERNEL); if (prtd == NULL) { @@ -366,9 +380,11 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm) } } -static int omap_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index 189e039..3d6a554 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -21,28 +21,90 @@ #include <linux/clk.h> #include <linux/platform_device.h> +#include <linux/i2c.h> #include <sound/core.h> #include <sound/pcm.h> +#include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-dapm.h> #include <sound/jack.h> +#include <sound/soc-dsp.h> #include <asm/mach-types.h> #include <plat/hardware.h> #include <plat/mux.h> +#include <plat/mcbsp.h> -#include "mcpdm.h" +#include "omap-mcpdm.h" +#include "omap-abe.h" #include "omap-pcm.h" +#include "omap-mcbsp.h" #include "../codecs/twl6040.h" static int twl6040_power_mode; +static int mcbsp_cfg; -static int sdp4430_hw_params(struct snd_pcm_substream *substream, +static int sdp4430_modem_mcbsp_configure(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params, int flag) +{ + int ret = 0; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_pcm_substream *modem_substream[2]; + struct snd_soc_pcm_runtime *modem_rtd; + int channels; + + if (flag) { + modem_substream[substream->stream] = + snd_soc_get_dai_substream(rtd->card, + OMAP_ABE_BE_MM_EXT1, + substream->stream); + if (unlikely(modem_substream[substream->stream] == NULL)) + return -ENODEV; + + modem_rtd = + modem_substream[substream->stream]->private_data; + + if (!mcbsp_cfg) { + /* Set cpu DAI configuration */ + ret = snd_soc_dai_set_fmt(modem_rtd->cpu_dai, + SND_SOC_DAIFMT_I2S | + SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBM_CFM); + + if (unlikely(ret < 0)) { + printk(KERN_ERR "can't set Modem cpu DAI configuration\n"); + goto exit; + } else { + mcbsp_cfg = 1; + } + } + + 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_rx_threshold( + modem_rtd->cpu_dai->id, channels); + else + omap_mcbsp_set_tx_threshold( + modem_rtd->cpu_dai->id, channels); + } + } else { + mcbsp_cfg = 0; + } + +exit: + return ret; +} + +static int sdp4430_mcpdm_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; - int clk_id, freq; - int ret; + struct snd_soc_dsp_params *dsp_params; + int clk_id, freq, ret, stream = substream->stream; if (twl6040_power_mode) { clk_id = TWL6040_SYSCLK_SEL_HPPLL; @@ -59,13 +121,113 @@ static int sdp4430_hw_params(struct snd_pcm_substream *substream, printk(KERN_ERR "can't set codec system clock\n"); return ret; } + list_for_each_entry(dsp_params, &rtd->dsp[stream].fe_clients, list_fe) { + + if (dsp_params->fe->cpu_dai->id != ABE_FRONTEND_DAI_MODEM) + continue; + + /* freed Modem McBSP configuration */ + ret = sdp4430_modem_mcbsp_configure(substream, params, 1); + if (ret < 0) { + printk(KERN_ERR "can't set Modem cpu DAI configuration\n"); + return ret; + } + } + return ret; +} + +static int sdp4430_mcpdm_hw_free(struct snd_pcm_substream *substream) +{ + int ret = 0; + + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dsp_params *dsp_params; + int stream = substream->stream; + + list_for_each_entry(dsp_params, &rtd->dsp[stream].fe_clients, list_fe) { + + if (dsp_params->fe->cpu_dai->id != ABE_FRONTEND_DAI_MODEM) + continue; + + /* freed Modem McBSP configuration */ + ret = sdp4430_modem_mcbsp_configure(substream, NULL, 0); + if (ret < 0) { + printk(KERN_ERR "can't set Modem cpu DAI configuration\n"); + return ret; + } + } return ret; } -static struct snd_soc_ops sdp4430_ops = { - .hw_params = sdp4430_hw_params, +static struct snd_soc_ops sdp4430_mcpdm_ops = { + .hw_params = sdp4430_mcpdm_hw_params, + .hw_free = sdp4430_mcpdm_hw_free, }; +static int sdp4430_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 *cpu_dai = rtd->cpu_dai; + int ret = 0; + unsigned int be_id; + + be_id = rtd->dai_link->be_id; + + if (be_id == OMAP_ABE_DAI_MM_FM) { + /* 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); + } else if (be_id == OMAP_ABE_DAI_BT_VX) { + ret = snd_soc_dai_set_fmt(cpu_dai, + SND_SOC_DAIFMT_DSP_B | + SND_SOC_DAIFMT_NB_IF | + SND_SOC_DAIFMT_CBM_CFM); + } + + if (ret < 0) { + printk(KERN_ERR "can't set cpu DAI configuration\n"); + return ret; + } + + /* + * TODO: where does this clock come from (external source??) - + * do we need to enable it. + */ + /* Set McBSP clock to external */ + ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_FCLK, + 64 * params_rate(params), + SND_SOC_CLOCK_IN); + if (ret < 0) { + printk(KERN_ERR "can't set cpu system clock\n"); + return ret; + } + return 0; +} + +static struct snd_soc_ops sdp4430_mcbsp_ops = { + .hw_params = sdp4430_mcbsp_hw_params, +}; + +static int 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); + unsigned int be_id = rtd->dai_link->be_id; + + if (be_id == OMAP_ABE_DAI_MM_FM) + channels->min = 2; + else if (be_id == OMAP_ABE_DAI_BT_VX) + channels->min = 1; + snd_mask_set(¶ms->masks[SNDRV_PCM_HW_PARAM_FORMAT - + SNDRV_PCM_HW_PARAM_FIRST_MASK], + SNDRV_PCM_FORMAT_S16_LE); + return 0; +} + /* Headset jack */ static struct snd_soc_jack hs_jack; @@ -175,6 +337,14 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) snd_soc_dapm_enable_pin(dapm, "Headset Mic"); snd_soc_dapm_enable_pin(dapm, "Headset Stereophone"); + /* allow audio paths from the audio modem to run during suspend */ + snd_soc_dapm_ignore_suspend(dapm, "Ext Mic"); + snd_soc_dapm_ignore_suspend(dapm, "Ext Spk"); + snd_soc_dapm_ignore_suspend(dapm, "AFML"); + snd_soc_dapm_ignore_suspend(dapm, "AFMR"); + snd_soc_dapm_ignore_suspend(dapm, "Headset Mic"); + snd_soc_dapm_ignore_suspend(dapm, "Headset Stereophone"); + ret = snd_soc_dapm_sync(dapm); if (ret) return ret; @@ -193,37 +363,374 @@ static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) else snd_soc_jack_report(&hs_jack, SND_JACK_HEADSET, SND_JACK_HEADSET); + /* wait 500 ms before switching of HS power */ + rtd->pmdown_time = 500; + return ret; } +static int sdp4430_twl6040_dl2_init(struct snd_soc_pcm_runtime *rtd) +{ + /* wait 500 ms before switching of HF power */ + rtd->pmdown_time = 500; + + return 0; +} + +/* TODO: make this a separate BT CODEC driver or DUMMY */ +static struct snd_soc_dai_driver dai[] = { +{ + .name = "Bluetooth", + .playback = { + .stream_name = "Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "Capture", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | + SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, +}, +/* TODO: make this a separate FM CODEC driver or DUMMY */ +{ + .name = "FM Digital", + .playback = { + .stream_name = "Playback", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "Capture", + .channels_min = 1, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, +}, +{ + .name = "HDMI", + .playback = { + .stream_name = "Playback", + .channels_min = 2, + .channels_max = 8, + .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE, + }, +}, +}; + +struct snd_soc_dsp_link fe_media = { + .playback = true, + .capture = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; + +struct snd_soc_dsp_link fe_media_capture = { + .capture = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; + +struct snd_soc_dsp_link fe_tones = { + .playback = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; + +struct snd_soc_dsp_link fe_vib = { + .playback = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; + +struct snd_soc_dsp_link fe_modem = { + .playback = true, + .capture = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; + +struct snd_soc_dsp_link fe_lp_media = { + .playback = true, + .trigger = + {SND_SOC_DSP_TRIGGER_BESPOKE, SND_SOC_DSP_TRIGGER_BESPOKE}, +}; /* Digital audio interface glue - connects codec <--> CPU */ -static struct snd_soc_dai_link sdp4430_dai = { - .name = "TWL6040", - .stream_name = "TWL6040", - .cpu_dai_name ="omap-mcpdm-dai", - .codec_dai_name = "twl6040-hifi", - .platform_name = "omap-pcm-audio", - .codec_name = "twl6040-codec", - .init = sdp4430_twl6040_init, - .ops = &sdp4430_ops, +static struct snd_soc_dai_link sdp4430_dai[] = { + +/* + * Frontend DAIs - i.e. userspace visible interfaces (ALSA PCMs) + */ + + { + .name = "SDP4430 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 = "SDP4430 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 = "SDP4430 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 = "SDP4430 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 = "SDP4430 Vibra Playback", + .stream_name = "VIB-DL", + + /* ABE components - DMIC UL 2 */ + .cpu_dai_name = "Vibra", + .platform_name = "omap-pcm-audio", + + .dynamic = 1, /* BE is dynamic */ + .dsp_link = &fe_vib, + }, + { + .name = "SDP4430 MODEM", + .stream_name = "MODEM", + + /* ABE components - MODEM <-> McBSP2 */ + .cpu_dai_name = "MODEM", + .platform_name = "aess", + + .dynamic = 1, /* BE is dynamic */ + .dsp_link = &fe_modem, + .no_host_mode = SND_SOC_DAI_LINK_NO_HOST, + .ignore_suspend = 1, + }, + { + .name = "SDP4430 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, + }, + { + .name = "Legacy McBSP", + .stream_name = "Multimedia", + + /* ABE components - MCBSP2 - MM-EXT */ + .cpu_dai_name = "omap-mcbsp-dai.1", + .platform_name = "omap-pcm-audio", + + /* FM */ + .codec_dai_name = "FM Digital", + + .no_codec = 1, /* TODO: have a dummy CODEC */ + .ops = &sdp4430_mcbsp_ops, + }, + { + .name = "Legacy McPDM", + .stream_name = "Headset Playback", + + /* ABE components - DL1 */ + .cpu_dai_name = "mcpdm-dl", + .platform_name = "omap-pcm-audio", + + /* Phoenix - DL1 DAC */ + .codec_dai_name = "twl6040-dl1", + .codec_name = "twl6040-codec", + + .ops = &sdp4430_mcpdm_ops, + }, + +/* + * Backend DAIs - i.e. dynamically matched interfaces, invisible to userspace. + * Matched to above interfaces at runtime, based upon use case. + */ + + { + .name = OMAP_ABE_BE_PDM_DL1, + .stream_name = "HS Playback", + + /* ABE components - DL1 */ + .cpu_dai_name = "mcpdm-dl1", + .platform_name = "aess", + + /* Phoenix - DL1 DAC */ + .codec_dai_name = "twl6040-dl1", + .codec_name = "twl6040-codec", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .init = sdp4430_twl6040_init, + .ops = &sdp4430_mcpdm_ops, + .be_id = OMAP_ABE_DAI_PDM_DL1, + }, + { + .name = OMAP_ABE_BE_PDM_UL1, + .stream_name = "Analog Capture", + + /* ABE components - UL1 */ + .cpu_dai_name = "mcpdm-ul1", + .platform_name = "aess", + + /* Phoenix - UL ADC */ + .codec_dai_name = "twl6040-ul", + .codec_name = "twl6040-codec", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .ops = &sdp4430_mcpdm_ops, + .be_id = OMAP_ABE_DAI_PDM_UL, + }, + { + .name = OMAP_ABE_BE_PDM_DL2, + .stream_name = "HF Playback", + + /* ABE components - DL2 */ + .cpu_dai_name = "mcpdm-dl2", + .platform_name = "aess", + + /* Phoenix - DL2 DAC */ + .codec_dai_name = "twl6040-dl2", + .codec_name = "twl6040-codec", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .init = sdp4430_twl6040_dl2_init, + .ops = &sdp4430_mcpdm_ops, + .be_id = OMAP_ABE_DAI_PDM_DL2, + }, + { + .name = OMAP_ABE_BE_PDM_VIB, + .stream_name = "Vibra", + + /* ABE components - VIB1 DL */ + .cpu_dai_name = "mcpdm-vib", + .platform_name = "aess", + + /* Phoenix - PDM to PWM */ + .codec_dai_name = "twl6040-vib", + .codec_name = "twl6040-codec", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .ops = &sdp4430_mcpdm_ops, + .be_id = OMAP_ABE_DAI_PDM_VIB, + }, + { + .name = OMAP_ABE_BE_BT_VX, + .stream_name = "BT", + + /* ABE components - MCBSP1 - BT-VX */ + .cpu_dai_name = "omap-mcbsp-dai.0", + .platform_name = "aess", + + /* Bluetooth */ + .codec_dai_name = "Bluetooth", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .no_codec = 1, /* TODO: have a dummy CODEC */ + .be_hw_params_fixup = mcbsp_be_hw_params_fixup, + .ops = &sdp4430_mcbsp_ops, + .be_id = OMAP_ABE_DAI_BT_VX, + }, + { + .name = OMAP_ABE_BE_MM_EXT0, + .stream_name = "FM", + + /* ABE components - MCBSP2 - MM-EXT */ + .cpu_dai_name = "omap-mcbsp-dai.1", + .platform_name = "aess", + + /* FM */ + .codec_dai_name = "FM Digital", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .no_codec = 1, /* TODO: have a dummy CODEC */ + .be_hw_params_fixup = mcbsp_be_hw_params_fixup, + .ops = &sdp4430_mcbsp_ops, + .be_id = OMAP_ABE_DAI_MM_FM, + }, + { + .name = OMAP_ABE_BE_MM_EXT1, + .stream_name = "MODEM", + + /* ABE components - MCBSP2 - MM-EXT */ + .cpu_dai_name = "omap-mcbsp-dai.1", + .platform_name = "aess", + + /* MODEM */ + .codec_dai_name = "MODEM", + + .no_pcm = 1, /* don't create ALSA pcm for this */ + .no_codec = 1, /* TODO: have a dummy CODEC */ + .be_hw_params_fixup = mcbsp_be_hw_params_fixup, + .ops = &sdp4430_mcbsp_ops, + .be_id = OMAP_ABE_DAI_MODEM, + .ignore_suspend = 1, + }, }; /* Audio machine driver */ static struct snd_soc_card snd_soc_sdp4430 = { - .name = "SDP4430", - .dai_link = &sdp4430_dai, - .num_links = 1, + .driver_name = "OMAP4", + .long_name = "TI OMAP4 Board", + .dai_link = sdp4430_dai, + .num_links = ARRAY_SIZE(sdp4430_dai), }; static struct platform_device *sdp4430_snd_device; +struct i2c_adapter *adapter; static int __init sdp4430_soc_init(void) { int ret; - if (!machine_is_omap_4430sdp()) + if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda()) { + pr_debug("Not SDP4430 or PandaBoard!\n"); return -ENODEV; + } printk(KERN_INFO "SDP4430 SoC init\n"); + if (machine_is_omap_4430sdp()) + snd_soc_sdp4430.name = "SDP4430"; + else if (machine_is_omap4_panda()) + snd_soc_sdp4430.name = "Panda"; sdp4430_snd_device = platform_device_alloc("soc-audio", -1); if (!sdp4430_snd_device) { @@ -231,15 +738,15 @@ static int __init sdp4430_soc_init(void) return -ENOMEM; } + ret = snd_soc_register_dais(&sdp4430_snd_device->dev, dai, ARRAY_SIZE(dai)); + if (ret < 0) + goto err; platform_set_drvdata(sdp4430_snd_device, &snd_soc_sdp4430); ret = platform_device_add(sdp4430_snd_device); if (ret) goto err; - /* Codec starts in HP mode */ - twl6040_power_mode = 1; - return 0; err: diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index fab20a5..da28394 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -85,9 +85,11 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = { static u64 pxa2xx_pcm_dmamask = DMA_BIT_MASK(32); -static int pxa2xx_soc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; if (!card->dev->dma_mask) diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index ab3ccae..80c85fd 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c @@ -443,10 +443,11 @@ static void s6000_pcm_free(struct snd_pcm *pcm) static u64 s6000_pcm_dmamask = DMA_BIT_MASK(32); -static int s6000_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime) { - struct snd_soc_pcm_runtime *runtime = pcm->private_data; + struct snd_card *card = runtime->card->snd_card; + struct snd_soc_dai *dai = runtime->cpu_dai; + struct snd_pcm *pcm = runtime->pcm; struct s6000_pcm_dma_params *params; int res; diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 5cb3b88..9465588 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -425,9 +425,11 @@ static void dma_free_dma_buffers(struct snd_pcm *pcm) static u64 dma_mask = DMA_BIT_MASK(32); -static int dma_new(struct snd_card *card, - struct snd_soc_dai *dai, struct snd_pcm *pcm) +static int dma_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_card *card = rtd->card->snd_card; + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; int ret = 0; pr_debug("Entered %s\n", __func__); diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index c326d29..db74005 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -327,10 +327,10 @@ static void camelot_pcm_free(struct snd_pcm *pcm) snd_pcm_lib_preallocate_free_for_all(pcm); } -static int camelot_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_pcm *pcm = rtd->pcm; + /* dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel * in MMAP mode (i.e. aplay -M) */ diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 4a9da6b..339a1df 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1129,10 +1129,10 @@ static void fsi_pcm_free(struct snd_pcm *pcm) snd_pcm_lib_preallocate_free_for_all(pcm); } -static int fsi_pcm_new(struct snd_card *card, - struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int fsi_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_pcm *pcm = rtd->pcm; + /* * dont use SNDRV_DMA_TYPE_DEV, since it will oops the SH kernel * in MMAP mode (i.e. aplay -M) diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index a423bab..f8f6816 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -527,10 +527,11 @@ static snd_pcm_uframes_t siu_pcm_pointer_dma(struct snd_pcm_substream *ss) return bytes_to_frames(ss->runtime, ptr); } -static int siu_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int siu_pcm_new(struct snd_soc_pcm_runtime *rtd) { /* card->dev == socdev->dev, see snd_soc_new_pcms() */ + struct snd_card *card = rtd->card->snd_card; + struct snd_pcm *pcm = rtd->pcm; struct siu_info *info = siu_i2s_data; struct platform_device *pdev = to_platform_device(card->dev); int ret; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b194be0..70d3a22 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -37,6 +37,7 @@ #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-dsp.h> #include <sound/initval.h> #define CREATE_TRACE_POINTS @@ -44,7 +45,6 @@ #define NAME_SIZE 32 -static DEFINE_MUTEX(pcm_mutex); static DECLARE_WAIT_QUEUE_HEAD(soc_pm_waitq); #ifdef CONFIG_DEBUG_FS @@ -59,6 +59,7 @@ static LIST_HEAD(platform_list); static LIST_HEAD(codec_list); static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); +int soc_dsp_debugfs_add(struct snd_soc_pcm_runtime *rtd); /* * This is a timeout to do a DAPM powerdown after a stream is closed(). @@ -122,6 +123,24 @@ static int format_register_str(struct snd_soc_codec *codec, return 0; } +/* ASoC no host IO hardware. + * TODO: fine tune these values for all host less transfers. + */ +static const struct snd_pcm_hardware no_host_hardware = { + .info = SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_MMAP_VALID | + SNDRV_PCM_INFO_INTERLEAVED | + SNDRV_PCM_INFO_PAUSE | + SNDRV_PCM_INFO_RESUME, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S32_LE, + .period_bytes_min = PAGE_SIZE >> 2, + .period_bytes_max = PAGE_SIZE >> 1, + .periods_min = 2, + .periods_max = 4, + .buffer_bytes_max = PAGE_SIZE, +}; + /* codec register dump */ static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf, size_t count, loff_t pos) @@ -526,7 +545,7 @@ static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream) * then initialized and any private data can be allocated. This also calls * startup for the cpu DAI, platform, machine and codec DAI. */ -static int soc_pcm_open(struct snd_pcm_substream *substream) +int soc_pcm_open(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_pcm_runtime *runtime = substream->runtime; @@ -537,7 +556,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) struct snd_soc_dai_driver *codec_dai_drv = codec_dai->driver; int ret = 0; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); + + if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) + snd_soc_set_runtime_hwparams(substream, &no_host_hardware); /* startup the audio subsystem */ if (cpu_dai->driver->ops->startup) { @@ -574,6 +596,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) } } + /* DSP DAI links compat checks are different */ + if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) + goto dynamic; + /* Check that the codec and cpu DAIs are compatible */ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { runtime->hw.rate_min = @@ -657,6 +683,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) pr_debug("asoc: min rate %d max rate %d\n", runtime->hw.rate_min, runtime->hw.rate_max); +dynamic: if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { cpu_dai->playback_active++; codec_dai->playback_active++; @@ -667,7 +694,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) cpu_dai->active++; codec_dai->active++; rtd->codec->active++; - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return 0; config_err: @@ -686,7 +713,7 @@ platform_err: if (cpu_dai->driver->ops->shutdown) cpu_dai->driver->ops->shutdown(substream, cpu_dai); out: - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return ret; } @@ -701,7 +728,7 @@ static void close_delayed_work(struct work_struct *work) container_of(work, struct snd_soc_pcm_runtime, delayed_work.work); struct snd_soc_dai *codec_dai = rtd->codec_dai; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); pr_debug("pop wq checking: %s status: %s waiting: %s\n", codec_dai->driver->playback.stream_name, @@ -716,7 +743,7 @@ static void close_delayed_work(struct work_struct *work) SND_SOC_DAPM_STREAM_STOP); } - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); } /* @@ -724,7 +751,7 @@ static void close_delayed_work(struct work_struct *work) * freed here. The cpu DAI, codec DAI, machine and platform are also * shutdown. */ -static int soc_codec_close(struct snd_pcm_substream *substream) +int soc_pcm_close(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_platform *platform = rtd->platform; @@ -732,7 +759,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream) struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_codec *codec = rtd->codec; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { cpu_dai->playback_active--; @@ -777,7 +804,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream) SND_SOC_DAPM_STREAM_STOP); } - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return 0; } @@ -786,7 +813,7 @@ static int soc_codec_close(struct snd_pcm_substream *substream) * rate, etc. This function is non atomic and can be called multiple times, * it can refer to the runtime info. */ -static int soc_pcm_prepare(struct snd_pcm_substream *substream) +int soc_pcm_prepare(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_platform *platform = rtd->platform; @@ -794,7 +821,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) struct snd_soc_dai *codec_dai = rtd->codec_dai; int ret = 0; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) { ret = rtd->dai_link->ops->prepare(substream); @@ -847,7 +874,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) snd_soc_dai_digital_mute(codec_dai, 0); out: - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return ret; } @@ -856,7 +883,7 @@ out: * function can also be called multiple times and can allocate buffers * (using snd_pcm_lib_* ). It's non-atomic. */ -static int soc_pcm_hw_params(struct snd_pcm_substream *substream, +int soc_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -865,7 +892,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *codec_dai = rtd->codec_dai; int ret = 0; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) { ret = rtd->dai_link->ops->hw_params(substream, params); @@ -904,8 +931,21 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, rtd->rate = params_rate(params); + /* malloc a page for hostless IO. + * FIXME: rework with alsa-lib changes so that this malloc is not required. + */ + if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) { + substream->dma_buffer.dev.type = SNDRV_DMA_TYPE_DEV; + substream->dma_buffer.dev.dev = &rtd->dev; + substream->dma_buffer.dev.dev->coherent_dma_mask = ISA_DMA_THRESHOLD; + substream->dma_buffer.private_data = NULL; + + ret = snd_pcm_lib_malloc_pages(substream, PAGE_SIZE); + if (ret < 0) + goto platform_err; + } out: - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return ret; platform_err: @@ -920,14 +960,14 @@ codec_err: if (rtd->dai_link->ops && rtd->dai_link->ops->hw_free) rtd->dai_link->ops->hw_free(substream); - mutex_unlock(&pcm_mutex); + mutex_unlock(&rtd->pcm_mutex); return ret; } /* * Frees resources allocated by hw_params, can be called multiple times */ -static int soc_pcm_hw_free(struct snd_pcm_substream *substream) +int soc_pcm_hw_free(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_platform *platform = rtd->platform; @@ -935,7 +975,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_codec *codec = rtd->codec; - mutex_lock(&pcm_mutex); + mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); /* apply codec digital mute */ if (!codec->active) @@ -956,11 +996,13 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream) if (cpu_dai->driver->ops->hw_free) cpu_dai->driver->ops->hw_free(substream, cpu_dai); - mutex_unlock(&pcm_mutex); + if (rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) + snd_pcm_lib_free_pages(substream); + mutex_unlock(&rtd->pcm_mutex); return 0; } -static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) +int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_platform *platform = rtd->platform; @@ -988,12 +1030,40 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) return 0; } +int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream, int cmd) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_platform *platform = rtd->platform; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_dai *codec_dai = rtd->codec_dai; + int ret; + + if (codec_dai->driver->ops->bespoke_trigger) { + ret = codec_dai->driver->ops->bespoke_trigger(substream, cmd, codec_dai); + if (ret < 0) + return ret; + } + + if (platform->driver->bespoke_trigger) { + ret = platform->driver->bespoke_trigger(substream, cmd); + if (ret < 0) + return ret; + } + + if (cpu_dai->driver->ops->bespoke_trigger) { + ret = cpu_dai->driver->ops->bespoke_trigger(substream, cmd, cpu_dai); + if (ret < 0) + return ret; + } + return 0; +} + /* * soc level wrapper for pointer callback * If cpu_dai, codec_dai, platform driver has the delay callback, than * the runtime->delay will be updated accordingly. */ -static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) +snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_platform *platform = rtd->platform; @@ -1020,16 +1090,45 @@ static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) return offset; } -/* ASoC PCM operations */ -static struct snd_pcm_ops soc_pcm_ops = { - .open = soc_pcm_open, - .close = soc_codec_close, - .hw_params = soc_pcm_hw_params, - .hw_free = soc_pcm_hw_free, - .prepare = soc_pcm_prepare, - .trigger = soc_pcm_trigger, - .pointer = soc_pcm_pointer, -}; +static int soc_pcm_ioctl(struct snd_pcm_substream *substream, + unsigned int cmd, void *arg) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_platform *platform = rtd->platform; + + if (platform->driver->ops->ioctl) + return platform->driver->ops->ioctl(substream, cmd, arg); + return snd_pcm_lib_ioctl(substream, cmd, arg); +} + +struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, + const char *dai_link, int stream) +{ + int i; + + for (i = 0; i < card->num_links; i++) { + if (card->rtd[i].dai_link->no_pcm && + !strcmp(card->rtd[i].dai_link->name, dai_link)) + return card->rtd[i].pcm->streams[stream].substream; + } + dev_dbg(card->dev, "failed to find dai link %s\n", dai_link); + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_get_dai_substream); + +struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, + const char *dai_link) +{ + int i; + + for (i = 0; i < card->num_links; i++) { + if (!strcmp(card->rtd[i].dai_link->name, dai_link)) + return &card->rtd[i]; + } + dev_dbg(card->dev, "failed to find rtd %s\n", dai_link); + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); #ifdef CONFIG_PM_SLEEP /* powers down audio subsystem for suspend */ @@ -1060,16 +1159,22 @@ int snd_soc_suspend(struct device *dev) struct snd_soc_dai *dai = card->rtd[i].codec_dai; struct snd_soc_dai_driver *drv = dai->driver; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (drv->ops->digital_mute && dai->playback_active) - drv->ops->digital_mute(dai, 1); + if (card->rtd[i].dai_link->dynamic) + soc_dsp_be_digital_mute(&card->rtd[i], 1); + else { + if (drv->ops->digital_mute && dai->playback_active) + drv->ops->digital_mute(dai, 1); + } } /* suspend all pcms */ for (i = 0; i < card->num_rtd; i++) { - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; snd_pcm_suspend_all(card->rtd[i].pcm); @@ -1082,14 +1187,20 @@ int snd_soc_suspend(struct device *dev) struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; struct snd_soc_platform *platform = card->rtd[i].platform; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (cpu_dai->driver->suspend && !cpu_dai->driver->ac97_control) - cpu_dai->driver->suspend(cpu_dai); - if (platform->driver->suspend && !platform->suspended) { - platform->driver->suspend(cpu_dai); - platform->suspended = 1; + if (card->rtd[i].dai_link->dynamic) { + soc_dsp_be_cpu_dai_suspend(&card->rtd[i]); + soc_dsp_be_platform_suspend(&card->rtd[i]); + } else { + if (cpu_dai->driver->suspend && !cpu_dai->driver->ac97_control) + cpu_dai->driver->suspend(cpu_dai); + if (platform->driver->suspend && !platform->suspended) { + platform->driver->suspend(cpu_dai); + platform->suspended = 1; + } } } @@ -1102,7 +1213,8 @@ int snd_soc_suspend(struct device *dev) for (i = 0; i < card->num_rtd; i++) { struct snd_soc_dai_driver *driver = card->rtd[i].codec_dai->driver; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; if (driver->playback.stream_name != NULL) @@ -1135,11 +1247,15 @@ int snd_soc_suspend(struct device *dev) for (i = 0; i < card->num_rtd; i++) { struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (cpu_dai->driver->suspend && cpu_dai->driver->ac97_control) - cpu_dai->driver->suspend(cpu_dai); + if (card->rtd[i].dai_link->dynamic) + soc_dsp_be_ac97_cpu_dai_suspend(&card->rtd[i]); + else + if (cpu_dai->driver->suspend && cpu_dai->driver->ac97_control) + cpu_dai->driver->suspend(cpu_dai); } if (card->suspend_post) @@ -1175,11 +1291,15 @@ static void soc_resume_deferred(struct work_struct *work) for (i = 0; i < card->num_rtd; i++) { struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (cpu_dai->driver->resume && cpu_dai->driver->ac97_control) - cpu_dai->driver->resume(cpu_dai); + if (card->rtd[i].dai_link->dynamic) + soc_dsp_be_ac97_cpu_dai_resume(&card->rtd[i]); + else + if (cpu_dai->driver->resume && cpu_dai->driver->ac97_control) + cpu_dai->driver->resume(cpu_dai); } list_for_each_entry(codec, &card->codec_dev_list, card_list) { @@ -1204,7 +1324,8 @@ static void soc_resume_deferred(struct work_struct *work) for (i = 0; i < card->num_rtd; i++) { struct snd_soc_dai_driver *driver = card->rtd[i].codec_dai->driver; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; if (driver->playback.stream_name != NULL) @@ -1221,25 +1342,36 @@ static void soc_resume_deferred(struct work_struct *work) struct snd_soc_dai *dai = card->rtd[i].codec_dai; struct snd_soc_dai_driver *drv = dai->driver; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (drv->ops->digital_mute && dai->playback_active) - drv->ops->digital_mute(dai, 0); + if (card->rtd[i].dai_link->dynamic) + soc_dsp_be_digital_mute(&card->rtd[i], 0); + else { + if (drv->ops->digital_mute && dai->playback_active) + drv->ops->digital_mute(dai, 0); + } } for (i = 0; i < card->num_rtd; i++) { struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai; struct snd_soc_platform *platform = card->rtd[i].platform; - if (card->rtd[i].dai_link->ignore_suspend) + if (card->rtd[i].dai_link->ignore_suspend || + card->rtd[i].dai_link->no_pcm) continue; - if (cpu_dai->driver->resume && !cpu_dai->driver->ac97_control) - cpu_dai->driver->resume(cpu_dai); - if (platform->driver->resume && platform->suspended) { - platform->driver->resume(cpu_dai); - platform->suspended = 0; + if (card->rtd[i].dai_link->dynamic) { + soc_dsp_be_cpu_dai_resume(&card->rtd[i]); + soc_dsp_be_platform_resume(&card->rtd[i]); + } else { + if (cpu_dai->driver->resume && !cpu_dai->driver->ac97_control) + cpu_dai->driver->resume(cpu_dai); + if (platform->driver->resume && platform->suspended) { + platform->driver->resume(cpu_dai); + platform->suspended = 0; + } } } @@ -1283,8 +1415,30 @@ EXPORT_SYMBOL_GPL(snd_soc_resume); #define snd_soc_resume NULL #endif +#define NULL_FORMATS \ + (SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_U16 |\ + SNDRV_PCM_FMTBIT_S24 | SNDRV_PCM_FMTBIT_U24 |\ + SNDRV_PCM_FMTBIT_S32 | SNDRV_PCM_FMTBIT_U32) + static struct snd_soc_dai_ops null_dai_ops = { }; +static struct snd_soc_dai_driver null_codec_dai_drv = { + .name = "null-codec-dai", + .ops = &null_dai_ops, + .capture = { + .channels_min = 1 , + .channels_max = 16, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = NULL_FORMATS, + }, + .playback = { + .channels_min = 1 , + .channels_max = 16, + .rates = SNDRV_PCM_RATE_CONTINUOUS, + .formats = NULL_FORMATS, + }, +}; +static struct snd_soc_codec_driver null_codec_drv = {}; static int soc_bind_dai_link(struct snd_soc_card *card, int num) { @@ -1326,7 +1480,7 @@ find_codec: /* CODEC found, so find CODEC DAI from registered DAIs from this CODEC*/ list_for_each_entry(codec_dai, &dai_list, list) { - if (codec->dev == codec_dai->dev && + if ((codec->dev == codec_dai->dev || codec->driver == &null_codec_drv) && !strcmp(codec_dai->name, dai_link->codec_dai_name)) { rtd->codec_dai = codec_dai; goto find_platform; @@ -1393,7 +1547,7 @@ static void soc_remove_codec(struct snd_soc_codec *codec) module_put(codec->dev->driver->owner); } -static void soc_remove_dai_link(struct snd_soc_card *card, int num) +static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) { struct snd_soc_pcm_runtime *rtd = &card->rtd[num]; struct snd_soc_codec *codec = rtd->codec; @@ -1410,7 +1564,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num) } /* remove the CODEC DAI */ - if (codec_dai && codec_dai->probed) { + if (codec_dai && codec_dai->probed && + codec_dai->driver->remove_order == order) { if (codec_dai->driver->remove) { err = codec_dai->driver->remove(codec_dai); if (err < 0) @@ -1418,10 +1573,12 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num) } codec_dai->probed = 0; list_del(&codec_dai->card_list); + module_put(codec_dai->dev->driver->owner); } /* remove the platform */ - if (platform && platform->probed) { + if (platform && platform->probed && + platform->driver->remove_order == order) { if (platform->driver->remove) { err = platform->driver->remove(platform); if (err < 0) @@ -1433,11 +1590,13 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num) } /* remove the CODEC */ - if (codec && codec->probed) + if (codec && codec->probed && + codec->driver->remove_order == order) soc_remove_codec(codec); /* remove the cpu_dai */ - if (cpu_dai && cpu_dai->probed) { + if (cpu_dai && cpu_dai->probed && + cpu_dai->driver->remove_order == order) { if (cpu_dai->driver->remove) { err = cpu_dai->driver->remove(cpu_dai); if (err < 0) @@ -1451,11 +1610,13 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num) static void soc_remove_dai_links(struct snd_soc_card *card) { - int i; - - for (i = 0; i < card->num_rtd; i++) - soc_remove_dai_link(card, i); + int dai, order; + for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST; + order++) { + for (dai = 0; dai < card->num_rtd; dai++) + soc_remove_dai_link(card, dai, order); + } card->num_rtd = 0; } @@ -1572,6 +1733,11 @@ static int soc_post_component_init(struct snd_soc_card *card, rtd->dev.parent = card->dev; rtd->dev.release = rtd_release; rtd->dev.init_name = name; + mutex_init(&rtd->pcm_mutex); + INIT_LIST_HEAD(&rtd->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients); + INIT_LIST_HEAD(&rtd->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients); + INIT_LIST_HEAD(&rtd->dsp[SNDRV_PCM_STREAM_PLAYBACK].fe_clients); + INIT_LIST_HEAD(&rtd->dsp[SNDRV_PCM_STREAM_CAPTURE].fe_clients); ret = device_register(&rtd->dev); if (ret < 0) { dev_err(card->dev, @@ -1593,10 +1759,21 @@ static int soc_post_component_init(struct snd_soc_card *card, dev_err(codec->dev, "asoc: failed to add codec sysfs files: %d\n", ret); +#ifdef CONFIG_DEBUG_FS + /* add DSP sysfs entries */ + if (!dai_link->dynamic) + goto out; + + ret = soc_dsp_debugfs_add(rtd); + if (ret < 0) + dev_err(&rtd->dev, "asoc: failed to add dsp sysfs entries: %d\n", ret); + +out: +#endif return 0; } -static int soc_probe_dai_link(struct snd_soc_card *card, int num) +static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order) { struct snd_soc_dai_link *dai_link = &card->dai_link[num]; struct snd_soc_pcm_runtime *rtd = &card->rtd[num]; @@ -1605,19 +1782,22 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) struct snd_soc_dai *codec_dai = rtd->codec_dai, *cpu_dai = rtd->cpu_dai; int ret; - dev_dbg(card->dev, "probe %s dai link %d\n", card->name, num); + dev_dbg(card->dev, "probe %s dai link %d late %d\n", + card->name, num, order); /* config components */ codec_dai->codec = codec; cpu_dai->platform = platform; codec_dai->card = card; cpu_dai->card = card; + codec->dapm.card = platform->dapm.card = card; /* set default power off timeout */ rtd->pmdown_time = pmdown_time; /* probe the cpu_dai */ - if (!cpu_dai->probed) { + if (!cpu_dai->probed && + cpu_dai->driver->probe_order == order) { if (!try_module_get(cpu_dai->dev->driver->owner)) return -ENODEV; @@ -1636,17 +1816,20 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) } /* probe the CODEC */ - if (!codec->probed) { + if (!codec->probed && + codec->driver->probe_order == order) { ret = soc_probe_codec(card, codec); if (ret < 0) return ret; } /* probe the platform */ - if (!platform->probed) { + if (!platform->probed && + platform->driver->probe_order == order) { if (!try_module_get(platform->dev->driver->owner)) return -ENODEV; + platform->card = card; if (platform->driver->probe) { ret = platform->driver->probe(platform); if (ret < 0) { @@ -1662,12 +1845,15 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) } /* probe the CODEC DAI */ - if (!codec_dai->probed) { + if (!codec_dai->probed && codec_dai->driver->probe_order == order) { + if (!try_module_get(codec_dai->dev->driver->owner)) + return -ENODEV; if (codec_dai->driver->probe) { ret = codec_dai->driver->probe(codec_dai); if (ret < 0) { printk(KERN_ERR "asoc: failed to probe CODEC DAI %s\n", codec_dai->name); + module_put(codec_dai->dev->driver->owner); return ret; } } @@ -1677,6 +1863,10 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num) list_add(&codec_dai->card_list, &card->dai_dev_list); } + /* complete DAI probe during last probe */ + if (order != SND_SOC_COMP_ORDER_LAST) + return 0; + /* DAPM dai link stream work */ INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work); @@ -1817,7 +2007,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) struct snd_soc_codec *codec; struct snd_soc_codec_conf *codec_conf; enum snd_soc_compress_type compress_type; - int ret, i; + int ret, i, order; mutex_lock(&card->mutex); @@ -1895,12 +2085,16 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) goto card_probe_error; } - for (i = 0; i < card->num_links; i++) { - ret = soc_probe_dai_link(card, i); - if (ret < 0) { - pr_err("asoc: failed to instantiate card %s: %d\n", + /* early DAI link probe */ + for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST; + order++) { + for (i = 0; i < card->num_links; i++) { + ret = soc_probe_dai_link(card, i, order); + if (ret < 0) { + pr_err("asoc: failed to instantiate card %s: %d\n", card->name, ret); - goto probe_dai_err; + goto probe_dai_err; + } } } @@ -2103,6 +2297,7 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) struct snd_soc_platform *platform = rtd->platform; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_pcm_substream *substream[2]; struct snd_pcm *pcm; char new_name[64]; int ret = 0, playback = 0, capture = 0; @@ -2111,10 +2306,15 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) snprintf(new_name, sizeof(new_name), "%s %s-%d", rtd->dai_link->stream_name, codec_dai->name, num); - if (codec_dai->driver->playback.channels_min) - playback = 1; - if (codec_dai->driver->capture.channels_min) - capture = 1; + if (rtd->dai_link->dynamic) { + playback = rtd->dai_link->dsp_link->playback; + capture = rtd->dai_link->dsp_link->capture; + } else { + if (codec_dai->driver->playback.channels_min) + playback = 1; + if (codec_dai->driver->capture.channels_min) + capture = 1; + } dev_dbg(rtd->card->dev, "registered pcm #%d %s\n",num,new_name); ret = snd_pcm_new(rtd->card->snd_card, new_name, @@ -2126,25 +2326,67 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) rtd->pcm = pcm; pcm->private_data = rtd; + + substream[SNDRV_PCM_STREAM_PLAYBACK] = + pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; + substream[SNDRV_PCM_STREAM_CAPTURE] = + pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; + + if (rtd->dai_link->no_pcm) { + if (playback) + substream[SNDRV_PCM_STREAM_PLAYBACK]->private_data = rtd; + if (capture) + substream[SNDRV_PCM_STREAM_CAPTURE]->private_data = rtd; + goto out; + } + + /* setup any hostless PCMs - i.e. no host IO is performed */ + if (rtd->dai_link->no_host_mode) { + substream[SNDRV_PCM_STREAM_PLAYBACK]->hw_no_buffer = 1; + substream[SNDRV_PCM_STREAM_CAPTURE]->hw_no_buffer = 1; + snd_soc_set_runtime_hwparams(substream[SNDRV_PCM_STREAM_PLAYBACK], + &no_host_hardware); + snd_soc_set_runtime_hwparams(substream[SNDRV_PCM_STREAM_CAPTURE], + &no_host_hardware); + } + + /* ASoC PCM operations */ + if (rtd->dai_link->dynamic) { + rtd->ops.open = soc_dsp_fe_dai_open; + rtd->ops.hw_params = soc_dsp_fe_dai_hw_params; + rtd->ops.prepare = soc_dsp_fe_dai_prepare; + rtd->ops.trigger = soc_dsp_fe_dai_trigger; + rtd->ops.hw_free = soc_dsp_fe_dai_hw_free; + rtd->ops.close = soc_dsp_fe_dai_close; + rtd->ops.pointer = soc_pcm_pointer; + rtd->ops.ioctl = soc_pcm_ioctl; + } else { + rtd->ops.open = soc_pcm_open; + rtd->ops.hw_params = soc_pcm_hw_params; + rtd->ops.prepare = soc_pcm_prepare; + rtd->ops.trigger = soc_pcm_trigger; + rtd->ops.hw_free = soc_pcm_hw_free; + rtd->ops.close = soc_pcm_close; + rtd->ops.pointer = soc_pcm_pointer; + rtd->ops.ioctl = soc_pcm_ioctl; + } + if (platform->driver->ops) { - soc_pcm_ops.mmap = platform->driver->ops->mmap; - soc_pcm_ops.pointer = platform->driver->ops->pointer; - soc_pcm_ops.ioctl = platform->driver->ops->ioctl; - soc_pcm_ops.copy = platform->driver->ops->copy; - soc_pcm_ops.silence = platform->driver->ops->silence; - soc_pcm_ops.ack = platform->driver->ops->ack; - soc_pcm_ops.page = platform->driver->ops->page; + rtd->ops.ack = platform->driver->ops->ack; + rtd->ops.copy = platform->driver->ops->copy; + rtd->ops.silence = platform->driver->ops->silence; + rtd->ops.page = platform->driver->ops->page; + rtd->ops.mmap = platform->driver->ops->mmap; } if (playback) - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &soc_pcm_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &rtd->ops); if (capture) - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &soc_pcm_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); if (platform->driver->pcm_new) { - ret = platform->driver->pcm_new(rtd->card->snd_card, - codec_dai, pcm); + ret = platform->driver->pcm_new(rtd); if (ret < 0) { pr_err("asoc: platform pcm constructor failed\n"); return ret; @@ -2152,6 +2394,7 @@ static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) } pcm->private_free = platform->driver->pcm_free; +out: printk(KERN_INFO "asoc: %s <-> %s mapping ok\n", codec_dai->name, cpu_dai->name); return ret; @@ -2175,6 +2418,28 @@ int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, } EXPORT_SYMBOL_GPL(snd_soc_codec_volatile_register); +unsigned int snd_soc_platform_read(struct snd_soc_platform *platform, + unsigned int reg) +{ + unsigned int ret; + + ret = platform->driver->read(platform, reg); + dev_dbg(platform->dev, "read %x => %x\n", reg, ret); + trace_snd_soc_preg_read(platform, reg, ret); + + return ret; +} +EXPORT_SYMBOL_GPL(snd_soc_platform_read); + +unsigned int snd_soc_platform_write(struct snd_soc_platform *platform, + unsigned int reg, unsigned int val) +{ + dev_dbg(platform->dev, "write %x = %x\n", reg, val); + trace_snd_soc_preg_write(platform, reg, val); + return platform->driver->write(platform, reg, val); +} +EXPORT_SYMBOL_GPL(snd_soc_platform_write); + /** * snd_soc_codec_readable_register: Report if a register is readable. * @@ -2397,6 +2662,8 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, const struct snd_pcm_hardware *hw) { struct snd_pcm_runtime *runtime = substream->runtime; + if (!runtime) + return 0; runtime->hw.info = hw->info; runtime->hw.formats = hw->formats; runtime->hw.period_bytes_min = hw->period_bytes_min; @@ -2490,6 +2757,36 @@ int snd_soc_add_controls(struct snd_soc_codec *codec, EXPORT_SYMBOL_GPL(snd_soc_add_controls); /** + * snd_soc_add_platform_controls - add an array of controls to a platform. + * Convienience function to add a list of controls. + * + * @platform: platform to add controls to + * @controls: array of controls to add + * @num_controls: number of elements in the array + * + * Return 0 for success, else error. + */ +int snd_soc_add_platform_controls(struct snd_soc_platform *platform, + const struct snd_kcontrol_new *controls, int num_controls) +{ + struct snd_card *card = platform->card->snd_card; + int err, i; + + for (i = 0; i < num_controls; i++) { + const struct snd_kcontrol_new *control = &controls[i]; + err = snd_ctl_add(card, snd_soc_cnew(control, platform, + control->name, NULL)); + if (err < 0) { + dev_err(platform->dev, "Failed to add %s %d\n",control->name, err); + return err; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(snd_soc_add_platform_controls); + +/** * snd_soc_info_enum_double - enumerated double mixer info callback * @kcontrol: mixer control * @uinfo: control element information @@ -2511,7 +2808,8 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, if (uinfo->value.enumerated.item > e->max - 1) uinfo->value.enumerated.item = e->max - 1; strcpy(uinfo->value.enumerated.name, - e->texts[uinfo->value.enumerated.item]); + snd_soc_get_enum_text(e, uinfo->value.enumerated.item)); + return 0; } EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); @@ -2675,7 +2973,7 @@ int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, if (uinfo->value.enumerated.item > e->max - 1) uinfo->value.enumerated.item = e->max - 1; strcpy(uinfo->value.enumerated.name, - e->texts[uinfo->value.enumerated.item]); + snd_soc_get_enum_text(e, uinfo->value.enumerated.item)); return 0; } EXPORT_SYMBOL_GPL(snd_soc_info_enum_ext); @@ -3356,6 +3654,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_digital_mute); int snd_soc_register_card(struct snd_soc_card *card) { int i; + int ret = 0; if (!card->name || !card->dev) return -EINVAL; @@ -3373,12 +3672,42 @@ int snd_soc_register_card(struct snd_soc_card *card) return -ENOMEM; card->rtd_aux = &card->rtd[card->num_links]; - for (i = 0; i < card->num_links; i++) + for (i = 0; i < card->num_links; i++) { card->rtd[i].dai_link = &card->dai_link[i]; + if (card->rtd[i].dai_link->dynamic) { + + card->rtd[i].dai_link->codec_name = "null-codec"; + card->rtd[i].dai_link->codec_dai_name = "null-codec-dai"; + + ret = snd_soc_register_codec(card->dev, &null_codec_drv, + &null_codec_dai_drv, 1); + if (ret < 0) { + printk(KERN_ERR "%s: failed to register dynamic DAI link %d\n", + __func__, ret); + goto out; + } + + continue; + } + if (card->rtd[i].dai_link->no_codec) { + card->rtd[i].dai_link->codec_name = "null-codec"; + + ret = snd_soc_register_codec(card->dev, &null_codec_drv, + &null_codec_dai_drv, 1); + if (ret < 0) { + printk(KERN_ERR "%s: failed to register dynamic DAI link %d\n", + __func__, ret); + goto out; + } + continue; + } + } INIT_LIST_HEAD(&card->list); card->instantiated = 0; mutex_init(&card->mutex); + mutex_init(&card->dapm_mutex); + mutex_init(&card->dsp_mutex); mutex_lock(&client_mutex); list_add(&card->list, &card_list); @@ -3387,7 +3716,8 @@ int snd_soc_register_card(struct snd_soc_card *card) dev_dbg(card->dev, "Registered card '%s'\n", card->name); - return 0; +out: + return ret; } EXPORT_SYMBOL_GPL(snd_soc_register_card); @@ -3632,7 +3962,10 @@ int snd_soc_register_platform(struct device *dev, } platform->dev = dev; + platform->dapm.platform = platform; platform->driver = platform_drv; + platform->dapm.dev = dev; + platform->dapm.stream_event = platform_drv->stream_event; mutex_lock(&client_mutex); list_add(&platform->list, &platform_list); @@ -3725,7 +4058,10 @@ int snd_soc_register_codec(struct device *dev, return -ENOMEM; /* create CODEC component name */ - codec->name = fmt_single_name(dev, &codec->id); + if (codec_drv == &null_codec_drv) + codec->name = kstrdup("null-codec", GFP_KERNEL); + else + codec->name = fmt_single_name(dev, &codec->id); if (codec->name == NULL) { kfree(codec); return -ENOMEM; @@ -3745,6 +4081,7 @@ int snd_soc_register_codec(struct device *dev, codec->dapm.dev = dev; codec->dapm.codec = codec; codec->dapm.seq_notifier = codec_drv->seq_notifier; + codec->dapm.stream_event = codec_drv->stream_event; codec->dev = dev; codec->driver = codec_drv; codec->num_dai = num_dai; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 32ab7fc..6fb473f 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -48,6 +48,10 @@ #include <trace/events/asoc.h> +#define PATH_MAX_HOPS 16 + +int soc_dsp_runtime_update(struct snd_soc_dapm_widget *); + /* dapm power sequences - make this per codec in the future */ static int dapm_up_seq[] = { [snd_soc_dapm_pre] = 0, @@ -124,6 +128,390 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget( return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); } +static inline struct snd_card *dapm_get_card(struct snd_soc_dapm_context *dapm) +{ + if (dapm->codec) + return dapm->codec->card->snd_card; + else if (dapm->platform) + return dapm->platform->card->snd_card; + else + BUG(); +} + +static inline struct snd_soc_card *dapm_get_soc_card( + struct snd_soc_dapm_context *dapm) +{ + if (dapm->codec) + return dapm->codec->card; + else if (dapm->platform) + return dapm->platform->card; + else + BUG(); +} + +static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) +{ + if (w->codec) + return snd_soc_read(w->codec, reg); + else if (w->platform) + return snd_soc_platform_read(w->platform, reg); + return 0; +} + +static int soc_widget_write(struct snd_soc_dapm_widget *w,int reg, int val) +{ + if (w->codec) + return snd_soc_write(w->codec, reg, val); + else if (w->platform) + return snd_soc_platform_write(w->platform, reg, val); + return 0; +} + +int soc_widget_update_bits(struct snd_soc_dapm_widget *w, unsigned short reg, + unsigned int mask, unsigned int value) +{ + int change; + unsigned int old, new; + + old = soc_widget_read(w, reg); + new = (old & ~mask) | value; + change = old != new; + if (change) + soc_widget_write(w, reg, new); + + return change; +} + +int soc_widget_test_bits(struct snd_soc_dapm_widget *w, unsigned short reg, + unsigned int mask, unsigned int value) +{ + int change; + unsigned int old, new; + + old = soc_widget_read(w, reg); + new = (old & ~mask) | value; + change = old != new; + + return change; +} + +/* reset 'walked' bit for each dapm path */ +static inline void dapm_clear_walk(struct snd_soc_dapm_context *dapm) +{ + struct snd_soc_dapm_path *p; + + list_for_each_entry(p, &dapm->card->paths, list) + p->walked = 0; +} + +static void dapm_clear_paths(struct snd_soc_dapm_context *dapm) +{ + struct snd_soc_dapm_path *p; + struct snd_soc_dapm_widget *w; + struct list_head *l; + + list_for_each(l, &dapm->card->paths) { + p = list_entry(l, struct snd_soc_dapm_path, list); + p->length = 0; + } + list_for_each(l, &dapm->card->widgets) { + w = list_entry(l, struct snd_soc_dapm_widget, list); + w->hops = 0; + } + dapm_clear_walk(dapm); +} + +static int dapm_add_unique_widget(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget_list **list, struct snd_soc_dapm_widget *w) +{ + struct snd_soc_dapm_widget_list *wlist; + int wlistsize, wlistentries, i; + + /* is the list empty ? */ + if (*list == NULL) { + + wlistsize = sizeof(struct snd_soc_dapm_widget_list) + + sizeof(struct snd_soc_dapm_widget *); + *list = kzalloc(wlistsize, GFP_KERNEL); + if (*list == NULL) { + dev_err(dapm->dev, "can't allocate widget list for %s\n", w->name); + return -ENOMEM; + } + } else { + + wlist = *list; + /* is this widget already in the list */ + for (i = 0; i < wlist->num_widgets; i++) { + if (wlist->widgets[i] == w) + return 0; + } + + wlistentries = wlist->num_widgets + 1; + wlistsize = sizeof(struct snd_soc_dapm_widget_list) + + wlistentries * sizeof(struct snd_soc_dapm_widget *); + *list = krealloc(wlist, wlistsize, GFP_KERNEL); + if (*list == NULL) { + dev_err(dapm->dev, "can't allocate widget list for %s\n", w->name); + return -ENOMEM; + } + } + wlist = *list; + + /* insert the widget */ + dev_dbg(dapm->dev, "added %s in widget list pos %d\n", + w->name, wlist->num_widgets); + wlist->widgets[wlist->num_widgets] = w; + wlist->num_widgets++; + return 1; +} + +static int is_output_widget_ep(struct snd_soc_dapm_widget *widget) +{ + switch (widget->id) { + case snd_soc_dapm_adc: + case snd_soc_dapm_aif_out: + return 1; + case snd_soc_dapm_output: + if (widget->connected && !widget->ext) + return 1; + else + return 0; + case snd_soc_dapm_hp: + case snd_soc_dapm_spk: + case snd_soc_dapm_line: + return !list_empty(&widget->sources); + default: + return 0; + } +} + +static int is_input_widget_ep(struct snd_soc_dapm_widget *widget) +{ + switch (widget->id) { + case snd_soc_dapm_dac: + case snd_soc_dapm_aif_in: + return 1; + case snd_soc_dapm_input: + if (widget->connected && !widget->ext) + return 1; + else + return 0; + case snd_soc_dapm_mic: + return !list_empty(&widget->sources); + default: + return 0; + } +} + +/* + * find all the paths between source and sink + */ +static int dapm_find_playback_paths(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *root, + struct snd_soc_dapm_widget_list **list, int hops) +{ + struct list_head *lp; + struct snd_soc_dapm_path *path; + int dist = 0; + + if (hops > PATH_MAX_HOPS) + return 0; + + if (is_output_widget_ep(root) && hops != 1) { + dev_dbg(dapm->dev," ! %d: valid playback route found\n", hops); + dapm->num_valid_paths++; + return 1; + } + + if (root->hops && root->hops <= hops) + return 0; + root->hops = hops; + + /* check all the output paths on this source widget by walking + * from source to sink */ + list_for_each(lp, &root->sinks) { + path = list_entry(lp, struct snd_soc_dapm_path, list_source); + + dev_dbg(dapm->dev," %c %d: %s -> %s -> %s\n", + path->connect ? '*' : ' ', hops, + root->name, path->name, path->sink->name); + + /* been here before ? */ + if (path->length && path->length <= hops) + continue; + + /* check down the next path if connected */ + if (path->sink && path->connect && + dapm_find_playback_paths(dapm, path->sink, list, hops + 1)) { + path->length = hops; + + /* add widget to list */ + dapm_add_unique_widget(dapm, list, path->sink); + + if (!dist || dist > path->length) + dist = path->length; + } + } + + return dist; +} + +static int dapm_find_capture_paths(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *root, + struct snd_soc_dapm_widget_list **list, int hops) +{ + struct list_head *lp; + struct snd_soc_dapm_path *path; + int dist = 0; + + if (hops > PATH_MAX_HOPS) + return 0; + + if (is_input_widget_ep(root) && hops != 1) { + dev_dbg(dapm->dev," ! %d: valid capture route found\n", hops); + dapm->num_valid_paths++; + return 1; + } + + if (root->hops && root->hops <= hops) + return 0; + root->hops = hops; + + /* check all the output paths on this source widget by walking from + * sink to source */ + list_for_each(lp, &root->sources) { + path = list_entry(lp, struct snd_soc_dapm_path, list_sink); + + dev_dbg(dapm->dev," %c %d: %s <- %s <- %s\n", + path->connect ? '*' : ' ', hops, + root->name, path->name, path->source->name); + + /* been here before ? */ + if (path->length && path->length <= hops) + continue; + + /* check down the next path if connected */ + if (path->source && path->connect && + dapm_find_capture_paths(dapm, path->source, list, hops + 1)) { + path->length = hops; + + /* add widget to list */ + dapm_add_unique_widget(dapm, list, path->source); + + if (!dist || dist > path->length) + dist = path->length; + } + } + + return dist; +} + +/* + * traverse the tree from sink to source via the shortest path + */ +static int dapm_get_playback_paths(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *root, + struct snd_soc_dapm_widget_list **list) +{ + dev_dbg(dapm->dev, "Playback: checking paths from %s\n",root->name); + dapm_find_playback_paths(dapm, root, list, 1); + return dapm->num_valid_paths; +} + +static int dapm_get_capture_paths(struct snd_soc_dapm_context *dapm, + struct snd_soc_dapm_widget *root, + struct snd_soc_dapm_widget_list **list) +{ + dev_dbg(dapm->dev, "Capture: checking paths to %s\n", root->name); + dapm_find_capture_paths(dapm, root, list, 1); + return dapm->num_valid_paths; +} + +/** + * snd_soc_dapm_get_connected_widgets_type - query audio path and it's widgets. + * @dapm: the dapm context. + * @stream_name: stream name. + * @list: list of active widgets for this stream. + * @stream: stream direction. + * @type: Initial widget type. + * + * Queries DAPM graph as to whether an valid audio stream path exists for + * the DAPM stream and initial widget type specified. This takes into account + * current mixer and mux kcontrol settings. Creates list of valid widgets. + * + * Returns the number of valid paths or negative error. + */ +int snd_soc_dapm_get_connected_widgets_type(struct snd_soc_dapm_context *dapm, + const char *stream_name, struct snd_soc_dapm_widget_list **list, + int stream, enum snd_soc_dapm_type type) +{ + struct snd_soc_dapm_widget *w; + int paths; + + /* get stream root widget AIF, DAC or ADC from stream string and direction */ + list_for_each_entry(w, &dapm->card->widgets, list) { + + if (!w->sname) + continue; + + if (w->id != type) + continue; + + if (strstr(w->sname, stream_name)) + goto found; + } + dev_err(dapm->dev, "root widget not found\n"); + return 0; + +found: + dapm->num_valid_paths = 0; + *list = NULL; + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + paths = dapm_get_playback_paths(dapm, w, list); + else + paths = dapm_get_capture_paths(dapm, w, list); + + dapm_clear_paths(dapm); + return paths; +} +/** + * snd_soc_dapm_get_connected_widgets_name - query audio path and it's widgets. + * @dapm: the dapm context. + * @name: initial widget name. + * @list: list of active widgets for this stream. + * @stream: stream direction. + * + * Queries DAPM graph as to whether an valid audio stream path exists for + * the initial widget specified by name. This takes into account + * current mixer and mux kcontrol settings. Creates list of valid widgets. + * + * Returns the number of valid paths or negative error. + */ +int snd_soc_dapm_get_connected_widgets_name(struct snd_soc_dapm_context *dapm, + const char *name, struct snd_soc_dapm_widget_list **list, int stream) +{ + struct snd_soc_dapm_widget *w; + int paths; + + /* get stream root widget AIF, DAC or ADC from stream string and direction */ + list_for_each_entry(w, &dapm->card->widgets, list) { + + if (strstr(w->name, name)) + goto found; + } + dev_err(dapm->dev, "root widget %s not found\n", name); + return 0; + +found: + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + paths = dapm_get_playback_paths(dapm, w, list); + else + paths = dapm_get_capture_paths(dapm, w, list); + + dapm_clear_paths(dapm); + return paths; +} + /** * snd_soc_dapm_set_bias_level - set the bias level for the system * @dapm: DAPM context @@ -194,7 +582,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, unsigned int mask = (1 << fls(max)) - 1; unsigned int invert = mc->invert; - val = snd_soc_read(w->codec, reg); + val = soc_widget_read(w, reg); val = (val >> shift) & mask; if ((invert && !val) || (!invert && val)) @@ -210,12 +598,12 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, for (bitmask = 1; bitmask < e->max; bitmask <<= 1) ; - val = snd_soc_read(w->codec, e->reg); + val = soc_widget_read(w, e->reg); item = (val >> e->shift_l) & (bitmask - 1); p->connect = 0; for (i = 0; i < e->max; i++) { - if (!(strcmp(p->name, e->texts[i])) && item == i) + if (!(strcmp(p->name, snd_soc_get_enum_text(e, i))) && item == i) p->connect = 1; } } @@ -231,7 +619,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, * that the default mux choice (the first) will be * correctly powered up during initialization. */ - if (!strcmp(p->name, e->texts[0])) + if (!strcmp(p->name, snd_soc_get_enum_text(e, 0))) p->connect = 1; } break; @@ -240,7 +628,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, w->kcontrol_news[i].private_value; int val, item; - val = snd_soc_read(w->codec, e->reg); + val = soc_widget_read(w, e->reg); val = (val >> e->shift_l) & e->mask; for (item = 0; item < e->max; item++) { if (val == e->values[item]) @@ -249,7 +637,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, p->connect = 0; for (i = 0; i < e->max; i++) { - if (!(strcmp(p->name, e->texts[i])) && item == i) + if (!(strcmp(p->name, snd_soc_get_enum_text(e, i))) && item == i) p->connect = 1; } } @@ -290,11 +678,11 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm, int i; for (i = 0; i < e->max; i++) { - if (!(strcmp(control_name, e->texts[i]))) { + if (!(strcmp(control_name, snd_soc_get_enum_text(e, i)))) { list_add(&path->list, &dapm->card->paths); list_add(&path->list_sink, &dest->sources); list_add(&path->list_source, &src->sinks); - path->name = (char*)e->texts[i]; + path->name = (char*)snd_soc_get_enum_text(e, i); dapm_set_path_status(dest, path, 0); return 0; } @@ -492,7 +880,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) wlist->widgets[wlistentries - 1] = w; if (!kcontrol) { - if (dapm->codec) + if (dapm->codec && dapm->codec->name_prefix) prefix = dapm->codec->name_prefix; else prefix = NULL; @@ -514,7 +902,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w) * cut the prefix off the front of the widget name. */ kcontrol = snd_soc_cnew(&w->kcontrol_news[0], wlist, - name + prefix_len, prefix); + name, prefix); ret = snd_ctl_add(card, kcontrol); if (ret < 0) { dev_err(dapm->dev, @@ -544,15 +932,6 @@ static int dapm_new_pga(struct snd_soc_dapm_widget *w) return 0; } -/* reset 'walked' bit for each dapm path */ -static inline void dapm_clear_walk(struct snd_soc_dapm_context *dapm) -{ - struct snd_soc_dapm_path *p; - - list_for_each_entry(p, &dapm->card->paths, list) - p->walked = 0; -} - /* We implement power down on suspend by checking the power state of * the ALSA card - when we are suspending the ALSA state for the card * is set to D3. @@ -681,7 +1060,7 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w, else val = w->off_val; - snd_soc_update_bits(w->codec, -(w->reg + 1), + soc_widget_update_bits(w, -(w->reg + 1), w->mask << w->shift, val << w->shift); return 0; @@ -853,14 +1232,15 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, struct list_head *pending) { struct snd_soc_card *card = dapm->card; - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w, *_w; int reg, power; unsigned int value = 0; unsigned int mask = 0; unsigned int cur_mask; - reg = list_first_entry(pending, struct snd_soc_dapm_widget, - power_list)->reg; + _w = list_first_entry(pending, struct snd_soc_dapm_widget, + power_list); + reg = _w->reg; list_for_each_entry(w, pending, power_list) { cur_mask = 1 << w->shift; @@ -889,7 +1269,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_dapm_context *dapm, "pop test : Applying 0x%x/0x%x to %x in %dms\n", value, mask, reg, card->pop_time); pop_wait(card->pop_time); - snd_soc_update_bits(dapm->codec, reg, mask, value); + soc_widget_update_bits(_w, reg, mask, value); } list_for_each_entry(w, pending, power_list) { @@ -1163,7 +1543,11 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) dapm->dev_power = 1; break; case SND_SOC_DAPM_STREAM_STOP: - dapm->dev_power = !!dapm->codec->active; +#warning need re-work + if (dapm->codec) + dapm->dev_power = !!dapm->codec->active; + else + dapm->dev_power = 0; break; case SND_SOC_DAPM_STREAM_SUSPEND: dapm->dev_power = 0; @@ -1397,7 +1781,7 @@ static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) #endif /* test and update the power status of a mux widget */ -static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, +int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, struct snd_kcontrol *kcontrol, int change, int mux, struct soc_enum *e) { @@ -1414,29 +1798,33 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget, /* find dapm widget path assoc with kcontrol */ list_for_each_entry(path, &widget->dapm->card->paths, list) { + if (path->kcontrol != kcontrol) continue; - if (!path->name || !e->texts[mux]) + if (!path->name || !snd_soc_get_enum_text(e, mux)) continue; found = 1; /* we now need to match the string in the enum to the path */ - if (!(strcmp(path->name, e->texts[mux]))) + if (!(strcmp(path->name, snd_soc_get_enum_text(e, mux)))) path->connect = 1; /* new connection */ else path->connect = 0; /* old connection must be powered down */ } - if (found) + if (found) { dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP); + soc_dsp_runtime_update(widget); + } return 0; } +EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power); /* test and update the power status of a mixer or switch widget */ -static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, - struct snd_kcontrol *kcontrol, int connect) +int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, + struct snd_kcontrol *kcontrol, int connect) { struct snd_soc_dapm_path *path; int found = 0; @@ -1457,26 +1845,25 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, break; } - if (found) + if (found) { dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP); + soc_dsp_runtime_update(widget); + } return 0; } +EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power); /* show dapm widget status in sys fs */ -static ssize_t dapm_widget_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t widget_show(struct snd_soc_dapm_context *dapm, + const char *name, char *buf, ssize_t count) { - struct snd_soc_pcm_runtime *rtd = - container_of(dev, struct snd_soc_pcm_runtime, dev); - struct snd_soc_codec *codec =rtd->codec; struct snd_soc_dapm_widget *w; - int count = 0; char *state = "not set"; - list_for_each_entry(w, &codec->card->widgets, list) { - if (w->dapm != &codec->dapm) - continue; + count += sprintf(buf + count, "\n%s\n", name); + + list_for_each_entry(w, &dapm->card->widgets, list) { /* only display widgets that burnm power */ switch (w->id) { @@ -1501,7 +1888,7 @@ static ssize_t dapm_widget_show(struct device *dev, } } - switch (codec->dapm.bias_level) { + switch (dapm->bias_level) { case SND_SOC_BIAS_ON: state = "On"; break; @@ -1520,6 +1907,21 @@ static ssize_t dapm_widget_show(struct device *dev, return count; } +/* show dapm widget status in sys fs */ +static ssize_t dapm_widget_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct snd_soc_pcm_runtime *rtd = + container_of(dev, struct snd_soc_pcm_runtime, dev); + struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_platform *platform = rtd->platform; + ssize_t count = 0; + + count += widget_show(&codec->dapm, codec->name, buf, count); + count += widget_show(&platform->dapm, platform->name, buf, count); + return count; +} + static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL); int snd_soc_dapm_sys_add(struct device *dev) @@ -1865,7 +2267,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) /* Read the initial power state from the device */ if (w->reg >= 0) { - val = snd_soc_read(w->codec, w->reg); + val = soc_widget_read(w, w->reg); val &= 1 << w->shift; if (w->invert) val = !val; @@ -1884,6 +2286,24 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) } EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets); +const char *snd_soc_dapm_get_aif(struct snd_soc_dapm_context *dapm, + const char *stream_name, enum snd_soc_dapm_type type) +{ + struct snd_soc_dapm_widget *w; + + list_for_each_entry(w, &dapm->card->widgets, list) { + + if (!w->sname) + continue; + + if (w->id == type && strstr(w->sname, stream_name)) + return w->name; + + } + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_dapm_get_aif); + /** * snd_soc_dapm_get_volsw - dapm mixer get callback * @kcontrol: mixer control @@ -1981,7 +2401,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, update.val = val; widget->dapm->update = &update; - dapm_mixer_update_power(widget, kcontrol, connect); + snd_soc_dapm_mixer_update_power(widget, kcontrol, connect); widget->dapm->update = NULL; } @@ -2072,7 +2492,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, update.val = val; widget->dapm->update = &update; - dapm_mux_update_power(widget, kcontrol, change, mux, e); + snd_soc_dapm_mux_update_power(widget, kcontrol, change, mux, e); widget->dapm->update = NULL; } @@ -2133,8 +2553,8 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, widget->value = ucontrol->value.enumerated.item[0]; - dapm_mux_update_power(widget, kcontrol, change, - widget->value, e); + snd_soc_dapm_mux_update_power(widget, kcontrol, change, + widget->value, e); } } @@ -2237,7 +2657,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, update.val = val; widget->dapm->update = &update; - dapm_mux_update_power(widget, kcontrol, change, mux, e); + snd_soc_dapm_mux_update_power(widget, kcontrol, change, mux, e); widget->dapm->update = NULL; } @@ -2353,6 +2773,7 @@ int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, dapm->n_widgets++; w->dapm = dapm; w->codec = dapm->codec; + w->platform = dapm->platform; INIT_LIST_HEAD(&w->sources); INIT_LIST_HEAD(&w->sinks); INIT_LIST_HEAD(&w->list); @@ -2399,6 +2820,9 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, { struct snd_soc_dapm_widget *w; + if (!dapm) + return; + list_for_each_entry(w, &dapm->card->widgets, list) { if (!w->sname || w->dapm != dapm) @@ -2423,6 +2847,9 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, } dapm_power_widgets(dapm, event); + /* do we need to notify any clients that DAPM stream is complete */ + if (dapm->stream_event) + dapm->stream_event(dapm); } /** @@ -2439,14 +2866,15 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, const char *stream, int event) { - struct snd_soc_codec *codec = rtd->codec; - if (stream == NULL) return 0; - mutex_lock(&codec->mutex); - soc_dapm_stream_event(&codec->dapm, stream, event); - mutex_unlock(&codec->mutex); + mutex_lock(&rtd->card->dapm_mutex); + + soc_dapm_stream_event(&rtd->platform->dapm, stream, event); + soc_dapm_stream_event(&rtd->codec->dapm, stream, event); + + mutex_unlock(&rtd->card->dapm_mutex); return 0; } @@ -2627,11 +3055,17 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) void snd_soc_dapm_shutdown(struct snd_soc_card *card) { struct snd_soc_codec *codec; + struct snd_soc_platform *platform; list_for_each_entry(codec, &card->codec_dev_list, list) { soc_dapm_shutdown_codec(&codec->dapm); snd_soc_dapm_set_bias_level(&codec->dapm, SND_SOC_BIAS_OFF); } + + list_for_each_entry(platform, &card->platform_dev_list, list) { + soc_dapm_shutdown_codec(&platform->dapm); + snd_soc_dapm_set_bias_level(&platform->dapm, SND_SOC_BIAS_OFF); + } } /* Module information */ diff --git a/sound/soc/soc-dsp.c b/sound/soc/soc-dsp.c new file mode 100644 index 0000000..1770ee8 --- /dev/null +++ b/sound/soc/soc-dsp.c @@ -0,0 +1,1506 @@ +/* + * soc-dsp.c -- ALSA SoC Audio DSP + * + * Copyright (C) 2010 Texas Instruments Inc. + * + * Author: Liam Girdwood <lrg@slimlogic.co.uk> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/delay.h> +#include <linux/pm.h> +#include <linux/bitops.h> +#include <linux/debugfs.h> +#include <linux/platform_device.h> +#include <linux/slab.h> +#include <sound/ac97_codec.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/soc-dsp.h> + +int soc_pcm_open(struct snd_pcm_substream *); +void soc_pcm_close(struct snd_pcm_substream *); +int soc_pcm_hw_params(struct snd_pcm_substream *, struct snd_pcm_hw_params *); +int soc_pcm_hw_free(struct snd_pcm_substream *); +int soc_pcm_prepare(struct snd_pcm_substream *); +int soc_pcm_trigger(struct snd_pcm_substream *, int); +int soc_pcm_bespoke_trigger(struct snd_pcm_substream *, int); + +static inline int be_connect(struct snd_soc_pcm_runtime *fe, + struct snd_soc_pcm_runtime *be, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + + /* only add new dsp_paramss */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + if (dsp_params->be == be && dsp_params->fe == fe) + return 0; + } + + dsp_params = kzalloc(sizeof(struct snd_soc_dsp_params), GFP_KERNEL); + if (!dsp_params) + return -ENOMEM; + + dsp_params->be = be; + dsp_params->fe = fe; + be->dsp[stream].runtime = fe->dsp[stream].runtime; + dsp_params->state = SND_SOC_DSP_LINK_STATE_NEW; + list_add(&dsp_params->list_be, &fe->dsp[stream].be_clients); + list_add(&dsp_params->list_fe, &be->dsp[stream].fe_clients); + + dev_dbg(&fe->dev, " connected new DSP %s path %s %s %s\n", + stream ? "capture" : "playback", fe->dai_link->name, + stream ? "<-" : "->", be->dai_link->name); + +#ifdef CONFIG_DEBUG_FS + dsp_params->debugfs_state = debugfs_create_u32(be->dai_link->name, 0644, + fe->debugfs_dsp_root, &dsp_params->state); +#endif + + return 1; +} + +static inline void be_disconnect(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params, *d; + + list_for_each_entry_safe(dsp_params, d, &fe->dsp[stream].be_clients, list_be) { + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_FREE) { + dev_dbg(&fe->dev, " freed DSP %s path %s %s %s\n", + stream ? "capture" : "playback", fe->dai_link->name, + stream ? "<-" : "->", dsp_params->be->dai_link->name); + +#ifdef CONFIG_DEBUG_FS + debugfs_remove(dsp_params->debugfs_state); +#endif + + list_del(&dsp_params->list_be); + list_del(&dsp_params->list_fe); + kfree(dsp_params); + } + } +} + +static struct snd_soc_pcm_runtime *be_get_rtd(struct snd_soc_card *card, + struct snd_soc_dapm_widget *widget) +{ + struct snd_soc_pcm_runtime *be; + int i; + + if (!widget->sname) + return NULL; + + for (i = 0; i < card->num_links; i++) { + be = &card->rtd[i]; + + if (!strcmp(widget->sname, be->dai_link->stream_name)) + return be; + } + + return NULL; +} + +static struct snd_soc_dapm_widget *be_get_widget(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dapm_widget *widget; + + list_for_each_entry(widget, &card->widgets, list) { + + if (!widget->sname) + continue; + + if (!strcmp(widget->sname, rtd->dai_link->stream_name)) + return widget; + } + + return NULL; +} + +static int widget_in_list(struct snd_soc_dapm_widget_list *list, + struct snd_soc_dapm_widget *widget) +{ + int i; + + for (i = 0; i < list->num_widgets; i++) { + if (widget == list->widgets[i]) + return 1; + } + + return 0; +} + +/* + * Find the corresponding BE DAIs that source or sink audio to this + * FE substream. + */ +static int dsp_add_new_paths(struct snd_soc_pcm_runtime *fe, + int stream, int pending) +{ + struct snd_soc_dai *cpu_dai = fe->cpu_dai; + struct snd_soc_card *card = fe->card; + struct snd_soc_dapm_widget_list *list; + enum snd_soc_dapm_type fe_type, be_type; + int i, count = 0, err, paths; + + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + fe_type = snd_soc_dapm_aif_in; + be_type = snd_soc_dapm_aif_out; + } else { + fe_type = snd_soc_dapm_aif_out; + be_type = snd_soc_dapm_aif_in; + } + + /* get number of valid playback paths and their widgets */ + paths = snd_soc_dapm_get_connected_widgets_type(&card->dapm, + cpu_dai->driver->name, &list, stream, fe_type); + + dev_dbg(&fe->dev, "found %d audio %s paths\n", paths, + stream ? "capture" : "playback"); + if (!paths) + goto out; + + /* find BE DAI widgets and and connect the to FE */ + for (i = 0; i < list->num_widgets; i++) { + + if (list->widgets[i]->id == be_type) { + struct snd_soc_pcm_runtime *be; + + /* is there a valid BE rtd for this widget */ + be = be_get_rtd(card, list->widgets[i]); + if (!be) { + dev_err(&fe->dev, "no BE found for %s\n", + list->widgets[i]->name); + continue; + } + + /* newly connected FE and BE */ + err = be_connect(fe, be, stream); + if (err < 0) { + dev_err(&fe->dev, "can't connect %s\n", list->widgets[i]->name); + break; + } else if (err == 0) + continue; + + be->dsp[stream].runtime_update = pending; + count++; + } + } + +out: + kfree(list); + return count; +} + +/* + * Find the corresponding BE DAIs that source or sink audio to this + * FE substream. + */ +static int dsp_prune_old_paths(struct snd_soc_pcm_runtime *fe, int stream, + int pending) +{ + struct snd_soc_dai *cpu_dai = fe->cpu_dai; + struct snd_soc_card *card = fe->card; + struct snd_soc_dsp_params *dsp_params; + struct snd_soc_dapm_widget_list *list; + int count = 0, paths; + enum snd_soc_dapm_type fe_type, be_type; + struct snd_soc_dapm_widget *widget; + + dev_dbg(&fe->dev, "scan for old %s %s streams\n", fe->dai_link->name, + stream ? "capture" : "playback"); + + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + fe_type = snd_soc_dapm_aif_in; + be_type = snd_soc_dapm_aif_out; + } else { + fe_type = snd_soc_dapm_aif_out; + be_type = snd_soc_dapm_aif_in; + } + + /* get number of valid playback paths and their widgets */ + paths = snd_soc_dapm_get_connected_widgets_type(&card->dapm, + cpu_dai->driver->name, &list, stream, fe_type); + + dev_dbg(&fe->dev, "found %d audio %s paths\n", paths, + stream ? "capture" : "playback"); + if (!paths) { + /* prune all BEs */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + dsp_params->state = SND_SOC_DSP_LINK_STATE_FREE; + dsp_params->be->dsp[stream].runtime_update = pending; + count++; + } + + dev_dbg(&fe->dev, "pruned all %s BE for FE %s\n", fe->dai_link->name, + stream ? "capture" : "playback"); + goto out; + } + + /* search card for valid BE AIFs */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + /* is there a valid widget for this BE */ + widget = be_get_widget(card, dsp_params->be); + if (!widget) { + dev_err(&fe->dev, "no widget found for %s\n", + dsp_params->be->dai_link->name); + continue; + } + + /* prune the BE if it's no longer in our active list */ + if (widget_in_list(list, widget)) + continue; + + dev_dbg(&fe->dev, "pruning %s BE %s for %s\n", + stream ? "capture" : "playback", dsp_params->be->dai_link->name, + fe->dai_link->name); + dsp_params->state = SND_SOC_DSP_LINK_STATE_FREE; + dsp_params->be->dsp[stream].runtime_update = pending; + count++; + } + + /* the number of old paths pruned */ +out: + kfree(list); + return count; +} + +/* + * Update the state of all BE's with state old to state new. + */ +static void be_state_update(struct snd_soc_pcm_runtime *fe, int stream, + enum snd_soc_dsp_link_state old, enum snd_soc_dsp_link_state new) +{ + struct snd_soc_dsp_params *dsp_params; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + if (dsp_params->state == old) + dsp_params->state = new; + } +} + +/* + * Update the state of all BE's to new regardless of current state. + */ +static void fe_state_update(struct snd_soc_pcm_runtime *fe, int stream, + enum snd_soc_dsp_link_state new) +{ + struct snd_soc_dsp_params *dsp_params; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) + dsp_params->state = new; +} + +/* + * Clear the runtime pending state of all BE's. + */ +static void fe_clear_pending(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) + dsp_params->be->dsp[stream].runtime_update = 0; +} + +/* Unwind the BE startup */ +static void soc_dsp_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + + /* disable any enabled and non active backends */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + if (--dsp_params->be->dsp[stream].users != 0) + continue; + + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_NEW) + continue; + + soc_pcm_close(be_substream); + be_substream->runtime = NULL; + } +} + +/* Startup all new BE */ +static int soc_dsp_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + int err, count = 0; + + /* only startup BE DAIs that are either sinks or sources to this FE DAI */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + /* first time the dsp_params is open ? */ + if (dsp_params->be->dsp[stream].users++ != 0) + continue; + + /* only open and ref count new links */ + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_NEW) + continue; + + dev_dbg(&dsp_params->be->dev, "dsp: open BE %s\n", + dsp_params->be->dai_link->name); + + be_substream->runtime = dsp_params->be->dsp[stream].runtime; + err = soc_pcm_open(be_substream); + if (err < 0) + goto unwind; + count++; + } + + /* update BE state */ + be_state_update(fe, stream, + SND_SOC_DSP_LINK_STATE_NEW, SND_SOC_DSP_LINK_STATE_HW_PARAMS); + return count; + +unwind: + /* disable any enabled and non active backends */ + list_for_each_entry_continue_reverse(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + if (--dsp_params->be->dsp[stream].users != 0) + continue; + + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_NEW) + continue; + + soc_pcm_close(be_substream); + be_substream->runtime = NULL; + } + + /* update BE state for disconnect */ + be_state_update(fe, stream, + SND_SOC_DSP_LINK_STATE_NEW, SND_SOC_DSP_LINK_STATE_FREE); + return err; +} + +void soc_dsp_set_dynamic_runtime(struct snd_pcm_substream *substream) +{ + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_dai_driver *cpu_dai_drv = cpu_dai->driver; + + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + runtime->hw.rate_min = cpu_dai_drv->playback.rate_min; + runtime->hw.rate_max = cpu_dai_drv->playback.rate_max; + runtime->hw.channels_min = cpu_dai_drv->playback.channels_min; + runtime->hw.channels_max = cpu_dai_drv->playback.channels_max; + runtime->hw.formats &= cpu_dai_drv->playback.formats; + runtime->hw.rates = cpu_dai_drv->playback.rates; + } else { + runtime->hw.rate_min = cpu_dai_drv->capture.rate_min; + runtime->hw.rate_max = cpu_dai_drv->capture.rate_max; + runtime->hw.channels_min = cpu_dai_drv->capture.channels_min; + runtime->hw.channels_max = cpu_dai_drv->capture.channels_max; + runtime->hw.formats &= cpu_dai_drv->capture.formats; + runtime->hw.rates = cpu_dai_drv->capture.rates; + } +} + +static int soc_dsp_fe_dai_startup(struct snd_pcm_substream *fe_substream) +{ + struct snd_soc_pcm_runtime *fe = fe_substream->private_data; + struct snd_pcm_runtime *runtime = fe_substream->runtime; + int ret = 0; + + mutex_lock(&fe->card->dsp_mutex); + + ret = soc_dsp_be_dai_startup(fe, fe_substream->stream); + if (ret < 0) + goto be_err; + + dev_dbg(&fe->dev, "dsp: open FE %s\n", fe->dai_link->name); + + /* start the DAI frontend */ + ret = soc_pcm_open(fe_substream); + if (ret < 0) { + dev_err(&fe->dev,"dsp: failed to start FE %d\n", ret); + goto unwind; + } + + soc_dsp_set_dynamic_runtime(fe_substream); + snd_pcm_limit_hw_rates(runtime); + + mutex_unlock(&fe->card->dsp_mutex); + return 0; + +unwind: + soc_dsp_be_dai_startup_unwind(fe, fe_substream->stream); +be_err: + mutex_unlock(&fe->card->dsp_mutex); + return ret; +} + +/* BE shutdown - called on DAPM sync updates (i.e. FE is already running)*/ +static int soc_dsp_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + + /* only shutdown backends that are either sinks or sources to this frontend DAI */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + if (--dsp_params->be->dsp[stream].users != 0) + continue; + + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_FREE) + continue; + + dev_dbg(&dsp_params->be->dev, "dsp: close BE %s\n", + dsp_params->fe->dai_link->name); + + soc_pcm_close(be_substream); + be_substream->runtime = NULL; + } + return 0; +} + +/* FE +BE shutdown - called on FE PCM ops */ +static int soc_dsp_fe_dai_shutdown(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + int stream = substream->stream; + + mutex_lock(&fe->card->dsp_mutex); + + /* shutdown the BEs */ + soc_dsp_be_dai_shutdown(fe, substream->stream); + + dev_dbg(&fe->dev, "dsp: close FE %s\n", fe->dai_link->name); + + /* now shutdown the frontend */ + soc_pcm_close(substream); + + /* run the stream event for each BE */ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->playback.stream_name, + SND_SOC_DAPM_STREAM_STOP); + else + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->capture.stream_name, + SND_SOC_DAPM_STREAM_STOP); + + mutex_unlock(&fe->card->dsp_mutex); + return 0; +} + +static int soc_dsp_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + int ret; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_HW_PARAMS) + continue; + + /* first time the dsp_params is open ? */ + if (dsp_params->be->dsp[stream].users != 1) + continue; + + dev_dbg(&dsp_params->be->dev, "dsp: hw_params BE %s\n", + dsp_params->fe->dai_link->name); + + /* copy params for each dsp_params */ + memcpy(&dsp_params->params, &fe->dsp[stream].params, + sizeof(struct snd_pcm_hw_params)); + + /* perform any hw_params fixups */ + if (dsp_params->be->dai_link->be_hw_params_fixup) { + ret = dsp_params->be->dai_link->be_hw_params_fixup(dsp_params->be, + &dsp_params->params); + if (ret < 0) { + dev_err(&dsp_params->be->dev, + "dsp: hw_params BE fixup failed %d\n", ret); + return ret; + } + } + + ret = soc_pcm_hw_params(be_substream, &dsp_params->params); + if (ret < 0) { + dev_err(&dsp_params->be->dev, "dsp: hw_params BE failed %d\n", ret); + return ret; + } + } + return 0; +} + +int soc_dsp_fe_dai_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + int ret; + + mutex_lock(&fe->card->dsp_mutex); + + memcpy(&fe->dsp[substream->stream].params, params, + sizeof(struct snd_pcm_hw_params)); + ret = soc_dsp_be_dai_hw_params(fe, substream->stream); + if (ret < 0) + goto out; + + dev_dbg(&fe->dev, "dsp: hw_params FE %s\n", fe->dai_link->name); + + /* call hw_params on the frontend */ + ret = soc_pcm_hw_params(substream, params); + if (ret < 0) + dev_err(&fe->dev,"dsp: hw_params FE failed %d\n", ret); + +out: + mutex_unlock(&fe->card->dsp_mutex); + return ret; +} + +static int dsp_do_trigger(struct snd_soc_dsp_params *dsp_params, + struct snd_pcm_substream *substream, int cmd) +{ + int ret; + + dev_dbg(&dsp_params->be->dev, "dsp: trigger BE %s cmd %d\n", + dsp_params->fe->dai_link->name, cmd); + + ret = soc_pcm_trigger(substream, cmd); + if (ret < 0) + dev_err(&dsp_params->be->dev,"dsp: trigger BE failed %d\n", ret); + + return ret; +} + +int soc_dsp_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd) +{ + struct snd_soc_dsp_params *dsp_params; + int ret = 0; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + /* only start BEs that are not triggered */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_PREPARE) { + ret = dsp_do_trigger(dsp_params, be_substream, cmd); + if (ret == 0) + dsp_params->state = SND_SOC_DSP_LINK_STATE_START; + } + break; + case SNDRV_PCM_TRIGGER_STOP: + /* only stop BEs that are being shutdown */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_FREE && + dsp_params->be->dsp[stream].users == 1) + ret = dsp_do_trigger(dsp_params, be_substream, cmd); + break; + case SNDRV_PCM_TRIGGER_SUSPEND: + case SNDRV_PCM_TRIGGER_RESUME: + /* suspend and resume all BEs */ + ret = dsp_do_trigger(dsp_params, be_substream, cmd); + break; + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + /* only release Paused BEs */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_PAUSED) { + ret = dsp_do_trigger(dsp_params, be_substream, cmd); + if (ret == 0) + dsp_params->state = SND_SOC_DSP_LINK_STATE_START; + } + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + /* only pause active BEs */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_START) { + ret = dsp_do_trigger(dsp_params, be_substream, cmd); + if (ret == 0) + dsp_params->state = SND_SOC_DSP_LINK_STATE_PAUSED; + } + break; + } + if (ret < 0) + return ret; + } + + return ret; +} +EXPORT_SYMBOL_GPL(soc_dsp_be_dai_trigger); + +int soc_dsp_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + struct snd_soc_dsp_link *dsp_link = fe->dai_link->dsp_link; + int stream = substream->stream, ret; + + switch (dsp_link->trigger[stream]) { + case SND_SOC_DSP_TRIGGER_PRE: + /* call trigger on the frontend before the backend. */ + + dev_dbg(&fe->dev, "dsp: pre trigger FE %s cmd %d\n", + fe->dai_link->name, cmd); + + ret = soc_pcm_trigger(substream, cmd); + if (ret < 0) { + dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret); + return ret; + } + + ret = soc_dsp_be_dai_trigger(fe, substream->stream, cmd); + break; + case SND_SOC_DSP_TRIGGER_POST: + /* call trigger on the frontend after the backend. */ + + ret = soc_dsp_be_dai_trigger(fe, substream->stream, cmd); + if (ret < 0) { + dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret); + return ret; + } + + dev_dbg(&fe->dev, "dsp: post trigger FE %s cmd %d\n", + fe->dai_link->name, cmd); + + ret = soc_pcm_trigger(substream, cmd); + break; + case SND_SOC_DSP_TRIGGER_BESPOKE: + /* bespoke trigger() - handles both FE and BEs */ + + dev_dbg(&fe->dev, "dsp: bespoke trigger FE %s cmd %d\n", + fe->dai_link->name, cmd); + + ret = soc_pcm_bespoke_trigger(substream, cmd); + if (ret < 0) { + dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret); + return ret; + } + break; + default: + dev_err(&fe->dev, "dsp: invalid trigger cmd %d for %s\n", cmd, + fe->dai_link->name); + return -EINVAL; + } + + return ret; +} + +static int soc_dsp_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + int ret = 0; + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + /* only prepare ACTIVE or READY BE's */ + if (dsp_params->state == SND_SOC_DSP_LINK_STATE_NEW || + dsp_params->state == SND_SOC_DSP_LINK_STATE_FREE) + continue; + + dev_dbg(&dsp_params->be->dev, "dsp: prepare BE %s\n", + dsp_params->fe->dai_link->name); + + ret = soc_pcm_prepare(be_substream); + if (ret < 0) { + dev_err(&dsp_params->be->dev,"dsp: backend prepare failed %d\n", + ret); + break; + } + + /* mark the BE as active */ + be_state_update(fe, stream, SND_SOC_DSP_LINK_STATE_HW_PARAMS, + SND_SOC_DSP_LINK_STATE_PREPARE); + } + return ret; +} + +int soc_dsp_fe_dai_prepare(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + int stream = substream->stream, ret = 0; + + mutex_lock(&fe->card->dsp_mutex); + + dev_dbg(&fe->dev, "dsp: prepare FE %s\n", fe->dai_link->name); + + /* there is no point preparing this FE if there are no BEs */ + if (list_empty(&fe->dsp[stream].be_clients)) { + dev_err(&fe->dev, "dsp: no backend DAIs enabled for %s\n", + fe->dai_link->name); + ret = -EINVAL; + goto out; + } + + ret = soc_dsp_be_dai_prepare(fe, substream->stream); + if (ret < 0) + goto out; + + /* mark the BE as active */ + fe_state_update(fe, stream, SND_SOC_DSP_LINK_STATE_PREPARE); + + /* call prepare on the frontend */ + ret = soc_pcm_prepare(substream); + if (ret < 0) { + dev_err(&fe->dev,"dsp: prepare FE %s failed\n", fe->dai_link->name); + goto out; + } + + /* run the stream event for each BE */ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->playback.stream_name, + SNDRV_PCM_TRIGGER_START); + else + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->capture.stream_name, + SNDRV_PCM_TRIGGER_START); + +out: + mutex_unlock(&fe->card->dsp_mutex); + return ret; +} + +static int soc_dsp_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_params; + + /* only hw_params backends that are either sinks or sources + * to this frontend DAI */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + struct snd_pcm_substream *be_substream = + snd_soc_dsp_get_substream(dsp_params->be, stream); + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + if (dsp_params->state != SND_SOC_DSP_LINK_STATE_FREE) + continue; + + /* only free hw when no longer used */ + if (dsp_params->be->dsp[stream].users != 1) + continue; + + dev_dbg(&dsp_params->be->dev, "dsp: hw_free BE %s\n", + dsp_params->fe->dai_link->name); + + soc_pcm_hw_free(be_substream); + } + + return 0; +} + +int soc_dsp_fe_dai_hw_free(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *fe = substream->private_data; + int ret, stream = substream->stream; + + mutex_lock(&fe->card->dsp_mutex); + + fe_state_update(fe, stream, SND_SOC_DSP_LINK_STATE_FREE); + + dev_dbg(&fe->dev, "dsp: hw_free FE %s\n", fe->dai_link->name); + + /* call hw_free on the frontend */ + ret = soc_pcm_hw_free(substream); + if (ret < 0) + dev_err(&fe->dev,"dsp: hw_free FE %s failed\n", fe->dai_link->name); + + /* only hw_params backends that are either sinks or sources + * to this frontend DAI */ + ret = soc_dsp_be_dai_hw_free(fe, stream); + + mutex_unlock(&fe->card->dsp_mutex); + return ret; +} + +/* + * FE stream event, send event to all active BEs. + */ +int soc_dsp_dapm_stream_event(struct snd_soc_pcm_runtime *fe, + int dir, const char *stream, int event) +{ + struct snd_soc_dsp_params *dsp_params; + + /* resume for playback */ + list_for_each_entry(dsp_params, &fe->dsp[dir].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + + dev_dbg(&be->dev, "pm: BE %s stream %s event %d dir %d\n", + be->dai_link->name, stream, event, dir); + + snd_soc_dapm_stream_event(be, stream, event); + } + + return 0; +} + +static int dsp_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_link *dsp_link = fe->dai_link->dsp_link; + struct snd_pcm_substream *substream = snd_soc_dsp_get_substream(fe, stream); + struct snd_soc_dsp_params *dsp_params; + int ret; + + dev_dbg(&fe->dev, "runtime %s close on FE %s\n", + stream ? "capture" : "playback", fe->dai_link->name); + + if (dsp_link->trigger[stream] == SND_SOC_DSP_TRIGGER_BESPOKE) { + /* call bespoke trigger - FE takes care of all BE triggers */ + dev_dbg(&fe->dev, "dsp: bespoke trigger FE %s cmd stop\n", + fe->dai_link->name); + + ret = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_STOP); + if (ret < 0) { + dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret); + return ret; + } + } else { + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + dev_dbg(&fe->dev, "dsp: trigger FE %s cmd stop\n", + fe->dai_link->name); + + ret = soc_dsp_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP); + if (ret < 0) + return ret; + } + } + + ret = soc_dsp_be_dai_hw_free(fe, stream); + if (ret < 0) + return ret; + + ret = soc_dsp_be_dai_shutdown(fe, stream); + if (ret < 0) + return ret; + + /* run the stream event for each BE */ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->playback.stream_name, + SNDRV_PCM_TRIGGER_STOP); + else + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->capture.stream_name, + SNDRV_PCM_TRIGGER_STOP); + + return 0; +} + +/* check for running FEs */ +static int dsp_get_be_trigger_cmd(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_be_params, *dsp_fe_params; + + /* get the FEs for each BE */ + list_for_each_entry(dsp_be_params, &fe->dsp[stream].be_clients, list_be) { + struct snd_soc_pcm_runtime *be = dsp_be_params->be; + + /* get the FEs for this BE */ + list_for_each_entry(dsp_fe_params, &be->dsp[stream].fe_clients, list_fe) { + + if (dsp_fe_params->state == SND_SOC_DSP_LINK_STATE_START) + return SND_SOC_DSP_LINK_STATE_START; + } + } + return SND_SOC_DSP_LINK_STATE_PAUSED; +} + +/* check for running BEs */ +static int dsp_get_fe_trigger_cmd(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_params *dsp_be_params; + + /* get the FEs for each BE */ + list_for_each_entry(dsp_be_params, &fe->dsp[stream].be_clients, list_be) { + + if (dsp_be_params->state == SND_SOC_DSP_LINK_STATE_START) + return SND_SOC_DSP_LINK_STATE_START; + } + return SND_SOC_DSP_LINK_STATE_PAUSED; +} + +static int dsp_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) +{ + struct snd_soc_dsp_link *dsp_link = fe->dai_link->dsp_link; + struct snd_pcm_substream *substream = snd_soc_dsp_get_substream(fe, stream); + struct snd_soc_dsp_params *dsp_params; + int ret, cmd; + + dev_dbg(&fe->dev, "runtime %s open on FE %s\n", + stream ? "capture" : "playback", fe->dai_link->name); + + ret = soc_dsp_be_dai_startup(fe, stream); + if (ret < 0) + return ret; + + ret = soc_dsp_be_dai_hw_params(fe, stream); + if (ret < 0) + return ret; + + ret = soc_dsp_be_dai_prepare(fe, stream); + if (ret < 0) + return ret; + + /* run the stream event for each BE */ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->playback.stream_name, + SNDRV_PCM_TRIGGER_START); + else + soc_dsp_dapm_stream_event(fe, stream, + fe->cpu_dai->driver->capture.stream_name, + SNDRV_PCM_TRIGGER_START); + + if (dsp_link->trigger[stream] == SND_SOC_DSP_TRIGGER_BESPOKE) { + + /* there is no point in triggering START iff all BEs are PAUSED */ + cmd = dsp_get_fe_trigger_cmd(fe, stream); + + /* call trigger on the frontend - FE takes care of all BE triggers */ + dev_dbg(&fe->dev, "dsp: bespoke trigger FE %s cmd start\n", + fe->dai_link->name); + + ret = soc_pcm_bespoke_trigger(substream, cmd); + if (ret < 0) { + dev_err(&fe->dev,"dsp: trigger FE failed %d\n", ret); + return ret; + } + + /* successful trigger so update BE trigger status */ + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + /* is this op for this BE ? */ + if (fe->dsp[stream].runtime_update && + !dsp_params->be->dsp[stream].runtime_update) + continue; + + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + case SNDRV_PCM_TRIGGER_RESUME: + dsp_params->state = SND_SOC_DSP_LINK_STATE_START; + break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + case SNDRV_PCM_TRIGGER_STOP: + case SNDRV_PCM_TRIGGER_SUSPEND: + dsp_params->state = SND_SOC_DSP_LINK_STATE_PAUSED; + break; + } + } + } else { + + list_for_each_entry(dsp_params, &fe->dsp[stream].be_clients, list_be) { + + /* there is no point in triggering start iff all FEs are PAUSED */ + cmd = dsp_get_be_trigger_cmd(fe, stream); + + dev_dbg(&fe->dev, "dsp: trigger FE %s cmd start\n", + fe->dai_link->name); + + ret = soc_dsp_be_dai_trigger(fe, stream, cmd); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int dsp_run_update(struct snd_soc_pcm_runtime *fe, int stream, + int start, int stop) +{ + int ret = 0; + + fe->dsp[stream].runtime_update = 1; + + /* startup any new BEs */ + if (start) { + ret = dsp_run_update_startup(fe, stream); + if (ret < 0) + dev_err(&fe->dev, "failed to startup BEs\n"); + } + + /* close down old BEs */ + if (stop) { + ret = dsp_run_update_shutdown(fe, stream); + if (ret < 0) + dev_err(&fe->dev, "failed to shutdown BEs\n"); + } + + fe->dsp[stream].runtime_update = 0; + + return ret; +} + +/* called when any mixer updates change FE -> BE the stream */ +int soc_dsp_runtime_update(struct snd_soc_dapm_widget *widget) +{ + struct snd_soc_card *card; + int i, ret = 0, start, stop; + + if (widget->codec) + card = widget->codec->card; + else if (widget->platform) + card = widget->platform->card; + else + return -EINVAL; + + mutex_lock(&widget->dapm->card->dsp_mutex); + + for (i = 0; i < card->num_rtd; i++) { + struct snd_soc_pcm_runtime *fe = &card->rtd[i]; + + /* make sure link is BE */ + if (!fe->dai_link->dsp_link) + continue; + + /* only check active links */ + if (!fe->cpu_dai->active) { + continue; + } + + /* DAPM sync will call this to update DSP paths */ + dev_dbg(card->dev, "DSP runtime update for FE %s\n", fe->dai_link->name); + + /* update any playback paths */ + start = dsp_add_new_paths(fe, SNDRV_PCM_STREAM_PLAYBACK, 1); + stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_PLAYBACK, 1); + if (!(start || stop)) + goto capture; + + /* run PCM ops on new/old playback paths */ + ret = dsp_run_update(fe, SNDRV_PCM_STREAM_PLAYBACK, start, stop); + if (ret < 0) { + dev_err(&fe->dev, "failed to update playback FE stream %s\n", + fe->dai_link->stream_name); + } + + /* free old playback links */ + be_disconnect(fe, SNDRV_PCM_STREAM_PLAYBACK); + fe_clear_pending(fe, SNDRV_PCM_STREAM_PLAYBACK); + +capture: + /* update any capture paths */ + start = dsp_add_new_paths(fe, SNDRV_PCM_STREAM_CAPTURE, 1); + stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_CAPTURE, 1); + if (!(start || stop)) + continue; + + /* run PCM ops on new/old capture paths */ + ret = dsp_run_update(fe, SNDRV_PCM_STREAM_CAPTURE, start, stop); + if (ret < 0) { + dev_err(&fe->dev, "failed to update capture FE stream %s\n", + fe->dai_link->stream_name); + } + + /* free old capture links */ + be_disconnect(fe, SNDRV_PCM_STREAM_CAPTURE); + fe_clear_pending(fe, SNDRV_PCM_STREAM_CAPTURE); + } + + mutex_unlock(&widget->dapm->card->dsp_mutex); + return ret; +} + +int soc_dsp_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute) +{ + struct snd_soc_dsp_params *dsp_params; + + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->codec_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "BE digital mute %s\n", be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->ops->digital_mute && dai->playback_active) + drv->ops->digital_mute(dai, mute); + } + + return 0; +} + +int soc_dsp_be_cpu_dai_suspend(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* suspend for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI playback suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && !drv->ac97_control) + drv->suspend(dai); + } + + /* suspend for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI capture suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && !drv->ac97_control) + drv->suspend(dai); + } + + return 0; +} + +int soc_dsp_be_ac97_cpu_dai_suspend(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* suspend for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI playback suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && drv->ac97_control) + drv->suspend(dai); + } + + /* suspend for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI capture suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && drv->ac97_control) + drv->suspend(dai); + } + + return 0; +} + +int soc_dsp_be_platform_suspend(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* suspend for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_platform *platform = be->platform; + struct snd_soc_platform_driver *drv = platform->driver; + struct snd_soc_dai *dai = be->cpu_dai; + + dev_dbg(&be->dev, "pm: BE platform playback suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && !platform->suspended) { + drv->suspend(dai); + platform->suspended = 1; + } + } + + /* suspend for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_platform *platform = be->platform; + struct snd_soc_platform_driver *drv = platform->driver; + struct snd_soc_dai *dai = be->cpu_dai; + + dev_dbg(&be->dev, "pm: BE platform capture suspend %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->suspend && !platform->suspended) { + drv->suspend(dai); + platform->suspended = 1; + } + } + + return 0; +} + +int soc_dsp_be_cpu_dai_resume(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* resume for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI playback resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && !drv->ac97_control) + drv->resume(dai); + } + + /* suspend for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI capture resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && !drv->ac97_control) + drv->resume(dai); + } + + return 0; +} + +int soc_dsp_be_ac97_cpu_dai_resume(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* resume for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI playback resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && drv->ac97_control) + drv->resume(dai); + } + + /* suspend for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_dai *dai = be->cpu_dai; + struct snd_soc_dai_driver *drv = dai->driver; + + dev_dbg(&be->dev, "pm: BE CPU DAI capture resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && drv->ac97_control) + drv->resume(dai); + } + + return 0; +} + +int soc_dsp_be_platform_resume(struct snd_soc_pcm_runtime *fe) +{ + struct snd_soc_dsp_params *dsp_params; + + /* resume for playback */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_PLAYBACK].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_platform *platform = be->platform; + struct snd_soc_platform_driver *drv = platform->driver; + struct snd_soc_dai *dai = be->cpu_dai; + + dev_dbg(&be->dev, "pm: BE platform playback resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && platform->suspended) { + drv->resume(dai); + platform->suspended = 0; + } + } + + /* resume for capture */ + list_for_each_entry(dsp_params, + &fe->dsp[SNDRV_PCM_STREAM_CAPTURE].be_clients, list_be) { + + struct snd_soc_pcm_runtime *be = dsp_params->be; + struct snd_soc_platform *platform = be->platform; + struct snd_soc_platform_driver *drv = platform->driver; + struct snd_soc_dai *dai = be->cpu_dai; + + dev_dbg(&be->dev, "pm: BE platform capture resume %s\n", + be->dai_link->name); + + if (be->dai_link->ignore_suspend) + continue; + + if (drv->resume && platform->suspended) { + drv->resume(dai); + platform->suspended = 0; + } + } + + return 0; +} + +/* called when opening FE stream */ +int soc_dsp_fe_dai_open(struct snd_pcm_substream *fe_substream) +{ + struct snd_soc_pcm_runtime *fe = fe_substream->private_data; + int err; + + fe->dsp[fe_substream->stream].runtime = fe_substream->runtime; + + /* calculate valid and active FE <-> BE dsp_paramss */ + err = dsp_add_new_paths(fe, fe_substream->stream, 0); + if (err <= 0) { + dev_warn(&fe->dev, "asoc: %s no valid %s route from source to sink\n", + fe->dai_link->name, fe_substream->stream ? "capture" : "playback"); + } + + return soc_dsp_fe_dai_startup(fe_substream); +} + +/* called when closing FE stream */ +int soc_dsp_fe_dai_close(struct snd_pcm_substream *fe_substream) +{ + struct snd_soc_pcm_runtime *fe = fe_substream->private_data; + int ret; + + ret = soc_dsp_fe_dai_shutdown(fe_substream); + + be_disconnect(fe, fe_substream->stream); + + return ret; +} + +#ifdef CONFIG_DEBUG_FS +int soc_dsp_debugfs_add(struct snd_soc_pcm_runtime *rtd) +{ + rtd->debugfs_dsp_root = debugfs_create_dir(rtd->dai_link->name, + rtd->card->debugfs_card_root); + if (!rtd->debugfs_dsp_root) { + dev_dbg(&rtd->dev, + "ASoC: Failed to create dsp debugfs directory %s\n", + rtd->dai_link->name); + return -EINVAL; + } + + return 0; +} +#endif + +/* Module information */ +MODULE_AUTHOR("Liam Girdwood, lrg@slimlogic.co.uk"); +MODULE_DESCRIPTION("ALSA SoC DSP Core"); +MODULE_LICENSE("GPL"); diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index f4aa4e0..34aa972 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -288,9 +288,10 @@ static void txx9aclc_pcm_free_dma_buffers(struct snd_pcm *pcm) snd_pcm_lib_preallocate_free_for_all(pcm); } -static int txx9aclc_pcm_new(struct snd_card *card, struct snd_soc_dai *dai, - struct snd_pcm *pcm) +static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd) { + struct snd_soc_dai *dai = rtd->cpu_dai; + struct snd_pcm *pcm = rtd->pcm; struct platform_device *pdev = to_platform_device(dai->platform->dev); struct txx9aclc_soc_device *dev; struct resource *r; |