\r
}\r
\r
+ if(bp->ops->bp_assert != BP_UNKNOW_DATA)\r
+ {\r
+ result = gpio_request(bp->ops->bp_assert, "bp_assert");\r
+ if(result)\r
+ {\r
+ printk("%s:fail to request gpio %d\n",__func__, bp->ops->bp_assert);\r
+ //return -1;\r
+ }\r
+ }\r
+ \r
if(bp->ops->bp_power != BP_UNKNOW_DATA)\r
{\r
result = gpio_request(bp->ops->bp_power, "bp_power");\r
{\r
\r
struct bp_private_data *bp = dev_id;\r
- printk("<---%s:bp_id=%d--->\n",__FUNCTION__,bp->ops->bp_id); \r
+ //printk("<---%s:bp_id=%d--->\n",__FUNCTION__,bp->ops->bp_id); \r
if(bp->ops->bp_wake_ap){\r
bp->ops->bp_wake_ap(bp);\r
} \r
case BP_IOCTL_GET_IMEI:\r
printk("BP_IMEI_READ\n");\r
GetSNSectorInfo(SectorBuffer); \r
- if(copy_to_user(argp, &(SectorBuffer[451]), 16)) // IMEIo¨®¡ä¨®451??¨°??a¨º?¦Ì?16bytes¡ê?¦Ì¨²¨°???byte?a3¡è?¨¨1¨¬?¡§?a15\r
+ if(copy_to_user(argp, &(SectorBuffer[451]), 16)) // IMEIo¡§???¡§?451??¡§¡ã??a¡§o?|¨¬?16bytes?¨º?|¨¬¡§2¡§¡ã???byte?a3?¨¨?¡§¡§1¡§???¡ì?a15\r
{\r
printk("ERROR: copy_to_user---%s\n", __FUNCTION__);\r
return -EFAULT;\r
if(bp->ops->active)\r
bp->ops->active(bp, 0);\r
break; \r
- \r
+ case 2://power en gpio low\r
+ if(bp->ops->active)\r
+ bp->ops->active(bp, 2);\r
+ break;\r
+ case 3://power en gpio high\r
+ if(bp->ops->active)\r
+ bp->ops->active(bp, 3);\r
+ break;\r
default:\r
break;\r
}\r
} \r
return result; \r
}\r
-//static CLASS_ATTR(bp_status, 0777, bp_status_read, bp_status_write);\r
+static CLASS_ATTR(bp_status, 0777, bp_status_read, bp_status_write);\r
static int bp_probe(struct platform_device *pdev)\r
{\r
struct bp_platform_data *pdata = pdev->dev.platform_data;\r
bp->ops->init(bp);\r
bp->ops->irq = 0;\r
wake_lock_init(&bp->bp_wakelock, WAKE_LOCK_SUSPEND, "bp_wakelock");\r
- if((bp->ops->bp_wakeup_ap) && (bp->ops->trig != BP_UNKNOW_DATA))\r
+ if((bp->ops->bp_wakeup_ap != BP_UNKNOW_DATA) && (bp->ops->trig != BP_UNKNOW_DATA))\r
{\r
irq = gpio_to_irq(bp->ops->bp_wakeup_ap);\r
result = request_irq(irq, bp_wake_up_irq, bp->ops->trig, "bp_wakeup_ap", bp);\r
static int __init bp_init(void)\r
{\r
int ret ;\r
- //bp_class = class_create(THIS_MODULE, "bp-auto");\r
- //ret = class_create_file(bp_class, &class_attr_bp_status);\r
- //if (ret)\r
- //{\r
- // printk("Fail to create class bp-auto\n");\r
- //}\r
+ bp_class = class_create(THIS_MODULE, "bp-auto");\r
+ ret = class_create_file(bp_class, &class_attr_bp_status);\r
+ if (ret)\r
+ {\r
+ printk("Fail to create class bp-auto\n");\r
+ }\r
return platform_driver_register(&bp_driver);\r
}\r
\r
config BP_AUTO_U7501\r
bool "modem u7501"\r
default n\r
+ \r
config BP_AUTO_U5501\r
bool "modem u5501"\r
+\r
+config BP_AUTO_AW706\r
+bool "modem aw706"\r
default n
\ No newline at end of file
obj-$(CONFIG_BP_AUTO) += u7501.o\r
obj-$(CONFIG_BP_AUTO) += a85xx.o\r
obj-$(CONFIG_BP_AUTO) += u5501.o\r
+obj-$(CONFIG_BP_AUTO) += aw706.o\r
\r
\r
/****************operate according to bp chip:start************/\r
+\r
static int bp_active(struct bp_private_data *bp, int enable)\r
{ \r
int result = 0;\r
-\r
- if(enable)\r
- { \r
- printk("<-----a85xx power on-------->\n"); \r
- gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
- msleep(100);\r
- gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
- mdelay(100);\r
- gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
- mdelay(2500);\r
- gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
- }\r
- else\r
- {\r
- printk("<-----a85xx power off-------->\n");\r
- gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
- msleep(2500);\r
- gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
- msleep(500);\r
- gpio_set_value(bp->ops->bp_reset, GPIO_HIGH); \r
- gpio_set_value(bp->ops->bp_power, GPIO_LOW);\r
- }\r
- \r
+ switch(enable){\r
+ case 0:\r
+ printk("<-----a85xx power off-------->\n");\r
+ gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+ msleep(2500);\r
+ gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
+ msleep(500);\r
+ gpio_set_value(bp->ops->bp_reset, GPIO_HIGH); \r
+ gpio_set_value(bp->ops->bp_power, GPIO_LOW); \r
+ break;\r
+ case 1:\r
+ printk("<-----a85xx power on-------->\n"); \r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ msleep(100);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
+ //mdelay(100);\r
+ //gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
+ mdelay(2500);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
+ break;\r
+ case 2:\r
+ printk("<-----a85xx udate power_en low-------->\n");\r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ msleep(100);\r
+ \r
+ gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
+ //mdelay(100);\r
+ //gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
+ break;\r
+ case 3:\r
+ printk("<-----a85xx udate power_en high-------->\n");\r
+ gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
+ break;\r
+ default:\r
+ break;\r
+ } \r
return result;\r
}\r
static void ap_wake_bp_work(struct work_struct *work)\r
.resume = bp_resume,\r
.misc_name = NULL,\r
.private_miscdev = NULL,\r
-#elif defined(CONFIG_ARCH_RK30)\r
+#elif defined(CONFIG_SOC_RK3028)\r
.name = "a85xx",\r
.bp_id = BP_ID_A85XX,\r
.bp_bus = BP_BUS_TYPE_UART, \r
.bp_pid = 0, \r
.bp_vid = 0, \r
- .bp_power = BP_UNKNOW_DATA, // RK2928_PIN3_PC2, // 3g_power\r
- .bp_en = BP_UNKNOW_DATA, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+ .bp_power = RK30_PIN0_PC2, // RK2928_PIN3_PC2, // 3g_power\r
+ .bp_en = RK30_PIN3_PD0, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
.bp_reset = BP_UNKNOW_DATA, // RK2928_PIN0_PB6,\r
.ap_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD0, //\r
.bp_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD6,\r
- .ap_wakeup_bp = BP_UNKNOW_DATA, // RK2928_PIN3_PC4,\r
- .bp_wakeup_ap = BP_UNKNOW_DATA, // RK2928_PIN3_PC3, //\r
+ .ap_wakeup_bp = RK30_PIN3_PC6, // RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = RK30_PIN0_PC1, // RK2928_PIN3_PC3, //\r
.bp_assert = BP_UNKNOW_DATA,\r
.bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
.bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
--- /dev/null
+/* drivers/misc/bp/chips/aw706.c\r
+ *\r
+ * Copyright (C) 2012-2015 ROCKCHIP.\r
+ * Author: luowei <lw@rock-chips.com>\r
+ *\r
+ * This software is licensed under the terms of the GNU General Public\r
+ * License version 2, as published by the Free Software Foundation, and\r
+ * may be copied, distributed, and modified under those terms.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ */\r
+#include <linux/module.h>\r
+#include <linux/kernel.h>\r
+#include <linux/i2c.h>\r
+#include <linux/irq.h>\r
+#include <linux/gpio.h>\r
+#include <linux/input.h>\r
+#include <linux/platform_device.h>\r
+#include <linux/fs.h>\r
+#include <linux/uaccess.h>\r
+#include <linux/miscdevice.h>\r
+#include <linux/circ_buf.h>\r
+#include <linux/interrupt.h>\r
+#include <linux/miscdevice.h>\r
+#include <mach/iomux.h>\r
+#include <mach/gpio.h>\r
+#include <asm/gpio.h>\r
+#include <linux/delay.h>\r
+#include <linux/poll.h>\r
+#include <linux/wait.h>\r
+#include <linux/wakelock.h>\r
+#include <linux/workqueue.h>\r
+#include <linux/slab.h>\r
+#include <linux/earlysuspend.h>\r
+\r
+#include <linux/bp-auto.h>\r
+ \r
+ \r
+#if 0\r
+#define DBG(x...) printk(x)\r
+#else\r
+#define DBG(x...)\r
+#endif\r
+\r
+/****************operate according to bp chip:start************/\r
+static int bp_active(struct bp_private_data *bp, int enable)\r
+{ \r
+ int result = 0;\r
+ switch(enable){\r
+ case 0:\r
+ printk("<-----aw706 power off-------->\n");\r
+ //result = gpio_get_value(bp->ops->bp_assert);\r
+ //if(!result){ \r
+ //printk("<-----aw706 is poweroff-------->\n");\r
+ //return result;}\r
+ gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+ msleep(2500);\r
+ gpio_set_value(bp->ops->bp_en, GPIO_HIGH); \r
+ gpio_set_value(bp->ops->bp_power, GPIO_LOW); \r
+ break;\r
+ case 1:\r
+ printk("<-----aw706 power on-------->\n"); \r
+ //result = gpio_get_value(bp->ops->bp_assert);\r
+ //if(result){\r
+ // printk("<-----aw706 power bp_assert is high no need to power on again-------->\n");\r
+ // return result;\r
+ //}\r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ mdelay(100);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
+ gpio_set_value(bp->ops->ap_wakeup_bp,GPIO_HIGH); \r
+ mdelay(1000); \r
+ gpio_set_value(bp->ops->ap_wakeup_bp,GPIO_LOW);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
+ break;\r
+ case 2:\r
+ printk("<-----aw706 udate power_en low-------->\n");\r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ mdelay(50);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
+ gpio_set_value(bp->ops->ap_wakeup_bp,GPIO_HIGH);\r
+ break;\r
+ case 3:\r
+ printk("<-----aw706 udate power_en high-------->\n");\r
+ gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
+ gpio_set_value(bp->ops->ap_wakeup_bp,GPIO_LOW);\r
+ break;\r
+ default:\r
+ break;\r
+ } \r
+ return result;\r
+}\r
+static void ap_wake_bp_work(struct work_struct *work)\r
+{\r
+ return;\r
+}\r
+static int bp_wake_ap(struct bp_private_data *bp)\r
+{\r
+ int result = 0;\r
+ \r
+ if(bp->suspend_status)\r
+ {\r
+ //iomux_set(UART1_RTSN);\r
+ //gpio_direction_output(RK30_PIN1_PA6, GPIO_LOW);\r
+ printk("bp_wake_ap aw706 done!!! \n"); \r
+ \r
+ bp->suspend_status = 0; \r
+ wake_lock_timeout(&bp->bp_wakelock, 10 * HZ);\r
+ }\r
+ \r
+ return result;\r
+}\r
+static int bp_init(struct bp_private_data *bp)\r
+{\r
+ int result = 0;\r
+ \r
+ gpio_direction_output(bp->ops->bp_power, GPIO_LOW);\r
+ //gpio_direction_output(bp->ops->bp_reset, GPIO_LOW);\r
+ gpio_direction_output(bp->ops->bp_en, GPIO_HIGH);\r
+ //gpio_direction_output(bp->ops->ap_ready, GPIO_LOW);\r
+ gpio_direction_output(bp->ops->ap_wakeup_bp, GPIO_LOW); \r
+ //gpio_direction_input(bp->ops->bp_ready); \r
+ gpio_direction_input(bp->ops->bp_wakeup_ap);\r
+ gpio_direction_input(bp->ops->bp_assert);\r
+ gpio_pull_updown(bp->ops->bp_wakeup_ap, 1); \r
+ \r
+ //if(bp->ops->active)\r
+ //bp->ops->active(bp, 1); \r
+ INIT_DELAYED_WORK(&bp->wakeup_work, ap_wake_bp_work);\r
+ return result;\r
+}\r
+\r
+static int bp_reset(struct bp_private_data *bp)\r
+{\r
+ printk("ioctrl aw706 reset !!! \n"); \r
+ return 0;\r
+ gpio_set_value(bp->ops->bp_en,GPIO_LOW);\r
+ mdelay(6000);\r
+ gpio_set_value(bp->ops->bp_en,GPIO_HIGH);\r
+ \r
+}\r
+static int bp_shutdown(struct bp_private_data *bp)\r
+{\r
+ int result = 0;\r
+ \r
+ if(bp->ops->active)\r
+ bp->ops->active(bp, 0);\r
+ \r
+ cancel_delayed_work_sync(&bp->wakeup_work); \r
+ \r
+ return result;\r
+}\r
+static int bp_suspend(struct bp_private_data *bp)\r
+{ \r
+ int result = 0;\r
+ int ret = 0;\r
+ printk("aw706 %s !!! \n",__func__);\r
+ bp->suspend_status = 1;\r
+ //gpio_set_value(bp->ops->ap_ready, GPIO_HIGH);\r
+ gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_HIGH);\r
+ /*\r
+ iomux_set(GPIO1_A7);\r
+ ret = gpio_request(RK30_PIN1_PA7,"bp_auto");\r
+ if(ret < 0){\r
+ printk("%s rk30_pin1_pa7 request failed\n",__func__);\r
+ return result;\r
+ } \r
+ gpio_direction_output(RK30_PIN1_PA7, GPIO_HIGH);\r
+ */\r
+ return result;\r
+}\r
+static int bp_resume(struct bp_private_data *bp)\r
+{\r
+ \r
+ bp->suspend_status = 0; \r
+ \r
+ //iomux_set(UART1_RTSN); \r
+ //gpio_direction_output(RK30_PIN1_PA7, GPIO_LOW);\r
+ gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_LOW);\r
+ return 0;\r
+}\r
+\r
+\r
+struct bp_operate bp_aw706_ops = {\r
+#if defined(CONFIG_ARCH_RK2928)\r
+ .name = "aw706",\r
+ .bp_id = BP_ID_AW706,\r
+ .bp_bus = BP_BUS_TYPE_UART, \r
+ .bp_pid = 0, \r
+ .bp_vid = 0, \r
+ .bp_power = RK2928_PIN3_PC2, // 3g_power\r
+ .bp_en = RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+ .bp_reset = RK2928_PIN0_PB6,\r
+ .ap_ready = RK2928_PIN0_PD0, //\r
+ .bp_ready = RK2928_PIN0_PD6,\r
+ .ap_wakeup_bp = RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = RK2928_PIN3_PC3, //\r
+ .bp_assert = BP_UNKNOW_DATA,\r
+ .bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
+ .bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
+ .trig = IRQF_TRIGGER_FALLING,\r
+\r
+ .active = bp_active,\r
+ .init = bp_init,\r
+ .reset = bp_reset,\r
+ .ap_wake_bp = NULL,\r
+ .bp_wake_ap = bp_wake_ap,\r
+ .shutdown = bp_shutdown,\r
+ .read_status = NULL,\r
+ .write_status = NULL,\r
+ .suspend = bp_suspend,\r
+ .resume = bp_resume,\r
+ .misc_name = NULL,\r
+ .private_miscdev = NULL,\r
+#elif defined(CONFIG_SOC_RK3028)\r
+ .name = "aw706",\r
+ .bp_id = BP_ID_AW706,\r
+ .bp_bus = BP_BUS_TYPE_UART, \r
+ .bp_pid = 0, \r
+ .bp_vid = 0, \r
+ .bp_power = RK30_PIN0_PC2,//BP_UNKNOW_DATA,// 3g_power\r
+#if defined(CONFIG_MACH_RK3028_PHONEPAD_780)\r
+ .bp_en = RK30_PIN0_PC5, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+#else\r
+ .bp_en = RK30_PIN3_PD0, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+#endif\r
+ .bp_reset = BP_UNKNOW_DATA,//BP_UNKNOW_DATA, // RK2928_PIN0_PB6,\r
+ .ap_ready = BP_UNKNOW_DATA,//RK30_PIN1_PB5,//BP_UNKNOW_DATA, // RK2928_PIN0_PD0, //\r
+ .bp_ready = BP_UNKNOW_DATA,//RK30_PIN3_PD0,//BP_UNKNOW_DATA, // RK2928_PIN0_PD6,\r
+ .ap_wakeup_bp = RK30_PIN3_PC6,//BP_UNKNOW_DATA, // RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = RK30_PIN0_PC1,//BP_UNKNOW_DATA, // RK2928_PIN3_PC3, //\r
+ .bp_assert = RK30_PIN0_PC0,\r
+ .bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
+ .bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
+ .trig = IRQF_TRIGGER_FALLING,\r
+\r
+ .active = bp_active,\r
+ .init = bp_init,\r
+ .reset = bp_reset,\r
+ .ap_wake_bp = NULL,\r
+ .bp_wake_ap = bp_wake_ap,\r
+ .shutdown = bp_shutdown,\r
+ .read_status = NULL,\r
+ .write_status = NULL,\r
+ .suspend = bp_suspend,\r
+ .resume = bp_resume,\r
+ .misc_name = NULL,\r
+ .private_miscdev = NULL,\r
+#else\r
+ .name = "aw706",\r
+ .bp_id = BP_ID_AW706,\r
+ .bp_bus = BP_BUS_TYPE_UART, \r
+ .bp_pid = 0, \r
+ .bp_vid = 0, \r
+ .bp_power = BP_UNKNOW_DATA, // RK2928_PIN3_PC2, // 3g_power\r
+ .bp_en = BP_UNKNOW_DATA, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+ .bp_reset = BP_UNKNOW_DATA, // RK2928_PIN0_PB6,\r
+ .ap_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD0, //\r
+ .bp_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD6,\r
+ .ap_wakeup_bp = BP_UNKNOW_DATA, // RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = BP_UNKNOW_DATA, // RK2928_PIN3_PC3, //\r
+ .bp_assert = BP_UNKNOW_DATA,\r
+ .bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
+ .bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
+ .trig = IRQF_TRIGGER_FALLING,\r
+\r
+ .active = bp_active,\r
+ .init = bp_init,\r
+ .reset = bp_reset,\r
+ .ap_wake_bp = NULL,\r
+ .bp_wake_ap = bp_wake_ap,\r
+ .shutdown = bp_shutdown,\r
+ .read_status = NULL,\r
+ .write_status = NULL,\r
+ .suspend = bp_suspend,\r
+ .resume = bp_resume,\r
+ .misc_name = NULL,\r
+ .private_miscdev = NULL,\r
+#endif\r
+};\r
+\r
+/****************operate according to bp chip:end************/\r
+\r
+//function name should not be changed\r
+static struct bp_operate *bp_get_ops(void)\r
+{\r
+ return &bp_aw706_ops;\r
+}\r
+\r
+static int __init bp_aw706_init(void)\r
+{\r
+ struct bp_operate *ops = bp_get_ops();\r
+ int result = 0;\r
+ result = bp_register_slave(NULL, NULL, bp_get_ops);\r
+ if(result)\r
+ { \r
+ return result;\r
+ }\r
+ \r
+ if(ops->private_miscdev)\r
+ {\r
+ result = misc_register(ops->private_miscdev);\r
+ if (result < 0) {\r
+ printk("%s:misc_register err\n",__func__);\r
+ return result;\r
+ }\r
+ }\r
+ \r
+ DBG("%s\n",__func__);\r
+ return result;\r
+}\r
+\r
+static void __exit bp_aw706_exit(void)\r
+{\r
+ //struct bp_operate *ops = bp_get_ops();\r
+ bp_unregister_slave(NULL, NULL, bp_get_ops);\r
+}\r
+\r
+\r
+subsys_initcall(bp_aw706_init);\r
+module_exit(bp_aw706_exit);\r
+\r
static int bp_active(struct bp_private_data *bp, int enable)\r
{ \r
int result = 0;\r
- if(enable)\r
- { \r
- printk("<-----m51 power on-------->\n");\r
- gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
- msleep(100);\r
- gpio_set_value(bp->ops->bp_reset, GPIO_HIGH);\r
- msleep(500);\r
- gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
- gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
- msleep(1000);\r
- //gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
- }\r
- else\r
- {\r
- printk("<-----m51 power off-------->\n");\r
- //gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
- //msleep(1000);\r
- gpio_set_value(bp->ops->bp_reset, GPIO_HIGH);\r
- msleep(200);\r
- gpio_set_value(bp->ops->bp_power, GPIO_LOW);\r
- msleep(500);\r
- }\r
- \r
+ switch(enable){\r
+ case 0:\r
+ printk("<-----m51 power off-------->\n");\r
+ gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+ msleep(2000); \r
+ gpio_set_value(bp->ops->bp_power, GPIO_LOW);\r
+ msleep(1000);\r
+ break;\r
+ case 1:\r
+ printk("<-----m51 power on-------->\n");\r
+ \r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ //msleep(100); \r
+ //gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+ msleep(500);\r
+ gpio_set_value(bp->ops->bp_en, GPIO_HIGH); \r
+ msleep(2500);\r
+ break;\r
+ case 2:\r
+ printk("<-----aw706 udate power_en low-------->\n");\r
+ gpio_set_value(bp->ops->bp_power, GPIO_HIGH);\r
+ msleep(100); \r
+ gpio_set_value(bp->ops->bp_en, GPIO_LOW);\r
+ msleep(1000);\r
+ gpio_set_value(bp->ops->bp_en, GPIO_HIGH);\r
+ break;\r
+ case 3:\r
+ printk("<-----aw706 udate power_en high-------->\n");\r
+ \r
+ break;\r
+ default:\r
+ break;\r
+ } \r
return result;\r
}\r
+\r
+\r
static void ap_wake_bp_work(struct work_struct *work)\r
{\r
return;\r
\r
}\r
gpio_direction_output(bp->ops->bp_power, GPIO_LOW);\r
- gpio_direction_output(bp->ops->bp_reset, GPIO_HIGH);\r
+// gpio_direction_output(bp->ops->bp_reset, GPIO_HIGH);\r
gpio_direction_output(bp->ops->bp_en, GPIO_LOW);\r
- gpio_direction_output(bp->ops->ap_ready, GPIO_LOW);\r
+ //gpio_direction_output(bp->ops->ap_ready, GPIO_LOW);\r
gpio_direction_output(bp->ops->ap_wakeup_bp, GPIO_LOW);\r
gpio_direction_input(bp->ops->bp_wakeup_ap);\r
gpio_pull_updown(bp->ops->bp_wakeup_ap, 1); \r
static int bp_reset(struct bp_private_data *bp)\r
{\r
printk("ioctrl m51 reset !!! \n");\r
- gpio_set_value(bp->ops->bp_reset, GPIO_HIGH);\r
+// gpio_set_value(bp->ops->bp_reset, GPIO_HIGH);\r
msleep(500);\r
//gpio_set_value(bp->ops->bp_reset, GPIO_LOW);\r
gpio_set_value(bp->ops->bp_power, GPIO_LOW); \r
static int bp_suspend(struct bp_private_data *bp)\r
{ \r
int result = 0;\r
- \r
+ printk("m51 bp_suspend !!! \n");\r
bp->suspend_status = 1;\r
//gpio_set_value(bp->ops->ap_ready, GPIO_HIGH);\r
gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_HIGH);\r
}\r
static int bp_resume(struct bp_private_data *bp)\r
{\r
- \r
+ printk("m51 bp_resume !!! \n");\r
bp->suspend_status = 0; \r
//gpio_set_value(bp->ops->ap_ready, GPIO_LOW);\r
gpio_set_value(bp->ops->ap_wakeup_bp, GPIO_LOW);\r
struct bp_operate bp_m51_ops = {\r
#if defined(CONFIG_ARCH_RK2928)\r
.name = "m51",\r
- .bp_id = BP_ID_M50,\r
+ .bp_id = BP_ID_M51,\r
.bp_bus = BP_BUS_TYPE_UART, \r
.bp_pid = 0, \r
.bp_vid = 0, \r
.bp_power = RK2928_PIN3_PC2, // 3g_power\r
.bp_en = RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
.bp_reset = RK2928_PIN0_PB6,\r
- .ap_ready = RK2928_PIN0_PD6, //\r
- .bp_ready = RK2928_PIN0_PD0,\r
+ .ap_ready = BP_UNKNOW_DATA, //\r
+ .bp_ready = BP_UNKNOW_DATA,\r
.ap_wakeup_bp = RK2928_PIN3_PC4,\r
.bp_wakeup_ap = RK2928_PIN3_PC3, //\r
.bp_assert = BP_UNKNOW_DATA,\r
.private_miscdev = NULL,\r
#elif defined(CONFIG_ARCH_RK30)\r
.name = "m51",\r
- .bp_id = BP_ID_M50,\r
+ .bp_id = BP_ID_M51,\r
.bp_bus = BP_BUS_TYPE_UART, \r
.bp_pid = 0, \r
.bp_vid = 0, \r
- .bp_power = BP_UNKNOW_DATA, // RK2928_PIN3_PC2, // 3g_power\r
- .bp_en = BP_UNKNOW_DATA, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
+ .bp_power = RK30_PIN0_PC2, // RK2928_PIN3_PC2, // 3g_power\r
+ .bp_en = RK30_PIN0_PC0, // RK2928_PIN3_PC5,//BP_UNKNOW_DATA, // 3g_en\r
.bp_reset = BP_UNKNOW_DATA, // RK2928_PIN0_PB6,\r
.ap_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD6, //\r
.bp_ready = BP_UNKNOW_DATA, // RK2928_PIN0_PD0,\r
- .ap_wakeup_bp = BP_UNKNOW_DATA, // RK2928_PIN3_PC4,\r
- .bp_wakeup_ap = BP_UNKNOW_DATA, // RK2928_PIN3_PC3, //\r
+ .ap_wakeup_bp = RK30_PIN3_PC6, // RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = RK30_PIN0_PC1, // RK2928_PIN3_PC3, //\r
.bp_assert = BP_UNKNOW_DATA,\r
.bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
.bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
.private_miscdev = NULL,\r
#else\r
.name = "m51",\r
- .bp_id = BP_ID_M50,\r
+ .bp_id = BP_ID_M51,\r
.bp_bus = BP_BUS_TYPE_UART, \r
.bp_pid = 0, \r
.bp_vid = 0, \r
.bp_bus = BP_BUS_TYPE_UART, \r
.bp_pid = 0, \r
.bp_vid = 0, \r
- .bp_power = BP_UNKNOW_DATA, // RK2928_PIN3_PC2, // 3g_power\r
+ .bp_power = RK30_PIN0_PC2, // RK2928_PIN3_PC2, // 3g_power\r
.bp_en = BP_UNKNOW_DATA, // 3g_en\r
.bp_reset = BP_UNKNOW_DATA,\r
.ap_ready = BP_UNKNOW_DATA, //\r
.bp_ready = BP_UNKNOW_DATA,\r
- .ap_wakeup_bp = BP_UNKNOW_DATA, // RK2928_PIN3_PC4,\r
- .bp_wakeup_ap = BP_UNKNOW_DATA, // RK2928_PIN3_PC3, //\r
+ .ap_wakeup_bp = RK30_PIN3_PC6, // RK2928_PIN3_PC4,\r
+ .bp_wakeup_ap = RK30_PIN0_PC1, // RK2928_PIN3_PC3, //\r
.bp_uart_en = BP_UNKNOW_DATA, //EINT9\r
.bp_usb_en = BP_UNKNOW_DATA, //W_disable\r
- .bp_assert = BP_UNKNOW_DATA, // RK2928_PIN3_PC5,\r
+ .bp_assert = RK30_PIN0_PC0, // RK2928_PIN3_PC5,\r
.trig = IRQF_TRIGGER_RISING,\r
\r
.active = bp_active,\r
BP_ID_MW100, //4 thinkwill MW100 WCDMA\r
BP_ID_TD8801, //5 spreadtrum SC8803 TD-SCDMA\r
BP_ID_SC6610, //6 spreadtrum SC6610 GSM\r
- BP_ID_M50, //7 spreadtrum RDA GSM\r
+ BP_ID_M51, //7 spreadtrum RDA GSM\r
BP_ID_MT6250, //8 ZINN M50 EDGE\r
BP_ID_C66A, //9 ZHIGUAN C66A GSM\r
BP_ID_SEW290, //10 SCV SEW290 WCDMA\r