mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
1.add mt6229 power on/off on settings for MID
2.change some method to static
This commit is contained in:
@@ -60,6 +60,9 @@
|
||||
#if defined(CONFIG_MU509)
|
||||
#include <linux/mu509.h>
|
||||
#endif
|
||||
#if defined(CONFIG_MT6229)
|
||||
#include <linux/mt6229.h>
|
||||
#endif
|
||||
#if defined(CONFIG_MW100)
|
||||
#include <linux/mw100.h>
|
||||
#endif
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user