Commit latest Qisda version and Bookeen's modification
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user