All of lore.kernel.org
 help / color / mirror / Atom feed
* [01/14] usb: dwc2: Rename hibernation to partial_power_down
@ 2018-02-15 13:23 Felipe Balbi
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2018-02-15 13:23 UTC (permalink / raw)
  To: Grigor Tovmasyan, John Youn, Greg Kroah-Hartman, linux-usb

Grigor Tovmasyan <Grigor.Tovmasyan@synopsys.com> writes:

> From: Vardan Mikayelyan <mvardan@synopsys.com>
>
> No-op change, only rename.
>
> This code was misnamed originally. It was only responsible for partial
> power down and not for hibernation.
>
> Rename core_params->hibernation to core_params->power_down,
> dwc2_set_param_hibernation() to dwc2_set_param_power_down().
>
> Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
> Signed-off-by: John Youn <johnyoun@synopsys.com>
> Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>

Fails to apply, please rebase:

checking file drivers/usb/dwc2/core.c
Hunk #1 succeeded at 126 (offset -2 lines).
Hunk #2 succeeded at 180 (offset -2 lines).
Hunk #3 succeeded at 218 (offset -2 lines).
checking file drivers/usb/dwc2/core.h
Hunk #2 FAILED at 498.
Hunk #3 FAILED at 1110.
2 out of 3 hunks FAILED
checking file drivers/usb/dwc2/core_intr.c
Hunk #2 succeeded at 361 (offset -56 lines).
Hunk #3 succeeded at 441 (offset -56 lines).
checking file drivers/usb/dwc2/debugfs.c
Hunk #1 FAILED at 754.
1 out of 1 hunk FAILED
checking file drivers/usb/dwc2/gadget.c
Hunk #1 succeeded at 3523 (offset -42 lines).
Hunk #2 succeeded at 4368 (offset -44 lines).
checking file drivers/usb/dwc2/hcd.c
Hunk #1 succeeded at 3389 (offset -3 lines).
Hunk #2 succeeded at 3424 (offset -3 lines).
Hunk #3 succeeded at 4356 (offset -3 lines).
Hunk #4 succeeded at 4370 (offset -3 lines).
Hunk #5 succeeded at 4386 (offset -3 lines).
Hunk #6 succeeded at 4411 (offset -3 lines).
Hunk #7 succeeded at 4433 (offset -3 lines).
checking file drivers/usb/dwc2/params.c
Hunk #1 FAILED at 278.
1 out of 1 hunk FAILED

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [01/14] usb: dwc2: Rename hibernation to partial_power_down
@ 2018-02-15 14:43 Grigor Tovmasyan
  0 siblings, 0 replies; 3+ messages in thread
From: Grigor Tovmasyan @ 2018-02-15 14:43 UTC (permalink / raw)
  To: Felipe Balbi, Grigor Tovmasyan, John Youn, Greg Kroah-Hartman, linux-usb

Hi Balbi

On 2/15/2018 17:23, Felipe Balbi wrote:
> Grigor Tovmasyan <Grigor.Tovmasyan@synopsys.com> writes:
> 
>> From: Vardan Mikayelyan <mvardan@synopsys.com>
>>
>> No-op change, only rename.
>>
>> This code was misnamed originally. It was only responsible for partial
>> power down and not for hibernation.
>>
>> Rename core_params->hibernation to core_params->power_down,
>> dwc2_set_param_hibernation() to dwc2_set_param_power_down().
>>
>> Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
>> Signed-off-by: John Youn <johnyoun@synopsys.com>
>> Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
> 
> Fails to apply, please rebase:
> 
> checking file drivers/usb/dwc2/core.c
> Hunk #1 succeeded at 126 (offset -2 lines).
> Hunk #2 succeeded at 180 (offset -2 lines).
> Hunk #3 succeeded at 218 (offset -2 lines).
> checking file drivers/usb/dwc2/core.h
> Hunk #2 FAILED at 498.
> Hunk #3 FAILED at 1110.
> 2 out of 3 hunks FAILED
> checking file drivers/usb/dwc2/core_intr.c
> Hunk #2 succeeded at 361 (offset -56 lines).
> Hunk #3 succeeded at 441 (offset -56 lines).
> checking file drivers/usb/dwc2/debugfs.c
> Hunk #1 FAILED at 754.
> 1 out of 1 hunk FAILED
> checking file drivers/usb/dwc2/gadget.c
> Hunk #1 succeeded at 3523 (offset -42 lines).
> Hunk #2 succeeded at 4368 (offset -44 lines).
> checking file drivers/usb/dwc2/hcd.c
> Hunk #1 succeeded at 3389 (offset -3 lines).
> Hunk #2 succeeded at 3424 (offset -3 lines).
> Hunk #3 succeeded at 4356 (offset -3 lines).
> Hunk #4 succeeded at 4370 (offset -3 lines).
> Hunk #5 succeeded at 4386 (offset -3 lines).
> Hunk #6 succeeded at 4411 (offset -3 lines).
> Hunk #7 succeeded at 4433 (offset -3 lines).
> checking file drivers/usb/dwc2/params.c
> Hunk #1 FAILED at 278.
> 1 out of 1 hunk FAILED
> 

I will rebase this patch series also.

Thanks, Grigor.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [01/14] usb: dwc2: Rename hibernation to partial_power_down
@ 2018-01-26 11:45 Grigor Tovmasyan
  0 siblings, 0 replies; 3+ messages in thread
From: Grigor Tovmasyan @ 2018-01-26 11:45 UTC (permalink / raw)
  To: John Youn, Felipe Balbi, Greg Kroah-Hartman, linux-usb; +Cc: Grigor Tovmasyan

From: Vardan Mikayelyan <mvardan@synopsys.com>

No-op change, only rename.

This code was misnamed originally. It was only responsible for partial
power down and not for hibernation.

Rename core_params->hibernation to core_params->power_down,
dwc2_set_param_hibernation() to dwc2_set_param_power_down().

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
---
 drivers/usb/dwc2/core.c      | 14 +++++++-------
 drivers/usb/dwc2/core.h      | 12 ++++++------
 drivers/usb/dwc2/core_intr.c | 14 +++++++-------
 drivers/usb/dwc2/debugfs.c   |  2 +-
 drivers/usb/dwc2/gadget.c    |  6 +++---
 drivers/usb/dwc2/hcd.c       | 26 +++++++++++++-------------
 drivers/usb/dwc2/params.c    |  2 +-
 7 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index 7a236e61e2e2..e26aeda29bba 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -128,17 +128,17 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg)
 }
 
 /**
- * dwc2_exit_hibernation() - Exit controller from Partial Power Down.
+ * dwc2_exit_partial_power_down() - Exit controller from Partial Power Down.
  *
  * @hsotg: Programming view of the DWC_otg controller
  * @restore: Controller registers need to be restored
  */
-int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore)
+int dwc2_exit_partial_power_down(struct dwc2_hsotg *hsotg, bool restore)
 {
 	u32 pcgcctl;
 	int ret = 0;
 
-	if (!hsotg->params.hibernation)
+	if (!hsotg->params.power_down)
 		return -ENOTSUPP;
 
 	pcgcctl = dwc2_readl(hsotg->regs + PCGCTL);
@@ -182,16 +182,16 @@ int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore)
 }
 
 /**
- * dwc2_enter_hibernation() - Put controller in Partial Power Down.
+ * dwc2_enter_partial_power_down() - Put controller in Partial Power Down.
  *
  * @hsotg: Programming view of the DWC_otg controller
  */
-int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg)
+int dwc2_enter_partial_power_down(struct dwc2_hsotg *hsotg)
 {
 	u32 pcgcctl;
 	int ret = 0;
 
-	if (!hsotg->params.hibernation)
+	if (!hsotg->params.power_down)
 		return -ENOTSUPP;
 
 	/* Backup all registers */
@@ -220,7 +220,7 @@ int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg)
 
 	/*
 	 * Clear any pending interrupts since dwc2 will not be able to
-	 * clear them after entering hibernation.
+	 * clear them after entering partial_power_down.
 	 */
 	dwc2_writel(0xffffffff, hsotg->regs + GINTSTS);
 
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 5c17cf0482b9..93c58a4175c3 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -421,9 +421,9 @@ enum dwc2_ep0_state {
  *                      case.
  *                      0 - No (default)
  *                      1 - Yes
- * @hibernation:	Specifies whether the controller support hibernation.
- *			If hibernation is enabled, the controller will enter
- *			hibernation in both peripheral and host mode when
+ * @power_down:         Specifies whether the controller support power_down.
+ *			If power_down is enabled, the controller will enter
+ *			power_down in both peripheral and host mode when
  *			needed.
  *			0 - No (default)
  *			1 - Yes
@@ -498,7 +498,7 @@ struct dwc2_core_params {
 	bool reload_ctl;
 	bool uframe_sched;
 	bool external_id_pin_ctl;
-	bool hibernation;
+	bool power_down;
 	bool lpm;
 	bool lpm_clock_gating;
 	bool besl;
@@ -1110,8 +1110,8 @@ static inline bool dwc2_is_hs_iot(struct dwc2_hsotg *hsotg)
  * and the DWC_otg controller
  */
 int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait);
-int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg);
-int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore);
+int dwc2_enter_partial_power_down(struct dwc2_hsotg *hsotg);
+int dwc2_exit_partial_power_down(struct dwc2_hsotg *hsotg, bool restore);
 
 void dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host);
 void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg);
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
index 46b32ec7d343..41d7dda40cb1 100644
--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -321,10 +321,10 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
 
 	if (dwc2_is_device_mode(hsotg)) {
 		if (hsotg->lx_state == DWC2_L2) {
-			ret = dwc2_exit_hibernation(hsotg, true);
+			ret = dwc2_exit_partial_power_down(hsotg, true);
 			if (ret && (ret != -ENOTSUPP))
 				dev_err(hsotg->dev,
-					"exit hibernation failed\n");
+					"exit power_down failed\n");
 		}
 
 		/*
@@ -417,16 +417,16 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg)
 			/* Clear Remote Wakeup Signaling */
 			dctl &= ~DCTL_RMTWKUPSIG;
 			dwc2_writel(dctl, hsotg->regs + DCTL);
-			ret = dwc2_exit_hibernation(hsotg, true);
+			ret = dwc2_exit_partial_power_down(hsotg, true);
 			if (ret && (ret != -ENOTSUPP))
-				dev_err(hsotg->dev, "exit hibernation failed\n");
+				dev_err(hsotg->dev, "exit power_down failed\n");
 
 			call_gadget(hsotg, resume);
 		}
 		/* Change to L0 state */
 		hsotg->lx_state = DWC2_L0;
 	} else {
-		if (hsotg->params.hibernation)
+		if (hsotg->params.power_down)
 			return;
 
 		if (hsotg->lx_state != DWC2_L1) {
@@ -497,11 +497,11 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
 				return;
 			}
 
-			ret = dwc2_enter_hibernation(hsotg);
+			ret = dwc2_enter_partial_power_down(hsotg);
 			if (ret) {
 				if (ret != -ENOTSUPP)
 					dev_err(hsotg->dev,
-						"enter hibernation failed\n");
+						"enter power_down failed\n");
 				goto skip_power_saving;
 			}
 
diff --git a/drivers/usb/dwc2/debugfs.c b/drivers/usb/dwc2/debugfs.c
index bd9cd8829094..4f32e43bb934 100644
--- a/drivers/usb/dwc2/debugfs.c
+++ b/drivers/usb/dwc2/debugfs.c
@@ -754,7 +754,7 @@ static int params_show(struct seq_file *seq, void *v)
 	print_param_hex(seq, p, ahbcfg);
 	print_param(seq, p, uframe_sched);
 	print_param(seq, p, external_id_pin_ctl);
-	print_param(seq, p, hibernation);
+	print_param(seq, p, power_down);
 	print_param(seq, p, lpm);
 	print_param(seq, p, lpm_clock_gating);
 	print_param(seq, p, besl);
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index d017400caa6f..0d1cf29a5d0d 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3565,7 +3565,7 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
 
 		/* This event must be used only if controller is suspended */
 		if (hsotg->lx_state == DWC2_L2) {
-			dwc2_exit_hibernation(hsotg, true);
+			dwc2_exit_partial_power_down(hsotg, true);
 			hsotg->lx_state = DWC2_L0;
 		}
 	}
@@ -4412,11 +4412,11 @@ static int dwc2_hsotg_vbus_session(struct usb_gadget *gadget, int is_active)
 	spin_lock_irqsave(&hsotg->lock, flags);
 
 	/*
-	 * If controller is hibernated, it must exit from hibernation
+	 * If controller is hibernated, it must exit from power_down
 	 * before being initialized / de-initialized
 	 */
 	if (hsotg->lx_state == DWC2_L2)
-		dwc2_exit_hibernation(hsotg, false);
+		dwc2_exit_partial_power_down(hsotg, false);
 
 	if (is_active) {
 		hsotg->op_state = OTG_STATE_B_PERIPHERAL;
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index ea8f87f813aa..96a751d927d1 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -3392,10 +3392,10 @@ static void dwc2_port_suspend(struct dwc2_hsotg *hsotg, u16 windex)
 	hsotg->bus_suspended = true;
 
 	/*
-	 * If hibernation is supported, Phy clock will be suspended
+	 * If power_down is supported, Phy clock will be suspended
 	 * after registers are backuped.
 	 */
-	if (!hsotg->params.hibernation) {
+	if (!hsotg->params.power_down) {
 		/* Suspend the Phy Clock */
 		pcgctl = dwc2_readl(hsotg->regs + PCGCTL);
 		pcgctl |= PCGCTL_STOPPCLK;
@@ -3427,10 +3427,10 @@ static void dwc2_port_resume(struct dwc2_hsotg *hsotg)
 	spin_lock_irqsave(&hsotg->lock, flags);
 
 	/*
-	 * If hibernation is supported, Phy clock is already resumed
+	 * If power_down is supported, Phy clock is already resumed
 	 * after registers restore.
 	 */
-	if (!hsotg->params.hibernation) {
+	if (!hsotg->params.power_down) {
 		pcgctl = dwc2_readl(hsotg->regs + PCGCTL);
 		pcgctl &= ~PCGCTL_STOPPCLK;
 		dwc2_writel(pcgctl, hsotg->regs + PCGCTL);
@@ -4359,7 +4359,7 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
 	if (hsotg->op_state == OTG_STATE_B_PERIPHERAL)
 		goto unlock;
 
-	if (!hsotg->params.hibernation)
+	if (!hsotg->params.power_down)
 		goto skip_power_saving;
 
 	/*
@@ -4373,12 +4373,12 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
 		dwc2_writel(hprt0, hsotg->regs + HPRT0);
 	}
 
-	/* Enter hibernation */
-	ret = dwc2_enter_hibernation(hsotg);
+	/* Enter partial_power_down */
+	ret = dwc2_enter_partial_power_down(hsotg);
 	if (ret) {
 		if (ret != -ENOTSUPP)
 			dev_err(hsotg->dev,
-				"enter hibernation failed\n");
+				"enter partial_power_down failed\n");
 		goto skip_power_saving;
 	}
 
@@ -4389,7 +4389,7 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
 		spin_lock_irqsave(&hsotg->lock, flags);
 	}
 
-	/* After entering hibernation, hardware is no more accessible */
+	/* After entering partial_power_down, hardware is no more accessible */
 	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
 
 skip_power_saving:
@@ -4414,7 +4414,7 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
 	if (hsotg->lx_state != DWC2_L2)
 		goto unlock;
 
-	if (!hsotg->params.hibernation) {
+	if (!hsotg->params.power_down) {
 		hsotg->lx_state = DWC2_L0;
 		goto unlock;
 	}
@@ -4436,10 +4436,10 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
 		spin_lock_irqsave(&hsotg->lock, flags);
 	}
 
-	/* Exit hibernation */
-	ret = dwc2_exit_hibernation(hsotg, true);
+	/* Exit partial_power_down */
+	ret = dwc2_exit_partial_power_down(hsotg, true);
 	if (ret && (ret != -ENOTSUPP))
-		dev_err(hsotg->dev, "exit hibernation failed\n");
+		dev_err(hsotg->dev, "exit partial_power_down failed\n");
 
 	hsotg->lx_state = DWC2_L0;
 
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 48790f2dc483..c472e93de350 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -278,7 +278,7 @@ static void dwc2_set_default_params(struct dwc2_hsotg *hsotg)
 	p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
 	p->uframe_sched = true;
 	p->external_id_pin_ctl = false;
-	p->hibernation = false;
+	p->power_down = false;
 	p->lpm = true;
 	p->lpm_clock_gating = true;
 	p->besl = true;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-15 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15 13:23 [01/14] usb: dwc2: Rename hibernation to partial_power_down Felipe Balbi
  -- strict thread matches above, loose matches on Subject: below --
2018-02-15 14:43 Grigor Tovmasyan
2018-01-26 11:45 Grigor Tovmasyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.