From 905cf2130dfff065c8bb781454357068d52b3189 Mon Sep 17 00:00:00 2001 From: kfx Date: Mon, 31 Dec 2012 18:29:40 +0800 Subject: [PATCH] rk3168: ds1006h: mt5931&mt6622 support(lintao) --- arch/arm/configs/rk3168_ds1006h_defconfig | 6 ++-- arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c | 16 ++++----- arch/arm/mach-rk30/board-rk3168-ds1006h.c | 42 +++++++++++++++++++++++ 3 files changed, 54 insertions(+), 10 deletions(-) mode change 100755 => 100644 arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c diff --git a/arch/arm/configs/rk3168_ds1006h_defconfig b/arch/arm/configs/rk3168_ds1006h_defconfig index 587b0cb06d69..f4eb004340f5 100644 --- a/arch/arm/configs/rk3168_ds1006h_defconfig +++ b/arch/arm/configs/rk3168_ds1006h_defconfig @@ -207,7 +207,8 @@ CONFIG_PHYLIB=y # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set CONFIG_WLAN_80211=y -CONFIG_RKWIFI=y +CONFIG_MT5931_MT6622=y +#CONFIG_RKWIFI is not set CONFIG_USB_USBNET=y CONFIG_PPP=y CONFIG_PPP_MULTILINK=y @@ -261,7 +262,8 @@ CONFIG_PS_STK3171=y # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_RK29=y CONFIG_UART0_RK29=y -CONFIG_UART0_CTS_RTS_RK29=y +# CONFIG_UART0_CTS_RTS_RK29 is not set +CONFIG_UART0_DMA_RK29=2 CONFIG_UART3_RK29=y CONFIG_UART3_CTS_RTS_RK29=y # CONFIG_HW_RANDOM is not set diff --git a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c old mode 100755 new mode 100644 index 27d87a5ae542..29781a64f68d --- a/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c +++ b/arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c @@ -370,15 +370,15 @@ #define RK30SDK_WIFI_GPIO_RESET_IOMUX_FGPIO GPIO2A_GPIO2A7 #elif defined(CONFIG_MT5931_MT6622) || defined(CONFIG_MT5931) - #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0 - #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH - #define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_MIIMD_NAME - #define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3D_GPIO3D0 + #define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN0_PA5 + #define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_HIGH + //#define RK30SDK_WIFI_GPIO_POWER_PIN_NAME GPIO3D0_SDMMC1PWREN_MIIMD_NAME + //#define RK30SDK_WIFI_GPIO_POWER_IOMUX_FGPIO GPIO3D_GPIO3D0 - //#define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN3_PD1 - //#define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH - //#define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO3D1_SDMMC1BACKENDPWR_MIIMDCLK_NAME - //#define RK30SDK_WIFI_GPIO_RESET_IOMUX_FGPIO GPIO3D_GPIO3D1 + #define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN3_PD1 + #define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH + #define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO3D1_SDMMC1BACKENDPWR_MIIMDCLK_NAME + #define RK30SDK_WIFI_GPIO_RESET_IOMUX_FGPIO GPIO3D_GPIO3D1 #endif #elif defined(CONFIG_ARCH_RK2928) //refer to file ./arch/arm/mach-rk2928/include/mach/iomux.h #define WIFI_HOST_WAKE RK2928_PIN3_PC0 diff --git a/arch/arm/mach-rk30/board-rk3168-ds1006h.c b/arch/arm/mach-rk30/board-rk3168-ds1006h.c index 5e4c1b727355..b1b90d3c1adc 100644 --- a/arch/arm/mach-rk30/board-rk3168-ds1006h.c +++ b/arch/arm/mach-rk30/board-rk3168-ds1006h.c @@ -989,6 +989,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_FB_ROCKCHIP @@ -1025,6 +1060,9 @@ static struct platform_device *devices[] __initdata = { #ifdef CONFIG_GPS_RK &rk_device_gps, #endif +#ifdef CONFIG_MT5931_MT6622 + &device_mt6622, +#endif }; // i2c @@ -1611,6 +1649,10 @@ static void __init machine_rk30_board_init(void) #if defined(CONFIG_MT6620) clk_set_rate(clk_get_sys("rk_serial.1", "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