aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/westbridge/astoria/include/linux/westbridge/cyasintr.h
blob: 60a6fffb5d53aee851072e3268ce572eac6a3556 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* Cypress West Bridge API header file (cyasintr.h)
## ===========================
## Copyright (C) 2010  Cypress Semiconductor
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street
## Fifth Floor, Boston, MA  02110-1301, USA.
## ===========================
*/

#ifndef _INCLUDED_CYASINTR_H_
#define _INCLUDED_CYASINTR_H_

#include "cyasdevice.h"

#include "cyas_cplus_start.h"

/* Summary
   Initialize the interrupt manager module

   Description
   This function is called to initialize the interrupt module.
   This module enables interrupts as well as servies West Bridge
   related interrupts by determining the source of the interrupt
   and calling the appropriate handler function.

   Notes
   If the dmaintr parameter is TRUE, the initialization code
   initializes the interrupt mask to have the DMA related interrupt
   enabled via the general purpose interrupt. However, the interrupt
   service function assumes that the DMA interrupt is handled by the
   HAL layer before the interrupt module handler function is called.

   Returns
   * CY_AS_ERROR_SUCCESS - the interrupt module was initialized
   * correctly
   * CY_AS_ERROR_ALREADY_RUNNING - the interrupt module was already
   * started

   See Also
   * CyAsIntrStop
   * CyAsServiceInterrupt
*/
cy_as_return_status_t
cy_as_intr_start(
	/* Device being initialized */
	cy_as_device *dev_p,
	/* If true, enable the DMA interrupt through the INT signal */
	cy_bool dmaintr
	);

/* Summary
   Stop the interrupt manager module

   Description
   This function stops the interrupt module and masks all interrupts
   from the West Bridge device.

   Returns
   * CY_AS_ERROR_SUCCESS - the interrupt module was stopped
   *	successfully
   * CY_AS_ERROR_NOT_RUNNING - the interrupt module was not
   *	running

   See Also
   * CyAsIntrStart
   * CyAsServiceInterrupt
*/
cy_as_return_status_t
cy_as_intr_stop(
	/* Device bein stopped */
	cy_as_device *dev_p
	);


/* Summary
   The interrupt service routine for West Bridge

   Description
   When an interrupt is detected, this function is called to
   service the West Bridge interrupt. It is safe and efficient
   for this function to be called when no West Bridge interrupt
   has occurred. This function will determine it is not an West
   Bridge interrupt quickly and return.
*/
void cy_as_intr_service_interrupt(
	/* The USER supplied tag for this device */
	cy_as_hal_device_tag tag
	);

#include "cyas_cplus_end.h"

#endif				  /* _INCLUDED_CYASINTR_H_ */