Linux Audio

Check our new training course

Loading...
v3.1
 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
15#define FSI_PORT_A	0
16#define FSI_PORT_B	1
17
18#include <linux/clk.h>
19#include <sound/soc.h>
20
21/*
22 * flags format
23 *
24 * 0x000000BA
25 *
26 * A:  inversion
27 * B:  format mode
28 */
29
30/* A: clock inversion */
31#define SH_FSI_INVERSION_MASK	0x0000000F
32#define SH_FSI_LRM_INV		(1 << 0)
33#define SH_FSI_BRM_INV		(1 << 1)
34#define SH_FSI_LRS_INV		(1 << 2)
35#define SH_FSI_BRS_INV		(1 << 3)
36
37/* B: format mode */
38#define SH_FSI_FMT_MASK		0x000000F0
39#define SH_FSI_FMT_DAI		(0 << 4)
40#define SH_FSI_FMT_SPDIF	(1 << 4)
41
42
43/*
44 * set_rate return value
45 *
46 * see ACKMD/BPFMD on
47 *     ACK_MD (FSI2)
48 *     CKG1   (FSI)
49 *
50 * err		: return value <  0
51 * no change	: return value == 0
52 * change xMD	: return value >  0
53 *
54 * 0x-00000AB
55 *
56 * A:  ACKMD value
57 * B:  BPFMD value
58 */
59
60#define SH_FSI_ACKMD_MASK	(0xF << 0)
61#define SH_FSI_ACKMD_512	(1 << 0)
62#define SH_FSI_ACKMD_256	(2 << 0)
63#define SH_FSI_ACKMD_128	(3 << 0)
64#define SH_FSI_ACKMD_64		(4 << 0)
65#define SH_FSI_ACKMD_32		(5 << 0)
66
67#define SH_FSI_BPFMD_MASK	(0xF << 4)
68#define SH_FSI_BPFMD_512	(1 << 4)
69#define SH_FSI_BPFMD_256	(2 << 4)
70#define SH_FSI_BPFMD_128	(3 << 4)
71#define SH_FSI_BPFMD_64		(4 << 4)
72#define SH_FSI_BPFMD_32		(5 << 4)
73#define SH_FSI_BPFMD_16		(6 << 4)
74
75struct sh_fsi_platform_info {
76	unsigned long porta_flags;
77	unsigned long portb_flags;
78	int (*set_rate)(struct device *dev, int is_porta, int rate, int enable);
79};
80
81#endif /* __SOUND_FSI_H */
v5.4
 1/* SPDX-License-Identifier: GPL-2.0
 2 *
 
 
 3 * Fifo-attached Serial Interface (FSI) support for SH7724
 4 *
 5 * Copyright (C) 2009 Renesas Solutions Corp.
 6 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
 
 
 
 
 7 */
 8#ifndef __SOUND_FSI_H
 9#define __SOUND_FSI_H
 
10
11#include <linux/clk.h>
12#include <sound/soc.h>
13
14/*
15 * flags
 
 
 
 
 
16 */
17#define SH_FSI_FMT_SPDIF		(1 << 0) /* spdif for HDMI */
18#define SH_FSI_ENABLE_STREAM_MODE	(1 << 1) /* for 16bit data */
19#define SH_FSI_CLK_CPG			(1 << 2) /* FSIxCK + FSI-DIV */
20
21struct sh_fsi_port_info {
22	unsigned long flags;
23	int tx_id;
24	int rx_id;
25};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
27struct sh_fsi_platform_info {
28	struct sh_fsi_port_info port_a;
29	struct sh_fsi_port_info port_b;
 
30};
31
32#endif /* __SOUND_FSI_H */