Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1418209

[RFC v4 12/14] EXAMPLE CODE: usb: hub: Power sequence the ports on activation

From Krzysztof Kozlowski <k.kozlowski@samsung.com>
Newsgroups linux.kernel
Subject [RFC v4 12/14] EXAMPLE CODE: usb: hub: Power sequence the ports on activation
Date 2016-06-09 11:50 +0200
Message-ID <rI4L8-4zR-41@gated-at.bofh.it> (permalink)
References <rI4L7-4zR-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The autodetection of attached USB device might not work on certain
boards where the power is delivered externally.  These devices also might
require a hard reset.  Use pwrseq for that in USB hub.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/usb/core/hub.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c421745b84aa..46d9f9aedacc 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -26,6 +26,7 @@
 #include <linux/mutex.h>
 #include <linux/random.h>
 #include <linux/pm_qos.h>
+#include <linux/pwrseq.h>
 
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
@@ -1663,6 +1664,15 @@ static int hub_configure(struct usb_hub *hub,
 
 	usb_hub_adjust_deviceremovable(hdev, hub->descriptor);
 
+	/* FIXME: When do the pre-power-on? */
+	/*
+	for (i = 0; i < maxchild; i++)
+		pwrseq_pre_power_on(hub->ports[i]->pwrseq);
+	*/
+
+	for (i = 0; i < maxchild; i++)
+		pwrseq_post_power_on(hub->ports[i]->pwrseq);
+
 	hub_activate(hub, HUB_INIT);
 	return 0;
 
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v4 00/14] usb/mmc/power: Generic power sequence (and fix USB/LAN  when TFTP booting) Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 11:50 +0200
  [RFC v4 14/14] ARM: dts: exynos: Fix LAN and HUB after bootloader  initialization on Odroid U3 Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 11:50 +0200
  [RFC v4 12/14] EXAMPLE CODE: usb: hub: Power sequence the ports on  activation Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 11:50 +0200
  [RFC v4 07/14] power: pwrseq: Generalize mmc_pwrseq operations by  removing mmc prefix Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200
  [RFC v4 04/14] MAINTAINERS: Retain Ulf Hansson as the same maintainer  of pwrseq Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200
  [RFC v4 09/14] power: pwrseq: Add support for USB hubs with external  power Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200
  [RFC v4 02/14] simplefb: Use new devm_of_regulator_all_get helper and  bulk API Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200
  [RFC v4 01/14] regulator: of: Add helper for getting all supplies Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200
    Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies Mark Brown <broonie@kernel.org> - 2016-06-09 12:40 +0200
      Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 13:50 +0200
        Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies Rob Herring <robh@kernel.org> - 2016-06-10 19:40 +0200
          Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies Heiko Stübner <heiko@sntech.de> - 2016-06-10 21:00 +0200
      Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies "Rafael J. Wysocki" <rafael@kernel.org> - 2016-06-09 15:00 +0200
        Re: [RFC v4 01/14] regulator: of: Add helper for getting all supplies Mark Brown <broonie@kernel.org> - 2016-06-09 18:00 +0200
  [RFC v4 03/14] power/mmc: Move pwrseq drivers to power/pwrseq Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-09 12:00 +0200

csiph-web