Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1567904pxy; Mon, 2 Aug 2021 05:11:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxctKsFufKEY6xlFeiILBsMpuLlmmRV5ZWzTMcnxiPjLlEheTIIjd9sy6pG5KvvzxJO8xg X-Received: by 2002:a5d:9304:: with SMTP id l4mr2965805ion.167.1627906306500; Mon, 02 Aug 2021 05:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627906306; cv=none; d=google.com; s=arc-20160816; b=KsWG5wBPWsMyY4NQmsoZwVHTgrjvjgTNiKS5MUZIkTXRU35JZewGM6aCxjIy74oMEA apKf2KjONB4X83dAGDsIN/Zn+clAAlNTxOlHCW4WU6h00TOnXdbjLoojjUCjt6ijb7OC 5DLAhK/2wBqo7ft/laUdRyupmWxWs8r+UNh1M+ztptG4+w+zRXpUhumnQdcFZa+WZLL9 eWu1w3hydPVSTLl54F9nN+7rdi415uUPCwUz88DtDObax4DFYvt8b5effSN7zimuEnNU 71gA53vDnXTn2XW/XjcxJdKOBpPsbIUNsKYDT/uglQfUf3ewBh2cX1bBx2WAJ1lKPtks KtYw== 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=IokGs/ock9H3fPpCABnbBAUNhbT31L4t8yb0xlxFIy8=; b=I0WMokjWsy6IsiE4ZkrvYVKroWrHqMr9FMkVQhHaVX4FK5N5oe/6NgLL5oe+eLmUIk wCkQhekcAc2CL3gur5CWZgErjrPmtKQNZicGLj39Zw1f4VnO+Ez7dWD24Flm2EPJbgqY 1tx/4KkKxxFOJ/CwcJwqeVy2zP84BaodzQ9D2Uj7hFq5ZJ1bmdhd6RXO9KDtCk2FAmZL 4m8oIFQkt4Yan+e9rLWRo2m6x/MougxlvW04JXSb//vJB+eeZMO+Qgr81gwKIDfT0AIV 9+x+CcpkroW83rCB+aqvk4yqbZm5upRxgXOaX2DleGVnXKMqlpDIhmS+I6e5tqKyK9n8 eIdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oPeKY+Mn; 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 j14si9801504jaq.106.2021.08.02.05.11.35; Mon, 02 Aug 2021 05:11:46 -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=oPeKY+Mn; 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 S233516AbhHBMK6 (ORCPT + 99 others); Mon, 2 Aug 2021 08:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbhHBMK5 (ORCPT ); Mon, 2 Aug 2021 08:10:57 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598C9C06175F for ; Mon, 2 Aug 2021 05:10:48 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id g76so28147737ybf.4 for ; Mon, 02 Aug 2021 05:10:48 -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=IokGs/ock9H3fPpCABnbBAUNhbT31L4t8yb0xlxFIy8=; b=oPeKY+Mn1bWxGwC8jLRHIpeFGvMJPtDjw06oaa8Knjmr9RsGRNOLC5NJq52SJlKGFB ugZVPyMeLkbm30ClxKj0tawg1XAbciSDD3yy0gj5ETJdyayUFQYqaNlBudYyb01s/u9G RGZL9w88H9CojbM8tkZgSsHAPn9+RtwES0k1PO9kL3RnrjPFI+nlK2ls83dZoGBUOmL4 opQLTyDEgPEjjUv2SXSkvrjOhK34IDLLtiAKmUhQ/SEoey/4DEAi18DnDpNl/cxxtJuP 42TLxX41ZT0YvxDtrICkv18dONEoU7HQe1hF7Of8V/ma2skYjNN0Uic4nb/rFn0mvD8z NY+A== 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=IokGs/ock9H3fPpCABnbBAUNhbT31L4t8yb0xlxFIy8=; b=BEcywiGpSpndh1q3vQUk/opR9erMjB1oj4OGUn2947dJz1Kx22GIu7Vq7fmxygADqA w0dq8wisCSstxFMwxjm3+92YuG6msBAdKx3ewTTuf5yDWvNm/a2f/z65x9RKZn6VGnKu DqV/16Pqt6QOXtCb6pZUE36MOABOmIYURqLxeIN5hiYpj3+JljeXORItL/mXzzAZNsoz vBFs33xZfEFTGMDlBWT0zOi1WsxJ+hCewciqvuQiqsRn30PV97bt0njtn/momqE8IG+E libHihoX4w4gQTMiZI6ZbansNoRJjOCuWMRyvzXcWdHuhceM3ZiBSWwB7wjPZPMyvC3P pB0Q== X-Gm-Message-State: AOAM533YulFkxBC5j0to+TlTsHYbXxO/ykhKdlUUyrkdtjFrglegF+vQ D1Ta6BsPGQa11X9X8r+HG0O4enPdPhu+D6XMiWXGPQ== X-Received: by 2002:a25:3750:: with SMTP id e77mr20820613yba.469.1627906247652; Mon, 02 Aug 2021 05:10:47 -0700 (PDT) MIME-Version: 1.0 References: <20210716221744.5445-1-robert.marko@sartura.hr> In-Reply-To: <20210716221744.5445-1-robert.marko@sartura.hr> From: Bartosz Golaszewski Date: Mon, 2 Aug 2021 14:10:36 +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 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