From patchwork Tue Mar 9 09:37:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 396135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89BD2C43333 for ; Tue, 9 Mar 2021 09:38:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 482E86525B for ; Tue, 9 Mar 2021 09:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhCIJiA (ORCPT ); Tue, 9 Mar 2021 04:38:00 -0500 Received: from mga02.intel.com ([134.134.136.20]:29451 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbhCIJhl (ORCPT ); Tue, 9 Mar 2021 04:37:41 -0500 IronPort-SDR: hiehay2Od8+CHc8TFIjZKaxXAoW2uZtBFKUoxmQ6iE/j7D719j/6UyG1V8TH28fi2Ug2nSP9oz vZF7M9GfOmtw== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="175303411" X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="175303411" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2021 01:37:40 -0800 IronPort-SDR: nr63oc0PNfB2pHc+gU4StUQ9vGCvf6MqbqzJEXz9VUaBkogbsDsWrt4vbIxG0cqJoTjAQuegqi 1WVhRNJ+whCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,234,1610438400"; d="scan'208";a="369725423" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 09 Mar 2021 01:37:37 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4B0C11EC; Tue, 9 Mar 2021 11:37:38 +0200 (EET) From: Andy Shevchenko To: Mika Westerberg , Andy Shevchenko , Linus Walleij , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Marc Zyngier , Jonathan Corbet , Bartosz Golaszewski , Thomas Gleixner , "Rafael J. Wysocki" Subject: [PATCH v6 0/6] gpiolib: switch to fwnode in the core Date: Tue, 9 Mar 2021 11:37:30 +0200 Message-Id: <20210309093736.67925-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org GPIO library uses of_node and fwnode in the core in non-unified way. The series cleans this up and improves IRQ domain creation for non-OF cases where currently the names of the domain are 'unknown'. This has been tested on Intel Galileo Gen 2. It touches GPIO core parts and it's expected that the series is routed via GPIO tree. In v6: - added tag to the patch 5 (Rafael) - dropped ops temporary variable (Rafael) In v5: - same as v4 + v3 (patches 1-4/5) in order to route via GPIO tree (Bart) In v4: - based on Rafael's bleeding-edge - split the rest to two patches (Rafael) - elaborate WARN() deduplication in the commit message (Rafael) In v3: - fixed subtle bug in gpiod_count - made irq_domain_add_simple() static inline (Marc) In v2: - added a new patch due to functionality in irq_comain_add_simple() (Linus) - tagged patches 2-4 (Linus) - Cc'ed to Rafael Andy Shevchenko (6): irqdomain: Introduce irq_domain_create_simple() API gpiolib: Unify the checks on fwnode type gpiolib: Move of_node operations to gpiolib-of and correct fwnode use gpiolib: Introduce acpi_gpio_dev_init() and call it from core gpiolib: Reuse device's fwnode to create IRQ domain gpiolib: Fold conditionals into a simple ternary operator Documentation/core-api/irq/irq-domain.rst | 22 ++++---- drivers/gpio/gpiolib-acpi.c | 7 +++ drivers/gpio/gpiolib-acpi.h | 4 ++ drivers/gpio/gpiolib-of.c | 6 ++- drivers/gpio/gpiolib.c | 62 +++++++++-------------- include/linux/irqdomain.h | 19 +++++-- kernel/irq/irqdomain.c | 20 ++++---- 7 files changed, 75 insertions(+), 65 deletions(-)