devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Roger Quadros <rogerq@kernel.org>,
	 Peter Chen <peter.chen@kernel.org>,
	Pawel Laszczak <pawell@cadence.com>,
	 Mathias Nyman <mathias.nyman@intel.com>,
	Nishanth Menon <nm@ti.com>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	Tero Kristo <kristo@kernel.org>
Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Kevin Hilman" <khilman@kernel.org>,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>
Subject: [PATCH v5 08/12] usb: cdns3: rename hibernated argument of role->resume() to lost_power
Date: Fri, 26 Jul 2024 20:17:56 +0200	[thread overview]
Message-ID: <20240726-s2r-cdns-v5-8-8664bfb032ac@bootlin.com> (raw)
In-Reply-To: <20240726-s2r-cdns-v5-0-8664bfb032ac@bootlin.com>

The cdns_role_driver->resume() callback takes a second boolean argument
named `hibernated` in its implementations. This is mistaken; the only
potential caller is:

int cdns_resume(struct cdns *cdns)
{
	/* ... */

	if (cdns->roles[cdns->role]->resume)
		cdns->roles[cdns->role]->resume(cdns, cdns_power_is_lost(cdns));

	return 0;
}

The argument can be true in cases outside of return from hibernation.
Reflect the true meaning by renaming both arguments to `lost_power`.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
 drivers/usb/cdns3/cdns3-gadget.c | 4 ++--
 drivers/usb/cdns3/cdnsp-gadget.c | 2 +-
 drivers/usb/cdns3/core.h         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index fd1beb10bba7..694aa1457739 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -3468,7 +3468,7 @@ __must_hold(&cdns->lock)
 	return 0;
 }
 
-static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated)
+static int cdns3_gadget_resume(struct cdns *cdns, bool lost_power)
 {
 	struct cdns3_device *priv_dev = cdns->gadget_dev;
 
@@ -3476,7 +3476,7 @@ static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated)
 		return 0;
 
 	cdns3_gadget_config(priv_dev);
-	if (hibernated)
+	if (lost_power)
 		writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf);
 
 	return 0;
diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index 4a3f0f958256..7d05180442fb 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -1973,7 +1973,7 @@ static int cdnsp_gadget_suspend(struct cdns *cdns, bool do_wakeup)
 	return 0;
 }
 
-static int cdnsp_gadget_resume(struct cdns *cdns, bool hibernated)
+static int cdnsp_gadget_resume(struct cdns *cdns, bool lost_power)
 {
 	struct cdnsp_device *pdev = cdns->gadget_dev;
 	enum usb_device_speed max_speed;
diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
index 9207bd6365f7..f385d3980545 100644
--- a/drivers/usb/cdns3/core.h
+++ b/drivers/usb/cdns3/core.h
@@ -30,7 +30,7 @@ struct cdns_role_driver {
 	int (*start)(struct cdns *cdns);
 	void (*stop)(struct cdns *cdns);
 	int (*suspend)(struct cdns *cdns, bool do_wakeup);
-	int (*resume)(struct cdns *cdns, bool hibernated);
+	int (*resume)(struct cdns *cdns, bool lost_power);
 	const char *name;
 #define CDNS_ROLE_STATE_INACTIVE	0
 #define CDNS_ROLE_STATE_ACTIVE		1

-- 
2.45.2


  parent reply	other threads:[~2024-07-26 18:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26 18:17 [PATCH v5 00/12] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) Théo Lebrun
2024-07-26 18:17 ` [PATCH v5 01/12] dt-bindings: usb: ti,j721e-usb: fix compatible list Théo Lebrun
2024-08-05 13:31   ` Roger Quadros
2024-07-26 18:17 ` [PATCH v5 02/12] dt-bindings: usb: ti,j721e-usb: add ti,j7200-usb compatible Théo Lebrun
2024-07-26 19:26   ` Rob Herring (Arm)
2024-09-10 10:03     ` Théo Lebrun
2024-07-26 18:17 ` [PATCH v5 03/12] usb: cdns3-ti: move reg writes to separate function Théo Lebrun
2024-07-26 18:17 ` [PATCH v5 04/12] usb: cdns3-ti: run HW init at resume() if HW was reset Théo Lebrun
2024-07-26 18:17 ` [PATCH v5 05/12] usb: cdns3: add quirk to platform data for reset-on-resume Théo Lebrun
2024-08-05 13:49   ` Roger Quadros
2024-07-26 18:17 ` [PATCH v5 06/12] usb: cdns3-ti: grab auxdata from match data Théo Lebrun
2024-08-05 13:51   ` Roger Quadros
2024-07-26 18:17 ` [PATCH v5 07/12] usb: cdns3-ti: add J7200 support with reset-on-resume behavior Théo Lebrun
2024-08-05 13:54   ` Roger Quadros
2024-09-10 13:57     ` Théo Lebrun
2024-07-26 18:17 ` Théo Lebrun [this message]
2024-07-26 18:17 ` [PATCH v5 09/12] xhci: introduce xhci->lost_power flag Théo Lebrun
2024-08-05 13:41   ` Roger Quadros
2024-09-10 13:50     ` Théo Lebrun
2024-11-20 14:49       ` Roger Quadros
2024-07-26 18:17 ` [PATCH v5 10/12] usb: cdns3: host: transmit lost_power signal from wrapper to XHCI Théo Lebrun
2024-07-26 18:17 ` [PATCH v5 11/12] arm64: dts: ti: k3-j7200: use J7200-specific USB compatible Théo Lebrun
2024-08-05 14:01   ` Roger Quadros
2024-07-26 18:18 ` [PATCH v5 12/12] arm64: dts: ti: k3-am64: add USB fallback compatible to J721E Théo Lebrun
2024-08-05 14:03   ` Roger Quadros
2024-08-03 15:14 ` [PATCH v5 00/12] Fix USB suspend on TI J7200 (cdns3-ti, cdns3, xhci) Roger Quadros
2024-08-05  8:58   ` Théo Lebrun
2024-08-05 14:01     ` Roger Quadros
2024-08-06 23:12     ` Kevin Hilman
2024-08-09  1:19 ` Peter Chen
2024-09-10 14:04   ` Théo Lebrun
2024-09-01 20:20 ` (subset) " Nishanth Menon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240726-s2r-cdns-v5-8-8664bfb032ac@bootlin.com \
    --to=theo.lebrun@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@bootlin.com \
    --cc=khilman@kernel.org \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=nm@ti.com \
    --cc=pawell@cadence.com \
    --cc=peter.chen@kernel.org \
    --cc=robh@kernel.org \
    --cc=rogerq@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).