1 /* SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2021, MediaTek Inc.
4 * Copyright (c) 2021-2022, Intel Corporation.
18 #ifndef __T7XX_MODEM_OPS_H__
19 #define __T7XX_MODEM_OPS_H__
21 #include <linux/spinlock.h>
22 #include <linux/types.h>
23 #include <linux/workqueue.h>
25 #include "t7xx_hif_cldma.h"
28 #define FEATURE_COUNT 64
31 * enum hif_ex_stage - HIF exception handshake stages with the HW.
32 * @HIF_EX_INIT: Disable and clear TXQ.
33 * @HIF_EX_INIT_DONE: Polling for initialization to be done.
34 * @HIF_EX_CLEARQ_DONE: Disable RX, flush TX/RX workqueues and clear RX.
35 * @HIF_EX_ALLQ_RESET: HW is back in safe mode for re-initialization and restart.
44 struct mtk_runtime_feature {
58 struct t7xx_sys_info {
60 bool handshake_ongoing;
61 u8 feature_set[FEATURE_COUNT];
62 struct t7xx_port *ctl_port;
66 struct cldma_ctrl *md_ctrl[CLDMA_NUM];
67 struct t7xx_pci_dev *t7xx_dev;
68 struct t7xx_sys_info core_md;
70 bool rgu_irq_asserted;
71 struct workqueue_struct *handshake_wq;
72 struct work_struct handshake_work;
73 struct t7xx_fsm_ctl *fsm_ctl;
74 struct port_proxy *port_prox;
76 spinlock_t exp_lock; /* Protects exception events */
79 void t7xx_md_exception_handshake(struct t7xx_modem *md);
80 void t7xx_md_event_notify(struct t7xx_modem *md, enum md_event_id evt_id);
81 int t7xx_md_reset(struct t7xx_pci_dev *t7xx_dev);
82 int t7xx_md_init(struct t7xx_pci_dev *t7xx_dev);
83 void t7xx_md_exit(struct t7xx_pci_dev *t7xx_dev);
84 void t7xx_clear_rgu_irq(struct t7xx_pci_dev *t7xx_dev);
85 int t7xx_acpi_fldr_func(struct t7xx_pci_dev *t7xx_dev);
86 int t7xx_pci_mhccif_isr(struct t7xx_pci_dev *t7xx_dev);
88 #endif /* __T7XX_MODEM_OPS_H__ */