From patchwork Wed Sep 21 02:29:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76654 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1794168qgf; Tue, 20 Sep 2016 19:30:19 -0700 (PDT) X-Received: by 10.28.197.12 with SMTP id v12mr873227wmf.11.1474425019416; Tue, 20 Sep 2016 19:30:19 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id d128si8659574wmc.41.2016.09.20.19.30.19; Tue, 20 Sep 2016 19:30:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F0A7B3891; Wed, 21 Sep 2016 04:29:00 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23ptSBEnfymo; Wed, 21 Sep 2016 04:29:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4680AB3896; Wed, 21 Sep 2016 04:28:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F672B3833 for ; Wed, 21 Sep 2016 04:28:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9D3Ryvvpr2KH for ; Wed, 21 Sep 2016 04:28:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 IN_IX_MANITU=4.35 (only DNSBL check requested) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id 2683AB3868 for ; Wed, 21 Sep 2016 04:27:50 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u8L2Qubd012826; Wed, 21 Sep 2016 11:27:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u8L2Qubd012826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474424833; bh=o++DawKKRkMZdieYAf8sbkGZhKRqdj/Q3tl0/sT7PZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vTk24ni6oFQuXJ4dyGK8mCPQPQtQg024A3zBr8h2czvAzWc++8PMF3hZyuGTbM70F Q1GiK/S1iZXJplMqY5kC2kq39xZ8uz/wRII8CdZmNVlS/vPWl8+JZp+XOguoR6uRyv O8Q83zEUz3UPgiYypLp9vUbNE3+KLK1pBUbIuE4Wjd92R7dM0JNs4jvdyWIXDv8G98 Odpp+A2bFlY95zsBot9aonSGBHPJgHbW5eNNeQEcYWCJFTGQRv0GRtOg3KX201xnTI CfBLoT1yPOwNhUw2kwm3vterCvXTIREropF4RJJTEkOLEJ6LCAX6R6Aql/Jp1xpeBQ JV8lqsjqzgdcQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 21 Sep 2016 11:29:01 +0900 Message-Id: <1474424946-16085-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474424946-16085-1-git-send-email-yamada.masahiro@socionext.com> References: <1474424946-16085-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini , Alexey Brodkin Subject: [U-Boot] [RESEND PATCH 09/10] reset: add no-op stubs for optional reset control X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" My motivation for this patch is to make reset control handling optional for generic drivers. I want to add reset control to drivers/usb/host/ehci-generic.c, but it is used by several platforms, some will implement a reset controller driver, some will not. Add no-op stubs in order to avoid link error for drivers that implement reset controlling, but still it is optional. Signed-off-by: Masahiro Yamada --- include/reset.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/include/reset.h b/include/reset.h index dc0900f..f45fcf8 100644 --- a/include/reset.h +++ b/include/reset.h @@ -7,6 +7,8 @@ #ifndef _RESET_H #define _RESET_H +#include + /** * A reset is a hardware signal indicating that a HW module (or IP block, or * sometimes an entire off-CPU chip) reset all of its internal state to some @@ -58,6 +60,7 @@ struct reset_ctl { unsigned long id; }; +#ifdef CONFIG_DM_RESET /** * reset_get_by_index - Get/request a reset signal by integer index. * @@ -132,4 +135,33 @@ int reset_assert(struct reset_ctl *reset_ctl); */ int reset_deassert(struct reset_ctl *reset_ctl); +#else +static inline int reset_get_by_index(struct udevice *dev, int index, + struct reset_ctl *reset_ctl) +{ + return -ENOTSUPP; +} + +static inline int reset_get_by_name(struct udevice *dev, const char *name, + struct reset_ctl *reset_ctl) +{ + return -ENOTSUPP; +} + +static inline int reset_free(struct reset_ctl *reset_ctl) +{ + return 0; +} + +static inline int reset_assert(struct reset_ctl *reset_ctl) +{ + return 0; +} + +static inline int reset_deassert(struct reset_ctl *reset_ctl) +{ + return 0; +} +#endif + #endif