From patchwork Wed Jun 7 14:39:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jerome Neanne X-Patchwork-Id: 690752 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 DE677C77B7A for ; Wed, 7 Jun 2023 14:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240770AbjFGOjl (ORCPT ); Wed, 7 Jun 2023 10:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240396AbjFGOjk (ORCPT ); Wed, 7 Jun 2023 10:39:40 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D1C1BF7 for ; Wed, 7 Jun 2023 07:39:38 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f735259fa0so45572965e9.1 for ; Wed, 07 Jun 2023 07:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1686148777; x=1688740777; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=1GcYfQXbJmH+P+okZGHVb5WVmSZydMCLOywQQa1xU8c=; b=ZPPI2dVEc5hp8ewqPynawtru3GCxCZPf6xGnhu6MHYni8F2Gnrf+crK2MVmQL5sR4U Gkp5BCvJ2iFfWv5nWiqNWJ87QDNSIVYF0rEIeA712Bt7v6yoGFlw2xX2DOld4DKhZgNB vdlF4k1Xygn3yGKS5XLKjr6FDTPLMYX+wSBMMBAn2NoqJ+lNLo4G5qhiS6aCI0jRU/Fy wTenv14TG3XD3Hbxs4m5H0ZmVHZMH76qPGSX4HIegSupRa/nIkoppLdEMs3PJUiSN3CD axQXJMeOmz6YlGAwCQA7osO50buxeG7t89cRSi0JFcrILCVD4aO8wyxbJ8awkfDdU2bM cCGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686148777; x=1688740777; 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=1GcYfQXbJmH+P+okZGHVb5WVmSZydMCLOywQQa1xU8c=; b=HH6ZRZin6ZDS4iYf36y6JiEyq7STmxDDYcKe9OTfbEI0J9A1JvBycWcJb/CBYWQXkD Ag+u2YDTy4FpEp+TqeUaJs5s9OI8t7oWdjXZP4u0A6Jjwyl7B+dcC2A+99mJ27D6sAvm CfwOmBQCTzKsPTX5cads7+Fcrh7CnIYtxCscZs2OnYN7HboL4hJ96CAN6L8npVuRKvk3 mYcgzuyWB/AicBjptCpL5BZYNYWnRTI4WTkoqoAyEkU7/EeVZrG8YID/NC9f+bSGjVei Sy6O1rnQFuXMj5Q8UN/gNvAwXC0WtRqxRTuYVnE63MHh0IHkmG1Ovlkbo2YAGUjnH02O rN0g== X-Gm-Message-State: AC+VfDxGAI+5UqqPRZuc4Nm0ujUqNnLcCUH/b2hqGUYuzXL2mV3YO+Xw eJZ3UxQjnTAprU1a7DT6FQAYwA== X-Google-Smtp-Source: ACHHUZ7aQ3eIVra/EYBsnLrW849H9HQ1yWGsVn89GVF+qIOu/DlliUweO7FhT2OLUA1340zXJGbeLA== X-Received: by 2002:a05:600c:2041:b0:3f7:a80a:c66c with SMTP id p1-20020a05600c204100b003f7a80ac66cmr7534980wmg.0.1686148776871; Wed, 07 Jun 2023 07:39:36 -0700 (PDT) Received: from [127.0.1.1] (192.201.68.85.rev.sfr.net. [85.68.201.192]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c021800b003f7ea771b5dsm2380720wmi.1.2023.06.07.07.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 07:39:36 -0700 (PDT) From: Jerome Neanne Subject: [PATCH v5 0/2] Add support for TI TPS65219 PMIC GPIO interface. Date: Wed, 07 Jun 2023 16:39:30 +0200 Message-Id: <20230511-tps65219-add-gpio-support-v5-0-ebb94281c854@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAKKWgGQC/43PTW7EIAwF4KuMWNdTMOSvq96j6gKCM6FqAAETd TTK3UtmU7XqIssn2Z+f7yxTcpTZy+nOEq0uu+BraJ5ObJy1vxA4WzNDjpI3QkCJuW1QDKCthUt 0AfI1xpAKSERjjSKOQ8fqvtGZwCTtx3kX5lLiNeaSSC/Pi86FEle8QbnPxkST+3r0eHuveUphg TLX2Z/riEoI2cvu3HcKWwUCPjxp7+nV6NunM4nOY1h2bna5hHR7fLXijh55YEXg0PKJTKtsqwb 92917rfIwJismhlpXS2V75P9g6jCmKmYa2+quVusQ/2Dbtn0DhnHKXcoBAAA= To: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Lee Jones Cc: khilman@baylibre.com, msp@baylibre.com, francesco@dolcini.it, 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=1686148775; l=3974; i=jneanne@baylibre.com; s=20230511; h=from:subject:message-id; bh=ayyGJqZuPvp+7hoYN3nxbJTiAaL3qNszicDwYunMJzQ=; b=zNK9dWkMh1R0CRGRe3DZW8Cza09Bx1whF0JJpQwy7+9jktk9HM9t3O07bLj3BmmGkwVL/kn3s 4Ts5+YpqWO8BKsa6BoHUbDSeQfY/0bJbt2N+cejioi5BCNckPaIgn1i X-Developer-Key: i=jneanne@baylibre.com; a=ed25519; pk=5rvbqNoG+28jQjC9/50ToY7TgKWf9rJukuCI8b6jkUo= Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Changes in v5: - andy.shevchenko review: - Use ENOTSUPP instead of EOPNOTSUPP. - Nits: - Use Datasheet tag in commit message and cover. - Indentation, use 80 column width for Kconfig and 100 colums for C files. - Format comment. - Link to v4: https://lore.kernel.org/r/20230511-tps65219-add-gpio-support-v4-0-b5d6a764d722@baylibre.com 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 Changes in v4: - andy.shevchenko review: - Nits: - move blank line before link in this cover. - Kconfig indentation. - Formatting: Comments; indentation; line length 100. - Do not split string literals. - Add var *dev = gpio->tps->dev and replace to get shorter blocks. - Evaluate GPIO0 MULTI_DEVICE_ENABLE only once. - Explicit include of bits.h Change to CONFIG_DEBUG_GPIO: debug options from Kconfig for GPIO only. - Link to v3: https://lore.kernel.org/r/20230511-tps65219-add-gpio-support-v3-0-19837a34d820@baylibre.com Changes in v3: - Linus Walleij Review: - put test code under IS_ENABLED(DEBUG) - Bartosz Golaszewski Review: - nits: alphabetical ordering for includes, newline after return, - Add error message on regmap_update_bits failure. - Change variable name in: tps65219_template_chip so that it's clear that gpio_chip get's a copy of this template structure. - Link to v2: https://lore.kernel.org/r/20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com 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 - Link to v1: https://lore.kernel.org/all/20230224113837.874264-1-jneanne@baylibre.com/ Datasheet: https://www.ti.com/lit/ds/symlink/tps65219.pdf 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 | 16 ++++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-tps65219.c | 185 +++++++++++++++++++++++++++++++++++++++++++ drivers/mfd/tps65219.c | 2 +- 5 files changed, 204 insertions(+), 1 deletion(-) --- base-commit: 8ded96e4d9a6da88bdbad61350cc6147b7c0c00c change-id: 20230511-tps65219-add-gpio-support-322bdb4e0297 Best regards,