Commit latest Qisda version and Bookeen's modification
This commit is contained in:
@@ -1,5 +1,64 @@
|
||||
menu "Generic Driver Options"
|
||||
|
||||
|
||||
# Qisda, Joey Lin {
|
||||
config QISDA_BQ060B00
|
||||
bool "QISDA BQ060B00"
|
||||
default n
|
||||
help
|
||||
Say Y here, and a list of supported model AS090B00 will be displayed.
|
||||
This option doesn't affect the kernel.
|
||||
|
||||
choice
|
||||
depends on QISDA_BQ060B00
|
||||
prompt "qisda bq060b00"
|
||||
default QISDA_BQ060B00_DVT
|
||||
config QISDA_BQ060B00_DVT
|
||||
bool "DVT"
|
||||
---help---
|
||||
QISDA_BQ060B00_DVT
|
||||
|
||||
#config QISDA_BQ060B00_DVT2
|
||||
# bool "DVT2"
|
||||
# ---help---
|
||||
# QISDA_BQ060B00_DVT2
|
||||
|
||||
endchoice
|
||||
# Qisda, Joey Lin }
|
||||
|
||||
# Qisda, Ralph Chang {
|
||||
config QISDA_BK060B00
|
||||
bool "QISDA BK060B00"
|
||||
default n
|
||||
help
|
||||
Say Y here, and a list of supported model BK060B00 will be displayed.
|
||||
This option doesn't affect the kernel.
|
||||
|
||||
# Qisda, Ralph Chang }
|
||||
|
||||
|
||||
# Qisda, Howard Hsu, 2010/01/07, fix SH060B00 config missing {
|
||||
config QISDA_SH060B00
|
||||
bool "QISDA SH060B00"
|
||||
default n
|
||||
help
|
||||
Say Y here, and a list of supported model SH060B00 will be displayed.
|
||||
This option doesn't affect the kernel.
|
||||
|
||||
choice
|
||||
depends on QISDA_SH060B00
|
||||
prompt "qisda sh060b00"
|
||||
default QISDA_SH060B00_DVT
|
||||
config QISDA_SH060B00_DVT
|
||||
bool "DVT"
|
||||
---help---
|
||||
QISDA_SH060B00_DVT
|
||||
|
||||
endchoice
|
||||
# } Qisda, Howard Hsu, 2010/01/07, fix SH060B00 config missing
|
||||
|
||||
|
||||
|
||||
# Qisda, Asaku Chen {
|
||||
config QISDA_QD060B00
|
||||
bool "QISDA QD060B00"
|
||||
|
||||
@@ -62,15 +62,22 @@
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
//#define USE_12BITS_ADC
|
||||
//#define USE_10BITS_ADC
|
||||
#define LEVEL0_MIN 2980
|
||||
#define LEVEL0_MAX 3384
|
||||
#define LEVEL1_MIN 3385
|
||||
#define LEVEL1_MAX 3484
|
||||
#define LEVEL2_MIN 3485
|
||||
#define LEVEL2_MAX 3684
|
||||
#define LEVEL3_MIN 3685
|
||||
#define LEVEL3_MAX 4080
|
||||
#define BATTERY_FULL 4081
|
||||
|
||||
|
||||
#define LEVEL0_MIN 2980 /*0%~25%*/
|
||||
#define LEVEL0_MAX 3581
|
||||
#define LEVEL1_MIN 3582 /*25%~50%*/ /*3.67V*/ /*3582*/
|
||||
#define LEVEL1_MAX 3666
|
||||
#define LEVEL2_MIN 3667 /*50%~75%*/ /*3.78V*/ /*3692*/ /*-25*/
|
||||
#define LEVEL2_MAX 3778
|
||||
#define LEVEL3_MIN 3779 /*75%~99%*/ /*3.92V*/ /*3829*/ /*-50*/
|
||||
#define LEVEL3_MAX 4004
|
||||
#define BATTERY_FULL 4005 /*100%*/ /*4.1V*/ /*4005*/
|
||||
|
||||
|
||||
#define ADC_sample_count 100 //25 /*joey modify ADC read method to catch top 5 low value 2009/12/21*/
|
||||
#define ADC_jig_voltage 3700 /*joey for ENV ADC to voltage 2010/01/15*/
|
||||
|
||||
#define ADC_READ_LEVEL_VAULE _IOR('S', 0x01, unsigned long)
|
||||
#define ADC_READ_INPUT_SOURCE_STATUS _IOR('S', 0x02, unsigned long)
|
||||
#define ADC_SET_PM_WKUP_SOURCE _IOW('S', 0x03, unsigned long)
|
||||
@@ -84,6 +91,19 @@
|
||||
#endif
|
||||
#define ADC_READ_WAKEUP_SOURCE _IOR('S', 0x0A, unsigned long)
|
||||
#define ADC_READ_POWER_FAIL_STATUS _IOR('S', 0x0B, unsigned long)
|
||||
|
||||
#define ADC_READ_LEVEL_VAULE_TOOL _IOR('S', 0x10, unsigned long) /*qisda joey add for tool read 20091207*/
|
||||
#define ADC_READ_RAW_VAULE_TOOL _IOR('S', 0x11, unsigned long) /*qisda joey add for tool read 20091207*/
|
||||
#define HIGH_LOW_PULSE _IOR('S', 0x12, unsigned long)
|
||||
#define ADC_READ_ENV _IOR('S', 0x13, unsigned long) /*joey for ENV ADC read/write 2010/01/13*/
|
||||
#define ADC_GET_ENV _IOR('S', 0x14, unsigned long) /*joey for ENV ADC read/write 2010/01/13*/
|
||||
#define ADC_READ_VOLTAGE _IOR('S', 0x15, unsigned long) /*joey for ENV ADC to voltage 2010/01/15*/
|
||||
|
||||
/* 2010/1/21, weichen, for handling events during suspend */
|
||||
#if defined (CONFIG_PM_PLATFORM_POWER_SAVING)
|
||||
#define ADC_CLEAR_WAKEUP_EVENT _IOW('S', 0x20, unsigned long)
|
||||
#endif
|
||||
|
||||
//#define ADC_INPUT_PIN _IOW('S', 0x0c, unsigned long)
|
||||
/*Qisda Qube 20091103 for Smart card power control*/
|
||||
#define ADC_SMARTCARD_PWR _IOR('S', 0x8F, unsigned long)
|
||||
@@ -96,6 +116,12 @@ unsigned int wkup_srce = NON_ZERO_VALUE;
|
||||
#ifdef CONFIG_PM_CPU_MODE
|
||||
unsigned char pm_cpu_mode = 0;
|
||||
#endif
|
||||
|
||||
/* 2010/1/21, weichen, for handling events during suspend */
|
||||
#if defined (CONFIG_PM_PLATFORM_POWER_SAVING)
|
||||
unsigned int g_wakeup_event_occurs = 0;
|
||||
#endif
|
||||
|
||||
#define ADC_PM_DEBUG_PORT (0x00000003)
|
||||
#define ADC_PM_WIFI (0x0000000C)
|
||||
#define ADC_PM_AUDIO (0x00000030)
|
||||
@@ -111,11 +137,12 @@ extern int IsWallCharger(void);
|
||||
extern int charging_source;
|
||||
/* } Qisda, ShiYong Lin, 2009/10/27, Modify for exception in IsWallCharger function */
|
||||
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event {
|
||||
//extern int sleeping_cha_event;
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event }
|
||||
|
||||
#define ADC_MINOR 131
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined(CONFIG_CPU_S3C2443)
|
||||
#define ADC_ENV(x) (S3C2410_ADCCON_PRSCVL(49))
|
||||
#else
|
||||
@@ -142,6 +169,8 @@ struct s3c_adc_mach_info s3c_adc_cfg __initdata = {
|
||||
//#endif
|
||||
};
|
||||
|
||||
int average_adc_value_keep1 = 9999; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
int average_adc_value_keep2 = 9999; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
|
||||
static struct clk *adc_clock;
|
||||
static void __iomem *base_addr;
|
||||
@@ -153,6 +182,7 @@ static unsigned long data_for_ADCCON;
|
||||
static unsigned long data_for_ADCTSC;
|
||||
|
||||
static int adc_port = 0;
|
||||
static unsigned long env_adc_value; /*joey for ENV ADC to voltage 2010/01/15*/
|
||||
|
||||
static void s3c_adc_save_SFR_on_ADC(void) {
|
||||
|
||||
@@ -270,16 +300,43 @@ s3c_adc_read(void)
|
||||
#endif
|
||||
/* Qisda, ShiYong Lin, 2009/07/18, ADC and Battery Status }*/
|
||||
|
||||
void bubblesort(int *data, int n) /*joey modify ADC read method to catch top 5 low value 2009/12/21*/
|
||||
{
|
||||
int i, j, temp;
|
||||
for (i = n - 1; i > 0; i--)
|
||||
{
|
||||
for (j = 0; j <= i - 1; j++)
|
||||
{
|
||||
if (data[j] > data[j + 1])
|
||||
{
|
||||
temp = data[j];
|
||||
data[j] = data[j + 1];
|
||||
data[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int i = 0;
|
||||
int average_adc_value = 0;
|
||||
int env_adc_voltage; /*joey for ENV ADC to voltage 2010/01/15*/
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
unsigned long data_mask = 0; /* BenQ, weichen, 2009/12/22, check the wakeup source of 2416 for MMI */
|
||||
#else
|
||||
int data_mask = 0;
|
||||
#endif
|
||||
unsigned int ret = -ENOIOCTLCMD;
|
||||
unsigned long level = NON_ZERO_VALUE;
|
||||
unsigned long input_source = NON_ZERO_VALUE;
|
||||
int ADC_raw_data[ADC_sample_count]; /*joey modify ADC read method to catch top 5 low value 2009/12/21*/
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
/* BenQ, weichen, 2009/12/22, check the wakeup source of 2416 for MMI */
|
||||
void __user *uarg = (void __user *) arg;
|
||||
#endif
|
||||
|
||||
switch (cmd) {
|
||||
/*Qisda Qube 20091103 for Smart card power control*/
|
||||
case ADC_SMARTCARD_PWR:
|
||||
@@ -324,32 +381,114 @@ static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
wkup_srce = (unsigned long) arg;
|
||||
printk("Wakeup parameter = %d\n", wkup_srce);
|
||||
/* Qisda, ShiYong Lin, 2009/09/28, Add the sleep event message when sleep {*/
|
||||
#ifdef QISDA
|
||||
s3c_keypad_pm_sleep_message_to_ap(1);
|
||||
#endif
|
||||
//s3c_keypad_pm_sleep_message_to_ap(1);
|
||||
/* } Qisda, ShiYong Lin, 2009/09/28, Add the sleep event message when sleep */
|
||||
ret = 0;
|
||||
break;
|
||||
case ADC_READ_LEVEL_VAULE:
|
||||
for(i=0; i<20 ;i++)
|
||||
for(i=0; i<ADC_sample_count ;i++)
|
||||
{
|
||||
udelay(1000);
|
||||
average_adc_value += s3c_adc_read();
|
||||
//udelay(1000);
|
||||
msleep(1); /*joey modify for asus request 2009/12/18*/
|
||||
average_adc_value += s3c_adc_read(); /*old*/
|
||||
////ADC_raw_data[i] = s3c_adc_read(); /*joey modify ADC read method to catch top 5 low value 2009/12/21*/ /*new*/
|
||||
}
|
||||
average_adc_value = average_adc_value/20;
|
||||
average_adc_value = average_adc_value/ADC_sample_count; /*old*/
|
||||
|
||||
//for(i=0; i<ADC_sample_count ;i++)
|
||||
// printk("Before ADC data = %d\n", (int)ADC_raw_data[i]);
|
||||
////bubblesort(ADC_raw_data, ADC_sample_count); /*new*/
|
||||
//for(i=0; i<ADC_sample_count ;i++)
|
||||
// printk("After ADC data = %d\n", (int)ADC_raw_data[i]);
|
||||
////average_adc_value = (ADC_raw_data[1]+ADC_raw_data[2]+ADC_raw_data[3]+ADC_raw_data[4]+ADC_raw_data[5])/5; /*new*/
|
||||
|
||||
// if((readl(S3C2410_GPGDAT)&(1<<1)) == 0) /*no usb charger */
|
||||
// {
|
||||
// if(average_adc_value > average_adc_value_keep1) /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
// average_adc_value = average_adc_value_keep1;
|
||||
// }
|
||||
|
||||
if (average_adc_value <= LEVEL0_MAX)
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
else if (average_adc_value < LEVEL1_MAX && average_adc_value >= LEVEL1_MIN)
|
||||
else if (average_adc_value <= LEVEL1_MAX && average_adc_value >= LEVEL1_MIN)
|
||||
{
|
||||
level = 1;
|
||||
}
|
||||
else if (average_adc_value < LEVEL2_MAX && average_adc_value >= LEVEL2_MIN)
|
||||
else if (average_adc_value <= LEVEL2_MAX && average_adc_value >= LEVEL2_MIN)
|
||||
{
|
||||
level = 2;
|
||||
}
|
||||
else if(average_adc_value < LEVEL3_MAX && average_adc_value >= LEVEL3_MIN)
|
||||
else if(average_adc_value <= LEVEL3_MAX && average_adc_value >= LEVEL3_MIN)
|
||||
{
|
||||
level = 3;
|
||||
}
|
||||
else if(average_adc_value >= BATTERY_FULL)
|
||||
{
|
||||
level = 4;
|
||||
}
|
||||
// printk("level = %d, ADC data = %d\n", (int)level, (int)average_adc_value);
|
||||
put_user(level, (unsigned long __user *)arg);
|
||||
|
||||
// if((readl(S3C2410_GPGDAT)&(1<<1)) == 0) /*no usb charger */
|
||||
// average_adc_value_keep1 = average_adc_value; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
|
||||
ret = 0;
|
||||
break;
|
||||
case ADC_READ_RAW_VAULE:
|
||||
for(i=0; i<ADC_sample_count ;i++)
|
||||
{
|
||||
//udelay(1000);
|
||||
msleep(1); /*joey modify for asus request 2009/12/18*/
|
||||
average_adc_value += s3c_adc_read();/*old*/
|
||||
////ADC_raw_data[i] = s3c_adc_read(); /*joey modify ADC read method to catch top 5 low value 2009/12/21*/ /*new*/
|
||||
}
|
||||
average_adc_value = average_adc_value / ADC_sample_count; /*old*/
|
||||
|
||||
//for(i=0; i<ADC_sample_count ;i++)
|
||||
// printk("Before ADC data = %d\n", (int)ADC_raw_data[i]);
|
||||
////bubblesort(ADC_raw_data, ADC_sample_count); /*new*/
|
||||
//for(i=0; i<ADC_sample_count ;i++)
|
||||
// printk("After ADC data = %d\n", (int)ADC_raw_data[i]);
|
||||
////average_adc_value = (ADC_raw_data[1]+ADC_raw_data[2]+ADC_raw_data[3]+ADC_raw_data[4]+ADC_raw_data[5])/5; /*new*/
|
||||
|
||||
// if((readl(S3C2410_GPGDAT)&(1<<1)) == 0) /*no usb charger */
|
||||
// {
|
||||
// if(average_adc_value > average_adc_value_keep2) /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
// average_adc_value = average_adc_value_keep2;
|
||||
// }
|
||||
|
||||
printk("ADC data = %d\n", (int)average_adc_value);
|
||||
put_user(average_adc_value, (unsigned long __user *)arg);
|
||||
|
||||
// if((readl(S3C2410_GPGDAT)&(1<<1)) == 0) /*no usb charger */
|
||||
// average_adc_value_keep2 = average_adc_value; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
|
||||
case ADC_READ_LEVEL_VAULE_TOOL: /*qisda joey add for tool read 20091207*/
|
||||
for(i=0; i<1000 ;i++) /*qisda joey modify from 20 to 1000 20091202*/
|
||||
{
|
||||
udelay(1000);
|
||||
average_adc_value += s3c_adc_read();
|
||||
}
|
||||
average_adc_value = average_adc_value/1000; /*qisda joey modify from 20 to 1000 20091202*/
|
||||
if (average_adc_value <= LEVEL0_MAX)
|
||||
{
|
||||
level = 0;
|
||||
}
|
||||
else if (average_adc_value <= LEVEL1_MAX && average_adc_value >= LEVEL1_MIN)
|
||||
{
|
||||
level = 1;
|
||||
}
|
||||
else if (average_adc_value <= LEVEL2_MAX && average_adc_value >= LEVEL2_MIN)
|
||||
{
|
||||
level = 2;
|
||||
}
|
||||
else if(average_adc_value <= LEVEL3_MAX && average_adc_value >= LEVEL3_MIN)
|
||||
{
|
||||
level = 3;
|
||||
}
|
||||
@@ -361,21 +500,31 @@ static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
put_user(level, (unsigned long __user *)arg);
|
||||
ret = 0;
|
||||
break;
|
||||
case ADC_READ_RAW_VAULE:
|
||||
for(i=0; i<20 ;i++)
|
||||
case ADC_READ_RAW_VAULE_TOOL: /*qisda joey add for tool read 20091207*/
|
||||
for(i=0; i<1000 ;i++) /*qisda joey modify from 20 to 1000 20091202*/
|
||||
{
|
||||
udelay(1000);
|
||||
average_adc_value += s3c_adc_read();
|
||||
}
|
||||
average_adc_value = average_adc_value / 20;
|
||||
average_adc_value = average_adc_value / 1000; /*qisda joey modify from 20 to 1000 20091202*/
|
||||
printk("ADC data = %d\n", (int)average_adc_value);
|
||||
put_user(average_adc_value, (unsigned long __user *)arg);
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
|
||||
case ADC_POWER_OFF:
|
||||
printk("power off");
|
||||
printk("power off\n");
|
||||
//writeb(0x0, 0xc8a30029); /*joey shut down SD bus power before p_keep pull low 2010/01/06*/
|
||||
s3c_moviNAND_power_off();
|
||||
msleep(100);
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD14, 0);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG0, 0);
|
||||
#endif
|
||||
ret = 0;
|
||||
break;
|
||||
#ifdef CONFIG_QISDA_AS090B00_EVT1
|
||||
@@ -386,14 +535,16 @@ static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
ret = put_user(data_mask, (unsigned long __user *)arg);
|
||||
break;
|
||||
#endif
|
||||
#if defined(CONFIG_QISDA_AS090B00_EVT1_1) || defined (CONFIG_QISDA_QD090B00_EVT1) || defined(CONFIG_QISDA_QD060N00_DVT1_1)
|
||||
case ADC_READ_CHARGING_STATUS:
|
||||
data_mask = readl(S3C2410_GPFDAT);
|
||||
data_mask &= 0x1<<6;
|
||||
if(data_mask) /*shiyong joey for asus 2009/12/15*/
|
||||
data_mask = 1;
|
||||
else
|
||||
data_mask = 0;
|
||||
printk("GPF6 = %d\n", data_mask);
|
||||
ret = put_user(data_mask, (unsigned long __user *)arg);
|
||||
break;
|
||||
#endif
|
||||
case ADC_SET_PM_FUNCTION_POWER:
|
||||
printk("ADC_SET_PM_FUNCTION_POWER\n");
|
||||
#if defined(CONFIG_QISDA_AS090B00_EVT1_1) || defined(CONFIG_QISDA_AS090B00_EVT1) || defined(CONFIG_QISDA_QD060N00_DVT1_1) || defined(CONFIG_QISDA_QD090B00_EVT1)
|
||||
@@ -673,38 +824,74 @@ static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
// s3c2410_gpio_setpin(S3C2410_GPB3, 0);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF2, 0);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD10, 0);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
|
||||
#endif
|
||||
}
|
||||
else if(((arg & ADC_PM_TOUCH) >> 12)==1){
|
||||
//power on
|
||||
printk("ADC_PM_TOUCH, 1\n");
|
||||
// s3c2410_gpio_cfgpin(S3C2410_GPB3, S3C2410_GPB3_OUTP);
|
||||
// s3c2410_gpio_setpin(S3C2410_GPB3, 1);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD10, 1);
|
||||
#else
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF5, 1);
|
||||
#endif
|
||||
}
|
||||
else if(((arg & ADC_PM_TOUCH) >> 12)==2){
|
||||
//power on () + touch active mode (touch ioctl)
|
||||
printk("ADC_PM_TOUCH, 2 Touch GPIO on and Enter Active\n");
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD10, 1);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF5, 1);
|
||||
#endif
|
||||
}
|
||||
else if(((arg & ADC_PM_TOUCH) >> 12)==3){
|
||||
//power on + touch sleep mode (via touch ioctl)
|
||||
printk("ADC_PM_TOUCH, 3 Touch GPIO on and Enter Sleep\n");
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD10, 1);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF5, 1);
|
||||
#endif
|
||||
}
|
||||
else if(((arg & ADC_PM_TOUCH) >> 12)==4){
|
||||
//power on + touch deep sleep mode (via touch ioctl)
|
||||
printk("ADC_PM_TOUCH, 4 Touch GPIO on and Enter Deep sleep\n");
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD10, 1);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPF5, 1);
|
||||
#endif
|
||||
}
|
||||
else{
|
||||
printk("ADC_PM_TOUCH, 5~15 do nothing\n");
|
||||
@@ -799,16 +986,94 @@ static int s3c_adc_ioctl(struct inode *inode, struct file *file,
|
||||
ret = 0;
|
||||
break;
|
||||
#endif
|
||||
/* BenQ, weichen, 2009/12/22, check the wakeup source of 2416 for MMI */
|
||||
case ADC_READ_WAKEUP_SOURCE:
|
||||
data_mask = readl(S3C2443_WKUPSTAT);
|
||||
data_mask = readl(S3C2443_WKUPSTAT);
|
||||
printk("Wakeup source =0x%08lx\n", data_mask);
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
if (copy_to_user(uarg, &data_mask, sizeof(data_mask)))
|
||||
return -EFAULT;
|
||||
/* BenQ, weichen, 2010/1/28, clear the wakeup source of 2416 for MMI */
|
||||
#if defined (CONFIG_PM_PLATFORM_POWER_SAVING)
|
||||
writel(0x33, S3C2443_WKUPSTAT);
|
||||
data_mask = readl(S3C2443_WKUPSTAT);
|
||||
printk("Wakeup source2 =0x%08lx\n", data_mask);
|
||||
#endif
|
||||
#endif
|
||||
ret = 0;
|
||||
break;
|
||||
/* BenQ, weichen, 2009/12/22, check the wakeup source of 2416 for MMI */
|
||||
case ADC_READ_POWER_FAIL_STATUS:
|
||||
data_mask = readl(S3C2410_GPGDAT) & (1<<5);
|
||||
printk("ADC_READ_POWER_FAIL_STATUS GPG5 = %d\n", data_mask);
|
||||
ret = put_user(data_mask, (unsigned long __user *)arg);
|
||||
break;
|
||||
|
||||
case HIGH_LOW_PULSE: /*joey add for high/low pulse 2010/01/08*/
|
||||
{
|
||||
unsigned long percent[3]={0, 0, 0}; /*1:high sec 2:low msec 3:times*/
|
||||
int i;
|
||||
|
||||
copy_from_user(percent, (unsigned long) arg, sizeof(unsigned long)*3);
|
||||
printk("1st=%d, 2nd=%d, 3rd=%d\n", percent[0], percent[1], percent[2]);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH11, S3C2410_GPH11_OUTP);
|
||||
s3c2410_gpio_pullup(S3C2410_GPH11, 2);
|
||||
for(i=0; i<percent[2]; i++)
|
||||
{
|
||||
s3c2410_gpio_setpin(S3C2410_GPH11, 0);
|
||||
printk("GPH11 pull low\n");
|
||||
msleep(percent[1]);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH11, 1);
|
||||
printk("GPH11 pull high\n");
|
||||
msleep(percent[0]);
|
||||
}
|
||||
//ret = put_user(data_mask, (unsigned long __user *)arg);
|
||||
break;
|
||||
}
|
||||
|
||||
case ADC_GET_ENV: /*joey for ENV ADC read/write 2010/01/13*/
|
||||
copy_from_user(&env_adc_value, (unsigned long) arg, sizeof(unsigned long));
|
||||
printk("env_adc_value=%d\n", env_adc_value);
|
||||
//ret = put_user(data_mask, (unsigned long __user *)arg);
|
||||
break;
|
||||
|
||||
case ADC_READ_ENV: /*joey for ENV ADC read/write 2010/01/13*/
|
||||
ret = put_user(env_adc_value, (unsigned long __user *)arg);
|
||||
printk("env_adc_value=%d\n", env_adc_value);
|
||||
break;
|
||||
|
||||
case ADC_READ_VOLTAGE: /*joey for ENV ADC to voltage 2010/01/15*/
|
||||
if(env_adc_value > 3711 || env_adc_value < 3511)
|
||||
env_adc_value = 3611;
|
||||
printk("env_adc_value=%d\n", env_adc_value);
|
||||
|
||||
for(i=0; i<ADC_sample_count ;i++)
|
||||
{
|
||||
msleep(1); /*joey modify for asus request 2009/12/18*/
|
||||
average_adc_value += s3c_adc_read();
|
||||
}
|
||||
average_adc_value = average_adc_value / ADC_sample_count;
|
||||
printk("average_adc_value=%d\n", average_adc_value);
|
||||
|
||||
if(average_adc_value >= env_adc_value)
|
||||
env_adc_voltage = ADC_jig_voltage + (average_adc_value-env_adc_value)*100/97;
|
||||
else
|
||||
env_adc_voltage = ADC_jig_voltage - (env_adc_value-average_adc_value)*100/97;
|
||||
|
||||
ret = put_user(env_adc_voltage, (unsigned long __user *)arg);
|
||||
printk("env_adc_voltage=%d\n", env_adc_voltage);
|
||||
break;
|
||||
#if defined (CONFIG_PM_PLATFORM_POWER_SAVING)
|
||||
case ADC_CLEAR_WAKEUP_EVENT:
|
||||
g_wakeup_event_occurs = 0;
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event {
|
||||
//sleeping_cha_event = 0;
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event }
|
||||
printk("ADC_CLEAR_WAKEUP_EVENT: g_wakeup_event_occurs=%d\n", g_wakeup_event_occurs);
|
||||
ret = 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
ret = -ENOIOCTLCMD;
|
||||
break;
|
||||
|
||||
@@ -917,6 +917,11 @@ static int s3c24xx_i2c_resume(struct platform_device *dev)
|
||||
//AUDIO [i2c] SDA setting
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA);
|
||||
|
||||
/*kit.add 2010/01/11*/
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA);
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL);
|
||||
/*kit.end*/
|
||||
|
||||
printk("[HIKO DEBUG]s3c24xx_i2c_resume");
|
||||
//HIKO: for RT5624 audio power management process {
|
||||
//#endif //0
|
||||
@@ -941,6 +946,14 @@ static int s3c24xx_i2c_suspend(struct platform_device *dev)
|
||||
//AUDIO [i2c] SDA setting
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_INP);
|
||||
|
||||
/*kit.add 2010/01/11*/
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPE14, 0);
|
||||
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPE15, 0);
|
||||
/*kit.end*/
|
||||
|
||||
printk("[HIKO DEBUG]s3c24xx_i2c_suspend");
|
||||
|
||||
|
||||
@@ -956,7 +969,7 @@ static int s3c24xx_i2c_suspend(struct platform_device *dev)
|
||||
static struct platform_driver s3c2410_i2c_driver = {
|
||||
.probe = s3c24xx_i2c_probe,
|
||||
.remove = s3c24xx_i2c_remove,
|
||||
.suspend = s3c24xx_i2c_suspend, //Asaku
|
||||
.suspend = s3c24xx_i2c_suspend, //Asaku
|
||||
.resume = s3c24xx_i2c_resume,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
@@ -967,7 +980,7 @@ static struct platform_driver s3c2410_i2c_driver = {
|
||||
static struct platform_driver s3c2440_i2c_driver = {
|
||||
.probe = s3c24xx_i2c_probe,
|
||||
.remove = s3c24xx_i2c_remove,
|
||||
.suspend = s3c24xx_i2c_suspend, //Asaku
|
||||
.suspend = s3c24xx_i2c_suspend, //Asaku
|
||||
.resume = s3c24xx_i2c_resume,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
|
||||
@@ -131,4 +131,12 @@ config QISDA_IIC
|
||||
help
|
||||
tony.yc.huang@qisda.com
|
||||
#Qisda Tony 090406, add Auo touch i2c driver ]
|
||||
|
||||
#BENQ Aaron 091210, add power-saving of AUO touch i2c driver for plato
|
||||
config TOUCH_PM
|
||||
tristate "Power Saving Setting of Touch for Plato use"
|
||||
default n
|
||||
help
|
||||
aaron.lan@benq.com
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -52,6 +52,48 @@
|
||||
|
||||
#define QISDA_IIC_ID 0xB8
|
||||
#define DELAY_TIME_IIC_READ 8//1//8
|
||||
|
||||
//Aaron, add for the feature of buffered touch data
|
||||
#define USE_BUFFERED_TOUCH_DATA
|
||||
|
||||
|
||||
#ifdef USE_BUFFERED_TOUCH_DATA
|
||||
//Aaron, prevent from read wrong data in touch panel of old firmware version
|
||||
static int IsBufferedDataFwVersion;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TOUCH_PM
|
||||
//Aaron
|
||||
#define AXIS_DATA(axis) \
|
||||
printk(KERN_INFO"AA: show_%s():", #axis); \
|
||||
if (axis < 0) \
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", "read data error"); \
|
||||
else { \
|
||||
axis = axis; \
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(%d)\n", axis, axis); \
|
||||
}
|
||||
|
||||
#define COORD_DATA_BLOCK_NUM 8
|
||||
|
||||
#define X1_LSB 0x00
|
||||
#define X1_MSB 0x01
|
||||
|
||||
#define Y1_LSB 0x02
|
||||
#define Y1_MSB 0x03
|
||||
|
||||
#define X2_LSB 0x04
|
||||
#define X2_MSB 0x05
|
||||
|
||||
#define Y2_LSB 0x06
|
||||
#define Y2_MSB 0x07
|
||||
|
||||
#define X_SENSITIVITY 0x6F
|
||||
#define Y_SENSITIVITY 0x70
|
||||
#define INT_SETTING 0x71
|
||||
#define INT_WIDTH 0x72
|
||||
#define POWERMODE 0x73
|
||||
#define CALIBRATION 0x78
|
||||
#endif
|
||||
static struct i2c_driver qisda_iic_driver;
|
||||
static unsigned short normal_i2c[] = { QISDA_IIC_ID>>1 , I2C_CLIENT_END };
|
||||
I2C_CLIENT_INSMOD_1(qisda_iic);
|
||||
@@ -105,6 +147,308 @@ static struct i2c_driver qisda_iic_driver = {
|
||||
#define NEW_TCOM_BOARD
|
||||
//Tony 090615 end
|
||||
|
||||
#ifdef CONFIG_TOUCH_PM
|
||||
//Aaron
|
||||
static ssize_t show_x1(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
#if 1
|
||||
int x1;
|
||||
// int x1_lsb, x1_msb;
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
|
||||
x1 = i2c_smbus_read_word_data(&data->client, X1_LSB);
|
||||
AXIS_DATA(x1); /* Macro */
|
||||
// x1_lsb = i2c_smbus_read_byte_data(&data->client, X1_LSB);
|
||||
// x1_msb = i2c_smbus_read_byte_data(&data->client, X1_MSB);
|
||||
// printk(KERN_INFO"AA: show_x1():");
|
||||
// if (x1_lsb < 0 || x1_msb < 0)
|
||||
// return snprintf(buf, PAGE_SIZE, "%s\n", "read data error");
|
||||
// else {
|
||||
// x1 = (x1_lsb & 0xff) | (x1_msb << 8);
|
||||
// return snprintf(buf, PAGE_SIZE, "0x%x(%d)\n", x1, x1);
|
||||
// }
|
||||
#else
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
u8 coordinate[COORD_DATA_BLOCK_NUM] = {0};
|
||||
int ret = 0;
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
ret = i2c_smbus_read_i2c_block_data(&data->client, X1_LSB, COORD_DATA_BLOCK_NUM, coordinate);
|
||||
if (ret != COORD_DATA_BLOCK_NUM)
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", "read data error(number not match)");
|
||||
x1 = *(coordinate ) | (*(coordinate + 1) << 8);
|
||||
y1 = *(coordinate + 2) | (*(coordinate + 3) << 8);
|
||||
x2 = *(coordinate + 4) | (*(coordinate + 5) << 8);
|
||||
y2 = *(coordinate + 6) | (*(coordinate + 7) << 8);
|
||||
return snprintf(buf, PAGE_SIZE, "(%d,%d)(%d,%d)\n", x1, y1, x2, y2);
|
||||
#endif
|
||||
|
||||
}
|
||||
static DEVICE_ATTR(x1, S_IRUGO, show_x1, NULL);
|
||||
|
||||
static ssize_t show_y1(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int y1;
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
|
||||
y1 = i2c_smbus_read_word_data(&data->client, Y1_LSB);
|
||||
AXIS_DATA(y1); /* Macro */
|
||||
|
||||
/* printk(KERN_ERR"AA: show_y1(): y1_lsb=0x%x, y1_msb=0x%x \n", y1_lsb, y1_msb);
|
||||
if (y1_lsb < 0 || y1_msb < 0)
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", "read x1 error");
|
||||
else {
|
||||
y1 = (y1_lsb & 0xff) | ((y1_msb & 0x3) << 8);
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(%d)\n", x1, x1);
|
||||
}
|
||||
*/
|
||||
//return snprintf(buf, PAGE_SIZE, "0x%x\n", );
|
||||
}
|
||||
static DEVICE_ATTR(y1, S_IRUGO, show_y1, NULL);
|
||||
|
||||
static ssize_t show_x2(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int x2;
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
#if 0
|
||||
x2 = i2c_smbus_read_word_data(&data->client, X2_LSB);
|
||||
#else
|
||||
x2 = i2c_smbus_read_word_data(&data->client, 0xC0);
|
||||
#endif
|
||||
AXIS_DATA(x2); /* Macro */
|
||||
}
|
||||
static DEVICE_ATTR(x2, S_IRUGO, show_x2, NULL);
|
||||
|
||||
static ssize_t show_y2(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int y2;
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
#if 0
|
||||
y2 = i2c_smbus_read_word_data(&data->client, Y2_LSB);
|
||||
#else
|
||||
y2 = i2c_smbus_read_byte_data(&data->client, 0x77);
|
||||
#endif
|
||||
AXIS_DATA(y2); /* Macro */
|
||||
}
|
||||
static DEVICE_ATTR(y2, S_IRUGO, show_y2, NULL);
|
||||
|
||||
static ssize_t show_x_sensitivity(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value;
|
||||
|
||||
value = i2c_smbus_read_byte_data(&data->client, X_SENSITIVITY);
|
||||
if (value < 0 || value > 255)
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(error data)\n", value);
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", value);
|
||||
}
|
||||
|
||||
static ssize_t store_x_sensitivity(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value = 0;
|
||||
|
||||
sscanf(buf, "%x", &value);
|
||||
/* check whether data is correct */
|
||||
if (value < 0 || value > 255)
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, X_SENSITIVITY, value) < 0)
|
||||
return -EIO;
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(x_sensitivity, S_IWUSR | S_IRUGO, show_x_sensitivity, store_x_sensitivity);
|
||||
|
||||
static ssize_t show_y_sensitivity(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value;
|
||||
|
||||
value = i2c_smbus_read_byte_data(&data->client, Y_SENSITIVITY);
|
||||
if (value < 0 || value > 255)
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(error)\n", value);
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", value);
|
||||
}
|
||||
|
||||
static ssize_t store_y_sensitivity(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value = 0;
|
||||
|
||||
sscanf(buf, "%x", &value);
|
||||
/* check whether data is correct */
|
||||
if (value < 0 || value > 255)
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, Y_SENSITIVITY, value) < 0)
|
||||
return -EIO;
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(y_sensitivity, S_IWUSR | S_IRUGO, show_y_sensitivity, store_y_sensitivity);
|
||||
|
||||
static ssize_t show_int_setting(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", i2c_smbus_read_byte_data(&data->client, INT_SETTING));
|
||||
}
|
||||
|
||||
static ssize_t store_int_setting(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int setting_data = 0;
|
||||
|
||||
sscanf(buf, "%x", &setting_data);
|
||||
/* check whether data is correct */
|
||||
if (setting_data < 0 || setting_data > 0xf)
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, INT_SETTING, setting_data) < 0)
|
||||
return -EIO;
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(int_setting, S_IWUSR | S_IRUGO, show_int_setting, store_int_setting);
|
||||
|
||||
static ssize_t show_int_width(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value;
|
||||
|
||||
value = i2c_smbus_read_byte_data(&data->client, INT_WIDTH);
|
||||
if (value < 0 || value > 255)
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(error)\n", value);
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", value);
|
||||
}
|
||||
|
||||
static ssize_t store_int_width(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value = 0;
|
||||
|
||||
sscanf(buf, "%x", &value);
|
||||
|
||||
/* check whether data is correct */
|
||||
if (value < 0 || value > 255)
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, INT_WIDTH, value) < 0)
|
||||
return -EIO;
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(int_width, S_IWUSR | S_IRUGO, show_int_width, store_int_width);
|
||||
|
||||
static ssize_t show_powermode(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value;
|
||||
|
||||
value = i2c_smbus_read_byte_data(&data->client, POWERMODE);
|
||||
if (value < 0 || value & 0x08)
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(error)\n", value);
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", value);
|
||||
}
|
||||
|
||||
static ssize_t store_powermode(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value = 0;
|
||||
|
||||
sscanf(buf, "%x", &value);
|
||||
|
||||
/* check whether data is correct */
|
||||
if ((value < 0) || (value > (0xff -0x08)) || (value & 0x08))
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, POWERMODE, value) < 0)
|
||||
return -EIO;
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(powermode, S_IWUSR | S_IRUGO, show_powermode, store_powermode);
|
||||
|
||||
//TODO: add for calibration register.
|
||||
static ssize_t show_calibration(struct device *device, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value;
|
||||
|
||||
value = i2c_smbus_read_byte_data(&data->client, CALIBRATION);
|
||||
if (value < 0)
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x(error)\n", value);
|
||||
else
|
||||
return snprintf(buf, PAGE_SIZE, "0x%x\n", value);
|
||||
}
|
||||
|
||||
static ssize_t store_calibration(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct qisda_iic_data *data = dev_get_drvdata(device);
|
||||
int value = 0;
|
||||
//int value2 = -1;
|
||||
|
||||
sscanf(buf, "%x", &value);
|
||||
|
||||
/* check whether data is correct */
|
||||
if ((value < 0) || (value & (0xff - 0x03)))
|
||||
return -EINVAL;
|
||||
|
||||
if (i2c_smbus_write_byte_data(&data->client, CALIBRATION, value) < 0)
|
||||
return -EIO;
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(calibration, S_IWUSR | S_IRUGO, show_calibration, store_calibration);
|
||||
|
||||
static struct attribute *multitouch_attributes[] = {
|
||||
&dev_attr_x1.attr,
|
||||
&dev_attr_y1.attr,
|
||||
&dev_attr_x2.attr,
|
||||
&dev_attr_y2.attr,
|
||||
&dev_attr_x_sensitivity.attr,
|
||||
&dev_attr_y_sensitivity.attr,
|
||||
&dev_attr_int_setting.attr,
|
||||
&dev_attr_int_width.attr,
|
||||
&dev_attr_powermode.attr,
|
||||
&dev_attr_calibration.attr,
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
static const struct attribute_group multitouch_group = {
|
||||
.attrs = multitouch_attributes,
|
||||
};
|
||||
#endif
|
||||
|
||||
unsigned char qisda_iic_read(struct i2c_client *client, unsigned char subaddr)
|
||||
{
|
||||
int ret;
|
||||
@@ -140,6 +484,35 @@ writel(readl(g_pGPIOReg_GPFCON+0x04) & (0x0<<0), g_pGPIOReg_GPFCON+0x04);
|
||||
return buf[0];
|
||||
}
|
||||
|
||||
/*kit.add 2009/12/02*/
|
||||
unsigned char i2c_buf1[1];
|
||||
unsigned char i2c_buf2[4];
|
||||
int qisda_iic_read_pos(struct i2c_client *client, unsigned char subaddr)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
struct i2c_msg msg[] =
|
||||
{
|
||||
{client->addr, 0, 1, i2c_buf1},
|
||||
{client->addr, I2C_M_RD, 4, i2c_buf2},
|
||||
};
|
||||
|
||||
for(i=0; i<4; i++)
|
||||
i2c_buf2[i] = 0;
|
||||
|
||||
i2c_buf1[0] = subaddr;
|
||||
i2c_buf2[0] = subaddr;
|
||||
|
||||
ret = i2c_transfer(client->adapter, msg, 2) == 1 ? 0 : -EIO;
|
||||
/*if (ret == -EIO) {
|
||||
printk(" I2C read Error, subaddr: 0x%x \n", subaddr);
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*kit.end*/
|
||||
|
||||
static int qisda_iic_write(struct i2c_client *client, unsigned char subaddr, unsigned char val)
|
||||
{
|
||||
unsigned char buf[2];
|
||||
@@ -190,6 +563,17 @@ static int qisda_iic_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
//Then it will callback to the command
|
||||
if ((err = s3c_ts_iic_port_init(new_client))) goto exit_kfree;;
|
||||
|
||||
#ifdef CONFIG_TOUCH_PM
|
||||
/* Aaron: create sysfs group */
|
||||
if (sysfs_create_group(&new_client->dev.kobj, &multitouch_group) < 0) {
|
||||
printk(KERN_ERR "qisda_iic_detect: Unable to create sysfs group\n");
|
||||
//goto err_sysfs_create_group_failed;
|
||||
}
|
||||
//Aaron: powermode with allow_sleep
|
||||
if(qisda_iic_write(new_client, 0x73, 0x54) < 0)
|
||||
printk(KERN_ERR "qisda_iic_detect: fail to set powermode with allow_sleep\n");
|
||||
#endif
|
||||
|
||||
return err;
|
||||
|
||||
exit_kfree:
|
||||
@@ -240,33 +624,55 @@ writel(readl(g_pGPIOReg_GPFCON+0x08) | (0x2<<0), g_pGPIOReg_GPFCON+0x08);
|
||||
if(qisda_iic_write(client, 0x71, 0xA) < 0) return -EIO;
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8return= qisda_iic_read(client, 0x71);
|
||||
printk(KERN_INFO "qisda_iic_command INIT =0x%x\n",u8return);
|
||||
//printk(KERN_INFO "qisda_iic_command INIT =0x%x\n",u8return);
|
||||
qisda_iic_write(client, 0x6F, 0x22);
|
||||
qisda_iic_write(client, 0x70, 0x22);
|
||||
|
||||
#ifdef USE_BUFFERED_TOUCH_DATA
|
||||
//Aaron: add for buffered data
|
||||
/* enable buffered data, because default is disabled (0x0) */
|
||||
if(qisda_iic_write(client, 0xBE, 0x01) < 0) return -EIO;
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8return= qisda_iic_read(client, 0xBE);
|
||||
//printk(KERN_INFO "qisda_iic_command: points interval =0x%x\n",u8return);
|
||||
u8return= qisda_iic_read(client, 0x77); //read firmware version of touch panel
|
||||
//printk(KERN_INFO "qisda_iic_command: firmware version =0x%x\n",u8return);
|
||||
if (u8return < 0x13)
|
||||
IsBufferedDataFwVersion = 0;
|
||||
else
|
||||
IsBufferedDataFwVersion = 1;
|
||||
#endif
|
||||
#else // old
|
||||
printk(KERN_INFO "qisda_iic_command INIT 1111\n");
|
||||
//printk(KERN_INFO "qisda_iic_command INIT 1111\n");
|
||||
mdelay(6000);
|
||||
qisda_iic_write(client, 0x78, 0x3);
|
||||
printk(KERN_INFO "qisda_iic_command INIT 2222\n");
|
||||
//printk(KERN_INFO "qisda_iic_command INIT 2222\n");
|
||||
qisda_iic_write(client, 0x71,INT_MODE_ENABLE | INT_MODE_TOUCH_INDICATE);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8return= qisda_iic_read(client, 0x71);
|
||||
printk(KERN_INFO "qisda_iic_command INIT =0x%x\n",u8return);
|
||||
//printk(KERN_INFO "qisda_iic_command INIT =0x%x\n",u8return);
|
||||
#endif
|
||||
|
||||
break;
|
||||
case QISDA_IIC_READ_POSITION:
|
||||
pos = arg;
|
||||
#ifdef NEW_TCOM_BOARD
|
||||
u8x0= qisda_iic_read(client, 0x00);
|
||||
|
||||
/*kit.mod 2009/12/02*/
|
||||
/*u8x0= qisda_iic_read(client, 0x00);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8x1= qisda_iic_read(client, 0x01);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8y0= qisda_iic_read(client, 0x02);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
u8y1= qisda_iic_read(client, 0x03);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
udelay(DELAY_TIME_IIC_READ);*/
|
||||
|
||||
qisda_iic_read_pos(client, 0x00);
|
||||
u8x0 = i2c_buf2[0];
|
||||
u8x1 = i2c_buf2[1];
|
||||
u8y0 = i2c_buf2[2];
|
||||
u8y1 = i2c_buf2[3];
|
||||
/*kit.end*/
|
||||
#else
|
||||
u8x0= qisda_iic_read(client, 0x54);
|
||||
udelay(DELAY_TIME_IIC_READ);
|
||||
@@ -304,7 +710,62 @@ writel(readl(g_pGPIOReg_GPFCON+0x08) | (0x2<<0), g_pGPIOReg_GPFCON+0x08);
|
||||
#endif
|
||||
//printk("X: %d, Y: %d\n", pos[0], pos[1]);
|
||||
break;
|
||||
|
||||
#ifdef USE_BUFFERED_TOUCH_DATA
|
||||
/* Aaron,20091224, add for buffered data read */
|
||||
case QISDA_IIC_READ_BUFFERED_POSITION:
|
||||
{
|
||||
int coordinate[2] = {0}; /*[0]=x, [1]=y*/
|
||||
int *data = (int *)arg;
|
||||
int index, len, i, j, offset, *point_data;
|
||||
|
||||
/* prevent from using the panel of old firmware version */
|
||||
if (!IsBufferedDataFwVersion) {
|
||||
printk("qisda_iic_command():buffered data(Not supported firmware version)\n");
|
||||
break;
|
||||
}
|
||||
|
||||
index = data[0];
|
||||
len = data[1];
|
||||
point_data = data + (2 + index * len * 2); /* each point is made of two coordinate data*/
|
||||
offset = len * index * 4;
|
||||
/* read buffered data for each check length */
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
/* read coordinates for x & y (two words), as one point data */
|
||||
for (j = 0; j < 2; j++) {
|
||||
coordinate[j] = i2c_smbus_read_word_data(client, (0xC0 + offset + j*2));
|
||||
if (coordinate[j] < 0) {
|
||||
printk("qisda_iic_command():read word data error(%d),i=%d,j=%d\n", coordinate[j], i, j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
offset += 4; /* there are 4 bytes in each point data*/
|
||||
|
||||
//Aaron: //TODO: maybe should change from "<" to "<="
|
||||
/* if either of x/y is zero, we think they are both zero. */
|
||||
//TODO: need to feedback the status of no more read?????????
|
||||
if (coordinate[0] <= 0 || coordinate[1] <= 0)
|
||||
break;
|
||||
|
||||
#ifdef ROTATE_NAGATIVE_90
|
||||
#if defined(AUO_EPAPER_6_INCH)
|
||||
point_data[i*2] = 600 - coordinate[1];
|
||||
#elif defined(AUO_EPAPER_9_INCH)
|
||||
point_data[i*2] = 768 - coordinate[1];
|
||||
#else
|
||||
/* error: shall not go into this configuration */
|
||||
point_data[i*2] = coordinate[1];
|
||||
#endif
|
||||
point_data[i*2 + 1] = coordinate[0];
|
||||
#else
|
||||
point_data[i*2] = coordinate[0];
|
||||
point_data[i*2 + 1] = coordinate[1];
|
||||
#endif
|
||||
//printk("qisda_iic_command():buffered data(%d,%d)\n", point_data[i*2],point_data[i*2 + 1]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif //#ifdef USE_BUFFERED_TOUCH_DATA
|
||||
case QISDA_IIC_CALIBRATION:
|
||||
if(qisda_iic_write(client, 0x78, 0x3) < 0){
|
||||
printk("CALIBRATION ERROR!");
|
||||
@@ -312,25 +773,43 @@ writel(readl(g_pGPIOReg_GPFCON+0x08) | (0x2<<0), g_pGPIOReg_GPFCON+0x08);
|
||||
}
|
||||
msleep(300);
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_TOUCH_PM
|
||||
case QISDA_IIC_ACTIVE_MODE:
|
||||
printk("ACTIVE MODE\n");
|
||||
//printk("ACTIVE MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x54);
|
||||
msleep(5);
|
||||
break;
|
||||
|
||||
case QISDA_IIC_SLEEP_MODE:
|
||||
//printk("SLEEP MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x55);
|
||||
msleep(5);
|
||||
break;
|
||||
|
||||
case QISDA_IIC_DEEPSLEEP_MODE:
|
||||
//printk("ALSO SLEEP MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x55);
|
||||
msleep(5);
|
||||
break;
|
||||
#else
|
||||
case QISDA_IIC_ACTIVE_MODE:
|
||||
//printk("ACTIVE MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x50);
|
||||
msleep(5);
|
||||
break;
|
||||
|
||||
case QISDA_IIC_SLEEP_MODE:
|
||||
printk("SLEEP MODE\n");
|
||||
//printk("SLEEP MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x51);
|
||||
msleep(5);
|
||||
break;
|
||||
|
||||
case QISDA_IIC_DEEPSLEEP_MODE:
|
||||
printk("DEEP SLEEP MODE\n");
|
||||
//printk("DEEP SLEEP MODE\n");
|
||||
qisda_iic_write(client, 0x73, 0x52);
|
||||
msleep(5);
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -29,6 +29,16 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
#define INPUT_DEVICES 256
|
||||
|
||||
/* Aaron, 20090122, add for CPU sleep prevention */
|
||||
/* prevent cpu from sleep when any event happens */
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
#define CPU_SLEEP_PREVENT
|
||||
#endif
|
||||
|
||||
#ifdef CPU_SLEEP_PREVENT
|
||||
extern unsigned int g_wakeup_event_occurs;
|
||||
#endif
|
||||
|
||||
static LIST_HEAD(input_dev_list);
|
||||
static LIST_HEAD(input_handler_list);
|
||||
|
||||
@@ -50,6 +60,10 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
|
||||
|
||||
if (type > EV_MAX || !test_bit(type, dev->evbit))
|
||||
return;
|
||||
|
||||
#ifdef CPU_SLEEP_PREVENT
|
||||
g_wakeup_event_occurs = 1;
|
||||
#endif
|
||||
|
||||
add_input_randomness(type, code, value);
|
||||
|
||||
|
||||
@@ -229,6 +229,13 @@ config KEYBOARD_GPIO
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called gpio-keys.
|
||||
|
||||
config CYBOOK_CYIO
|
||||
tristate "Cybook CyIO"
|
||||
# depends on MACH_CYBOOK_ORIZON
|
||||
default y
|
||||
help
|
||||
Say Y.
|
||||
|
||||
config KEYPAD_S3C
|
||||
tristate "S3C keypad support"
|
||||
depends on (CPU_S3C6400 || CPU_S3C6410)
|
||||
@@ -248,10 +255,4 @@ config KEYPAD_S3C_QISDA
|
||||
tony.yc.huang@qisda.com
|
||||
#Qisda Tony 090324, add keypad ]
|
||||
|
||||
config CYBOOK_CYIO
|
||||
tristate "CYBOOK buttons"
|
||||
default y
|
||||
help
|
||||
To compile this driver as a module, choose M here.
|
||||
|
||||
endif
|
||||
|
||||
@@ -23,4 +23,4 @@ obj-$(CONFIG_KEYPAD_S3C) += s3c-keypad.o
|
||||
#Qisda Tony 090324, add keypad [
|
||||
obj-$(CONFIG_KEYPAD_S3C_QISDA) += s3c-keypad-qisda.o
|
||||
#Qisda Tony 090324, add keypad ]
|
||||
obj-$(CONFIG_CYIO) += cyio.o
|
||||
obj-$(CONFIG_CYBOOK_CYIO) += cyio.o
|
||||
|
||||
@@ -12,21 +12,24 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/proc_fs.h>
|
||||
|
||||
|
||||
#include <cybook.h>
|
||||
|
||||
#include "cyio.h"
|
||||
#include <linux/cyio.h>
|
||||
|
||||
//#define CYIO_TIMER
|
||||
#define CYIO_REPEAT
|
||||
#define CYIO_TIMER
|
||||
//#define CYIO_REPEAT
|
||||
//#define CYIO_POLLING
|
||||
|
||||
#define CYIO_ALTERNATE_KEY
|
||||
//#define CYIO_ALTERNATE_KEY
|
||||
|
||||
#define DEBUG_MESSAGES
|
||||
#define DBG_IRQ
|
||||
//#define DEBUG_MESSAGES
|
||||
//#define DBG_IRQ
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/delay.h>
|
||||
#include <asm/delay.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm-arm/irq.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
@@ -43,17 +46,38 @@ spinlock_t io_lock = SPIN_LOCK_UNLOCKED;
|
||||
static unsigned long io_status = 0;
|
||||
struct task_struct *ptsk = 0;
|
||||
|
||||
unsigned int platform_type = CYBOOK_GEN4;
|
||||
#ifdef CYIO_POLLING
|
||||
#define GPROCFS_ROOTFOLDER "cybook"
|
||||
#define GPROCFS_MODULEFOLDER "gsensor"
|
||||
#define GPROCFS_CALIBFILE "calibration"
|
||||
#define GPROCFS_IOFILE "io"
|
||||
#define GPROCFS_STATUSFILE "status"
|
||||
#define GPROCFS_AXISFILE "axis"
|
||||
#define GPROCFS_THDXFILE "thdx"
|
||||
#define GPROCFS_THDYFILE "thdy"
|
||||
#define GPROCFS_DIRECTIONFILE "direction"
|
||||
#define GPROCFS_DEBUGFILE "debug"
|
||||
|
||||
unsigned long tiltRotation;
|
||||
static struct proc_dir_entry *rootDir, *ioProcEntry;
|
||||
#endif
|
||||
|
||||
#ifdef CYIO_TIMER
|
||||
#define IO_TIMER_DELAY_1 ((HZ * 1) / 2) /* 500 ms */
|
||||
#define IO_TIMER_DELAY_2 ((HZ * 2) / 1) /* 2 s */
|
||||
#define IO_TIMER_DELAY_3 ((HZ * 1) / 1) /* 1 s */
|
||||
static struct timer_list io_timer;
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
static struct timer_list io_btn_timer;
|
||||
#endif
|
||||
|
||||
static int timer_inited = 0;
|
||||
static int timer_run = 0;
|
||||
#endif
|
||||
|
||||
static volatile int CyIO_Running = 0;
|
||||
|
||||
#define TRUE (1==1)
|
||||
#define FALSE (0==1)
|
||||
|
||||
@@ -72,14 +96,26 @@ typedef struct _cyIrq_
|
||||
char* sName;
|
||||
} cyIrq;
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
typedef struct _cyPoll_
|
||||
{
|
||||
u32 nGpio;
|
||||
u8 oldState;
|
||||
u8 nCodeActive;
|
||||
u8 nCodeInactive;
|
||||
char *sName;
|
||||
} cyPoll;
|
||||
#endif
|
||||
|
||||
typedef struct _cyEvent_
|
||||
{
|
||||
u8 nCode;
|
||||
u8 nKeyEvent;
|
||||
u8 bValid;
|
||||
void* pNext;
|
||||
} cyEvent;
|
||||
|
||||
static cyEvent s_nEvents[10];
|
||||
static cyEvent s_nEvents[20];
|
||||
static int s_nEventMax = sizeof(s_nEvents)/sizeof(s_nEvents[0]);
|
||||
static int s_nEventCnt = 0;
|
||||
static int s_nKeyLogMax = 1;
|
||||
@@ -119,31 +155,48 @@ static u8 s_altKeyPresent = FALSE; /* By default we don't have a Alt Key */
|
||||
#define GPIO_G8 S3C2410_GPG8
|
||||
#define GPIO_G9 S3C2410_GPG9
|
||||
|
||||
|
||||
#define GPIO_D10 S3C2410_GPD10
|
||||
#define GPIO_D11 S3C2410_GPD11
|
||||
#define GPIO_D14 S3C2410_GPD14
|
||||
|
||||
#define GPIO_H4 S3C2410_GPH4
|
||||
#define GPIO_H5 S3C2410_GPH5
|
||||
|
||||
static cyIrq *s_nIrq ;
|
||||
static int nCnt;
|
||||
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
static int nPCnt;
|
||||
static cyPoll *s_nPio;
|
||||
#endif
|
||||
|
||||
static cyIrq s_nIrq_GEN4[] =
|
||||
{ /* Event structure for the Cybook Gen3 (2440) */
|
||||
/* IRQ GPIO A B C Depress Event Release Event Alt Event Name Number */
|
||||
{ IRQ_EINT0, GPIO_F0, 0, 1, 0, CYEVENT_KEY_OFF, 0, 0, "PowerBtn" } //0
|
||||
//, { IRQ_EINT1, GPIO_F1, 0, 0, 0, CYEVENT_SD_IN, CYEVENT_SD_OUT, 0, "SD Card" } //1
|
||||
//, { IRQ_EINT2, GPIO_F2, 0, 0, 0, CYEVENT_TP_PRESS, CYEVENT_TP_REL, 0, "Touch Panel" } //2
|
||||
//
|
||||
/* EINT3 is not Wifi EINT */
|
||||
/* EINT4 is Headphone plug status */
|
||||
/* EINT5 is Touchpanel Enable */
|
||||
/* EINT6 is charger status */
|
||||
, { IRQ_EINT7, GPIO_F7, 0, 1, 0, CYEVENT_KEY_LEFT, 0, 0, "Left" } //3
|
||||
/* INT8 is Power Keey???? */
|
||||
//, { IRQ_EINT9, GPIO_G1, 0, 0, 0, CYEVENT_USB_IN, CYEVENT_USB_OUT, 0, "USB" } //4
|
||||
/* EINT10 is SD power enable */
|
||||
, { IRQ_EINT15, GPIO_G7, 0, 1, 0, CYEVENT_KEY_RIGHT, 0, 0, "Right" } //5
|
||||
/* IRQ GPIO A B C Depress Event Release Event Alt Event Name Number */
|
||||
/* A:Reserved (must be 0) - B: Is Keypress Event? (or Allow Repeat?) (1: Yes, 0: No) - C: Is Alt Key? (1: Yes 0: No) */
|
||||
, { IRQ_EINT7, GPIO_F7, 0, 1, 0, CYEVENT_KEY_DOWN, 0, 0, "Down" } //1
|
||||
, { IRQ_EINT15, GPIO_G7, 0, 1, 0, CYEVENT_KEY_UP, 0, 0, "Up" } //2
|
||||
, { IRQ_EINT8, GPIO_G0, 0, 1, 0, CYEVENT_KEY_LEFT, 0, 0, "Left" } //3
|
||||
, { IRQ_EINT10, GPIO_G2, 0, 1, 0, CYEVENT_KEY_RIGHT, 0, 0, "Right" } //4
|
||||
, { IRQ_EINT14, GPIO_G6, 0, 1, 0, CYEVENT_KEY_ENTER, 0, 0, "Center" } //5
|
||||
, { IRQ_EINT9, GPIO_G1, 0, 0, 0, CYEVENT_USB_OUT, CYEVENT_USB_IN, 0, "USB" } //6
|
||||
/* IRQ GPIO A B C Depress Event Release Event Alt Event Name Number */
|
||||
/* A:Reserved (must be 0) - B: Is Keypress Event? (or Allow Repeat?) (1: Yes, 0: No) - C: Is Alt Key? (1: Yes 0: No) */
|
||||
};
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
static cyPoll s_nPoll_GEN4[] =
|
||||
{
|
||||
/* GPIO, Must 0 Depress Event, Release Event Name */
|
||||
// { GPIO_H4, 0, CYEVENT_KEY_LEFT, 0, "Left" }
|
||||
//, { GPIO_H5, 0, CYEVENT_KEY_RIGHT, 0, "Right" }
|
||||
//, { GPIO_D14, 0, CYEVENT_KEY_ENTER, 0, "Enter" }
|
||||
/* GPIO, Must 0 Depress Event, Release Event, Name */
|
||||
};
|
||||
#endif
|
||||
|
||||
static u8* s_pbUsbPowered = NULL;
|
||||
static u8* s_pbAcPowered = NULL;
|
||||
static u8* s_pbPowerOff = NULL;
|
||||
static u8* s_pbVolMinus = NULL;
|
||||
|
||||
@@ -151,6 +204,16 @@ static irqreturn_t io_interrupt(int irq, void *dev_id);
|
||||
|
||||
#ifdef CYIO_TIMER
|
||||
static void io_timer_handler(unsigned long nData);
|
||||
#ifdef CYIO_POLLING
|
||||
static void io_btn_timer_handler(unsigned long nData);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
static int procReadIo (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data);
|
||||
static int procWriteIo (struct file *file, const char *buffer,
|
||||
unsigned long count, void *data);
|
||||
#endif
|
||||
|
||||
#undef MSG
|
||||
@@ -159,8 +222,8 @@ static void io_timer_handler(unsigned long nData);
|
||||
#define MSG(str) { printk(KERN_ALERT str "\n"); }
|
||||
#define DBG(str, ...) { printk(KERN_ALERT str "\n", __VA_ARGS__); }
|
||||
#else
|
||||
#define MSG(str)
|
||||
#define DBG(str, ...)
|
||||
#define MSG(str)
|
||||
#define DBG(str, ...)
|
||||
#endif
|
||||
|
||||
//#define DEBUG_SPINLOCK
|
||||
@@ -186,35 +249,50 @@ static void io_timer_handler(unsigned long nData);
|
||||
#endif
|
||||
|
||||
/* Allow other modules/driver to push cyio event */
|
||||
void Cyio_PushEvent(char eventId, char unique)
|
||||
int Cyio_PushEvent(char eventId, char unique)
|
||||
{
|
||||
cyEvent *pEventC;
|
||||
|
||||
spinLock(&io_lock);
|
||||
int ret = 0;
|
||||
|
||||
spinLock(&io_lock);
|
||||
|
||||
/* CyIO is not running, ie no one take it, so don't accept events */
|
||||
if (CyIO_Running == 0)
|
||||
{
|
||||
spinUnlock(&io_lock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (unique != 0)
|
||||
{
|
||||
pEventC = s_pEventR;
|
||||
do
|
||||
{
|
||||
if (pEventC->nCode == eventId)
|
||||
goto exit;
|
||||
pEventC = pEventC->pNext;
|
||||
if (pEventC->nCode == eventId)
|
||||
{
|
||||
ret = -EEXIST;
|
||||
goto exit;
|
||||
}
|
||||
pEventC = pEventC->pNext;
|
||||
} while ((pEventC != s_pEventW) && (s_pEventR != s_pEventW));
|
||||
}
|
||||
DBG("New Pushed event '%c'\n", eventId);
|
||||
DBG("New Pushed event '%c'\n", eventId>8);
|
||||
|
||||
if (s_pEventW)
|
||||
{
|
||||
++s_nEventCnt;
|
||||
s_pEventW->nCode = eventId;
|
||||
s_pEventW->nCode = eventId;
|
||||
s_pEventW->nKeyEvent = 0;
|
||||
s_pEventW->bValid = 1;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
spinUnlock(&io_lock);
|
||||
|
||||
ret = 0;
|
||||
exit:
|
||||
if (ptsk)
|
||||
wake_up_process(ptsk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(Cyio_PushEvent);
|
||||
|
||||
@@ -223,9 +301,9 @@ EXPORT_SYMBOL(Cyio_PushEvent);
|
||||
void Cyio_ResetTimer(void)
|
||||
{
|
||||
if (timer_inited == 0)
|
||||
return;
|
||||
return;
|
||||
if (timer_run == 0)
|
||||
return;
|
||||
return;
|
||||
#ifndef ALTERNATE_TIMER_CHANGE
|
||||
del_timer(&io_timer);
|
||||
if (io_timer.data == CYEVENT_SUSPEND_SCREEN)
|
||||
@@ -260,6 +338,7 @@ void io_initEventList(void)
|
||||
cyEvent* pEvent = &s_nEvents[i];
|
||||
pEvent->nCode = 0;
|
||||
pEvent->nKeyEvent = 0;
|
||||
pEvent->bValid = 0;
|
||||
if (s_pEventR)
|
||||
s_pEventR->pNext = pEvent;
|
||||
s_pEventR = pEvent;
|
||||
@@ -289,8 +368,28 @@ void io_initIrq(void)
|
||||
int i;
|
||||
cyIrq *pIrq, *pIrq0;
|
||||
int ret;
|
||||
#ifdef CYIO_POLLING
|
||||
cyPoll *pPoll, *pPoll0;
|
||||
pPoll0 = &s_nPio[0];
|
||||
#endif
|
||||
pIrq0 = &s_nIrq[0];
|
||||
|
||||
|
||||
DBG(">>%s()\n", __func__);
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
tiltRotation = 90;
|
||||
for (i=0, pPoll=pPoll0; i<nPCnt; ++i, ++pPoll)
|
||||
{
|
||||
s3c2410_gpio_cfgpin(pPoll->nGpio, 0);
|
||||
s3c2410_gpio_pullup(pPoll->nGpio, 0);
|
||||
}
|
||||
|
||||
s3c2410_gpio_cfgpin(GPIO_D10, 0);
|
||||
s3c2410_gpio_pullup(GPIO_D10, 0);
|
||||
s3c2410_gpio_cfgpin(GPIO_D11, 0);
|
||||
s3c2410_gpio_pullup(GPIO_D11, 0);
|
||||
#endif
|
||||
// Read state as fast as possible (important when resuming)
|
||||
for (i=0, pIrq=pIrq0; i<nCnt; ++i, ++pIrq)
|
||||
{
|
||||
@@ -311,8 +410,8 @@ void io_initIrq(void)
|
||||
switch (pIrq->nCodeActive)
|
||||
{
|
||||
case CYEVENT_USB_IN:
|
||||
case CYEVENT_USB_OUT:
|
||||
s_pbUsbPowered = &pIrq->bActive;
|
||||
s_pbAcPowered = &pIrq->bActive;
|
||||
break;
|
||||
case CYEVENT_AC_IN:
|
||||
break;
|
||||
@@ -326,9 +425,9 @@ void io_initIrq(void)
|
||||
#ifdef CYIO_ALTERNATE_KEY
|
||||
if (pIrq->bIsAltKey)
|
||||
{ /* If this event is configured as the Alt key, just fill the needed variables */
|
||||
DBG("Found Alt key as '%s'\n", pIrq->sName);
|
||||
s_altKeyPresent = TRUE;
|
||||
s_altKeyGpio = pIrq->nGpio;
|
||||
DBG("Found Alt key as '%s'\n", pIrq->sName);
|
||||
s_altKeyPresent = TRUE;
|
||||
s_altKeyGpio = pIrq->nGpio;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -342,6 +441,7 @@ void io_initIrq(void)
|
||||
++s_nKeyLogCnt;
|
||||
s_pEventW->nCode = CYEVENT_FACTORY_OFF;
|
||||
s_pEventW->nKeyEvent = 1;
|
||||
s_pEventW->bValid = 0;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
spinUnlock(&io_lock);
|
||||
@@ -361,7 +461,7 @@ void io_initIrq(void)
|
||||
// !!! BUGBUG (we might miss system events once a key event is queued)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (s_pEventW)
|
||||
{
|
||||
++s_nEventCnt;
|
||||
@@ -369,6 +469,7 @@ void io_initIrq(void)
|
||||
++s_nKeyLogCnt;
|
||||
s_pEventW->nCode = pIrq->bActive ? pIrq->nCodeActive : pIrq->nCodeInactive;
|
||||
s_pEventW->nKeyEvent = pIrq->bKeyIrq;
|
||||
s_pEventW->bValid = 0;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
}
|
||||
@@ -379,9 +480,13 @@ void io_initIrq(void)
|
||||
{
|
||||
int nIrq = pIrq->nIrq;
|
||||
set_irq_type(nIrq, IRQT_BOTHEDGE);
|
||||
|
||||
|
||||
/* Set no Pullup and no Pulldown */
|
||||
s3c2410_gpio_pullup(pIrq->nGpio, 0);
|
||||
|
||||
DBG(".. io_initIrq [%s][%c] bActive[%d]", pIrq->sName, pIrq->bActive || !pIrq->nCodeInactive ? (char)pIrq->nCodeActive : (char)pIrq->nCodeInactive, pIrq->bActive);
|
||||
ret = request_irq(nIrq, io_interrupt, SA_INTERRUPT|SA_SHIRQ, "cyio", pIrq);
|
||||
ret = request_irq(nIrq, io_interrupt, SA_INTERRUPT|SA_SHIRQ, pIrq->sName, pIrq);
|
||||
enable_irq_wake(nIrq);
|
||||
if (ret != 0)
|
||||
{
|
||||
printk(KERN_ERR PFX "Error registering IRQ %d [%s]!\n", nIrq, pIrq->sName);
|
||||
@@ -393,7 +498,16 @@ void io_initIrq(void)
|
||||
timer_inited = 1;
|
||||
io_timer.function = io_timer_handler;
|
||||
io_timer.data = CYEVENT_SUSPEND_SCREEN;
|
||||
#ifdef CYIO_POLLING
|
||||
init_timer(&io_btn_timer);
|
||||
io_btn_timer.function = io_btn_timer_handler;
|
||||
io_btn_timer.expires = jiffies + HZ/8;
|
||||
add_timer(&io_btn_timer);
|
||||
#endif
|
||||
#endif
|
||||
spinLock(&io_lock);
|
||||
CyIO_Running = 1;
|
||||
spinUnlock(&io_lock);
|
||||
}
|
||||
// ---------------------------------------------------------------------------
|
||||
void io_deinitIrq(void)
|
||||
@@ -401,18 +515,27 @@ void io_deinitIrq(void)
|
||||
int i;
|
||||
cyIrq *pIrq, *pIrq0;
|
||||
|
||||
spinLock(&io_lock);
|
||||
CyIO_Running = 0;
|
||||
spinUnlock(&io_lock);
|
||||
|
||||
#ifdef CYIO_TIMER
|
||||
del_timer(&io_timer);
|
||||
timer_run = 0;
|
||||
# ifdef CYIO_POLLING
|
||||
del_timer(&io_btn_timer);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//nCnt = sizeof(s_nIrq)/sizeof(s_nIrq[0]);
|
||||
pIrq0 = &s_nIrq[0];
|
||||
for (i=0, pIrq=pIrq0; i<nCnt; ++i, ++pIrq)
|
||||
{
|
||||
disable_irq_wake(pIrq->nIrq);
|
||||
free_irq(pIrq->nIrq, pIrq);
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------------------------
|
||||
//#define DBG_IRQ
|
||||
static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
cyIrq* pIrq = (cyIrq*)dev_id;
|
||||
@@ -445,16 +568,22 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
|
||||
#ifdef DBG_IRQ
|
||||
#ifdef CYIO_ALTERNATE_KEY
|
||||
DBG(".. io_irq #%d [%s][%c] alt[%d:%d] bActive[%d]", s_nIrq_dbg, pIrq->sName, bActive || !pIrq->nCodeInactive ? (char)pIrq->nCodeActive : (char)pIrq->nCodeInactive, (s_altKeyPress && pIrq->bKeyIrq) ? pIrq->nCodeAlternate : (bActive ? pIrq->nCodeActive : pIrq->nCodeInactive), s_altKeyPress, bActive);
|
||||
#else
|
||||
DBG(".. io_irq #%d [%s][%c] bActive[%d]", s_nIrq_dbg, pIrq->sName, bActive || !pIrq->nCodeInactive ? (char)pIrq->nCodeActive : (char)pIrq->nCodeInactive, (bActive ? pIrq->nCodeActive : pIrq->nCodeInactive), bActive);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
blCodeActive = (s_altKeyPress && pIrq->bKeyIrq) ? pIrq->nCodeAlternate : (bActive ? pIrq->nCodeActive : pIrq->nCodeInactive);
|
||||
#ifdef CYIO_ALTERNATE_KEY
|
||||
blCodeActive = (s_altKeyPress && pIrq->bKeyIrq) ? pIrq->nCodeAlternate : (bActive ? pIrq->nCodeActive : pIrq->nCodeInactive);
|
||||
if (s_altKeyPresent)
|
||||
{
|
||||
s_altKeyPress = !gpio_get_value(s_altKeyGpio);
|
||||
DBG("alt status: %d", s_altKeyPress);
|
||||
DBG("alt status: %d", s_altKeyPress);
|
||||
}
|
||||
#else
|
||||
blCodeActive = bActive ? pIrq->nCodeActive : pIrq->nCodeInactive;
|
||||
#endif
|
||||
|
||||
spinLock(&io_lock);
|
||||
@@ -475,13 +604,14 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
|
||||
if (s_bRepMode && !s_nPrevKey)
|
||||
{
|
||||
MSG("Exit repeat mode...");
|
||||
MSG("Exit repeat mode...");
|
||||
s_bRepMode = 0;
|
||||
if (s_pEventW)
|
||||
{ // NB: This is considered as a system event
|
||||
++s_nEventCnt;
|
||||
s_pEventW->nCode = CYEVENT_KEY_REPEAT_END;
|
||||
s_pEventW->nKeyEvent = 0;
|
||||
s_pEventW->bValid = 0;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
if (ptsk)
|
||||
@@ -520,6 +650,7 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
++s_nKeyLogCnt;
|
||||
s_pEventW->nCode = CYEVENT_FACTORY_OFF;
|
||||
s_pEventW->nKeyEvent = 1;
|
||||
s_pEventW->bValid = 0;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
spinUnlock(&io_lock);
|
||||
@@ -537,7 +668,7 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
}
|
||||
|
||||
#ifdef CYIO_ALTERNATE_KEY
|
||||
|
||||
|
||||
if (s_altKeyPresent && bAltKeyUsed && !s_altKeyPress && (pIrq->nGpio == s_altKeyGpio))
|
||||
{ /* If the released key is the Alt Key and it was used as the Alt Key, do not send an event */
|
||||
MSG("Alt Key released... Do Nothing");
|
||||
@@ -550,19 +681,19 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
{ /* If the altKey is pressed, we have to do a little trick: Inverse it's active state */
|
||||
MSG("Alt key event...");
|
||||
/* To be sure */
|
||||
s_nPrevKey = 0;
|
||||
s_nPrevKey = 0;
|
||||
s_bRepMode = 0;
|
||||
|
||||
bActive = !bActive;
|
||||
bActive = !bActive;
|
||||
}
|
||||
else if (s_altKeyPresent && s_altKeyPress && pIrq->bKeyIrq)
|
||||
{/* The event is a keypress and the AltKey is pressed, set our internal value to prevent Alt to send an event */
|
||||
MSG("Button press with Alt...");
|
||||
if (pIrq->nCodeAlternate != 0)
|
||||
bAltKeyUsed = TRUE;
|
||||
if (pIrq->nCodeAlternate != 0)
|
||||
bAltKeyUsed = TRUE;
|
||||
}
|
||||
MSG("Hum...");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (s_pEventW)
|
||||
{
|
||||
@@ -578,7 +709,8 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
#endif
|
||||
|
||||
s_pEventW->nKeyEvent = pIrq->bKeyIrq;
|
||||
|
||||
s_pEventW->bValid = 0;
|
||||
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
spinUnlock(&io_lock);
|
||||
@@ -593,23 +725,88 @@ static irqreturn_t io_interrupt(int irq, void *dev_id)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
#ifdef CYIO_TIMER
|
||||
#ifdef CYIO_POLLING
|
||||
static void io_btn_timer_handler(unsigned long nData)
|
||||
{
|
||||
/* read buttons */
|
||||
cyPoll *pPoll, *pPoll0;
|
||||
int i;
|
||||
int curState;
|
||||
int currentTilt, tE1, tE2;
|
||||
pPoll0 = &s_nPio[0];
|
||||
|
||||
DBG(">>%s()\n", __func__);
|
||||
|
||||
for (i=0, pPoll=pPoll0; i<nPCnt; ++i, ++pPoll)
|
||||
{
|
||||
curState = !gpio_get_value(pPoll->nGpio);
|
||||
DBG("|| Btn '%s' [current: %d, old: %d, gpio: %d]\n", pPoll->sName, curState, pPoll->oldState, pPoll->nGpio);
|
||||
/* If button found pressed, then push event 'bout them */
|
||||
if (pPoll->oldState != curState)
|
||||
{
|
||||
if (curState != 0)
|
||||
Cyio_PushEvent(pPoll->nCodeActive, 1);
|
||||
/*else
|
||||
Cyio_PushEvent(CYEVENT_KEY_REPEAT_END, 1);*/
|
||||
}
|
||||
else if (pPoll->oldState != 0)
|
||||
{
|
||||
/* Push event with repeat flag */
|
||||
//Cyio_PushEvent(pPoll->nCodeActive | CYEVENT_KEY_REPEAT_FLAG, 1);
|
||||
}
|
||||
|
||||
pPoll->oldState = curState;
|
||||
|
||||
}
|
||||
|
||||
/* special case, look at the tilt sensor */
|
||||
tE1 = !gpio_get_value(GPIO_D11);
|
||||
tE2 = !gpio_get_value(GPIO_D10);
|
||||
currentTilt = 0;
|
||||
if (!tE2)
|
||||
currentTilt |= 1 << 1;
|
||||
if (!tE1)
|
||||
currentTilt |= 1 << 0;
|
||||
|
||||
switch(currentTilt)
|
||||
{
|
||||
case 0x00: /* 90 */
|
||||
currentTilt = 90;
|
||||
break;
|
||||
|
||||
case 0x01: /* 0 */
|
||||
currentTilt = 0;
|
||||
break;
|
||||
|
||||
case 0x02: /* 180 */
|
||||
currentTilt = 180;
|
||||
break;
|
||||
|
||||
case 0x03: /* 270 */
|
||||
currentTilt = 270;
|
||||
break;
|
||||
}
|
||||
if (currentTilt != tiltRotation)
|
||||
{ /* We move */
|
||||
tiltRotation = currentTilt;
|
||||
printk("New tilt: %d\n", tiltRotation);
|
||||
Cyio_PushEvent(CYEVENT_ORIENTATIONCHANGED, 1);
|
||||
}
|
||||
|
||||
/* Update the timer */
|
||||
io_btn_timer.expires = jiffies + HZ/8;
|
||||
mod_timer(&io_btn_timer, io_btn_timer.expires);
|
||||
DBG("<<%s()\n", __func__);
|
||||
}
|
||||
#endif
|
||||
static void io_timer_handler(unsigned long nData)
|
||||
{
|
||||
/* YEP inside */
|
||||
#if 0
|
||||
//#ifdef G_SENSOR
|
||||
if (hold_wakeup==1) {
|
||||
del_timer(&io_timer);
|
||||
goto end_timer;
|
||||
}
|
||||
#endif
|
||||
/* end YEP inside */
|
||||
DBG("Timer [%ld] tick...\n", nData);
|
||||
|
||||
spin_lock_irq(&io_lock);
|
||||
|
||||
del_timer(&io_timer);
|
||||
timer_run = 0;
|
||||
timer_run = 0;
|
||||
if (s_nEventCnt < s_nEventMax)
|
||||
{
|
||||
if (s_pEventW)
|
||||
@@ -617,6 +814,7 @@ static void io_timer_handler(unsigned long nData)
|
||||
++s_nEventCnt;
|
||||
s_pEventW->nCode = (u8)nData;
|
||||
s_pEventW->nKeyEvent = 0;
|
||||
s_pEventW->bValid = 0;
|
||||
s_pEventW = s_pEventW->pNext;
|
||||
}
|
||||
}
|
||||
@@ -625,7 +823,7 @@ static void io_timer_handler(unsigned long nData)
|
||||
|
||||
if (ptsk)
|
||||
wake_up_process(ptsk);
|
||||
//end_timer:
|
||||
//end_timer:
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -670,7 +868,7 @@ static int io_release(struct inode *inode, struct file *file)
|
||||
// Only initialize the list when registering the driver and when closing it
|
||||
// This allows for a quicker opening of the driver
|
||||
io_initEventList();
|
||||
|
||||
|
||||
spin_unlock_irq(&io_lock);
|
||||
|
||||
MSG("<< io_release");
|
||||
@@ -682,7 +880,7 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
int nBytes = sizeof(unsigned long);
|
||||
unsigned long nData;
|
||||
ssize_t nRes = 0;
|
||||
|
||||
u8 bDataValid = 0;
|
||||
if (count < sizeof(unsigned long))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -694,6 +892,7 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
if (s_nEventCnt)
|
||||
{
|
||||
nData = s_pEventR->nCode;
|
||||
bDataValid = s_pEventR->bValid;
|
||||
s_pEventR->nCode = 0;
|
||||
--s_nEventCnt;
|
||||
if (s_pEventR->nKeyEvent)
|
||||
@@ -702,7 +901,6 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
#ifdef CYIO_REPEAT
|
||||
if (nData != CYEVENT_KEY_OFF)
|
||||
{
|
||||
DBG("(line %d)Set s_nPrevKey", __LINE__);
|
||||
s_nPrevKey = nData;
|
||||
s_bRepMode = 0;
|
||||
}
|
||||
@@ -716,31 +914,26 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
int i;
|
||||
cyIrq *pIrq, *pIrq0;
|
||||
|
||||
pIrq0 = &s_nIrq[0];
|
||||
MSG("Will test key...");
|
||||
pIrq0 = &s_nIrq[0];
|
||||
for (i=0, pIrq=pIrq0; i<nCnt; ++i, ++pIrq)
|
||||
{
|
||||
#ifdef CYIO_ALTERNATE_KEY
|
||||
if ((pIrq->nCodeActive != s_nPrevKey) && (pIrq->nCodeAlternate != s_nPrevKey))
|
||||
#else
|
||||
if (pIrq->nCodeActive != s_nPrevKey)
|
||||
if (pIrq->nCodeActive != s_nPrevKey)
|
||||
#endif
|
||||
{
|
||||
MSG("!CodeActive and Alt+!AltCode");
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
MSG("May clear prevkey");
|
||||
}
|
||||
|
||||
if (!pIrq->bActive || gpio_get_value(pIrq->nGpio))
|
||||
{
|
||||
DBG("(line %d)Set s_nPrevKey", __LINE__);
|
||||
{
|
||||
s_nPrevKey = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (s_nPrevKey)
|
||||
{
|
||||
MSG("Will Set Repeat flag...");
|
||||
nData = s_nPrevKey | CYEVENT_KEY_REPEAT_FLAG;
|
||||
s_bRepMode = 1;
|
||||
}
|
||||
@@ -748,7 +941,7 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
#endif
|
||||
spinUnlock(&io_lock);
|
||||
|
||||
if (nData != 0)
|
||||
if ((nData != 0) | (bDataValid == 1))
|
||||
{
|
||||
#ifdef CYIO_TIMER
|
||||
del_timer(&io_timer);
|
||||
@@ -758,8 +951,8 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CYIO_TIMER
|
||||
if (s_pbUsbPowered && s_pbAcPowered && !(*s_pbUsbPowered) && !(*s_pbAcPowered))
|
||||
#ifdef CYIO_TIMER
|
||||
if (s_pbUsbPowered && (*s_pbUsbPowered))
|
||||
{
|
||||
del_timer(&io_timer);
|
||||
timer_run = 0;
|
||||
@@ -791,8 +984,8 @@ ssize_t io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nData)
|
||||
|
||||
if ((nData != 0) | (bDataValid == 1))
|
||||
{
|
||||
nRes = copy_to_user(buf,&nData,nBytes);
|
||||
if (!nRes)
|
||||
@@ -835,7 +1028,7 @@ static int io_remove(struct platform_device *dev)
|
||||
misc_deregister(&s_io_dev);
|
||||
return 0;
|
||||
}
|
||||
// ---------------------------------------------------------------------------
|
||||
// --------------------------------------------------------------------------
|
||||
static int io_resume(struct platform_device *dev)
|
||||
{
|
||||
//cyIrq *pIrq;
|
||||
@@ -847,7 +1040,7 @@ static int io_resume(struct platform_device *dev)
|
||||
pIrq = &s_nIrq[13];
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
pIrq = &s_nIrq[11];
|
||||
}
|
||||
|
||||
@@ -855,8 +1048,8 @@ static int io_resume(struct platform_device *dev)
|
||||
|
||||
//MSG(">>Resume() .......bSdCd 0x%x\n",bSdCd);
|
||||
if (pIrq->bActive == bSdCd)
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
|
||||
spinLock(&io_lock);
|
||||
pIrq->bActive = bSdCd;
|
||||
if (s_pEventW)
|
||||
@@ -870,7 +1063,7 @@ static int io_resume(struct platform_device *dev)
|
||||
if (ptsk)
|
||||
wake_up_process(ptsk);
|
||||
#endif
|
||||
|
||||
|
||||
MSG("<<Resume() .......\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -892,24 +1085,34 @@ static struct platform_driver cyio_driver =
|
||||
static int __init cyIo_init(void)
|
||||
{
|
||||
#if 0
|
||||
if(platform_type == CYBOOK_OPUS)
|
||||
{
|
||||
s_nIrq = s_nIrq_OPUS;
|
||||
nCnt = sizeof(s_nIrq_OPUS)/sizeof(s_nIrq_OPUS[0]);
|
||||
}
|
||||
else if (/* GEN3 && GEN3GOLD */
|
||||
{
|
||||
s_nIrq = s_nIrq_GEN3;
|
||||
nCnt = sizeof(s_nIrq_GEN3)/sizeof(s_nIrq_GEN3[0]);
|
||||
}
|
||||
if(platform_type == CYBOOK_OPUS)
|
||||
{
|
||||
s_nIrq = s_nIrq_OPUS;
|
||||
nCnt = sizeof(s_nIrq_OPUS)/sizeof(s_nIrq_OPUS[0]);
|
||||
}
|
||||
else if (/* GEN3 && GEN3GOLD */
|
||||
{
|
||||
s_nIrq = s_nIrq_GEN3;
|
||||
nCnt = sizeof(s_nIrq_GEN3)/sizeof(s_nIrq_GEN3[0]);
|
||||
}
|
||||
#endif
|
||||
s_nIrq = s_nIrq_GEN4;
|
||||
nCnt = sizeof(s_nIrq_GEN4)/sizeof(s_nIrq_GEN4[0]);
|
||||
|
||||
DBG("s_nEventMax:%d, s_nEventCnt:%d, s_nKeyLogMax:%d, s_nKeyLogCnt:%d",s_nEventMax,s_nEventCnt,s_nKeyLogMax,s_nKeyLogCnt);
|
||||
s_nIrq = s_nIrq_GEN4;
|
||||
#ifdef CYIO_POLLING
|
||||
s_nPio = s_nPoll_GEN4;
|
||||
nPCnt = sizeof(s_nPoll_GEN4)/sizeof(s_nPoll_GEN4[0]);
|
||||
#endif
|
||||
nCnt = sizeof(s_nIrq_GEN4)/sizeof(s_nIrq_GEN4[0]);
|
||||
|
||||
|
||||
/* end YEP inside */
|
||||
DBG("s_nEventMax:%d, s_nEventCnt:%d, s_nKeyLogMax:%d, s_nKeyLogCnt:%d",s_nEventMax,s_nEventCnt,s_nKeyLogMax,s_nKeyLogCnt);
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
rootDir = proc_mkdir(GPROCFS_MODULEFOLDER, proc_root_driver);
|
||||
ioProcEntry = create_proc_entry(GPROCFS_IOFILE, 0644, rootDir);
|
||||
ioProcEntry->read_proc = procReadIo;
|
||||
ioProcEntry->write_proc = procWriteIo;
|
||||
ioProcEntry->owner = THIS_MODULE;
|
||||
#endif
|
||||
|
||||
io_initEventList();
|
||||
|
||||
@@ -929,6 +1132,57 @@ static void __exit cyIo_exit(void)
|
||||
|
||||
//MSG("<< cyIo_exit");
|
||||
}
|
||||
|
||||
#ifdef CYIO_POLLING
|
||||
static int procReadIo (char *page, char **start, off_t off, int count,
|
||||
int *eof, void *data)
|
||||
{
|
||||
int len;
|
||||
char tmp = 0;
|
||||
//printk("Read IO Tilt [%d]", tiltRotation);
|
||||
switch (tiltRotation)
|
||||
{
|
||||
case 270:
|
||||
tmp++;
|
||||
case 180:
|
||||
tmp++;
|
||||
case 90:
|
||||
tmp++;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
len = sprintf (page, "%02X", tmp);
|
||||
DBG("io readed value: %02X", tmp);
|
||||
return len;
|
||||
}
|
||||
|
||||
static int procWriteIo (struct file *file, const char *buffer,
|
||||
unsigned long count, void *data)
|
||||
{
|
||||
char cmd;
|
||||
/* in case of... */
|
||||
if ( count < 1 )
|
||||
return 0;
|
||||
|
||||
cmd = buffer[0];
|
||||
switch(cmd)
|
||||
{
|
||||
case G_SENSOR_CAL:
|
||||
case G_SENSOR_ON:
|
||||
case G_SENSOR_OFF:
|
||||
case 254:
|
||||
break;
|
||||
|
||||
default:
|
||||
printk(KERN_ERR "ProcIO: Unknown command '%c'\n",cmd);
|
||||
break;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
module_init(cyIo_init);
|
||||
module_exit(cyIo_exit);
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
// ===========================================================================
|
||||
// cyio.h
|
||||
// Copyright (C) 2008-2009 Bookeen - All rights reserved
|
||||
// ===========================================================================
|
||||
// Key events
|
||||
#define CYEVENT_KEY_ENTER 'e'
|
||||
#define CYEVENT_KEY_RIGHT 'r'
|
||||
#define CYEVENT_KEY_DOWN 'd'
|
||||
#define CYEVENT_KEY_LEFT 'l'
|
||||
#define CYEVENT_KEY_UP 'u'
|
||||
#define CYEVENT_KEY_F1 '1'
|
||||
#define CYEVENT_KEY_F2 '2'
|
||||
#define CYEVENT_KEY_F3 '3'
|
||||
#define CYEVENT_KEY_F4 '4'
|
||||
#define CYEVENT_KEY_OFF 'o'
|
||||
#define CYEVENT_KEY_VOLP '+'
|
||||
#define CYEVENT_KEY_VOLN '-'
|
||||
#define CYEVENT_KEY_REPEAT_FLAG 0x80
|
||||
#define CYEVENT_KEY_REPEAT_END '0'
|
||||
// Physical events
|
||||
#define CYEVENT_USB_IN 'p'
|
||||
#define CYEVENT_USB_OUT 'q'
|
||||
#define CYEVENT_AC_IN 'a'
|
||||
#define CYEVENT_AC_OUT 'b'
|
||||
#define CYEVENT_ACN_IN 'j'
|
||||
#define CYEVENT_ACN_OUT 'k'
|
||||
#define CYEVENT_SD_IN 's'
|
||||
#define CYEVENT_SD_OUT 't'
|
||||
#define CYEVENT_SDN_IN 'u'
|
||||
#define CYEVENT_SDN_OUT 'v'
|
||||
|
||||
// G-Sensor events
|
||||
#define CYEVENT_ORIENTATIONCHANGED 'O'
|
||||
#define CYEVENT_G_ROT000 'A'
|
||||
#define CYEVENT_G_ROT090 'B'
|
||||
#define CYEVENT_G_ROT180 'C'
|
||||
#define CYEVENT_G_ROT270 'D'
|
||||
#define CYEVENT_TOGGLE_GSENSOR 'G'
|
||||
|
||||
// Logical events
|
||||
// CYEVENT_KEY_OFF + CYEVENT_KEY_VOLN
|
||||
#define CYEVENT_FACTORY_OFF 'x'
|
||||
#define CYEVENT_SUSPEND_SCREEN 'y'
|
||||
#define CYEVENT_SUSPEND_DEVICE 'z'
|
||||
// ===========================================================================
|
||||
/* YEP inside */
|
||||
#define CYIO_KERNEL_2_6 1
|
||||
|
||||
#define G_SENSOR_ON '1'
|
||||
#define G_SENSOR_OFF '0'
|
||||
#define G_SENSOR_CAL 'C'
|
||||
|
||||
/* end YEP inside */
|
||||
enum
|
||||
{
|
||||
CYGSENSOR_STATUS_ENABLED = 0,
|
||||
CYGSENSOR_STATUS_DISABLED = 1,
|
||||
CYGSENSOR_STATUS_NOTCALIB = 2, /* Not calibrated, or invalid calibration data */
|
||||
CYGSENSOR_STATUS_CALIBRATED = 3, /* This status should never been read, but it could help to debug */
|
||||
CYGSENSOR_STATUS_UNKNOWN = 4, /* This status should not been read too, but it could help to debug */
|
||||
};
|
||||
|
||||
/* Exported function of CyIO */
|
||||
void Cyio_ResetTimer(void);
|
||||
void Cyio_PushEvent(char eventId, char unique);
|
||||
@@ -22,6 +22,10 @@
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
#include <../include/asm-arm/plat-s3c24xx/common-smdk.h>
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/08/18, Detect insertion source {*/
|
||||
#include <asm/arch/regs-udc-hs.h>
|
||||
#include <asm/arch/regs-s3c2416-clock.h>
|
||||
@@ -45,8 +49,24 @@
|
||||
#define QISDA_TILT_180 3
|
||||
#define QISDA_TILT_270 2
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
//static int hw_version_for_keypad = 0;
|
||||
extern int board_id;
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
extern int average_adc_value_keep1; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
extern int average_adc_value_keep2; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event {
|
||||
int sleeping_cha_event = 0;
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event }
|
||||
|
||||
/*Qisda , howard hsu, 20100116 , op_mode-delay key event {*/
|
||||
#define OP_MODE_DELAY_REQUEST KEY_F9
|
||||
/*} Qisda , howard hsu, 20100116 , op_mode-delay key event*/
|
||||
|
||||
#if defined(CONFIG_QISDA_AS090B00_EVT1) || defined(CONFIG_QISDA_AS090B00_EVT1_1)
|
||||
#define MAX_KEYPAD_QISDA 22
|
||||
#define MAX_KEYPAD_QISDA 23 /*shiyong joey for asus 2009/12/15*/
|
||||
static int keypad_keycode_qisda[] = {
|
||||
KEY_PAGEDOWN, KEY_PAGEUP, KEY_VOLUMEDOWN, KEY_VOLUMEUP,
|
||||
KEY_F1, KEY_F2, KEY_F3, KEY_INSERT, KEY_ESC,
|
||||
@@ -54,9 +74,8 @@ static int keypad_keycode_qisda[] = {
|
||||
KEY_CHA_STA_WALL_CHARGER, KEY_CHA_STA_UNPLUG,
|
||||
KEY_CHA_STA_USB, KEY_BATTERY_FAIL,
|
||||
KEY_SLEEP, KEY_TIMER_TICK,
|
||||
/* } Qisda, ShiYong Lin, 2009/09/08, Implement for message for AP */
|
||||
KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_SOUND,
|
||||
KEY_SD_INSERT
|
||||
KEY_SD_INSERT, KEY_BATTERY /*shiyong joey for asus 2009/12/15*/
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -65,9 +84,10 @@ static int keypad_keycode_qisda[] = {
|
||||
|
||||
#define QISDA_E600
|
||||
//#define QISDA_L600
|
||||
//#define QISDA_BQ060B00_DVT
|
||||
|
||||
|
||||
#define MAX_KEYPAD_QISDA 27
|
||||
#define MAX_KEYPAD_QISDA 29
|
||||
static int keypad_keycode_qisda[] = {
|
||||
KEY_MENU, KEY_SEARCH, KEY_PAGEDOWN, KEY_PAGEUP,
|
||||
KEY_BACK, KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_WAKEUP,
|
||||
@@ -78,14 +98,17 @@ static int keypad_keycode_qisda[] = {
|
||||
/* Qisda, ShiYong Lin, 2009/09/08, Implement for message for AP {*/
|
||||
KEY_CLOSE, KEY_CHA_STA_WALL_CHARGER, KEY_CHA_STA_UNPLUG,
|
||||
KEY_CHA_STA_USB, KEY_BATTERY_FAIL,
|
||||
KEY_SLEEP, KEY_TIMER_TICK
|
||||
KEY_SLEEP, KEY_TIMER_TICK, KEY_BATTERY,
|
||||
/* } Qisda, ShiYong Lin, 2009/09/08, Implement for message for AP */
|
||||
/*Qisda , howard hsu, 20100116 , op_mode-delay key event {*/
|
||||
KEY_F9
|
||||
/*} Qisda , howard hsu, 20100116 , op_mode-delay key event*/
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
#define MAX_KEYPAD_QISDA 25
|
||||
#define MAX_KEYPAD_QISDA 27
|
||||
static int keypad_keycode_qisda[] = {
|
||||
KEY_MENU, KEY_SEARCH, KEY_PAGEDOWN, KEY_PAGEUP,
|
||||
KEY_BACK, KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_WAKEUP,
|
||||
@@ -95,8 +118,11 @@ static int keypad_keycode_qisda[] = {
|
||||
/* Qisda, ShiYong Lin, 2009/09/08, Implement for message for AP {*/
|
||||
KEY_CLOSE, KEY_CHA_STA_WALL_CHARGER, KEY_CHA_STA_UNPLUG,
|
||||
KEY_CHA_STA_USB, KEY_BATTERY_FAIL,
|
||||
KEY_SLEEP, KEY_TIMER_TICK
|
||||
KEY_SLEEP, KEY_TIMER_TICK, KEY_BATTERY,
|
||||
/* } Qisda, ShiYong Lin, 2009/09/08, Implement for message for AP */
|
||||
/*Qisda , howard hsu, 20100116 , op_mode-delay key event {*/
|
||||
KEY_F9
|
||||
/*} Qisda , howard hsu, 20100116 , op_mode-delay key event*/
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -114,6 +140,9 @@ static int keypad_set_irq = FALSE;
|
||||
/* Qisda, ShiYong Lin, 2009/11/11, Fix the trembling voice issue when plugging usb {*/
|
||||
static struct timer_list charger_source_timer;
|
||||
/* } Qisda, ShiYong Lin, 2009/11/11, Fix the trembling voice issue when plugging usb */
|
||||
/*joey add timer to avoid bouncing with usb in/out 20100127*/
|
||||
static struct timer_list battery_status_timer;
|
||||
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/11/11, Modify for pwr fail event occurring wrongly when heavy loading {*/
|
||||
static struct timer_list power_fail_timer;
|
||||
@@ -157,16 +186,38 @@ static void keypad_port_initialize(void)
|
||||
|
||||
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
// hw_version_for_keypad = readl(S3C2416_GPKDAT) & (0x3<<3);
|
||||
printk("\nhw_version_for_keypad: %d\n", board_id);
|
||||
|
||||
//if(hw_version_for_keypad){
|
||||
if(board_id != QD090B00_S02){
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPC3, S3C2410_GPC3_OUTP); // Tilt_EN
|
||||
s3c2410_gpio_setpin(S3C2410_GPC3, 1);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_EINT10); // Search
|
||||
s3c2410_gpio_pullup(S3C2410_GPG2, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11); // Return
|
||||
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
//old
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_INP); // Search
|
||||
s3c2410_gpio_pullup(S3C2410_GPD14, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD15, S3C2410_GPD15_INP); // Return
|
||||
s3c2410_gpio_pullup(S3C2410_GPD15, 2);
|
||||
}
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
//Set gpio as input and pull-up enable
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_INP); //T_SENSOR2
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_INP); //T_SENSOR1
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_INP); // Search
|
||||
s3c2410_gpio_pullup(S3C2410_GPD14, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD15, S3C2410_GPD15_INP); // Return
|
||||
s3c2410_gpio_pullup(S3C2410_GPD15, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0); // power
|
||||
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
|
||||
|
||||
@@ -191,31 +242,62 @@ static void keypad_port_initialize(void)
|
||||
|
||||
|
||||
#ifdef CONFIG_QISDA_QD060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPC3, S3C2410_GPC3_OUTP); // Tilt_EN
|
||||
s3c2410_gpio_setpin(S3C2410_GPC3, 1);
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_INP); //T_SENSOR2
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP); //T_SENSOR1
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_INP); // Menu / Plato: Menu
|
||||
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_INP); // VOL-/LEFT
|
||||
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_INP); // VOL+/RIGHT
|
||||
s3c2410_gpio_pullup(S3C2410_GPG2, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH5, S3C2410_GPH5_OUTP); // USB_SEL: DEVICE ONLY
|
||||
s3c2410_gpio_setpin(S3C2410_GPH5, 0);
|
||||
#else
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_INP); //T_SENSOR2
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_INP); //T_SENSOR1
|
||||
|
||||
//Set gpio as input and pull-up enable
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_INP); // Menu
|
||||
// Qisda Jonas disable for keypad rework 20100104
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_INP); // Menu / Plato: Menu
|
||||
s3c2410_gpio_pullup(S3C2410_GPD14, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD15, S3C2410_GPD15_INP); // Page down / Back
|
||||
s3c2410_gpio_pullup(S3C2410_GPD15, 2);
|
||||
// Qisda Jonas disable for keypad rework
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0); // power
|
||||
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_INP); // Back / Right
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH5, S3C2410_GPH5_INP); // Search / UP / Plato: Vol up
|
||||
s3c2410_gpio_pullup(S3C2410_GPH5, 2);
|
||||
|
||||
// Qisda Jonas modify for keypad rework 20100104
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11); // Menu key
|
||||
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_EINT12); // Page up, Plato: Back
|
||||
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
|
||||
// Qisda Jonas modify for keypad rework
|
||||
#endif
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD15, S3C2410_GPD15_INP); // Page down / Back / Plato: Back
|
||||
s3c2410_gpio_pullup(S3C2410_GPD15, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_EINT7); // Back / Right / Plato: Page down
|
||||
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
|
||||
|
||||
#ifdef QISDA_E600
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP); // Page up
|
||||
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
|
||||
#endif
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_INP); // VOL / Down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_EINT14); // VOL / Down / Plato: Search
|
||||
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_INP); // Refresh / Left
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_EINT15); // Refresh / Left / Plato: Page up
|
||||
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
|
||||
|
||||
#ifdef QISDA_L600
|
||||
@@ -223,24 +305,30 @@ static void keypad_port_initialize(void)
|
||||
s3c2410_gpio_pullup(S3C2410_GPH4, 2);
|
||||
#endif
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH5, S3C2410_GPH5_INP); // Search / UP
|
||||
s3c2410_gpio_pullup(S3C2410_GPH5, 2);
|
||||
#ifdef CONFIG_QISDA_BQ060B00_DVT
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH4, S3C2410_GPH4_INP); // Plato: Vol down
|
||||
s3c2410_gpio_pullup(S3C2410_GPH4, 2);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/08/27, Implement for message for AP {*/
|
||||
// Power_Fail, GPG5, need to open when EVT2
|
||||
// Both edge triggered
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
|
||||
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
|
||||
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1); /* EINT13 filter enable */
|
||||
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(6<<20)), S3C2410_EXTINT1);
|
||||
// CHG_STA, GPF6, Both edge triggered /*shiyong joey for asus 2009/12/15*/
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_EINT6);
|
||||
s3c2410_gpio_pullup(S3C2410_GPF6, 0); /*joey modify 2->0 20100127*/
|
||||
writel((readl(S3C2410_EXTINT0) & ~(1<<27)), S3C2410_EXTINT0);
|
||||
writel(((readl(S3C2410_EXTINT0) & ~(7<<24))|(4<<24)), S3C2410_EXTINT0); /*joey modify (6<<24) to (4<<24)) 20100127*/ /*1:high 4:rise 6:both*/
|
||||
|
||||
// CHG_STA, GPG1, need to open when EVT2,
|
||||
// Both edge triggered
|
||||
// VBUS_IN_STA, GPG1, Both edge triggered /*shiyong joey for asus 2009/12/15*/
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
|
||||
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
|
||||
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1); /* EINT9 filter enable */
|
||||
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
|
||||
|
||||
// Power_Fail, GPG5, Both edge triggered /*shiyong joey for asus 2009/12/15*/
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
|
||||
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
|
||||
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
|
||||
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(6<<20)), S3C2410_EXTINT1);
|
||||
}
|
||||
|
||||
struct s3c_keypad_qisda *pdata;
|
||||
@@ -271,8 +359,8 @@ int IsWallCharger(void)
|
||||
if((readl(S3C2410_GPGDAT)&0x2)==0x2){
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 1); /* usb power enbale */
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPD13_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD13,1); /* usb power enbale */
|
||||
// s3c2410_gpio_cfgpin(S3C2410_GPD13, S3C2410_GPD13_OUTP);
|
||||
// s3c2410_gpio_setpin(S3C2410_GPD13,1); /* usb power enbale */
|
||||
|
||||
/* if reset by sleep wakeup, control the retention I/O cell */
|
||||
if (__raw_readl(S3C_RSTSTAT) & 0x8)
|
||||
@@ -285,17 +373,21 @@ int IsWallCharger(void)
|
||||
udelay(1000);
|
||||
__raw_writel((1<<2)|(0<<0), S3C_URSTCON);
|
||||
__raw_writel((0<<2)|(0<<0), S3C_URSTCON);
|
||||
__raw_writel((0<<3)|(0<<2)|(0<<1)|(0<<0), S3C_PHYCTRL);
|
||||
__raw_writel((0<<3)|(0<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
|
||||
__raw_writel((1<<31)|(0<<4)|(0<<3)|(0<<2)|(0<<1)|(0<<0), S3C_PHYPWR);
|
||||
__raw_writel((0<<31)|(1<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
__raw_writel((1<<31)|(1<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
__raw_writel((1<<31)|(1<<4)|(1<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
}
|
||||
|
||||
for(i=0;i<10;i++) {
|
||||
read_pin = __raw_readl(S3C_UDC_SYS_STATUS_REG)&0x60;
|
||||
udelay(1000);
|
||||
}
|
||||
//Benq,Andy modify for wall charger recognize bugfix
|
||||
//if( (read_pin != 0x60) ){
|
||||
if( (read_pin != 0x60) && (read_pin != 0x0)){ //Benq, Andy add (read_pin != 0x0)
|
||||
|
||||
read_pin = __raw_readl(S3C_UDC_SYS_STATUS_REG)&0x60;
|
||||
if(read_pin !=0x60){
|
||||
|
||||
// printk("usb\n");
|
||||
printk("usb\n");
|
||||
#if defined(CONFIG_QISDA_E600_EVT2)|| defined(CONFIG_QISDA_QD060N00_DVT1_1)
|
||||
if((readl(S3C2410_GPGDAT) &(1<<1))==0)
|
||||
{
|
||||
@@ -321,11 +413,20 @@ int IsWallCharger(void)
|
||||
__raw_writel((0<<31)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
//{Benq,Andy add for USB power disable
|
||||
printk("\nUSB_UDC_DEVICE_POWER_DOWN\n");
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 0); /* usb all power disable (USB_EN20)*/
|
||||
//}Benq,Andy add for USB power disable
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// printk("wall charger\n");
|
||||
printk("wall charger\n");
|
||||
#if defined(CONFIG_QISDA_E600_EVT2)||defined(CONFIG_QISDA_QD060N00_DVT1_1)
|
||||
if((readl(S3C2410_GPGDAT) &(1<<1))==0)
|
||||
{
|
||||
@@ -349,6 +450,15 @@ int IsWallCharger(void)
|
||||
__raw_writel((0<<31)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
//{Benq,Andy add for USB power disable
|
||||
printk("\nUSB_UDC_DEVICE_POWER_DOWN\n");
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 0); /* usb all power disable (USB_EN20)*/
|
||||
//}Benq,Andy add for USB power disable
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -390,21 +500,87 @@ static irqreturn_t s3c_pwrbtn_close_irq(int irq, void *id)
|
||||
#else
|
||||
s3c_keypad_deal(dev, read_pin, 7);
|
||||
#endif
|
||||
//close system by letting P_KEEP low
|
||||
|
||||
#ifdef POWER_KEY_FOR_SYS_SHUTDOWN
|
||||
//close system by letting P_KEEP low
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD14, 0);
|
||||
|
||||
#else
|
||||
s3c2410_gpio_setpin(S3C2410_GPG0, 0);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_OUTP);
|
||||
#endif
|
||||
#endif
|
||||
/* } Qisda, ShiYong Lin, 2009/08/27, Implementing power btn behavior */
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void battery_status_handler(unsigned long data)
|
||||
{
|
||||
//struct input_dev *dev = id;
|
||||
u32 read_pin;
|
||||
u32 i, j;
|
||||
|
||||
printk("battery_status_handler\n");
|
||||
|
||||
read_pin = readl(S3C2410_GPGDAT) & (1<<1); /*joey add condition with usb/charger 20100128*/
|
||||
if(read_pin!=0)
|
||||
{
|
||||
read_pin = readl(S3C2410_GPFDAT) & (0x01<<6);
|
||||
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
if(read_pin)
|
||||
{
|
||||
//s3c_keypad_deal(dev, 0 , 25);
|
||||
input_report_key(Message_dev,KEY_BATTERY,1);
|
||||
input_sync(Message_dev);
|
||||
printk("s3c_battery_status_irq, keypad_message_to_ap\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
//s3c_keypad_deal(dev, 1 , 25);
|
||||
input_report_key(Message_dev,KEY_BATTERY,0);
|
||||
input_sync(Message_dev);
|
||||
}
|
||||
#else
|
||||
if(read_pin)
|
||||
{
|
||||
//s3c_keypad_deal(dev, 0 , 27);
|
||||
input_report_key(Message_dev,KEY_BATTERY,1);
|
||||
input_sync(Message_dev);
|
||||
printk("s3c_battery_status_irq, keypad_message_to_ap\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
//s3c_keypad_deal(dev, 1 , 27);
|
||||
input_report_key(Message_dev,KEY_BATTERY,0);
|
||||
input_sync(Message_dev);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
enable_irq(IRQ_EINT6); /*joey add timer to avoid bouncing with usb in/out 20100127*/
|
||||
}
|
||||
|
||||
static irqreturn_t s3c_battery_status_irq(int irq, void *id) /*joey add timer to avoid bouncing with usb in/out 20100127*/
|
||||
{
|
||||
printk("s3c_battery_status_irq, detecting\n");
|
||||
disable_irq(IRQ_EINT6);
|
||||
battery_status_timer.expires = jiffies + (HZ);
|
||||
add_timer(&battery_status_timer);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/11/11, Fix the trembling voice issue when plugging usb {*/
|
||||
static irqreturn_t s3c_cha_sta_irq(int irq, void *id)
|
||||
{
|
||||
/* Qisda , howard hsu, 2010/01/16 , op_mode-delay key event {*/
|
||||
op_mode_delay_message_to_ap(0);//0:usb,1:sd
|
||||
/* } Qisda , howard hsu, 2010/01/16 , op_mode-delay key event */
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event {
|
||||
sleeping_cha_event = 1;
|
||||
// Qisda, 2010/02/18, TN Wei, sleep mode wakes up for usb event }
|
||||
printk("s3c_cha_sta_irq\n");
|
||||
disable_irq(IRQ_EINT9);
|
||||
charger_source_timer.expires = jiffies + (HZ);
|
||||
@@ -453,17 +629,57 @@ void USB_SaftRemove_keypad_message_to_ap(uint uiSleep)
|
||||
{
|
||||
input_report_key(Message_dev,KEY_F6,1);
|
||||
input_sync(Message_dev);
|
||||
printk("Key-USB_PlugIn\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
input_report_key(Message_dev,KEY_F6,0);
|
||||
input_sync(Message_dev);
|
||||
printk("USB_SaftRemove_keypad_message_to_ap, USB_SaftRemove_keypad_message_to_ap press\n");
|
||||
printk("Key-USB_PlugOut\n");
|
||||
//printk("USB_SaftRemove_keypad_message_to_ap, USB_SaftRemove_keypad_message_to_ap press\n");
|
||||
}
|
||||
}
|
||||
/*} Qisda, Leo SJ Yang, 2009/10/26*/
|
||||
|
||||
|
||||
/*Qisda , howard hsu, 20100116 , op_mode-delay key event {*/
|
||||
/* OP_MODE_DELAY_REQUEST is KEY_F9 */
|
||||
/* Qisda , howard hsu, 20100208 , add type, 0 for usb, 1 for sd */
|
||||
void op_mode_delay_message_to_ap(uint type)
|
||||
{
|
||||
static uint last_type=0;
|
||||
if (type == last_type)
|
||||
{
|
||||
if(pdata!=NULL)
|
||||
{
|
||||
change_bit(OP_MODE_DELAY_REQUEST,pdata->dev->key);
|
||||
}
|
||||
}
|
||||
last_type = type;
|
||||
input_report_key(Message_dev,OP_MODE_DELAY_REQUEST,type);
|
||||
input_sync(Message_dev);
|
||||
}
|
||||
/*} Qisda , howard hsu, 20100116 , op_mode-delay key event*/
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
// disable it first, wait integration test
|
||||
#ifdef CONFIG_SD_SW_DEBOUNCE
|
||||
void SD_Detect_keypad_message_to_ap(uint sd_on)
|
||||
{
|
||||
static uint last_sd_on=0;
|
||||
if (last_sd_on == sd_on)
|
||||
{
|
||||
printk("\nCC--Repeat SDKey(%d)\n",sd_on);
|
||||
if(pdata!=NULL)
|
||||
{
|
||||
change_bit(KEY_F5,pdata->dev->key);
|
||||
}
|
||||
}
|
||||
last_sd_on = sd_on;
|
||||
input_report_key(Message_dev,KEY_F5,sd_on);
|
||||
input_sync(Message_dev);
|
||||
printk("\nCC--SendSD Key(%d)\n",sd_on);
|
||||
}
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/09/08, Implement sleep message to AP {*/
|
||||
void s3c_keypad_pm_sleep_message_to_ap (uint uiSleep)
|
||||
@@ -485,6 +701,10 @@ static void s3c_keypad_set_irq(struct input_dev *dev)
|
||||
request_irq(IRQ_EINT0, s3c_pwrbtn_close_irq,
|
||||
SA_INTERRUPT, DEVICE_NAME, dev);
|
||||
|
||||
set_irq_type(IRQ_EINT6, 0x3); /*shiyong joey for asus 2009/12/15*/
|
||||
request_irq(IRQ_EINT6, s3c_battery_status_irq,
|
||||
SA_INTERRUPT, "s3c2410-battery status", dev);
|
||||
|
||||
set_irq_type(IRQ_EINT9, 0x3);
|
||||
request_irq(IRQ_EINT9, s3c_cha_sta_irq,
|
||||
SA_INTERRUPT, "s3c2410-charging status", dev);
|
||||
@@ -509,6 +729,9 @@ static void charger_source_handler(unsigned long data)
|
||||
read_pin = readl(S3C2410_GPGDAT) & (1<<1);
|
||||
printk("GPG1 = %d\n", read_pin);
|
||||
if(read_pin != 0){
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF6, 0); /*joey add to put floating GPF6 with usb 20100201*/
|
||||
average_adc_value_keep1=9999; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
average_adc_value_keep2=9999; /*joey add to keep ADC will always return lower one 2009/12/28*/
|
||||
input_report_key(Message_dev, KEY_CHA_STA_UNPLUG, 0);
|
||||
input_sync(Message_dev);
|
||||
printk("usb or wallchager\n");
|
||||
@@ -539,6 +762,7 @@ static void charger_source_handler(unsigned long data)
|
||||
}
|
||||
}
|
||||
else{
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF6, 1); /*joey add to pull low GPF6 without usb 20100201*/
|
||||
printk("nothing\n");
|
||||
input_report_key(Message_dev, KEY_CHA_STA_UNPLUG, 1);
|
||||
input_sync(Message_dev);
|
||||
@@ -558,6 +782,14 @@ static void charger_source_handler(unsigned long data)
|
||||
//EN1
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPB4, 1);
|
||||
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
//{Benq,Andy add for disable USB power
|
||||
printk("\nUSB_UDC_DEVICE_POWER_DOWN\n");
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 0); /* usb all power disable (USB33 & USB12)*/
|
||||
//}Benq,Andy add for disable USB power
|
||||
#endif
|
||||
}
|
||||
enable_irq(IRQ_EINT9);
|
||||
}
|
||||
@@ -627,6 +859,8 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
u32 read_tilt;
|
||||
static u32 tilt_status_previous;
|
||||
static int tilt_counter=3;
|
||||
static u32 mmc_status_previous = 0xF;
|
||||
static int mmc_counter=16;
|
||||
|
||||
//struct s3c_keypad_qisda *pdata = (struct s3c_keypad_qisda *)data;
|
||||
pdata = (struct s3c_keypad_qisda *)data;
|
||||
@@ -721,7 +955,24 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
read_pin = readl(S3C2410_GPFDAT);
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 2); // Page down
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<1)), 16); // SD card
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
#ifndef CONFIG_SD_SW_DEBOUNCE
|
||||
if(mmc_status_previous != (read_pin & (0x1<<1))){
|
||||
if(mmc_counter != 0){
|
||||
mmc_counter--;
|
||||
}
|
||||
else{
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<1)), 16); // SD card
|
||||
mmc_status_previous = (read_pin & (0x1<<1));
|
||||
mmc_counter=16;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
mmc_counter=16;
|
||||
}
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
|
||||
if(headphonr_insert != (read_pin & (1<<4))){ // Headphone
|
||||
if(headphonr_insert_counter != 0){
|
||||
@@ -752,13 +1003,31 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 0); // Menu
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 3); // Page up
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
//if(hw_version_for_keypad){
|
||||
if(board_id !=QD090B00_S02)
|
||||
{
|
||||
//new
|
||||
s3c_keypad_deal(dev, read_pin & 1<<2, 1); // Search
|
||||
s3c_keypad_deal(dev, read_pin & 1<<3, 4); // Return
|
||||
}
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
read_pin = readl(S3C2410_GPHDAT);
|
||||
s3c_keypad_deal(dev, read_pin & 1<<5, 5); // Volume down
|
||||
s3c_keypad_deal(dev, read_pin & 1<<4, 6); // Volume up
|
||||
|
||||
read_pin = readl(S3C2410_GPDDAT);
|
||||
s3c_keypad_deal(dev, read_pin & 1<<14, 1); // Search
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 4); // Return
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
//if(!hw_version_for_keypad){
|
||||
if(board_id ==QD090B00_S02)
|
||||
{
|
||||
//old
|
||||
s3c_keypad_deal(dev, read_pin & 1<<14, 1); // Search
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 4); // Return
|
||||
}
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
read_tilt = (read_pin & (0x3<<10)) >> 10;
|
||||
if(tilt_status_previous != read_tilt){
|
||||
@@ -807,13 +1076,34 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
#ifdef CONFIG_QISDA_QD060B00
|
||||
read_pin = readl(S3C2410_GPFDAT);
|
||||
#ifdef QISDA_E600
|
||||
#ifdef CONFIG_QISDA_BQ060B00_DVT
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 2); // Page down
|
||||
#else
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 4); // Back
|
||||
#endif
|
||||
#endif
|
||||
#ifdef QISDA_L600
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 13); // Right
|
||||
#endif
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<1)), 18); // SD card
|
||||
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
#ifndef CONFIG_SD_SW_DEBOUNCE
|
||||
if(mmc_status_previous != (read_pin & (0x1<<1))){
|
||||
if(mmc_counter != 0){
|
||||
mmc_counter--;
|
||||
}
|
||||
else{
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<1)), 18); // SD card
|
||||
mmc_status_previous = (read_pin & (0x1<<1));
|
||||
printk("Key-SD_CHANGE(%d)\n",mmc_status_previous);
|
||||
mmc_counter=16;
|
||||
}
|
||||
}
|
||||
else{
|
||||
mmc_counter=16;
|
||||
}
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
|
||||
if(headphonr_insert != (read_pin & (1<<4))){ // Headphone
|
||||
if(headphonr_insert_counter != 0){
|
||||
@@ -841,19 +1131,53 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
|
||||
read_pin = readl(S3C2410_GPGDAT);
|
||||
#ifdef QISDA_E600
|
||||
#ifdef CONFIG_QISDA_BQ060B00_DVT
|
||||
//s3c_keypad_deal(dev, (read_pin & (0x1<<4)), 8); // Refresh
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 1); // Search
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 3); // Page up
|
||||
if(board_id ==BQ060B00_A02)
|
||||
{
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<3)), 0); // Menu
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<4)), 4); // Back
|
||||
}
|
||||
#else
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<4)), 3); // Page up
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 6); // Volume
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 8); // Refresh
|
||||
if(board_id ==QD060B00_A02) {
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<3)), 0); // Menu
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 2); // Page down
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 1); // Search
|
||||
|
||||
} else if(board_id == QD060B00_A01_And_Before){
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 6); // Volume
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 8); // Refresh
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef QISDA_L600
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<6)), 11); // Down
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<7)), 12); // Left
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<0)), 12); // LEFT
|
||||
s3c_keypad_deal(dev, (read_pin & (0x1<<2)), 13); // RIGHT
|
||||
#endif
|
||||
|
||||
read_pin = readl(S3C2410_GPHDAT);
|
||||
#ifdef QISDA_E600
|
||||
s3c_keypad_deal(dev, read_pin & 1<<5, 1); // Search
|
||||
#ifdef CONFIG_QISDA_BQ060B00_DVT
|
||||
s3c_keypad_deal(dev, read_pin & 1<<4, 5); // Volume down
|
||||
s3c_keypad_deal(dev, read_pin & 1<<5, 6); // Volume up
|
||||
#else
|
||||
// Qisda Jonas modify for keypad rework 20100104
|
||||
if(board_id ==QD060B00_A02) {
|
||||
s3c_keypad_deal(dev, read_pin & 1<<5, 8); // Refresh
|
||||
} else if (board_id == QD060B00_A01_And_Before){
|
||||
s3c_keypad_deal(dev, read_pin & 1<<5, 1); // Search
|
||||
}
|
||||
// Qisda Jonas modify for keypad rework
|
||||
#endif
|
||||
#endif
|
||||
#ifdef QISDA_L600
|
||||
s3c_keypad_deal(dev, read_pin & 1<<4, 9); // OK
|
||||
@@ -862,16 +1186,40 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
|
||||
|
||||
read_pin = readl(S3C2410_GPDDAT);
|
||||
s3c_keypad_deal(dev, read_pin & 1<<14, 0); // Menu
|
||||
#ifdef QISDA_E600
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 2); // Page down
|
||||
#ifdef CONFIG_QISDA_BQ060B00_DVT
|
||||
// Qisda Jonas modify for keypad rework 20100103
|
||||
if(board_id ==BQ060B00_A01_And_Before)
|
||||
{
|
||||
s3c_keypad_deal(dev, read_pin & 1<<14, 0); // Menu
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 4); // Back
|
||||
}
|
||||
#else
|
||||
// Qisda Jonas modify for keypad rework
|
||||
if(board_id == QD060B00_A02) {
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 6); // Volumn
|
||||
} else if(board_id == QD060B00_A01_And_Before){
|
||||
s3c_keypad_deal(dev, read_pin & 1<<14, 0); // Menu
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 2); // Page down
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#ifdef QISDA_L600
|
||||
s3c_keypad_deal(dev, read_pin & 1<<15, 4); // Back
|
||||
#endif
|
||||
|
||||
//Benq,Aaron: no tilt sensor in Plato
|
||||
#ifndef CONFIG_QISDA_BQ060B00_DVT
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
read_pin = readl(S3C2410_GPGDAT);
|
||||
read_tilt = (read_pin & (0x3<<3)) >> 3;
|
||||
#else
|
||||
read_tilt = (read_pin & (0x3<<10)) >> 10;
|
||||
#endif
|
||||
|
||||
if(tilt_status_previous != read_tilt){
|
||||
if(tilt_counter != 0){
|
||||
tilt_counter--;
|
||||
@@ -912,6 +1260,7 @@ static void keypad_timer_handler_qisda(unsigned long data)
|
||||
s3c_keypad_deal(dev, 1, 16);
|
||||
s3c_keypad_deal(dev, 1, 17);
|
||||
}
|
||||
#endif // #ifndef CONFIG_QISDA_BQ060B00_DVT
|
||||
#endif
|
||||
|
||||
if (is_timer_on_qisda == FALSE) {
|
||||
@@ -994,6 +1343,9 @@ static int __init s3c_keypad_qisda_probe(struct platform_device *pdev)
|
||||
init_timer(&charger_source_timer);
|
||||
charger_source_timer.function = charger_source_handler;
|
||||
/* } Qisda, ShiYong Lin, 2009/11/11, Fix the trembling voice issue when plugging usb */
|
||||
/*joey add timer to avoid bouncing with usb in/out 20100127*/
|
||||
init_timer(&battery_status_timer);
|
||||
battery_status_timer.function = battery_status_handler;
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/11/11, Modify for pwr fail event occurring wrongly when heavy loading {*/
|
||||
init_timer(&power_fail_timer);
|
||||
@@ -1004,6 +1356,15 @@ static int __init s3c_keypad_qisda_probe(struct platform_device *pdev)
|
||||
//initial work queue
|
||||
//INIT_WORK(&wqReadData,s3c_keypad_qisda_workqueue);
|
||||
|
||||
//{Benq,Andy add for USB cable unplug bugfix
|
||||
//If boot up with USB cable, s3c_adc_init will set charging_source to 0, without sending input_report_key,
|
||||
//so recheck is needed when initializing keypad, setting KEY_CHA_STA_USB to 1
|
||||
if( charging_source == 0 ){
|
||||
if ( ((readl(S3C2410_GPGDAT) & (1<<1)) != 0) && (IsWallCharger() == 0) )
|
||||
input_report_key(s3c_keypad_qisda->dev, KEY_CHA_STA_USB, 1);
|
||||
}
|
||||
//}Benq,Andy add for USB cable unplug bugfix
|
||||
|
||||
DPRINTK("s3c_keypad_qisda_probe finished\n");
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/08/27, Implement for message for AP {*/
|
||||
|
||||
@@ -89,4 +89,11 @@ config HP_SDC_RTC
|
||||
Say Y here if you want to support the built-in real time clock
|
||||
of the HP SDC controller.
|
||||
|
||||
config CYBOOK_ORIZON_TILT
|
||||
tristate "Cybook Orizon Tilt Sensor"
|
||||
depends on MACH_CYBOOK_ORIZON && CYBOOK_CYIO
|
||||
default y
|
||||
help
|
||||
Say Y here ig you want to support the Cybook Orizon Tilt Sensor
|
||||
|
||||
endif
|
||||
|
||||
@@ -12,3 +12,4 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
|
||||
obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o
|
||||
obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o
|
||||
obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o
|
||||
obj-$(CONFIG_CYBOOK_ORIZON_TILT) += orizon_tilt.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -404,7 +404,7 @@ extern void s3c_camif_set_polarity(camif_cfg_t *cfg);
|
||||
#define QISDA_IIC_ACTIVE_MODE (1<<3)
|
||||
#define QISDA_IIC_SLEEP_MODE (1<<4)
|
||||
#define QISDA_IIC_DEEPSLEEP_MODE (1<<5)
|
||||
|
||||
#define QISDA_IIC_READ_BUFFERED_POSITION (1<<6)
|
||||
|
||||
|
||||
extern int s3c_ts_iic_port_init(struct i2c_client *c);
|
||||
|
||||
@@ -18,6 +18,13 @@ config MMC_DEBUG
|
||||
This is an option for use by developers; most people should
|
||||
say N here. This enables MMC core and driver debugging.
|
||||
|
||||
config SD_SW_DEBOUNCE
|
||||
bool "Use SD_SW_DEBOUNC detect method"
|
||||
default n
|
||||
help
|
||||
This is an option for enable the added sd-card detection
|
||||
method with "software debounce time" feature
|
||||
|
||||
if MMC
|
||||
|
||||
source "drivers/mmc/core/Kconfig"
|
||||
|
||||
@@ -430,7 +430,10 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
|
||||
struct mmc_blk_data *md;
|
||||
int devidx, ret;
|
||||
|
||||
devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
|
||||
/* Qisda, howard hsu, 2010/01/21, fix start slot for SD card { */
|
||||
//devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
|
||||
devidx = find_next_zero_bit(dev_use, MMC_NUM_MINORS, card->host->first_devidx);
|
||||
/* } Qisda, howard hsu, 2010/01/21, fix start slot for SD card */
|
||||
if (devidx >= MMC_NUM_MINORS)
|
||||
return ERR_PTR(-ENOSPC);
|
||||
__set_bit(devidx, dev_use);
|
||||
|
||||
@@ -120,8 +120,8 @@ config MMC_TIFM_SD
|
||||
config MMC_SPI
|
||||
tristate "MMC/SD over SPI (EXPERIMENTAL)"
|
||||
depends on MMC && SPI_MASTER && !HIGHMEM && EXPERIMENTAL
|
||||
select CRC7
|
||||
select CRC_ITU_T
|
||||
#select CRC7
|
||||
#select CRC_ITU_T
|
||||
help
|
||||
Some systems accss MMC/SD cards using a SPI controller instead of
|
||||
using a "native" MMC/SD controller. This has a disadvantage of
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
|
||||
#include <asm/arch/hsmmc.h>
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
#include <../include/asm-arm/plat-s3c24xx/common-smdk.h>
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
/*Trevor add for debug*/
|
||||
/*#define CONFIG_S3CMMC_DEBUG*/
|
||||
|
||||
@@ -79,6 +83,11 @@ struct s3c_hsmmc_host *global_host[3];
|
||||
#endif
|
||||
|
||||
static void s3c_hsmmc_tasklet_finish (unsigned long param);
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
extern int board_id;
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
static int inResume = 0; //howard, 2009/12/22, fix resume card-detect
|
||||
/*Qisda,2009/7/28,Leo SJ Yang {*/
|
||||
/*Fix: Must plug-in twice ,SD is reconginzed by system*/
|
||||
/* GEORGE 20090608 update for module on board.*/
|
||||
@@ -86,6 +95,106 @@ static int card_detect = 0;
|
||||
static int card_detect2 = 2;
|
||||
/* GEORGE 20090608 update for module on board.*/
|
||||
/*}Qisda,2009/7/28,Leo SJ Yang*/
|
||||
/* Qisda , howard hsu, 2010/01/16 , op_mode-delay key event {*/
|
||||
//extern void op_mode_delay_message_to_ap();
|
||||
/* } Qisda , howard hsu, 2010/01/16 , op_mode-delay key event */
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
// disable it first, wait integration test
|
||||
#ifdef CONFIG_SD_SW_DEBOUNCE
|
||||
static int SDCardStatus = 16;
|
||||
|
||||
#define SD_INSERTED 0
|
||||
#define SD_REMOVED 2
|
||||
|
||||
#define CHECK_MSEC 50
|
||||
#define INSERT_MSEC 800
|
||||
#define REMOVE_MSEC 800
|
||||
|
||||
static struct timer_list sd_detect_timer;
|
||||
static void sdcard_debounce_timer(unsigned long data);
|
||||
|
||||
static int ReadSDCardStatus()
|
||||
{
|
||||
int SDStatus= 0;
|
||||
#if defined(CONFIG_CPU_S3C2450) || defined(CONFIG_CPU_S3C2416)
|
||||
SDStatus = readl(S3C2410_GPFDAT);
|
||||
SDStatus &= SD_REMOVED; /* GPF1 */
|
||||
#elif defined(CONFIG_CPU_S3C6410)
|
||||
SDStatus = readl(S3C_GPNDAT);
|
||||
SDStatus &= 0x2000; /* GPN13 */
|
||||
#endif
|
||||
return SDStatus;
|
||||
}
|
||||
static void sdcard_debounce_timer(unsigned long data)
|
||||
{
|
||||
static unsigned int StayCount = 0;
|
||||
static unsigned int MaxCount = 2*INSERT_MSEC/CHECK_MSEC;
|
||||
static unsigned int MidCount = INSERT_MSEC/CHECK_MSEC;
|
||||
static unsigned int MinCount = INSERT_MSEC/CHECK_MSEC/2;
|
||||
static int LastSDCardStatus = 0xF;
|
||||
int RawStatus = ReadSDCardStatus();
|
||||
/* stay count in case of resume in progress */
|
||||
if (inResume == 1)
|
||||
{
|
||||
mod_timer(&sd_detect_timer ,jiffies+msecs_to_jiffies(CHECK_MSEC));
|
||||
return;
|
||||
}
|
||||
if ( SDCardStatus == RawStatus )
|
||||
{
|
||||
StayCount++;
|
||||
if (StayCount >= MaxCount)
|
||||
{
|
||||
StayCount = 0;
|
||||
LastSDCardStatus = SDCardStatus;
|
||||
del_timer(&sd_detect_timer);
|
||||
}
|
||||
else if (StayCount == MidCount)
|
||||
{
|
||||
struct s3c_hsmmc_host *s3c_host = global_host[0];
|
||||
struct mmc_host *host = s3c_host->mmc;
|
||||
|
||||
if (SDCardStatus == LastSDCardStatus )
|
||||
{
|
||||
//StayCount = 0;
|
||||
//LastSDCardStatus = 0xF;
|
||||
}
|
||||
mmc_detect_change(host, 1);
|
||||
mod_timer(&sd_detect_timer, jiffies+msecs_to_jiffies(CHECK_MSEC));
|
||||
}
|
||||
else if ( StayCount==MinCount )
|
||||
{
|
||||
/* call detect twice for SD_INSERTED case */
|
||||
//if (SDCardStatus == LastSDCardStatus )
|
||||
if (SDCardStatus == SD_INSERTED )
|
||||
{
|
||||
struct s3c_hsmmc_host *s3c_host = global_host[0];
|
||||
struct mmc_host *host = s3c_host->mmc;
|
||||
mmc_detect_change(host, 1);
|
||||
}
|
||||
mod_timer(&sd_detect_timer, jiffies+msecs_to_jiffies(CHECK_MSEC));
|
||||
}
|
||||
else
|
||||
{
|
||||
mod_timer(&sd_detect_timer, jiffies+msecs_to_jiffies(CHECK_MSEC));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SDCardStatus = RawStatus;
|
||||
if (SDCardStatus==SD_INSERTED) {
|
||||
MaxCount = 2*INSERT_MSEC/CHECK_MSEC;
|
||||
MidCount = INSERT_MSEC/CHECK_MSEC;
|
||||
}
|
||||
else {
|
||||
MaxCount = 2*REMOVE_MSEC/CHECK_MSEC;
|
||||
MidCount = REMOVE_MSEC/CHECK_MSEC;
|
||||
}
|
||||
StayCount = 0;
|
||||
mod_timer(&sd_detect_timer ,jiffies+msecs_to_jiffies(CHECK_MSEC));
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
/*****************************************************************************\
|
||||
* *
|
||||
* Low level functions *
|
||||
@@ -123,8 +232,34 @@ static int s3c_hsmmc_power_switch(int channel, int arg)
|
||||
if(arg){
|
||||
if(channel == 0){
|
||||
//Power on
|
||||
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
//if((readl(S3C2416_GPKDAT) & (0x3<<3))){
|
||||
if(board_id!=QD090B00_S02){
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD14, 1);
|
||||
}
|
||||
else{
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG2, 1);
|
||||
}
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_QISDA_QD060B00
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH4, S3C2410_GPH4_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH4, 1);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG2, 1);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//Signal
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2450_GPE5_SD0_CLK);
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE6, S3C2450_GPE6_SD0_CMD);
|
||||
@@ -145,8 +280,32 @@ static int s3c_hsmmc_power_switch(int channel, int arg)
|
||||
else{
|
||||
if(channel == 0){
|
||||
//Power off
|
||||
#ifdef CONFIG_QISDA_QD090B00
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
//if((readl(S3C2416_GPKDAT) & (0x3<<3))){
|
||||
if(board_id!=QD090B00_S02){
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD14, 0);
|
||||
}
|
||||
else{
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
|
||||
}
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_QISDA_QD060B00
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH4, S3C2410_GPH4_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH4, 0);
|
||||
#else
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Signal
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPE5_INP);
|
||||
s3c2410_gpio_pullup(S3C2410_GPE5, 1);
|
||||
@@ -274,7 +433,18 @@ static void s3c_hsmmc_tasklet_card (ulong param)
|
||||
|
||||
spin_unlock_irqrestore(&host->lock, iflags);
|
||||
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
#ifdef CONFIG_SD_SW_DEBOUNCE
|
||||
int exist = timer_pending(&sd_detect_timer);
|
||||
if (exist == 0)
|
||||
{
|
||||
sd_detect_timer.expires = jiffies+msecs_to_jiffies(CHECK_MSEC);
|
||||
add_timer(&sd_detect_timer);
|
||||
}
|
||||
#else
|
||||
mmc_detect_change(host->mmc, msecs_to_jiffies(500));
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
}
|
||||
|
||||
static void s3c_hsmmc_activate_led(struct s3c_hsmmc_host *host)
|
||||
@@ -933,6 +1103,10 @@ out:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#include <linux/cyio.h>
|
||||
int Cyio_PushEvent(char eventId, char unique);
|
||||
|
||||
static irqreturn_t s3c_hsmmc_irq_cd (int irq, void *dev_id)
|
||||
{
|
||||
struct s3c_hsmmc_host *host = dev_id;
|
||||
@@ -948,23 +1122,41 @@ static irqreturn_t s3c_hsmmc_irq_cd (int irq, void *dev_id)
|
||||
//printk("\ns3c_hsmmc_irq_cd, ext_CD_int: %d, card_detect: %d, card_detect2: %d\n", ext_CD_int, card_detect, card_detect2);
|
||||
if(ext_CD_int && card_detect) {
|
||||
printk("s3c-hsmmc channel-0(EXT): card removed.\n");
|
||||
set_irq_type(host->irq_cd, IRQT_FALLING);
|
||||
/*Qisda Qube for sd card detect20091124*/
|
||||
//set_irq_type(host->irq_cd, IRQT_FALLING);
|
||||
set_irq_type(host->irq_cd, IRQT_LOW);
|
||||
/*Qisda Qube for sd card detect20091124*/
|
||||
card_detect = 0;
|
||||
|
||||
//Qisda, Asaku Chen, 2009/11/03, SD power off
|
||||
s3c_hsmmc_power_switch(0, 0);
|
||||
card_detect2 = 2;
|
||||
|
||||
/* Send CyIO event */
|
||||
Cyio_PushEvent(CYEVENT_SD_OUT, 1);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if(!ext_CD_int && !card_detect) {
|
||||
printk("s3c-hsmmc channel-0(EXT): card inserted.\n");
|
||||
set_irq_type(host->irq_cd, IRQT_RISING);
|
||||
card_detect = 1;
|
||||
|
||||
/*Qisda Qube for sd card detect20091124*/
|
||||
//set_irq_type(host->irq_cd, IRQT_RISING);
|
||||
set_irq_type(host->irq_cd, IRQT_HIGH);
|
||||
/*Qisda Qube for sd card detect20091124*/
|
||||
//Qisda, Asaku Chen, 2009/11/03, SD power on
|
||||
s3c_hsmmc_power_switch(0, 1);
|
||||
if (inResume!=1)//howard, 2009/12/22, fix resume card-detect
|
||||
{
|
||||
card_detect = 1;
|
||||
s3c_hsmmc_power_switch(0, 1);
|
||||
}
|
||||
if(card_detect2 == 3){
|
||||
printk("resume host first\n");
|
||||
s3c_hsmmc_ios_init(host);
|
||||
mmc_resume_host(host->mmc);
|
||||
card_detect2 = 2;
|
||||
|
||||
}
|
||||
/* Send CyIO event */
|
||||
Cyio_PushEvent(CYEVENT_SD_IN, 1);
|
||||
|
||||
}
|
||||
//Qisda, Asaku Chen, 2009/11/03 {
|
||||
@@ -1244,9 +1436,105 @@ static int s3c_wifi_open(struct inode *inode, struct file *file)
|
||||
#define S3C_READ_GPIO_VALUE 4
|
||||
#define S3C_SET_GPIO_ADDR 5
|
||||
#define S3C_WRITE_GPIO_VALUE 6
|
||||
#define S3C_READ_HW_VERSION 7
|
||||
|
||||
#define S3C_TCON_ERASE 10
|
||||
#define S3C_TCON_ID 11
|
||||
#define S3C_TCON_READ 12
|
||||
#define S3C_TCON_BYTE_COUNT 13
|
||||
#define S3C_TCON_WRITE 14
|
||||
|
||||
#define MMC_DEVICE_POWER_STATE 20
|
||||
|
||||
#define S3C_BT_POWER_ON 1
|
||||
#define S3C_BT_POWER_OFF 2
|
||||
|
||||
static unsigned char s3c_tcon_read_byte(void)
|
||||
{
|
||||
/*
|
||||
Unsigned char Get data () //Receive a byte from Serial flash
|
||||
{
|
||||
unsigned char k, temdata =0, i;
|
||||
for ( k = 0; k++; k< 8)
|
||||
{
|
||||
if ( SO == 1 )
|
||||
{
|
||||
i = (0x80 >> k);
|
||||
temdata = (temdata || i);
|
||||
}
|
||||
SCLK = 1;
|
||||
SCLK = 0;
|
||||
}
|
||||
return (temdata);
|
||||
}
|
||||
|
||||
*/
|
||||
unsigned char k, temdata =0, i=0;
|
||||
u32 read_pin;
|
||||
|
||||
for(k=0; k<8; k++){
|
||||
|
||||
read_pin = (readl(S3C2410_GPEDAT) & (1<<11));
|
||||
//printk(" [%d]: 0x%X 0x%X\n", k, read_pin, readl(S3C2410_GPEDAT));
|
||||
|
||||
if(read_pin){
|
||||
i = (0x80 >> k);
|
||||
temdata = (temdata | i);
|
||||
}
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPE13, 1);
|
||||
udelay(2);
|
||||
s3c2410_gpio_setpin(S3C2410_GPE13, 0);
|
||||
udelay(2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//printk("s3c_tcon_read_byte: 0x%2X\n", temdata);
|
||||
|
||||
return (temdata);
|
||||
}
|
||||
|
||||
|
||||
static void s3c_tcon_write_byte(char w_data)
|
||||
{
|
||||
/*
|
||||
Send data (unsigned char indata) // Send 1 byte data to Serial flash
|
||||
{
|
||||
unsigned char k;
|
||||
for ( k = 0; k++; k< 8)
|
||||
{
|
||||
if( (indata & 0x80) == 0x80)
|
||||
SI = 1;
|
||||
else
|
||||
SI = 0;
|
||||
SCLK = 1;
|
||||
SCLK = 0;
|
||||
indata = (indata << 1);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
unsigned char k;
|
||||
|
||||
//printk("s3c_tcon_write_byte: 0x%2X\n", w_data);
|
||||
|
||||
for(k=0; k<8; k++){
|
||||
if((w_data & 0x80))
|
||||
s3c2410_gpio_setpin(S3C2410_GPE12, 1);
|
||||
else
|
||||
s3c2410_gpio_setpin(S3C2410_GPE12, 0);
|
||||
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPE13, 1);
|
||||
udelay(2);
|
||||
s3c2410_gpio_setpin(S3C2410_GPE13, 0);
|
||||
udelay(2);
|
||||
|
||||
w_data = (w_data << 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1255,10 +1543,128 @@ static int s3c_wifi_ioctl(struct inode *inode, struct file *file, unsigned int c
|
||||
{
|
||||
static char s3c_power_off = 0;
|
||||
static unsigned int gpio_addr = 0;
|
||||
static unsigned int tcon_byte_count;
|
||||
static unsigned int tcon_address;
|
||||
unsigned char tcon_buffer[128];
|
||||
unsigned char r_data;
|
||||
int ret, i;
|
||||
u32 read_pin;
|
||||
|
||||
switch(cmd){
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
case S3C_WIFI_POWER_ON:
|
||||
printk("BCM4329-WIFI_BT_POWER_ON\n");
|
||||
|
||||
//TCON Flash disable, and select WiFi
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH6, S3C2410_GPH6_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH6, 0);
|
||||
|
||||
//bcm4329 module power on control
|
||||
//GPK7, WIFI PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<7)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<6)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<5)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK9 (green light), pull high
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<19)) | (1<<18)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<9)), S3C2416_GPKDAT);
|
||||
|
||||
//WIFI_BT_EN (GPD11) pull high
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 0);
|
||||
//writel(((readl(S3C2416_GPGCON) & ~(1<<9)) | (1<<8)), S3C2416_GPGCON);
|
||||
//writel((readl(S3C2416_GPGDAT) & ~(1<<4)), S3C2416_GPGDAT);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 1);
|
||||
//writel((readl(S3C2416_GPGDAT) | (1<<4)), S3C2416_GPGDAT);
|
||||
mdelay(20);
|
||||
|
||||
//EXT_N_WIFI_RST (GPD8) pull high
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
//writel(((readl(S3C2416_GPDCON) & ~(1<<17)) | (1<<16)), S3C2416_GPDCON);
|
||||
//writel((readl(S3C2416_GPDDAT) & ~(1<<8)), S3C2416_GPDDAT);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 1);
|
||||
//writel((readl(S3C2416_GPDDAT) | (1<<8)), S3C2416_GPDDAT);
|
||||
mdelay(20);
|
||||
|
||||
//EXT_N_BT_RST (GPA2) pull high
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPA2, S3C2410_GPA2_OUT);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 0);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 1);
|
||||
mdelay(20);
|
||||
|
||||
//UART1 CTS1 (GPH10) set
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH10, S3C2410_GPH10_CLKOUT1);
|
||||
//writel(((readl(S3C2416_GPHCON) | (1<<21)) & ~ (1<<20)), S3C2416_GPHCON);
|
||||
//writel(((readl(S3C2416_GPHUDP) & ~ (1<<21)) & ~ (1<<20)), S3C2416_GPHUDP);
|
||||
//writel((readl(S3C2416_GPHDAT) & ~(1<<10)), S3C2416_GPHDAT);
|
||||
mdelay(1);
|
||||
|
||||
//UART1 RTS1 (GPH11) set
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH11, S3C2410_GPH11_nRTS);
|
||||
//writel(((readl(S3C2416_GPHCON) | (1<<23)) & ~(1<<22)), S3C2416_GPHCON);
|
||||
//writel((readl(S3C2416_GPHDAT) & ~(1<<11)), S3C2416_GPHDAT);
|
||||
//writel(((readl(S3C2416_GPHUDP) & ~ (1<<23)) & ~ (1<<22)), S3C2416_GPHUDP);
|
||||
mdelay(1);
|
||||
|
||||
break;
|
||||
|
||||
case S3C_WIFI_POWER_OFF:
|
||||
printk("BCM4329-WIFI_POWER_OFF\n");
|
||||
|
||||
//TCON Flash disable, and select WiFi
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH6, S3C2410_GPH6_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH6, 0);
|
||||
|
||||
//bcm4329 module power off control
|
||||
|
||||
//EXT_N_WIFI_RST (GPD8) pull down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
|
||||
//WIFI_BT_EN (GPD11) pull down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 0);
|
||||
|
||||
//EXT_N_BT_RST (GPA2) pull down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPA2, S3C2410_GPA2_OUT);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 0);
|
||||
mdelay(20);
|
||||
|
||||
//GPK9 (green light), pull down
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<19)) | (1<<18)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<9)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK7, WIFI PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<7)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<6)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<5)), S3C2416_GPKDAT);
|
||||
break;
|
||||
#else
|
||||
case S3C_WIFI_POWER_ON:
|
||||
printk("WIFI_POWER_ON\n");
|
||||
|
||||
//TCON Flash disable, and select WiFi
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH6, S3C2410_GPH6_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH6, 0);
|
||||
|
||||
//GPL13, SPI_CS
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_SS0);
|
||||
//SPI DI
|
||||
@@ -1288,6 +1694,11 @@ static int s3c_wifi_ioctl(struct inode *inode, struct file *file, unsigned int c
|
||||
|
||||
case S3C_WIFI_POWER_OFF:
|
||||
printk("WIFI_POWER_OFF\n");
|
||||
|
||||
//TCON Flash disable, and select WiFi
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH6, S3C2410_GPH6_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH6, 0);
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<5)), S3C2416_GPKDAT);
|
||||
@@ -1315,7 +1726,7 @@ static int s3c_wifi_ioctl(struct inode *inode, struct file *file, unsigned int c
|
||||
|
||||
|
||||
break;
|
||||
|
||||
#endif
|
||||
case S3C_READ_TILT_STATUS:
|
||||
if( ((readl(S3C2410_GPDDAT) & (0x3<<10)) >> 10) == 2){
|
||||
return 270;
|
||||
@@ -1366,6 +1777,191 @@ static int s3c_wifi_ioctl(struct inode *inode, struct file *file, unsigned int c
|
||||
|
||||
break;
|
||||
|
||||
case S3C_READ_HW_VERSION:
|
||||
//printk("S3C_READ_HW_VERSION\n");
|
||||
read_pin = readl(S3C2416_GPKDAT) & 0x1E;
|
||||
//printk(" read_pin: 0x%x\n", read_pin);
|
||||
ret = 0;
|
||||
if((read_pin & (1<<4)))
|
||||
ret = ret + 0x1000;
|
||||
if((read_pin & (1<<3)))
|
||||
ret = ret + 0x0100;
|
||||
if((read_pin & (1<<2)))
|
||||
ret = ret + 0x0010;
|
||||
if((read_pin & (1<<1)))
|
||||
ret = ret + 0x0001;
|
||||
printk("Board ID: 0x%04x\n", ret);
|
||||
return ret;
|
||||
break;
|
||||
|
||||
|
||||
case S3C_TCON_ERASE:
|
||||
printk("S3C_TCON_ERASE\n");
|
||||
|
||||
//WiFi off
|
||||
//GPK5, PA 3.3V off
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<5)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<6)), S3C2416_GPKDAT);
|
||||
|
||||
//GPD8, RESET
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
|
||||
//GPH6, TCON_FLASH enable, and select TCON flash
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH6, S3C2410_GPH6_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPH6, 1);
|
||||
|
||||
mdelay(200);
|
||||
|
||||
//Set GPIO for TCON update
|
||||
//Chip Select
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
|
||||
//GPE11 SPIMISO0
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPE11_INP);
|
||||
s3c2410_gpio_pullup(S3C2410_GPE11, 0);
|
||||
|
||||
//GPE12 SPIMOSI0
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPE12_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPE12, 1);
|
||||
|
||||
//GPE13 SPI CLK
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPE13, 0);
|
||||
msleep(50);
|
||||
|
||||
//Erase TCON Flash
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
s3c_tcon_write_byte(0x06); //Setting Write Enable Latch bit
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
udelay(50);
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
s3c_tcon_write_byte(0x60); //Write Chip Erase command
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
msleep(500);
|
||||
|
||||
do{
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
s3c_tcon_write_byte(0x05); //Write Read Status command
|
||||
r_data = s3c_tcon_read_byte();
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
//printk("r_data: 0x%02x\n", r_data);
|
||||
msleep(500);
|
||||
|
||||
}while(r_data & 0x01);
|
||||
|
||||
|
||||
tcon_byte_count = 0;
|
||||
tcon_address = 0;
|
||||
break;
|
||||
|
||||
case S3C_TCON_ID:
|
||||
printk("S3C_TCON_ID: ");
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
|
||||
s3c_tcon_write_byte(0x9F);
|
||||
r_data = s3c_tcon_read_byte();
|
||||
printk("0x%02X ", r_data);
|
||||
r_data = s3c_tcon_read_byte();
|
||||
printk("0x%02X ", r_data);
|
||||
r_data = s3c_tcon_read_byte();
|
||||
printk("0x%02X\n", r_data);
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
break;
|
||||
|
||||
case S3C_TCON_READ:
|
||||
printk("S3C_TCON_READ\n");
|
||||
printk("\n\ns3c_tcon_read_content 1\n");
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
|
||||
s3c_tcon_write_byte(0x03);
|
||||
s3c_tcon_write_byte(0x00);
|
||||
s3c_tcon_write_byte(0x00);
|
||||
s3c_tcon_write_byte(0x00);
|
||||
|
||||
for(i=0; i<300; i++){
|
||||
printk("0x%02x\n", s3c_tcon_read_byte());
|
||||
}
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
|
||||
msleep(50);
|
||||
|
||||
printk("\n\ns3c_tcon_read_content 2\n");
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
|
||||
s3c_tcon_write_byte(0x03);
|
||||
s3c_tcon_write_byte(0x02);
|
||||
s3c_tcon_write_byte(0x0F);
|
||||
s3c_tcon_write_byte(0xA0);
|
||||
|
||||
for(i=0; i<40; i++){
|
||||
printk("0x%02x\n", s3c_tcon_read_byte());
|
||||
}
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
break;
|
||||
|
||||
case S3C_TCON_BYTE_COUNT:
|
||||
tcon_byte_count = arg;
|
||||
//printk("S3C_TCON_BYTE_COUNT: %d\n", tcon_byte_count);
|
||||
break;
|
||||
|
||||
case S3C_TCON_WRITE:
|
||||
//printk("+ S3C_TCON_WRITE: %d\n ", tcon_address);
|
||||
copy_from_user(tcon_buffer, arg, tcon_byte_count);
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(20);
|
||||
s3c_tcon_write_byte(0x06); //Setting Write Enable Latch bit
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
udelay(20);
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(20);
|
||||
|
||||
//printk("0x%x 0x%x 0x%x\n", (tcon_address & 0xFF0000) >> 16, (tcon_address & 0xFF00) >> 8, (tcon_address & 0xFF));
|
||||
|
||||
s3c_tcon_write_byte(0x02); //Write Page Program command
|
||||
s3c_tcon_write_byte( (tcon_address & 0xFF0000) >> 16 );
|
||||
s3c_tcon_write_byte( (tcon_address & 0xFF00) >> 8 );
|
||||
s3c_tcon_write_byte( (tcon_address & 0xFF) );
|
||||
|
||||
for(i=0; i<tcon_byte_count; i++){
|
||||
//printk("0x%02X ", tcon_buffer[i]);
|
||||
s3c_tcon_write_byte(tcon_buffer[i]);
|
||||
}
|
||||
|
||||
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
udelay(400);
|
||||
|
||||
do{
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
|
||||
udelay(50);
|
||||
s3c_tcon_write_byte(0x05); //Write Read Status command
|
||||
r_data = s3c_tcon_read_byte();
|
||||
s3c2410_gpio_setpin(S3C2410_GPL13, 1);
|
||||
//printk("r_data: 0x%02x\n", r_data);
|
||||
udelay(100);
|
||||
|
||||
}while(r_data & 0x01);
|
||||
|
||||
tcon_address = tcon_address + tcon_byte_count;
|
||||
//printk("\n- S3C_TCON_WRITE: %d\n\n", tcon_address);
|
||||
break;
|
||||
|
||||
default:
|
||||
printk("no this command\n");
|
||||
@@ -1373,12 +1969,140 @@ static int s3c_wifi_ioctl(struct inode *inode, struct file *file, unsigned int c
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
|
||||
static int s3c_bt_open(struct inode *inode, struct file *file);
|
||||
static int s3c_bt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
|
||||
|
||||
/* File operations struct for character device */
|
||||
static const struct file_operations s3c_bt_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.ioctl = s3c_bt_ioctl,
|
||||
.open = s3c_bt_open,
|
||||
.release = NULL
|
||||
};
|
||||
//Qisda, Ralph Chang, 2010/02/09, for bt power }
|
||||
|
||||
//Qisda, Ralph Chang, 2010/02/09, for bt power {
|
||||
static int s3c_bt_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int s3c_bt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
switch(cmd){
|
||||
case S3C_BT_POWER_ON:
|
||||
printk("BCM4329-BT_POWER_ON\n");
|
||||
|
||||
//bcm4329 module power on control
|
||||
//GPK7, WIFI PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<7)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<6)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<5)), S3C2416_GPKDAT);
|
||||
mdelay(1);
|
||||
|
||||
//GPL8 (blue light), pull high
|
||||
//printk ("\n GPL8 (blue light), pull high\n");
|
||||
//writel(((readl(S3C2416_GPLCON) & ~(1<<17)) | (1<<16)), S3C2416_GPLCON);
|
||||
//writel((readl(S3C2416_GPLDAT) | (1<<8)), S3C2416_GPLDAT);
|
||||
//writel(((readl(S3C2416_GPLUDP) | (1<<17)) & ~(1<<16)), S3C2416_GPLUDP); //pull up enable
|
||||
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPL8, S3C2410_GPL8_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPL8, 1);
|
||||
//s3c2410_gpio_pullup(S3C2410_GPL8, 1);
|
||||
|
||||
//WIFI_BT_EN (GPD11) pull high
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 0);
|
||||
//writel(((readl(S3C2416_GPGCON) & ~(1<<9)) | (1<<8)), S3C2416_GPGCON);
|
||||
//writel((readl(S3C2416_GPGDAT) & ~(1<<4)), S3C2416_GPGDAT);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 1);
|
||||
//writel((readl(S3C2416_GPGDAT) | (1<<4)), S3C2416_GPGDAT);
|
||||
mdelay(20);
|
||||
|
||||
/*
|
||||
printk("EXT_N_WIFI_RST (GPD8) set high\n");
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
writel(((readl(S3C2416_GPDCON) & ~(1<<17)) | (1<<16)), S3C2416_GPDCON);
|
||||
writel((readl(S3C2416_GPDDAT) & ~(1<<8)), S3C2416_GPDDAT);
|
||||
mdelay(1);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPD8, 1);
|
||||
writel((readl(S3C2416_GPDDAT) | (1<<8)), S3C2416_GPDDAT);
|
||||
mdelay(20);
|
||||
*/
|
||||
|
||||
//EXT_N_BT_RST (GPA2) pull high
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPA2, S3C2410_GPA2_OUT);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 0);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 1);
|
||||
mdelay(20);
|
||||
|
||||
//UART1 CTS1 (GPH10) set
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH10, S3C2410_GPH10_CLKOUT1);
|
||||
//writel(((readl(S3C2416_GPHCON) | (1<<21)) & ~ (1<<20)), S3C2416_GPHCON);
|
||||
//writel(((readl(S3C2416_GPHUDP) & ~ (1<<21)) & ~ (1<<20)), S3C2416_GPHUDP);
|
||||
//writel((readl(S3C2416_GPHDAT) & ~(1<<10)), S3C2416_GPHDAT);
|
||||
mdelay(1);
|
||||
|
||||
//"UART1 RTS1 (GPH11) set
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPH11, S3C2410_GPH11_nRTS);
|
||||
//writel(((readl(S3C2416_GPHCON) | (1<<23)) & ~(1<<22)), S3C2416_GPHCON);
|
||||
//writel((readl(S3C2416_GPHDAT) & ~(1<<11)), S3C2416_GPHDAT);
|
||||
//writel(((readl(S3C2416_GPHUDP) & ~ (1<<23)) & ~ (1<<22)), S3C2416_GPHUDP);
|
||||
mdelay(1);
|
||||
break;
|
||||
|
||||
case S3C_BT_POWER_OFF:
|
||||
printk("BCM4329-BT_POWER_OFF\n");
|
||||
|
||||
//bcm4329 module power off control
|
||||
|
||||
//EXT_N_BT_RST (GPA2) pull down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPA2, S3C2410_GPA2_OUT);
|
||||
s3c2410_gpio_setpin(S3C2410_GPA2, 0);
|
||||
mdelay(20);
|
||||
|
||||
//WIFI_BT_EN (GPD11) pull down
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD11, S3C2410_GPD11_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD11, 0);
|
||||
|
||||
//GPL8 (blue light), pull down
|
||||
//writel(((readl(S3C2416_GPLCON) & ~(1<<17)) | (1<<16)), S3C2416_GPLCON);
|
||||
//writel((readl(S3C2416_GPLDAT) & ~(1<<8)), S3C2416_GPLDAT);
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPL8, S3C2410_GPL8_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPL8, 0);
|
||||
|
||||
//GPK7, WIFI PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<7)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<6)), S3C2416_GPKDAT);
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<5)), S3C2416_GPKDAT);
|
||||
break;
|
||||
|
||||
default:
|
||||
printk("no this command\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* File operations struct for character device */
|
||||
static const struct file_operations s3c_wifi_fops = {
|
||||
@@ -1426,6 +2150,17 @@ static int s3c_hsmmc_probe (struct platform_device *pdev)
|
||||
}
|
||||
//Qisda, Asaku Chen, 2009/08/20, for wifi power }
|
||||
|
||||
#ifdef CONFIG_QISDA_BK060B00
|
||||
//Qisda, Ralph Chang, 2010/02/09, for bt power {
|
||||
if(plat_data->hwport==1){
|
||||
if (register_chrdev (S3C_BT_MAJOR, "s3c_bt_cmd", &s3c_bt_fops)) {
|
||||
printk("unable to get major S3C_BT_MAJOR\n");
|
||||
|
||||
}
|
||||
}
|
||||
//Qisda, Asaku Chen, 2009/08/20, for wifi power }
|
||||
#endif
|
||||
|
||||
host = mmc_priv(mmc);
|
||||
|
||||
host->mmc = mmc;
|
||||
@@ -1465,7 +2200,25 @@ static int s3c_hsmmc_probe (struct platform_device *pdev)
|
||||
DBG("s3c_hsmmc_cfg(plat_data): enabled(%d) hwport(%d)\n", plat_data->enabled, plat_data->hwport);
|
||||
|
||||
/* To detect a card inserted on channel 0, an external interrupt is used. */
|
||||
|
||||
/* Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card { */
|
||||
#ifdef CONFIG_SD_SW_DEBOUNCE
|
||||
if( plat_data->hwport == 0)
|
||||
{
|
||||
init_timer(&sd_detect_timer);
|
||||
sd_detect_timer.function=sdcard_debounce_timer;
|
||||
}
|
||||
#endif /* CONFIG_SD_SW_DEBOUNCE */
|
||||
/* } Qisda, howard hsu, 2010/01/21, SW_DEBOUNCE for sd card */
|
||||
/* Qisda, howard hsu, 2010/01/21, fix start slot for SD card { */
|
||||
if( plat_data->hwport == 0)
|
||||
{
|
||||
mmc->first_devidx = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mmc->first_devidx = 0;
|
||||
}
|
||||
/* } Qisda, howard hsu, 2010/01/21, fix start slot for SD card */
|
||||
if ((plat_data->enabled == 1) && (plat_data->hwport == 0)) {
|
||||
host->irq_cd = platform_get_irq(pdev, 1);
|
||||
if (host->irq_cd == 0) {
|
||||
@@ -1514,7 +2267,8 @@ static int s3c_hsmmc_probe (struct platform_device *pdev)
|
||||
/* you must make sure that our hsmmc block can support
|
||||
* up to 52MHz. by scsuh
|
||||
*/
|
||||
mmc->f_max = 100 * MHZ;
|
||||
//mmc->f_max = 100 * MHZ;
|
||||
mmc->f_max = 25 * MHZ;
|
||||
mmc->caps = plat_data->host_caps;
|
||||
DBG("mmc->caps: %08lx\n", mmc->caps);
|
||||
printk(KERN_INFO "mmc->caps: %08lx\n", mmc->caps);
|
||||
@@ -1708,7 +2462,13 @@ static int s3c_hsmmc_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
|
||||
//mmc suspend GPIO config
|
||||
s3c_hsmmc_power_switch(s3c_host->plat_data->hwport, 0);
|
||||
|
||||
/* Qisda, Howard, 2009/12/22, fix resume card-detect { */
|
||||
if(s3c_host->plat_data->hwport==0)
|
||||
{
|
||||
inResume = 1;
|
||||
card_detect2 = 2;
|
||||
}
|
||||
/* } Qisda, Howard, 2009/12/22, fix resume card-detect */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1733,19 +2493,41 @@ static int s3c_hsmmc_resume(struct platform_device *pdev)
|
||||
//PWREN_SD
|
||||
if(s3c_host->plat_data->hwport==0){
|
||||
read_pin = readl(S3C2410_GPFDAT) & (1<<1);
|
||||
if(read_pin){
|
||||
//printk("\nno card\n");
|
||||
if(read_pin && !card_detect){
|
||||
printk("\nNO CARD\n");
|
||||
s3c_hsmmc_power_switch(0, 0);
|
||||
set_irq_type(s3c_host->irq_cd, IRQT_FALLING);
|
||||
/* Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger { */
|
||||
//set_irq_type(s3c_host->irq_cd, IRQT_FALLING);
|
||||
set_irq_type(s3c_host->irq_cd, IRQT_LOW);
|
||||
/* } Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger */
|
||||
card_detect2 = 3;
|
||||
}
|
||||
else{
|
||||
//printk("\ncard in\n");
|
||||
if(read_pin){
|
||||
printk("no card\n");
|
||||
/* Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger { */
|
||||
//set_irq_type(s3c_host->irq_cd, IRQT_FALLING);
|
||||
set_irq_type(s3c_host->irq_cd, IRQT_LOW);
|
||||
/* } Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger */
|
||||
card_detect = 0;
|
||||
//s3c_hsmmc_power_switch(0, 0);
|
||||
}
|
||||
else{
|
||||
printk("card in\n");
|
||||
/* Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger { */
|
||||
//set_irq_type(s3c_host->irq_cd, IRQT_RISING);
|
||||
set_irq_type(s3c_host->irq_cd, IRQT_HIGH);
|
||||
/* } Qisda, Howard Hsu, 2009/12/17, card detect by level-trigger */
|
||||
card_detect = 1;
|
||||
//s3c_hsmmc_power_switch(0, 1);
|
||||
}
|
||||
|
||||
card_detect2 = 2;
|
||||
s3c_hsmmc_power_switch(0, 1);
|
||||
set_irq_type(s3c_host->irq_cd, IRQT_RISING);
|
||||
s3c_hsmmc_ios_init(s3c_host);
|
||||
mmc_resume_host(host);
|
||||
mmc_resume_host(host);
|
||||
}
|
||||
card_detect2 = 2; //Qisda, Asaku Chen, 2009/11/03 {
|
||||
inResume = 0; //howard, 2009/12/22, fix resume card-detect
|
||||
}
|
||||
else if(s3c_host->plat_data->hwport==1){
|
||||
s3c_hsmmc_power_switch(1, 1);
|
||||
@@ -1813,6 +2595,12 @@ static void __exit s3c_hsmmc_drv_exit(void)
|
||||
platform_driver_unregister(&s3c_hsmmc_driver);
|
||||
}
|
||||
|
||||
void s3c_moviNAND_power_off(void)
|
||||
{
|
||||
struct s3c_hsmmc_host *host = global_host[1];
|
||||
printk("s3c_moviNAND_power_off");
|
||||
s3c_hsmmc_writeb(S3C_HSMMC_POWER_OFF, S3C_HSMMC_PWRCON);
|
||||
}
|
||||
|
||||
module_init(s3c_hsmmc_drv_init);
|
||||
module_exit(s3c_hsmmc_drv_exit);
|
||||
|
||||
@@ -48,9 +48,7 @@ static unsigned int tick_count;
|
||||
|
||||
/* Qisda, ShiYong Lin, 2009/07/22, Implement function for RTC tick service {*/
|
||||
static unsigned long uiResolution = 0;
|
||||
#ifdef QISDA
|
||||
extern void rtc_tick_keypad_message_to_ap (void);
|
||||
#endif
|
||||
//extern void rtc_tick_keypad_message_to_ap (void);
|
||||
/* Qisda, ShiYong Lin, 2009/07/22, Implement function for RTC tick service }*/
|
||||
|
||||
static irqreturn_t s3c_rtc_alarmirq(int irq, void *id)
|
||||
@@ -69,9 +67,9 @@ static irqreturn_t s3c_rtc_tickirq(int irq, void *id)
|
||||
{
|
||||
struct rtc_device *rdev = id;
|
||||
|
||||
#ifdef QISDA
|
||||
rtc_tick_keypad_message_to_ap();
|
||||
#endif
|
||||
//rtc_tick_keypad_message_to_ap();
|
||||
|
||||
|
||||
rtc_update_irq(&rdev->class_dev, tick_count++, RTC_PF | RTC_IRQF);
|
||||
|
||||
#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
|
||||
|
||||
@@ -667,14 +667,16 @@ static unsigned int s3c24xx_serial_getclk(struct uart_port *port,
|
||||
struct baud_calc *resptr, *best, *sptr;
|
||||
int i;
|
||||
|
||||
|
||||
/*Qisda Qube for smart card*/
|
||||
if(port->irq==73&&port->uartclk==1)
|
||||
{
|
||||
//force uart 1 clock= pclk
|
||||
cfg->clocks_size=1;
|
||||
}
|
||||
/*Qisda Qube for smart card*/
|
||||
/* Ralph added compile flag to disable it for BK060B00 */
|
||||
#ifndef CONFIG_QISDA_BK060B00
|
||||
/*Qisda Qube for smart card*/
|
||||
if(port->irq==73&&port->uartclk==1)
|
||||
{
|
||||
//force uart 1 clock= pclk
|
||||
cfg->clocks_size=1;
|
||||
}
|
||||
/*Qisda Qube for smart card*/
|
||||
#endif
|
||||
|
||||
//printk("\n\n\s3c24xx_serial_getclk\n\n\n");
|
||||
//printk("\n\n\n\n hwport= %ld \n\n\n\\n",cfg->hwport);
|
||||
@@ -782,15 +784,17 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
|
||||
|
||||
baud = uart_get_baud_rate(port, termios, old, 0, 115200*8);
|
||||
|
||||
/*Qisda Qube for smart card*/
|
||||
/* Ralph added compile flag to disable it for BK060B00 */
|
||||
#ifndef CONFIG_QISDA_BK060B00
|
||||
/*Qisda Qube for smart card*/
|
||||
|
||||
if(port->irq==73&&port->uartclk==1)
|
||||
{
|
||||
//force uart1 to 38400
|
||||
baud=38400;
|
||||
}
|
||||
/*Qisda Qube for smart card*/
|
||||
|
||||
if(port->irq==73&&port->uartclk==1)
|
||||
{
|
||||
//force uart1 to 38400
|
||||
baud=38400;
|
||||
}
|
||||
/*Qisda Qube for smart card*/
|
||||
#endif
|
||||
|
||||
if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
|
||||
quot = port->custom_divisor;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
#include <asm/arch/regs-clock.h>
|
||||
#include <asm/arch/regs-spi.h>
|
||||
#include <asm/arch/regs-irq.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
#include "spi-dev.h"
|
||||
@@ -60,7 +61,7 @@
|
||||
#define CONFIG_AUTO_nSS 0
|
||||
#define CONFIG_DO_SWRST 1
|
||||
#define CONFIG_USE_PKTCNT 1
|
||||
#define CONFIG_SPI_PRESCALER 1
|
||||
#define CONFIG_SPI_PRESCALER 1
|
||||
|
||||
#define CONFIG_TX_LVL 0x20
|
||||
#define CONFIG_RX_LVL 0x10
|
||||
@@ -86,7 +87,132 @@ static void s3c_spi_wifi_if_on(void);
|
||||
static void s3c_spi_wifi_if_off(void);
|
||||
|
||||
|
||||
//#undef debug
|
||||
//blacksu add
|
||||
#define S3C2416_GPKCON S3C2410_GPIOREG(0xe0)
|
||||
#define S3C2416_GPKDAT S3C2410_GPIOREG(0xe4)
|
||||
#define S3C2416_GPKUDP S3C2410_GPIOREG(0xe8)
|
||||
|
||||
irqreturn_t Wlan_irq (int i4Irq, void *pvDevID)
|
||||
{
|
||||
|
||||
|
||||
|
||||
printk("Wlan_irq()++\n");
|
||||
|
||||
disable_irq(IRQ_EINT3);
|
||||
enable_irq(IRQ_EINT3);
|
||||
|
||||
printk("Wlan_irq()--\n");
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void
|
||||
myhexdump(char *pfx, unsigned char *msg, int msglen)
|
||||
{
|
||||
int i, col;
|
||||
char buf[1024];
|
||||
|
||||
|
||||
|
||||
col = 0;
|
||||
|
||||
for (i = 0; i < msglen; i++, col++) {
|
||||
if (col % 16 == 0)
|
||||
strcpy(buf, pfx);
|
||||
sprintf(buf + strlen(buf), "%02x", msg[i]);
|
||||
if ((col + 1) % 16 == 0)
|
||||
printk("%s\n", buf);
|
||||
else
|
||||
sprintf(buf + strlen(buf), " ");
|
||||
}
|
||||
|
||||
if (col % 16 != 0)
|
||||
printk("%s\n", buf);
|
||||
}
|
||||
|
||||
|
||||
void ClearSourcePenging(void)
|
||||
{
|
||||
|
||||
writel( (1<<3), S3C2410_SRCPND);
|
||||
|
||||
}
|
||||
|
||||
void ClearIntrPenging(void)
|
||||
{
|
||||
|
||||
writel( (1<<3), S3C2410_INTPND);
|
||||
|
||||
}
|
||||
|
||||
void S3cEnableIntr(void)
|
||||
{
|
||||
|
||||
// writel(readl(S3C2410_INTMSK)& ~(1<<3), S3C2410_INTMSK);
|
||||
writel(readl(S3C2410_INTMSK)& 0xfffffff7, S3C2410_INTMSK);
|
||||
|
||||
}
|
||||
|
||||
void S3cDisableIntr(void)
|
||||
{
|
||||
|
||||
writel(readl(S3C2410_INTMSK)|(1<<3), S3C2410_INTMSK);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void spi_sendrecv(sdioh_info_t *sd, uint8 *msg_out, uint8 *msg_in, int msglen)
|
||||
{
|
||||
|
||||
struct spi_dev *prSpiDev;
|
||||
int ret;
|
||||
unsigned char Write;
|
||||
// int i;
|
||||
|
||||
//myhexdump("OUT:", msg_out,msglen);
|
||||
|
||||
/*
|
||||
if( (sd->wordlen!=2) || (sd->resp_delay_all) )
|
||||
{
|
||||
printk("********************************\n");
|
||||
printk("******* BlackSu *****************\n");
|
||||
printk("********Watch Here***************\n");
|
||||
printk("wordlen=%d, resp_delay_all=%d\n",sd->wordlen,sd->resp_delay_all);
|
||||
printk("********************************\n");
|
||||
}
|
||||
*/
|
||||
Write=msg_out[2] & 0x80;//bit 7: read:0, write :1
|
||||
prSpiDev = spi_dev_get_by_minor(0);
|
||||
if(Write)
|
||||
{
|
||||
ret = spi_master_send(prSpiDev, (char *)&msg_out[0], msglen-4);//send CMD
|
||||
ret = spi_master_recv(prSpiDev, (char *)&msg_in[msglen-4], 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = spi_master_send(prSpiDev, (char *)&msg_out[0], 4);//send CMD
|
||||
ret = spi_master_recv(prSpiDev, (char *)&msg_in[4], msglen-4);
|
||||
}
|
||||
//myhexdump("I N:", msg_in,msglen);
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
EXPORT_SYMBOL(ClearSourcePenging);
|
||||
EXPORT_SYMBOL(ClearIntrPenging);
|
||||
EXPORT_SYMBOL(S3cEnableIntr);
|
||||
EXPORT_SYMBOL(S3cDisableIntr);
|
||||
|
||||
EXPORT_SYMBOL(spi_sendrecv);
|
||||
|
||||
|
||||
|
||||
#undef debug
|
||||
//#define debug
|
||||
#ifdef debug
|
||||
#define DBG(x...) printk(x)
|
||||
@@ -112,7 +238,7 @@ void print_reg(struct s3c_spi *spi) { }
|
||||
|
||||
static void s3c_spi_free(struct s3c_spi *spi)
|
||||
{
|
||||
//DEBUG;
|
||||
DEBUG;
|
||||
|
||||
if (spi->clk != NULL && !IS_ERR(spi->clk)) {
|
||||
clk_disable(spi->clk);
|
||||
@@ -139,7 +265,7 @@ static void s3c_spi_free(struct s3c_spi *spi)
|
||||
|
||||
static void s3c_spi_wifi_if_on()
|
||||
{
|
||||
printk("\n[HIKO HSPI] s3c_spi_wifi_if_on()\n");
|
||||
printk("s3c_spi_wifi_if_on()++\n");
|
||||
|
||||
/* program defaults into the registers */
|
||||
writel(readl(S3C2443_SCLKCON)|(1<<14), S3C2443_SCLKCON);
|
||||
@@ -168,30 +294,82 @@ static void s3c_spi_wifi_if_on()
|
||||
/* GeorgeKuo: */
|
||||
//s3c2410_gpio_pullup(S3C2410_GPL13, 2); /* pull-up enable */
|
||||
|
||||
//GPK5, PA 3.3V
|
||||
//writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
//writel((readl(S3C2416_GPKDAT) | (1<<5)), S3C2416_GPKDAT);
|
||||
//writel(((readl(S3C2416_GPKUDP) & (1<<11)) | ~(1<<10)), S3C2416_GPKUDP);
|
||||
|
||||
//GPK6, PA 1.8V
|
||||
//writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
//writel((readl(S3C2416_GPKDAT) | (1<<6)), S3C2416_GPKDAT);
|
||||
//writel(((readl(S3C2416_GPKUDP) & (1<<13)) | ~(1<<12)), S3C2416_GPKUDP);
|
||||
/*
|
||||
printk("GPK_CON = 0x%08x\n",readl(S3C2416_GPKCON));
|
||||
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<13)) | (1<<12)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<6)), S3C2416_GPKDAT);
|
||||
writel(((readl(S3C2416_GPKUDP) & (1<<13)) | ~(1<<12)), S3C2416_GPKUDP);
|
||||
*/
|
||||
|
||||
|
||||
//GPK5, WIFI 3.3V
|
||||
printk("GPK_CON = 0x%08x\n",readl(S3C2416_GPKCON));
|
||||
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<5)), S3C2416_GPKDAT);
|
||||
writel(((readl(S3C2416_GPKUDP) & (1<<11)) | ~(1<<10)), S3C2416_GPKUDP);
|
||||
|
||||
|
||||
//GPK7, PA 3.3V
|
||||
printk("GPK_CON = 0x%08x\n",readl(S3C2416_GPKCON));
|
||||
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel((readl(S3C2416_GPKDAT) | (1<<7)), S3C2416_GPKDAT);
|
||||
writel(((readl(S3C2416_GPKUDP) & (1<<15)) | ~(1<<14)), S3C2416_GPKUDP);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
//WIFI_BT_EN
|
||||
//GPG4
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP);
|
||||
// s3c2410_gpio_setpin(S3C2410_GPG4, 0);
|
||||
// mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPG4, 1);
|
||||
mdelay(20);
|
||||
#endif
|
||||
|
||||
|
||||
/* GeorgeKuo: */
|
||||
//EXT Reset
|
||||
//s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
//mdelay(1);
|
||||
//s3c2410_gpio_setpin(S3C2410_GPD8, 1);
|
||||
//mdelay(20);
|
||||
//EXT_N_WIFI_RST
|
||||
//GPD8
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPD8, S3C2410_GPD8_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 1);
|
||||
mdelay(20);
|
||||
printk("s3c_spi_wifi_if_on()--\n");
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(s3c_spi_wifi_if_on);
|
||||
|
||||
|
||||
static void s3c_spi_wifi_if_off()
|
||||
{
|
||||
printk("\n[HIKO HSPI] s3c_spi_wifi_if_off()\n");
|
||||
|
||||
|
||||
//GPK7, PA 3.3V
|
||||
printk("+GPK_DAT = 0x%08x\n",readl(S3C2416_GPKDAT));
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<15)) | (1<<14)), S3C2416_GPKCON);
|
||||
writel(((readl(S3C2416_GPKUDP) & ~(1<<15)) | (1<<14)), S3C2416_GPKUDP);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<7)), S3C2416_GPKDAT);
|
||||
// writel(((readl(S3C2416_GPKUDP) & (1<<15)) | ~(1<<14)), S3C2416_GPKUDP);
|
||||
printk("-GPK_DAT = 0x%08x\n",readl(S3C2416_GPKDAT));
|
||||
|
||||
|
||||
|
||||
//GPK5, WIFI 3.3V
|
||||
printk("+GPK_DAT = 0x%08x\n",readl(S3C2416_GPKDAT));
|
||||
|
||||
writel(((readl(S3C2416_GPKCON) & ~(1<<11)) | (1<<10)), S3C2416_GPKCON);
|
||||
writel(((readl(S3C2416_GPKUDP) & ~(1<<11)) | (1<<10)), S3C2416_GPKUDP);
|
||||
writel((readl(S3C2416_GPKDAT) & ~(1<<5)), S3C2416_GPKDAT);
|
||||
// writel(((readl(S3C2416_GPKUDP) & (1<<11)) | ~(1<<10)), S3C2416_GPKUDP);
|
||||
printk("-GPK_DAT = 0x%08x\n",readl(S3C2416_GPKDAT));
|
||||
printk("s3c_spi_wifi_if_off()\n");
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(s3c_spi_wifi_if_off);
|
||||
|
||||
@@ -236,12 +414,14 @@ static int s3c_spi_hw_init(struct s3c_spi *spi)
|
||||
|
||||
#ifdef CONFIG_SPICLK_PCLK
|
||||
/*Enable PCLK into the HS SPI*/
|
||||
printk("Enable PCLK into the HS SPI\n");
|
||||
writel(readl(S3C2443_PCLKCON)|(1<<6), S3C2443_PCLKCON);
|
||||
|
||||
clk_enable(spi->clk);
|
||||
|
||||
#elif defined CONFIG_SPICLK_EPLL
|
||||
/* implemetation when use EPLL clock */
|
||||
printk("implemetation when use EPLL clock\n");
|
||||
writel(0x800, S3C2443_LOCKCON1);
|
||||
writel( (readl( S3C2443_CLKSRC ) | (1 << 6) ), S3C2443_CLKSRC); // EPLL Output
|
||||
|
||||
@@ -277,7 +457,7 @@ static int s3c_spi_hw_init(struct s3c_spi *spi)
|
||||
|
||||
static int s3c_spi_dma_init(struct s3c_spi *spi, int mode)
|
||||
{
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
|
||||
// TX
|
||||
if (mode == 0) {
|
||||
@@ -304,7 +484,7 @@ static int s3c_spi_dma_init(struct s3c_spi *spi, int mode)
|
||||
static inline void s3c_spi_write_fifo(struct s3c_spi *spi)
|
||||
{
|
||||
u32 wdata = 0;
|
||||
|
||||
DEBUG;
|
||||
if (spi->msg->wbuf) {
|
||||
wdata = spi->msg->wbuf[spi->msg_ptr++];
|
||||
} else {
|
||||
@@ -323,7 +503,7 @@ static inline void s3c_spi_write_fifo(struct s3c_spi *spi)
|
||||
*/
|
||||
static inline void s3c_spi_master_complete(struct s3c_spi *spi, int ret)
|
||||
{
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
|
||||
spi->msg_ptr = 0;
|
||||
spi->msg_rd_ptr = 0;
|
||||
@@ -358,7 +538,7 @@ static inline void s3c_spi_stop(struct s3c_spi *spi, int ret)
|
||||
{
|
||||
u32 spi_slavecfg;
|
||||
u32 spi_chcfg;
|
||||
|
||||
DEBUG;
|
||||
#if CONFIG_AUTO_nSS
|
||||
#else
|
||||
/* GeorgeKuo: set nSS high to stop bus operation */
|
||||
@@ -396,7 +576,7 @@ void s3c_spi_dma_cb(struct s3c2410_dma_chan *dma_ch, void *buf_id,
|
||||
{
|
||||
struct s3c_spi *spi = (struct s3c_spi *)buf_id;
|
||||
unsigned long status = 0;
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
|
||||
status = readl(spi->regs + S3C_SPI_STATUS);
|
||||
|
||||
@@ -427,7 +607,7 @@ static void s3c_spi_message_start(struct s3c_spi *spi)
|
||||
//u32 spi_clkcfg = 0;
|
||||
|
||||
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
|
||||
#if CONFIG_DO_SWRST /* GeorgeKuo: do software reset */
|
||||
writel(readl(spi->regs + S3C_CH_CFG) | SPI_CH_SW_RST, spi->regs + S3C_CH_CFG);
|
||||
@@ -615,11 +795,13 @@ static void s3c_spi_message_start(struct s3c_spi *spi)
|
||||
|
||||
static inline int tx_msgend(struct s3c_spi *spi)
|
||||
{
|
||||
DEBUG;
|
||||
return spi->msg_ptr >= spi->msg->len;
|
||||
}
|
||||
|
||||
static inline int rx_msgend(struct s3c_spi *spi)
|
||||
{
|
||||
DEBUG;
|
||||
return spi->msg_rd_ptr >= spi->msg->len;
|
||||
}
|
||||
|
||||
@@ -733,7 +915,8 @@ static irqreturn_t s3c_spi_irq(int irqno, void *dev_id)
|
||||
{
|
||||
struct s3c_spi *spi = dev_id;
|
||||
unsigned long spi_sts;
|
||||
|
||||
//printk("[S3C2416]s3c_spi_irq()++\n");
|
||||
DEBUG;
|
||||
spi_sts = readl(spi->regs + S3C_SPI_STATUS);
|
||||
|
||||
if (spi_sts & SPI_STUS_RX_OVERRUN_ERR) {
|
||||
@@ -762,7 +945,7 @@ static irqreturn_t s3c_spi_irq(int irqno, void *dev_id)
|
||||
static int s3c_spi_doxfer(struct s3c_spi *spi, struct spi_msg msgs[], int num)
|
||||
{
|
||||
int ret;
|
||||
|
||||
DEBUG;
|
||||
/* GeorgeKuo: spi_dev->bus_lock is acquired by caller, do we have to do
|
||||
* protection again?
|
||||
*/
|
||||
@@ -783,22 +966,24 @@ static int s3c_spi_doxfer(struct s3c_spi *spi, struct spi_msg msgs[], int num)
|
||||
}*/
|
||||
|
||||
if (spi->msg->wbuf) {
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
spi->state = STATE_XFER_TX;
|
||||
|
||||
/* vivek, 2009-04-15 17:40 Notes: write dmabufw to dmabuf_addr */
|
||||
if (spi->msg->flags & SPI_M_DMA_MODE) {
|
||||
spi->dmabuf_addr = spi->spidev.dmabufw;
|
||||
pr_debug("spi->dmabuf_addr = 0x%x\n",spi->dmabuf_addr);
|
||||
printk("[W]spi->dmabuf_addr = 0x%x\n",spi->dmabuf_addr);
|
||||
}
|
||||
} else if (spi->msg->rbuf) {
|
||||
// DEBUG;
|
||||
DEBUG;
|
||||
spi->state = STATE_XFER_RX;
|
||||
|
||||
/* vivek, 2009-04-15 17:41 Notes: write dmabufr to dmabuf_addr */
|
||||
if (spi->msg->flags & SPI_M_DMA_MODE) {
|
||||
spi->dmabuf_addr = spi->spidev.dmabufr;
|
||||
pr_debug("spi->dmabuf_addr = 0x%x\n",spi->dmabuf_addr);
|
||||
printk("[R]spi->dmabuf_addr = 0x%x\n",spi->dmabuf_addr);
|
||||
}
|
||||
} else {
|
||||
dev_err(spi->dev,"Unknown functionality \n");
|
||||
@@ -844,7 +1029,7 @@ static int s3c_spi_xfer(struct spi_dev *spi_dev,
|
||||
struct s3c_spi *spi = (struct s3c_spi *)spi_dev->algo_data;
|
||||
int retry;
|
||||
int ret;
|
||||
|
||||
DEBUG;
|
||||
for (retry = 0; retry < spi_dev->retries; retry++) {
|
||||
|
||||
ret = s3c_spi_doxfer(spi, msgs, num);
|
||||
@@ -865,7 +1050,7 @@ static int s3c_spi_close(struct spi_dev *spi_dev)
|
||||
{
|
||||
struct s3c_spi *spi = (struct s3c_spi *)spi_dev->algo_data;
|
||||
u32 spi_clkcfg;
|
||||
//DEBUG;
|
||||
DEBUG;
|
||||
|
||||
spi_clkcfg = readl( spi->regs + S3C_CLK_CFG);
|
||||
/* GeorgeKuo: */
|
||||
@@ -959,8 +1144,10 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
struct s3c_spi *spi = &s3c_spi[pdev->id];
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
DEBUG;
|
||||
/* find the clock and enable it */
|
||||
printk("s3c_spi_probe(name=%s , id=%d, # resources=%d)++\n", pdev->name, pdev->id,pdev->num_resources);
|
||||
|
||||
sema_init(&spi->sem, 0);
|
||||
spi->nr = pdev->id;
|
||||
spi->dev = &pdev->dev;
|
||||
@@ -990,7 +1177,7 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
printk(KERN_ALERT "resource start : %x\n",res->start);
|
||||
printk("resource start : %x\n",res->start);
|
||||
|
||||
spi->regs = ioremap(res->start, (res->end - res->start) + 1);
|
||||
|
||||
@@ -1000,7 +1187,7 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
printk(KERN_ALERT "hspi registers %p (%p, %p)\n", spi->regs, spi->ioarea, res);
|
||||
printk("hspi registers %p (%p, %p)\n", spi->regs, spi->ioarea, res);
|
||||
|
||||
/* setup info block for the spi core */
|
||||
|
||||
@@ -1028,6 +1215,8 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
|
||||
/* GeorgeKuo: */
|
||||
//ret = request_irq(res->start, s3c_spi_irq, SA_INTERRUPT, pdev->name, spi);
|
||||
printk("[s3c2416]request_irq=%d\n",spi->irq->start);
|
||||
|
||||
ret = request_irq(spi->irq->start, s3c_spi_irq, SA_INTERRUPT, pdev->name,
|
||||
spi);
|
||||
|
||||
@@ -1039,7 +1228,15 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
/* GeorgeKuo: Do initialization here instead of each read/write operation */
|
||||
do {
|
||||
/* MT5921 uses CPOL=1, CPHA=1 */
|
||||
u32 spi_chcfg = SPI_CH_MASTER | SPI_CH_FALLING | SPI_CH_FORMAT_B;
|
||||
// u32 spi_chcfg = SPI_CH_MASTER | SPI_CH_FALLING | SPI_CH_FORMAT_B;
|
||||
|
||||
//blacksu mod
|
||||
u32 spi_chcfg = SPI_CH_MASTER | SPI_CH_RISING | SPI_CH_FORMAT_A;
|
||||
// spi_chcfg = SPI_CH_MASTER | SPI_CH_RISING | SPI_CH_FORMAT_B;
|
||||
// spi_chcfg = SPI_CH_MASTER | SPI_CH_FALLING | SPI_CH_FORMAT_A;
|
||||
|
||||
|
||||
|
||||
//u32 spi_clkcfg = SPI_ENCLK_ENABLE | 1; /* prescaler = 1 */
|
||||
u32 spi_clkcfg = SPI_ENCLK_ENABLE | CONFIG_SPI_PRESCALER; /* prescaler = 1 */
|
||||
//0:44.435 Mhz, 1:22.2175 Mhz, 2:14.81 Mhz, 3:11.10875 Mhz, 4:8.887Mhz
|
||||
@@ -1106,6 +1303,95 @@ static int s3c_spi_probe(struct platform_device *pdev)
|
||||
s3c_spi_dma_init(spi, 1);
|
||||
printk("spi read channel is %d\n",spi->dmar);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
printk("GPFCON=%08X\n",readl(S3C2410_GPFCON));
|
||||
printk("GPFDAT=%08X\n",readl(S3C2410_GPFDAT));
|
||||
printk("GPFUP=%08X\n",readl(S3C2410_GPFUP));
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_OUTP);
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF3, 0); // pull-up/down disable
|
||||
s3c2410_gpio_pullup(S3C2410_GPF3, 1); // pull-down enable
|
||||
|
||||
writel( (readl( S3C2410_GPFDAT ) | (1 << 3) ), S3C2410_GPFDAT); // EPLL Output
|
||||
*/
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
printk("GPFCON=%08X\n",readl(S3C2410_GPFCON));
|
||||
printk("GPFDAT=%08X\n",readl(S3C2410_GPFDAT));
|
||||
printk("GPFUP=%08X\n",readl(S3C2410_GPFUP));
|
||||
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_INP);
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF3, 0); /* pull-up/down disable */
|
||||
s3c2410_gpio_pullup(S3C2410_GPF3, 1); /* pull-down enable */
|
||||
// s3c2410_gpio_pullup(S3C2410_GPF3, 2); /* pull-up enable */
|
||||
//set_irq_type(WLAN_STA_IRQ, IRQ_TYPE_LEVEL_LOW);
|
||||
set_irq_type(IRQ_EINT3, IRQ_TYPE_LEVEL_HIGH);
|
||||
|
||||
|
||||
printk("GPFCON=%08X\n",readl(S3C2410_GPFCON));
|
||||
printk("GPFDAT=%08X\n",readl(S3C2410_GPFDAT));
|
||||
printk("GPFUP=%08X\n",readl(S3C2410_GPFUP));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if 1
|
||||
|
||||
|
||||
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_EINT3);
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF3, 0); // pull-up/down disable
|
||||
s3c2410_gpio_pullup(S3C2410_GPF3, 1); // pull-down enable
|
||||
// s3c2410_gpio_pullup(S3C2410_GPF3, 2); // pull-up enable
|
||||
// set_irq_type(IRQ_EINT3, IRQ_TYPE_LEVEL_LOW);
|
||||
set_irq_type(IRQ_EINT3, IRQ_TYPE_LEVEL_HIGH);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_EINT3);
|
||||
//s3c2410_gpio_pullup(S3C2410_GPF3, 0); // pull-up/down disable
|
||||
s3c2410_gpio_pullup(S3C2410_GPF3, 2); // pull-up enable
|
||||
//set_irq_type(WLAN_STA_IRQ, IRQ_TYPE_LEVEL_LOW);
|
||||
// set_irq_type(IRQ_EINT3, IRQ_TYPE_EDGE_FALLING);
|
||||
set_irq_type(IRQ_EINT3, IRQ_TYPE_EDGE_FALLING);
|
||||
|
||||
|
||||
mdelay(100);
|
||||
|
||||
// ret = request_irq(IRQ_EINT3, Wlan_irq, IRQ_TYPE_EDGE_FALLING | IRQ_DISABLED, "EINT3-test", NULL);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
printk("GPFCON=%08X\n",readl(S3C2410_GPFCON));
|
||||
printk("GPFDAT=%08X\n",readl(S3C2410_GPFDAT));
|
||||
printk("GPFUP=%08X\n",readl(S3C2410_GPFUP));
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
out:
|
||||
if (ret < 0)
|
||||
s3c_spi_free(spi);
|
||||
@@ -1166,6 +1452,91 @@ out:
|
||||
|
||||
} while (0);
|
||||
#endif
|
||||
|
||||
#if 1 /* BCM4329 read test*/
|
||||
do {
|
||||
|
||||
struct spi_dev *prSpiDev;
|
||||
int ret;
|
||||
// int i;
|
||||
sdioh_info_t sd;
|
||||
|
||||
unsigned C[4];
|
||||
unsigned char buf[128]={0x0,};
|
||||
unsigned char msg_out[128]={0xa0,0x04,0x00,0x00,};
|
||||
unsigned char msg_in[128]={0,};
|
||||
int msglen=16;
|
||||
|
||||
|
||||
|
||||
|
||||
#define CMD_READ 0
|
||||
#define CMD_WRITE 1
|
||||
#define ACCESS_FIXED 0
|
||||
#define ACCESS_INCREMENTAL 1
|
||||
#define FUN_0 0
|
||||
#define FUN_1 1
|
||||
#define FUN_2 2
|
||||
#define FUN_3 3
|
||||
|
||||
|
||||
unsigned int SPI_Cmd=CMD_READ;
|
||||
unsigned int SPI_Acc=ACCESS_INCREMENTAL;
|
||||
unsigned int SPI_Fun=FUN_0;
|
||||
unsigned int SPI_Add=0x14;
|
||||
unsigned int SPI_Len=0x4;
|
||||
unsigned int CMD=0x0;
|
||||
|
||||
CMD= (SPI_Cmd <<31) | (SPI_Acc<<30) | (SPI_Fun<<28) | (SPI_Add<<11) | (SPI_Len<<0);
|
||||
|
||||
C[3]=(CMD & 0xff000000) >> 24;
|
||||
C[2]=(CMD & 0x00ff0000) >> 16;
|
||||
C[1]=(CMD & 0x0000ff00) >> 8;
|
||||
C[0]=(CMD & 0x000000ff) >>0;
|
||||
|
||||
buf[0]=C[1];
|
||||
buf[1]=C[0];
|
||||
buf[2]=C[3];
|
||||
buf[3]=C[2];
|
||||
|
||||
|
||||
/*
|
||||
// GeorgeKuo:
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 0);
|
||||
mdelay(1);
|
||||
s3c2410_gpio_setpin(S3C2410_GPD8, 1);
|
||||
mdelay(20);
|
||||
*/
|
||||
prSpiDev = spi_dev_get_by_minor(0);
|
||||
|
||||
#if 1
|
||||
// for (i = 0; i < 10; i++) {
|
||||
ret = spi_master_send(prSpiDev, (char *)&buf[0], 4);
|
||||
ret = spi_master_recv(prSpiDev, (char *)&buf[4], 8);
|
||||
printk("****BCM4329 read test****\n");
|
||||
if( (buf[4]==0xBE) &&
|
||||
(buf[5]==0xAD) &&
|
||||
(buf[6]==0xFE) &&
|
||||
(buf[7]==0xED) )
|
||||
printk("$$$$$$$ Success to read Reg. 0x14 buf1=%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7],buf[8],buf[9],buf[10],buf[11]);
|
||||
else
|
||||
printk("!!!!!! Failed to read Reg. 0x14\n");
|
||||
// }
|
||||
#endif
|
||||
|
||||
|
||||
sd.wordlen=2;
|
||||
sd.resp_delay_all=0;
|
||||
spi_sendrecv(&sd,msg_out, msg_in, msglen);
|
||||
myhexdump("OUT:", msg_out,msglen);
|
||||
myhexdump("I N:", msg_in,msglen);
|
||||
|
||||
|
||||
//ret = spi_master_recv(prSpiDev, (char *)&u4RVal, sizeof(u32));
|
||||
//printk(KERN_INFO "read 0x%x\n", u4RVal);
|
||||
} while (0);
|
||||
#endif
|
||||
|
||||
#if 0 /* MT5921 Initial */
|
||||
do {
|
||||
u32 u4InitCmd = 0x00040000UL;
|
||||
@@ -1223,7 +1594,7 @@ out:
|
||||
}
|
||||
} while (0);
|
||||
#endif
|
||||
|
||||
printk("s3c_spi_probe()--\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1258,6 +1629,7 @@ static int s3c_spi_remove(struct platform_device *pdev)
|
||||
static int s3c_spi_suspend(struct platform_device *pdev, pm_message_t msg)
|
||||
{
|
||||
struct s3c_spi *hw = platform_get_drvdata(pdev);
|
||||
DEBUG;
|
||||
clk_disable(hw->clk);
|
||||
return 0;
|
||||
}
|
||||
@@ -1265,6 +1637,7 @@ static int s3c_spi_suspend(struct platform_device *pdev, pm_message_t msg)
|
||||
static int s3c_spi_resume(struct platform_device *pdev)
|
||||
{
|
||||
struct s3c_spi *hw = platform_get_drvdata(pdev);
|
||||
DEBUG;
|
||||
clk_enable(hw->clk);
|
||||
|
||||
s3c_spi_wifi_if_on();
|
||||
@@ -1293,16 +1666,20 @@ static struct platform_driver s3c_spi_driver = {
|
||||
|
||||
static int __init s3c_spi_driver_init(void)
|
||||
{
|
||||
printk(KERN_INFO "S3C2443 HSPI Driver \n");
|
||||
// printk("s3c_spi_driver_init()\n");
|
||||
DEBUG;
|
||||
|
||||
s3c_spi_wifi_if_on();
|
||||
|
||||
printk("platform_bus_type=%s\n",platform_bus_type.name);
|
||||
return platform_driver_register(&s3c_spi_driver);
|
||||
}
|
||||
|
||||
|
||||
static void __exit s3c_spi_driver_exit(void)
|
||||
{
|
||||
printk("s3c_spi_driver_exit()++\n");
|
||||
s3c_spi_wifi_if_off();
|
||||
platform_driver_unregister(&s3c_spi_driver);
|
||||
printk("s3c_spi_driver_exit()--\n");
|
||||
}
|
||||
|
||||
module_init(s3c_spi_driver_init);
|
||||
|
||||
@@ -105,9 +105,159 @@ struct s3c_spi {
|
||||
struct resource *ioarea;
|
||||
struct spi_dev spidev;
|
||||
|
||||
/* GeorgeKuo: */
|
||||
struct completion comp;
|
||||
/* GeorgeKuo: */
|
||||
struct completion comp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef unsigned char int8;
|
||||
typedef signed short int16;
|
||||
typedef signed int int32;
|
||||
|
||||
|
||||
typedef unsigned char uchar;
|
||||
//typedef unsigned short ushort;
|
||||
//typedef unsigned int uint;
|
||||
//typedef unsigned long ulong;
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define BCM_MEM_FILENAME_LEN 24
|
||||
|
||||
typedef void (*pktfree_cb_fn_t)(void *ctx, void *pkt, unsigned int status);
|
||||
typedef struct {
|
||||
bool pkttag;
|
||||
uint pktalloced;
|
||||
bool mmbus;
|
||||
pktfree_cb_fn_t tx_fn;
|
||||
void *tx_ctx;
|
||||
} osl_pubinfo_t;
|
||||
|
||||
typedef struct bcm_mem_link {
|
||||
struct bcm_mem_link *prev;
|
||||
struct bcm_mem_link *next;
|
||||
uint size;
|
||||
int line;
|
||||
char file[BCM_MEM_FILENAME_LEN];
|
||||
} bcm_mem_link_t;
|
||||
|
||||
struct osl_info {
|
||||
osl_pubinfo_t pub;
|
||||
uint magic;
|
||||
void *pdev;
|
||||
uint malloced;
|
||||
uint failed;
|
||||
uint bustype;
|
||||
bcm_mem_link_t *dbgmem_list;
|
||||
};
|
||||
|
||||
|
||||
/* Maximum number of I/O funcs */
|
||||
#define SPI_MAX_IOFUNCS 4
|
||||
|
||||
#define NUM_PREV_TRANSACTIONS 16
|
||||
|
||||
|
||||
/* Error statistics for gSPI */
|
||||
struct spierrstats_t {
|
||||
uint32 dna; /* The requested data is not available. */
|
||||
uint32 rdunderflow; /* FIFO underflow happened due to current (F2, F3) rd command */
|
||||
uint32 wroverflow; /* FIFO underflow happened due to current (F1, F2, F3) wr command */
|
||||
|
||||
uint32 f2interrupt; /* OR of all F2 related intr status bits. */
|
||||
uint32 f3interrupt; /* OR of all F3 related intr status bits. */
|
||||
|
||||
uint32 f2rxnotready; /* F2 FIFO is not ready to receive data (FIFO empty) */
|
||||
uint32 f3rxnotready; /* F3 FIFO is not ready to receive data (FIFO empty) */
|
||||
|
||||
uint32 hostcmddataerr; /* Error in command or host data, detected by CRC/checksum
|
||||
* (optional)
|
||||
*/
|
||||
uint32 f2pktavailable; /* Packet is available in F2 TX FIFO */
|
||||
uint32 f3pktavailable; /* Packet is available in F2 TX FIFO */
|
||||
|
||||
uint32 dstatus[NUM_PREV_TRANSACTIONS]; /* dstatus bits of last 16 gSPI transactions */
|
||||
uint32 spicmd[NUM_PREV_TRANSACTIONS];
|
||||
};
|
||||
|
||||
typedef struct osl_info osl_t;
|
||||
typedef void (*sdioh_cb_fn_t)(void *);
|
||||
struct sdioh_info {
|
||||
uint cfg_bar; /* pci cfg address for bar */
|
||||
uint32 caps; /* cached value of capabilities reg */
|
||||
void *bar0; /* BAR0 for PCI Device */
|
||||
osl_t *osh; /* osh handler */
|
||||
void *controller; /* Pointer to SPI Controller's private data struct */
|
||||
|
||||
uint lockcount; /* nest count of spi_lock() calls */
|
||||
bool client_intr_enabled; /* interrupt connnected flag */
|
||||
bool intr_handler_valid; /* client driver interrupt handler valid */
|
||||
sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
|
||||
void *intr_handler_arg; /* argument to call interrupt handler */
|
||||
bool initialized; /* card initialized */
|
||||
uint32 target_dev; /* Target device ID */
|
||||
uint32 intmask; /* Current active interrupts */
|
||||
void *sdos_info; /* Pointer to per-OS private data */
|
||||
|
||||
uint32 controller_type; /* Host controller type */
|
||||
uint8 version; /* Host Controller Spec Compliance Version */
|
||||
uint irq; /* Client irq */
|
||||
uint32 intrcount; /* Client interrupts */
|
||||
uint32 local_intrcount; /* Controller interrupts */
|
||||
bool host_init_done; /* Controller initted */
|
||||
bool card_init_done; /* Client SDIO interface initted */
|
||||
bool polled_mode; /* polling for command completion */
|
||||
|
||||
bool sd_use_dma; /* DMA on CMD53 */
|
||||
bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
|
||||
/* Must be on for sd_multiblock to be effective */
|
||||
bool use_client_ints; /* If this is false, make sure to restore */
|
||||
/* polling hack in wl_linux.c:wl_timer() */
|
||||
int adapter_slot; /* Maybe dealing with multiple slots/controllers */
|
||||
int sd_mode; /* SD1/SD4/SPI */
|
||||
int client_block_size[SPI_MAX_IOFUNCS]; /* Blocksize */
|
||||
uint32 data_xfer_count; /* Current transfer */
|
||||
uint16 card_rca; /* Current Address */
|
||||
uint8 num_funcs; /* Supported funcs on client */
|
||||
uint32 card_dstatus; /* 32bit device status */
|
||||
uint32 com_cis_ptr;
|
||||
uint32 func_cis_ptr[SPI_MAX_IOFUNCS];
|
||||
void *dma_buf;
|
||||
ulong dma_phys;
|
||||
int r_cnt; /* rx count */
|
||||
int t_cnt; /* tx_count */
|
||||
uint32 wordlen; /* host processor 16/32bits */
|
||||
uint32 prev_fun;
|
||||
uint32 chip;
|
||||
uint32 chiprev;
|
||||
bool resp_delay_all;
|
||||
bool dwordmode;
|
||||
|
||||
struct spierrstats_t spierrstats;
|
||||
};
|
||||
typedef struct sdioh_info sdioh_info_t;
|
||||
|
||||
void spi_sendrecv(sdioh_info_t *sd, uint8 *msg_out, uint8 *msg_in, int msglen);
|
||||
|
||||
void ClearSourcePenging(void);
|
||||
void ClearIntrPenging(void);
|
||||
void S3cEnableIntr(void);
|
||||
void S3cDisableIntr(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _S3C6400_SPI_H */
|
||||
|
||||
@@ -220,8 +220,10 @@ static ssize_t spidev_write (struct file *file, const char __user *buf, size_t c
|
||||
#endif
|
||||
if (count > BUFFER_SIZE)
|
||||
count = BUFFER_SIZE;
|
||||
|
||||
|
||||
if(spi_dev->flags & SPI_M_DMA_MODE){
|
||||
printk("********USE DMA MODE*********\n");
|
||||
|
||||
tmp = dma_alloc_coherent(NULL, BUFFER_SIZE,
|
||||
&spi_dev->dmabuf, GFP_KERNEL | GFP_DMA);
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ struct spi_algorithm {
|
||||
extern int spi_attach_spidev(struct spi_dev *);
|
||||
extern int spi_detach_spidev(struct spi_dev *);
|
||||
|
||||
extern struct spi_dev *spi_dev_get_by_minor(unsigned index);
|
||||
|
||||
/*
|
||||
* SPI Message - used for pure spi transaction, also from /dev interface
|
||||
*/
|
||||
|
||||
@@ -2058,10 +2058,12 @@ static int do_verify(struct fsg_dev *fsg)
|
||||
static int do_inquiry(struct fsg_dev *fsg, struct fsg_buffhd *bh)
|
||||
{
|
||||
u8 *buf = (u8 *) bh->buf;
|
||||
|
||||
static char vendor_id[] = "Linux ";
|
||||
static char product_id[] = "File-Stor Gadget";
|
||||
|
||||
/* Qisda, howard.hsu, 2010/01/26, change usb device name { */
|
||||
//static char vendor_id[] = "Linux ";
|
||||
//static char product_id[] = "File-Stor Gadget";
|
||||
static char vendor_id[] = "e-Book ";
|
||||
static char product_id[] = "Reader";
|
||||
/* } Qisda, howard.hsu, 2010/01/26, change usb device name */
|
||||
if (!fsg->curlun) { // Unsupported LUNs are okay
|
||||
fsg->bad_lun_okay = 1;
|
||||
memset(buf, 0, 36);
|
||||
|
||||
@@ -128,9 +128,7 @@ static void reconfig_usbd(void);
|
||||
/*send key code F6 1 when USB plugin*/
|
||||
/*send key code F6 0 when USB unplugin*/
|
||||
/*send key code F6 0 when USB safety remove USB{*/
|
||||
#ifdef QISDA
|
||||
void USB_SaftRemove_keypad_message_to_ap(uint uiSleep)
|
||||
#endif
|
||||
//void USB_SaftRemove_keypad_message_to_ap(uint uiSleep);
|
||||
/*}Qisda,Leo SJ Yang,2009/10/26*/
|
||||
static __inline__ u32 usb_read(u32 port, u8 ind)
|
||||
{
|
||||
@@ -299,8 +297,10 @@ static void udc_disable(struct s3c_udc *dev)
|
||||
__raw_writel((0<<31)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
//#elif CONFIG_QISDA_AS090B00_EVT1
|
||||
#else
|
||||
if((readl(S3C2410_GPHDAT) &&(1<<11))==0)
|
||||
/* Qisda, 2009/12/29, Howard Hsu, fix condition error */
|
||||
if((readl(S3C2410_GPHDAT)&(1<<11))==0)
|
||||
{
|
||||
printk("turn-off USB_GPH14 power\n");
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 0);
|
||||
/* usb clock disable */
|
||||
@@ -425,7 +425,7 @@ static int udc_enable(struct s3c_udc *dev)
|
||||
/*Qisda,Leo SJ Yang,2009/09/09{*/
|
||||
/*Fixed 3G module can not work after running Mass storage*/
|
||||
// __raw_writel((0<<3)|(1<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
|
||||
__raw_writel((0<<3)|(0<<2)|(0<<1)|(0<<0), S3C_PHYCTRL);
|
||||
__raw_writel((0<<3)|(0<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
|
||||
/*}Qisda,Leo SJ Yang,2009/09/09*/
|
||||
/*Fixed 3G module can not work after running Mass storage*/
|
||||
/* 48Mhz clock on ,PHY2.0 analog block power on
|
||||
@@ -455,8 +455,12 @@ static int udc_enable(struct s3c_udc *dev)
|
||||
*/
|
||||
/*Qisda,Leo SJ Yang,2009/09/09{*/
|
||||
/*Fixed 3G module can not work after running Mass storage*/
|
||||
/*Qisda Leo SJ Yang 2009/12/10*/
|
||||
/*Fix the issue, the 3G can not work after playing audio{*/
|
||||
//__raw_writel((1<<31)|(1<<2)|(0<<1)|(1<<0), S3C_UCLKCON);
|
||||
__raw_writel((1<<31)|(1<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
__raw_writel((1<<31)|(1<<4)|(1<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
/*}Qisda Leo SJ Yang 2009/12/10*/
|
||||
/*Fix the issue, the 3G can not work after playing audio*/
|
||||
/*}Qisda,Leo SJ Yang,2009/09/09*/
|
||||
/*Fixed 3G module can not work after running Mass storage*/
|
||||
|
||||
@@ -1127,10 +1131,8 @@ static irqreturn_t s3c_udc_irq(int irq, void *_dev)
|
||||
/*send key code F6 0 when USB safety remove USB{*/
|
||||
/*Qisda,Leo SJ Yang,2009/11/13*/
|
||||
/*prevent from sending saftremove event to MMI when the event to be occured is not the action of saftremove{*/
|
||||
#ifdef QISDA
|
||||
if((intr_status&S3C_UDC_INT_VBUSON)==0)
|
||||
USB_SaftRemove_keypad_message_to_ap(0);
|
||||
#endif
|
||||
//if((intr_status&S3C_UDC_INT_VBUSON)==0)
|
||||
//USB_SaftRemove_keypad_message_to_ap(0);
|
||||
/*}Qisda,Leo SJ Yang,2009/11/13*/
|
||||
#endif
|
||||
/*}Qisda,Leo SJ Yang,2009/08/26 set g_EMUSBTestIsOK=0 when uplug USB*/
|
||||
@@ -1797,9 +1799,8 @@ static void s3c_ep0_setup(struct s3c_udc *dev, u32 csr)
|
||||
/*Qisda,Leo SJ Yang,2009/07/28 add /proc/driver/udc for EM mode{*/
|
||||
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
|
||||
g_EMUSBTestIsOK=1;
|
||||
#ifdef QISDA
|
||||
USB_SaftRemove_keypad_message_to_ap(1);
|
||||
#endif
|
||||
//USB_SaftRemove_keypad_message_to_ap(1);
|
||||
|
||||
|
||||
#endif
|
||||
/*}Qisda,Leo SJ Yang,2009/07/28 add /proc/driver/udc for EM mode*/
|
||||
@@ -2191,7 +2192,17 @@ static int s3c_udc_ioctl(struct inode *inode, struct file *file, unsigned int cm
|
||||
s3c_UDC_power_off = 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_PM_PLATFORM_POWER_SAVING
|
||||
//{Benq,Andy add for USB power disable, even when VBUS_IN_STA is on
|
||||
else if(arg == 5)
|
||||
{
|
||||
printk("\nUSB_UDC_DEVICE_POWER_DOWN\n");
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 0); /* usb all power disable (USB_EN20)*/
|
||||
}
|
||||
//}Benq,Andy add for USB power disable, even when VBUS_IN_STA is on
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/usb-control.h>
|
||||
#include <asm/arch/regs-gpio.h>
|
||||
#include <asm/arch/regs-udc-hs.h>
|
||||
#include <linux/major.h> //Qisda, Leo SJ Yang, 2009/08/31, for 3G power
|
||||
|
||||
#if defined(CONFIG_CPU_S3C6400)
|
||||
@@ -32,6 +33,7 @@
|
||||
#elif defined(CONFIG_CPU_S3C6410)
|
||||
#include <asm/arch/regs-s3c6410-clock.h>
|
||||
#endif
|
||||
#include <asm/arch/regs-s3c2416-clock.h>
|
||||
|
||||
#define USB_HOST_PORT2_EN 0
|
||||
/*Qisda,Leo SJ Yang,2009/09/09{*/
|
||||
@@ -46,6 +48,10 @@ extern char g_EMUSBTestIsOK;
|
||||
#include <asm/arch/regs-usb-otg-hs.h>
|
||||
#endif
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
#include <../include/asm-arm/plat-s3c24xx/common-smdk.h>
|
||||
extern int board_id;
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
#define valid_port(idx) ((idx) == 1 || (idx) == 2)
|
||||
|
||||
@@ -408,6 +414,106 @@ static int s3c_3G_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*Qisda Leo SJ Yang,2009/12/10*/
|
||||
/*Fix the issue, the 3G can not work after playing audio{*/
|
||||
static int usb20_phy_init(void)
|
||||
{
|
||||
long reg=0;
|
||||
#if 0
|
||||
s3c2410_gpio_pullup(S3C2443_GPH14, 2); /* usb power pull-up enable */
|
||||
s3c2410_gpio_pullup(S3C2410_GPF2, 0); /* vbus detect pull-up/down disable */
|
||||
s3c2410_gpio_cfgpin(S3C2443_GPH14, S3C2443_GPH14_OUTP);
|
||||
s3c2410_gpio_setpin(S3C2443_GPH14, 1); /* usb power enbale */
|
||||
#endif
|
||||
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<29)) | 1<<28), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<14), S3C2410_GPHDAT);
|
||||
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) &~(1<<8), S3C2410_GPHDAT);
|
||||
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<23)) | 1<<22), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) &~(1<<11), S3C2410_GPHDAT);
|
||||
writel(((readl(S3C2410_GPGCON) & ~(1<<7)) | 1<<6), S3C2410_GPGCON);
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel(readl(S3C2410_GPGDAT) |(1<<3), S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
//s3c2410_gpio_pullup(S3C2410_GPG3, 2); /* usb power enbale */
|
||||
|
||||
//mdelay(100);
|
||||
/*2009/10/21 ,Qisda,Leo SJ Yang*/
|
||||
/*3G will voltage over 3.6V if charging capcity for 100 msec*/
|
||||
/*change the time of charging from 100 msec to 65 msec{*/
|
||||
mdelay(65);
|
||||
/*}2009/10/21 ,Qisda,Leo SJ Yang*/
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<11), S3C2410_GPHDAT);
|
||||
s3c2410_gpio_pullup(S3C2410_GPH11, 2); /* usb power enbale */
|
||||
|
||||
mdelay(1);
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
//s3c2410_gpio_pullup(S3C2410_GPG3, 1); /* usb power enbale */
|
||||
|
||||
mdelay(1);
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
|
||||
s3c2410_gpio_pullup(S3C2410_GPH8, 2); /* usb power enbale */
|
||||
s3c2410_gpio_pullup(S3C2410_GPH9, 2); /* usb power enbale */
|
||||
#if 0
|
||||
/* if reset by sleep wakeup, control the retention I/O cell */
|
||||
if (readl(S3C_RSTSTAT) & 0x8)
|
||||
writel(readl(S3C_RSTCON)|(1<<16), S3C_RSTCON);
|
||||
|
||||
/* USB Port is Normal mode */
|
||||
writel(readl(S3C2410_MISCCR)&~(1<<12), S3C2410_MISCCR);
|
||||
|
||||
/* PHY power enable */
|
||||
writel(readl(S3C_PWRCFG)|(1<<4), S3C_PWRCFG);
|
||||
|
||||
/* USB device 2.0 must reset like bellow,
|
||||
* 1st phy reset and after at least 10us, func_reset & host reset
|
||||
* phy reset can reset bellow registers.
|
||||
*/
|
||||
/* PHY 2.0 S/W reset */
|
||||
writel((1<<1)|(0<<0), S3C_URSTCON);
|
||||
mdelay(1); /* phy reset must be asserted for at 10us */
|
||||
|
||||
/*Function 2.0, Host 1.1 S/W reset*/
|
||||
writel((0<<1)|(1<<0), S3C_URSTCON);
|
||||
writel((0<<1)|(0<<0), S3C_URSTCON);
|
||||
|
||||
/* 48Mhz,Oscillator,External X-tal,device */
|
||||
writel((0<<3)|(1<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
|
||||
/* 48Mhz clock on ,PHY2.0 analog block power on
|
||||
* XO block power on,XO block power in suspend mode,
|
||||
* PHY 2.0 Pll power on ,suspend signal for save mode disable
|
||||
*/
|
||||
writel((1<<31)|(0<<4)|(0<<3)|(0<<2)|(0<<1)|(0<<0), S3C_PHYPWR);
|
||||
|
||||
/* D+ pull up disable(VBUS detect), USB2.0 Function clock Disable,
|
||||
* USB1.1 HOST Enable, USB2.0 PHY test enable
|
||||
*/
|
||||
//__raw_writel((0<<31)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
//__raw_writel((1<<31)|(1<<4)|(0<<2)|(1<<1)|(1<<0), S3C_UCLKCON);
|
||||
#endif
|
||||
//writel((0<<3)|(1<<2)|(1<<1)|(0<<0), S3C_PHYCTRL);
|
||||
reg=readl(S3C_PHYCTRL);
|
||||
reg|=(1<<1);
|
||||
writel(reg, S3C_PHYCTRL);
|
||||
reg=readl(S3C_UCLKCON);
|
||||
reg|=(1<<4);
|
||||
writel(reg, S3C_UCLKCON);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/*}Qisda Leo SJ Yang 2009/12/10 2009/12/10*/
|
||||
/*Fix the issue, the 3G can not work after playing audio*/
|
||||
static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
int retval;
|
||||
@@ -425,8 +531,10 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
|
||||
USB_3G_POWER_SAVING = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
/*Qisda Leo SJ Yang, 2009/12/10*/
|
||||
/*Fix the issue, the 3G can not work after playing audio{*/
|
||||
#if 0
|
||||
#ifdef CONFIG_QISDA_E600_EVT2
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<29)) | 1<<28), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<14), S3C2410_GPHDAT);
|
||||
@@ -469,7 +577,10 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
|
||||
writel(readl(S3C2410_GPHDAT) &~(1<<11), S3C2410_GPHDAT);
|
||||
writel(((readl(S3C2410_GPGCON) & ~(1<<7)) | 1<<6), S3C2410_GPGCON);
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel(readl(S3C2410_GPGDAT) |(1<<3), S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
//s3c2410_gpio_pullup(S3C2410_GPG3, 2); /* usb power enbale */
|
||||
|
||||
//mdelay(100);
|
||||
@@ -483,16 +594,23 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
|
||||
|
||||
mdelay(1);
|
||||
|
||||
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel(readl(S3C2410_GPGDAT) &~(1<<3), S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
//s3c2410_gpio_pullup(S3C2410_GPG3, 1); /* usb power enbale */
|
||||
|
||||
mdelay(1);
|
||||
writel(((readl(S3C2410_GPHCON) & ~(1<<17)) | 1<<16), S3C2410_GPHCON);
|
||||
writel(readl(S3C2410_GPHDAT) |(1<<8), S3C2410_GPHDAT);
|
||||
s3c2410_gpio_pullup(S3C2410_GPH8, 2); /* usb power enbale */
|
||||
|
||||
s3c2410_gpio_pullup(S3C2410_GPH9, 2); /* usb power enbale */
|
||||
#endif //CONFIG_QISDA_AS090B00_EVT1_1
|
||||
|
||||
#endif
|
||||
usb20_phy_init();
|
||||
/*}Qisda Leo SJ Yang 2009/12/10*/
|
||||
/*Fix the issue,the 3G can not work after playing audio*/
|
||||
s3c_3Gpower_off = 0;
|
||||
if(g_phcd==NULL)
|
||||
{
|
||||
@@ -594,7 +712,12 @@ static int s3c_3G_ioctl(struct inode *inode, struct file *file, unsigned int cmd
|
||||
#if defined(CONFIG_QISDA_AS090B00_EVT1_1)|| defined(CONFIG_QISDA_QD090B00_EVT1)
|
||||
writel((readl(S3C2410_GPHDAT)&~(1<<11)),S3C2410_GPHDAT);
|
||||
writel(readl(S3C2410_GPHDAT)&~(1<<8), S3C2410_GPHDAT);
|
||||
writel((readl(S3C2410_GPGDAT)&~(1<<3)),S3C2410_GPGDAT);
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel((readl(S3C2410_GPGDAT)&~(1<<3)),S3C2410_GPGDAT);
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
|
||||
s3c2410_gpio_pullup(S3C2410_GPH11, 1); /* usb power enbale */
|
||||
s3c2410_gpio_pullup(S3C2410_GPH8, 1); /* usb power enbale */
|
||||
#endif
|
||||
@@ -745,7 +868,11 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
|
||||
|
||||
writel((readl(S3C2410_GPHDAT)&~(1<<11)),S3C2410_GPHDAT); //on/off
|
||||
writel(readl(S3C2410_GPHDAT)&~(1<<8), S3C2410_GPHDAT);//disable
|
||||
writel(readl(S3C2410_GPGDAT)&~(1<<3), S3C2410_GPGDAT);//audio reset
|
||||
|
||||
/*Qisda , wenny cheng , 20091224 , board id info {*/
|
||||
if(board_id==QD090B00_S02)
|
||||
writel(readl(S3C2410_GPGDAT)&~(1<<3), S3C2410_GPGDAT);//audio reset
|
||||
/*Qisda , wenny cheng , 20091224 , board id info }*/
|
||||
#endif
|
||||
|
||||
if (register_chrdev (S3C_3G_MAJOR, "s3c_3G_cmd", &s3c_3G_fops)) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -78,7 +78,9 @@
|
||||
|
||||
#define AUOFB_IOCTL_SHOW_PROGRESS_BAR 0xFFE0
|
||||
#define AUOFB_IOCTL_CLEAN_EPD 0xFFE1
|
||||
|
||||
/* Qisda, Howard Hsu, 2010/01/11, Add show image ioctrl { */
|
||||
#define AUOFB_IOCTL_SHOW_IMAGE 0xFFE2
|
||||
/* } Qisda, Howard Hsu, 2010/01/11, Add show image ioctrl */
|
||||
#define EPD_DEVICE_POWER_STATE AUOFB_IOCTL_TCON_POWER_STATE
|
||||
|
||||
enum {
|
||||
@@ -411,5 +413,6 @@ extern int auo_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long ar
|
||||
|
||||
extern void auofb_activate_var(struct auo_fb_info *fbi, struct fb_var_screeninfo *var);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,6 +44,8 @@ typedef enum
|
||||
#define AUO_EPAPER_CMD_RESET 0x1005
|
||||
#define AUO_EPAPER_CMD_ROTATION 0x1006
|
||||
#define AUO_EPAPER_CMD_LUT_STOP 0x1009
|
||||
#define AUO_EPAPER_CMD_PRE_DISPLAY_START 0x100D
|
||||
#define AUO_EPAPER_CMD_PRE_DISPLAY_STOP 0x100F
|
||||
|
||||
#define AUO_EPAPER_CMD_FLASH_W 0x2000
|
||||
#define AUO_EPAPER_CMD_FLASH_E 0x2001
|
||||
@@ -89,10 +91,9 @@ typedef struct T_DISPLAY_FRAME_TAG
|
||||
unsigned short* pFrameData;
|
||||
} T_DISPLAY_FRAME, *T_DISPLAY_FRAME_P;
|
||||
|
||||
|
||||
//functions
|
||||
void Epaper_SetLcdPort(void);
|
||||
DispErrorCode_t Epaper_Disp(T_DISPLAY_FRAME tFrame);
|
||||
int Epaper_Disp(T_DISPLAY_FRAME tFrame);
|
||||
int is_Epaper_Write_Ready(void);
|
||||
int is_Epaper_Write_Ready_No_Wait(void);
|
||||
int is_Epaper_Write_Ready_Wait(unsigned long waitTime); //ms
|
||||
@@ -102,15 +103,17 @@ void Epaper_Set_Resolution(int h_res, int v_res);
|
||||
void Epaper_Enter_Standby_Mode(int isEnter);
|
||||
void Epaper_Enter_Sleep_Mode(int isEnter);
|
||||
void Epaper_Power(int isEnable);
|
||||
int Epaper_Init(int h_Res, int v_Res, int rotation, int data_inverse, int inputdata_arrangement, int outputdata_arrangement,int UD, int SHL);
|
||||
int Epaper_Init(int h_Res, int v_Res, int temp_ave, int data_filter, int rotation, int data_inverse, int inputdata_arrangement, int outputdata_arrangement,int UD, int SHL);
|
||||
void EPaper_CloseLcdPort(void);
|
||||
void Epaper_Read_R_TEMP(unsigned short* val0, unsigned short* val1, unsigned short* val2, unsigned short* val3);
|
||||
void Epaper_Display_Refresh(void);
|
||||
int Epaper_Update_LUT(unsigned short* u16LUT, unsigned long u32LUTLength);
|
||||
void Epaper_Read_LUT(unsigned short* u16LUT, unsigned long u32LUTLength);
|
||||
int Epaper_Read_LUT(unsigned short* u16LUT, unsigned long u32LUTLength);
|
||||
void Epaper_Reset(void);
|
||||
void Epaper_Clean_Panel(void);
|
||||
void Epaper_Show_Progress(int percent);
|
||||
int Epaper_Pre_DMA_Disp_Start(T_DISPLAY_FRAME tFrame);
|
||||
int Epaper_Pre_DMA_Disp_Stop(T_DISPLAY_FRAME tFrame);
|
||||
#ifdef EPAPER_BOOT_CODE
|
||||
|
||||
#else //KERNEL
|
||||
|
||||
@@ -30,15 +30,20 @@ config LOGO_LINUX_LANDSCAPED_CLUT224
|
||||
depends on LOGO
|
||||
default y
|
||||
|
||||
config LOGO_LINUX_SH060B00_6_INCH_CLUT224
|
||||
bool "SH060B00 224-color Linux logo, 6 inch"
|
||||
depends on LOGO && FB_AUOEPAPER_6
|
||||
default n
|
||||
|
||||
config LOGO_LINUX_CUSTOMER_6_INCH_CLUT224
|
||||
bool "Customer 224-color Linux logo, 6 inch"
|
||||
depends on LOGO && FB_AUOEPAPER_6
|
||||
default y
|
||||
default n
|
||||
|
||||
config LOGO_LINUX_CUSTOMER_9_INCH_CLUT224
|
||||
bool "Customer 224-color Linux logo, 9 inch"
|
||||
depends on LOGO && FB_AUOEPAPER_9
|
||||
default y
|
||||
default n
|
||||
|
||||
config LOGO_DEC_CLUT224
|
||||
bool "224-color Digital Equipment Corporation Linux logo"
|
||||
|
||||
@@ -5,8 +5,9 @@ obj-$(CONFIG_LOGO_LINUX_MONO) += logo_linux_mono.o
|
||||
obj-$(CONFIG_LOGO_LINUX_VGA16) += logo_linux_vga16.o
|
||||
obj-$(CONFIG_LOGO_LINUX_CLUT224) += logo_linux_clut224.o
|
||||
obj-$(CONFIG_LOGO_LINUX_LANDSCAPED_CLUT224) += logo_linux_landscaped_clut224.o
|
||||
obj-$(CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224) += logo_linux_customer_6_inch_clut224.o
|
||||
#obj-$(CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224) += logo_linux_customer_6_inch_clut224.o
|
||||
obj-$(CONFIG_LOGO_LINUX_CUSTOMER_9_INCH_CLUT224) += logo_linux_customer_9_inch_clut224.o
|
||||
obj-$(CONFIG_LOGO_LINUX_SH060B00_6_INCH_CLUT224) += logo_linux_sh060b00_6_inch_clut224.o
|
||||
obj-$(CONFIG_LOGO_DEC_CLUT224) += logo_dec_clut224.o
|
||||
obj-$(CONFIG_LOGO_MAC_CLUT224) += logo_mac_clut224.o
|
||||
obj-$(CONFIG_LOGO_PARISC_CLUT224) += logo_parisc_clut224.o
|
||||
@@ -16,6 +17,17 @@ obj-$(CONFIG_LOGO_SUPERH_MONO) += logo_superh_mono.o
|
||||
obj-$(CONFIG_LOGO_SUPERH_VGA16) += logo_superh_vga16.o
|
||||
obj-$(CONFIG_LOGO_SUPERH_CLUT224) += logo_superh_clut224.o
|
||||
obj-$(CONFIG_LOGO_M32R_CLUT224) += logo_m32r_clut224.o
|
||||
# Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00 {
|
||||
ifdef CONFIG_QISDA_BQ060B00
|
||||
ifndef CONFIG_RESCUEOS_BUILD
|
||||
obj-$(CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224) += logo_bq060b00_startup_6_inch_clut224.o
|
||||
else
|
||||
obj-$(CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224) += logo_bq060b00_rescueos_6_inch_clut224.o
|
||||
endif
|
||||
else
|
||||
obj-$(CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224) += logo_linux_customer_6_inch_clut224.o
|
||||
endif
|
||||
# } Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00
|
||||
|
||||
# How to generate logo's
|
||||
|
||||
|
||||
@@ -36,9 +36,24 @@ extern const struct linux_logo logo_superh_clut224;
|
||||
extern const struct linux_logo logo_m32r_clut224;
|
||||
|
||||
//20090819 Ivan
|
||||
extern const struct linux_logo logo_linux_customer_6_inch_clut224;
|
||||
//extern const struct linux_logo logo_linux_customer_6_inch_clut224;
|
||||
extern const struct linux_logo logo_linux_customer_9_inch_clut224;
|
||||
extern const struct linux_logo logo_linux_sh060b00_6_inch_clut224;
|
||||
//20090819 Ivan
|
||||
#ifdef CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224
|
||||
/* Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00 { */
|
||||
#ifdef CONFIG_QISDA_BQ060B00
|
||||
#ifdef CONFIG_RESCUEOS_BUILD
|
||||
extern const struct linux_logo logo_bq060b00_rescueos_6_inch_clut224;
|
||||
#else
|
||||
extern const struct linux_logo logo_bq060b00_startup_6_inch_clut224;
|
||||
#endif /* CONFIG_RESCUEOS_BUILD */
|
||||
#else
|
||||
extern const struct linux_logo logo_linux_customer_6_inch_clut224;
|
||||
#endif /* CONFIG_QISDA_BQ060B00 */
|
||||
#endif /* CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224 */
|
||||
/* } Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00 */
|
||||
|
||||
|
||||
const struct linux_logo *fb_find_logo(int depth)
|
||||
{
|
||||
@@ -112,12 +127,25 @@ const struct linux_logo *fb_find_logo(int depth)
|
||||
#endif
|
||||
|
||||
//20090819 Ivan
|
||||
/* Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00 { */
|
||||
#ifdef CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224
|
||||
#ifdef CONFIG_QISDA_BQ060B00
|
||||
#ifdef CONFIG_RESCUEOS_BUILD
|
||||
logo = &logo_bq060b00_rescueos_6_inch_clut224;
|
||||
#else
|
||||
logo = &logo_bq060b00_startup_6_inch_clut224;
|
||||
#endif
|
||||
#else
|
||||
logo = &logo_linux_customer_6_inch_clut224;
|
||||
#endif
|
||||
#endif /* CONFIG_QISDA_BQ060B00 */
|
||||
#endif /*CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224 */
|
||||
/* } Qisda, Howard Hsu, 2010/01/04, custom logo for BQ060B00 */
|
||||
#ifdef CONFIG_LOGO_LINUX_CUSTOMER_9_INCH_CLUT224
|
||||
logo = &logo_linux_customer_9_inch_clut224;
|
||||
#endif
|
||||
#ifdef CONFIG_LOGO_LINUX_SH060B00_6_INCH_CLUT224
|
||||
logo = &logo_linux_sh060b00_6_inch_clut224;
|
||||
#endif
|
||||
//20090819 Ivan
|
||||
}
|
||||
return logo;
|
||||
|
||||
28803
drivers/video/logo/logo_bq060b00_rescueos_6_inch_clut224.ppm
Executable file
28803
drivers/video/logo/logo_bq060b00_rescueos_6_inch_clut224.ppm
Executable file
File diff suppressed because it is too large
Load Diff
28803
drivers/video/logo/logo_bq060b00_startup_6_inch_clut224.ppm
Executable file
28803
drivers/video/logo/logo_bq060b00_startup_6_inch_clut224.ppm
Executable file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
28803
drivers/video/logo/logo_linux_sh060b00_6_inch_clut224.ppm
Normal file
28803
drivers/video/logo/logo_linux_sh060b00_6_inch_clut224.ppm
Normal file
File diff suppressed because it is too large
Load Diff
28803
drivers/video/logo/logo_st060b00is_startup_6_inch_clut224.ppm
Normal file
28803
drivers/video/logo/logo_st060b00is_startup_6_inch_clut224.ppm
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user