From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.7 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,URIBL_BLOCKED autolearn=unavailable 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 BDE92C432BE for ; Mon, 2 Aug 2021 12:10:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DE9760FA0 for ; Mon, 2 Aug 2021 12:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233576AbhHBMK6 (ORCPT ); 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-Google-Smtp-Source: ABdhPJxd/nHYE1HdonBqJGgu3Tqa+WZ9PmgGGn7DeGFK/iw+LvNCai1ySHkhSlmzifsAFlqatmlthT2JUhnQjRlcQcU= 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