Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1569346pxy; Mon, 2 Aug 2021 05:13:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrh/2TKvHSlRApvrcaf5HswUVPaMyI+S1oUew9wL1dE/A86b9XCcpS+12v0bR68iVlKTfd X-Received: by 2002:a5d:96cb:: with SMTP id r11mr2106490iol.53.1627906411348; Mon, 02 Aug 2021 05:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627906411; cv=none; d=google.com; s=arc-20160816; b=Q3k6wDDjOXnfc49v+d4WjTdxGeFfC02RWK5hN+zICX3HfkKVByNC1kIJ8NNO2Xrlin QWeoIF8JPqUU29tUuNg8OdPOtAABTcGicQyGAERta86NuiaTCwMKq8NYkr044GURaR39 93sS0TYK2VKNWOuJj2iCJGvIk2a8ZUmB3I6yt2JswTsJg7SPCKag4b4blogOKgANGBFo 9JxhLstCqjsSep1Azf3r/PyJVU46eJdyVocqpWslbYX2JCYO/anTF0KGV4SUW5KbHwNv 5BYB6lVTiIETf1cad6gnJSi0UlhPX+2l0YNPh20bKz9+yzmpitslL5lt3HsfbcCu1Ztd QR9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FkCp4kdPQ6v+pD/rtKzXxvtpigTWSSTz78u5tHl7Xw0=; b=mz8ZtDZ1tG42AnYs056gTewMv3eDzfsO9BqMg/XPLg8Atr0hR8ucar42/gCDdAcjKg XA6sQeJgHQeAn36WoCKBv1kg0s33JC0IA9akyJwLYObUlZ1Q/BkLvOUpaEpOV255Kv7I djWpsM/f2GFfbAunXyXp1EEeGb1duGi6XenkivIjYE3ZeKUAD7ujzlNRpiFyEW9uI1k5 6MWwiV54YjGkt54fMsXuszd0BsVzn9y28VKQ1WwQiFWAVYjRQ4bewabAc15+eGP3lnye HJ3jNS+ze+VkVOVByPFUhWgoD3bytARZsLX5/6naHjlUtzZAxSdr9cNnAbQbEiwQnkEl 4twA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oW3C6jQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o1si5528284jah.81.2021.08.02.05.13.20; Mon, 02 Aug 2021 05:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oW3C6jQO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233570AbhHBMMq (ORCPT + 99 others); Mon, 2 Aug 2021 08:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233594AbhHBMMn (ORCPT ); Mon, 2 Aug 2021 08:12:43 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 310F4C061796 for ; Mon, 2 Aug 2021 05:12:33 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id w17so28053961ybl.11 for ; Mon, 02 Aug 2021 05:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FkCp4kdPQ6v+pD/rtKzXxvtpigTWSSTz78u5tHl7Xw0=; b=oW3C6jQOKtE2Ij6HWnrX36JyH29DLnGDBkzqnseCD3B7Sg45+lwtJoAJZ6sE1xwsBV 1uBHXVrgz4+y/kx88AZx4qgoDD2KPTmkBnKw+/OWNDXkL0mWqawKi4O+O5aykFa1JYsh OGVPL6HQPx5AECzgnWCey3MdUAHaOsAFWBpK9JJwxRnr2cv4E0UwqHZS2mvcAHDSXbGy G7/4O+2vt9i5Agaj6h56yWKGWaoep+YCpCW5Q/CDVe3ce1xuv8YzU4KuFO0KKYSykm+8 /pRoi3FaG/XftwBg2ylo1IwT7R2sGyysK4tkr1v3bWyHZ2/+V/fqiEhBhliFfjUwg+/w u4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FkCp4kdPQ6v+pD/rtKzXxvtpigTWSSTz78u5tHl7Xw0=; b=rQYMzy/87DpGLw+Umxu2J/dDiRiHN0HgRhl0+oLLP2f22I4HDkL/Vp0aoG7mWs2Rc+ MIkkKA57zV/+7Q9k8GkEFJgpOo/uqpksA3mrMvLztMRduRbT673g05uD6749AfDf3jiW +cCXIDBiIJcnwJaN97lp3dvq1LpXOactOaphv28GGQf+20XwtOqyubA3FCmNhdgsBfNK EEqKaYzq+9owVK9LJs5cU8hJEVDHw1IaH3EP0jd31FzWDuLkuwtqmKRHQDOrq0HCaJ9S ThP1Lwnr8QwMriZ7hATUGF4AtNreUY1BzD5+z+WhF1OCtl42XeGzANzzfkJUP6bxSOQZ FmhA== X-Gm-Message-State: AOAM531IzjuthSoS8kCjXACV83AwYT6FSeOd/2TWFRsFBD6eIbQGrdPw YdVBScrH4h6UeAwm1SqEVk4CFoQyzV4TZuwRdZBatw== X-Received: by 2002:a25:48c7:: with SMTP id v190mr20238398yba.312.1627906352461; Mon, 02 Aug 2021 05:12:32 -0700 (PDT) MIME-Version: 1.0 References: <20210716221744.5445-1-robert.marko@sartura.hr> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 2 Aug 2021 14:12:21 +0200 Message-ID: Subject: Re: [PATCH 1/2] gpio: tn48m: Add support for Delta TN4810M CPLD To: Robert Marko Cc: Linus Walleij , Rob Herring , linux-gpio , linux-devicetree , LKML , luka.perkov@sartura.hr Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 2, 2021 at 2:10 PM Bartosz Golaszewski wrote: > > On Sat, Jul 17, 2021 at 12:17 AM Robert Marko wrote: > > > > Delta TN4810M uses a similar CPLD GPIO expander > > like the TN48M, but it has pins for 48 SFP+ ports, > > making a total of 192 pins. > > It also provides the TX fault pins which the TN48M > > does not. > > > > Only TX disable pins like on the TN48M are output > > ones. > > > > Thankfully, regmap GPIO allows for the driver to be > > easily extended to support the TN4810M. > > > > Note that this patch depends on the following series: > > https://patchwork.ozlabs.org/project/linux-gpio/list/?series=247538 > > > > Signed-off-by: Robert Marko > > --- > > drivers/gpio/gpio-tn48m.c | 56 ++++++++++++++++++++++++++++++++++++--- > > 1 file changed, 52 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpio/gpio-tn48m.c b/drivers/gpio/gpio-tn48m.c > > index b12a6b4bc4b3..e429e7ade941 100644 > > --- a/drivers/gpio/gpio-tn48m.c > > +++ b/drivers/gpio/gpio-tn48m.c > > @@ -19,6 +19,10 @@ enum tn48m_gpio_type { > > TN48M_SFP_TX_DISABLE = 1, > > TN48M_SFP_PRESENT, > > TN48M_SFP_LOS, > > + TN4810M_SFP_TX_DISABLE, > > + TN4810M_SFP_TX_FAULT, > > + TN4810M_SFP_PRESENT, > > + TN4810M_SFP_LOS, > > }; > > > > static int tn48m_gpio_probe(struct platform_device *pdev) > > @@ -46,17 +50,36 @@ static int tn48m_gpio_probe(struct platform_device *pdev) > > > > config.regmap = regmap; > > config.parent = &pdev->dev; > > - config.ngpio = 4; > > + config.ngpio_per_reg = 8; > > > > switch (type) { > > case TN48M_SFP_TX_DISABLE: > > config.reg_set_base = base; > > + config.ngpio = 4; > > break; > > case TN48M_SFP_PRESENT: > > config.reg_dat_base = base; > > + config.ngpio = 4; > > break; > > case TN48M_SFP_LOS: > > config.reg_dat_base = base; > > + config.ngpio = 4; > > + break; > > + case TN4810M_SFP_TX_DISABLE: > > + config.reg_set_base = base; > > + config.ngpio = 48; > > + break; > > + case TN4810M_SFP_TX_FAULT: > > + config.reg_dat_base = base; > > + config.ngpio = 48; > > + break; > > + case TN4810M_SFP_PRESENT: > > + config.reg_dat_base = base; > > + config.ngpio = 48; > > + break; > > + case TN4810M_SFP_LOS: > > + config.reg_dat_base = base; > > + config.ngpio = 48; > > break; > > default: > > dev_err(&pdev->dev, "unknown type %d\n", type); > > @@ -67,9 +90,34 @@ static int tn48m_gpio_probe(struct platform_device *pdev) > > } > > > > 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 }, > > + { > > + .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 > > + }, > > + { > > + .compatible = "delta,tn4810m-gpio-sfp-tx-disable", > > + .data = (void *)TN4810M_SFP_TX_DISABLE > > + }, > > + { > > + .compatible = "delta,tn4810m-gpio-sfp-tx-fault", > > + .data = (void *)TN4810M_SFP_TX_FAULT > > + }, > > + { > > + .compatible = "delta,tn4810m-gpio-sfp-present", > > + .data = (void *)TN4810M_SFP_PRESENT > > + }, > > + { > > + .compatible = "delta,tn4810m-gpio-sfp-los", > > + .data = (void *)TN4810M_SFP_LOS > > + }, > > { } > > }; > > MODULE_DEVICE_TABLE(of, tn48m_gpio_of_match); > > -- > > 2.31.1 > > > > This looks good to me. I suppose the other patches are going in > through the MFD tree. I don't see anything that can fail here at > build-time - can you confirm that I can pick these patches up > separately for v5.15? > > Bartosz Scratch that, I now saw Linus' comment about the special purpose pins under the other series. Let's clear that up first. Bart