11d4ba0b8SHerve Codina /* SPDX-License-Identifier: GPL-2.0 */ 21d4ba0b8SHerve Codina /* 31d4ba0b8SHerve Codina * TSA management 41d4ba0b8SHerve Codina * 51d4ba0b8SHerve Codina * Copyright 2022 CS GROUP France 61d4ba0b8SHerve Codina * 71d4ba0b8SHerve Codina * Author: Herve Codina <herve.codina@bootlin.com> 81d4ba0b8SHerve Codina */ 91d4ba0b8SHerve Codina #ifndef __SOC_FSL_TSA_H__ 101d4ba0b8SHerve Codina #define __SOC_FSL_TSA_H__ 111d4ba0b8SHerve Codina 121d4ba0b8SHerve Codina #include <linux/types.h> 131d4ba0b8SHerve Codina 141d4ba0b8SHerve Codina struct device_node; 151d4ba0b8SHerve Codina struct device; 161d4ba0b8SHerve Codina struct tsa_serial; 171d4ba0b8SHerve Codina 181d4ba0b8SHerve Codina struct tsa_serial *tsa_serial_get_byphandle(struct device_node *np, 191d4ba0b8SHerve Codina const char *phandle_name); 201d4ba0b8SHerve Codina void tsa_serial_put(struct tsa_serial *tsa_serial); 211d4ba0b8SHerve Codina struct tsa_serial *devm_tsa_serial_get_byphandle(struct device *dev, 221d4ba0b8SHerve Codina struct device_node *np, 231d4ba0b8SHerve Codina const char *phandle_name); 241d4ba0b8SHerve Codina 251d4ba0b8SHerve Codina /* Connect and disconnect the TSA serial */ 261d4ba0b8SHerve Codina int tsa_serial_connect(struct tsa_serial *tsa_serial); 271d4ba0b8SHerve Codina int tsa_serial_disconnect(struct tsa_serial *tsa_serial); 281d4ba0b8SHerve Codina 291d4ba0b8SHerve Codina /* Cell information */ 301d4ba0b8SHerve Codina struct tsa_serial_info { 311d4ba0b8SHerve Codina unsigned long rx_fs_rate; 321d4ba0b8SHerve Codina unsigned long rx_bit_rate; 331d4ba0b8SHerve Codina u8 nb_rx_ts; 341d4ba0b8SHerve Codina unsigned long tx_fs_rate; 351d4ba0b8SHerve Codina unsigned long tx_bit_rate; 361d4ba0b8SHerve Codina u8 nb_tx_ts; 371d4ba0b8SHerve Codina }; 381d4ba0b8SHerve Codina 391d4ba0b8SHerve Codina /* Get information */ 401d4ba0b8SHerve Codina int tsa_serial_get_info(struct tsa_serial *tsa_serial, struct tsa_serial_info *info); 411d4ba0b8SHerve Codina 42*38258909SHerve Codina /* Get serial number */ 43*38258909SHerve Codina int tsa_serial_get_num(struct tsa_serial *tsa_serial); 44*38258909SHerve Codina 451d4ba0b8SHerve Codina #endif /* __SOC_FSL_TSA_H__ */ 46