From 50c9726b0483b74983542d686a80ad877ed4f2b1 Mon Sep 17 00:00:00 2001 From: hwg Date: Wed, 20 Mar 2013 17:39:26 +0800 Subject: [PATCH] wifi: add mt6622 resource in board --- .../mach-rk30/board-rk3028-tb-sdmmc-conifg.c | 5 +++ arch/arm/mach-rk30/board-rk3028-tb.c | 42 +++++++++++++++++++ .../mach-rk30/board-rk3168-tb-sdmmc-conifg.c | 5 +++ arch/arm/mach-rk30/board-rk3168-tb.c | 42 +++++++++++++++++++ .../mach-rk30/board-rk3168m-tb-sdmmc-conifg.c | 5 +++ arch/arm/mach-rk30/board-rk3168m-tb.c | 42 +++++++++++++++++++ 6 files changed, 141 insertions(+) diff --git a/arch/arm/mach-rk30/board-rk3028-tb-sdmmc-conifg.c b/arch/arm/mach-rk30/board-rk3028-tb-sdmmc-conifg.c index ba831936ebbb..122cf0fadf28 100755 --- a/arch/arm/mach-rk30/board-rk3028-tb-sdmmc-conifg.c +++ b/arch/arm/mach-rk30/board-rk3028-tb-sdmmc-conifg.c @@ -132,6 +132,11 @@ int rk31sdk_get_sdmmc0_pin_io_voltage(void) #endif // #if COMBO_MODULE_MT6620_CDT--#endif #endif +#ifndef RK30SDK_WIFI_GPIO_WIFI_INT_B +#define RK30SDK_WIFI_GPIO_WIFI_INT_B INVALID_GPIO +#define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH +#endif + int rk31sdk_get_sdio_wifi_voltage(void) { int voltage; diff --git a/arch/arm/mach-rk30/board-rk3028-tb.c b/arch/arm/mach-rk30/board-rk3028-tb.c index 61e880afc4d1..ffd1aae95ffc 100755 --- a/arch/arm/mach-rk30/board-rk3028-tb.c +++ b/arch/arm/mach-rk30/board-rk3028-tb.c @@ -1288,6 +1288,41 @@ struct platform_device rk_device_gps = { }; #endif +#if defined(CONFIG_MT5931_MT6622) +static struct mt6622_platform_data mt6622_platdata = { + .power_gpio = { // BT_REG_ON + .io = RK30_PIN3_PD5, // set io to INVALID_GPIO for disable it + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .reset_gpio = { // BT_RST + .io = RK30_PIN0_PD7, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .irq_gpio = { + .io = RK30_PIN3_PD2, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + } +}; + +static struct platform_device device_mt6622 = { + .name = "mt6622", + .id = -1, + .dev = { + .platform_data = &mt6622_platdata, + }, +}; +#endif static struct platform_device *devices[] __initdata = { #ifdef CONFIG_ION @@ -1332,6 +1367,9 @@ static struct platform_device *devices[] __initdata = { &rk_device_gps, #endif +#ifdef CONFIG_MT5931_MT6622 + &device_mt6622, +#endif }; static int rk_platform_add_display_devices(void) @@ -2044,6 +2082,10 @@ static void __init machine_rk30_board_init(void) #if defined(CONFIG_MT6620) clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 48*1000000); #endif + +#if defined(CONFIG_MT5931_MT6622) + clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 24*1000000); +#endif } static void __init rk30_reserve(void) diff --git a/arch/arm/mach-rk30/board-rk3168-tb-sdmmc-conifg.c b/arch/arm/mach-rk30/board-rk3168-tb-sdmmc-conifg.c index 2f687c62e6bc..e44300abd7ec 100644 --- a/arch/arm/mach-rk30/board-rk3168-tb-sdmmc-conifg.c +++ b/arch/arm/mach-rk30/board-rk3168-tb-sdmmc-conifg.c @@ -132,6 +132,11 @@ int rk31sdk_get_sdmmc0_pin_io_voltage(void) #endif // #if COMBO_MODULE_MT6620_CDT--#endif #endif +#ifndef RK30SDK_WIFI_GPIO_WIFI_INT_B +#define RK30SDK_WIFI_GPIO_WIFI_INT_B INVALID_GPIO +#define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH +#endif + int rk31sdk_get_sdio_wifi_voltage(void) { int voltage; diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index b5e8d6a58950..5a115778937d 100755 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -1272,6 +1272,41 @@ struct platform_device rk_device_gps = { }; #endif +#if defined(CONFIG_MT5931_MT6622) +static struct mt6622_platform_data mt6622_platdata = { + .power_gpio = { // BT_REG_ON + .io = RK30_PIN3_PD5, // set io to INVALID_GPIO for disable it + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .reset_gpio = { // BT_RST + .io = RK30_PIN0_PD7, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .irq_gpio = { + .io = RK30_PIN3_PD2, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + } +}; + +static struct platform_device device_mt6622 = { + .name = "mt6622", + .id = -1, + .dev = { + .platform_data = &mt6622_platdata, + }, +}; +#endif static struct platform_device *devices[] __initdata = { #ifdef CONFIG_ION @@ -1318,6 +1353,9 @@ static struct platform_device *devices[] __initdata = { #if defined(CONFIG_ARCH_RK3188) &device_mali, #endif +#ifdef CONFIG_MT5931_MT6622 + &device_mt6622, +#endif }; static int rk_platform_add_display_devices(void) @@ -2030,6 +2068,10 @@ static void __init machine_rk30_board_init(void) #if defined(CONFIG_MT6620) clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 48*1000000); #endif + +#if defined(CONFIG_MT5931_MT6622) + clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 24*1000000); +#endif } #define HD_SCREEN_SIZE 1920UL*1200UL*4*3 static void __init rk30_reserve(void) diff --git a/arch/arm/mach-rk30/board-rk3168m-tb-sdmmc-conifg.c b/arch/arm/mach-rk30/board-rk3168m-tb-sdmmc-conifg.c index 6532d1b8800c..c1c03e057599 100644 --- a/arch/arm/mach-rk30/board-rk3168m-tb-sdmmc-conifg.c +++ b/arch/arm/mach-rk30/board-rk3168m-tb-sdmmc-conifg.c @@ -132,6 +132,11 @@ int rk31sdk_get_sdmmc0_pin_io_voltage(void) #endif // #if COMBO_MODULE_MT6620_CDT--#endif #endif +#ifndef RK30SDK_WIFI_GPIO_WIFI_INT_B +#define RK30SDK_WIFI_GPIO_WIFI_INT_B INVALID_GPIO +#define RK30SDK_WIFI_GPIO_WIFI_INT_B_ENABLE_VALUE GPIO_HIGH +#endif + int rk31sdk_get_sdio_wifi_voltage(void) { int voltage; diff --git a/arch/arm/mach-rk30/board-rk3168m-tb.c b/arch/arm/mach-rk30/board-rk3168m-tb.c index 741055301d30..b76afbd07e21 100755 --- a/arch/arm/mach-rk30/board-rk3168m-tb.c +++ b/arch/arm/mach-rk30/board-rk3168m-tb.c @@ -1278,6 +1278,41 @@ struct platform_device rk_device_gps = { }; #endif +#if defined(CONFIG_MT5931_MT6622) +static struct mt6622_platform_data mt6622_platdata = { + .power_gpio = { // BT_REG_ON + .io = RK30_PIN3_PD5, // set io to INVALID_GPIO for disable it + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .reset_gpio = { // BT_RST + .io = RK30_PIN0_PD7, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + }, + + .irq_gpio = { + .io = RK30_PIN3_PD2, + .enable = GPIO_HIGH, + .iomux = { + .name = NULL, + }, + } +}; + +static struct platform_device device_mt6622 = { + .name = "mt6622", + .id = -1, + .dev = { + .platform_data = &mt6622_platdata, + }, +}; +#endif static struct platform_device *devices[] __initdata = { #ifdef CONFIG_ION @@ -1322,6 +1357,9 @@ static struct platform_device *devices[] __initdata = { &rk_device_gps, #endif +#ifdef CONFIG_MT5931_MT6622 + &device_mt6622, +#endif }; static int rk_platform_add_display_devices(void) @@ -2035,6 +2073,10 @@ static void __init machine_rk30_board_init(void) #if defined(CONFIG_MT6620) clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 48*1000000); #endif + +#if defined(CONFIG_MT5931_MT6622) + clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 24*1000000); +#endif } static void __init rk30_reserve(void) -- 2.34.1