add cmmb io init interface in board file.
authorroot <root@zyc-desktop.(none)>
Fri, 8 Oct 2010 06:39:20 +0000 (14:39 +0800)
committerroot <root@zyc-desktop.(none)>
Fri, 8 Oct 2010 09:49:02 +0000 (17:49 +0800)
arch/arm/mach-rk2818/board-raho.c
drivers/cmmb/siano/smscoreapi.c
drivers/cmmb/siano/smsspilog.c
drivers/cmmb/siano/smsspiphy.h
drivers/cmmb/siano/smsspiphy_rk.c

index 777518adcd5f1b23aaee2dcba76a57ad918f6252..d9d09c78c4016bb98e0ac0665712a2d1a2124125 100755 (executable)
@@ -1401,11 +1401,18 @@ static struct rk2818_spi_chip cmb_spi_chip = {
 
 #define CMMB_1186_SPIIRQ RK2818_PIN_PA6
 
+void cmmb_io_init_mux(void)
+{
+       rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, 0);
+
+}
+
 static struct cmmb_io_def_s cmmb_io = {
        .cmmb_pw_en = FPGA_PIO4_03,
        .cmmb_pw_dwn = FPGA_PIO2_09,
        .cmmb_pw_rst = FPGA_PIO2_06,
-       .cmmb_irq = RK2818_PIN_PA6
+       .cmmb_irq = RK2818_PIN_PA6,
+       .io_init_mux = cmmb_io_init_mux
 };
 
 static struct spi_board_info board_spi_devices[] = {
index 71a47884e69ec80e2644b6245e5724a806a3d88b..52d8bc2788969e1e4f7ad9d3980a1724ec3cbf80 100755 (executable)
@@ -593,10 +593,10 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
                //mdelay(5);
        }
     }//hzb test 0527
-    msleep(200);
+   // msleep(200);
     g_libdownload = true;
        
-               msleep(200);
+       //      msleep(200);
        while (size && rc >= 0) {
                struct SmsDataDownload_ST *DataMsg =
                                (struct SmsDataDownload_ST *) msg;
@@ -634,9 +634,9 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
 
        
        complete(&coredev->data_download_done);
-       msleep(200);
+       //msleep(200);
        g_libdownload = false;
-       msleep(200);
+//     msleep(200);
 // ¼ÓÈëÑÓʱ£¬·ÀÖ¹³õʼ»¯Ê§°Ü£¬ZYC
        msleep(2000);
 //printk("firmware is downloaded\n!!!!");
index 87a82c9af42dec6bd999e95a34485eb622de9ae7..3bfc915dce517708ca8db1f30446b092e5824c5b 100755 (executable)
@@ -296,7 +296,7 @@ static void spi_worker_thread(void *arg)
 
                //check if we lost msg, if so, recover
                if(g_Sms_MsgFound_Counter < g_Sms_Int_Counter){
-                       sms_err("we lost msg, probably becouse dma time out\n");
+               //      sms_err("we lost msg, probably becouse dma time out\n");
                        //for(i=0; i<16; i++)
                        {
                                //smsspi_common_transfer_msg(&spi_device->dev, NULL, 1);
index c20cb05f3d8259b9e847de3983ad7bbc3919b224..392a6ed64f0a60584421b690f6963022241cd517 100755 (executable)
@@ -41,5 +41,6 @@ int  smsspibus_ssp_resume(void* context);
        unsigned int cmmb_pw_dwn;
        unsigned int cmmb_pw_rst;
        unsigned int cmmb_irq;
+       void (*io_init_mux)(void);
 };
 #endif /* __SMS_SPI_PHY_H__ */
index 424e78189e6adfe1dfb99778a1c38603554ff19e..ade22ea577ea489f777aee8b3f1d2cb2cdf4855a 100755 (executable)
@@ -206,7 +206,7 @@ static irqreturn_t spibus_interrupt(int irq, void *context)
        u_irq_count ++;
     
 //     PDEBUG("INT counter = %d\n", u_irq_count);
-       printk("cmmb siano 1186 int\n");
+//     printk("cmmb siano 1186 int\n");
         sms_info("spibus_interrupt %d\n", u_irq_count);
     
        if (spiphy_dev->interruptHandler)
@@ -327,15 +327,15 @@ static void chip_poweron()
              mdelay(100);
                gpio_direction_output(cmmb_io_ctrl->cmmb_pw_en,1);
        //      gpio_set_value(CMMB_1186_POWER_ENABLE,GPIO_HIGH);
-               mdelay(500);
+               mdelay(200);
        //      gpio_set_value(CMMB_1186_POWER_DOWN,GPIO_HIGH);
                gpio_direction_output(cmmb_io_ctrl->cmmb_pw_dwn,1);
 
-               mdelay(500);
+               mdelay(200);
        //      gpio_set_value(CMMB_1186_POWER_RESET,GPIO_HIGH);
                gpio_direction_output(cmmb_io_ctrl->cmmb_pw_rst,1);
 
-               mdelay(500);
+               mdelay(200);
          
                printk("cmmb chip_poweron !!!!\n");
                }
@@ -454,11 +454,15 @@ static void request_cmmb_gpio()
     gpio_pull_updown(CMMB_1186_SPIIRQ,GPIOPullUp);
        printk("leave the request_cmmb_gpio\n");
        #endif
-
+#if 1
                int ret;
        
        if(cmmb_io_ctrl)
                {
+                       if(cmmb_io_ctrl->io_init_mux)
+                       cmmb_io_ctrl->io_init_mux();
+                       else
+                               printk("cmmb_io_ctrl->io_init_mux is null !!!!!!!\n");
                        ret = gpio_request(cmmb_io_ctrl->cmmb_pw_rst, NULL);
                        if (ret) {
                        printk("%s:failed to request CMMB_1186_POWER_RESET\n",__FUNCTION__);
@@ -478,7 +482,7 @@ static void request_cmmb_gpio()
                        //return ret;
                        }
 
-                       rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, 0);
+               //      rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, 0);
                        ret = gpio_request(cmmb_io_ctrl->cmmb_irq,"cmmb irq");
                        if (ret) {
                                //dev_err(&pdev->dev, "failed to request play key gpio\n");
@@ -490,11 +494,12 @@ static void request_cmmb_gpio()
                    gpio_pull_updown(cmmb_io_ctrl->cmmb_irq,GPIOPullUp);
                        printk("leave the request_cmmb_gpio\n");
                }
-
+#endif
 }
 
 static void release_cmmb_gpio()
 {
+#if 1
        if(cmmb_io_ctrl)
                {
                gpio_free(cmmb_io_ctrl->cmmb_pw_rst);
@@ -504,7 +509,7 @@ static void release_cmmb_gpio()
                cmmb_io_ctrl = NULL;
                printk("leave the release_cmmb_gpio\n");
                }
-
+#endif
 
 }