Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6330078rwl; Tue, 4 Apr 2023 10:55:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aaC8WkgihGi9weKmwDwvscvLcjrkCZzHY4481klMeYW2jXxZYNbajEKR++pOw4KzXMVvX1 X-Received: by 2002:a17:902:cf45:b0:1a1:b7fc:eeba with SMTP id e5-20020a170902cf4500b001a1b7fceebamr3058684plg.19.1680630924692; Tue, 04 Apr 2023 10:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680630924; cv=pass; d=google.com; s=arc-20160816; b=qf5hyhMPYBkajufYfwu3Q4Rvb4AhEnHuvFgtedg1qFVi4tgdsBeAquBVlqQkJc5CQ/ EZjDY3uFHTA7ElyrCHq/DgsvPbncBySt6jYDEIrWXmmzX0jaIETDlF0sGxZofndGeJ73 9KqshoxbSgKfdkNo+zO1yhoax1zC0W+y3OC5go4Vqkz0ysL6NEy3S0HPX0JnhvNS3TVd TB36BOVx+islZjKl3ptEb2KEEIr35bijLWsYjzzdGJ1ELFuw1e408y5qupH9MMgf0RDE mXHLTZzTyOEmU/axWHOkfxZvyWn/p5tt8E6a7lu4Vo3oy0nQ1ZKQudY+WWO367OcDyiJ 7mWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=vn1Gv+MPsZse8YDIbac/WddAJh1/5fEZ8LboCnVufF8=; b=zDIutKutSBUlyZp0PbbwjmVRLIOabI7ISnqRcs7GotTItxrvxo+i7AcJXTmjoNPP7O /ABFZmZ3pT8mVgbZwbXMXtXXhMtb9IbWesDQ0Re6ca5Tfoau4jjiZz9UdhwQbqE8FgNx EAM4mOw81gQDT70cE2jxty0T1M82XgWU/HM2iJFhO1vyQsXwp0eHBiP8/AaRuZAgQWru KnqUuGUhYsZTkpEMpyQJTLHpDlNdbN2VNKiPjDdCUbeBZlKNlXfAA1pAmjLKg7OC1Tt0 V5czF+I2IzieIsBAV06O1O7zint8boeL+jgHtUKMi7wjSHrleYt4He3i/rjDELd07rK8 X8/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Fn1792NX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 77-20020a630150000000b0050bcf249337si11036423pgb.502.2023.04.04.10.55.12; Tue, 04 Apr 2023 10:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Fn1792NX; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236300AbjDDRcy (ORCPT + 99 others); Tue, 4 Apr 2023 13:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236279AbjDDRck (ORCPT ); Tue, 4 Apr 2023 13:32:40 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20615.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::615]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37D565B86; Tue, 4 Apr 2023 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gx0kT7lB5Ag9CydDFXgztsuL7f7A7FyfjGEif3bL+bVCcSpul/8V+/sqyKE0f79YmFCyuoLfCAJfkyzPunifMLTGrIpdCSGrEJOHuavlNN3ZULvE5NyU1gb15ds09MKRGyi6deAtXvmA5MAzHSIOyTk85FpBNWOcJASr1hfbw6OFBcf9JbyaeoSB8X4xQpUtxfL+BoAPBloem7h5F75yJ1nYup6Dq7s0OaihOhhtpBQ47P0fL0Bc9q+uG0kfAT8zpUSaXBx9Dno+UvwkCHFXVhlpI5bDxnO3WFDc4WOZ5X55MP9EbR6sQxjgtW2uq9Plw4BMF1Rhzxiffi6HAJXVpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vn1Gv+MPsZse8YDIbac/WddAJh1/5fEZ8LboCnVufF8=; b=AGZqADq+jilexd3tIu3sZxjSiHyyXjFjJqNrM9hwBdFD8qssUVXHxd3A5SkXWXMbact/UqcpuTxhegaQ5gvhddbptGHzFTCqKsN0Zl1d7FNCTTYh2+48OKlhuQhOV9X7DfSa7RNjLxJoOKsBnifm5fZVczZr8exLlNZiK1sAahy2LVtb9igR00TnH7hlsxdtBNJtVPIcgRel8/16aIrkf3aMzP4B/Zfzd++V0S9F7FNoqEl1VIjguo1fpBpZQvaPbtSzf7j8PF7d/dUqowd15l93B038fXOSPgsrifWYkGv924m1oPaGztEcSTzZGydXdxZm1cGKhV0OVkQhDE6CVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vn1Gv+MPsZse8YDIbac/WddAJh1/5fEZ8LboCnVufF8=; b=Fn1792NXj6WFAgW9MpPI98T0s0rjjtN00MpxDA+apDcsHQCtu/SZDCIOxxKj3ICrKSVUkBavg4LDf+lmn7QNawtkhydFEE1/9CB1c5XZx8uvDs+mmHGVmhAKdd5awwkGJn6ufbNPOVIF31yTNhmlYGMRK2IlYTLypAedLEXU15O9m2xesSYburITFEAiFKtckSqnhLqkMrU6rx9PgQ56/sVl5QVa4JDAXxiDKQolEuUvYIbi/hZwciapKXRMUaRZp1OmiLxZLXWllmZYSN3/XeQobm4lf6PIHucYWLnsctfjG1kkKBCa38+9eHiqUn+jAOAm/z7XCfVFnMCfv5+Ktw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) by SN7PR12MB6789.namprd12.prod.outlook.com (2603:10b6:806:26b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Tue, 4 Apr 2023 17:31:00 +0000 Received: from IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::265:64aa:fb3e:288]) by IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::265:64aa:fb3e:288%4]) with mapi id 15.20.6254.033; Tue, 4 Apr 2023 17:30:59 +0000 Message-ID: <6acd75ce-2902-01cf-5b53-f852ed70de15@nvidia.com> Date: Tue, 4 Apr 2023 10:30:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH V4 04/10] dt-bindings: timestamp: Add nvidia,gpio-controller Content-Language: en-US To: Thierry Reding Cc: Krzysztof Kozlowski , Rob Herring , jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, timestamp@lists.linux.dev, krzysztof.kozlowski+dt@linaro.org, brgl@bgdev.pl, corbet@lwn.net, gregkh@linuxfoundation.org References: <20230323012929.10815-1-dipenp@nvidia.com> <20230323012929.10815-5-dipenp@nvidia.com> <20230324171329.GA2062332-robh@kernel.org> <7f2dc5cf-78b5-81c6-0012-26b1adce1c86@nvidia.com> <19b71fef-614a-d678-2e73-95db8f226e61@linaro.org> From: Dipen Patel X-Nvconfidentiality: public In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0101.namprd05.prod.outlook.com (2603:10b6:a03:e0::42) To IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6604:EE_|SN7PR12MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: 057df557-2640-476f-f3d4-08db35325b24 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tNbTQTY4kIBy9MmMl3wufAx4EIMXO67d7kYkjiLurSIyKFGkZr72rzEnTo4xssWb/d+wJBw+kmKdsbNN1du95/9l7PhkZoBpMhrXdqLwXuSQCNnPFyVDaR39g4/TM3h9hLAnmixsl/uBmkZMRxx3EH27WQ2nTODQSi3oneTmObBpXAMdsMd9xGaR5jHfOTmnA03BWIxJ6sfXAg72P3Tr07dONT0NAnVrYdAlSHMaf7PzqaSNnqAUyGzVGZFqpD8zeWta5ni7SNV3uVkv+zkpBR6ap+tPwjzBd+ZuWXcXJu66nVGSbMOXAyO2t3CV1E2VC4ChNzFLX3eV3asLM/Ra6oXGcb2brFMAYt3fNNqbnvSPM/2uxSbWHLe0LCGYEkruiQGGg55sSJQ+//2yfbctChRc38qNGDBj5SFkGZEB4admssdtAjwR2HfAdYifgVjD53EDwgq2gp1wRDZP4mqcOlO/B6UjQib873Y9tyIjiCjVdXkylM5DDJS3aF7f+BtjHquR/seliIVIm6EAdWD5TchMnyQkzrfurXZD0tjuejO4Iq7xKq3xP68Szy02yAGA9RAenx2Akk55PAZyClXQ7g9VM7mlOHM6zDZ1mwgsyTdQ54fxkCuvyNaEdg2gmQBKrO7a5N64gWEZuYYa5pOvRw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR12MB6604.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(376002)(39860400002)(136003)(396003)(451199021)(6916009)(66476007)(478600001)(316002)(8676002)(4326008)(66556008)(66946007)(8936002)(54906003)(7416002)(38100700002)(41300700001)(5660300002)(53546011)(6486002)(186003)(2616005)(6666004)(6506007)(6512007)(26005)(31696002)(86362001)(2906002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eVJMU29BaFR6YitQUHo4eGxBV1ROSVg4b253SkwwaXFSVVFQOEVaeXQyR1I0?= =?utf-8?B?NndOdGhCcU56aENQZ1FHT3dmQnhvY2Zjb3VrSE9zOVVKZ3lncE9UOUtlR2k2?= =?utf-8?B?WjV2cTRwY1NCL3l0bVRZbUNtUWV4T2NJY1JjM2FrOURzZFhGZGM2NjhZS3Np?= =?utf-8?B?ejFJOFdOazBaaDMwa0p6UVAxNU9SVFNtbzJaa05idHE2MUsvZDVicTZW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JHRitlUXhSYnJ6bFVXdDc5NWhNTVNk?= =?utf-8?B?NGZPWHNFYlJDV29IbHBoaHVya1FESkpRbUN1K1I0T3Y5M0ZKenpOQnR2TU9P?= =?utf-8?Q?dZOMRsTUtxVycJlTuu1zreEz8?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 057df557-2640-476f-f3d4-08db35325b24 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6604.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2023 17:30:59.8925 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aV6POlZNDXjT9m1W6EGlBeOGaH1SNm1D5We1M9ecdxCq+xtAkhkvXWpUL3ADD7NXa4zANBi5zRQEAGlXkfnLKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6789 X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, SPF_HELO_PASS,SPF_NONE autolearn=unavailable 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 On 4/4/23 3:28 AM, Thierry Reding wrote: > On Mon, Apr 03, 2023 at 09:24:17PM -0700, Dipen Patel wrote: >> On 3/25/23 4:09 AM, Krzysztof Kozlowski wrote: >>> On 24/03/2023 19:51, Dipen Patel wrote: >>>> On 3/24/23 10:13 AM, Rob Herring wrote: >>>>> On Wed, Mar 22, 2023 at 06:29:23PM -0700, Dipen Patel wrote: >>>>>> Introducing nvidia,gpio-controller property from Tegra234 SoCs onwards. >>>>>> This is done to help below case. >>>>>> >>>>>> Without this property code would look like: >>>>>> if (of_device_is_compatible(dev->of_node, "nvidia,tegra194-gte-aon")) >>>>>> hte_dev->c = gpiochip_find("tegra194-gpio-aon", >>>>>> tegra_get_gpiochip_from_name); >>>>>> else if (of_device_is_compatible(dev->of_node, "nvidia,tegra234-gte-aon")) >>>>>> hte_dev->c = gpiochip_find("tegra234-gpio-aon", >>>>>> tegra_get_gpiochip_from_name); >>>>>> else >>>>>> return -ENODEV; >>>>> >>>>> Or you just put the name in match data. >>>> >>>> Not sure I have understood this comment, but "name" the first argument is >>>> already there to supply to callback to match data. Also, this if else is >>>> needed to know which "name" to provide. >>> >>> The point is that of_device_is_compatible() do not really scale and make >>> code more difficult to read. Your variant-customization should in >>> general entirely come from match/driver data. >> >> Perhaps I should not have mentioned driver related details here about how >> this property will help, that detail will go in driver patch. In the next >> patch series I will remove this commit and just focus on what this property >> is. > > I think the point that Rob and Krzysztof are trying to make that rather > than adding a new property for this, we can add a const char *gpio field > to struct tegra_hte_data and then set that to the compatible string of > the GPIO controller that we need this for. This means it will have to track the label of the gpio controller and for each new provider, we have to touch the driver to set the char *field. Also, I think having gpio controller property in the DT presents/describes the tegra HTE provider perfectly as it does have hard dependency on the tegra gpio controller. > > To be honest, I slightly prefer the explicit phandle reference, but it > also complicates things a bit and looking up by compatible string isn't > all that bad. > > Thierry