Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp834256pxb; Fri, 22 Apr 2022 12:10:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6m/Fu3S08um9475HrrYc7ePliSloyzyf6aAJYYFwBvN4dEZZR1OZEVyYWnHF6BbJgWijS X-Received: by 2002:a17:90b:2311:b0:1d9:277e:edad with SMTP id mt17-20020a17090b231100b001d9277eedadmr478219pjb.190.1650654650848; Fri, 22 Apr 2022 12:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650654650; cv=none; d=google.com; s=arc-20160816; b=b36fnwhJFopjWOC+OlHxHYJGkQsYjHUTIg98r6SZgg2dq7uMNAJYq0ynmlWXWEA7pz WzyKI3zwXwtLwyx8kaNsz+qRYfUzRKsdm4nR5ZQ+GvMrNOfrH+dcJVGDnH28GYuap6dG k5lnyqIH7TunZHqqfOD2pH/ubBs4ajsBprnEy7Rfw2+l89CPflr6PHyNvZ4wFLOzs13X ZcDM9oFaIgZvmQFSsKeJ7d0HtkNoxBn697tjUWgmmsP4UyqXZUo2jX7mlFMjuXhgc9Nf C5/Ril+IXVomi7puvsg+Ms6+4QnhiRPurCNOYixnZS3nIfMYBGE+uyaiKEAMim3sS8ah Yc3Q== 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=Hl0H8r3ajkx6AoTJ0h/8Wbz3DASQYMFtnKxsp34ktyo=; b=U8277UbqUJJlYWUnO3Hme7EPF6756NhBUY0OePEs43t87sB8rxorYNgQzY7NFKEZIb tF7M8SX7AAg4EVm8hDoBpPjPImhh0Q2awxUWlgQX+MhpSN5iXp+juiOa8VcSOoGeKvqb 6ueq2ChUI3VX4aLL4y/jhS5AU9VEg018O1ofM+Xpxy4mxhBF2gBqMEE5UCmMckQsPx/I HQbzrhCT+M0pq6NrwHBSClzD/vmr1n/d8BAPi0twwPYaF3U6L0ojHTUQG1h9svxxnP1/ YiyIhxDX27JVVwDMSajHzl+tm68U/nB7SPNSztwmdh47NBHxCNNB7L2MfvHyLANOwuqW 73Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lK9+4jZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c26-20020a631c5a000000b003863116c04csi8824833pgm.192.2022.04.22.12.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lK9+4jZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 69A3E1A5F6C; Fri, 22 Apr 2022 11:28:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392577AbiDUU4L (ORCPT + 99 others); Thu, 21 Apr 2022 16:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392576AbiDUU4G (ORCPT ); Thu, 21 Apr 2022 16:56:06 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 703404EA03 for ; Thu, 21 Apr 2022 13:53:15 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id w20so4690988ybi.8 for ; Thu, 21 Apr 2022 13:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hl0H8r3ajkx6AoTJ0h/8Wbz3DASQYMFtnKxsp34ktyo=; b=lK9+4jZIPZ4+NkR82tNKiJrtDpuWaIp81H8ZGwqKgNjNCjeo9TcUh8reO1cS4Fc1Gj U6Y75CRMiywZeFBD/Oqd2QUXID1fktacITwJAe/1rPxSCLQpdrCqmNgbF+fipiJjPtUY 5R7/3jDqpl9/MR3BVEpteMq8pqEYHdX/jUdSUukKSI/RlTIH2aNtZNW1ItKHMVCpAGEc 0IItadOZ0PXwep+x3Zg5SMa5kIL792n0Hx9jGn9MWJpPm2ZuVHf7wcNWY7Dpw8l+5G2V JiGNTAULGBKYwZAyl4w8XY1mu1taub6lG7nmXE15BdMlqyDPOTL2xrVavMqcLJ1TXqmF lzkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hl0H8r3ajkx6AoTJ0h/8Wbz3DASQYMFtnKxsp34ktyo=; b=G7IMxipQYRV6/vx4dxi6ZFM/Yf2YFw6+29hq2oJw8yzJ1OmI/yx1lZYYqPB+Yxs0Dy Gyz3DBZrpMW++GFOUw3lbrX4epR9u9imIDPWaIANYpZfz0tj8ruv1Fu56DcseeI10wYC Xibcd+sY/jd74wzA3NONG4qKvgENsCj0lxJnwL+TwsJFyyNfv+A2Lp3XpX38jzxjo2oV hkbkluFLfiMXqVvi05QipqKQmtJpvEu9+BVkJ6N1mBrWuxqJRtannq0w8/7dhZSkatut iGQ340wryNV88j5IerTNC7kFVQZNTsF9LmAckkPoi/CmEehVuazHShnnL+sQN/4eJbgh xI6A== X-Gm-Message-State: AOAM531kbcyzUKNxfm6lAERULAo5uW8q1Q+S/JJV5qF7m6PRufsaPGqx sr+fFzEhCNFoXh8z6qQBx5al1GiqXg5Mgp4QEJdd6g== X-Received: by 2002:a25:4e82:0:b0:633:68d7:b864 with SMTP id c124-20020a254e82000000b0063368d7b864mr1662875ybb.514.1650574394711; Thu, 21 Apr 2022 13:53:14 -0700 (PDT) MIME-Version: 1.0 References: <20220419071503.1596423-1-patrick.rudolph@9elements.com> <20220419071503.1596423-3-patrick.rudolph@9elements.com> In-Reply-To: <20220419071503.1596423-3-patrick.rudolph@9elements.com> From: Linus Walleij Date: Thu, 21 Apr 2022 22:53:02 +0200 Message-ID: Subject: Re: [PATCH 2/2] pinctrl: Add Cypress cy8c95x0 support To: Patrick Rudolph Cc: Naresh Solanki , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Patrick, Naresh, thanks for your patch! This is a VERY good looking driver so I don't think we will need a lot of iterations before it is finished. (Famous last words, but it looks very good.) On Tue, Apr 19, 2022 at 9:17 AM Patrick Rudolph wrote: > +static const struct i2c_device_id cy8c95x0_id[] = { > + { "cy8c9520", 20, }, > + { "cy8c9540", 40, }, > + { "cy8c9560", 60, }, > + { } So here is the ngpios for each expander. > + chip->tpin = chip->driver_data & CY8C95X0_GPIO_MASK; > + ngpios = -1; > + if (client->dev.of_node) > + of_property_read_u32(client->dev.of_node, "ngpios", &ngpios); > + > + if (ngpios < 0 || ngpios > (chip->driver_data & CY8C95X0_GPIO_MASK)) > + ngpios = chip->driver_data & CY8C95X0_GPIO_MASK; So why should this be configurable from the device tree at all? I understand if not all gpios are used, but we usually just expose all GPIOs on an expander. Yours, Linus Walleij