Received: by 10.192.165.148 with SMTP id m20csp892337imm; Thu, 10 May 2018 02:18:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrSV4rh/DCTgtmw1SwhnU/dPCHW9pfS/xYEWVu+fRMZKY6GJNxulQTlA5o5lOge8CCTyUiP X-Received: by 2002:a62:679a:: with SMTP id t26-v6mr643801pfj.24.1525943907997; Thu, 10 May 2018 02:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525943907; cv=none; d=google.com; s=arc-20160816; b=sSvpRV73CiAtXPBHBtvWgz8krg3epUf7+UPdGIpu9Ksuw3w3ZuHG6chLuvxMbWLGma zQGBHbe2ANbf+uRJqK4QhmdP/NjFe4HoiBtvarxqPUiyidepmLucs89FATSszYak5WIQ SWjnivCux3F8atP2Miz4tfcBbBLUWhLLTY4A16NLHir/U0EWDf3GJhPAJ2hif52UVB+X kzThBFFYRxFdCQhYvccSSkm49CkFuh1WoaTmFa+jUbAMGNTLwWJZzMz9N9w0R0J1WOxp 5pwtQpaHgunKsdfNJBOIM5H07cOnpFSKAxTVt3Su+cQT4GsyLqbFHTMFKimrA4plDsGs EWyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ISaHJsINhCUqJjicB3euf8x2mj0MU9uKXdNJ6STCCnU=; b=bvp/3K2doP8EZ3/kLGZz/m4oJwGZNYZgSr0ioT56yDXQuSrs/Fs/ooYzCUmo8cgPVr H2ePZvVemz3W7DJze82+M9o/ailLpRmXAvxba3CWj/ptVwi3AluCpHEa3uEIG3ZHbkVz 3y6sG1HVbhM25RsoC08PQNAZfMfdlbOaHqK336167vJZFaOT8IRtMBOeENT6vh4ncqrq +eqVGVjDQL89y7S78QIwR/rYrvtlJ7v92mFyzMlZ4xGnDp03Ljti3p7e7Aqp9jkAuwx1 OfaoaJMAqPvwVQRSDQLWhm5SbliVm79kqoujTHcrCfLovVu2reP/LC6drziXSF0zRQ+Q ufgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11-v6si380311plt.455.2018.05.10.02.18.13; Thu, 10 May 2018 02:18:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757049AbeEJJRq (ORCPT + 99 others); Thu, 10 May 2018 05:17:46 -0400 Received: from regular1.263xmail.com ([211.150.99.133]:50005 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757027AbeEJJRl (ORCPT ); Thu, 10 May 2018 05:17:41 -0400 Received: from djw?t-chip.com.cn (unknown [192.168.167.12]) by regular1.263xmail.com (Postfix) with ESMTP id 4F46D91FB; Thu, 10 May 2018 17:17:37 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id B79743C8; Thu, 10 May 2018 17:17:37 +0800 (CST) X-RL-SENDER: djw@t-chip.com.cn X-FST-TO: linux-rockchip@lists.infradead.org X-SENDER-IP: 59.33.101.82 X-LOGIN-NAME: djw@t-chip.com.cn X-UNIQUE-TAG: <5475be979ad0cd213b161e09e3967b9f> X-ATTACHMENT-NUM: 0 X-SENDER: djw@t-chip.com.cn X-DNS-TYPE: 7 Received: from unknown (82.101.33.59.broad.zs.gd.dynamic.163data.com.cn [59.33.101.82]) by smtp.263.net (Postfix) whith SMTP id 26450HM4DNR; Thu, 10 May 2018 17:17:38 +0800 (CST) From: djw@t-chip.com.cn To: linux-rockchip@lists.infradead.org Cc: Wayne Chou , Levin Du , Heiko Stuebner , linux-gpio@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org Subject: [PATCH v1 1/5] gpio: syscon: allow fetching syscon from parent node Date: Thu, 10 May 2018 17:16:36 +0800 Message-Id: <1525943800-14095-2-git-send-email-djw@t-chip.com.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525943800-14095-1-git-send-email-djw@t-chip.com.cn> References: <1525943800-14095-1-git-send-email-djw@t-chip.com.cn> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiko Stuebner Syscon nodes can be a simple-mfd and the syscon-users then be declared as children of this node. That way the parent-child structure can be better represented for devices that are fully embedded in the syscon. Therefore allow getting the syscon from the parent if neither a special compatible nor a gpio,syscon-dev property is defined. Signed-off-by: Heiko Stuebner Signed-off-by: Levin Du --- Changes in v1: - New drivers/gpio/gpio-syscon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c index 537cec7..7325b86 100644 --- a/drivers/gpio/gpio-syscon.c +++ b/drivers/gpio/gpio-syscon.c @@ -205,6 +205,8 @@ static int syscon_gpio_probe(struct platform_device *pdev) } else { priv->syscon = syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev"); + if (IS_ERR(priv->syscon) && np->parent) + priv->syscon = syscon_node_to_regmap(np->parent); if (IS_ERR(priv->syscon)) return PTR_ERR(priv->syscon); -- 2.7.4