add cmmb io init interface in board file.

This commit is contained in:
root 2010-10-08 14:39:20 +08:00
parent 7c57afa2f1
commit 453f143580
5 changed files with 27 additions and 14 deletions

View File

@ -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[] = {

View File

@ -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!!!!");

View File

@ -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);

View File

@ -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__ */

View File

@ -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
}