gadget.c (abd064a19d81001412281501819622d1568309e0) gadget.c (66e77a24a8c36ff83f0a12f44d23d8141e82fa3b)
1// SPDX-License-Identifier: GPL-2.0
2/**
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>

--- 4332 unchanged lines hidden (view full) ---

4341 hsotg->enabled = is_on;
4342 return 0;
4343 }
4344
4345 spin_lock_irqsave(&hsotg->lock, flags);
4346 if (is_on) {
4347 hsotg->enabled = 1;
4348 dwc2_hsotg_core_init_disconnected(hsotg, false);
1// SPDX-License-Identifier: GPL-2.0
2/**
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>

--- 4332 unchanged lines hidden (view full) ---

4341 hsotg->enabled = is_on;
4342 return 0;
4343 }
4344
4345 spin_lock_irqsave(&hsotg->lock, flags);
4346 if (is_on) {
4347 hsotg->enabled = 1;
4348 dwc2_hsotg_core_init_disconnected(hsotg, false);
4349 /* Enable ACG feature in device mode,if supported */
4350 dwc2_enable_acg(hsotg);
4349 dwc2_hsotg_core_connect(hsotg);
4350 } else {
4351 dwc2_hsotg_core_disconnect(hsotg);
4352 dwc2_hsotg_disconnect(hsotg);
4353 hsotg->enabled = 0;
4354 }
4355
4356 hsotg->gadget.speed = USB_SPEED_UNKNOWN;

--- 16 unchanged lines hidden (view full) ---

4373 */
4374 if (hsotg->lx_state == DWC2_L2)
4375 dwc2_exit_hibernation(hsotg, false);
4376
4377 if (is_active) {
4378 hsotg->op_state = OTG_STATE_B_PERIPHERAL;
4379
4380 dwc2_hsotg_core_init_disconnected(hsotg, false);
4351 dwc2_hsotg_core_connect(hsotg);
4352 } else {
4353 dwc2_hsotg_core_disconnect(hsotg);
4354 dwc2_hsotg_disconnect(hsotg);
4355 hsotg->enabled = 0;
4356 }
4357
4358 hsotg->gadget.speed = USB_SPEED_UNKNOWN;

--- 16 unchanged lines hidden (view full) ---

4375 */
4376 if (hsotg->lx_state == DWC2_L2)
4377 dwc2_exit_hibernation(hsotg, false);
4378
4379 if (is_active) {
4380 hsotg->op_state = OTG_STATE_B_PERIPHERAL;
4381
4382 dwc2_hsotg_core_init_disconnected(hsotg, false);
4381 if (hsotg->enabled)
4383 if (hsotg->enabled) {
4384 /* Enable ACG feature in device mode,if supported */
4385 dwc2_enable_acg(hsotg);
4382 dwc2_hsotg_core_connect(hsotg);
4386 dwc2_hsotg_core_connect(hsotg);
4387 }
4383 } else {
4384 dwc2_hsotg_core_disconnect(hsotg);
4385 dwc2_hsotg_disconnect(hsotg);
4386 }
4387
4388 spin_unlock_irqrestore(&hsotg->lock, flags);
4389 return 0;
4390}

--- 348 unchanged lines hidden (view full) ---

4739 return 0;
4740
4741 if (hsotg->driver) {
4742 dev_info(hsotg->dev, "resuming usb gadget %s\n",
4743 hsotg->driver->driver.name);
4744
4745 spin_lock_irqsave(&hsotg->lock, flags);
4746 dwc2_hsotg_core_init_disconnected(hsotg, false);
4388 } else {
4389 dwc2_hsotg_core_disconnect(hsotg);
4390 dwc2_hsotg_disconnect(hsotg);
4391 }
4392
4393 spin_unlock_irqrestore(&hsotg->lock, flags);
4394 return 0;
4395}

--- 348 unchanged lines hidden (view full) ---

4744 return 0;
4745
4746 if (hsotg->driver) {
4747 dev_info(hsotg->dev, "resuming usb gadget %s\n",
4748 hsotg->driver->driver.name);
4749
4750 spin_lock_irqsave(&hsotg->lock, flags);
4751 dwc2_hsotg_core_init_disconnected(hsotg, false);
4747 if (hsotg->enabled)
4752 if (hsotg->enabled) {
4753 /* Enable ACG feature in device mode,if supported */
4754 dwc2_enable_acg(hsotg);
4748 dwc2_hsotg_core_connect(hsotg);
4755 dwc2_hsotg_core_connect(hsotg);
4756 }
4749 spin_unlock_irqrestore(&hsotg->lock, flags);
4750 }
4751
4752 return 0;
4753}
4754
4755/**
4756 * dwc2_backup_device_registers() - Backup controller device registers.

--- 99 unchanged lines hidden ---
4757 spin_unlock_irqrestore(&hsotg->lock, flags);
4758 }
4759
4760 return 0;
4761}
4762
4763/**
4764 * dwc2_backup_device_registers() - Backup controller device registers.

--- 99 unchanged lines hidden ---