1cd59f138SKenneth Westfield /* 2cd59f138SKenneth Westfield * Copyright (c) 2010-2011,2013-2015 The Linux Foundation. All rights reserved. 3cd59f138SKenneth Westfield * 4cd59f138SKenneth Westfield * This program is free software; you can redistribute it and/or modify 5cd59f138SKenneth Westfield * it under the terms of the GNU General Public License version 2 and 6cd59f138SKenneth Westfield * only version 2 as published by the Free Software Foundation. 7cd59f138SKenneth Westfield * 8cd59f138SKenneth Westfield * This program is distributed in the hope that it will be useful, 9cd59f138SKenneth Westfield * but WITHOUT ANY WARRANTY; without even the implied warranty of 10cd59f138SKenneth Westfield * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11cd59f138SKenneth Westfield * GNU General Public License for more details. 12cd59f138SKenneth Westfield * 13cd59f138SKenneth Westfield * lpass.h - Definitions for the QTi LPASS 14cd59f138SKenneth Westfield */ 15cd59f138SKenneth Westfield 16cd59f138SKenneth Westfield #ifndef __LPASS_H__ 17cd59f138SKenneth Westfield #define __LPASS_H__ 18cd59f138SKenneth Westfield 19cd59f138SKenneth Westfield #include <linux/clk.h> 20cd59f138SKenneth Westfield #include <linux/compiler.h> 21cd59f138SKenneth Westfield #include <linux/platform_device.h> 22cd59f138SKenneth Westfield #include <linux/regmap.h> 23cd59f138SKenneth Westfield 24cd59f138SKenneth Westfield #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 25cd59f138SKenneth Westfield 26cd59f138SKenneth Westfield /* Both the CPU DAI and platform drivers will access this data */ 27cd59f138SKenneth Westfield struct lpass_data { 28cd59f138SKenneth Westfield 29cd59f138SKenneth Westfield /* AHB-I/X bus clocks inside the low-power audio subsystem (LPASS) */ 30cd59f138SKenneth Westfield struct clk *ahbix_clk; 31cd59f138SKenneth Westfield 32cd59f138SKenneth Westfield /* MI2S system clock */ 33cd59f138SKenneth Westfield struct clk *mi2s_osr_clk; 34cd59f138SKenneth Westfield 35cd59f138SKenneth Westfield /* MI2S bit clock (derived from system clock by a divider */ 36cd59f138SKenneth Westfield struct clk *mi2s_bit_clk; 37cd59f138SKenneth Westfield 38cd59f138SKenneth Westfield /* low-power audio interface (LPAIF) registers */ 39cd59f138SKenneth Westfield void __iomem *lpaif; 40cd59f138SKenneth Westfield 41cd59f138SKenneth Westfield /* regmap backed by the low-power audio interface (LPAIF) registers */ 42cd59f138SKenneth Westfield struct regmap *lpaif_map; 43cd59f138SKenneth Westfield 44cd59f138SKenneth Westfield /* interrupts from the low-power audio interface (LPAIF) */ 45cd59f138SKenneth Westfield int lpaif_irq; 469bae4880SSrinivas Kandagatla 479bae4880SSrinivas Kandagatla /* SOC specific variations in the LPASS IP integration */ 489bae4880SSrinivas Kandagatla struct lpass_variant *variant; 499bae4880SSrinivas Kandagatla }; 509bae4880SSrinivas Kandagatla 519bae4880SSrinivas Kandagatla /* Vairant data per each SOC */ 529bae4880SSrinivas Kandagatla struct lpass_variant { 539bae4880SSrinivas Kandagatla u32 i2sctrl_reg_base; 549bae4880SSrinivas Kandagatla u32 i2sctrl_reg_stride; 559bae4880SSrinivas Kandagatla u32 i2s_ports; 569bae4880SSrinivas Kandagatla u32 irq_reg_base; 579bae4880SSrinivas Kandagatla u32 irq_reg_stride; 589bae4880SSrinivas Kandagatla u32 irq_ports; 599bae4880SSrinivas Kandagatla u32 rdma_reg_base; 609bae4880SSrinivas Kandagatla u32 rdma_reg_stride; 619bae4880SSrinivas Kandagatla u32 rdma_channels; 629bae4880SSrinivas Kandagatla 639bae4880SSrinivas Kandagatla /* SOC specific intialization like clocks */ 649bae4880SSrinivas Kandagatla int (*init)(struct platform_device *pdev); 659bae4880SSrinivas Kandagatla int (*exit)(struct platform_device *pdev); 666db1c6baSSrinivas Kandagatla int (*alloc_dma_channel)(struct lpass_data *data); 676db1c6baSSrinivas Kandagatla int (*free_dma_channel)(struct lpass_data *data, int ch); 689bae4880SSrinivas Kandagatla 699bae4880SSrinivas Kandagatla /* SOC specific dais */ 709bae4880SSrinivas Kandagatla struct snd_soc_dai_driver *dai_driver; 719bae4880SSrinivas Kandagatla int num_dai; 72cd59f138SKenneth Westfield }; 73cd59f138SKenneth Westfield 74cd59f138SKenneth Westfield /* register the platform driver from the CPU DAI driver */ 75cd59f138SKenneth Westfield int asoc_qcom_lpass_platform_register(struct platform_device *); 769bae4880SSrinivas Kandagatla int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev); 779bae4880SSrinivas Kandagatla int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev); 789bae4880SSrinivas Kandagatla int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai); 799bae4880SSrinivas Kandagatla extern struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops; 80cd59f138SKenneth Westfield 81cd59f138SKenneth Westfield #endif /* __LPASS_H__ */ 82