CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_LL=y
-CONFIG_BT_HCIBCM4325=y
-CONFIG_BT_AUTOSLEEP=y
+CONFIG_MAC80211=y
CONFIG_RFKILL=y
-CONFIG_RFKILL_RK=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
CONFIG_WLAN_80211=y
-CONFIG_RKWIFI=y
+CONFIG_MT5931_MT6622=y
CONFIG_USB_USBNET=y
CONFIG_PPP=y
CONFIG_PPP_MULTILINK=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_RK29=y
CONFIG_UART0_RK29=y
-CONFIG_UART0_CTS_RTS_RK29=y
-CONFIG_UART3_RK29=y
-CONFIG_UART3_CTS_RTS_RK29=y
+CONFIG_UART0_DMA_RK29=2
+CONFIG_UART2_RK29=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C=y
# CONFIG_I2C_COMPAT is not set
CONFIG_MEDIA_SUPPORT=y
CONFIG_VIDEO_DEV=y
CONFIG_SOC_CAMERA=y
-CONFIG_SOC_CAMERA_OV2659=y
-CONFIG_SOC_CAMERA_OV5642=y
CONFIG_VIDEO_RK29=y
CONFIG_VIDEO_RK29_CAMMEM_ION=y
CONFIG_ION=y
#endif
#elif defined(CONFIG_ARCH_RK3066B)//refer to file /arch/arm/mach-rk30/include/mach/iomux-rk3066b.h
#define WIFI_HOST_WAKE RK30_PIN3_PD2
-
+
#if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU)
#define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PD0
#define RK30SDK_WIFI_GPIO_POWER_ENABLE_VALUE GPIO_LOW//GPIO_HIGH
#define RK30SDK_WIFI_GPIO_RESET_ENABLE_VALUE GPIO_HIGH
#define RK30SDK_WIFI_GPIO_RESET_PIN_NAME GPIO2A7_LCDC1DATA7_SMCDATA7_TRACEDATA7_NAME
#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_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
};
#endif
+#if defined(CONFIG_MT5931_MT6622)
+static struct mt6622_platform_data mt6622_platdata = {
+ .power_gpio = { // BT_REG_ON
+ .io = RK30_PIN3_PC7, // set io to INVALID_GPIO for disable it
+ .enable = GPIO_HIGH,
+ .iomux = {
+ .name = NULL,
+ },
+ },
+
+ .reset_gpio = { // BT_RST
+ .io = RK30_PIN3_PD1,
+ .enable = GPIO_HIGH,
+ .iomux = {
+ .name = NULL,
+ },
+ },
+
+ .irq_gpio = {
+ .io = RK30_PIN0_PA5,
+ .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
#ifdef CONFIG_GPS_RK
&rk_device_gps,
#endif
+#ifdef CONFIG_MT5931_MT6622
+ &device_mt6622,
+#endif
};
* comments : min arm/logic voltage
*/
static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
- {.frequency = 312 * 1000, .cpu_volt = 850 * 1000, .logic_volt = 1000 * 1000},
+/* {.frequency = 312 * 1000, .cpu_volt = 850 * 1000, .logic_volt = 1000 * 1000},
{.frequency = 504 * 1000, .cpu_volt = 900 * 1000, .logic_volt = 1000 * 1000},
- {.frequency = 816 * 1000, .cpu_volt = 950 * 1000, .logic_volt = 1000 * 1000},
- {.frequency = 1008 * 1000, .cpu_volt = 1025 * 1000, .logic_volt = 1000 * 1000},
+*/ {.frequency = 816 * 1000, .cpu_volt = 950 * 1000, .logic_volt = 1000 * 1000},
+/* {.frequency = 1008 * 1000, .cpu_volt = 1025 * 1000, .logic_volt = 1000 * 1000},
{.frequency = 1200 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1050 * 1000},
{.frequency = 1416 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1150 * 1000},
{.frequency = 1608 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1250 * 1000},
- {.frequency = CPUFREQ_TABLE_END},
+*/ {.frequency = CPUFREQ_TABLE_END},
};
static struct cpufreq_frequency_table dvfs_gpu_table[] = {
extern void mt_bt_gpio_init(void);
extern void mt_bt_gpio_release(void);
+extern int mt_bt_power_init(void);
extern int mt_bt_power_on(void);
extern void mt_bt_power_off(void);
return -1;
}
- if (gpio_request(pdata->power_gpio.io, "BT_PWR_EN")){
- printk("mt6622 power_gpio is busy!\n");
- return -1;
+ if(pdata->power_gpio.io != INVALID_GPIO) {
+ if (gpio_request(pdata->power_gpio.io, "BT_PWR_EN")){
+ printk("mt6622 power_gpio is busy!\n");
+ return -1;
+ }
}
- if (gpio_request(pdata->reset_gpio.io, "BT_RESET")){
- printk("mt6622 reset_gpio is busy!\n");
- gpio_free(pdata->power_gpio.io);
- return -1;
+ if(pdata->reset_gpio.io != INVALID_GPIO) {
+ if (gpio_request(pdata->reset_gpio.io, "BT_RESET")){
+ printk("mt6622 reset_gpio is busy!\n");
+ gpio_free(pdata->power_gpio.io);
+ return -1;
+ }
}
- if (gpio_request(pdata->irq_gpio.io, "BT_EINT")){
- printk("mt6622 irq_gpio is busy!\n");
- gpio_free(pdata->power_gpio.io);
- gpio_free(pdata->reset_gpio.io);
- return -1;
+ if(pdata->irq_gpio.io != INVALID_GPIO) {
+ if (gpio_request(pdata->irq_gpio.io, "BT_EINT")){
+ printk("mt6622 irq_gpio is busy!\n");
+ gpio_free(pdata->power_gpio.io);
+ gpio_free(pdata->reset_gpio.io);
+ return -1;
+ }
}
+ mt_bt_power_init();
+
return 0;
}
printk("mt6622_remove.\n");
if(pdata) {
- gpio_free(pdata->power_gpio.io);
- gpio_free(pdata->reset_gpio.io);
- gpio_free(pdata->irq_gpio.io);
+ if(pdata->power_gpio.io != INVALID_GPIO)
+ gpio_free(pdata->power_gpio.io);
+ if(pdata->reset_gpio.io != INVALID_GPIO)
+ gpio_free(pdata->reset_gpio.io);
+ if(pdata->irq_gpio.io != INVALID_GPIO)
+ gpio_free(pdata->irq_gpio.io);
}
return 0;
static int mt_bt_request_irq(void)\r
{\r
int iRet;\r
+ int trigger = IRQF_TRIGGER_HIGH;\r
+ struct mt6622_platform_data *pdata = (struct mt6622_platform_data *)mt_bt_get_platform_data();\r
+ \r
+ if(pdata->irq_gpio.enable == GPIO_LOW)\r
+ trigger = IRQF_TRIGGER_RISING;\r
+ \r
iRet = request_irq(irq_num, mt_bt_eirq_handler, \r
- /*IRQF_TRIGGER_RISING*/IRQF_TRIGGER_HIGH, "BT_INT_B", NULL);\r
+ trigger, "BT_INT_B", NULL);\r
if (iRet){\r
printk(KERN_ALERT MODULE_TAG "request_irq IRQ%d fails, errno %d\n", irq_num, iRet);\r
}\r
* P O W E R C O N T R O L *\r
*****************************************************************************/\r
\r
+int mt_bt_power_init(void)\r
+{\r
+ struct mt6622_platform_data *pdata;\r
+ \r
+ printk(KERN_INFO MODULE_TAG "mt_bt_power_init\n");\r
+ \r
+ pdata = (struct mt6622_platform_data *)mt_bt_get_platform_data();\r
+ \r
+ if(pdata) {\r
+ \r
+ // PWR_EN and RESET\r
+ /* PWR_EN set to gpio output low */\r
+ if(pdata->power_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->power_gpio.io, 0);\r
+ /* RESET set to gpio output low */\r
+ if(pdata->reset_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->reset_gpio.io, 0);\r
+ msleep(200);\r
+ \r
+ /* RESET pull up */\r
+ if(pdata->reset_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->reset_gpio.io, 1);\r
+ msleep(1000);\r
+ \r
+ //pdata->power_gpio.io = INVALID_GPIO;\r
+ pdata->reset_gpio.io = INVALID_GPIO;\r
+ }\r
+ \r
+ return 0;\r
+}\r
+EXPORT_SYMBOL(mt_bt_power_init);\r
+\r
int mt_bt_power_on(void)\r
{\r
int error;\r
// EINT\r
//--s3c_gpio_cfgpin(GPIO_BT_EINT_PIN, S3C_GPIO_SFN(0));\r
//--s3c_gpio_setpull(GPIO_BT_EINT_PIN, S3C_GPIO_PULL_DOWN);\r
- gpio_direction_input(pdata->irq_gpio.io);\r
+ if(pdata->irq_gpio.io != INVALID_GPIO)\r
+ gpio_direction_input(pdata->irq_gpio.io);\r
//gpio_pull_updown(pdata->irq_gpio->io, GPIOPullDown);\r
/* set to EINT mode */\r
//--s3c_gpio_cfgpin(GPIO_BT_EINT_PIN, S3C_GPIO_SFN(0xF));\r
/* get irq number */\r
- irq_num = gpio_to_irq(pdata->irq_gpio.io);\r
+ if(pdata->irq_gpio.io != INVALID_GPIO)\r
+ irq_num = gpio_to_irq(pdata->irq_gpio.io);\r
//mt_set_gpio_mode(GPIO_BT_EINT_PIN, GPIO_BT_EINT_PIN_M_GPIO);\r
//mt_set_gpio_pull_enable(GPIO_BT_EINT_PIN, 1);\r
//mt_set_gpio_pull_select(GPIO_BT_EINT_PIN, GPIO_PULL_DOWN);\r
\r
// PWR_EN and RESET\r
/* PWR_EN set to gpio output low */\r
- gpio_direction_output(pdata->power_gpio.io, 0);\r
+ if(pdata->power_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->power_gpio.io, 0);\r
/* RESET set to gpio output low */\r
- gpio_direction_output(pdata->reset_gpio.io, 0);\r
+ if(pdata->reset_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->reset_gpio.io, 0);\r
msleep(200);\r
\r
/* PWR_EN pull up */\r
- gpio_direction_output(pdata->power_gpio.io, 1);\r
+ if(pdata->power_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->power_gpio.io, 1);\r
msleep(200);\r
/* RESET pull up */\r
- gpio_direction_output(pdata->reset_gpio.io, 1);\r
+ if(pdata->reset_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->reset_gpio.io, 1);\r
msleep(1000);\r
\r
error = mt_bt_request_irq();\r
if (error){\r
- gpio_direction_output(pdata->power_gpio.io, 0);\r
- gpio_direction_output(pdata->reset_gpio.io, 0);\r
+ if(pdata->power_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->power_gpio.io, 0);\r
+ if(pdata->reset_gpio.io != INVALID_GPIO) \r
+ gpio_direction_output(pdata->reset_gpio.io, 0);\r
//--s3c_gpio_cfgpin(GPIO_BT_EINT_PIN, S3C_GPIO_SFN(1));\r
- gpio_direction_output(pdata->irq_gpio.io, 0);\r
+ if(pdata->irq_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->irq_gpio.io, 0);\r
return error;\r
}\r
}\r
\r
if(pdata) {\r
// PWR_EN and RESET\r
- gpio_direction_output(pdata->power_gpio.io, 0);\r
- gpio_direction_output(pdata->reset_gpio.io, 0);\r
+ if(pdata->power_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->power_gpio.io, 0);\r
+ if(pdata->reset_gpio.io != INVALID_GPIO) \r
+ gpio_direction_output(pdata->reset_gpio.io, 0);\r
\r
// EINT\r
//--s3c_gpio_cfgpin(GPIO_BT_EINT_PIN, S3C_GPIO_SFN(1));\r
- gpio_direction_output(pdata->irq_gpio.io, 0);\r
+ if(pdata->irq_gpio.io != INVALID_GPIO)\r
+ gpio_direction_output(pdata->irq_gpio.io, 0);\r
\r
mt_bt_free_irq();\r
}\r