diff options
author | Noé Rubinstein <nrubinstein@proformatique.com> | 2010-07-28 12:25:26 +0200 |
---|---|---|
committer | Noé Rubinstein <nrubinstein@proformatique.com> | 2010-07-28 12:25:26 +0200 |
commit | ed6f4dbfa44f154af94776093a2b43fc7a8a7320 (patch) | |
tree | f005809a0ba245d6ca4f7ecfa1e6075db1fe7687 /xhfc/xhfc.h | |
parent | f10dbbcb7cd35ac9bc3406dab41177572faa884d (diff) |
GPIO kernel interface driver
Diffstat (limited to 'xhfc/xhfc.h')
-rw-r--r-- | xhfc/xhfc.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/xhfc/xhfc.h b/xhfc/xhfc.h new file mode 100644 index 0000000..ef9fc1e --- /dev/null +++ b/xhfc/xhfc.h @@ -0,0 +1,80 @@ +#ifndef __XHFC_HWTD_H__ +#define __XHFC_HWTD_H__ + +#include <linux/interrupt.h> +#include "xhfc24sucd.h" + +#define DRIVER_NAME "xhfc_hdlc" + +#ifndef CHIP_ID_2S4U +#define CHIP_ID_2S4U 0x62 +#endif +#ifndef CHIP_ID_4SU +#define CHIP_ID_4SU 0x63 +#endif +#ifndef CHIP_ID_1SU +#define CHIP_ID_1SU 0x60 +#endif +#ifndef CHIP_ID_2SU +#define CHIP_ID_2SU 0x61 +#endif + +#define XHFC_PCM_MASTER 0 +#define XHFC_PCM_SLAVE 1 +#define VERBOSE_TRANSACTIONS 0 + +#define dbg(code) do { \ + printk(KERN_DEBUG __FILE__ ":%s:%d: " #code "\n", \ + __FUNCTION__, __LINE__); code; \ + } while (0) + +#define dbg_d(code) printk(KERN_DEBUG __FILE__ ":%s:%d: " #code " => %d\n", \ + __FUNCTION__, __LINE__, code); + +/* some forward declaration */ +struct xhfc_test; +struct xhfc_pi; +struct xhfc; + +/**********************/ +/* hardware structure */ +/**********************/ +struct xhfc { + char *name; + __u8 chipidx; /* index in pi->xhfcs[NUM_XHFCS] */ + struct xhfc_pi *pi; /* backpointer to xhfc_pi */ + + spinlock_t lock; + + int num_ports; /* number of S and U interfaces */ + int max_fifo; /* always 4 fifos per port */ + int max_z; + int irq_cnt; + + struct xhfc_test* testdata; + +}; + + +/**********************/ +/* hardware structure */ +/**********************/ +struct xhfc_pi { + + struct tlp_leb_regs __iomem *regs; + u8 __iomem *cs_n0; + int irq; + + char name[16]; /* 'XHFC_PI0' = ProcessorInterface no. 0 */ + struct xhfc xhfc; /* mem for one XHFC */ + +}; + +void xhfc_waitbusy(struct xhfc * xhfc); +void xhfc_selfifo(struct xhfc * xhfc, int fifo, int receive); +void xhfc_inc_f(struct xhfc * xhfc); +int xhfc_reset(struct xhfc * xhfc); +int xhfc_chipid(struct xhfc * xhfc); +int xhfc_cfg_pcm_loop1(struct xhfc * xhfc, __u8 pcm); + +#endif // __XHFC_HWTD_H__ |