Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3261104rwl; Tue, 27 Dec 2022 06:43:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoFFUz4jrtkSdcNofEccwFrooxfaSYYCz4rBZKtaZp/VcskszIW2iZ53zuJQAc3q4Gjih8 X-Received: by 2002:aa7:cd83:0:b0:45c:835b:9448 with SMTP id x3-20020aa7cd83000000b0045c835b9448mr16612200edv.4.1672152209311; Tue, 27 Dec 2022 06:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672152209; cv=none; d=google.com; s=arc-20160816; b=icwtSPRjjFJ3ziOegPKhhgnEn9aEiLcSsPy8Wb58vg4IJIAQr1CMysS0aLxhDo1q88 lFqJp+UZv53oaRNA78Z82OegfczYh+RDmbpP6X/taCgtsH9epfj73sh6pXkjsqI5hD1U pC8G8/F2fKRhdUJLo9tTMWNipP+UzQSW0cGYO5z6YfUJ2VkMaf1T1QBRnz8yEq4xOSkh viMNwxFoKnY7LZlBj88mhy4tycBJwzbxYh1KMxuFexsgml/1ddoV1mJKg/vzcUMpgldI TMTm0RV+zuBcoIIaZsHW3kZParRiu1M/Q5tLBTxM7pYRQDG4UlZDbKZuyiA4WWMRtV3s A/pg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8yl7tSpZqM1nYkQndNf9Bgez3en4RCjlOQ/FXT9ZblI=; b=BAqn+uElB8cp/iLHUCGa6KZUTJBVhpfSVwEn6c+/pMk8eFlS3nnqOl/6s7czC0pYUg fiCMk5DalpjZPbh7XqEtlginX6uyQhr6ieAnopn7oA7t9ANsIrgITsOYx6mOpeMU6TLX TerQ+HUaivGrZXoZnhF8lsA8uXNQ8mVYQoCHWqoZjmmFKkboHEWqA9nE1njNrJHzV8HK 04W+cUpgntDKPPvTHx9uUt/ga+Hg+H2hwUM0T7hcP6R/3Un7FYrrSth/QByGiBivRw/i pjsApfXHpSsc55ppb5pZ74T0xtO7pxvPyV6GdKaKxx575T58gRMgOoJgGfaAJ2s5XHI/ 4TUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Td2EhVNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bb13-20020a1709070a0d00b0078d4c9d77adsi11698531ejc.94.2022.12.27.06.43.12; Tue, 27 Dec 2022 06:43:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Td2EhVNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbiL0Ocq (ORCPT + 66 others); Tue, 27 Dec 2022 09:32:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiL0Oco (ORCPT ); Tue, 27 Dec 2022 09:32:44 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66A8EB1E for ; Tue, 27 Dec 2022 06:32:43 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id r205so12540067oib.9 for ; Tue, 27 Dec 2022 06:32:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8yl7tSpZqM1nYkQndNf9Bgez3en4RCjlOQ/FXT9ZblI=; b=Td2EhVNfRYDN5avfBp19l0818QxqaHnIjUxwlYgRPNqchGwNWj8Di+Z0JHRVin4Gn2 FQ6DGrfCHBW1aiBX4yVlANWNjq3BlGwSQj9WpDM/RqriiSdhli6PltH+bceccwuP9RTX Pxpj3jdoW7UeDi+MlGUmYntxk0r2+5iJ6P8by1l48aDY+ROeml/cOhSQ2xOujxknYQqJ GKSQ+e5c2WdBTOIBBCUzI7neWn0Rdkhzf80o3cmOrrBSWcahOlFDl/FmxDuXiTWefqZv DC13U+Zj0yXXTHLEej4KiNyWcGnbDCH8jXqBUK6jib2xWcGRFYDH5e2pukj1SCIRKy86 g7mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8yl7tSpZqM1nYkQndNf9Bgez3en4RCjlOQ/FXT9ZblI=; b=RonPMCYivXatPoq5h7NMUeXNpMNSkF2Wv0lPuzg8sQZ3XgeyV8GRsUvWycCHUahgBm eC3ROpY9BvhGuAD16nAl/VsThnmw/NrKWrDK9CTzE0IDNEP58+ZYCT2+jrNt+yEmw1TP iRZv7JUeZgU7UnF8bAhd9e7ZCdvP0GfJH589NX2+67mJ8QzeGtZ+Lth7F38/Bg8xIeYK A4pAAAnnwrltEiHEJnbdvIBz7EIYg8Jc5ytUCBB26K2KmHhu7lTGHJM4Qt+OVC2vJSC7 afRN0mMTRBOPV4h+DHrLa0ecASN7z1rVExUS95PBUFh6fg4DzLfgECmy4oy2sI6y0Ldh 852Q== X-Gm-Message-State: AFqh2kowau9R6SZNNsdEzBKUqM/JYGKvnVfE1GfOmrBDKDR7FgDmNSZB DnvAFSGGJu6ikJ1Atx+Wkss1kg== X-Received: by 2002:a05:6808:1492:b0:35e:910d:10e6 with SMTP id e18-20020a056808149200b0035e910d10e6mr11908461oiw.9.1672151562694; Tue, 27 Dec 2022 06:32:42 -0800 (PST) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id q205-20020acac0d6000000b0035bce2a39c7sm5864969oif.21.2022.12.27.06.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Dec 2022 06:32:42 -0800 (PST) From: William Breathitt Gray To: linus.walleij@linaro.org, brgl@bgdev.pl Cc: andriy.shevchenko@linux.intel.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, michael@walle.cc, William Breathitt Gray Subject: [PATCH v5 0/8] Migrate i8255 GPIO drivers to regmap API Date: Tue, 27 Dec 2022 09:09:38 -0500 Message-Id: X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v5: - Add REGMAP_MMIO Kconfig selection for GPIO_104_DIO_48E, GPIO_104_IDI_48, and GPIO_GPIO_MM - Replace magic number 0x3 with GENMASK(1, 0) to make intent clear in the dio48e_handle_mask_sync() function - Write (instead of read) to clear interrupts on unmask; although the datasheet lists the respective register as read/write, all other references state that this should be a write operation to clear The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver. The 104-dio-48e and gpio-mm modules depend on the i8255 library and are thus updated accordingly. The 104-IDI-48 is hardwired as an input-only device. Because the i8255 control registers are not exposed on the 104-IDI-48, the i8255 library doesn't provide much benefit here. In this case it's simpler to utilize the gpio_regmap API directly, so this patch series does such and removes the i8255 library dependency from the 104-idi-48 module. The first patch in this series adjusts gpio_regmap to always set gpio_chip get_direction. This patch is mostly independent of the rest of the patches in the series and can be picked up separately if desired. I'm including it here because it allows the input-only 104-idi-48 driver to continue reporting offset directions after migrating to gpio_regmap. By leveraging the gpio_regmap API, the i8255 library is reduced to simply a devm_i8255_regmap_register() function, a configuration structure struct i8255_regmap_config, and a helper macro i8255_volatile_regmap_range() provided to simplify volatile PPI register hinting for the regmap. The regmap_irq API is leveraged by the 104-idi-48 and 104-dio-48e modules to support their IRQ functionality. Do their respective regmap configurations need use_hwlock set to true in this case, or is adequate locking already handled by the regmap_irq API? William Breathitt Gray (8): gpio: regmap: Always set gpio_chip get_direction gpio: 104-dio-48e: Migrate to the regmap-irq API gpio: 104-idi-48: Migrate to the regmap-irq API gpio: 104-idi-48: Migrate to gpio-regmap API gpio: i8255: Migrate to gpio-regmap API gpio: 104-dio-48e: Migrate to regmap API gpio: gpio-mm: Migrate to regmap API gpio: i8255: Remove unused legacy interface drivers/gpio/Kconfig | 8 +- drivers/gpio/gpio-104-dio-48e.c | 398 +++++++++++--------------------- drivers/gpio/gpio-104-idi-48.c | 336 +++++++++------------------ drivers/gpio/gpio-gpio-mm.c | 154 +++--------- drivers/gpio/gpio-i8255.c | 320 +++++++------------------ drivers/gpio/gpio-i8255.h | 54 ++--- drivers/gpio/gpio-regmap.c | 7 +- 7 files changed, 390 insertions(+), 887 deletions(-) base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2 -- 2.38.1