Ejemplo n.º 1
0
/*--------------------------------------- API ---------------------------------------*/
int vo_i2c_proc(int id,unsigned int addr,unsigned int index,char *pdata,int len)
{
    swi2c_handle_t *handle = 0;
    int ret = 0;

    switch(id) {
    case 1:	// dvi
        if( lvds_get_enable() )	// share pin with LVDS
            return -1;

        handle = &vo_swi2c_dvi;
        break;
    default:
        break;
    }

    if( handle ) {
        if( wmt_swi2c_check(handle) ) {
            return -1;
        }

        if( addr & 0x1 ) {	// read
            *pdata = 0xff;
#ifdef CONFIG_WMT_EDID
            ret = wmt_swi2c_read(handle,addr & ~0x1,index,pdata,len);
#else
            ret = -1;
#endif
        }
        else {	// write
            DBG_ERR("not support sw i2c write\n");
        }
    }
    return ret;
}
Ejemplo n.º 2
0
/*!
* \brief
*       set VID mode
* \retval  0 if success
*/ 
int wmt_vid_i2c_read(int chipId ,unsigned int index) 
{
    char retval;

    if (vid_i2c_gpio_en)
    {
			wmt_swi2c_read( &vid_swi2c, chipId*2,  index, &retval, 1 );
    }else{
    wmt_vid_i2c_read_page( chipId ,index,&retval,1) ;   
    }

    
    return retval;
} /* End of wmt_vid_i2c_read() */