70 lines
2.2 KiB
C
70 lines
2.2 KiB
C
![]() |
#ifndef _STC_DEF_H_
|
|||
|
#define _STC_DEF_H_
|
|||
|
|
|||
|
#include <linux/module.h>
|
|||
|
#include <linux/kernel.h> /*<2A><><EFBFBD><EFBFBD>printk()<29><><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>̬<EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD>*/
|
|||
|
#include <linux/fs.h> /*<2A>ļ<EFBFBD>ϵͳ<CFB5>йصģ<D8B5><C4A3>ṹ<EFBFBD><E1B9B9>file_operationsҲ<73><D2B2>fsͷ<73>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>*/
|
|||
|
#include <linux/init.h> /*init<69><74>exit<69><74><EFBFBD>غ<EFBFBD>*/
|
|||
|
#include <linux/delay.h>
|
|||
|
#include <linux/poll.h>
|
|||
|
#include <linux/irq.h> /*linux<75>ж϶<D0B6><CFB6><EFBFBD>*/
|
|||
|
#include <asm/irq.h>
|
|||
|
#include <linux/interrupt.h> /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>صĴֺ꼰<D6BA>ṹ<EFBFBD><E1B9B9><EFBFBD>Ķ<EFBFBD><C4B6>壬request_irq()<29><>*/
|
|||
|
#include <asm/uaccess.h> /*linux<75>е<EFBFBD><D0B5>û<EFBFBD>̬<EFBFBD>ڴ潻<DAB4><E6BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>copy_from_user(),copy_to_user()<29><>*/
|
|||
|
#include <linux/platform_device.h>
|
|||
|
#include <linux/cdev.h>
|
|||
|
#include <linux/miscdevice.h> /*misc<73><63><EFBFBD><EFBFBD><EFBFBD>豸ע<E8B1B8><D7A2><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>*/
|
|||
|
#include <asm/io.h>
|
|||
|
#include <linux/sched.h>
|
|||
|
#include <linux/ioport.h>
|
|||
|
#include <linux/spinlock.h>
|
|||
|
#include <linux/errno.h>
|
|||
|
#include <linux/fcntl.h>
|
|||
|
#include <linux/init.h>
|
|||
|
#include <linux/proc_fs.h>
|
|||
|
#include <linux/workqueue.h>
|
|||
|
|
|||
|
typedef char sint8;
|
|||
|
typedef unsigned char uint8;
|
|||
|
typedef int sint32;
|
|||
|
typedef unsigned int uint32;
|
|||
|
typedef long sint64;
|
|||
|
typedef unsigned long uint64;
|
|||
|
|
|||
|
|
|||
|
#define SUCCESS (0)
|
|||
|
#define FAILURE (-1)
|
|||
|
#define IRQ_EXCEPTION (0xFFFFFF)
|
|||
|
|
|||
|
#define STC_MODULE_MAGIC 'g'
|
|||
|
#define STC_INT_CFG _IOWR(STC_MODULE_MAGIC, 0x01, uint32)
|
|||
|
|
|||
|
#define STC_REG_BASE_ADDR (0x08568000ull) //STC基地址
|
|||
|
#define STC_REG_LEN (0x08000)
|
|||
|
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
STC_INT_RESERVED = 0, /* Reserved*/ /* Reserved*/
|
|||
|
STC_TOD_1PPS, /* stc 1pps*/
|
|||
|
STC_EX_1PPS_IN, /* external 1pps */
|
|||
|
STC_HSCC_DUMP = 4 /* HSCC_DUMP */
|
|||
|
} stc_int_type_e;
|
|||
|
|
|||
|
struct stc_driver{
|
|||
|
sint32 irq_1pps_tod;
|
|||
|
sint32 irq_1pps_in;
|
|||
|
sint32 irq_hscc_dump;
|
|||
|
uint32 irq_1pps_tod_cnt;
|
|||
|
uint32 irq_1pps_in_cnt;
|
|||
|
uint32 irq_hscc_dump_cnt;
|
|||
|
stc_int_type_e cond_1pps_tod;
|
|||
|
stc_int_type_e cond_1pps_in;
|
|||
|
stc_int_type_e cond_hscc_dump;
|
|||
|
wait_queue_head_t pp1s_tod_queue;
|
|||
|
wait_queue_head_t pp1s_in_queue;
|
|||
|
wait_queue_head_t hscc_dump_queue;
|
|||
|
void __iomem *io_base_addr;
|
|||
|
};
|
|||
|
|
|||
|
#endif
|