From patchwork Wed Sep 21 02:01:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76641 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1783549qgf; Tue, 20 Sep 2016 19:00:32 -0700 (PDT) X-Received: by 10.194.145.229 with SMTP id sx5mr30307496wjb.13.1474423232668; Tue, 20 Sep 2016 19:00:32 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id y129si24853576wmg.14.2016.09.20.19.00.32; Tue, 20 Sep 2016 19:00:32 -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 3AEF4A7541; Wed, 21 Sep 2016 04:00:30 +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 zA9RmPqw8jiO; Wed, 21 Sep 2016 04:00:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A14ABB3813; Wed, 21 Sep 2016 04:00:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8DCCA7541 for ; Wed, 21 Sep 2016 04:00:15 +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 ueZRNQu-Ac4I for ; Wed, 21 Sep 2016 04:00:15 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by theia.denx.de (Postfix) with ESMTPS id 06028A752D for ; Wed, 21 Sep 2016 04:00:11 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u8L1xKJF021633; Wed, 21 Sep 2016 10:59:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u8L1xKJF021633 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474423175; bh=o++DawKKRkMZdieYAf8sbkGZhKRqdj/Q3tl0/sT7PZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wozub3MpjaybW/BcOjQkq+XuapA90Gghf130Sfn5iSgKbtTVnY+MsfQ8BZOxRWAvg ostVcq0+qCXlFqFTygtokFbNdcc2u257xhBaeR7Bm/oF7Y4XEC1V8+6L7/Nv+miTMn doOa4T3sQJ9FFH9a81vxqjs0l0wVWqX8Wlasm6eTM4KGilq8j/ANMvYAOOAyj76HLC y6k3gfCJPEpjMaf6djfoWCV2dWtEFQYgy1874K7yTdoYLFY027PYIqjZ5qkOeaGunp zoXrcQkrFrig8M8H1wmXeRaWMsEFpX5HC6qq+WBj7PfWTM2ZLAtCj2RuTmxfSLNld6 gT9lYhP762bXg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 21 Sep 2016 11:01:11 +0900 Message-Id: <1474423285-14403-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474423285-14403-1-git-send-email-yamada.masahiro@socionext.com> References: <1474423285-14403-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini , Alexey Brodkin Subject: [U-Boot] [PATCH 7/8] 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