ASoC: qcom: make osr clock optional
[deliverable/linux.git] / sound / soc / qcom / lpass.h
CommitLineData
cd59f138
KW
1/*
2 * Copyright (c) 2010-2011,2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * lpass.h - Definitions for the QTi LPASS
14 */
15
16#ifndef __LPASS_H__
17#define __LPASS_H__
18
19#include <linux/clk.h>
20#include <linux/compiler.h>
21#include <linux/platform_device.h>
22#include <linux/regmap.h>
23
24#define LPASS_AHBIX_CLOCK_FREQUENCY 131072000
9a127cff 25#define LPASS_MAX_MI2S_PORTS (8)
cd59f138
KW
26
27/* Both the CPU DAI and platform drivers will access this data */
28struct lpass_data {
29
30 /* AHB-I/X bus clocks inside the low-power audio subsystem (LPASS) */
31 struct clk *ahbix_clk;
32
33 /* MI2S system clock */
9a127cff 34 struct clk *mi2s_osr_clk[LPASS_MAX_MI2S_PORTS];
cd59f138
KW
35
36 /* MI2S bit clock (derived from system clock by a divider */
9a127cff 37 struct clk *mi2s_bit_clk[LPASS_MAX_MI2S_PORTS];
cd59f138
KW
38
39 /* low-power audio interface (LPAIF) registers */
40 void __iomem *lpaif;
41
42 /* regmap backed by the low-power audio interface (LPAIF) registers */
43 struct regmap *lpaif_map;
44
45 /* interrupts from the low-power audio interface (LPAIF) */
46 int lpaif_irq;
9bae4880
SK
47
48 /* SOC specific variations in the LPASS IP integration */
49 struct lpass_variant *variant;
50};
51
52/* Vairant data per each SOC */
53struct lpass_variant {
54 u32 i2sctrl_reg_base;
55 u32 i2sctrl_reg_stride;
56 u32 i2s_ports;
57 u32 irq_reg_base;
58 u32 irq_reg_stride;
59 u32 irq_ports;
60 u32 rdma_reg_base;
61 u32 rdma_reg_stride;
62 u32 rdma_channels;
63
64 /* SOC specific intialization like clocks */
65 int (*init)(struct platform_device *pdev);
66 int (*exit)(struct platform_device *pdev);
6db1c6ba
SK
67 int (*alloc_dma_channel)(struct lpass_data *data);
68 int (*free_dma_channel)(struct lpass_data *data, int ch);
9bae4880
SK
69
70 /* SOC specific dais */
71 struct snd_soc_dai_driver *dai_driver;
72 int num_dai;
cd59f138
KW
73};
74
75/* register the platform driver from the CPU DAI driver */
76int asoc_qcom_lpass_platform_register(struct platform_device *);
9bae4880
SK
77int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev);
78int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev);
79int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai);
80extern struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops;
cd59f138
KW
81
82#endif /* __LPASS_H__ */
This page took 0.046549 seconds and 5 git commands to generate.