From patchwork Thu Jul 7 18:10:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 588340 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 ED792C433EF for ; Thu, 7 Jul 2022 23:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236216AbiGGXQR (ORCPT ); Thu, 7 Jul 2022 19:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236128AbiGGXQQ (ORCPT ); Thu, 7 Jul 2022 19:16:16 -0400 Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D60675B6 for ; Thu, 7 Jul 2022 16:16:15 -0700 (PDT) Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-101b4f9e825so27274943fac.5 for ; Thu, 07 Jul 2022 16:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3GtFLT5VlHIMmMMlLDEGSWPueKfPOd59FonXvTzyyE=; b=HaK0sV1wqReBsLI5fYuywyIsK7IX8zq2V0C3U4KAcNkLTQILSU0CP1lyPlfvHr/WjE ml4+0viUos4z0FKMiUTBEsAoq8Ap4hrnsoMbZ0HSP7e2jfzz3EkamK/Xh1IpCL4rNM4N Dg4wb7cLNpQ1RoXtxw3Jy84B5I77DPJiLZGzZe/bafVfYgYzcth9XVL9Xd0SX/n6CQGL 4PR+uqHrcTllvDEvJnumD1+mSOyMkCyyh3Oci8R5OBrliZA49RzOfx249nS99Cyeq5rN GDrP6FHYvFgDoQBvMJ6iZ4gXG0MdSnSQIJc2886+NJr+7Ivvx1X90mqi595it9vWKc4+ MnHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3GtFLT5VlHIMmMMlLDEGSWPueKfPOd59FonXvTzyyE=; b=vTBxle+HVnMC1bbzs3XZfCfz1EuSufVpxF1OVlA2IwYnLVcaoyQBdrwPKGTUUcMICa 4O6RuqdzQJ88xwcpSnJZ7TAlb8i1zr3s7ztLOj6MjMOjnxOD/yb/2JkqQ2c1hICsQ6mz xrKVsxEEfGiEqCOLXA9I9SuZ37PZ2+ds1tn3Pn51HJQndmlfnzRIqL8l5Vp+fjK7gnWd AK7a/AGNcPMcKP9qEJUvu8HVhAGd+e/0SL97PSpCzLVJDk6b4ZF7T8gnmEGbPDcbzzSE NNVUf3hXXHlN9JfmFJ+4LD5qlSg6TxFDashte6xzE5CtrmUpVBxWtt0U2NBe6UJFdVD4 fNfQ== X-Gm-Message-State: AJIora8VJ9QLZKZmV6jjs/IInZ7W4RNJP1VjaSN1iGp9BYZj2DZI1caE sdIHGaHMhYyig6eJZkj/cb7Zyw== X-Google-Smtp-Source: AGRyM1uog+T7XWwPK+NaACTq1k/xU9UmzU4HnRc/BXdZwD6n3ZAmkFK6NlgZF1pL5XX4Au8NK3SRUg== X-Received: by 2002:a05:6870:a70c:b0:10c:3bb7:ea15 with SMTP id g12-20020a056870a70c00b0010c3bb7ea15mr3640528oam.69.1657235774716; Thu, 07 Jul 2022 16:16:14 -0700 (PDT) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id cg10-20020a056830630a00b006190efaf118sm2177606otb.66.2022.07.07.16.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 16:16:14 -0700 (PDT) From: William Breathitt Gray To: linus.walleij@linaro.org, brgl@bgdev.pl Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray , John Hentges , Jay Dolan , Fred Eckert , Paul Demetrotion , techsupport@winsystems.com Subject: [PATCH v2 0/6] gpio: Implement and utilize register structures for ISA drivers Date: Thu, 7 Jul 2022 14:10:02 -0400 Message-Id: X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Changes in v2: - Implement support for the Intel 8255 interface as a new gpio-i8255 module; common code among gpio-104-dio-48e, gpio-104-idi-48, and gpio-gpio-mm are consolidated in the gpio-i8255 module - Refactor the gpio-104-dio-48e, gpio-104-idi-48, and gpio-gpio-mm to utilize the new gpio-i8255 functions; this greatly simplifies the changes for these drivers The PC104/ISA drivers were updated to use I/O memory accessor calls such as ioread8()/iowrite8() in a previous patch series [1]. This patchset is a continuation of the effort to improve the code readability and reduce magic numbers by implementing and utilizing named register data structures. One of the benefits is that we can now observe more easily similarities in devices that share similar interfaces; such as the i8255 interfaces used by the 104-DIO-48E, 104-IDI-48, and GPIO-MM drivers -- as well as the similar interface used by the 104-IDIO-16 and PCI-IDIO-16 drivers. A new module supporting the Intel 8255 interface is introduced to consolidate the common code found among the 104-DIO-48E, 104-IDI-48, and GPIO-MM drivers. [1] https://lore.kernel.org/all/cover.1652201921.git.william.gray@linaro.org/ William Breathitt Gray (6): gpio: i8255: Introduce the i8255 module gpio: 104-dio-48e: Implement and utilize register structures gpio: 104-idi-48: Implement and utilize register structures gpio: gpio-mm: Implement and utilize register structures gpio: 104-idio-16: Implement and utilize register structures gpio: ws16c48: Implement and utilize register structures MAINTAINERS | 6 + drivers/gpio/Kconfig | 6 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-104-dio-48e.c | 224 +++++++++------------------- drivers/gpio/gpio-104-idi-48.c | 123 +++++++--------- drivers/gpio/gpio-104-idio-16.c | 58 +++++--- drivers/gpio/gpio-gpio-mm.c | 177 +++++------------------ drivers/gpio/gpio-i8255.c | 249 ++++++++++++++++++++++++++++++++ drivers/gpio/gpio-ws16c48.c | 119 ++++++++++----- include/linux/gpio/i8255.h | 34 +++++ 10 files changed, 575 insertions(+), 422 deletions(-) create mode 100644 drivers/gpio/gpio-i8255.c create mode 100644 include/linux/gpio/i8255.h base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56