rcar_snd.h 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Renesas R-Car SRU/SCU/SSIU/SSI support
 *
 * Copyright (C) 2013 Renesas Solutions Corp.
 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.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.
 */

#ifndef RCAR_SND_H
#define RCAR_SND_H


16
#define RSND_GEN1_SRU	0
17
#define RSND_GEN1_ADG	1
18
#define RSND_GEN1_SSI	2
19

20
#define RSND_GEN2_SCU	0
21
#define RSND_GEN2_ADG	1
22 23
#define RSND_GEN2_SSIU	2
#define RSND_GEN2_SSI	3
24

25 26 27 28 29
#define RSND_BASE_MAX	4

/*
 * flags
 *
30
 * 0xAB000000
31 32
 *
 * A : clock sharing settings
33
 * B : SSI direction
34
 */
35

36 37
#define RSND_SSI(_dma_id, _irq, _flags)		\
{ .dma_id = _dma_id, .irq = _irq, .flags = _flags }
38
#define RSND_SSI_UNUSED \
39
{ .dma_id = -1, .irq = -1, .flags = 0 }
40

41
struct rsnd_ssi_platform_info {
42
	int dma_id;
43
	int irq;
44 45
	u32 flags;
};
46

47
#define RSND_SRC(rate, _dma_id)						\
48
{ .convert_rate = rate, .dma_id = _dma_id, }
49
#define RSND_SRC_UNUSED				\
50
{ .convert_rate = 0, .dma_id = -1, }
51 52

struct rsnd_src_platform_info {
53
	u32 convert_rate; /* sampling rate convert */
54
	int dma_id; /* for Gen2 SCU */
55
	int irq;
56
};
57

K
Kuninori Morimoto 已提交
58 59 60
/*
 * flags
 */
61 62 63 64
struct rsnd_ctu_platform_info {
	u32 flags;
};

65 66 67 68
struct rsnd_mix_platform_info {
	u32 flags;
};

K
Kuninori Morimoto 已提交
69 70 71 72
struct rsnd_dvc_platform_info {
	u32 flags;
};

73 74
struct rsnd_dai_path_info {
	struct rsnd_ssi_platform_info *ssi;
75
	struct rsnd_src_platform_info *src;
76
	struct rsnd_ctu_platform_info *ctu;
77
	struct rsnd_mix_platform_info *mix;
K
Kuninori Morimoto 已提交
78
	struct rsnd_dvc_platform_info *dvc;
79 80 81 82 83 84 85
};

struct rsnd_dai_platform_info {
	struct rsnd_dai_path_info playback;
	struct rsnd_dai_path_info capture;
};

86 87 88 89 90 91 92
/*
 * flags
 *
 * 0x0000000A
 *
 * A : generation
 */
93
#define RSND_GEN_MASK	(0xF << 0)
94 95 96
#define RSND_GEN1	(1 << 0) /* fixme */
#define RSND_GEN2	(2 << 0) /* fixme */

97 98
struct rcar_snd_info {
	u32 flags;
99 100
	struct rsnd_ssi_platform_info *ssi_info;
	int ssi_info_nr;
101 102
	struct rsnd_src_platform_info *src_info;
	int src_info_nr;
103 104
	struct rsnd_ctu_platform_info *ctu_info;
	int ctu_info_nr;
105 106
	struct rsnd_mix_platform_info *mix_info;
	int mix_info_nr;
K
Kuninori Morimoto 已提交
107 108
	struct rsnd_dvc_platform_info *dvc_info;
	int dvc_info_nr;
109 110
	struct rsnd_dai_platform_info *dai_info;
	int dai_info_nr;
111 112 113 114 115
	int (*start)(int id);
	int (*stop)(int id);
};

#endif