Commit | Line | Data |
---|---|---|
a4d7d550 KM |
1 | #ifndef __SOUND_FSI_H |
2 | #define __SOUND_FSI_H | |
3 | ||
4 | /* | |
5 | * Fifo-attached Serial Interface (FSI) support for SH7724 | |
6 | * | |
7 | * Copyright (C) 2009 Renesas Solutions Corp. | |
8 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License version 2 as | |
12 | * published by the Free Software Foundation. | |
13 | */ | |
14 | ||
3c2ef841 KM |
15 | #define FSI_PORT_A 0 |
16 | #define FSI_PORT_B 1 | |
17 | ||
a4d7d550 KM |
18 | #include <linux/clk.h> |
19 | #include <sound/soc.h> | |
20 | ||
f17c13ca KM |
21 | /* |
22 | * flags format | |
23 | * | |
766812e6 | 24 | * 0x00000CBA |
f17c13ca KM |
25 | * |
26 | * A: inversion | |
27 | * B: format mode | |
766812e6 | 28 | * C: chip specific |
f17c13ca | 29 | */ |
a4d7d550 | 30 | |
f17c13ca KM |
31 | /* A: clock inversion */ |
32 | #define SH_FSI_INVERSION_MASK 0x0000000F | |
33 | #define SH_FSI_LRM_INV (1 << 0) | |
34 | #define SH_FSI_BRM_INV (1 << 1) | |
35 | #define SH_FSI_LRS_INV (1 << 2) | |
36 | #define SH_FSI_BRS_INV (1 << 3) | |
37 | ||
38 | /* B: format mode */ | |
39 | #define SH_FSI_FMT_MASK 0x000000F0 | |
40 | #define SH_FSI_FMT_DAI (0 << 4) | |
41 | #define SH_FSI_FMT_SPDIF (1 << 4) | |
a4d7d550 | 42 | |
766812e6 KM |
43 | /* C: chip specific */ |
44 | #define SH_FSI_OPTION_MASK 0x00000F00 | |
45 | #define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */ | |
ccad7b44 KM |
46 | |
47 | /* | |
48 | * set_rate return value | |
49 | * | |
50 | * see ACKMD/BPFMD on | |
51 | * ACK_MD (FSI2) | |
52 | * CKG1 (FSI) | |
53 | * | |
d4bc99b9 KM |
54 | * err : return value < 0 |
55 | * no change : return value == 0 | |
56 | * change xMD : return value > 0 | |
ccad7b44 KM |
57 | * |
58 | * 0x-00000AB | |
59 | * | |
60 | * A: ACKMD value | |
61 | * B: BPFMD value | |
62 | */ | |
63 | ||
64 | #define SH_FSI_ACKMD_MASK (0xF << 0) | |
65 | #define SH_FSI_ACKMD_512 (1 << 0) | |
66 | #define SH_FSI_ACKMD_256 (2 << 0) | |
67 | #define SH_FSI_ACKMD_128 (3 << 0) | |
68 | #define SH_FSI_ACKMD_64 (4 << 0) | |
69 | #define SH_FSI_ACKMD_32 (5 << 0) | |
70 | ||
71 | #define SH_FSI_BPFMD_MASK (0xF << 4) | |
72 | #define SH_FSI_BPFMD_512 (1 << 4) | |
73 | #define SH_FSI_BPFMD_256 (2 << 4) | |
74 | #define SH_FSI_BPFMD_128 (3 << 4) | |
75 | #define SH_FSI_BPFMD_64 (4 << 4) | |
76 | #define SH_FSI_BPFMD_32 (5 << 4) | |
77 | #define SH_FSI_BPFMD_16 (6 << 4) | |
78 | ||
fec691e7 KM |
79 | struct sh_fsi_port_info { |
80 | unsigned long flags; | |
7da9ced6 KM |
81 | int tx_id; |
82 | int rx_id; | |
fec691e7 KM |
83 | int (*set_rate)(struct device *dev, int rate, int enable); |
84 | }; | |
85 | ||
a4d7d550 | 86 | struct sh_fsi_platform_info { |
fec691e7 KM |
87 | struct sh_fsi_port_info port_a; |
88 | struct sh_fsi_port_info port_b; | |
a4d7d550 KM |
89 | }; |
90 | ||
a4d7d550 | 91 | #endif /* __SOUND_FSI_H */ |