kernel: add Intel/Lantiq VRX518 EP driver
[openwrt/openwrt.git] / package / kernel / lantiq / vrx518_ep / src / misc.h
1 /*******************************************************************************
2
3 Intel SmartPHY DSL PCIe Endpoint/ACA Linux driver
4 Copyright(c) 2016 Intel Corporation.
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 *******************************************************************************/
23
24 #ifndef MISC_H
25 #define MISC_H
26
27 #define EP_TIMEOUT 10000
28
29 void dc_ep_clkod_disable(struct dc_ep_priv *priv);
30 void dc_ep_icu_init(struct dc_ep_priv *priv);
31 void dc_ep_icu_disable(struct dc_ep_priv *priv);
32 void dc_ep_assert_device(struct dc_ep_priv *priv, u32 bits);
33 void dc_ep_deassert_device(struct dc_ep_priv *priv, u32 bits);
34 int dc_ep_reset_device(struct dc_ep_priv *priv, u32 bits);
35 int dc_ep_clk_on(struct dc_ep_priv *priv, u32 bits);
36 int dc_ep_clk_off(struct dc_ep_priv *priv, u32 bits);
37 int dc_ep_clk_set(struct dc_ep_priv *priv, u32 sysclk, u32 ppeclk);
38 int dc_ep_clk_get(struct dc_ep_priv *priv, u32 *sysclk, u32 *ppeclk);
39 int dc_ep_gpio_dir(struct dc_ep_priv *priv, u32 gpio, int dir);
40 int dc_ep_gpio_set(struct dc_ep_priv *priv, u32 gpio, int val);
41 int dc_ep_gpio_get(struct dc_ep_priv *priv, u32 gpio, int *val);
42 int dc_ep_pinmux_set(struct dc_ep_priv *priv, u32 gpio, int func);
43 int dc_ep_pinmux_get(struct dc_ep_priv *priv, u32 gpio, int *func);
44 int dc_ep_gpio_pupd_set(struct dc_ep_priv *priv, u32 gpio, u32 val);
45 int dc_ep_gpio_od_set(struct dc_ep_priv *priv, u32 gpio, int val);
46 int dc_ep_gpio_src_set(struct dc_ep_priv *priv, u32 gpio, int val);
47 int dc_ep_gpio_dcc_set(struct dc_ep_priv *priv, u32 gpio, u32 val);
48 void dc_ep_icu_dis_intr(struct dc_ep_priv *priv, u32 bits);
49 void dc_ep_icu_en_intr(struct dc_ep_priv *priv, u32 bits);
50
51 #endif /* MISC_H */