From patchwork Fri Jun 17 10:09:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9183257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B6E16075F for ; Fri, 17 Jun 2016 10:18:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85E7F28388 for ; Fri, 17 Jun 2016 10:18:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7637B28399; Fri, 17 Jun 2016 10:18:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C8D728388 for ; Fri, 17 Jun 2016 10:18:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDqp7-00061H-GF; Fri, 17 Jun 2016 10:16:25 +0000 Received: from mail-by2on0601.outbound.protection.outlook.com ([2a01:111:f400:fc0c::601] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDqp0-0005vK-AL for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2016 10:16:20 +0000 Received: from CH1PR03CA006.namprd03.prod.outlook.com (10.255.156.151) by BY2PR0301MB1622.namprd03.prod.outlook.com (10.163.28.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Fri, 17 Jun 2016 10:15:55 +0000 Received: from BL2FFO11FD055.protection.gbl (10.255.156.132) by CH1PR03CA006.outlook.office365.com (10.255.156.151) with Microsoft SMTP Server (TLS) id 15.1.501.7 via Frontend Transport; Fri, 17 Jun 2016 10:15:55 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD055.mail.protection.outlook.com (10.173.161.183) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Fri, 17 Jun 2016 10:15:55 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u5HAFbSn029984; Fri, 17 Jun 2016 03:15:48 -0700 From: Peter Chen To: , , , , , Subject: [PATCH 01/12] power/mmc: Move pwrseq drivers to power/pwrseq Date: Fri, 17 Jun 2016 18:09:14 +0800 Message-ID: <1466158165-9380-2-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466158165-9380-1-git-send-email-peter.chen@nxp.com> References: <1466158165-9380-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131106321554225207; (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)(339900001)(199003)(189002)(5008740100001)(81166006)(8676002)(81156014)(48376002)(2950100001)(229853001)(356003)(77096005)(104016004)(5001770100001)(33646002)(189998001)(19580405001)(19580395003)(105606002)(8936002)(50466002)(97736004)(106466001)(5003940100001)(85426001)(92566002)(11100500001)(586003)(4326007)(2906002)(87936001)(2171001)(68736007)(36756003)(76176999)(50986999)(6806005)(86362001)(575784001)(50226002)(2201001)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB1622; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD055; 1:eeMURDADppJiqHXbyWUifmD5ZaCu94N+tTd/tUe+tcP8sP54/bx3P3dFYMsukVrcfG1T1XwwXzY4QHK9Camyic4/c3kdrC9bAx4b8D/iHYaQf2EUWwBlU9X081BhCdEjt91JI82uaASemIO27kgf1VPfmi6CQwyWkNKp98/KrCa6YqiCuiuGNwb1thW0CywqmzMfFydnU8+vzyyfP+ts1qZ+2lfz98ADWKfMk43aMH5dO4q5ydA/PQ17mzs9F5e/gvYaR60OCDJucpicuDHH9Z5kwA9Zrfold+sIsT0qz29S2I96AT/u+dxQwJsseLDDJ1QmE+fqWWf/0hDaa3XhJA5Cl3nsH5dZZ/hOoZI3u8WRMM4zPKAHT09+Qxt59NOjsTNR+Fy9ph/ybMY8dMfTlU4oyiQ/fNrEl3nQyg5qf41N6oTfSgOnFh0lLR/9kFxIwG8Rr07xWtUaOz2fglXs5uHibFypXLLIK+BHLiyfxW9kmqxCpy+thR9Umh/HPnXSfkVhfOEIlczEKU3zTt2Vvm0p+lJSmKhZxScBf3v7qNRVQfOYy3ZAzUfCUK8qgEliXo2Fz0LGLshVWaoL9ln+HnKgNDDtkIy3YJ+uGycmo2D8o+G5fqweqFOppKZfMQMc MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 02b457a7-115a-4dbb-d6da-08d396985e80 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 2:JcZv+Qzrh+nJPefTbT3qml3rFVgAktd/12+2gic3t8VzPbyGeb4kJUadg48BhYAZIx+WLPJuemLdtG0z9Acxq/HI0Qfk8H9r7hEmMnpGuVdhnLG3m4gbpuGC/9PRGYXVoTTYBXBV97px70hu2BtX0rROnunaM0E+9hM3oSjxdI8QSJE//dlh4sf7HSG/MvZ1; 3:DXmIzPu0wiQZjpsgaoQWCsxu1A8Iu94YcOzOWFM34LJiTzjwE/J7JHNtTqMXGlTKnQ04h+lsD/qUwecV6En1R8TQ2gJtK5MSx0RQ+6ZgTw11X0Rx1Q2y5fN+f2mlmBWTWHToyfjHAAArNTbnaBC1o28b9beOcFqKKQ7/SANsGD+LfqdM3Cl9gfkMCY0P7Dgi8AFIOH9GcEGrSFeH33y9lURrIESDJ9tGxBeWP96G6Io= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1622; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 25:2Dl14OukLuowcH7EjOmrqLP4Ub9u/J56znfkkCsjo3HEnkZ7nD01beJG/XhKe3O+Y1eenQq4NXmSyTt0HRMwXtcaEbGaKm1eS4ddT4eazQZOC1HXeWxA+WIz7chK90VcBQ3gq2e7wTeqFj8zayAjsPjK4HCkBC9JEdYiRUFo/qa3xG6fMNi+OxGLPlujjcvHce0xa9+hDCcn6mIIO7/bXZnQvHHldWQM6m7dHGO0jYoin7Gs99GfmvAX0yU4Az9uZ8kXQw8k8Cxlf690/MdaEzSQT479wkaaRytTnvtAh5ED/MmHeArdsFLhADRgmIICChm6CvIIpLd9HVh6LB/Z8G8tX3Nvk2PcjQQnYum3sSpec38iosrMsuW60SI+ZXzsmLkfVhbWqSbPr/a3DDKEbmtfZMJzxljUQ37h5het6umL9wN4+q0yfGjCy92ogLHtxw5NX0qF44+2qgHuGYA/UVqY1zumq6YFXv2smrPyW6K+SqTyd+Zu80QpG/3biGTEmeNWMb49SzYvpep5ihdEKA/ufeTgnr9laMCKRVnH3fe5dUWn8oZK6gYGu13dAZS6OB0BTWmoi8rND/3V2gPguJzXQkg2AXqrU7EVJHXfvi1KY1r0RCu3y9N9mT0nn2DmkaeOPSTOiwf+e6XBrySF1BzHRRZ4IAob8f12sO1vzSIBMFe3UwjBWhyCcS2QALK3YeGMRYzKwRE/UhlX1D5HUmOtIHNucn910afLIFllgrcjCuqWwbpNSE9QZthek59koY1DZDfm/y0YVP+hxI8NzQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(7411616537696); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR0301MB1622; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB1622; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 4:XC8qkLR0f7fU6XZhkdT6dHk7DUJjTYeXgOpXBJ7D/d/0C8gnDiJW7vPiJsQpvb9fdkVry1BsG+sgcBlOlCFSCy6ppiziIfN17wZr9yujrFBi5X+PsWCosz4rl/KjH/YP9vwLHfVCcLw2OaIYt4lbqh3aodTLSs46TzGq8avuDEYEYszIvUBgFsxaGNzvD+PuHvuFlrvPjHXHKkgWBTZ3fcokT1A+wv/XV1/RAnRambNecZ3jJqsTjaTLNMNcyQZ3Dx7OzhgSTU/aoC/LxJdYNyjqwa/fq9Kn/y2U+NPrUyNMZm0ZPPq2cqB56cLeP5LwSQiiWF0E8ntfuvv47wsTw7Yw3jmrtARJh36pBfCXsdBwxNNWaH3mhMrF7rjwVGtPMS1N8tK4O/qcxFhH0ohMoNkClOEQ1reJGGpVJUd6giTVl3iOysiGtQzzZHPTTmgoEupDK8um2eOeWFijEsFLLKChrm97oDOzS0DQhvuan6lI0WtLQk5JwlDIzlbYhTZfknr1C2AK7fx/U5yaMZtIzQ== X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1622; 23:D8k4HCtyhKOIBPl6a7RUWA2QULtYZfLUiwH/aLI?= =?us-ascii?Q?6qdj7SySwzsZFQn8SWadL/bnFNx+UL8K9j4GkKLy47wWo4a9nUS5CX1Iu4Sn?= =?us-ascii?Q?Fy085uU1FfQqHeduD1FFhxdmjvHOS8kz3LWMpxHfCMzXm/vzasbaophZFGcM?= =?us-ascii?Q?e23lWZY6GtBINstutWrK0UHnx1xWg7W96yhcQ0JFu3NldVoFvSSy7FDw9JTQ?= =?us-ascii?Q?CAFpbQX13eDUamArOHZKDR4SDKO4Uz1TQ+yfnMWrd+24W9Cg2Z9BwaAtbI5q?= =?us-ascii?Q?h6DxEOJHe32J0uBObma469GpXfPPjTYWIPl/FkdsbsdiZovtCdL3d5jMSWCn?= =?us-ascii?Q?zmChIT6eFjA3rZd+/3NAIZuOSHLvOyasGWSdo+Si9MLcW91JfUs+oEUs4EZj?= =?us-ascii?Q?yFHzie6QZBB455XwMqLSPjP4Byc/dPdnfkS+mTUFtzeaumuz9zswELrkjBA2?= =?us-ascii?Q?MRMe0g1Mwej87qLEUpm6WCLHLoB6ZqHz8r6I1ddIX/ipG6PG5eO0jYKVr5/g?= =?us-ascii?Q?Ozvtn4Ygpc7pqmuivKUEGGgIovkrRsn9pqe9xFZlMLskw0NgDAb1PVLPL8Xz?= =?us-ascii?Q?BXaebhCfPlZsYBjjpDr3XmWvOFOUu+Fg2j+6+iRXbR47yWPpRzGJMhdIN6QH?= =?us-ascii?Q?QIUk/Bp5SQB2m3sRWQR4rby1c63XeqddFwnRlGS9RMKNueXngrWzC9T+LJgO?= =?us-ascii?Q?0HnPOg8wbCGgysYU1uzBfuYrLvsY7rwOij8C2gp/Z5lN8+UcC8ZsH/w/Iz4F?= =?us-ascii?Q?Ew8XtnebVx11yX1HIHCViSizjC0QZZKS92bciFBBGXiazLQkyYeub8EqNMW+?= =?us-ascii?Q?N3uZSiPkrU9yMI+JWL99LlEflWLxcYFUMeRZt2mva0oJZcXN17qEBPShWC+Q?= =?us-ascii?Q?T1MUsbIJL3w9M8mDy75yxwhO4C5VSQT7f7S4SCuluMkWLK9I9zABtNTRpiNc?= =?us-ascii?Q?nG1imAZyIdP8XeWTroebpmLIVgKpGcjTyWN7VHfkXxDuo2aGARQeIGG6r77O?= =?us-ascii?Q?1k20AJRs/XJURblr+YGZ9RzuXVBKMmhUE+eqggKpfpNRvZ5FpIADRnT3PNgF?= =?us-ascii?Q?I+SD2+orRzz4+4KBkkMp9XNK2/NIppiOuL8z901xBhmISwDLGENArsDIqo5p?= =?us-ascii?Q?E269NAOCHBwkfTd09KXqPij0HI8Jiita1IhQNeqoLQGgvowMKQZJaU0gvHUx?= =?us-ascii?Q?3U/niyPl4VN1/hYU=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1622; 6:3b2WdYxTRy43MEgasjDPUf04sjhq247rPQy/I4XOSDhBr7MtYscEwxHaLiB+Ku5DbefLvYvA8AaWrS+5JWxRt2eE9o76kqMBG+dSb0Mgp1oCuuEJbqaD5Z4M+ELCv3jL3fqhJVMuYiFCkQMV5qluNJkt+o/3cqR9ymbU5C04w+XpOWCORodBYJeIKeovsJtFbOnu5fYwlYSZElYnWgNXQbrmAr/EN5zCE8DS7xTFKQLwMswSYZ8Ob++pHagjgET8TnNLmPgo1PC1+Bwyl4f2CMlqLIDUs6TX3L1OjcnykPw=; 5:yoaaoLn0DiTDbQ3NreCh2PPGJsEFOL+nEmpv4k4X0ZZuHKDu/czgwHCDV6CkrW3NW3FWWU4sQ95YvPOoOSVEPJHIvhA+10GB8zzD1b8Hs9FJKCe6Vt5tAGsg4L+OM2K+XaChXS3F0LLf+BpGWT0nvkRYe5IgxfHXDZRp/Hl3hf4=; 24:jPvTzctJelwtYxtekLespyCAmaA7HlxCfLq7L/rUsI3bUSrTe5BBcfZp+3iFlP0W4ThqiHy1bHnZjKrOWNpMfyLmFqG4US+2XNi4MlR47n4=; 7:ATVwtyfnroC2Y0ugpcxRaB45IRoN3AwYyrFdb9QAl+JMQ5/d6oegkpv3dQyTpAl7CYLUe4fuyQykWc3YkK+hMu5cO1IhtUuK4E0EHkSMFx+qEp39NLCVSlv79tSTbTeCagyAU/jJl4/aT+kmXDXZdB5F4qk8sdBG9EROvdHgisAQfbB4wa40wWEv7RHuhbcQDP8cs5wRguaeeNWcqKyItA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:15:55.2353 (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: BY2PR0301MB1622 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160617_031618_512183_9CDE75EB X-CRM114-Status: GOOD ( 15.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, k.kozlowski@samsung.com, stephen.boyd@linaro.org, oscar@naiandei.net, arnd@arndb.de, pawel.moll@arm.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de, linux-usb@vger.kernel.org, linux-mmc@vger.kernel.org, mail@maciej.szmigiero.name, troy.kisky@boundarydevices.com, javier@osg.samsung.com, p.zabel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Krzysztof Kozlowski The MMC power sequence drivers are useful also outside of MMC world: for USB devices needed a hard-reset before probing. Before extending and re-using pwrseq drivers, move them to a new place. The commit does not introduce significant changes in the pwrseq drivers code so still all the functions are prefixed with "mmc_pwrseq". However the MMC-specific pwrseq functions has to be now exported and everything is hidden not by CONFIG_OF but by new CONFIG_POWER_SEQ option. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Javier Martinez Canillas --- .../pwrseq/pwrseq-emmc.txt} | 0 .../pwrseq/pwrseq-simple.txt} | 0 drivers/mmc/Kconfig | 2 -- drivers/mmc/core/Makefile | 3 --- drivers/mmc/core/core.c | 2 +- drivers/mmc/core/host.c | 2 +- drivers/power/Kconfig | 1 + drivers/power/Makefile | 1 + drivers/{mmc/core => power/pwrseq}/Kconfig | 18 +++++++++++++----- drivers/power/pwrseq/Makefile | 3 +++ drivers/{mmc/core => power/pwrseq}/pwrseq.c | 8 ++++++-- drivers/{mmc/core => power/pwrseq}/pwrseq_emmc.c | 3 +-- drivers/{mmc/core => power/pwrseq}/pwrseq_simple.c | 3 +-- {drivers/mmc/core => include/linux}/pwrseq.h | 6 +++--- 14 files changed, 31 insertions(+), 21 deletions(-) rename Documentation/devicetree/bindings/{mmc/mmc-pwrseq-emmc.txt => power/pwrseq/pwrseq-emmc.txt} (100%) rename Documentation/devicetree/bindings/{mmc/mmc-pwrseq-simple.txt => power/pwrseq/pwrseq-simple.txt} (100%) rename drivers/{mmc/core => power/pwrseq}/Kconfig (66%) create mode 100644 drivers/power/pwrseq/Makefile rename drivers/{mmc/core => power/pwrseq}/pwrseq.c (90%) rename drivers/{mmc/core => power/pwrseq}/pwrseq_emmc.c (99%) rename drivers/{mmc/core => power/pwrseq}/pwrseq_simple.c (99%) rename {drivers/mmc/core => include/linux}/pwrseq.h (94%) diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt b/Documentation/devicetree/bindings/power/pwrseq/pwrseq-emmc.txt similarity index 100% rename from Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt rename to Documentation/devicetree/bindings/power/pwrseq/pwrseq-emmc.txt diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt similarity index 100% rename from Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt rename to Documentation/devicetree/bindings/power/pwrseq/pwrseq-simple.txt diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index f2eeb38..7ade379 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -21,8 +21,6 @@ config MMC_DEBUG if MMC -source "drivers/mmc/core/Kconfig" - source "drivers/mmc/card/Kconfig" source "drivers/mmc/host/Kconfig" diff --git a/drivers/mmc/core/Makefile b/drivers/mmc/core/Makefile index f007151..a901d3c 100644 --- a/drivers/mmc/core/Makefile +++ b/drivers/mmc/core/Makefile @@ -8,7 +8,4 @@ mmc_core-y := core.o bus.o host.o \ sdio.o sdio_ops.o sdio_bus.o \ sdio_cis.o sdio_io.o sdio_irq.o \ quirks.o slot-gpio.o -mmc_core-$(CONFIG_OF) += pwrseq.o -obj-$(CONFIG_PWRSEQ_SIMPLE) += pwrseq_simple.o -obj-$(CONFIG_PWRSEQ_EMMC) += pwrseq_emmc.o mmc_core-$(CONFIG_DEBUG_FS) += debugfs.o diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8b4dfd4..edefc3f 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include "bus.h" #include "host.h" #include "sdio_bus.h" -#include "pwrseq.h" #include "mmc_ops.h" #include "sd_ops.h" diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 1be42fa..1db7d58 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,6 @@ #include "core.h" #include "host.h" #include "slot-gpio.h" -#include "pwrseq.h" #define cls_dev_to_mmc_host(d) container_of(d, struct mmc_host, class_dev) diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 421770d..2702aca 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -511,5 +511,6 @@ config AXP20X_POWER endif # POWER_SUPPLY +source "drivers/power/pwrseq/Kconfig" source "drivers/power/reset/Kconfig" source "drivers/power/avs/Kconfig" diff --git a/drivers/power/Makefile b/drivers/power/Makefile index e46b75d..02f9d5d 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -71,6 +71,7 @@ obj-$(CONFIG_POWER_AVS) += avs/ obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o obj-$(CONFIG_CHARGER_TPS65217) += tps65217_charger.o +obj-$(CONFIG_POWER_SEQ) += pwrseq/ obj-$(CONFIG_POWER_RESET) += reset/ obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o diff --git a/drivers/mmc/core/Kconfig b/drivers/power/pwrseq/Kconfig similarity index 66% rename from drivers/mmc/core/Kconfig rename to drivers/power/pwrseq/Kconfig index 250f223..7ecd66a 100644 --- a/drivers/mmc/core/Kconfig +++ b/drivers/power/pwrseq/Kconfig @@ -1,7 +1,13 @@ -# -# MMC core configuration -# -config PWRSEQ_EMMC +menuconfig POWER_SEQ + default y if OF + bool "Hardware reset support for specific devices" + help + Provides drivers that implements specific power sequences for chips, + using the generic power sequence management interface. + +if POWER_SEQ + +config POWER_SEQ_EMMC tristate "HW reset support for eMMC" default y depends on OF @@ -12,7 +18,7 @@ config PWRSEQ_EMMC This driver can also be built as a module. If so, the module will be called pwrseq_emmc. -config PWRSEQ_SIMPLE +config POWER_SEQ_SIMPLE tristate "Simple HW reset support for MMC" default y depends on OF @@ -22,3 +28,5 @@ config PWRSEQ_SIMPLE This driver can also be built as a module. If so, the module will be called pwrseq_simple. + +endif diff --git a/drivers/power/pwrseq/Makefile b/drivers/power/pwrseq/Makefile new file mode 100644 index 0000000..9e40e4b --- /dev/null +++ b/drivers/power/pwrseq/Makefile @@ -0,0 +1,3 @@ +obj-$(CONFIG_POWER_SEQ) += pwrseq.o +obj-$(CONFIG_POWER_SEQ_SIMPLE) += pwrseq_simple.o +obj-$(CONFIG_POWER_SEQ_EMMC) += pwrseq_emmc.o diff --git a/drivers/mmc/core/pwrseq.c b/drivers/power/pwrseq/pwrseq.c similarity index 90% rename from drivers/mmc/core/pwrseq.c rename to drivers/power/pwrseq/pwrseq.c index 9386c47..66310d7 100644 --- a/drivers/mmc/core/pwrseq.c +++ b/drivers/power/pwrseq/pwrseq.c @@ -11,11 +11,10 @@ #include #include #include +#include #include -#include "pwrseq.h" - static DEFINE_MUTEX(pwrseq_list_mutex); static LIST_HEAD(pwrseq_list); @@ -51,6 +50,7 @@ int mmc_pwrseq_alloc(struct mmc_host *host) return 0; } +EXPORT_SYMBOL_GPL(mmc_pwrseq_alloc); void mmc_pwrseq_pre_power_on(struct mmc_host *host) { @@ -59,6 +59,7 @@ void mmc_pwrseq_pre_power_on(struct mmc_host *host) if (pwrseq && pwrseq->ops->pre_power_on) pwrseq->ops->pre_power_on(host); } +EXPORT_SYMBOL_GPL(mmc_pwrseq_pre_power_on); void mmc_pwrseq_post_power_on(struct mmc_host *host) { @@ -67,6 +68,7 @@ void mmc_pwrseq_post_power_on(struct mmc_host *host) if (pwrseq && pwrseq->ops->post_power_on) pwrseq->ops->post_power_on(host); } +EXPORT_SYMBOL_GPL(mmc_pwrseq_post_power_on); void mmc_pwrseq_power_off(struct mmc_host *host) { @@ -75,6 +77,7 @@ void mmc_pwrseq_power_off(struct mmc_host *host) if (pwrseq && pwrseq->ops->power_off) pwrseq->ops->power_off(host); } +EXPORT_SYMBOL_GPL(mmc_pwrseq_power_off); void mmc_pwrseq_free(struct mmc_host *host) { @@ -85,6 +88,7 @@ void mmc_pwrseq_free(struct mmc_host *host) host->pwrseq = NULL; } } +EXPORT_SYMBOL_GPL(mmc_pwrseq_free); int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq) { diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/power/pwrseq/pwrseq_emmc.c similarity index 99% rename from drivers/mmc/core/pwrseq_emmc.c rename to drivers/power/pwrseq/pwrseq_emmc.c index adc9c0c..a0583ed 100644 --- a/drivers/mmc/core/pwrseq_emmc.c +++ b/drivers/power/pwrseq/pwrseq_emmc.c @@ -17,11 +17,10 @@ #include #include #include +#include #include -#include "pwrseq.h" - struct mmc_pwrseq_emmc { struct mmc_pwrseq pwrseq; struct notifier_block reset_nb; diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/power/pwrseq/pwrseq_simple.c similarity index 99% rename from drivers/mmc/core/pwrseq_simple.c rename to drivers/power/pwrseq/pwrseq_simple.c index 450d907..786f1db 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/power/pwrseq/pwrseq_simple.c @@ -16,11 +16,10 @@ #include #include #include +#include #include -#include "pwrseq.h" - struct mmc_pwrseq_simple { struct mmc_pwrseq pwrseq; bool clk_enabled; diff --git a/drivers/mmc/core/pwrseq.h b/include/linux/pwrseq.h similarity index 94% rename from drivers/mmc/core/pwrseq.h rename to include/linux/pwrseq.h index d69e751..e230670 100644 --- a/drivers/mmc/core/pwrseq.h +++ b/include/linux/pwrseq.h @@ -23,7 +23,7 @@ struct mmc_pwrseq { struct module *owner; }; -#ifdef CONFIG_OF +#ifdef CONFIG_POWER_SEQ int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq); void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq); @@ -34,7 +34,7 @@ void mmc_pwrseq_post_power_on(struct mmc_host *host); void mmc_pwrseq_power_off(struct mmc_host *host); void mmc_pwrseq_free(struct mmc_host *host); -#else +#else /* CONFIG_POWER_SEQ */ static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq) { @@ -47,6 +47,6 @@ static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {} static inline void mmc_pwrseq_power_off(struct mmc_host *host) {} static inline void mmc_pwrseq_free(struct mmc_host *host) {} -#endif +#endif /* CONFIG_POWER_SEQ */ #endif