1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef H_PLAT_BOARD_RFKILL_WLAN_H 3#define H_PLAT_BOARD_RFKILL_WLAN_H 4 5#include <linux/types.h> 6#include <linux/init.h> 7#include <linux/device.h> 8#include <linux/clk.h> 9 10struct rksdmmc_iomux { 11 char *name; // set the MACRO of gpio 12 int fgpio; 13 int fmux; 14}; 15 16struct 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 23struct rksdmmc_pmu { 24 bool power_ctrl_by_pmu; 25 char pmu_regulator[20]; 26 int enable; 27}; 28 29struct 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 49int rfkill_get_wifi_power_state(int *power); 50void *rockchip_mem_prealloc(int section, unsigned long size); 51int rfkill_set_wifi_bt_power(int on); 52int rockchip_wifi_power(int on); 53int rockchip_wifi_set_carddetect(int val); 54int rockchip_wifi_get_oob_irq(void); 55int rockchip_wifi_get_oob_irq_flag(void); 56int rockchip_wifi_reset(int on); 57int rockchip_wifi_mac_addr(unsigned char *buf); 58void *rockchip_wifi_country_code(char *ccode); 59int rfkill_wlan_init(void); 60void rfkill_wlan_exit(void); 61 62#endif 63