18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Freescale General-purpose Timers Module 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright 2006 Freescale Semiconductor, Inc. 68c2ecf20Sopenharmony_ci * Shlomi Gridish <gridish@freescale.com> 78c2ecf20Sopenharmony_ci * Jerry Huang <Chang-Ming.Huang@freescale.com> 88c2ecf20Sopenharmony_ci * Copyright (c) MontaVista Software, Inc. 2008. 98c2ecf20Sopenharmony_ci * Anton Vorontsov <avorontsov@ru.mvista.com> 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#ifndef __ASM_FSL_GTM_H 138c2ecf20Sopenharmony_ci#define __ASM_FSL_GTM_H 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#include <linux/types.h> 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_cistruct gtm; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_cistruct gtm_timer { 208c2ecf20Sopenharmony_ci unsigned int irq; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci struct gtm *gtm; 238c2ecf20Sopenharmony_ci bool requested; 248c2ecf20Sopenharmony_ci u8 __iomem *gtcfr; 258c2ecf20Sopenharmony_ci __be16 __iomem *gtmdr; 268c2ecf20Sopenharmony_ci __be16 __iomem *gtpsr; 278c2ecf20Sopenharmony_ci __be16 __iomem *gtcnr; 288c2ecf20Sopenharmony_ci __be16 __iomem *gtrfr; 298c2ecf20Sopenharmony_ci __be16 __iomem *gtevr; 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciextern struct gtm_timer *gtm_get_timer16(void); 338c2ecf20Sopenharmony_ciextern struct gtm_timer *gtm_get_specific_timer16(struct gtm *gtm, 348c2ecf20Sopenharmony_ci unsigned int timer); 358c2ecf20Sopenharmony_ciextern void gtm_put_timer16(struct gtm_timer *tmr); 368c2ecf20Sopenharmony_ciextern int gtm_set_timer16(struct gtm_timer *tmr, unsigned long usec, 378c2ecf20Sopenharmony_ci bool reload); 388c2ecf20Sopenharmony_ciextern int gtm_set_exact_timer16(struct gtm_timer *tmr, u16 usec, 398c2ecf20Sopenharmony_ci bool reload); 408c2ecf20Sopenharmony_ciextern void gtm_stop_timer16(struct gtm_timer *tmr); 418c2ecf20Sopenharmony_ciextern void gtm_ack_timer16(struct gtm_timer *tmr, u16 events); 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci#endif /* __ASM_FSL_GTM_H */ 44