Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * arch/powerpc/include/asm/mpic_timer.h
0004  *
0005  * Header file for Mpic Global Timer
0006  *
0007  * Copyright 2013 Freescale Semiconductor, Inc.
0008  *
0009  * Author: Wang Dongsheng <Dongsheng.Wang@freescale.com>
0010  *     Li Yang <leoli@freescale.com>
0011  */
0012 
0013 #ifndef __MPIC_TIMER__
0014 #define __MPIC_TIMER__
0015 
0016 #include <linux/interrupt.h>
0017 #include <linux/time.h>
0018 
0019 struct mpic_timer {
0020     void            *dev;
0021     struct cascade_priv *cascade_handle;
0022     unsigned int        num;
0023     unsigned int        irq;
0024 };
0025 
0026 #ifdef CONFIG_MPIC_TIMER
0027 struct mpic_timer *mpic_request_timer(irq_handler_t fn,  void *dev,
0028         time64_t time);
0029 void mpic_start_timer(struct mpic_timer *handle);
0030 void mpic_stop_timer(struct mpic_timer *handle);
0031 void mpic_get_remain_time(struct mpic_timer *handle, time64_t *time);
0032 void mpic_free_timer(struct mpic_timer *handle);
0033 #else
0034 struct mpic_timer *mpic_request_timer(irq_handler_t fn,  void *dev,
0035         time64_t time) { return NULL; }
0036 void mpic_start_timer(struct mpic_timer *handle) { }
0037 void mpic_stop_timer(struct mpic_timer *handle) { }
0038 void mpic_get_remain_time(struct mpic_timer *handle, time64_t *time) { }
0039 void mpic_free_timer(struct mpic_timer *handle) { }
0040 #endif
0041 
0042 #endif