Exemple #1
0
static int sunxi_ohci_hcd_resume(struct device *dev)
{
	struct sunxi_hci_hcd *sunxi_ohci = NULL;
	struct usb_hcd *hcd = NULL;

	if(dev == NULL){
		DMSG_PANIC("ERR: Argment is invalid\n");
		return 0;
	}

	hcd = dev_get_drvdata(dev);
	if(hcd == NULL){
		DMSG_PANIC("ERR: hcd is null\n");
		return 0;
	}

	sunxi_ohci = dev->platform_data;
	if(sunxi_ohci == NULL){
		DMSG_PANIC("ERR: sunxi_ohci is null\n");
		return 0;
	}

	if(sunxi_ohci->probe == 0){
		DMSG_PANIC("ERR: sunxi_ohci is disable, can not resume\n");
		return 0;
	}

	if(sunxi_ohci->not_suspend){
		DMSG_INFO("[%s]: controller not suspend, need not resume\n", sunxi_ohci->hci_name);
#if defined (CONFIG_ARCH_SUN8IW6) || defined (CONFIG_ARCH_SUN9IW1)
		sunxi_ohci->hci_phy_ctrl(sunxi_ohci, 1);
#endif
		scene_unlock(&ohci_standby_lock[sunxi_ohci->usbc_no]);
		disable_wakeup_src(CPUS_USBMOUSE_SRC, 0);

#ifdef CONFIG_USB_HCD_ENHANCE
		if(sunxi_ohci->usbc_no == 1){
			atomic_set(&hci1_thread_scan_flag, 1);
		}

		if(sunxi_ohci->usbc_no == 3){
			atomic_set(&hci3_thread_scan_flag, 1);
		}
#endif
	}else{
		DMSG_INFO("[%s]: sunxi_ohci_hcd_resume\n", sunxi_ohci->hci_name);

#ifndef CONFIG_ARCH_SUN9IW1
#ifdef  SUNXI_USB_FPGA
		fpga_config_use_hci((__u32 __force)sunxi_ohci->sram_vbase);
#endif
#endif
		sunxi_start_ohci(sunxi_ohci);

		set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		ohci_finish_controller_resume(hcd);
	}

	return 0;
}
Exemple #2
0
void scene_set_eye(struct scene * scene, Vec3 position, Vec3 direction) {

	scene_lock(scene);
	scene->eye_pos = position;
	scene->eye_dir = direction;
	scene_unlock(scene);
}
Exemple #3
0
void scene_add_object(struct scene * scene, struct model * model, Mat4 matrix) {

	scene_lock(scene);
	if (scene->objects_len == scene->objects_size) {
		uint32_t old_size = scene->objects_size;
		uint32_t added = scene->objects_size / 2;
		scene->objects_size = old_size + added;
		scene->objects = realloc(scene->objects, scene->objects_size);
		memset(scene->objects + old_size, 0, added * sizeof(struct scene_object));
	}
	uint32_t i = scene->objects_len++;
	struct scene_object * obj = &scene->objects[i];

	obj->model_matrix = matrix;
	obj->model = model;

	obj->s.matrix_dirty = 1;
	obj->s.mesh_dirty = 1;

	scene->s.objects_dirty = 1;
	scene_unlock(scene);
}