1*b8b572e1SStephen Rothwell /* 2*b8b572e1SStephen Rothwell * Freescale General-purpose Timers Module 3*b8b572e1SStephen Rothwell * 4*b8b572e1SStephen Rothwell * Copyright (c) Freescale Semicondutor, Inc. 2006. 5*b8b572e1SStephen Rothwell * Shlomi Gridish <gridish@freescale.com> 6*b8b572e1SStephen Rothwell * Jerry Huang <Chang-Ming.Huang@freescale.com> 7*b8b572e1SStephen Rothwell * Copyright (c) MontaVista Software, Inc. 2008. 8*b8b572e1SStephen Rothwell * Anton Vorontsov <avorontsov@ru.mvista.com> 9*b8b572e1SStephen Rothwell * 10*b8b572e1SStephen Rothwell * This program is free software; you can redistribute it and/or modify it 11*b8b572e1SStephen Rothwell * under the terms of the GNU General Public License as published by the 12*b8b572e1SStephen Rothwell * Free Software Foundation; either version 2 of the License, or (at your 13*b8b572e1SStephen Rothwell * option) any later version. 14*b8b572e1SStephen Rothwell */ 15*b8b572e1SStephen Rothwell 16*b8b572e1SStephen Rothwell #ifndef __ASM_FSL_GTM_H 17*b8b572e1SStephen Rothwell #define __ASM_FSL_GTM_H 18*b8b572e1SStephen Rothwell 19*b8b572e1SStephen Rothwell #include <linux/types.h> 20*b8b572e1SStephen Rothwell 21*b8b572e1SStephen Rothwell struct gtm; 22*b8b572e1SStephen Rothwell 23*b8b572e1SStephen Rothwell struct gtm_timer { 24*b8b572e1SStephen Rothwell unsigned int irq; 25*b8b572e1SStephen Rothwell 26*b8b572e1SStephen Rothwell struct gtm *gtm; 27*b8b572e1SStephen Rothwell bool requested; 28*b8b572e1SStephen Rothwell u8 __iomem *gtcfr; 29*b8b572e1SStephen Rothwell __be16 __iomem *gtmdr; 30*b8b572e1SStephen Rothwell __be16 __iomem *gtpsr; 31*b8b572e1SStephen Rothwell __be16 __iomem *gtcnr; 32*b8b572e1SStephen Rothwell __be16 __iomem *gtrfr; 33*b8b572e1SStephen Rothwell __be16 __iomem *gtevr; 34*b8b572e1SStephen Rothwell }; 35*b8b572e1SStephen Rothwell 36*b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_timer16(void); 37*b8b572e1SStephen Rothwell extern struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm, 38*b8b572e1SStephen Rothwell unsigned int timer); 39*b8b572e1SStephen Rothwell extern void gtm_put_timer16(struct gtm_timer *tmr); 40*b8b572e1SStephen Rothwell extern int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec, 41*b8b572e1SStephen Rothwell bool reload); 42*b8b572e1SStephen Rothwell extern int gtm_set_exact_timer16(struct gtm_timer *tmr, u16 usec, 43*b8b572e1SStephen Rothwell bool reload); 44*b8b572e1SStephen Rothwell extern void gtm_stop_timer16(struct gtm_timer *tmr); 45*b8b572e1SStephen Rothwell extern void gtm_ack_timer16(struct gtm_timer *tmr, u16 events); 46*b8b572e1SStephen Rothwell 47*b8b572e1SStephen Rothwell #endif /* __ASM_FSL_GTM_H */ 48