int smi_common_init(void) { int i; /* for( i=0 ; i < SMI_LARB_NR ; i++) { pLarbRegBackUp[i] = (unsigned int*)kmalloc(LARB_BACKUP_REG_SIZE, GFP_KERNEL|__GFP_ZERO); if(pLarbRegBackUp[i]==NULL) { SMIERR("pLarbRegBackUp kmalloc fail %d \n", i); } } */ /** make sure all larb power is on before we register callback func. then, when larb power is first off, default register value will be backed up. **/ for( i=0 ; i < SMI_LARB_NR ; i++) { larb_clock_on(i); } register_larb_monitor(&larb_monitor_handler); for( i=0 ; i < SMI_LARB_NR ; i++) { larb_clock_off(i); } return 0; }
/***************************************************************************** * FUNCTION * smi_common_init * DESCRIPTION * Allocate register backup memory. * PARAMETERS * None. * RETURNS * Type: Integer. always zero. ****************************************************************************/ int smi_common_init(void) { int i; for(i=0; i<SMI_LARB_NR; i++) { pLarbRegBackUp[i] = (unsigned int*)kmalloc(LARB_BACKUP_REG_SIZE, GFP_KERNEL|__GFP_ZERO); if(pLarbRegBackUp[i]==NULL) { SMIERR("pLarbRegBackUp kmalloc fail %d \n", i); } } register_larb_monitor(&larb_monitor_handler); return 0; }