From patchwork Thu May 31 03:27:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Levin X-Patchwork-Id: 10440191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C23C96035E for ; Thu, 31 May 2018 03:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B11A4294BE for ; Thu, 31 May 2018 03:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A455A294C1; Thu, 31 May 2018 03:28:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C227294BE for ; Thu, 31 May 2018 03:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8EFhHFzKP0FsRZhShShWTBgoHn2E8l6eDV3M5iHYwnQ=; b=LlqTbDA+nPI1JKY8GXYVFfjbd7 ehxBVj+0wqhzyxzxZdykESEliFp+3HGhNoCtp4PgEnWLy4zA83T5QU050OKE3o0otsUM9J3L8eKP1 xtJLAnXPe8xaTctd8TykLxZlq0i3eRTk6JzmOrolVexKdOYI3d8fhTzhTNL4TA8V54zW+QAg8UDmm vKrW/x2+3GrxqIjO47zkcUgGPX+WhPAop3mJ0+cfT3eixW8DbRv/c1Cok7TUae7l29awKPkBvkUhI CXrtTtknx1ifdq10KxPFUlmrpv1cBq4N7SrxwhaCtLmn5mKgtPhw532quJQP6pSZZMcW1Un1nmAd+ bdG2i/NQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOEGh-0007yG-D9; Thu, 31 May 2018 03:28:51 +0000 Received: from regular1.263xmail.com ([211.150.99.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOEGd-0007w3-Ii for linux-rockchip@lists.infradead.org; Thu, 31 May 2018 03:28:49 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_202847_814315_E572EE4C X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wayne Chou , Heiko Stuebner , Linus Walleij , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Levin Du MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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);