From patchwork Mon May 24 12:05:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 447587 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 5C14EC04FF3 for ; Mon, 24 May 2021 12:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B7A26109F for ; Mon, 24 May 2021 12:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232689AbhEXMHP (ORCPT ); Mon, 24 May 2021 08:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbhEXMHO (ORCPT ); Mon, 24 May 2021 08:07:14 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10F5C061574 for ; Mon, 24 May 2021 05:05:46 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso11289108wmh.4 for ; Mon, 24 May 2021 05:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vupoXXFVGGxP68p+rVk16msOI4FEaKWl6TGrTzM+/sE=; b=Ag1pM4LStX8QGVFfznn4U8xkqj3W9vY0n9DY5CJuxtlFT2yt/cHYP9vzAhrE3co0zR x1Iwhz6CF8CSQbJeZpse2cm+ha+HEeQY1E31tovMcsmnZcIbhXRWHL4L6SO2qSP0uaGj xAsiH3GXZPz3MN1iDjjcPv6f3o1ffIPcmyXFFlyZgRSR9GGiKzBSZmHUcB8Tk//bCOzD A45Y5WLUUsYO67zsvmxgaiLRxXeAJO2jwR3E0uIK1zqPKh4GbJJWyi/a0QyytL0Q8VPL e37z956H4a4qwtRP6KsP87w6PG/qHhfdza9TlLUak8je5WZikdWuX7wn1ZW/pPQ4A0lf 5jbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vupoXXFVGGxP68p+rVk16msOI4FEaKWl6TGrTzM+/sE=; b=ldKSzit8U62ZAnhoJiAelVh4/a/dfI6Y6P59bZ06Crx+VvqawLI8oKJs2uCzPLTniG u0hSIB63YR90FA/dTRhRSd69rgNQtpq0niRCmuViHIGDGiG9WY7aunes0FNjre+f1OHi CBgRkJy+x6SswIrIwB+eSdgAAYSYjkDMj2XcjFn+zm1Om9JFIA5nS8lgMycwmB6lW+aE 45lmb5IcY62DH8x95csRoyAi/kSROUYRXgOT+GjsPAgSVIEYp/h5yywX0ZkdvdJIe4PH 9J+gLbF3B7yGgJySzJgrHZJck/vO7kNa5nobxMh/xMXVcYQedjNP+Botu2TSIdOVYd+b I9cA== X-Gm-Message-State: AOAM531M/APwI1OVsQcAucllDDUVufpZ+RrS+wKXOZ7YO5j7vjpW7lv1 aMSgDW/YeBIj9y55QsgYWUaBFA== X-Google-Smtp-Source: ABdhPJy0FdiN1uxAQlj8gKVgakH2g+fVy09MLmYddnv3AT9gmfel4PWdCbeqJ6fp87avQbWglhPTdQ== X-Received: by 2002:a1c:f303:: with SMTP id q3mr19903841wmq.9.1621857945250; Mon, 24 May 2021 05:05:45 -0700 (PDT) Received: from localhost.localdomain ([188.252.220.224]) by smtp.googlemail.com with ESMTPSA id b10sm14342856wrr.27.2021.05.24.05.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 05:05:44 -0700 (PDT) From: Robert Marko To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, lee.jones@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, jmp@epiphyte.org, pmenzel@molgen.mpg.de, buczek@molgen.mpg.de, Robert Marko Subject: [PATCH v2 1/4] mfd: simple-mfd-i2c: Add Delta TN48M CPLD support Date: Mon, 24 May 2021 14:05:36 +0200 Message-Id: <20210524120539.3267145-1-robert.marko@sartura.hr> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Delta TN48M switches have a Lattice CPLD that serves multiple purposes including being a GPIO expander. So, lets use the simple I2C MFD driver to provide the MFD core. Also add a virtual symbol which pulls in the simple-mfd-i2c driver and provide a common symbol on which the subdevice drivers can depend on. Signed-off-by: Robert Marko --- Changes in v2: * Drop the custom MFD driver and header * Use simple I2C MFD driver drivers/mfd/Kconfig | 10 ++++++++++ drivers/mfd/simple-mfd-i2c.c | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5c7f2b100191..1042424c5678 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -297,6 +297,16 @@ config MFD_ASIC3 This driver supports the ASIC3 multifunction chip found on many PDAs (mainly iPAQ and HTC based ones) +config MFD_TN48M_CPLD + tristate "Delta Networks TN48M switch CPLD driver" + depends on I2C + select MFD_SIMPLE_MFD_I2C + help + Select this option to enable support for Delta Networks TN48M switch + CPLD. It consists of MFD and GPIO drivers. CPLD provides GPIOS-s + for the SFP slots as well as power supply related information. + SFP support depends on the GPIO driver being selected. + config PMIC_DA903X bool "Dialog Semiconductor DA9030/DA9034 PMIC Support" depends on I2C=y diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c index 87f684cff9a1..af8e91781417 100644 --- a/drivers/mfd/simple-mfd-i2c.c +++ b/drivers/mfd/simple-mfd-i2c.c @@ -39,6 +39,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c) static const struct of_device_id simple_mfd_i2c_of_match[] = { { .compatible = "kontron,sl28cpld" }, + { .compatible = "delta,tn48m-cpld" }, {} }; MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match); From patchwork Mon May 24 12:05:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 446606 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 157A6C2B9F7 for ; Mon, 24 May 2021 12:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4183613B0 for ; Mon, 24 May 2021 12:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232785AbhEXMHQ (ORCPT ); Mon, 24 May 2021 08:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbhEXMHQ (ORCPT ); Mon, 24 May 2021 08:07:16 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A120C06138A for ; Mon, 24 May 2021 05:05:48 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id q5so28270895wrs.4 for ; Mon, 24 May 2021 05:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QIlx8qZg5d6Uh9n8TaRrLxl4VsPkpMZ5hbZxfKGEKz4=; b=Y4UGAO23lMHMf7wrtfze7s/u2E+7odBkNQ6l3hHiQy5GecB/zslNhIpvQN1TN2U/B3 VTRhKNgBMpqmxKGeZOFa8fUcDoHt6rpV34s9q6sgowEMVh7+jjLtVsCd0Uer9lZhPRyE HWcJ3Ut/ED4Bi4kDqQeQj1unGBS5J+nKH7SoLbu5yHnFrg79vmV6E6z3qRBVDoVURaMJ RaG1wirKGv4MLYfZzZ/O3A7Hw67WcqmyvfSr+solixkSU42/wxhBMXqc/z0K0iAtDn8Z 2v8KOyMUf3JWVMozzz3eib3kP5AvQEcmxhAMLhf+ShBHL48FBCtxTB31knoprU4YBwlk 997Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QIlx8qZg5d6Uh9n8TaRrLxl4VsPkpMZ5hbZxfKGEKz4=; b=PbHcocnF+r6xzGPWgwyyo05xSd9b6MXYZDSeBaav9B7r/a6oWw1FAmNibeiIxJ6jvk dOdpSpscdXxwnF3VNviXgGQ9PgJb8eNzVoDgyD8EYKODOigmTTU/O9alJuDnrxlBAm0S gDKvlAQOa/8fTJOfVCIc1xyG/bFkuGFF+M8cAi9dU1XvvaxyPZ430Fp12flJGuw+5q5Q sTclPOZI3dCzqT0O0SRjfsQ18JP+q7CmL6UC2TwrW9dvEIoIA0p6LqRsgrbviCm02gMi EJV9cB3Gr9ByCX9PJSNQh0+JpOEBAt8zIZ4O2suraDhXlDvDImMwioQxWN6KQ/JzRkIy Owzw== X-Gm-Message-State: AOAM530shtMGXCLKqjrGzjNq3sGxEJrJtBMLvtkxqb9wI/XSJAbdpkD1 zyvyH4yK5xPbL4BkgS4Yuukcww== X-Google-Smtp-Source: ABdhPJyrIguuCaLAAt7tDQ0qjABDr07zCPmN8UpVUCNQEQlY/Rt+Daa+mIPRwCbCglde2+BU0MyA7w== X-Received: by 2002:adf:f309:: with SMTP id i9mr22279437wro.307.1621857946909; Mon, 24 May 2021 05:05:46 -0700 (PDT) Received: from localhost.localdomain ([188.252.220.224]) by smtp.googlemail.com with ESMTPSA id b10sm14342856wrr.27.2021.05.24.05.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 05:05:46 -0700 (PDT) From: Robert Marko To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, lee.jones@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, jmp@epiphyte.org, pmenzel@molgen.mpg.de, buczek@molgen.mpg.de, Robert Marko Subject: [PATCH v2 2/4] gpio: Add Delta TN48M CPLD GPIO driver Date: Mon, 24 May 2021 14:05:37 +0200 Message-Id: <20210524120539.3267145-2-robert.marko@sartura.hr> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524120539.3267145-1-robert.marko@sartura.hr> References: <20210524120539.3267145-1-robert.marko@sartura.hr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Delta TN48M CPLD is used as a GPIO expander for the SFP GPIOs. It is a mix of input only and output only pins. Signed-off-by: Robert Marko Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Reviewed-by: Linus Walleij --- Changes in v2: * Rewrite to use simple I2C MFD and GPIO regmap * Drop DT bindings for pin numbering drivers/gpio/Kconfig | 12 ++++++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-tn48m.c | 89 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 drivers/gpio/gpio-tn48m.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 1dd0ec6727fd..46caf72960e6 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1332,6 +1332,18 @@ config GPIO_TIMBERDALE help Add support for the GPIO IP in the timberdale FPGA. +config GPIO_TN48M_CPLD + tristate "Delta Networks TN48M switch CPLD GPIO driver" + depends on MFD_TN48M_CPLD + select GPIO_REGMAP + help + This enables support for the GPIOs found on the Delta + Networks TN48M switch CPLD. + They are used for inputs and outputs on the SFP slots. + + This driver can also be built as a module. If so, the + module will be called gpio-tn48m. + config GPIO_TPS65086 tristate "TI TPS65086 GPO" depends on MFD_TPS65086 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index d7c81e1611a4..07fa6419305f 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -147,6 +147,7 @@ obj-$(CONFIG_GPIO_TEGRA186) += gpio-tegra186.o obj-$(CONFIG_GPIO_TEGRA) += gpio-tegra.o obj-$(CONFIG_GPIO_THUNDERX) += gpio-thunderx.o obj-$(CONFIG_GPIO_TIMBERDALE) += gpio-timberdale.o +obj-$(CONFIG_GPIO_TN48M_CPLD) += gpio-tn48m.o obj-$(CONFIG_GPIO_TPIC2810) += gpio-tpic2810.o obj-$(CONFIG_GPIO_TPS65086) += gpio-tps65086.o obj-$(CONFIG_GPIO_TPS65218) += gpio-tps65218.o diff --git a/drivers/gpio/gpio-tn48m.c b/drivers/gpio/gpio-tn48m.c new file mode 100644 index 000000000000..41484c002826 --- /dev/null +++ b/drivers/gpio/gpio-tn48m.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Delta TN48M CPLD GPIO driver + * + * Copyright 2021 Sartura Ltd + * + * Author: Robert Marko + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +enum tn48m_gpio_type { + TN48M_SFP_TX_DISABLE = 1, + TN48M_SFP_PRESENT, + TN48M_SFP_LOS, +}; + +static int tn48m_gpio_probe(struct platform_device *pdev) +{ + struct gpio_regmap_config config = {0}; + enum tn48m_gpio_type type; + struct regmap *regmap; + u32 base; + int ret; + + if (!pdev->dev.parent) + return -ENODEV; + + type = (uintptr_t)device_get_match_data(&pdev->dev); + if (!type) + return -ENODEV; + + ret = device_property_read_u32(&pdev->dev, "reg", &base); + if (ret) + return -EINVAL; + + regmap = dev_get_regmap(pdev->dev.parent, NULL); + if (!regmap) + return -ENODEV; + + config.regmap = regmap; + config.parent = &pdev->dev; + config.ngpio = 4; + + switch (type) { + case TN48M_SFP_TX_DISABLE: + config.reg_set_base = base; + break; + case TN48M_SFP_PRESENT: + config.reg_dat_base = base; + break; + case TN48M_SFP_LOS: + config.reg_dat_base = base; + break; + default: + dev_err(&pdev->dev, "unknown type %d\n", type); + return -ENODEV; + } + + return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(&pdev->dev, &config)); +} + +static const struct of_device_id tn48m_gpio_of_match[] = { + { .compatible = "delta,tn48m-gpio-sfp-tx-disable", .data = (void *)TN48M_SFP_TX_DISABLE }, + { .compatible = "delta,tn48m-gpio-sfp-present", .data = (void *)TN48M_SFP_PRESENT }, + { .compatible = "delta,tn48m-gpio-sfp-los", .data = (void *)TN48M_SFP_LOS }, + { } +}; +MODULE_DEVICE_TABLE(of, tn48m_gpio_of_match); + +static struct platform_driver tn48m_gpio_driver = { + .driver = { + .name = "delta-tn48m-gpio", + .of_match_table = tn48m_gpio_of_match, + }, + .probe = tn48m_gpio_probe, +}; +module_platform_driver(tn48m_gpio_driver); + +MODULE_AUTHOR("Robert Marko "); +MODULE_DESCRIPTION("Delta TN48M CPLD GPIO driver"); +MODULE_LICENSE("GPL"); From patchwork Mon May 24 12:05:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 447586 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 E441DC04FF3 for ; Mon, 24 May 2021 12:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C80E96109F for ; Mon, 24 May 2021 12:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232808AbhEXMHT (ORCPT ); Mon, 24 May 2021 08:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232793AbhEXMHR (ORCPT ); Mon, 24 May 2021 08:07:17 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4465C061574 for ; Mon, 24 May 2021 05:05:49 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id x8so28273574wrq.9 for ; Mon, 24 May 2021 05:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pSikriGY8WxnD/HvwIHFkiIuj1QNzjOxk1k9wUWdYDc=; b=kdjX4LaXBUMzusDS7bfBuzNlSGjp91t5RXFOlJq2aJFBnw/x01MzTS/KIPmW4zm6mh Jpi6GIinJN6feaBAML0vAM7CnfDijG1Xc+A3ekhCWSM7z1EYrEMmQ8pOjy+t4eJxAA3J J4uYpF48/PRKBN4/rJFVlEfoEliqJCvpTrcD+b3+m5eNDLGG1J1eQR+zPJ5swOqTnhk3 40VqKjQGIn4uKppjHlde0GJqHMh4QihNNuaFPiSh8vGqzictkatP8qDhdSKvEDic4d+K uZ1t3zUeNyICHiwKVYpljn8E1giFPsZYu+SSNs6zUKuWoUBqksQyTaMWIF1uSjr221mr bKqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pSikriGY8WxnD/HvwIHFkiIuj1QNzjOxk1k9wUWdYDc=; b=HnCyxOsDz1I7VtYS5GE9ca8s4+w+u2P909zOHwfFfvXYD49ojmAmB9IMLVZRAaYv20 6POuVYZ7F4wcmeR6/JX7s5qHuPzg5G4dHpjiQqv3HiHl5fiSPlEdvFR66yfMZYQNfiCt 7U5+c+Z20RBPA6boopZitPkCqMPvjoxrYrIMZVr5Rr5W7fv4pKqfrjtS6He7N5eORAH4 MgRW/gAN71jAoCXhrdbICgzXG1wKaIhHSfQ4ZY+tv7dAcMr2tDGbzN0Zy9phzfmTYoq4 XKvFJdoWVWt2Aj74wcQXEoDKp3oyx/uCaRuhaxBoGVZM5b2Pnty46UT5j+4gOMihilXJ VmGQ== X-Gm-Message-State: AOAM530BdOM7s0/5yHYTIx/+jD+uOnmjcuVZVp+fzECFXiQjiHjFrmwB K7FzsvxpvvOOPU9GxyQNUD2ZSg== X-Google-Smtp-Source: ABdhPJxsxqXT3b6O4xVF+Wt+m1QGBD7G4gRM4JPeXkZBtgChfsei9VrOJKPzjeYgrsngJ7fIbZ3VYg== X-Received: by 2002:a05:6000:1145:: with SMTP id d5mr22270356wrx.404.1621857948390; Mon, 24 May 2021 05:05:48 -0700 (PDT) Received: from localhost.localdomain ([188.252.220.224]) by smtp.googlemail.com with ESMTPSA id b10sm14342856wrr.27.2021.05.24.05.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 05:05:48 -0700 (PDT) From: Robert Marko To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, lee.jones@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, jmp@epiphyte.org, pmenzel@molgen.mpg.de, buczek@molgen.mpg.de, Robert Marko Subject: [PATCH v2 3/4] dt-bindings: mfd: Add Delta TN48M CPLD drivers bindings Date: Mon, 24 May 2021 14:05:38 +0200 Message-Id: <20210524120539.3267145-3-robert.marko@sartura.hr> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524120539.3267145-1-robert.marko@sartura.hr> References: <20210524120539.3267145-1-robert.marko@sartura.hr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add binding documents for the Delta TN48M CPLD drivers. Signed-off-by: Robert Marko --- Changes in v2: * Implement MFD as a simple I2C MFD * Add GPIO bindings as separate .../bindings/gpio/delta,tn48m-gpio.yaml | 42 ++++++++++ .../bindings/mfd/delta,tn48m-cpld.yaml | 81 +++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml create mode 100644 Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml diff --git a/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml new file mode 100644 index 000000000000..aca646aecb12 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/delta,tn48m-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Delta Networks TN48M CPLD GPIO controller + +maintainers: + - Robert Marko + +description: | + This module is part of the Delta TN48M multi-function device. For more + details see ../mfd/delta,tn48m-cpld.yaml. + + GPIO controller module provides GPIO-s for the SFP slots. + It is split into 3 controllers, one output only for the SFP TX disable + pins, one input only for the SFP present pins and one input only for + the SFP LOS pins. + +properties: + compatible: + enum: + - delta,tn48m-gpio-sfp-tx-disable + - delta,tn48m-gpio-sfp-present + - delta,tn48m-gpio-sfp-los + + reg: + maxItems: 1 + + "#gpio-cells": + const: 2 + + gpio-controller: true + +required: + - compatible + - reg + - "#gpio-cells" + - gpio-controller + +additionalProperties: false diff --git a/Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml b/Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml new file mode 100644 index 000000000000..055e09129f86 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml @@ -0,0 +1,81 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/delta,tn48m-cpld.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Delta Networks TN48M CPLD controller + +maintainers: + - Robert Marko + +description: | + Lattice CPLD onboard the TN48M switches is used for system + management. + + It provides information about the hardware model, revision, + PSU status etc. + + It is also being used as a GPIO expander for the SFP slots. + +properties: + compatible: + const: delta,tn48m-cpld + + reg: + description: + I2C device address. + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + +patternProperties: + "^gpio(@[0-9a-f]+)?$": + $ref: ../gpio/delta,tn48m-gpio.yaml + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + cpld@41 { + compatible = "delta,tn48m-cpld"; + reg = <0x41>; + #address-cells = <1>; + #size-cells = <0>; + + gpio@31 { + compatible = "delta,tn48m-gpio-sfp-tx-disable"; + reg = <0x31>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio@3a { + compatible = "delta,tn48m-gpio-sfp-present"; + reg = <0x3a>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio@40 { + compatible = "delta,tn48m-gpio-sfp-los"; + reg = <0x40>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; From patchwork Mon May 24 12:05:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 446605 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=-21.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 2AADBC2B9F8 for ; Mon, 24 May 2021 12:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BFD0613AD for ; Mon, 24 May 2021 12:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232770AbhEXMHV (ORCPT ); Mon, 24 May 2021 08:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232793AbhEXMHT (ORCPT ); Mon, 24 May 2021 08:07:19 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD755C06138B for ; Mon, 24 May 2021 05:05:51 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id u133so14768785wmg.1 for ; Mon, 24 May 2021 05:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y4mDLJI6ZBdxgxH0dBpQUIM+/toIWaURghT1ZZl8ozY=; b=zacssyyJnwqvvoDKaK/qA3DhnNEcedibRWR+rSep0JbnvR5N6MVCLqVte25MJXmBYv 1TZS3tdj7L7Ok5gtxMO1i85sdiaW4SQNXjyw8AufZKXpBoAF/DSyDUw/YTyzmQE/hK/F RnlZsGvggqHsafYN6pvDgsVHpyPbgadLucqTPGxMVMuy3qtP9f/61uywZBShfe8mSGUM Jz1rHL+cwHzGernAtHRlyX3wwehFWGvHBG1EgCvaMancHaDTQfUiaOBZc1wqu+W7zQ0V a6u+0PNX4caMJ1y53QUirLoEbAjLKAEp8+Mjywew0cy1IDkGzpyr3ZwGTm3rWy72/sft p8rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y4mDLJI6ZBdxgxH0dBpQUIM+/toIWaURghT1ZZl8ozY=; b=npqK4KJ6l7oVrA/yzN0af6jCqbgzqTKYOs2aBTSpwk5cq+fct2UPMW5Qvyb7BAyHNS CmAEjvf3Q9CxvGun79oe6QjJVQVdgTdmLVJmeOJ8Hp9hmLqDr9bNshACJvSeXNQyp45H UKb7D2U0gCf++K2wemtM9k13StFu1/oiYNsHfecFxSNQTB9FuFjZdKggegw6uUiV7fb0 VEI6IWN5+XOTW3f/s4mdi98TLA+jTfucMfyaBJ77/gFE4tlOGvBS5/Z5Uft2XrXlK5PJ FCF4Ou5XFlSAcjlQCgKKagyHvLF4XD+cHbUAZl17WKH1BhcLjLHwV9dWi5SWqEl5KmTr eqvA== X-Gm-Message-State: AOAM532DTXa8z+fQFDEO2LUnl/6elQ2ATXUHB4AxiIOP64Qq2IabzRPx yH+Midx/2nVz8rv0czbXKEuOPA== X-Google-Smtp-Source: ABdhPJz0DoA7taigFJ1JR2F0uQQE2ldAgwNGedwjYYbAUsM7F3gwAvJCabQLNuVjwK6pcOA7l8VX+A== X-Received: by 2002:a1c:9d02:: with SMTP id g2mr19065979wme.119.1621857950421; Mon, 24 May 2021 05:05:50 -0700 (PDT) Received: from localhost.localdomain ([188.252.220.224]) by smtp.googlemail.com with ESMTPSA id b10sm14342856wrr.27.2021.05.24.05.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 05:05:50 -0700 (PDT) From: Robert Marko To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, robh+dt@kernel.org, lee.jones@linaro.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, jmp@epiphyte.org, pmenzel@molgen.mpg.de, buczek@molgen.mpg.de, Robert Marko Subject: [PATCH v2 4/4] MAINTAINERS: Add Delta Networks TN48M CPLD drivers Date: Mon, 24 May 2021 14:05:39 +0200 Message-Id: <20210524120539.3267145-4-robert.marko@sartura.hr> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524120539.3267145-1-robert.marko@sartura.hr> References: <20210524120539.3267145-1-robert.marko@sartura.hr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Add maintainers entry for the Delta Networks TN48M CPLD MFD drivers. Signed-off-by: Robert Marko --- Changes in v2: * Drop no more existing files MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 81e1edeceae4..dd2bcb8c7756 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5180,6 +5180,13 @@ W: https://linuxtv.org T: git git://linuxtv.org/media_tree.git F: drivers/media/platform/sti/delta +DELTA NETWORKS TN48M CPLD DRIVERS +M: Robert Marko +S: Maintained +F: Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml +F: Documentation/devicetree/bindings/mfd/delta,tn48m-cpld.yaml +F: drivers/gpio/gpio-tn48m.c + DENALI NAND DRIVER L: linux-mtd@lists.infradead.org S: Orphan