From: xxh Date: Sat, 30 Mar 2013 07:39:47 +0000 (+0800) Subject: 1.add mt6229 power on/off on settings for MID X-Git-Tag: firefly_0821_release~7306 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ef5142dab9d040cf0fb85ff17a9add1adbdee280;p=firefly-linux-kernel-4.4.55.git 1.add mt6229 power on/off on settings for MID 2.change some method to static --- diff --git a/arch/arm/mach-rk30/board-rk30-sdk.c b/arch/arm/mach-rk30/board-rk30-sdk.c index 128175a06bb3..47afb4b2ba03 100755 --- a/arch/arm/mach-rk30/board-rk30-sdk.c +++ b/arch/arm/mach-rk30/board-rk30-sdk.c @@ -60,6 +60,9 @@ #if defined(CONFIG_MU509) #include #endif +#if defined(CONFIG_MT6229) +#include +#endif #if defined(CONFIG_MW100) #include #endif diff --git a/drivers/misc/3g_module/mt6229.c b/drivers/misc/3g_module/mt6229.c index 37b848f22db0..0a7ce947fa60 100755 --- a/drivers/misc/3g_module/mt6229.c +++ b/drivers/misc/3g_module/mt6229.c @@ -72,7 +72,7 @@ static irqreturn_t detect_irq_handler(int irq, void *dev_id) } return IRQ_HANDLED; } -int modem_poweron_off(int on_off) +static int modem_poweron_off(int on_off) { struct rk29_mt6229_data *pdata = gpdata; if(on_off) @@ -188,13 +188,17 @@ static ssize_t modem_status_write(struct class *cls, const char *_buf, size_t _c int new_state = simple_strtoul(_buf, NULL, 16); if(new_state == modem_status) return _count; if (new_state == 1){ - printk("%s, c(%d), modem resume \n", __FUNCTION__, new_state); - gpio_set_value(gpdata->modem_usb_en, GPIO_HIGH); - gpio_set_value(gpdata->modem_uart_en,GPIO_LOW); + // printk("%s, c(%d), modem resume \n", __FUNCTION__, new_state); + // gpio_set_value(gpdata->modem_usb_en, GPIO_HIGH); + // gpio_set_value(gpdata->modem_uart_en,GPIO_LOW); + printk("%s, c(%d), open modem \n", __FUNCTION__, new_state); + modem_poweron_off(1); }else if(new_state == 0){ - printk("%s, c(%d), modem suspend \n", __FUNCTION__, new_state); - gpio_set_value(gpdata->modem_usb_en, GPIO_LOW); - gpio_set_value(gpdata->modem_uart_en,GPIO_HIGH); + // printk("%s, c(%d), modem suspend \n", __FUNCTION__, new_state); + // gpio_set_value(gpdata->modem_usb_en, GPIO_LOW); + // gpio_set_value(gpdata->modem_uart_en,GPIO_HIGH); + printk("%s, c(%d), close modem \n", __FUNCTION__, new_state); + modem_poweron_off(0); }else{ printk("%s, invalid parameter \n", __FUNCTION__); } @@ -291,7 +295,7 @@ err6: return 0; } -int mt6229_suspend(struct platform_device *pdev, pm_message_t state) +static int mt6229_suspend(struct platform_device *pdev, pm_message_t state) { do_wakeup_irq = 1; ap_wakeup_bp(pdev, 0); @@ -299,14 +303,14 @@ int mt6229_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -int mt6229_resume(struct platform_device *pdev) +static int mt6229_resume(struct platform_device *pdev) { gpio_set_value(gpdata->modem_uart_en,GPIO_LOW); schedule_delayed_work(&wakeup_work, 2*HZ); return 0; } -void mt6229_shutdown(struct platform_device *pdev) +static void mt6229_shutdown(struct platform_device *pdev) { struct rk29_mt6229_data *pdata = pdev->dev.platform_data; struct modem_dev *mt6229_data = platform_get_drvdata(pdev); diff --git a/drivers/misc/3g_module/mu509.c b/drivers/misc/3g_module/mu509.c index d6b4dad93a31..1b4958db17ba 100755 --- a/drivers/misc/3g_module/mu509.c +++ b/drivers/misc/3g_module/mu509.c @@ -73,7 +73,7 @@ static irqreturn_t detect_irq_handler(int irq, void *dev_id) } return IRQ_HANDLED; } -int modem_poweron_off(int on_off) +static int modem_poweron_off(int on_off) { struct rk29_mu509_data *pdata = gpdata; if(on_off) @@ -295,7 +295,7 @@ err4: return 0; } -int mu509_suspend(struct platform_device *pdev, pm_message_t state) +static int mu509_suspend(struct platform_device *pdev, pm_message_t state) { suspend_int = 1; do_wakeup_irq = 1; @@ -309,7 +309,7 @@ int mu509_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -int mu509_resume(struct platform_device *pdev) +static int mu509_resume(struct platform_device *pdev) { #if defined(CONFIG_ARCH_RK29) rk29_mux_api_set(GPIO1C1_UART0RTSN_SDMMC1WRITEPRT_NAME, GPIO1H_UART0_RTS_N); @@ -324,7 +324,7 @@ int mu509_resume(struct platform_device *pdev) return 0; } -void mu509_shutdown(struct platform_device *pdev) +static void mu509_shutdown(struct platform_device *pdev) { struct rk29_mu509_data *pdata = pdev->dev.platform_data; struct modem_dev *mu509_data = platform_get_drvdata(pdev); diff --git a/drivers/misc/3g_module/mw100.c b/drivers/misc/3g_module/mw100.c index ca75f039c24d..2a540af57214 100755 --- a/drivers/misc/3g_module/mw100.c +++ b/drivers/misc/3g_module/mw100.c @@ -163,7 +163,7 @@ err2: return 0; } -int mw100_suspend(struct platform_device *pdev, pm_message_t state) +static int mw100_suspend(struct platform_device *pdev, pm_message_t state) { struct rk29_mw100_data *pdata = pdev->dev.platform_data; @@ -181,7 +181,7 @@ int mw100_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -int mw100_resume(struct platform_device *pdev) +static int mw100_resume(struct platform_device *pdev) { struct rk29_mw100_data *pdata = pdev->dev.platform_data; int irq; @@ -194,7 +194,7 @@ int mw100_resume(struct platform_device *pdev) return 0; } -void mw100_shutdown(struct platform_device *pdev) +static void mw100_shutdown(struct platform_device *pdev) { struct rk29_mw100_data *pdata = pdev->dev.platform_data; struct modem_dev *mw100_data = platform_get_drvdata(pdev); diff --git a/drivers/misc/3g_module/sew868.c b/drivers/misc/3g_module/sew868.c index ae786be7e6d7..fe4bd858ef96 100755 --- a/drivers/misc/3g_module/sew868.c +++ b/drivers/misc/3g_module/sew868.c @@ -60,7 +60,7 @@ static irqreturn_t detect_irq_handler(int irq, void *dev_id) } return IRQ_HANDLED; } -int modem_poweron_off(int on_off) +static int modem_poweron_off(int on_off) { struct rk30_sew868_data *pdata = gpdata; if(on_off) @@ -180,18 +180,18 @@ err1: return 0; } -int sew868_suspend(struct platform_device *pdev, pm_message_t state) +static int sew868_suspend(struct platform_device *pdev, pm_message_t state) { do_wakeup_irq = 1; return 0; } -int sew868_resume(struct platform_device *pdev) +static int sew868_resume(struct platform_device *pdev) { return 0; } -void sew868_shutdown(struct platform_device *pdev) +static void sew868_shutdown(struct platform_device *pdev) { struct rk30_sew868_data *pdata = pdev->dev.platform_data; struct modem_dev *sew868_data = platform_get_drvdata(pdev);