/***************************************************************************** * FUNCTION * smi_probe * DESCRIPTION * 1. Call smi_register to register SMI Device Number, allocate and Initial SMI cdev struct, call cdev_add. * 2. Call class_create and device_create to add SMI device to kerne. * 3. Call smi_common_init. * 4. Call mau_init. * PARAMETERS * param1 : [IN] struct platform_device *pdev * No used in this function. * RETURNS * Type: Integer. 0 mean success and others mean fail. ****************************************************************************/ static int smi_probe(struct platform_device *pdev) { struct device* smiDevice = NULL; if (NULL == pdev) { SMIERR("platform data missed"); return -ENXIO; } if (smi_register()) { dev_err(&pdev->dev,"register char failed\n"); return -EAGAIN; } pSmiClass = class_create(THIS_MODULE, "MTK_SMI"); if (IS_ERR(pSmiClass)) { int ret = PTR_ERR(pSmiClass); SMIERR("Unable to create class, err = %d", ret); return ret; } smiDevice = device_create(pSmiClass, NULL, smiDevNo, NULL, "MTK_SMI"); smi_common_init(); mau_init(); { MTK_MAU_CONFIG mau_disp; mau_disp.entry = 0; mau_disp.larb = 0; mau_disp.start = 0x20000000; mau_disp.end = 0xFFFFFFFF; mau_disp.virt = 1; mau_disp.port_msk = 0xFFFF; mau_disp.monitor_read = 1; mau_disp.monitor_write = 1; mau_config(&mau_disp); } #ifdef SMI_DEFAULT_VR { MTK_SMI_BWC_CONFIG p_conf; p_conf.b_reduce_command_buffer = 1; p_conf.scenario = SMI_BWC_SCEN_VR1066; smi_bwc_config(&p_conf); } #endif //dump_smi_register(); return 0; }
static int smi_probe(struct platform_device *pdev) { struct device* smiDevice = NULL; if (NULL == pdev) { SMIERR("platform data missed"); return -ENXIO; } if (smi_register()) { dev_err(&pdev->dev,"register char failed\n"); return -EAGAIN; } pSmiClass = class_create(THIS_MODULE, "MTK_SMI"); if (IS_ERR(pSmiClass)) { int ret = PTR_ERR(pSmiClass); SMIERR("Unable to create class, err = %d", ret); return ret; } smiDevice = device_create(pSmiClass, NULL, smiDevNo, NULL, "MTK_SMI"); smi_common_init(); #ifdef __MAU_SPC_ENABLE__ mau_init(); MTK_SPC_Init(&(pdev->dev)); #endif SMI_DBG_Init(); #ifdef __MAU_SPC_ENABLE__ //init mau to monitor mva 0~0x2ffff & 0x40000000~0xffffffff #if 0 { MTK_MAU_CONFIG cfg; int i; for( i=0 ; i < SMI_LARB_NR ; i++) { cfg.larb = i; cfg.entry = 0; cfg.port_msk = 0xffffffff; cfg.virt = 1; cfg.monitor_read = 1; cfg.monitor_write = 1; cfg.start = 0; cfg.end = 0x2ffff; mau_config(&cfg); cfg.entry = 1; cfg.start = 0x40000000; cfg.end = 0xffffffff; mau_config(&cfg); } } #endif #endif return 0; }