Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1285357pxb; Thu, 4 Mar 2021 07:46:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxsjDtmgHf3wpqy2IiqnpF/IWpiLYR4DQcOVQNRmq0uJ/rsGbwGGsjqEBitiVe8iqg3KHh X-Received: by 2002:a17:906:15cc:: with SMTP id l12mr4996632ejd.280.1614872763093; Thu, 04 Mar 2021 07:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614872763; cv=none; d=google.com; s=arc-20160816; b=qkaDhOBxuZZFz5Xzi9xuC1+6v9JgGZYibB3dCt7sMkUaSBMWKle88WTGRHtLOUQ8hC 5ovtlTK+X4PCQ5OQSMO7I5lWVeuaK7DRXvOWtR7udOx5c9+ZVG/xh7eKqZJ7N82QCWOu bX48mj1WYbggUdjZvFyKfxmy8Cuw9B1TPqvVMp9fs3NDewCXWGHWSJe8tjT9SoAWRPOR ns2HpjqFW+9jbVuFzLgXGmDybdydUwLf6SJcJNGdFx3r+h1rvetpwAcsueJuuAnqHXkj SnYAPOw5Ug9cykMzRO7lsPFXLAznbCwiBV8g9cWybdNb/WNP5VtAlvJZNAlKFRX+LRG+ yodQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E9tYG5sQpt2PxFnt3/G3HRCcKTojRNxY1UpckrJvdZU=; b=ifUJuB/gwETWERYBES2FZMkidWpA0sDwQ2o2vf527sF0h5GKOBBhlc9ngyJg7Mlcrz e6flro34EGO1XPcFjgrpNQaj+vGpKe4iFSk1zt71xs31fniX85vO2JIq4SLO+OYZ+H9L f3GgMm9vULbHNUWTTbLCbf3vM3UXSyYDbGm+FeCfooGeWSyCYxHTQWlMATJXNeBiXieA C02hmYGuqUc4PASMIUSefF1g1PKmAVxDkI6qTHjOEOaGR411aNsVoDgRk1XPuJaJphMe j9vhDR8GknXTLSvg2KoV2ObMPkxu5UWst1ChMqaRbToBDRF4e0FouEJBmHUZvjtfGVGS AI/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dv5O19c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si13765562edw.372.2021.03.04.07.45.39; Thu, 04 Mar 2021 07:46:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dv5O19c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237013AbhCDI6J (ORCPT + 99 others); Thu, 4 Mar 2021 03:58:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236972AbhCDI55 (ORCPT ); Thu, 4 Mar 2021 03:57:57 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 696E0C06175F; Thu, 4 Mar 2021 00:57:17 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id i9so7313623wml.0; Thu, 04 Mar 2021 00:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=E9tYG5sQpt2PxFnt3/G3HRCcKTojRNxY1UpckrJvdZU=; b=dv5O19c02XYvno7CjRrWVr4T9RKmM6f5XLDVahZm/T+22AVCQGLXd2Etlg3m6j3Ji/ Fet04yWwPwMc4vewUcpJQMio/k+4wY3jZyDuEw28TESuwDhbtmXIdJFYd0ylK0B2j8Qx gliSYuh0V/Huu+HPA72TXh7KdnqanRspyhTbEPeFWq84puJXiQftcs7m7eu+pdYsE/2D lIv0A1X/ajoa2zKQIGOyIaeD5JiU+MbbRWGC8qf+YVtnxGatTPrlXFCNwfsirhnme2Fe hvr4jpPfhYWYcvduuVbVikmX4TJZJu4ighX0/CNriObH6hMRTHVACWF9a5UjuqEKG5KB E3Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E9tYG5sQpt2PxFnt3/G3HRCcKTojRNxY1UpckrJvdZU=; b=fgWCx/uNVOxpZcpFsXk9q+RkYUQq2wu7P1orCMUSW64gzPALyGrUPGDrItHlJjPRxN EZAxuDNM1j4PDIWcywxWbW6ErDX7ZlNAGQcKXXqm7hYfhEUHGe/GODpsHW7uOJOr0kAk p0qU7PhHc/XfR+1g7RVzhdeiRklcmwgoZnVgTkiK7FMAUrhSpftVuSlMwhPhrhD0vnuo /oB9oVQKByW0PqzGUsHeeDAqJiDQppRbQKEQ2gfsO05ezKWP1mQ8VlLC91RWUeruO6Qj 6f2mCuxyHXJjy0D9bDFGlfxlg05pnH6SYOMH1rbVmzJyKUObJs0aPplZ0Ec9GlpCZAP2 UdLg== X-Gm-Message-State: AOAM531HTrGSVG/gw4rOqsWy262t7LULfChzyIs2tO4/zKP5oTH2WoWf qJeiVskjPvE00tF99IGCpmE= X-Received: by 2002:a05:600c:4f0c:: with SMTP id l12mr2791652wmq.16.1614848236185; Thu, 04 Mar 2021 00:57:16 -0800 (PST) Received: from skynet.lan (170.red-88-1-105.dynamicip.rima-tde.net. [88.1.105.170]) by smtp.gmail.com with ESMTPSA id q15sm2828976wrx.56.2021.03.04.00.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 00:57:15 -0800 (PST) From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= To: Linus Walleij , Rob Herring , Michael Walle , Bartosz Golaszewski , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= , Jonas Gorski , Necip Fazil Yildiran , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 02/15] gpio: regmap: set gpio_chip of_node Date: Thu, 4 Mar 2021 09:56:57 +0100 Message-Id: <20210304085710.7128-3-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210304085710.7128-1-noltari@gmail.com> References: <20210304085710.7128-1-noltari@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is needed for properly registering gpio regmap as a child of a regmap pin controller. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Michael Walle --- v4: fix documentation v3: introduce patch needed for properly parsing gpio-ranges drivers/gpio/gpio-regmap.c | 1 + include/linux/gpio/regmap.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 5412cb3b0b2a..1a43a90024bb 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -249,6 +249,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config chip = &gpio->gpio_chip; chip->parent = config->parent; + chip->of_node = config->of_node ?: dev_of_node(config->parent); chip->base = -1; chip->ngpio = config->ngpio; chip->names = config->names; diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h index ad76f3d0a6ba..73105ff830fb 100644 --- a/include/linux/gpio/regmap.h +++ b/include/linux/gpio/regmap.h @@ -4,6 +4,7 @@ #define _LINUX_GPIO_REGMAP_H struct device; +struct device_node; struct gpio_regmap; struct irq_domain; struct regmap; @@ -16,6 +17,7 @@ struct regmap; * @parent: The parent device * @regmap: The regmap used to access the registers * given, the name of the device is used + * @of_node: (Optional) The device node * @label: (Optional) Descriptive name for GPIO controller. * If not given, the name of the device is used. * @ngpio: Number of GPIOs @@ -57,6 +59,7 @@ struct regmap; struct gpio_regmap_config { struct device *parent; struct regmap *regmap; + struct device_node *of_node; const char *label; int ngpio; -- 2.20.1