1/*
2 **************************************************************************
3 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all copies.
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 **************************************************************************
15 */
16
17/**
18 * nss_hal.h
19 *	NSS HAL public declarations.
20 */
21
22#ifndef __NSS_HAL_H
23#define __NSS_HAL_H
24
25#include <linux/platform_device.h>
26#include <linux/version.h>
27
28#include <nss_hal_pvt.h>
29
30#if (NSS_DT_SUPPORT != 1)
31/*
32 * nss_hal_common_reset()
33 */
34static inline void nss_hal_common_reset(uint32_t *clk_src)
35{
36	__nss_hal_common_reset(clk_src);
37}
38#endif
39
40/*
41 * nss_hal_core_reset()
42 */
43#if (NSS_DT_SUPPORT != 1)
44static inline void nss_hal_core_reset(uint32_t core_id, uint32_t map, uint32_t addr, uint32_t clk_src)
45{
46	__nss_hal_core_reset(core_id, map, addr, clk_src);
47}
48#else
49static inline void nss_hal_core_reset(uint32_t map_base, uint32_t reset_addr)
50{
51	__nss_hal_core_reset(map_base, reset_addr);
52}
53#endif
54
55/*
56 * nss_hal_read_interrupt_cause()
57 */
58static inline void nss_hal_read_interrupt_cause(uint32_t map, uint32_t irq, uint32_t shift_factor, uint32_t *cause)
59{
60	__nss_hal_read_interrupt_cause(map, irq, shift_factor, cause);
61}
62
63/*
64 * nss_hal_clear_interrupt_cause()
65 */
66static inline void nss_hal_clear_interrupt_cause(uint32_t map, uint32_t irq, uint32_t shift_factor, uint32_t cause)
67{
68	__nss_hal_clear_interrupt_cause(map, irq, shift_factor, cause);
69}
70
71/*
72 * nss_hal_disable_interrupt()
73 */
74static inline void nss_hal_disable_interrupt(uint32_t map, uint32_t irq, uint32_t shift_factor, uint32_t cause)
75{
76	__nss_hal_disable_interrupt(map, irq, shift_factor, cause);
77}
78
79/*
80 * nss_hal_enable_interrupt()
81 */
82static inline void nss_hal_enable_interrupt(uint32_t map, uint32_t irq, uint32_t shift_factor, uint32_t cause)
83{
84	__nss_hal_enable_interrupt(map, irq, shift_factor, cause);
85}
86
87/*
88 * nss_hal_send_interrupt()
89 */
90static inline void nss_hal_send_interrupt(uint32_t map, uint32_t irq, uint32_t cause)
91{
92	__nss_hal_send_interrupt(map, irq, cause);
93}
94
95/*
96 * nss_hal_debug_enable()
97 */
98static inline void nss_hal_debug_enable(void)
99{
100	__nss_hal_debug_enable();
101}
102
103/*
104 * nss_hal_probe()
105 */
106#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,7,0))
107int __devinit nss_hal_probe(struct platform_device *nss_dev);
108#else
109int nss_hal_probe(struct platform_device *nss_dev);
110#endif
111
112/*
113 * nss_hal_remove()
114 */
115#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,7,0))
116int __devexit nss_hal_remove(struct platform_device *nss_dev);
117#else
118int nss_hal_remove(struct platform_device *nss_dev);
119#endif
120
121#endif /* __NSS_HAL_H */
122