Skip to content

Commit d0c6525

Browse files
committed
Merge remote-tracking branch 'asoc/topic/fsi' into asoc-next
2 parents 1b4327d + e43fc6a commit d0c6525

7 files changed

Lines changed: 122 additions & 262 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Renesas FSI
2+
3+
Required properties:
4+
- compatible : "renesas,sh_fsi2" or "renesas,sh_fsi"
5+
- reg : Should contain the register physical address and length
6+
- interrupts : Should contain FSI interrupt
7+
8+
- fsia,spdif-connection : FSI is connected by S/PDFI
9+
- fsia,stream-mode-support : FSI supports 16bit stream mode.
10+
- fsia,use-internal-clock : FSI uses internal clock when master mode.
11+
12+
- fsib,spdif-connection : same as fsia
13+
- fsib,stream-mode-support : same as fsia
14+
- fsib,use-internal-clock : same as fsia
15+
16+
Example:
17+
18+
sh_fsi2: sh_fsi2@0xec230000 {
19+
compatible = "renesas,sh_fsi2";
20+
reg = <0xec230000 0x400>;
21+
interrupts = <0 146 0x4>;
22+
23+
fsia,spdif-connection;
24+
fsia,stream-mode-support;
25+
fsia,use-internal-clock;
26+
};

‎arch/arm/mach-shmobile/board-ap4evb.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -657,14 +657,8 @@ static struct platform_device lcdc_device = {
657657
/* FSI */
658658
#define IRQ_FSI evt2irq(0x1840)
659659
static struct sh_fsi_platform_info fsi_info = {
660-
.port_a = {
661-
.flags = SH_FSI_BRS_INV,
662-
},
663660
.port_b = {
664-
.flags = SH_FSI_BRS_INV |
665-
SH_FSI_BRM_INV |
666-
SH_FSI_LRS_INV |
667-
SH_FSI_CLK_CPG |
661+
.flags = SH_FSI_CLK_CPG |
668662
SH_FSI_FMT_SPDIF,
669663
},
670664
};
@@ -816,7 +810,8 @@ static struct platform_device lcdc1_device = {
816810
};
817811

818812
static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
819-
.cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM,
813+
.cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM |
814+
SND_SOC_DAIFMT_IB_NF,
820815
};
821816

822817
static struct asoc_simple_card_info fsi2_hdmi_info = {

‎arch/arm/mach-shmobile/board-mackerel.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ static struct platform_device hdmi_lcdc_device = {
503503
};
504504

505505
static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
506-
.cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM,
506+
.cpu_daifmt = SND_SOC_DAIFMT_CBM_CFM |
507+
SND_SOC_DAIFMT_IB_NF,
507508
};
508509

509510
static struct asoc_simple_card_info fsi2_hdmi_info = {
@@ -858,16 +859,12 @@ static struct platform_device leds_device = {
858859
#define IRQ_FSI evt2irq(0x1840)
859860
static struct sh_fsi_platform_info fsi_info = {
860861
.port_a = {
861-
.flags = SH_FSI_BRS_INV,
862862
.tx_id = SHDMA_SLAVE_FSIA_TX,
863863
.rx_id = SHDMA_SLAVE_FSIA_RX,
864864
},
865865
.port_b = {
866-
.flags = SH_FSI_BRS_INV |
867-
SH_FSI_BRM_INV |
868-
SH_FSI_LRS_INV |
869-
SH_FSI_CLK_CPG |
870-
SH_FSI_FMT_SPDIF,
866+
.flags = SH_FSI_CLK_CPG |
867+
SH_FSI_FMT_SPDIF,
871868
}
872869
};
873870

‎arch/sh/boards/mach-ecovec24/setup.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -887,12 +887,6 @@ static struct platform_device camera_devices[] = {
887887
};
888888

889889
/* FSI */
890-
static struct sh_fsi_platform_info fsi_info = {
891-
.port_b = {
892-
.flags = SH_FSI_BRS_INV,
893-
},
894-
};
895-
896890
static struct resource fsi_resources[] = {
897891
[0] = {
898892
.name = "FSI",
@@ -911,15 +905,13 @@ static struct platform_device fsi_device = {
911905
.id = 0,
912906
.num_resources = ARRAY_SIZE(fsi_resources),
913907
.resource = fsi_resources,
914-
.dev = {
915-
.platform_data = &fsi_info,
916-
},
917908
};
918909

919910
static struct asoc_simple_dai_init_info fsi_da7210_init_info = {
920911
.fmt = SND_SOC_DAIFMT_I2S,
921912
.codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
922-
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
913+
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS |
914+
SND_SOC_DAIFMT_IB_NF,
923915
};
924916

925917
static struct asoc_simple_card_info fsi_da7210_info = {

‎arch/sh/boards/mach-se/7724/setup.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,6 @@ static struct platform_device ceu1_device = {
279279

280280
/* FSI */
281281
/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
282-
static struct sh_fsi_platform_info fsi_info = {
283-
.port_a = {
284-
.flags = SH_FSI_BRS_INV,
285-
},
286-
};
287-
288282
static struct resource fsi_resources[] = {
289283
[0] = {
290284
.name = "FSI",
@@ -303,15 +297,13 @@ static struct platform_device fsi_device = {
303297
.id = 0,
304298
.num_resources = ARRAY_SIZE(fsi_resources),
305299
.resource = fsi_resources,
306-
.dev = {
307-
.platform_data = &fsi_info,
308-
},
309300
};
310301

311302
static struct asoc_simple_dai_init_info fsi2_ak4642_init_info = {
312303
.fmt = SND_SOC_DAIFMT_LEFT_J,
313304
.codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
314-
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
305+
.cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS |
306+
SND_SOC_DAIFMT_IB_NF,
315307
.sysclk = 11289600,
316308
};
317309

‎include/sound/sh_fsi.h‎

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,82 +11,20 @@
1111
* it under the terms of the GNU General Public License version 2 as
1212
* published by the Free Software Foundation.
1313
*/
14-
15-
#define FSI_PORT_A 0
16-
#define FSI_PORT_B 1
17-
1814
#include <linux/clk.h>
1915
#include <sound/soc.h>
2016

2117
/*
22-
* flags format
23-
*
24-
* 0x00000CBA
25-
*
26-
* A: inversion
27-
* B: format mode
28-
* C: chip specific
29-
* D: clock selecter if master mode
18+
* flags
3019
*/
31-
32-
/* A: clock inversion */
33-
#define SH_FSI_INVERSION_MASK 0x0000000F
34-
#define SH_FSI_LRM_INV (1 << 0)
35-
#define SH_FSI_BRM_INV (1 << 1)
36-
#define SH_FSI_LRS_INV (1 << 2)
37-
#define SH_FSI_BRS_INV (1 << 3)
38-
39-
/* B: format mode */
40-
#define SH_FSI_FMT_MASK 0x000000F0
41-
#define SH_FSI_FMT_DAI (0 << 4)
42-
#define SH_FSI_FMT_SPDIF (1 << 4)
43-
44-
/* C: chip specific */
45-
#define SH_FSI_OPTION_MASK 0x00000F00
46-
#define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
47-
48-
/* D: clock selecter if master mode */
49-
#define SH_FSI_CLK_MASK 0x0000F000
50-
#define SH_FSI_CLK_EXTERNAL (0 << 12)
51-
#define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
52-
53-
/*
54-
* set_rate return value
55-
*
56-
* see ACKMD/BPFMD on
57-
* ACK_MD (FSI2)
58-
* CKG1 (FSI)
59-
*
60-
* err : return value < 0
61-
* no change : return value == 0
62-
* change xMD : return value > 0
63-
*
64-
* 0x-00000AB
65-
*
66-
* A: ACKMD value
67-
* B: BPFMD value
68-
*/
69-
70-
#define SH_FSI_ACKMD_MASK (0xF << 0)
71-
#define SH_FSI_ACKMD_512 (1 << 0)
72-
#define SH_FSI_ACKMD_256 (2 << 0)
73-
#define SH_FSI_ACKMD_128 (3 << 0)
74-
#define SH_FSI_ACKMD_64 (4 << 0)
75-
#define SH_FSI_ACKMD_32 (5 << 0)
76-
77-
#define SH_FSI_BPFMD_MASK (0xF << 4)
78-
#define SH_FSI_BPFMD_512 (1 << 4)
79-
#define SH_FSI_BPFMD_256 (2 << 4)
80-
#define SH_FSI_BPFMD_128 (3 << 4)
81-
#define SH_FSI_BPFMD_64 (4 << 4)
82-
#define SH_FSI_BPFMD_32 (5 << 4)
83-
#define SH_FSI_BPFMD_16 (6 << 4)
20+
#define SH_FSI_FMT_SPDIF (1 << 0) /* spdif for HDMI */
21+
#define SH_FSI_ENABLE_STREAM_MODE (1 << 1) /* for 16bit data */
22+
#define SH_FSI_CLK_CPG (1 << 2) /* FSIxCK + FSI-DIV */
8423

8524
struct sh_fsi_port_info {
8625
unsigned long flags;
8726
int tx_id;
8827
int rx_id;
89-
int (*set_rate)(struct device *dev, int rate, int enable);
9028
};
9129

9230
struct sh_fsi_platform_info {

0 commit comments

Comments
 (0)