Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp160360imm; Wed, 30 May 2018 20:29:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLCl2vI7DBmzOy0Bzy9BVngReDr7ptIdWaShw4HP35xJy0uIhlQsAubo917L0G6gwTInke9 X-Received: by 2002:a17:902:7898:: with SMTP id q24-v6mr5424175pll.254.1527737358686; Wed, 30 May 2018 20:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527737358; cv=none; d=google.com; s=arc-20160816; b=sEsOGODTzwDbRlOeOQ//Vh0B3b4fGqB81OTuDN37sBUh8d3T+o+kBroeLehXQkFlpa pxm/71KAjiSBnr/4YSqmAGEsJswHdUMYfgn+2IIyeRuo8oOC0LJxA3NV4Dsr8WI2NU5K tcl81mZiaKO1/GhvrbmriouPad4Umy/ek77E1kLX0/2jmCXJgKAmOxmqwthzbZQQip5/ oxVxMHa3g519wlHAnl2phAc6vHcNwjH/t5Jcn+H7zA1hSdXusUfOVkY9NHXiCTg8rVfd OxUUQfGQopd2ajCq47JYWCVAmuqhxjFQiGO7Ht7okg5S0u4uxaozv6wR41gJDh3ZiUny MCaA== 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=mWxJb5M3JK6lkt4c2M4p1ktSA8VfAdW19/i1XT7ZvK4=; b=x30h9p2iLwA1qYIQ5MA9ERpeSuCPETnL03X8voMkeLS2DHxwdMIMp+iJRIbjK+TqyF HNEHEVL67wrxNAIKYcFUD3kU+5nWa+xS7uNipf+e9kTfpczQHCBMosQKYWUNrqbjO5bK Oie1YOk6S6USYqi6bFG2nCO/WE0dnRoPMcUGVVGjxakh+V9jdZME1OpZkfKchWZRhJ0f Fhmt+WkhGCel+el89S6L3ziypyHD+UT2h/Zaj1OpsXwZBuhURIaUm6uVI0sGtnJj7cpi MZ5gercyI6QKSui6v56xDCYGWFx9JZ/o8sqpHKU0R2ZEgLOpIXgDX/qVLCwa8iqsdTq8 GQGw== 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 p66-v6si35932401pfg.329.2018.05.30.20.29.04; Wed, 30 May 2018 20:29:18 -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 S932728AbeEaD2g (ORCPT + 99 others); Wed, 30 May 2018 23:28:36 -0400 Received: from regular1.263xmail.com ([211.150.99.130]:58856 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932637AbeEaD2e (ORCPT ); Wed, 30 May 2018 23:28:34 -0400 Received: from djw?t-chip.com.cn (unknown [192.168.167.11]) by regular1.263xmail.com (Postfix) with ESMTP id 38525B18B; Thu, 31 May 2018 11:28:28 +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 7FA473BF; Thu, 31 May 2018 11:28:26 +0800 (CST) X-RL-SENDER: djw@t-chip.com.cn X-FST-TO: linux-rockchip@lists.infradead.org X-SENDER-IP: 183.57.25.242 X-LOGIN-NAME: djw@t-chip.com.cn X-UNIQUE-TAG: <56470a8d3e2f819420024ad18e7ef67c> X-ATTACHMENT-NUM: 0 X-SENDER: djw@t-chip.com.cn X-DNS-TYPE: 0 Received: from unknown (unknown [183.57.25.242]) by smtp.263.net (Postfix) whith SMTP id 1701JA7O1U; Thu, 31 May 2018 11:28:28 +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 v3 1/5] gpio: syscon: allow fetching syscon from parent node Date: Thu, 31 May 2018 11:27:49 +0800 Message-Id: <1527737273-8387-2-git-send-email-djw@t-chip.com.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527737273-8387-1-git-send-email-djw@t-chip.com.cn> References: <1527737273-8387-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 v3: None Changes in v2: None Changes in v1: - New: allow fetching syscon from parent node in gpio-syscon driver 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