From patchwork Wed Feb 27 18:56:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1049109 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="re0WNcLr"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 448lSX0fGyz9s1b for ; Thu, 28 Feb 2019 06:03:08 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CA3C1C21DB5; Wed, 27 Feb 2019 19:00:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 93014C21E1B; Wed, 27 Feb 2019 19:00:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C95BC21E15; Wed, 27 Feb 2019 18:57:56 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id D7C4EC21D72 for ; Wed, 27 Feb 2019 18:57:52 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id h11so8407695pgl.0 for ; Wed, 27 Feb 2019 10:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yw2VJNLdbNeVaNMDYAI0fSIAdpGnpb3+7TKlhUECXKI=; b=re0WNcLrJZaUjK1fOsE1+7k4u1m//YmtFp1Q68mijTbvfdBUXv1mIgTyvAwahtM81v IsdJ/5vQ6M4BYdTiwrW5PM6lrlkScGdqIkxrh58YxEiV9N8NAi1vLgXtCzMDTWYkSR7m 8w3bH1ettPQl6qKIlj6iHvam0GLl3MUQ3f/fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yw2VJNLdbNeVaNMDYAI0fSIAdpGnpb3+7TKlhUECXKI=; b=oQhnCHfuVGN+iPlL8DafIZRBM/Vn89PI6NywElauAOD/bNDM3v9rEFdFXzL7MeJls2 f2JLjV4/MIQQLDgM8+h3RuIHgdxBG/UUery4gDuEV7sP8Qm7yixtB7GVlZT8FpkMFTLf bkGvO1xxvWgmKO06XWVADco/zMBP/2+eKkCKYPL34HUt5SdDPJD2LjrBQbtxa08GEm7g kEMKgotvz82+saJUjFGXcNXPiXSLLt+x4p4Wxl6Aas9T3QDX4sPs+03WDsBwE+lY/LHC cKbbcECute6z4LOXOU9I43DDJ+0Y/SuefwWhMPDZ5839MxKSWCh5iKwjfVaTbDZ9YGNX joJQ== X-Gm-Message-State: AHQUAubM9x9qqW1J5omlCHQDf+AurCQpjpDGsYiUBLPEsEz7eaAbONL4 Y0w8qVJZxli5st33CM7Mcfs4DQ== X-Google-Smtp-Source: AHgI3IaQstfB66nixSYIN0fH1LJ7QKSEU7X525tTqsn1X1HYgC/hS8MIGgWpD0LCQF1gw1ZUiL0qQg== X-Received: by 2002:a62:e40d:: with SMTP id r13mr3122915pfh.11.1551293871526; Wed, 27 Feb 2019 10:57:51 -0800 (PST) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id z6sm22020802pgo.31.2019.02.27.10.57.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 10:57:50 -0800 (PST) From: Jagan Teki To: =?utf-8?q?Andr=C3=A9_Przywara?= , Maxime Ripard , Chen-Yu Tsai Date: Thu, 28 Feb 2019 00:26:56 +0530 Message-Id: <20190227185701.15545-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190227185701.15545-1-jagan@amarulasolutions.com> References: <20190227185701.15545-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, linux-sunxi@googlegroups.com, Stephen Warren Subject: [U-Boot] [PATCH v3 08/13] test/dm: reset: Add reset_get_by_index[_nodev] test X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add sample dm reset test for reset_get_by_index and reset_get_by_index_nodev functionality code. Cc: Stephen Warren Signed-off-by: Jagan Teki Reviewed-by: Simon Glass --- test/dm/reset.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/dm/reset.c b/test/dm/reset.c index c02866a2f0..c61daed490 100644 --- a/test/dm/reset.c +++ b/test/dm/reset.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -15,6 +16,28 @@ /* This is the other reset phandle specifier handled by bulk */ #define OTHER_RESET_ID 2 +/* Base test of the reset uclass */ +static int dm_test_reset_base(struct unit_test_state *uts) +{ + struct udevice *dev; + struct reset_ctl reset_method1; + struct reset_ctl reset_method2; + + /* Get the device using the reset device */ + ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "reset-ctl-test", + &dev)); + + /* Get the same reset port in 2 different ways and compare */ + ut_assertok(reset_get_by_index(dev, 1, &reset_method1)); + ut_assertok(reset_get_by_index_nodev(dev_ofnode(dev), 1, + &reset_method2)); + ut_asserteq(reset_method1.id, reset_method2.id); + + return 0; +} + +DM_TEST(dm_test_reset_base, DM_TESTF_SCAN_FDT); + static int dm_test_reset(struct unit_test_state *uts) { struct udevice *dev_reset;