From patchwork Fri May 21 06:27:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 444904 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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 2D56EC433ED for ; Fri, 21 May 2021 06:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04740613B6 for ; Fri, 21 May 2021 06:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbhEUG2n (ORCPT ); Fri, 21 May 2021 02:28:43 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:35429 "EHLO mail-lf1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbhEUG2n (ORCPT ); Fri, 21 May 2021 02:28:43 -0400 Received: by mail-lf1-f48.google.com with SMTP id x19so28081981lfa.2; Thu, 20 May 2021 23:27:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=TEd7BwEnb381M+LjsahkUGlrL6ZQJ9SCtukWES/e0HQ=; b=CfUTW+xuK41HviXsjsVjigisOMQFiSM3dm4qgUWXKh2Plo3VvhaXS4xHZR+geuPjA7 pq8MJQHW12Sk1UROkAgtcFx9Wznaxq3rzCdK8hWT27C1xA8HaDD4WrX/7fVFKfnVhIGZ oSAtkKQWrahrLCoyIH63zWjXfe35W4C/ZSY1863XaR3/6bcDfLwjtENRVu4i6Yzn06kT H3RR+aYEYHp565sL3955SGevVFAYFvPfc0Qicit/RR1r9hNdygKn2tib7TW+gq8VT8rC eIYI4O1DYGGWnz+Lzp2lvL5j+sgQJNVJ36qPvmQ/Bi9+NjkqYyAfvT4VSUIq4emkPVrT mapQ== X-Gm-Message-State: AOAM532ITlj2tEuijcBuNxaT502da+aEu1S0Vf4+WzAwozZSwEfq/SzH 77++YDLaMK9UWI7HmT+g0oozRXIY+lhgug== X-Google-Smtp-Source: ABdhPJyePaIi0s7wx0tYT/mBO+4Hp2S33bjhg1sN/VST5UA6ngixt5Cg38E1XSGlt53XQ0eQeKn3bg== X-Received: by 2002:a05:6512:139e:: with SMTP id p30mr1112476lfa.489.1621578439576; Thu, 20 May 2021 23:27:19 -0700 (PDT) Received: from localhost.localdomain (dc7vkhyyyyyyyyyyyyybt-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::3]) by smtp.gmail.com with ESMTPSA id f4sm519482lfu.133.2021.05.20.23.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 23:27:18 -0700 (PDT) Date: Fri, 21 May 2021 09:27:11 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Linus Walleij , Bartosz Golaszewski , Matti Vaittinen , Michael Walle , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-power@fi.rohmeurope.com Subject: [PATCH v2 0/3] gpio: gpio-regmap: Support few custom operations Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Support providing some IC specific operations at gpio_regmap registration. Implementation of few GPIO related functionalities are likely to be very IC specific. For example the pin-configuration registers and the pin validity checks. Allow IC driver to provide IC specific functions which gpio-regmap can utilize for these IC specific configurations. This should help broaden the gpio-regmap IC coverage without the need of exposing the registered gpio_chip or struct gpio_regmap to IC drivers. The set_config and init_valid_mask are used by ROHM BD71815 GPIO driver. Convert the BD71815 GPIO driver to use gpio-regmap and get rid of some code. Rest of the ROHM GPIO drivers are to be reworked after the mechanism of adding IC specific functions is settled. Some preliminary discussion can be seen here: https://lore.kernel.org/linux-gpio/c4faac648d3e0c7f3dcb50f7e24c8b322e8c6974.camel@fi.rohmeurope.com/ Changelog v2: - Add cover-letter - Drop unnecessary checks for callback function validity - drop driver_data setting function as it is likely to be a race-condition-by-design --- Matti Vaittinen (3): gpio: regmap: Support few IC specific operations gpio: gpio-regmap: Use devm_add_action() gpio: bd71815: Use gpio-regmap drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-bd71815.c | 106 ++++++++++-------------------------- drivers/gpio/gpio-regmap.c | 62 ++++++++++++++------- include/linux/gpio/regmap.h | 14 ++++- 4 files changed, 84 insertions(+), 99 deletions(-) base-commit: d07f6ca923ea0927a1024dfccafc5b53b61cfecc