Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp219373pxf; Wed, 10 Mar 2021 04:57:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUQERz6x/cBdKDpS8peEVLOO7LZaX37aDpwGQTai7I1SE1dUfHsLr9AXcFeNvl6zxLyOLS X-Received: by 2002:a05:6402:384:: with SMTP id o4mr3137724edv.244.1615381052027; Wed, 10 Mar 2021 04:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615381052; cv=none; d=google.com; s=arc-20160816; b=yFu1hvQZBI0QDWdqndtScfu1AR5ClYX9paK8OPGHFGbtNV5RkXstVHocZ2/5/g8XCO OmVqt35VdkzjRROGfdpjiWMQJN9jv4D3ybLc9ChpwrVExbsfMXBEodPn9zxl69LdKktU H/5C1vtKZM6kdSmOLUBoOo1MzSLmjQ/WKaegPZtVi1ETRSLWqtrvVs9pX/TgjiKm9bqt Ezrq+Gr6C/cis8e7ez3wlQyfwVMyqYvjOn6MRfkuxgdFz+1AyQiWiHVWraAXa3KfadgZ SZifYNndHycUmQv3exJuaHARUh+iwuuhOwx/VVpvufuBnqHrc3VSboaX0IPGjWwEufgo IQjg== 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=PAJAtWRkOAd1GAbdY1wbENWkeMEKWY/41w1iBmNjTLI=; b=ZKU84sZH6zaOaoGf9q+cJ/HPE+UlXytkEUDYBGbuJdT6kNRCd9shDHO0LBQaAq1PjB swAX27/9FBD9pl2GuU10FeQw4xEAX33SQrC11e8m5IX95oON3NT9k2NGpnY533iK+xE9 oElFetj+Tb6EOxjUuB+Yp9F0/6Z6pXMamaUpe8JUNtWemQlAgs46Zq6e6LMcIxNmlMyO dKU/FFYKWKaNf7ng+wMocgiOInyhJFXiCajB3VOKxhe52LJyqViUab2lZkoejjt6y/k6 8ewarPyaIS65UmaoplT9OOX3nhPKEAmFzZbvi58HgDLi1TeGq04OKUV1/B8NFoqaV8Ri iJaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cazss+i4; 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 y4si5098409ejp.378.2021.03.10.04.57.08; Wed, 10 Mar 2021 04:57:32 -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=cazss+i4; 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 S232752AbhCJMzg (ORCPT + 99 others); Wed, 10 Mar 2021 07:55:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232604AbhCJMzK (ORCPT ); Wed, 10 Mar 2021 07:55:10 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB562C061760; Wed, 10 Mar 2021 04:55:09 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id w11so23209810wrr.10; Wed, 10 Mar 2021 04:55:09 -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=PAJAtWRkOAd1GAbdY1wbENWkeMEKWY/41w1iBmNjTLI=; b=cazss+i4tQDmShbLOPgzyz+hTJ+DcsxQmLGpcenNbyn+nRyLZgYb4FEX6eQ6iH1sms 6WuV1tFBGn3TJNXpphOQy5OZIp4fIJKNwV/bVwtjqz90sUs0N9aysxJ0mQeL462kRwoC jA5zJ8esGY4/t+V7r/PVR473ZtnppYJZCJMynJJZAxApOskbL9t/L2su9ZXAuwYNOK07 HlTBNx77fR5yTUUG0bf8L2g/MXYuVU25HjSZjTnvIzZZFMHsDIhQb+db1Mfa875+XLvF UaOMY0XGlABF98uaGNIdDJUhZCVilazp+oVyT/GdFbyVJa5c5eLUixMkeqWYhQetm27i vF5w== 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=PAJAtWRkOAd1GAbdY1wbENWkeMEKWY/41w1iBmNjTLI=; b=rWVKHy08cWhVeJKegYA0MXF9I5/F4Gax47AC0SuPK5CAHuh2HJ+VyZi5VXu5mNx9ae 7oZc1anHgtxvDi3xoDTIFv0JuZ2x/mRd8O4R9Y0tlu4hG0Q5mf6hEgCq/Ogxqg13cipX EG6TZU0Yzi+jHciwyOG0XYw6WQmjAyecOLsBxtxR1fA4PpKKvJ4vvI8Ze+Pzhlrw8fgS lzFCCRLEsZSAm7Ahf7v4l/WhYlThSaRGysuK7b/rkN1yH82jVUO+FFnzwV/hbmq/WH7i oC50EzKazeBfWuRnXsEgS3F42IPToc8/lK3HIulcQTnzie6us48cYuz4jaUz4JEUOdpe c9xg== X-Gm-Message-State: AOAM532b4ucH2yP0+UCnsoyKcYL3UXG4sr3lOlM3kcsw/V15Jyag78cz xIf6U1YXVU1i5DRU/jnjibs= X-Received: by 2002:a5d:6945:: with SMTP id r5mr3328286wrw.367.1615380908661; Wed, 10 Mar 2021 04:55:08 -0800 (PST) Received: from skynet.lan ([80.31.204.166]) by smtp.gmail.com with ESMTPSA id v6sm29403398wrx.32.2021.03.10.04.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 04:55:08 -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, Jonas Gorski , =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= , 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 v6 02/15] gpio: regmap: set gpio_chip of_node Date: Wed, 10 Mar 2021 13:54:50 +0100 Message-Id: <20210310125504.31886-3-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310125504.31886-1-noltari@gmail.com> References: <20210310125504.31886-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 --- v6: add comment and simplify of_node assignment v5: switch to fwnode v4: fix documentation v3: introduce patch needed for properly parsing gpio-range drivers/gpio/gpio-regmap.c | 1 + include/linux/gpio/regmap.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 5412cb3b0b2a..d4fc656e70b0 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 = to_of_node(config->fwnode); 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..334dd928042b 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 fwnode_handle; struct gpio_regmap; struct irq_domain; struct regmap; @@ -16,6 +17,8 @@ struct regmap; * @parent: The parent device * @regmap: The regmap used to access the registers * given, the name of the device is used + * @fwnode: (Optional) The firmware node. + * If not given, the fwnode of the parent is used. * @label: (Optional) Descriptive name for GPIO controller. * If not given, the name of the device is used. * @ngpio: Number of GPIOs @@ -57,6 +60,7 @@ struct regmap; struct gpio_regmap_config { struct device *parent; struct regmap *regmap; + struct fwnode_handle *fwnode; const char *label; int ngpio; -- 2.20.1