From patchwork Fri Sep 27 13:34:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1168512 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=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="U+5gCU8H"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46ft9v50vXz9sDB for ; Fri, 27 Sep 2019 23:36:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5AEB9C21FA5; Fri, 27 Sep 2019 13:35:36 +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_MSPIKE_H2, 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 88275C21FAC; Fri, 27 Sep 2019 13:35:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1FFA4C21E7F; Fri, 27 Sep 2019 13:35:17 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by lists.denx.de (Postfix) with ESMTPS id 096D9C21F91 for ; Fri, 27 Sep 2019 13:35:15 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id p7so6652692wmp.4 for ; Fri, 27 Sep 2019 06:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=LVToznQuFcaBwMTMFvavpB/N4Y+YWPMzPMFO6heNYr0=; b=U+5gCU8HyMkOO+Z/BdNJlzSDIGcrxHHIBaF+VWB/VM4m3Y6m0M1mHVNq5KHI7HDQIg h6tZ9pq+lI1M2BVdXk23fjpVewAV6Oawv/QtYsFj6OWWAfpqAUoi7hD6HMN1nhdGOJQS 6OeSntOIQjaUDD3T3PK7KgANsAm8pYdK04u3QZKz04ubU5hXTtaVfLgRmYHVzWPcNyE0 a1xC/tnx7WaoBmWA8fNL2s9q75eSvp/jyhgE/c+AcqpZfaPZO4/HduZWGs5M3QmVq+WQ vPs6CdcNRJLZxgLhagTlGFK0Q0Es18wWv98mZSgWK66r9xxgGQyp6jN5oqb2hoHIF5ND B58g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=LVToznQuFcaBwMTMFvavpB/N4Y+YWPMzPMFO6heNYr0=; b=JIv4MyQbtntcIhFkJ++lQohML/kJGDa+27HsHjWA49Lgs3q8aTHBSrB9+ACG8t8sik s/XuURRVj5hFnyyb+nLwBriEtO4XxLvIIIxpv/w/flHnAxWl1AC1HB0KVotP4Tbwi74o HSDJ7NCNB4tfcTiLEPwGJNR4ggwra6elINcI3aFdKfwizekEslvr0ZFayLopDGJtzwlH yj8BBruw4rEyNzLByiRyZlYOfUv/4Nv2C3JCvoC6pwNSmOyTolmolxpl3hDLZUtZCSit AMCWimioDKJRfUpkQsDI+ZfMaqzLXXcFToYQ6JoBK5/BZFBNCDj+089Hp/IliKIbkwuw aVVg== X-Gm-Message-State: APjAAAXWJlIVp1pE6I/fG9YGW+DhINtN1PYxQeGK3Qogdt7wrV1phrAe ile09HI3yI+hSvUqMhBFwhOyAlP3FQEuRQ== X-Google-Smtp-Source: APXvYqz0YcpbJe6AYCJ71d7FYiCRYjekyhHdNtx+HjEMEZ3vjArAWq+lgmzxxnNRIvY91+rXDqLKIw== X-Received: by 2002:a05:600c:118a:: with SMTP id i10mr398242wmf.80.1569591314415; Fri, 27 Sep 2019 06:35:14 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id e30sm5461209wra.48.2019.09.27.06.35.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Sep 2019 06:35:13 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Fri, 27 Sep 2019 15:34:53 +0200 Message-Id: <916fdafa5a736a57066de4de733b1ab9d8621fb6.1569591296.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Cc: ibai.erkiaga-elorza@xilinx.com, luca@lucaceresoli.net Subject: [U-Boot] [PATCH 02/13] mailbox: allow subnode for mbox regs 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Ibai Erkiaga The following patch allows the mailbox node in DT to host subnodes with mailbox definitions. If the client phandle to the mailbox is not the mailbox driver node, just checks parents as well. Signed-off-by: Ibai Erkiaga Signed-off-by: Michal Simek --- drivers/mailbox/mailbox-uclass.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c index 809f26b20258..9fdb6279e4f3 100644 --- a/drivers/mailbox/mailbox-uclass.c +++ b/drivers/mailbox/mailbox-uclass.c @@ -49,7 +49,16 @@ int mbox_get_by_index(struct udevice *dev, int index, struct mbox_chan *chan) if (ret) { debug("%s: uclass_get_device_by_of_offset failed: %d\n", __func__, ret); - return ret; + + /* Test with parent node */ + ret = uclass_get_device_by_ofnode(UCLASS_MAILBOX, + ofnode_get_parent(args.node), + &dev_mbox); + if (ret) { + debug("%s: mbox node from parent failed: %d\n", + __func__, ret); + return ret; + }; } ops = mbox_dev_ops(dev_mbox);