From patchwork Thu Dec 23 10:38:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 528304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FB43C4332F for ; Thu, 23 Dec 2021 10:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347761AbhLWKiJ (ORCPT ); Thu, 23 Dec 2021 05:38:09 -0500 Received: from mga05.intel.com ([192.55.52.43]:47340 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243241AbhLWKiI (ORCPT ); Thu, 23 Dec 2021 05:38:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640255888; x=1671791888; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yNV1tmH/oemQmmbyzBcEAOihPyJKp+tc9v1PnJomzdQ=; b=LGchwvbXHUQOo2KlaVD3NgIiSTGjKxdcFTKWyXgTL1CBbo0jJ/hF+6Ui oZSkvR6LSlmeRocW1vWVX4rpUFfhx5t/umw9wFFBxPpNIieEIFHQ65xO4 ZbSWYnYaZAsy3H+2bd4hEZ39xFOeVFBkS+YYSk9+GjgK2GNR13AyPQnJH zLiEkGXFMkKNxngMWZviG8pCP7Uq3xJ76TqbHjqX4kbcFwVfGNz/w1AIm Laz9Xh2HBaz8h3ymgCd2I1muTD171/4XoJGfZeT835o6twv+fXeiqHE8F Me9NS3LK7G4Vsz6esCPy+FoPhOiNnLlcQlm5MImm2CZ+LKLLw2W7iW6Xp w==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="327110934" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="327110934" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2021 02:38:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="617451821" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 23 Dec 2021 02:38:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id A5E44120; Thu, 23 Dec 2021 12:38:13 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Hoan Tran , Serge Semin , Linus Walleij , Bartosz Golaszewski , Mika Westerberg Subject: [PATCH v1 1/2] gpiolib: acpi: make fwnode take precedence in struct gpio_chip Date: Thu, 23 Dec 2021 12:38:08 +0200 Message-Id: <20211223103809.12343-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org If the driver sets the fwnode in struct gpio_chip, let it take precedence over the parent's fwnode. This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make fwnode take precedence in struct gpio_chip"). Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib-acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index c7a0e56593e7..c0f6a25c3279 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -1339,6 +1339,9 @@ void acpi_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev) /* Set default fwnode to parent's one if present */ if (gc->parent) ACPI_COMPANION_SET(&gdev->dev, ACPI_COMPANION(gc->parent)); + + if (gc->fwnode) + device_set_node(&gdev->dev, gc->fwnode); } static int acpi_gpio_package_count(const union acpi_object *obj) From patchwork Thu Dec 23 10:38:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 527420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84BF6C433FE for ; Thu, 23 Dec 2021 10:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347758AbhLWKiI (ORCPT ); Thu, 23 Dec 2021 05:38:08 -0500 Received: from mga14.intel.com ([192.55.52.115]:29250 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347755AbhLWKiI (ORCPT ); Thu, 23 Dec 2021 05:38:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640255887; x=1671791887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PuR52/Ba94yPsgQ4lSZpBqqDPD9qPXxRGfzZH9LoHw8=; b=KmkPKtePD+ZbztE7IWV24FNuik5c78VLQn4XKsJfAI0Vim9De2oXzbpA 1gln9F/EuibwIRduI/p1vETqUGOA9MnFH6cGh+kKMmYIRwwmW5VaoX550 ZX5gFDCGDNir/9nK6qQXMBeD9o8LQi9ERTl/npU4rbv5wz+IGARKGzB9k /9r2CLr+Mdkd0dqo2h6hUv1XAQjvHZ0M6rMjAfkeMiDYR8oEW3+ehybRE yW7DlJ2n5TCTzVJ6o0kiEgKlQU/Y1LomgeV2Q4YPTJqCv0XqKr7HI4v1l Z/oKKJEJ7goT79HPQWqtyQeYkfk6dSIlJofbtVXYYLPXBwyVjFhmpIN9u Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="241027274" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="241027274" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2021 02:38:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="664546190" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 23 Dec 2021 02:38:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AD5ADD4; Thu, 23 Dec 2021 12:38:13 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Hoan Tran , Serge Semin , Linus Walleij , Bartosz Golaszewski , Mika Westerberg Subject: [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node Date: Thu, 23 Dec 2021 12:38:09 +0200 Message-Id: <20211223103809.12343-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211223103809.12343-1-andriy.shevchenko@linux.intel.com> References: <20211223103809.12343-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes. Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin --- drivers/gpio/gpio-dwapb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index ec0767d7800d..b0f3aca61974 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -515,9 +514,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, return err; } -#ifdef CONFIG_OF_GPIO - port->gc.of_node = to_of_node(pp->fwnode); -#endif + port->gc.fwnode = pp->fwnode; port->gc.ngpio = pp->ngpio; port->gc.base = pp->gpio_base;