xref: /linux/drivers/soc/fsl/qe/tsa.h (revision e724e7aaf9ca794670a4d4931af7a7e24e37fec3)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * TSA management
4  *
5  * Copyright 2022 CS GROUP France
6  *
7  * Author: Herve Codina <herve.codina@bootlin.com>
8  */
9 #ifndef __SOC_FSL_TSA_H__
10 #define __SOC_FSL_TSA_H__
11 
12 #include <linux/types.h>
13 
14 struct device_node;
15 struct device;
16 struct tsa_serial;
17 
18 struct tsa_serial *tsa_serial_get_byphandle(struct device_node *np,
19 					    const char *phandle_name);
20 void tsa_serial_put(struct tsa_serial *tsa_serial);
21 struct tsa_serial *devm_tsa_serial_get_byphandle(struct device *dev,
22 						 struct device_node *np,
23 						 const char *phandle_name);
24 
25 /* Connect and disconnect the TSA serial */
26 int tsa_serial_connect(struct tsa_serial *tsa_serial);
27 int tsa_serial_disconnect(struct tsa_serial *tsa_serial);
28 
29 /* Cell information */
30 struct tsa_serial_info {
31 	unsigned long rx_fs_rate;
32 	unsigned long rx_bit_rate;
33 	u8 nb_rx_ts;
34 	unsigned long tx_fs_rate;
35 	unsigned long tx_bit_rate;
36 	u8 nb_tx_ts;
37 };
38 
39 /* Get information */
40 int tsa_serial_get_info(struct tsa_serial *tsa_serial, struct tsa_serial_info *info);
41 
42 #endif /* __SOC_FSL_TSA_H__ */
43