Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbcKNBgG (ORCPT ); Sun, 13 Nov 2016 20:36:06 -0500 Received: from mail-sn1nam01on0063.outbound.protection.outlook.com ([104.47.32.63]:17304 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750789AbcKNBgD (ORCPT ); Sun, 13 Nov 2016 20:36:03 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:1289;Count:8 From: Peter Chen To: , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , Peter Chen Subject: [PATCH v10 0/8] power: add power sequence library Date: Mon, 14 Nov 2016 09:35:51 +0800 Message-ID: <1479087359-7547-1-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 X-IncomingHeaderCount: 8 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131235609607642770;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(336003)(339900001)(53754006)(189002)(199003)(8666005)(104016004)(189998001)(48376002)(68736007)(50466002)(77096005)(586003)(356003)(47776003)(2906002)(4326007)(305945005)(7846002)(50986999)(5660300001)(92566002)(85426001)(7416002)(106466001)(33646002)(626004)(7406005)(8936002)(97736004)(36756003)(5001770100001)(5003940100001)(86362001)(105606002)(2201001)(87936001)(6666003)(8676002)(50226002)(2171001)(81156014)(81166006)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2469;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD046;1:kHQYruqWcryMLQEjimQ/ncW6p8RfJd05SEIk08j08jyqGWdBQ43ytpZR5C+S4ri2dMABrK/NXEeSL6Sai6mi0ju7tHpFBC7u7w9sIW+iD6K5LMCxmwEUx6IY7AnUiqtZmLKbPYJgz5l95yHqnXyufAbHhJrG9ruQOIupGukWg+5oHWAQqeFTJ3MQ4RG5KejhVX1HQvqt97yyJEPJr1azaS2MBgM3EJZrHKifUqxYb+oznCW/s6cm3w9HN+HJQ6OP6OSaeWD2CEq+OrtuASTiOYAOsi4JlgGagCIEFMSPxWdJ+8HUgUpaa4JpdJRdOv1MCeErXzBjtdxSTQTxsVDC5ftnB6cd6hoETvjqsvUAmQv6MLu4PIkfCB/SJdwz+JbyjAM6/1Y4MxORDEYYkGVX50ydZ+E1kFv1tGC+OF+/hGayCzttHpjxs05CRY28kJlvZzWHQSfSoBbASoumagkmuj61AToCja7SE+SklrLgyiScxAOjboPgZGYKUwqKblDii/em3t8C/nECYJ1u44LVf73volqiXcHg2W/CjW8sg8IvJa7Sm4InkYzK1n2HbdhH5RnM8KSIyWXZ+ArbdG0Kg41ZjbcyDPWDWjLv1W+fbPjR0GHz+uLEzl70h4An1uPCWILb4gzN4fHknF8eGqE7KCvFftBUynXooFwsw2BQFWyhbiD1M/Vc0MKILaHYl52SCjktLi2IMyJ+2MxmsKlYuPdEYTpkw632gVUxUvrVdeRSIJ//l6lyLpcnixJhqmnY MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2469;2:Ghq/Wkb5pUlRgsVYJXBaVEGMwMdD5mYhtqT65e1ryD6eHc/N2gKEAsSgYcJMmewWumgZuepuW1RSKo424BddOPcTjUBWPOOpMzRoB5/Av2vw8KNRvArn8tji7k84Pp6p6QM1OMIgNhXNUD0sl7rwNefFAYH1K+YZUyUxMoxgwS0=;3:FL/bc7E5OzfVMWXmkEyRvrZMj/TKfPzmijRLEh200T8Lza7oPH4TrZeM68MLHshTwDVDYGe6bs4LUNicAwetQz/NM3R72L7kQ3th6KjMgnilcd6dcsTAC+qoNaD5P0Nm2937Km8RG44xdA4vPE8oySQYKav2hOG5bWyTnk57oL5je686FbYr9O0LgCLJKmL4jX9uWbVF2euMh2ggJ0V2JNym6WU08Df4U13jXrd5bw0gzk3NDSfxSRUnZPxf6FWsmDkAOPE4IGZ3JtpqmAqqYQ== X-MS-Office365-Filtering-Correlation-Id: 75f15bb0-56a9-4627-3d33-08d40c2e9700 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2469; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2469;25:j9BngHV47D6cNNAfiu6Cn6Gid8DN5asvLOHlpNHpwx9UmS0hVMgWGywy3VWqal5d4x861WRiajqoXA1Kdqb/aO+x6ilNXykFcrsB+C6EY8FD+F8a9617+AIMJbbTyM5jWS0Koquk0MVqibjvvTcg3YdMNxmTMm5VCWbaP+pyx+BoURCuoFsFV8MFEJsQschWw4smu80XP/l6DdaktXGM6lNqWen6uAr6iiYpXk2vyBZvfffL/p+k4CnqfFDu6ecrij+TYApsUDFCkndNYDZUk7uDXKcGXXdX6lIkFzLWb69mk8OahB8nqNKxvkyNp6yCPLJi+sX3WiT5vRA0VZoEhq7c345iFJp7zJMGFLudMhzphxbw7FEvpTjUo3PQzhwt1sYXd6IwU6rv7fhgX5cMMgCgGz2btQGzBy/TRkEsCrdukhpOERyYApIMRYv50dyeTDo/blye2CxxMV8uCi7/efFRyJj4Ix1LkhSI15rHFLquAnpxB7WQKwC4Rf3P6FuUTB2sef1GjULM7QobXdz5YfmwrdIkRXCjjuDlqkdJbrVoLo7rjMDFRD18o/J0R8X2EoUNP7+FCZTnTakf81TT2vsbl3UzZ992TaKrSFEaErUg8kl6xfq4R+x1P+yrWH9YS18CXADCeJCNiLhUhHmUxQb03nkreRi3FTQLjZFO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test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(13018025)(13024025)(13015025)(13023025)(13017025)(3002001)(10201501046)(6055026);SRVR:CY4PR03MB2469;BCL:0;PCL:0;RULEID:(400006);SRVR:CY4PR03MB2469; X-Forefront-PRVS: 0126A32F74 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2469;23:Q9IXLnlNlT9Yly4T0SACOo7fN9TL4Ck4R1+WtwuMw?= =?us-ascii?Q?DToO6OUIAU09FlKKH5PcJIb96wHi1Vb/FSb4zNaJ19hTtWJ6Rk6KdIR2ObeB?= =?us-ascii?Q?vjEOZTr00AgMaQDl1AbaSSJ2DCoUl7E50AJCSVGcmTarIvtgkHskyoC+WdaM?= =?us-ascii?Q?/EUUPOuvKGsK0bOW8c8d34gMddGUlun3+n2zq8Yg81rgf4AyfQGj5FgBsrJY?= =?us-ascii?Q?ZvATW6rlBw4dtXGkTPP+2Zrphmm7gi/BG+80tVha7lcmrzPe/oObjgcF7y8z?= =?us-ascii?Q?TlBrE5HYPlD8AtNdS3+hnqGJBbR4pxh02IRRT5kgh+sAZH4TSEkwSpuOd0As?= =?us-ascii?Q?ka1DM8gvq992g+0TVR6ZEOiyDd78rrViRn+2ZrOdqkVP4JKphyossqn7pYaV?= =?us-ascii?Q?XorokomdQf8D/K37g13u/gCnB/jIJ7JGEkn6coGSAUf5F/UfTqCY4no1/Xqw?= =?us-ascii?Q?MKBx+XhOLcked0OQSRv6TzLAf1N4V33WHn1CwNyz6MaNNRPfTOo6RM489Rq2?= =?us-ascii?Q?D7aMYeM6W/+45Zh7jfQb2QlI6xVGvvvBrM4N8xFJbeuGYaBMSFPGh7v00EQl?= =?us-ascii?Q?MZ95fTn9blhYu+PbsWGH9mcLF9VpwGCq/z+SwwMuvQ7AMZqk95IIQ3xuAT0t?= =?us-ascii?Q?OMfo2MGVvqmuykQS3Y0ZXp2m6EP3eYjoinhDl0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MfeozvvebvP4qBxi4PTuZghV0fXxM3+gPEFJy2hFmrfT51TF0qOUULa2muFFJqA3vM22XBdGpTrJeTMVbftaIuh8ECe3IfE66;24:LlxA3cih42yl+P8R0kagAZ3Rwlp70jo2iA79xmICLfxfvF09Sg5K5cKbDQzJeVFXb3jyDQ6BVuiV4+UgYw5P9d1BW9XmgCRL1lYbp+Dz0EM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2469;7:HQDYYLudMmgyjqAJpLUjnABBg7l5NMSEZL0Wl+xV0aw3bBDrL7w1Ib6pr/ZXVxCpFFOb1V69mE0Y978twkfAqr1XR+OkiWibp/GpxbdhC3Drz/F1egLQTJoryQw1lR99cSzidHV9wB1nWqdCCDzU9PsOhvfzzaeOhbWfk7FUUGayMAEI3XYysp/MQODr6uI6xdz5jKSWtJwVUzRvPF/t07l1/Y0FPANsB3wY0HNC6aR8q3gV9wR7ztxT9oONSWhn7OouH7foyzpSxJhatbKXeuTcxOoKlp5iObEVyWQR7RW3cGVgl8b6Nyr2NrHRPSI0rbHdhT5Irrw3F7iBkaFOrKIXqp/H+W0C+LEF9pyp+2Q= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2016 01:36:00.3586 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2469 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6288 Lines: 134 Hi all, This is a follow-up for my last power sequence framework patch set [1]. According to Rob Herring and Ulf Hansson's comments[2]. The kinds of power sequence instances will be added at postcore_initcall, the match criteria is compatible string first, if the compatible string is not matched between dts and library, it will try to use generic power sequence. The host driver just needs to call of_pwrseq_on/of_pwrseq_off if only one power sequence instance is needed, for more power sequences are used, using of_pwrseq_on_list/of_pwrseq_off_list instead (eg, USB hub driver). In future, if there are special power sequence requirements, the special power sequence library can be created. This patch set is tested on i.mx6 sabresx evk using a dts change, I use two hot-plug devices to simulate this use case, the related binding change is updated at patch [1/6], The udoo board changes were tested using my last power sequence patch set.[3] Except for hard-wired MMC and USB devices, I find the USB ULPI PHY also need to power on itself before it can be found by ULPI bus. [1] http://www.spinics.net/lists/linux-usb/msg142755.html [2] http://www.spinics.net/lists/linux-usb/msg143106.html [3] http://www.spinics.net/lists/linux-usb/msg142815.html Changes for v10: - Improve the kernel-doc for power sequence core, including exported APIs and main structure. [Patch 2/8] - Change Kconfig, and let the user choose power sequence. [Patch 2/8] - Delete EXPORT_SYMBOL and change related APIs as local, these APIs do not be intended to export currently. [Patch 2/8] - Selete POWER_SEQUENCE at USB core's Kconfig. [Patch 4/8] Changes for v9: - Add Vaibhav Hiremath's reviewed-by [Patch 4/8] - Rebase to v4.9-rc1 Changes for v8: - Allocate one extra pwrseq instance if pwrseq_get has succeed, it can avoid preallocate instances problem which the number of instance is decided at compile time, thanks for Heiko Stuebner's suggestion [Patch 2/8] - Delete pwrseq_compatible_sample.c which is the demo purpose to show compatible match method. [Patch 2/8] - Add Maciej S. Szmigiero's tested-by. [Patch 7/8] Changes for v7: - Create kinds of power sequence instance at postcore_initcall, and match the instance with node using compatible string, the beneit of this is the host driver doesn't need to consider which pwrseq instance needs to be used, and pwrseq core will match it, however, it eats some memories if less power sequence instances are used. [Patch 2/8] - Add pwrseq_compatible_sample.c to test match pwrseq using device_id. [Patch 2/8] - Fix the comments Vaibhav Hiremath adds for error path for clock and do not use device_node for parameters at pwrseq_on. [Patch 2/8] - Simplify the caller to use power sequence, follows Alan's commnets [Patch 4/8] - Tested three pwrseq instances together using both specific compatible string and generic libraries. Changes for v6: - Add Matthias Kaehlcke's Reviewed-by and Tested-by. (patch [2/6]) - Change chipidea core of_node assignment for coming user. (patch [5/6]) - Applies Joshua Clayton's three dts changes for two boards, the USB device's reg has only #address-cells, but without #size-cells. Changes for v5: - Delete pwrseq_register/pwrseq_unregister, which is useless currently - Fix the linker error when the pwrseq user is compiled as module Changes for v4: - Create the patch on next-20160722 - Fix the of_node is not NULL after chipidea driver is unbinded [Patch 5/6] - Using more friendly wait method for reset gpio [Patch 2/6] - Support multiple input clocks [Patch 2/6] - Add Rob Herring's ack for DT changes - Add Joshua Clayton's Tested-by Changes for v3: - Delete "power-sequence" property at binding-doc, and change related code at both library and user code. - Change binding-doc example node name with Rob's comments - of_get_named_gpio_flags only gets the gpio, but without setting gpio flags, add additional code request gpio with proper gpio flags - Add Philipp Zabel's Ack and MAINTAINER's entry Changes for v2: - Delete "pwrseq" prefix and clock-names for properties at dt binding - Should use structure not but its pointer for kzalloc - Since chipidea core has no of_node, let core's of_node equals glue layer's at core's probe Joshua Clayton (2): ARM: dts: imx6qdl: Enable usb node children with ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen (6): binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library power: add power sequence library binding-doc: usb: usb-device: add optional properties for power sequence usb: core: add power sequence handling for USB devices usb: chipidea: let chipidea core device of_node equal's glue layer device of_node ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property .../bindings/power/pwrseq/pwrseq-generic.txt | 48 +++++ .../devicetree/bindings/usb/usb-device.txt | 10 +- MAINTAINERS | 9 + arch/arm/boot/dts/imx6q-evi.dts | 25 +-- arch/arm/boot/dts/imx6qdl-udoo.dtsi | 26 ++- arch/arm/boot/dts/imx6qdl.dtsi | 6 + drivers/power/Kconfig | 1 + drivers/power/Makefile | 1 + drivers/power/pwrseq/Kconfig | 21 ++ drivers/power/pwrseq/Makefile | 2 + drivers/power/pwrseq/core.c | 237 +++++++++++++++++++++ drivers/power/pwrseq/pwrseq_generic.c | 183 ++++++++++++++++ drivers/usb/Kconfig | 1 + drivers/usb/chipidea/core.c | 27 ++- drivers/usb/core/hub.c | 41 +++- drivers/usb/core/hub.h | 1 + include/linux/power/pwrseq.h | 60 ++++++ 17 files changed, 658 insertions(+), 41 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/pwrseq/pwrseq-generic.txt create mode 100644 drivers/power/pwrseq/Kconfig create mode 100644 drivers/power/pwrseq/Makefile create mode 100644 drivers/power/pwrseq/core.c create mode 100644 drivers/power/pwrseq/pwrseq_generic.c create mode 100644 include/linux/power/pwrseq.h -- 2.7.4