ftdi              195 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = kref_to_usb_ftdi(kref);
ftdi              196 drivers/usb/misc/ftdi-elan.c 	dev_warn(&ftdi->udev->dev, "FREEING ftdi=%p\n", ftdi);
ftdi              197 drivers/usb/misc/ftdi-elan.c 	usb_put_dev(ftdi->udev);
ftdi              198 drivers/usb/misc/ftdi-elan.c 	ftdi->disconnected += 1;
ftdi              200 drivers/usb/misc/ftdi-elan.c 	list_del_init(&ftdi->ftdi_list);
ftdi              203 drivers/usb/misc/ftdi-elan.c 	kfree(ftdi->bulk_in_buffer);
ftdi              204 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_buffer = NULL;
ftdi              207 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_put_kref(struct usb_ftdi *ftdi)
ftdi              209 drivers/usb/misc/ftdi-elan.c 	kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              212 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_get_kref(struct usb_ftdi *ftdi)
ftdi              214 drivers/usb/misc/ftdi-elan.c 	kref_get(&ftdi->kref);
ftdi              217 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_init_kref(struct usb_ftdi *ftdi)
ftdi              219 drivers/usb/misc/ftdi-elan.c 	kref_init(&ftdi->kref);
ftdi              222 drivers/usb/misc/ftdi-elan.c static void ftdi_status_requeue_work(struct usb_ftdi *ftdi, unsigned int delta)
ftdi              224 drivers/usb/misc/ftdi-elan.c 	if (!schedule_delayed_work(&ftdi->status_work, delta))
ftdi              225 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              228 drivers/usb/misc/ftdi-elan.c static void ftdi_status_queue_work(struct usb_ftdi *ftdi, unsigned int delta)
ftdi              230 drivers/usb/misc/ftdi-elan.c 	if (schedule_delayed_work(&ftdi->status_work, delta))
ftdi              231 drivers/usb/misc/ftdi-elan.c 		kref_get(&ftdi->kref);
ftdi              234 drivers/usb/misc/ftdi-elan.c static void ftdi_status_cancel_work(struct usb_ftdi *ftdi)
ftdi              236 drivers/usb/misc/ftdi-elan.c 	if (cancel_delayed_work_sync(&ftdi->status_work))
ftdi              237 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              240 drivers/usb/misc/ftdi-elan.c static void ftdi_command_requeue_work(struct usb_ftdi *ftdi, unsigned int delta)
ftdi              242 drivers/usb/misc/ftdi-elan.c 	if (!schedule_delayed_work(&ftdi->command_work, delta))
ftdi              243 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              246 drivers/usb/misc/ftdi-elan.c static void ftdi_command_queue_work(struct usb_ftdi *ftdi, unsigned int delta)
ftdi              248 drivers/usb/misc/ftdi-elan.c 	if (schedule_delayed_work(&ftdi->command_work, delta))
ftdi              249 drivers/usb/misc/ftdi-elan.c 		kref_get(&ftdi->kref);
ftdi              252 drivers/usb/misc/ftdi-elan.c static void ftdi_command_cancel_work(struct usb_ftdi *ftdi)
ftdi              254 drivers/usb/misc/ftdi-elan.c 	if (cancel_delayed_work_sync(&ftdi->command_work))
ftdi              255 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              258 drivers/usb/misc/ftdi-elan.c static void ftdi_response_requeue_work(struct usb_ftdi *ftdi,
ftdi              261 drivers/usb/misc/ftdi-elan.c 	if (!schedule_delayed_work(&ftdi->respond_work, delta))
ftdi              262 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              265 drivers/usb/misc/ftdi-elan.c static void ftdi_respond_queue_work(struct usb_ftdi *ftdi, unsigned int delta)
ftdi              267 drivers/usb/misc/ftdi-elan.c 	if (schedule_delayed_work(&ftdi->respond_work, delta))
ftdi              268 drivers/usb/misc/ftdi-elan.c 		kref_get(&ftdi->kref);
ftdi              271 drivers/usb/misc/ftdi-elan.c static void ftdi_response_cancel_work(struct usb_ftdi *ftdi)
ftdi              273 drivers/usb/misc/ftdi-elan.c 	if (cancel_delayed_work_sync(&ftdi->respond_work))
ftdi              274 drivers/usb/misc/ftdi-elan.c 		kref_put(&ftdi->kref, ftdi_elan_delete);
ftdi              279 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi              280 drivers/usb/misc/ftdi-elan.c 	ftdi->gone_away += 1;
ftdi              281 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_put_kref(ftdi);
ftdi              291 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_do_callback(struct usb_ftdi *ftdi,
ftdi              293 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_kick_command_queue(struct usb_ftdi *ftdi);
ftdi              294 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_kick_respond_queue(struct usb_ftdi *ftdi);
ftdi              295 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_setupOHCI(struct usb_ftdi *ftdi);
ftdi              296 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi);
ftdi              297 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_enumeratePCI(struct usb_ftdi *ftdi);
ftdi              298 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_synchronize(struct usb_ftdi *ftdi);
ftdi              299 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_stuck_waiting(struct usb_ftdi *ftdi);
ftdi              300 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_command_engine(struct usb_ftdi *ftdi);
ftdi              301 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi);
ftdi              302 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_hcd_init(struct usb_ftdi *ftdi)
ftdi              304 drivers/usb/misc/ftdi-elan.c 	if (ftdi->platform_dev.dev.parent)
ftdi              307 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_get_kref(ftdi);
ftdi              308 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_data.potpg = 100;
ftdi              309 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_data.reset = NULL;
ftdi              310 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.id = ftdi->sequence_num;
ftdi              311 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.resource = ftdi->resources;
ftdi              312 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.num_resources = ARRAY_SIZE(ftdi->resources);
ftdi              313 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.dev.platform_data = &ftdi->platform_data;
ftdi              314 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.dev.parent = NULL;
ftdi              315 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.dev.release = ftdi_release_platform_dev;
ftdi              316 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.dev.dma_mask = NULL;
ftdi              317 drivers/usb/misc/ftdi-elan.c 	snprintf(ftdi->device_name, sizeof(ftdi->device_name), "u132_hcd");
ftdi              318 drivers/usb/misc/ftdi-elan.c 	ftdi->platform_dev.name = ftdi->device_name;
ftdi              319 drivers/usb/misc/ftdi-elan.c 	dev_info(&ftdi->udev->dev, "requesting module '%s'\n", "u132_hcd");
ftdi              321 drivers/usb/misc/ftdi-elan.c 	dev_info(&ftdi->udev->dev, "registering '%s'\n",
ftdi              322 drivers/usb/misc/ftdi-elan.c 		 ftdi->platform_dev.name);
ftdi              324 drivers/usb/misc/ftdi-elan.c 	return platform_device_register(&ftdi->platform_dev);
ftdi              327 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_abandon_completions(struct usb_ftdi *ftdi)
ftdi              329 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              330 drivers/usb/misc/ftdi-elan.c 	while (ftdi->respond_next > ftdi->respond_head) {
ftdi              331 drivers/usb/misc/ftdi-elan.c 		struct u132_respond *respond = &ftdi->respond[RESPOND_MASK &
ftdi              332 drivers/usb/misc/ftdi-elan.c 							      ftdi->respond_head++];
ftdi              336 drivers/usb/misc/ftdi-elan.c 	} mutex_unlock(&ftdi->u132_lock);
ftdi              339 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_abandon_targets(struct usb_ftdi *ftdi)
ftdi              342 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              344 drivers/usb/misc/ftdi-elan.c 		struct u132_target *target = &ftdi->target[ed_number];
ftdi              347 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi              348 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_do_callback(ftdi, target, NULL, 0);
ftdi              349 drivers/usb/misc/ftdi-elan.c 			mutex_lock(&ftdi->u132_lock);
ftdi              352 drivers/usb/misc/ftdi-elan.c 	ftdi->received = 0;
ftdi              353 drivers/usb/misc/ftdi-elan.c 	ftdi->expected = 4;
ftdi              354 drivers/usb/misc/ftdi-elan.c 	ftdi->ed_found = 0;
ftdi              355 drivers/usb/misc/ftdi-elan.c 	mutex_unlock(&ftdi->u132_lock);
ftdi              358 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_flush_targets(struct usb_ftdi *ftdi)
ftdi              361 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              363 drivers/usb/misc/ftdi-elan.c 		struct u132_target *target = &ftdi->target[ed_number];
ftdi              366 drivers/usb/misc/ftdi-elan.c 			int command_size = ftdi->command_next -
ftdi              367 drivers/usb/misc/ftdi-elan.c 				ftdi->command_head;
ftdi              369 drivers/usb/misc/ftdi-elan.c 				struct u132_command *command = &ftdi->command[
ftdi              370 drivers/usb/misc/ftdi-elan.c 					COMMAND_MASK & ftdi->command_next];
ftdi              378 drivers/usb/misc/ftdi-elan.c 				ftdi->command_next += 1;
ftdi              379 drivers/usb/misc/ftdi-elan.c 				ftdi_elan_kick_command_queue(ftdi);
ftdi              381 drivers/usb/misc/ftdi-elan.c 				mutex_unlock(&ftdi->u132_lock);
ftdi              383 drivers/usb/misc/ftdi-elan.c 				mutex_lock(&ftdi->u132_lock);
ftdi              388 drivers/usb/misc/ftdi-elan.c 			int command_size = ftdi->command_next -
ftdi              389 drivers/usb/misc/ftdi-elan.c 				ftdi->command_head;
ftdi              391 drivers/usb/misc/ftdi-elan.c 				struct u132_command *command = &ftdi->command[
ftdi              392 drivers/usb/misc/ftdi-elan.c 					COMMAND_MASK & ftdi->command_next];
ftdi              400 drivers/usb/misc/ftdi-elan.c 				ftdi->command_next += 1;
ftdi              401 drivers/usb/misc/ftdi-elan.c 				ftdi_elan_kick_command_queue(ftdi);
ftdi              403 drivers/usb/misc/ftdi-elan.c 				mutex_unlock(&ftdi->u132_lock);
ftdi              405 drivers/usb/misc/ftdi-elan.c 				mutex_lock(&ftdi->u132_lock);
ftdi              410 drivers/usb/misc/ftdi-elan.c 	ftdi->received = 0;
ftdi              411 drivers/usb/misc/ftdi-elan.c 	ftdi->expected = 4;
ftdi              412 drivers/usb/misc/ftdi-elan.c 	ftdi->ed_found = 0;
ftdi              413 drivers/usb/misc/ftdi-elan.c 	mutex_unlock(&ftdi->u132_lock);
ftdi              416 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_cancel_targets(struct usb_ftdi *ftdi)
ftdi              419 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              421 drivers/usb/misc/ftdi-elan.c 		struct u132_target *target = &ftdi->target[ed_number];
ftdi              424 drivers/usb/misc/ftdi-elan.c 			int command_size = ftdi->command_next -
ftdi              425 drivers/usb/misc/ftdi-elan.c 				ftdi->command_head;
ftdi              427 drivers/usb/misc/ftdi-elan.c 				struct u132_command *command = &ftdi->command[
ftdi              428 drivers/usb/misc/ftdi-elan.c 					COMMAND_MASK & ftdi->command_next];
ftdi              436 drivers/usb/misc/ftdi-elan.c 				ftdi->command_next += 1;
ftdi              437 drivers/usb/misc/ftdi-elan.c 				ftdi_elan_kick_command_queue(ftdi);
ftdi              439 drivers/usb/misc/ftdi-elan.c 				mutex_unlock(&ftdi->u132_lock);
ftdi              441 drivers/usb/misc/ftdi-elan.c 				mutex_lock(&ftdi->u132_lock);
ftdi              446 drivers/usb/misc/ftdi-elan.c 	ftdi->received = 0;
ftdi              447 drivers/usb/misc/ftdi-elan.c 	ftdi->expected = 4;
ftdi              448 drivers/usb/misc/ftdi-elan.c 	ftdi->ed_found = 0;
ftdi              449 drivers/usb/misc/ftdi-elan.c 	mutex_unlock(&ftdi->u132_lock);
ftdi              452 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_kick_command_queue(struct usb_ftdi *ftdi)
ftdi              454 drivers/usb/misc/ftdi-elan.c 	ftdi_command_queue_work(ftdi, 0);
ftdi              459 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi =
ftdi              462 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi              463 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_put_kref(ftdi);
ftdi              466 drivers/usb/misc/ftdi-elan.c 		int retval = ftdi_elan_command_engine(ftdi);
ftdi              468 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              470 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              472 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "command error %d\n", retval);
ftdi              473 drivers/usb/misc/ftdi-elan.c 		ftdi_command_requeue_work(ftdi, msecs_to_jiffies(10));
ftdi              478 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_kick_respond_queue(struct usb_ftdi *ftdi)
ftdi              480 drivers/usb/misc/ftdi-elan.c 	ftdi_respond_queue_work(ftdi, 0);
ftdi              485 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi =
ftdi              487 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi              488 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_put_kref(ftdi);
ftdi              491 drivers/usb/misc/ftdi-elan.c 		int retval = ftdi_elan_respond_engine(ftdi);
ftdi              494 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              496 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              498 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              500 drivers/usb/misc/ftdi-elan.c 			ftdi->disconnected += 1;
ftdi              501 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "respond error %d\n", retval);
ftdi              503 drivers/usb/misc/ftdi-elan.c 		if (ftdi->disconnected > 0) {
ftdi              504 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_abandon_completions(ftdi);
ftdi              505 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_abandon_targets(ftdi);
ftdi              507 drivers/usb/misc/ftdi-elan.c 		ftdi_response_requeue_work(ftdi, msecs_to_jiffies(10));
ftdi              520 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi =
ftdi              523 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi              524 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_put_kref(ftdi);
ftdi              526 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->synchronized == 0) {
ftdi              527 drivers/usb/misc/ftdi-elan.c 		down(&ftdi->sw_lock);
ftdi              528 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_synchronize(ftdi) == 0) {
ftdi              529 drivers/usb/misc/ftdi-elan.c 			ftdi->synchronized = 1;
ftdi              530 drivers/usb/misc/ftdi-elan.c 			ftdi_command_queue_work(ftdi, 1);
ftdi              531 drivers/usb/misc/ftdi-elan.c 			ftdi_respond_queue_work(ftdi, 1);
ftdi              532 drivers/usb/misc/ftdi-elan.c 			up(&ftdi->sw_lock);
ftdi              535 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "synchronize failed\n");
ftdi              536 drivers/usb/misc/ftdi-elan.c 			up(&ftdi->sw_lock);
ftdi              539 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->stuck_status > 0) {
ftdi              540 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_stuck_waiting(ftdi) == 0) {
ftdi              541 drivers/usb/misc/ftdi-elan.c 			ftdi->stuck_status = 0;
ftdi              542 drivers/usb/misc/ftdi-elan.c 			ftdi->synchronized = 0;
ftdi              543 drivers/usb/misc/ftdi-elan.c 		} else if ((ftdi->stuck_status++ % 60) == 1) {
ftdi              544 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "WRONG type of card inserted - please remove\n");
ftdi              546 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "WRONG type of card inserted - checked %d times\n",
ftdi              547 drivers/usb/misc/ftdi-elan.c 				ftdi->stuck_status);
ftdi              549 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->enumerated == 0) {
ftdi              550 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_enumeratePCI(ftdi) == 0) {
ftdi              551 drivers/usb/misc/ftdi-elan.c 			ftdi->enumerated = 1;
ftdi              555 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi              556 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_setupOHCI(ftdi) == 0) {
ftdi              557 drivers/usb/misc/ftdi-elan.c 			ftdi->initialized = 1;
ftdi              560 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "initialized failed - trying again in 10 seconds\n");
ftdi              563 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->registered == 0) {
ftdi              565 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_hcd_init(ftdi) == 0) {
ftdi              566 drivers/usb/misc/ftdi-elan.c 			ftdi->registered = 1;
ftdi              568 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "register failed\n");
ftdi              571 drivers/usb/misc/ftdi-elan.c 		if (ftdi_elan_checkingPCI(ftdi) == 0) {
ftdi              573 drivers/usb/misc/ftdi-elan.c 		} else if (ftdi->controlreg & 0x00400000) {
ftdi              574 drivers/usb/misc/ftdi-elan.c 			if (ftdi->gone_away > 0) {
ftdi              575 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "PCI device eject confirmed platform_dev.dev.parent=%p platform_dev.dev=%p\n",
ftdi              576 drivers/usb/misc/ftdi-elan.c 					ftdi->platform_dev.dev.parent,
ftdi              577 drivers/usb/misc/ftdi-elan.c 					&ftdi->platform_dev.dev);
ftdi              578 drivers/usb/misc/ftdi-elan.c 				platform_device_unregister(&ftdi->platform_dev);
ftdi              579 drivers/usb/misc/ftdi-elan.c 				ftdi->platform_dev.dev.parent = NULL;
ftdi              580 drivers/usb/misc/ftdi-elan.c 				ftdi->registered = 0;
ftdi              581 drivers/usb/misc/ftdi-elan.c 				ftdi->enumerated = 0;
ftdi              582 drivers/usb/misc/ftdi-elan.c 				ftdi->card_ejected = 0;
ftdi              583 drivers/usb/misc/ftdi-elan.c 				ftdi->initialized = 0;
ftdi              584 drivers/usb/misc/ftdi-elan.c 				ftdi->gone_away = 0;
ftdi              586 drivers/usb/misc/ftdi-elan.c 				ftdi_elan_flush_targets(ftdi);
ftdi              589 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "PCI device has disappeared\n");
ftdi              590 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_cancel_targets(ftdi);
ftdi              592 drivers/usb/misc/ftdi-elan.c 			ftdi->enumerated = 0;
ftdi              593 drivers/usb/misc/ftdi-elan.c 			ftdi->initialized = 0;
ftdi              596 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi              597 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_put_kref(ftdi);
ftdi              600 drivers/usb/misc/ftdi-elan.c 		ftdi_status_requeue_work(ftdi,
ftdi              625 drivers/usb/misc/ftdi-elan.c 		struct usb_ftdi *ftdi = usb_get_intfdata(interface);
ftdi              626 drivers/usb/misc/ftdi-elan.c 		if (!ftdi) {
ftdi              629 drivers/usb/misc/ftdi-elan.c 			if (down_interruptible(&ftdi->sw_lock)) {
ftdi              632 drivers/usb/misc/ftdi-elan.c 				ftdi_elan_get_kref(ftdi);
ftdi              633 drivers/usb/misc/ftdi-elan.c 				file->private_data = ftdi;
ftdi              642 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = file->private_data;
ftdi              643 drivers/usb/misc/ftdi-elan.c 	if (ftdi == NULL)
ftdi              645 drivers/usb/misc/ftdi-elan.c 	up(&ftdi->sw_lock);        /* decrement the count on our device */
ftdi              646 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_put_kref(ftdi);
ftdi              665 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = file->private_data;
ftdi              666 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi              670 drivers/usb/misc/ftdi-elan.c have:if (ftdi->bulk_in_left > 0) {
ftdi              672 drivers/usb/misc/ftdi-elan.c 			char *p = ++ftdi->bulk_in_last + ftdi->bulk_in_buffer;
ftdi              673 drivers/usb/misc/ftdi-elan.c 			ftdi->bulk_in_left -= 1;
ftdi              690 drivers/usb/misc/ftdi-elan.c 		int retval = usb_bulk_msg(ftdi->udev,
ftdi              691 drivers/usb/misc/ftdi-elan.c 					  usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
ftdi              692 drivers/usb/misc/ftdi-elan.c 					  ftdi->bulk_in_buffer, ftdi->bulk_in_size,
ftdi              695 drivers/usb/misc/ftdi-elan.c 			ftdi->bulk_in_left = packet_bytes - 2;
ftdi              696 drivers/usb/misc/ftdi-elan.c 			ftdi->bulk_in_last = 1;
ftdi              718 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = urb->context;
ftdi              723 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev,
ftdi              730 drivers/usb/misc/ftdi-elan.c static int fill_buffer_with_all_queued_commands(struct usb_ftdi *ftdi,
ftdi              736 drivers/usb/misc/ftdi-elan.c 	int i = ftdi->command_head;
ftdi              738 drivers/usb/misc/ftdi-elan.c 		struct u132_command *command = &ftdi->command[COMMAND_MASK &
ftdi              757 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_total_command_size(struct usb_ftdi *ftdi, int command_size)
ftdi              761 drivers/usb/misc/ftdi-elan.c 	int i = ftdi->command_head;
ftdi              763 drivers/usb/misc/ftdi-elan.c 		struct u132_command *command = &ftdi->command[COMMAND_MASK &
ftdi              769 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
ftdi              776 drivers/usb/misc/ftdi-elan.c 	int command_size = ftdi->command_next - ftdi->command_head;
ftdi              779 drivers/usb/misc/ftdi-elan.c 	total_size = ftdi_elan_total_command_size(ftdi, command_size);
ftdi              783 drivers/usb/misc/ftdi-elan.c 	buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
ftdi              786 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "could not get a buffer to write %d commands totaling %d bytes to the Uxxx\n",
ftdi              791 drivers/usb/misc/ftdi-elan.c 	ed_commands = fill_buffer_with_all_queued_commands(ftdi, buf,
ftdi              793 drivers/usb/misc/ftdi-elan.c 	usb_fill_bulk_urb(urb, ftdi->udev, usb_sndbulkpipe(ftdi->udev,
ftdi              794 drivers/usb/misc/ftdi-elan.c 							   ftdi->bulk_out_endpointAddr), buf, total_size,
ftdi              795 drivers/usb/misc/ftdi-elan.c 			  ftdi_elan_write_bulk_callback, ftdi);
ftdi              813 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write %d commands totaling %d bytes to the Uxxx\n",
ftdi              815 drivers/usb/misc/ftdi-elan.c 		usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
ftdi              821 drivers/usb/misc/ftdi-elan.c 	ftdi->command_head += command_size;
ftdi              822 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_kick_respond_queue(ftdi);
ftdi              826 drivers/usb/misc/ftdi-elan.c static void ftdi_elan_do_callback(struct usb_ftdi *ftdi,
ftdi              847 drivers/usb/misc/ftdi-elan.c static char *have_ed_set_response(struct usb_ftdi *ftdi,
ftdi              852 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              859 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi              860 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_do_callback(ftdi, target, 4 + ftdi->response,
ftdi              862 drivers/usb/misc/ftdi-elan.c 			ftdi->received = 0;
ftdi              863 drivers/usb/misc/ftdi-elan.c 			ftdi->expected = 4;
ftdi              864 drivers/usb/misc/ftdi-elan.c 			ftdi->ed_found = 0;
ftdi              865 drivers/usb/misc/ftdi-elan.c 			return ftdi->response;
ftdi              867 drivers/usb/misc/ftdi-elan.c 			ftdi->expected = 4 + payload;
ftdi              868 drivers/usb/misc/ftdi-elan.c 			ftdi->ed_found = 1;
ftdi              869 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi              874 drivers/usb/misc/ftdi-elan.c 		mutex_unlock(&ftdi->u132_lock);
ftdi              875 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_do_callback(ftdi, target, 4 + ftdi->response,
ftdi              877 drivers/usb/misc/ftdi-elan.c 		ftdi->received = 0;
ftdi              878 drivers/usb/misc/ftdi-elan.c 		ftdi->expected = 4;
ftdi              879 drivers/usb/misc/ftdi-elan.c 		ftdi->ed_found = 0;
ftdi              880 drivers/usb/misc/ftdi-elan.c 		return ftdi->response;
ftdi              884 drivers/usb/misc/ftdi-elan.c static char *have_ed_get_response(struct usb_ftdi *ftdi,
ftdi              888 drivers/usb/misc/ftdi-elan.c 	mutex_lock(&ftdi->u132_lock);
ftdi              893 drivers/usb/misc/ftdi-elan.c 	mutex_unlock(&ftdi->u132_lock);
ftdi              895 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_do_callback(ftdi, target, NULL, 0);
ftdi              897 drivers/usb/misc/ftdi-elan.c 	ftdi->received = 0;
ftdi              898 drivers/usb/misc/ftdi-elan.c 	ftdi->expected = 4;
ftdi              899 drivers/usb/misc/ftdi-elan.c 	ftdi->ed_found = 0;
ftdi              900 drivers/usb/misc/ftdi-elan.c 	return ftdi->response;
ftdi              912 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_respond_engine(struct usb_ftdi *ftdi)
ftdi              914 drivers/usb/misc/ftdi-elan.c 	u8 *b = ftdi->response + ftdi->received;
ftdi              920 drivers/usb/misc/ftdi-elan.c 		int retval = usb_bulk_msg(ftdi->udev,
ftdi              921 drivers/usb/misc/ftdi-elan.c 					  usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
ftdi              922 drivers/usb/misc/ftdi-elan.c 					  ftdi->bulk_in_buffer, ftdi->bulk_in_size,
ftdi              927 drivers/usb/misc/ftdi-elan.c 		u8 *c = ftdi->bulk_in_buffer;
ftdi              937 drivers/usb/misc/ftdi-elan.c 			ftdi->bulk_in_left = packet_bytes - 2;
ftdi              938 drivers/usb/misc/ftdi-elan.c 			ftdi->bulk_in_last = 1;
ftdi              942 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
ftdi              946 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "ONLY %d bytes%s\n",
ftdi              950 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
ftdi              955 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
ftdi              959 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
ftdi              972 drivers/usb/misc/ftdi-elan.c have:if (ftdi->bulk_in_left > 0) {
ftdi              973 drivers/usb/misc/ftdi-elan.c 		u8 c = ftdi->bulk_in_buffer[++ftdi->bulk_in_last];
ftdi              975 drivers/usb/misc/ftdi-elan.c 		ftdi->bulk_in_left -= 1;
ftdi              976 drivers/usb/misc/ftdi-elan.c 		if (ftdi->received == 0 && c == 0xFF) {
ftdi              980 drivers/usb/misc/ftdi-elan.c 		if (++ftdi->received < ftdi->expected) {
ftdi              982 drivers/usb/misc/ftdi-elan.c 		} else if (ftdi->ed_found) {
ftdi              983 drivers/usb/misc/ftdi-elan.c 			int ed_number = (ftdi->response[0] >> 5) & 0x03;
ftdi              984 drivers/usb/misc/ftdi-elan.c 			u16 ed_length = (ftdi->response[2] << 8) |
ftdi              985 drivers/usb/misc/ftdi-elan.c 				ftdi->response[1];
ftdi              986 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed_number];
ftdi              991 drivers/usb/misc/ftdi-elan.c 			u8 *c = 4 + ftdi->response;
ftdi             1000 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_do_callback(ftdi, target, 4 + ftdi->response,
ftdi             1002 drivers/usb/misc/ftdi-elan.c 			ftdi->received = 0;
ftdi             1003 drivers/usb/misc/ftdi-elan.c 			ftdi->expected = 4;
ftdi             1004 drivers/usb/misc/ftdi-elan.c 			ftdi->ed_found = 0;
ftdi             1005 drivers/usb/misc/ftdi-elan.c 			b = ftdi->response;
ftdi             1007 drivers/usb/misc/ftdi-elan.c 		} else if (ftdi->expected == 8) {
ftdi             1009 drivers/usb/misc/ftdi-elan.c 			int respond_head = ftdi->respond_head++;
ftdi             1010 drivers/usb/misc/ftdi-elan.c 			struct u132_respond *respond = &ftdi->respond[
ftdi             1012 drivers/usb/misc/ftdi-elan.c 			u32 data = ftdi->response[7];
ftdi             1014 drivers/usb/misc/ftdi-elan.c 			data |= ftdi->response[6];
ftdi             1016 drivers/usb/misc/ftdi-elan.c 			data |= ftdi->response[5];
ftdi             1018 drivers/usb/misc/ftdi-elan.c 			data |= ftdi->response[4];
ftdi             1022 drivers/usb/misc/ftdi-elan.c 			ftdi->received = 0;
ftdi             1023 drivers/usb/misc/ftdi-elan.c 			ftdi->expected = 4;
ftdi             1024 drivers/usb/misc/ftdi-elan.c 			ftdi->ed_found = 0;
ftdi             1025 drivers/usb/misc/ftdi-elan.c 			b = ftdi->response;
ftdi             1026 drivers/usb/misc/ftdi-elan.c 			buscmd = (ftdi->response[0] >> 0) & 0x0F;
ftdi             1032 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "Uxxx unknown(%0X) value = %08X\n",
ftdi             1036 drivers/usb/misc/ftdi-elan.c 			if ((ftdi->response[0] & 0x80) == 0x00) {
ftdi             1037 drivers/usb/misc/ftdi-elan.c 				ftdi->expected = 8;
ftdi             1040 drivers/usb/misc/ftdi-elan.c 				int ed_number = (ftdi->response[0] >> 5) & 0x03;
ftdi             1041 drivers/usb/misc/ftdi-elan.c 				int ed_type = (ftdi->response[0] >> 0) & 0x03;
ftdi             1042 drivers/usb/misc/ftdi-elan.c 				u16 ed_length = (ftdi->response[2] << 8) |
ftdi             1043 drivers/usb/misc/ftdi-elan.c 					ftdi->response[1];
ftdi             1044 drivers/usb/misc/ftdi-elan.c 				struct u132_target *target = &ftdi->target[
ftdi             1046 drivers/usb/misc/ftdi-elan.c 				target->halted = (ftdi->response[0] >> 3) &
ftdi             1048 drivers/usb/misc/ftdi-elan.c 				target->skipped = (ftdi->response[0] >> 2) &
ftdi             1050 drivers/usb/misc/ftdi-elan.c 				target->toggle_bits = (ftdi->response[3] >> 6)
ftdi             1052 drivers/usb/misc/ftdi-elan.c 				target->error_count = (ftdi->response[3] >> 4)
ftdi             1054 drivers/usb/misc/ftdi-elan.c 				target->condition_code = (ftdi->response[
ftdi             1056 drivers/usb/misc/ftdi-elan.c 				if ((ftdi->response[0] & 0x10) == 0x00) {
ftdi             1057 drivers/usb/misc/ftdi-elan.c 					b = have_ed_set_response(ftdi, target,
ftdi             1062 drivers/usb/misc/ftdi-elan.c 					b = have_ed_get_response(ftdi, target,
ftdi             1085 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = file->private_data;
ftdi             1087 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi             1098 drivers/usb/misc/ftdi-elan.c 	buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL,
ftdi             1108 drivers/usb/misc/ftdi-elan.c 	usb_fill_bulk_urb(urb, ftdi->udev, usb_sndbulkpipe(ftdi->udev,
ftdi             1109 drivers/usb/misc/ftdi-elan.c 							   ftdi->bulk_out_endpointAddr), buf, count,
ftdi             1110 drivers/usb/misc/ftdi-elan.c 			  ftdi_elan_write_bulk_callback, ftdi);
ftdi             1114 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev,
ftdi             1123 drivers/usb/misc/ftdi-elan.c 	usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma);
ftdi             1182 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_write_reg(struct usb_ftdi *ftdi, u32 data)
ftdi             1184 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1188 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1189 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1191 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1192 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1200 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1201 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1202 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1205 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1212 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_write_config(struct usb_ftdi *ftdi, int config_offset,
ftdi             1216 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1220 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1221 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1223 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1224 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1232 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1233 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1234 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1237 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1244 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_write_pcimem(struct usb_ftdi *ftdi, int mem_offset,
ftdi             1248 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1252 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1253 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1255 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1256 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1264 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1265 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1266 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1269 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1279 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1280 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_write_pcimem(ftdi, mem_offset, width, data);
ftdi             1285 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_read_reg(struct usb_ftdi *ftdi, u32 *data)
ftdi             1287 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1292 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1293 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1294 drivers/usb/misc/ftdi-elan.c 		respond_size = ftdi->respond_next - ftdi->respond_head;
ftdi             1297 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1298 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1299 drivers/usb/misc/ftdi-elan.c 			struct u132_respond *respond = &ftdi->respond[
ftdi             1300 drivers/usb/misc/ftdi-elan.c 				RESPOND_MASK & ftdi->respond_next];
ftdi             1312 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1313 drivers/usb/misc/ftdi-elan.c 			ftdi->respond_next += 1;
ftdi             1314 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1315 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1319 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1326 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_read_config(struct usb_ftdi *ftdi, int config_offset,
ftdi             1330 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1335 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1336 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1337 drivers/usb/misc/ftdi-elan.c 		respond_size = ftdi->respond_next - ftdi->respond_head;
ftdi             1340 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1341 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1342 drivers/usb/misc/ftdi-elan.c 			struct u132_respond *respond = &ftdi->respond[
ftdi             1343 drivers/usb/misc/ftdi-elan.c 				RESPOND_MASK & ftdi->respond_next];
ftdi             1356 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1357 drivers/usb/misc/ftdi-elan.c 			ftdi->respond_next += 1;
ftdi             1358 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1359 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1363 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1370 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_read_pcimem(struct usb_ftdi *ftdi, int mem_offset,
ftdi             1374 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1379 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1380 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1381 drivers/usb/misc/ftdi-elan.c 		respond_size = ftdi->respond_next - ftdi->respond_head;
ftdi             1384 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1385 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1386 drivers/usb/misc/ftdi-elan.c 			struct u132_respond *respond = &ftdi->respond[
ftdi             1387 drivers/usb/misc/ftdi-elan.c 				RESPOND_MASK & ftdi->respond_next];
ftdi             1400 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1401 drivers/usb/misc/ftdi-elan.c 			ftdi->respond_next += 1;
ftdi             1402 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1403 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1407 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1417 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1418 drivers/usb/misc/ftdi-elan.c 	if (ftdi->initialized == 0) {
ftdi             1421 drivers/usb/misc/ftdi-elan.c 		return ftdi_elan_read_pcimem(ftdi, mem_offset, width, data);
ftdi             1426 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_setup(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1433 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1435 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1439 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1440 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1442 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed];
ftdi             1443 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1444 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1458 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1459 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1460 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1463 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1476 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1477 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_setup(ftdi, ed_number, endp, urb, address,
ftdi             1483 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_input(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1490 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1492 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1496 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1497 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1499 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed];
ftdi             1500 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1501 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1523 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1524 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1525 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1528 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1541 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1542 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_input(ftdi, ed_number, endp, urb, address,
ftdi             1548 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_empty(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1555 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1557 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1561 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1562 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1564 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed];
ftdi             1565 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1566 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1580 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1581 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1582 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1585 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1598 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1599 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_empty(ftdi, ed_number, endp, urb, address,
ftdi             1605 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_output(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1612 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1614 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1618 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1619 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1628 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed];
ftdi             1629 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1630 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1659 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1660 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1661 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1664 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1677 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1678 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_output(ftdi, ed_number, endp, urb, address,
ftdi             1684 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_single(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1691 drivers/usb/misc/ftdi-elan.c wait:if (ftdi->disconnected > 0) {
ftdi             1693 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1697 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1698 drivers/usb/misc/ftdi-elan.c 		command_size = ftdi->command_next - ftdi->command_head;
ftdi             1702 drivers/usb/misc/ftdi-elan.c 			struct u132_target *target = &ftdi->target[ed];
ftdi             1703 drivers/usb/misc/ftdi-elan.c 			struct u132_command *command = &ftdi->command[
ftdi             1704 drivers/usb/misc/ftdi-elan.c 				COMMAND_MASK & ftdi->command_next];
ftdi             1724 drivers/usb/misc/ftdi-elan.c 			ftdi->command_next += 1;
ftdi             1725 drivers/usb/misc/ftdi-elan.c 			ftdi_elan_kick_command_queue(ftdi);
ftdi             1726 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1729 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1742 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1743 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_single(ftdi, ed_number, endp, urb, address,
ftdi             1749 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_edset_flush(struct usb_ftdi *ftdi, u8 ed_number,
ftdi             1753 drivers/usb/misc/ftdi-elan.c 	if (ftdi->disconnected > 0) {
ftdi             1755 drivers/usb/misc/ftdi-elan.c 	} else if (ftdi->initialized == 0) {
ftdi             1758 drivers/usb/misc/ftdi-elan.c 		struct u132_target *target = &ftdi->target[ed];
ftdi             1759 drivers/usb/misc/ftdi-elan.c 		mutex_lock(&ftdi->u132_lock);
ftdi             1761 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1766 drivers/usb/misc/ftdi-elan.c 				int command_size = ftdi->command_next -
ftdi             1767 drivers/usb/misc/ftdi-elan.c 					ftdi->command_head;
ftdi             1770 drivers/usb/misc/ftdi-elan.c 						&ftdi->command[COMMAND_MASK &
ftdi             1771 drivers/usb/misc/ftdi-elan.c 							       ftdi->command_next];
ftdi             1780 drivers/usb/misc/ftdi-elan.c 					ftdi->command_next += 1;
ftdi             1781 drivers/usb/misc/ftdi-elan.c 					ftdi_elan_kick_command_queue(ftdi);
ftdi             1783 drivers/usb/misc/ftdi-elan.c 					mutex_unlock(&ftdi->u132_lock);
ftdi             1785 drivers/usb/misc/ftdi-elan.c 					mutex_lock(&ftdi->u132_lock);
ftdi             1789 drivers/usb/misc/ftdi-elan.c 			mutex_unlock(&ftdi->u132_lock);
ftdi             1798 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = platform_device_to_usb_ftdi(pdev);
ftdi             1799 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_edset_flush(ftdi, ed_number, endp);
ftdi             1804 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_flush_input_fifo(struct usb_ftdi *ftdi)
ftdi             1811 drivers/usb/misc/ftdi-elan.c 		int retval = usb_bulk_msg(ftdi->udev,
ftdi             1812 drivers/usb/misc/ftdi-elan.c 					  usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
ftdi             1813 drivers/usb/misc/ftdi-elan.c 					  ftdi->bulk_in_buffer, ftdi->bulk_in_size,
ftdi             1819 drivers/usb/misc/ftdi-elan.c 			char *b = ftdi->bulk_in_buffer;
ftdi             1835 drivers/usb/misc/ftdi-elan.c 			char s1 = ftdi->bulk_in_buffer[0];
ftdi             1836 drivers/usb/misc/ftdi-elan.c 			char s2 = ftdi->bulk_in_buffer[1];
ftdi             1842 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
ftdi             1846 drivers/usb/misc/ftdi-elan.c 			char b1 = ftdi->bulk_in_buffer[0];
ftdi             1847 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n",
ftdi             1852 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
ftdi             1859 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
ftdi             1866 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
ftdi             1870 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "error = %d\n", retval);
ftdi             1882 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
ftdi             1892 drivers/usb/misc/ftdi-elan.c 	buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
ftdi             1894 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n");
ftdi             1900 drivers/usb/misc/ftdi-elan.c 	usb_fill_bulk_urb(urb, ftdi->udev, usb_sndbulkpipe(ftdi->udev,
ftdi             1901 drivers/usb/misc/ftdi-elan.c 							   ftdi->bulk_out_endpointAddr), buf, i,
ftdi             1902 drivers/usb/misc/ftdi-elan.c 			  ftdi_elan_write_bulk_callback, ftdi);
ftdi             1906 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "failed to submit urb containing the flush sequence\n");
ftdi             1907 drivers/usb/misc/ftdi-elan.c 		usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
ftdi             1920 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
ftdi             1930 drivers/usb/misc/ftdi-elan.c 	buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
ftdi             1932 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "could not get a buffer for the reset sequence\n");
ftdi             1940 drivers/usb/misc/ftdi-elan.c 	usb_fill_bulk_urb(urb, ftdi->udev, usb_sndbulkpipe(ftdi->udev,
ftdi             1941 drivers/usb/misc/ftdi-elan.c 							   ftdi->bulk_out_endpointAddr), buf, i,
ftdi             1942 drivers/usb/misc/ftdi-elan.c 			  ftdi_elan_write_bulk_callback, ftdi);
ftdi             1946 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "failed to submit urb containing the reset sequence\n");
ftdi             1947 drivers/usb/misc/ftdi-elan.c 		usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
ftdi             1955 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
ftdi             1962 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_elan_flush_input_fifo(ftdi);
ftdi             1965 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_left = 0;
ftdi             1966 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_last = -1;
ftdi             1970 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_elan_synchronize_flush(ftdi);
ftdi             1973 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_elan_flush_input_fifo(ftdi);
ftdi             1976 drivers/usb/misc/ftdi-elan.c 	reset:retval = ftdi_elan_synchronize_reset(ftdi);
ftdi             1983 drivers/usb/misc/ftdi-elan.c 			retval = usb_bulk_msg(ftdi->udev,
ftdi             1984 drivers/usb/misc/ftdi-elan.c 					      usb_rcvbulkpipe(ftdi->udev,
ftdi             1985 drivers/usb/misc/ftdi-elan.c 							      ftdi->bulk_in_endpointAddr),
ftdi             1986 drivers/usb/misc/ftdi-elan.c 					      ftdi->bulk_in_buffer, ftdi->bulk_in_size,
ftdi             1992 drivers/usb/misc/ftdi-elan.c 				char *b = ftdi->bulk_in_buffer;
ftdi             2014 drivers/usb/misc/ftdi-elan.c 						dev_err(&ftdi->udev->dev, "retry limit reached\n");
ftdi             2019 drivers/usb/misc/ftdi-elan.c 				unsigned char s1 = ftdi->bulk_in_buffer[0];
ftdi             2020 drivers/usb/misc/ftdi-elan.c 				unsigned char s2 = ftdi->bulk_in_buffer[1];
ftdi             2030 drivers/usb/misc/ftdi-elan.c 						dev_err(&ftdi->udev->dev, "retry limit reached\n");
ftdi             2038 drivers/usb/misc/ftdi-elan.c 					dev_err(&ftdi->udev->dev, "retry limit reached\n");
ftdi             2045 drivers/usb/misc/ftdi-elan.c 					dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
ftdi             2052 drivers/usb/misc/ftdi-elan.c 					dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
ftdi             2057 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "error = %d\n",
ftdi             2062 drivers/usb/misc/ftdi-elan.c 					dev_err(&ftdi->udev->dev, "retry limit reached\n");
ftdi             2068 drivers/usb/misc/ftdi-elan.c 	dev_err(&ftdi->udev->dev, "failed to synchronize\n");
ftdi             2072 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_stuck_waiting(struct usb_ftdi *ftdi)
ftdi             2079 drivers/usb/misc/ftdi-elan.c 		int retval = usb_bulk_msg(ftdi->udev,
ftdi             2080 drivers/usb/misc/ftdi-elan.c 					  usb_rcvbulkpipe(ftdi->udev, ftdi->bulk_in_endpointAddr),
ftdi             2081 drivers/usb/misc/ftdi-elan.c 					  ftdi->bulk_in_buffer, ftdi->bulk_in_size,
ftdi             2087 drivers/usb/misc/ftdi-elan.c 			char *b = ftdi->bulk_in_buffer;
ftdi             2103 drivers/usb/misc/ftdi-elan.c 			char s1 = ftdi->bulk_in_buffer[0];
ftdi             2104 drivers/usb/misc/ftdi-elan.c 			char s2 = ftdi->bulk_in_buffer[1];
ftdi             2113 drivers/usb/misc/ftdi-elan.c 			char b1 = ftdi->bulk_in_buffer[0];
ftdi             2114 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n", b1);
ftdi             2119 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
ftdi             2126 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
ftdi             2133 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
ftdi             2137 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "error = %d\n", retval);
ftdi             2144 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
ftdi             2146 drivers/usb/misc/ftdi-elan.c 	int UxxxStatus = ftdi_elan_read_reg(ftdi, &ftdi->controlreg);
ftdi             2149 drivers/usb/misc/ftdi-elan.c 	if (ftdi->controlreg & 0x00400000) {
ftdi             2150 drivers/usb/misc/ftdi-elan.c 		if (ftdi->card_ejected) {
ftdi             2152 drivers/usb/misc/ftdi-elan.c 			ftdi->card_ejected = 1;
ftdi             2153 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "CARD EJECTED - controlreg = %08X\n",
ftdi             2154 drivers/usb/misc/ftdi-elan.c 				ftdi->controlreg);
ftdi             2158 drivers/usb/misc/ftdi-elan.c 		u8 fn = ftdi->function - 1;
ftdi             2164 drivers/usb/misc/ftdi-elan.c 		UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2170 drivers/usb/misc/ftdi-elan.c 		if (pciVID == ftdi->platform_data.vendor && pciPID ==
ftdi             2171 drivers/usb/misc/ftdi-elan.c 		    ftdi->platform_data.device) {
ftdi             2174 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "vendor=%04X pciVID=%04X device=%04X pciPID=%04X\n",
ftdi             2175 drivers/usb/misc/ftdi-elan.c 				ftdi->platform_data.vendor, pciVID,
ftdi             2176 drivers/usb/misc/ftdi-elan.c 				ftdi->platform_data.device, pciPID);
ftdi             2183 drivers/usb/misc/ftdi-elan.c #define ftdi_read_pcimem(ftdi, member, data) ftdi_elan_read_pcimem(ftdi, \
ftdi             2185 drivers/usb/misc/ftdi-elan.c #define ftdi_write_pcimem(ftdi, member, data) ftdi_elan_write_pcimem(ftdi, \
ftdi             2191 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_check_controller(struct usb_ftdi *ftdi, int quirk)
ftdi             2209 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, intrdisable, OHCI_INTR_MIE);
ftdi             2212 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2215 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, roothub.a, &rh_a);
ftdi             2219 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, fminterval, &hc_fminterval);
ftdi             2226 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &hc_control);
ftdi             2245 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, control, hc_control);
ftdi             2248 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2252 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, roothub.a, &roothub_a);
ftdi             2257 drivers/usb/misc/ftdi-elan.c 			retval = ftdi_write_pcimem(ftdi,
ftdi             2263 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2266 drivers/usb/misc/ftdi-elan.c retry:retval = ftdi_read_pcimem(ftdi, cmdstatus, &status);
ftdi             2269 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, cmdstatus, OHCI_HCR);
ftdi             2273 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_read_pcimem(ftdi, cmdstatus, &status);
ftdi             2278 drivers/usb/misc/ftdi-elan.c 				dev_err(&ftdi->udev->dev, "USB HC reset timed out!\n");
ftdi             2287 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_write_pcimem(ftdi, control, hc_control);
ftdi             2290 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2294 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, ed_controlhead, 0x00000000);
ftdi             2297 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, ed_bulkhead, 0x11000000);
ftdi             2300 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, hcca, 0x00000000);
ftdi             2303 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, fminterval, &fminterval);
ftdi             2306 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, fminterval,
ftdi             2310 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, periodicstart,
ftdi             2314 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, fminterval, &fminterval);
ftdi             2317 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, periodicstart, &periodicstart);
ftdi             2325 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "init err(%08x %04x)\n",
ftdi             2330 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, control, hc_control);
ftdi             2333 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, cmdstatus, OHCI_BLF);
ftdi             2336 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, cmdstatus, &cmdstatus);
ftdi             2339 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2342 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, roothub.status, RH_HS_DRWE);
ftdi             2345 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, intrstatus, mask);
ftdi             2348 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, intrdisable,
ftdi             2354 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, roothub.a, &roothub_a);
ftdi             2361 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_write_pcimem(ftdi, roothub.a, roothub_a);
ftdi             2366 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_write_pcimem(ftdi, roothub.a, roothub_a);
ftdi             2370 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, roothub.status, RH_HS_LPSC);
ftdi             2373 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_write_pcimem(ftdi, roothub.b,
ftdi             2377 drivers/usb/misc/ftdi-elan.c 	retval = ftdi_read_pcimem(ftdi, control, &control);
ftdi             2383 drivers/usb/misc/ftdi-elan.c 		retval = ftdi_read_pcimem(ftdi, roothub.portstatus[temp],
ftdi             2393 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_setup_controller(struct usb_ftdi *ftdi, int fn)
ftdi             2400 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000025FL | 0x2800);
ftdi             2404 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0,
ftdi             2408 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2412 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0,
ftdi             2416 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2421 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2427 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0x00,
ftdi             2431 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2436 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0x00,
ftdi             2440 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2445 drivers/usb/misc/ftdi-elan.c 		UxxxStatus = ftdi_elan_read_pcimem(ftdi, reg, 0, &pcidata);
ftdi             2452 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_close_controller(struct usb_ftdi *ftdi, int fn)
ftdi             2459 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000025FL | 0x2800);
ftdi             2463 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0,
ftdi             2467 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2471 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0,
ftdi             2475 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2480 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2486 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0x00,
ftdi             2490 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2495 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_config(ftdi, activePCIfn | reg, 0x00,
ftdi             2499 drivers/usb/misc/ftdi-elan.c 	return ftdi_elan_read_config(ftdi, activePCIfn | reg, 0, &pcidata);
ftdi             2502 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_found_controller(struct usb_ftdi *ftdi, int fn, int quirk)
ftdi             2506 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_setup_controller(ftdi, fn);
ftdi             2509 drivers/usb/misc/ftdi-elan.c 	result = ftdi_elan_check_controller(ftdi, quirk);
ftdi             2510 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_close_controller(ftdi, fn);
ftdi             2516 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_enumeratePCI(struct usb_ftdi *ftdi)
ftdi             2521 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_reg(ftdi, &controlreg);
ftdi             2524 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x00000000L);
ftdi             2528 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x00000200L | 0x100);
ftdi             2531 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x00000200L | 0x500);
ftdi             2534 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_reg(ftdi, &controlreg);
ftdi             2537 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000020CL | 0x000);
ftdi             2540 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000020DL | 0x000);
ftdi             2544 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000020FL | 0x000);
ftdi             2547 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_reg(ftdi, &controlreg);
ftdi             2550 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_write_reg(ftdi, 0x0000025FL | 0x800);
ftdi             2553 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_reg(ftdi, &controlreg);
ftdi             2556 drivers/usb/misc/ftdi-elan.c 	UxxxStatus = ftdi_elan_read_reg(ftdi, &controlreg);
ftdi             2567 drivers/usb/misc/ftdi-elan.c static int ftdi_elan_setupOHCI(struct usb_ftdi *ftdi)
ftdi             2577 drivers/usb/misc/ftdi-elan.c 	ftdi->function = 0;
ftdi             2583 drivers/usb/misc/ftdi-elan.c 		UxxxStatus = ftdi_elan_read_config(ftdi, activePCIfn | reg, 0,
ftdi             2590 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn, 0);
ftdi             2594 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn, 0);
ftdi             2597 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn, 0);
ftdi             2601 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn, 0);
ftdi             2604 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn,
ftdi             2608 drivers/usb/misc/ftdi-elan.c 			devices = ftdi_elan_found_controller(ftdi, fn,
ftdi             2616 drivers/usb/misc/ftdi-elan.c 			ftdi->function = fn + 1;
ftdi             2617 drivers/usb/misc/ftdi-elan.c 			ftdi->platform_data.vendor = pciVID;
ftdi             2618 drivers/usb/misc/ftdi-elan.c 			ftdi->platform_data.device = pciPID;
ftdi             2621 drivers/usb/misc/ftdi-elan.c 	if (ftdi->function > 0) {
ftdi             2622 drivers/usb/misc/ftdi-elan.c 		return ftdi_elan_setup_controller(ftdi,	ftdi->function - 1);
ftdi             2628 drivers/usb/misc/ftdi-elan.c 		ftdi->enumerated = 0;
ftdi             2643 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi;
ftdi             2645 drivers/usb/misc/ftdi-elan.c 	ftdi = kzalloc(sizeof(struct usb_ftdi), GFP_KERNEL);
ftdi             2646 drivers/usb/misc/ftdi-elan.c 	if (!ftdi)
ftdi             2650 drivers/usb/misc/ftdi-elan.c 	list_add_tail(&ftdi->ftdi_list, &ftdi_static_list);
ftdi             2651 drivers/usb/misc/ftdi-elan.c 	ftdi->sequence_num = ++ftdi_instances;
ftdi             2653 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_init_kref(ftdi);
ftdi             2654 drivers/usb/misc/ftdi-elan.c 	sema_init(&ftdi->sw_lock, 1);
ftdi             2655 drivers/usb/misc/ftdi-elan.c 	ftdi->udev = usb_get_dev(interface_to_usbdev(interface));
ftdi             2656 drivers/usb/misc/ftdi-elan.c 	ftdi->interface = interface;
ftdi             2657 drivers/usb/misc/ftdi-elan.c 	mutex_init(&ftdi->u132_lock);
ftdi             2658 drivers/usb/misc/ftdi-elan.c 	ftdi->expected = 4;
ftdi             2664 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev, "Could not find both bulk-in and bulk-out endpoints\n");
ftdi             2668 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_size = usb_endpoint_maxp(bulk_in);
ftdi             2669 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_endpointAddr = bulk_in->bEndpointAddress;
ftdi             2670 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_in_buffer = kmalloc(ftdi->bulk_in_size, GFP_KERNEL);
ftdi             2671 drivers/usb/misc/ftdi-elan.c 	if (!ftdi->bulk_in_buffer) {
ftdi             2676 drivers/usb/misc/ftdi-elan.c 	ftdi->bulk_out_endpointAddr = bulk_out->bEndpointAddress;
ftdi             2678 drivers/usb/misc/ftdi-elan.c 	dev_info(&ftdi->udev->dev, "interface %d has I=%02X O=%02X\n",
ftdi             2679 drivers/usb/misc/ftdi-elan.c 		 iface_desc->desc.bInterfaceNumber, ftdi->bulk_in_endpointAddr,
ftdi             2680 drivers/usb/misc/ftdi-elan.c 		 ftdi->bulk_out_endpointAddr);
ftdi             2681 drivers/usb/misc/ftdi-elan.c 	usb_set_intfdata(interface, ftdi);
ftdi             2683 drivers/usb/misc/ftdi-elan.c 	    ftdi->bulk_in_endpointAddr == 0x81 &&
ftdi             2684 drivers/usb/misc/ftdi-elan.c 	    ftdi->bulk_out_endpointAddr == 0x02) {
ftdi             2687 drivers/usb/misc/ftdi-elan.c 			dev_err(&ftdi->udev->dev, "Not able to get a minor for this device\n");
ftdi             2692 drivers/usb/misc/ftdi-elan.c 			ftdi->class = &ftdi_elan_jtag_class;
ftdi             2693 drivers/usb/misc/ftdi-elan.c 			dev_info(&ftdi->udev->dev, "USB FDTI=%p JTAG interface %d now attached to ftdi%d\n",
ftdi             2694 drivers/usb/misc/ftdi-elan.c 				 ftdi, iface_desc->desc.bInterfaceNumber,
ftdi             2699 drivers/usb/misc/ftdi-elan.c 		   ftdi->bulk_in_endpointAddr == 0x83 &&
ftdi             2700 drivers/usb/misc/ftdi-elan.c 		   ftdi->bulk_out_endpointAddr == 0x04) {
ftdi             2701 drivers/usb/misc/ftdi-elan.c 		ftdi->class = NULL;
ftdi             2702 drivers/usb/misc/ftdi-elan.c 		dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now activated\n",
ftdi             2703 drivers/usb/misc/ftdi-elan.c 			 ftdi, iface_desc->desc.bInterfaceNumber);
ftdi             2704 drivers/usb/misc/ftdi-elan.c 		INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work);
ftdi             2705 drivers/usb/misc/ftdi-elan.c 		INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work);
ftdi             2706 drivers/usb/misc/ftdi-elan.c 		INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work);
ftdi             2707 drivers/usb/misc/ftdi-elan.c 		ftdi_status_queue_work(ftdi, msecs_to_jiffies(3 *1000));
ftdi             2710 drivers/usb/misc/ftdi-elan.c 		dev_err(&ftdi->udev->dev,
ftdi             2715 drivers/usb/misc/ftdi-elan.c error:if (ftdi) {
ftdi             2716 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_put_kref(ftdi);
ftdi             2723 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi = usb_get_intfdata(interface);
ftdi             2724 drivers/usb/misc/ftdi-elan.c 	ftdi->disconnected += 1;
ftdi             2725 drivers/usb/misc/ftdi-elan.c 	if (ftdi->class) {
ftdi             2727 drivers/usb/misc/ftdi-elan.c 		struct usb_class_driver *class = ftdi->class;
ftdi             2730 drivers/usb/misc/ftdi-elan.c 		dev_info(&ftdi->udev->dev, "USB FTDI U132 jtag interface on minor %d now disconnected\n",
ftdi             2733 drivers/usb/misc/ftdi-elan.c 		ftdi_status_cancel_work(ftdi);
ftdi             2734 drivers/usb/misc/ftdi-elan.c 		ftdi_command_cancel_work(ftdi);
ftdi             2735 drivers/usb/misc/ftdi-elan.c 		ftdi_response_cancel_work(ftdi);
ftdi             2736 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_abandon_completions(ftdi);
ftdi             2737 drivers/usb/misc/ftdi-elan.c 		ftdi_elan_abandon_targets(ftdi);
ftdi             2738 drivers/usb/misc/ftdi-elan.c 		if (ftdi->registered) {
ftdi             2739 drivers/usb/misc/ftdi-elan.c 			platform_device_unregister(&ftdi->platform_dev);
ftdi             2740 drivers/usb/misc/ftdi-elan.c 			ftdi->synchronized = 0;
ftdi             2741 drivers/usb/misc/ftdi-elan.c 			ftdi->enumerated = 0;
ftdi             2742 drivers/usb/misc/ftdi-elan.c 			ftdi->initialized = 0;
ftdi             2743 drivers/usb/misc/ftdi-elan.c 			ftdi->registered = 0;
ftdi             2745 drivers/usb/misc/ftdi-elan.c 		ftdi->disconnected += 1;
ftdi             2747 drivers/usb/misc/ftdi-elan.c 		dev_info(&ftdi->udev->dev, "USB FTDI U132 host controller interface now disconnected\n");
ftdi             2749 drivers/usb/misc/ftdi-elan.c 	ftdi_elan_put_kref(ftdi);
ftdi             2774 drivers/usb/misc/ftdi-elan.c 	struct usb_ftdi *ftdi;
ftdi             2778 drivers/usb/misc/ftdi-elan.c 	list_for_each_entry_safe(ftdi, temp, &ftdi_static_list, ftdi_list) {
ftdi             2779 drivers/usb/misc/ftdi-elan.c 		ftdi_status_cancel_work(ftdi);
ftdi             2780 drivers/usb/misc/ftdi-elan.c 		ftdi_command_cancel_work(ftdi);
ftdi             2781 drivers/usb/misc/ftdi-elan.c 		ftdi_response_cancel_work(ftdi);