• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PLAT_BOARD_H
3 #define __PLAT_BOARD_H
4 
5 #include <linux/types.h>
6 #include <linux/init.h>
7 #include <linux/device.h>
8 #include <linux/clk.h>
9 
10 struct rksdmmc_iomux {
11     char    *name;  //set the MACRO of gpio
12     int     fgpio;
13     int     fmux;
14 };
15 
16 struct rksdmmc_gpio {
17     int     io;                             //set the address of gpio
18     char    name[64];   //
19     int     enable;  // disable = !enable   //set the default value,i.e,GPIO_HIGH or GPIO_LOW
20     struct rksdmmc_iomux  iomux;
21 };
22 
23 struct rksdmmc_pmu {
24     bool power_ctrl_by_pmu;
25     char pmu_regulator[20];
26     int  enable;
27 };
28 
29 struct rksdmmc_gpio_wifi_moudle {
30     int sdio_vol;    //sdio reference voltage
31     bool vref_ctrl_enble;
32     bool wifi_power_remain;
33     struct rksdmmc_pmu    mregulator;
34     struct rksdmmc_pmu    ioregulator;
35     struct rksdmmc_gpio   vbat_n;
36     struct rksdmmc_gpio   power_n;  //PMU_EN
37     struct rksdmmc_gpio   reset_n;  //SYSRET_B, DAIRST
38     struct rksdmmc_gpio   vddio;
39     struct rksdmmc_gpio   bgf_int_b;
40     struct rksdmmc_gpio   wifi_int_b;
41     struct rksdmmc_gpio   gps_sync;
42     struct rksdmmc_gpio   ANTSEL2;  //pin5--ANTSEL2
43     struct rksdmmc_gpio   ANTSEL3;  //pin6--ANTSEL3
44     struct rksdmmc_gpio   GPS_LAN;  //pin33--GPS_LAN
45     struct regmap *grf;
46 	struct clk *ext_clk;
47 };
48 
49 int rfkill_get_wifi_power_state(int *power);
50 void *rockchip_mem_prealloc(int section, unsigned long size);
51 int rfkill_set_wifi_bt_power(int on);
52 int rockchip_wifi_power(int on);
53 int rockchip_wifi_set_carddetect(int val);
54 int rockchip_wifi_get_oob_irq(void);
55 int rockchip_wifi_get_oob_irq_flag(void);
56 int rockchip_wifi_reset(int on);
57 int rockchip_wifi_mac_addr(unsigned char *buf);
58 void *rockchip_wifi_country_code(char *ccode);
59 int rfkill_wlan_init(void);
60 void rfkill_wlan_exit(void);
61 
62 #endif
63