0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef __T7XX_MODEM_OPS_H__
0019 #define __T7XX_MODEM_OPS_H__
0020
0021 #include <linux/spinlock.h>
0022 #include <linux/types.h>
0023 #include <linux/workqueue.h>
0024
0025 #include "t7xx_hif_cldma.h"
0026 #include "t7xx_pci.h"
0027
0028 #define FEATURE_COUNT 64
0029
0030
0031
0032
0033
0034
0035
0036
0037 enum hif_ex_stage {
0038 HIF_EX_INIT,
0039 HIF_EX_INIT_DONE,
0040 HIF_EX_CLEARQ_DONE,
0041 HIF_EX_ALLQ_RESET,
0042 };
0043
0044 struct mtk_runtime_feature {
0045 u8 feature_id;
0046 u8 support_info;
0047 u8 reserved[2];
0048 __le32 data_len;
0049 __le32 data[];
0050 };
0051
0052 enum md_event_id {
0053 FSM_PRE_START,
0054 FSM_START,
0055 FSM_READY,
0056 };
0057
0058 struct t7xx_sys_info {
0059 bool ready;
0060 bool handshake_ongoing;
0061 u8 feature_set[FEATURE_COUNT];
0062 struct t7xx_port *ctl_port;
0063 };
0064
0065 struct t7xx_modem {
0066 struct cldma_ctrl *md_ctrl[CLDMA_NUM];
0067 struct t7xx_pci_dev *t7xx_dev;
0068 struct t7xx_sys_info core_md;
0069 bool md_init_finish;
0070 bool rgu_irq_asserted;
0071 struct workqueue_struct *handshake_wq;
0072 struct work_struct handshake_work;
0073 struct t7xx_fsm_ctl *fsm_ctl;
0074 struct port_proxy *port_prox;
0075 unsigned int exp_id;
0076 spinlock_t exp_lock;
0077 };
0078
0079 void t7xx_md_exception_handshake(struct t7xx_modem *md);
0080 void t7xx_md_event_notify(struct t7xx_modem *md, enum md_event_id evt_id);
0081 int t7xx_md_reset(struct t7xx_pci_dev *t7xx_dev);
0082 int t7xx_md_init(struct t7xx_pci_dev *t7xx_dev);
0083 void t7xx_md_exit(struct t7xx_pci_dev *t7xx_dev);
0084 void t7xx_clear_rgu_irq(struct t7xx_pci_dev *t7xx_dev);
0085 int t7xx_acpi_fldr_func(struct t7xx_pci_dev *t7xx_dev);
0086 int t7xx_pci_mhccif_isr(struct t7xx_pci_dev *t7xx_dev);
0087
0088 #endif