From 453f143580cd4880768bfc12ac72ecce0194501d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Oct 2010 14:39:20 +0800 Subject: [PATCH] add cmmb io init interface in board file. --- arch/arm/mach-rk2818/board-raho.c | 9 ++++++++- drivers/cmmb/siano/smscoreapi.c | 8 ++++---- drivers/cmmb/siano/smsspilog.c | 2 +- drivers/cmmb/siano/smsspiphy.h | 1 + drivers/cmmb/siano/smsspiphy_rk.c | 21 +++++++++++++-------- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-rk2818/board-raho.c b/arch/arm/mach-rk2818/board-raho.c index 777518adcd5f..d9d09c78c401 100755 --- a/arch/arm/mach-rk2818/board-raho.c +++ b/arch/arm/mach-rk2818/board-raho.c @@ -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[] = { diff --git a/drivers/cmmb/siano/smscoreapi.c b/drivers/cmmb/siano/smscoreapi.c index 71a47884e69e..52d8bc278896 100755 --- a/drivers/cmmb/siano/smscoreapi.c +++ b/drivers/cmmb/siano/smscoreapi.c @@ -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!!!!"); diff --git a/drivers/cmmb/siano/smsspilog.c b/drivers/cmmb/siano/smsspilog.c index 87a82c9af42d..3bfc915dce51 100755 --- a/drivers/cmmb/siano/smsspilog.c +++ b/drivers/cmmb/siano/smsspilog.c @@ -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); diff --git a/drivers/cmmb/siano/smsspiphy.h b/drivers/cmmb/siano/smsspiphy.h index c20cb05f3d82..392a6ed64f0a 100755 --- a/drivers/cmmb/siano/smsspiphy.h +++ b/drivers/cmmb/siano/smsspiphy.h @@ -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__ */ diff --git a/drivers/cmmb/siano/smsspiphy_rk.c b/drivers/cmmb/siano/smsspiphy_rk.c index 424e78189e6a..ade22ea577ea 100755 --- a/drivers/cmmb/siano/smsspiphy_rk.c +++ b/drivers/cmmb/siano/smsspiphy_rk.c @@ -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 } -- 2.34.1