From patchwork Thu May 11 14:09:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 681457 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 DB977C77B7F for ; Thu, 11 May 2023 14:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238041AbjEKOJy (ORCPT ); Thu, 11 May 2023 10:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237782AbjEKOJt (ORCPT ); Thu, 11 May 2023 10:09:49 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96352D46 for ; Thu, 11 May 2023 07:09:47 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-953343581a4so1352723666b.3 for ; Thu, 11 May 2023 07:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1683814186; x=1686406186; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=SuyDnlOYxo/iihv+FkzR/V6NypU3FUK1HIwlYQQjiFA=; b=WV28hIevHEo3ZwDgw6pDbONFbRfwzDDWRcZAv12atTzdYG4VhUSkAXRuhmADUABQaQ Q3DQAApxjlYwT35fXjaoN5tSE5WsZxI4QTv/Nz38Ng9l8DKXq5YT7ISYwWXP76SnClZH us2IFCfAf1mjj/jdPfKS9ZHK6N6AbxhK9zOmAuMZ08scvfCJyJ4LXptry4GfjK6MePyu 87HTYEouLkVsMOvI1b/UUYM8hplu/lNwwL3YNYmIgevB5Uo3QD1oTQEh8pqwmljdPhu2 fXwj2nVnu4o7jnFMRlE7MQHqRXhird4kVLl6YzDTSraWOcdVTrqeC9UHU82Xji3WLINU RGHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683814186; x=1686406186; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SuyDnlOYxo/iihv+FkzR/V6NypU3FUK1HIwlYQQjiFA=; b=c52MrZ69VAuKQWxKMEaEIGHKWafLYn/iOZjC3zfo7gU8YHsN85S1lhn8643TRzMDaR gr8SB5CEumYqcSQ96h7YUd6rGgeTCzq1WozSK+NZD/NB+EZpdp2SLdgmcpqWdsw6Z9JR GHVCE2N/MEXlDvezLGPPDP8cqOEIMqb24lULvF1Be3cBfD2XRYjNFCbE546Qun5Cv6pI hwJ7/sBrob7WSj5W2qbEY3N1KTYRlOrPzQxIHukrwIOJuFY5S6pKQloqZ53boYrL9u8D w4WHcMJVcWdcVey/HtC44/gZR2xa2wBtStObPowzQvU1kmoDcemxF9DUNcdWLtwIAUA7 Ekeg== X-Gm-Message-State: AC+VfDxhLZlGusNnuS4qo71kMP2dDZNLAA4tWbG7aXd29UaTAPaHHetk xmmDfI/QN6SnALNKpl+XJDij4Q== X-Google-Smtp-Source: ACHHUZ6p282M3/d4Ia8U1W83mgvlYj22N3NEAwi2ZxI3B2vtXVjPE9WM0L4kfOb72diM5xbMkAv/Hg== X-Received: by 2002:a17:907:3fa5:b0:966:180f:d10c with SMTP id hr37-20020a1709073fa500b00966180fd10cmr19775421ejc.33.1683814186117; Thu, 11 May 2023 07:09:46 -0700 (PDT) Received: from [127.0.1.1] (abordeaux-655-1-129-86.w90-5.abo.wanadoo.fr. [90.5.10.86]) by smtp.gmail.com with ESMTPSA id gx1-20020a1709068a4100b00965a0f30fbfsm4057624ejc.186.2023.05.11.07.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 07:09:45 -0700 (PDT) From: Jerome Neanne Subject: [PATCH v2 0/2] Add support for TI TPS65219 PMIC GPIO interface. Date: Thu, 11 May 2023 16:09:40 +0200 Message-Id: <20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACT3XGQC/0WOTQ7CIBBGr2JYOwoDtdaV9zAuoB0txgIZ0GhM7 y514/Il7/v5iEzsKYvD6iOYnj77GCrgeiX60YYrgR8qC5SoZaMUlJR3DaoO7DDANfkI+ZFS5AI a0Q3OkMSuFTXvbCZwbEM/Lg1jKemRcmGy03ayuRBLIxvUi5uYLv71+3E6V75wnKCM1f2vIxql9 F63m31rcGdAwS2QDYGOzr7v3jFt+jiJef4C1WodctYAAAA= To: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Lee Jones Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Jonathan Cormier , Jerome Neanne X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1683814185; l=2580; i=jneanne@baylibre.com; s=20230511; h=from:subject:message-id; bh=8BsaXhLhKiuRMa3gSnxE5Xb+X8AQ7hver+4gadrzs5I=; b=p38uRgJ/bhq6eBnzjcKnFfhtOZlC9rguiKdvXr1dGz995ibKYfcLymqO+mpShgRqofLU+4m+Z TKc6XP6OJEKABSi9ltnTzHca3b95ykNeWSejCDBJkZhF1SiQS/l0f1M X-Developer-Key: i=jneanne@baylibre.com; a=ed25519; pk=5rvbqNoG+28jQjC9/50ToY7TgKWf9rJukuCI8b6jkUo= Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org GPIO interface consist in 3 pins: Two GPIOS are output only: GPO1, GPO2. GPIO0 is used for multi device support: - The input-functionality is only used in multi-PMIC configuration - In single-PMIC, it can be used as an output The configuration is static and flashed in NVM in factory. Description tps65219.pdf chapter 7.3.13 Linux must not change MULTI_DEVICE_ENABLE bit at run time. This was done for test purpose only to check input/output correct behavior on EVM board (no access to different NVM config). Tested on k3-am62x-lp-sk board. This board MULTI_DEVICE_ENABLE=0 Despite the register bits are out of order, driver is remapping in natural order: GPIO0 is gpiochip line 0 GPO1/2 are gpiochip line 1/2 Initial version by Jon Cormier on TI Mainline. Ported upstream by Jerome Neanne PMIC datasheet: Link: https://www.ti.com/lit/ds/symlink/tps65219.pdf Changes in v2: andy.shevchenko review - Typo and indentation in commit message. - Clarify Co-developer role. - Specify name for module. - Code simplification for tps65219_gpio_set - Put test code into #if 0 ... #endif to make it easier to re-use - Formatting for .driver - remove dupplicated error management => dead code Previous version: v1 - https://lore.kernel.org/all/20230224113837.874264-1-jneanne@baylibre.com/ Co-developed-by: Jonathan Cormier Signed-off-by: Jonathan Cormier Signed-off-by: Jerome Neanne Jerome Neanne (2): gpio: tps65219: add GPIO support for TPS65219 PMIC mfd: tps65219: Add gpio cell instance MAINTAINERS | 1 + drivers/gpio/Kconfig | 13 +++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-tps65219.c | 167 +++++++++++++++++++++++++++++++++++ drivers/mfd/tps65219.c | 7 +- 5 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 drivers/gpio/gpio-tps65219.c --- 2.34.1 --- Jerome Neanne (2): gpio: tps65219: add GPIO support for TPS65219 PMIC mfd: tps65219: Add gpio cell instance MAINTAINERS | 1 + drivers/gpio/Kconfig | 17 +++++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-tps65219.c | 173 +++++++++++++++++++++++++++++++++++++++++++ drivers/mfd/tps65219.c | 2 +- 5 files changed, 193 insertions(+), 1 deletion(-) --- base-commit: 1a5304fecee523060f26e2778d9d8e33c0562df3 change-id: 20230511-tps65219-add-gpio-support-322bdb4e0297 Best regards,