Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3856203rwl; Tue, 27 Dec 2022 16:50:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvo/0Amo1LzvwS94qkLWoTn/fmZSKvxg9rR2jcly4IWIQS5xBXRpE1XVfC0halTLsRV7Xx1 X-Received: by 2002:a17:907:c71b:b0:7c1:67ca:56f5 with SMTP id ty27-20020a170907c71b00b007c167ca56f5mr25293984ejc.15.1672188626839; Tue, 27 Dec 2022 16:50:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672188626; cv=pass; d=google.com; s=arc-20160816; b=qvj5cABWnpc9Fq/fjHagT3mC/HeXbctg2v2bKxtvhsjJw2lox2i3kFSKvecTXkjjPs q5VKldomgqFSjXfqGRnX0AQz82ujPsbBHFna9htKPowWigwsaw5gP8a7Kw/qpRAZz0VH SCdD1BoqYoJg4dukkmRF0cVvmirHTB5rXkq3S+AKgWB7JRACzuZasjeCG7zbpHVbAkyp wcB7KZcYIB+7XEU3MBN+uauRk1N+vHPJXyAtP59LJBtrPy0NeWL6XKyLXji2lx/UT0Ba BoG7RKFg6aU73zgj5tjwZ1AbRtgdbTn4D2ylzaL1An9yNh8X/VJy4YZCs57tJEX4Klr+ xEzQ== 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:content-language:references:cc:to:from:subject :user-agent:date:message-id:dkim-signature; bh=7rT+rgQ5vfWVaCy6f6i9n6m9hI2ftZ+9nQiIfH2idIw=; b=NbFo65jotjB5iXmEzgT8HkXYe89nXnfAlNVA129rwNekiLDo0mg6bROI6Ei/7ddPpY HBIeDcFbFH8tgr44DaVdtVzonD9rwJsKg8KXaFMNvEs486MgFfsok6Uf5/E0GB1Msup5 XB5nNI7xbJ0YlS8ZSJCCQN4ml2SIIANQ6TrOLxZarPVIxtgNRXB1dzCzrN8wM0ud6IrR 0f1JG9TTQoV9phf7zYBr3KAc0ls7yHAwVepp5MHZA9Ld1bR8Ts9b4hHGC/f8pu0H5NM5 VZMZGG+wH1KdC0tuuCVHfkV+fTzpscty4WQdglXOh5NxgPog0MLisaJi5+Z/ApeYR2Bb cbQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=E8GmlFBz; 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 ji20-20020a170907981400b007adfe2889efsi12405618ejc.607.2022.12.27.16.50.10; Tue, 27 Dec 2022 16:50:26 -0800 (PST) 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=E8GmlFBz; 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 S230049AbiL1An6 (ORCPT + 67 others); Tue, 27 Dec 2022 19:43:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbiL1An4 (ORCPT ); Tue, 27 Dec 2022 19:43:56 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58030DF6B; Tue, 27 Dec 2022 16:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJZXJ49/1df7d6X/MQZ9AHKE/9p0Sp3lX8V+ka0sZhwtpDzMkQJjFPiLEhwhpdwHwHCUNXdK0TqgLNVGSm0jaXFAMJ4oLNmcUlVW8XAn/FGUZmkbtpQGXzPEfoYXQmKL74vzPxRA1Yprsgcc5JJ2JTK1/ZlP4YPH9VOJAdjyYnVKAvGhUhbtrZCPeb1IzIj3+pTkmJApzCyl8TwhCbjvrFKtzRZDxEcB7g/hopMifPrhRhGxWNOe7BORKOgPpOGRfQad7tFuktedTBkS5lQpRDN/lgwO1OQa9Zy3NrYUSxt5enGaQzuGkD8u5FNXqNwmkUO+4JFpZ+KyFN4IBOCYfw== 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=7rT+rgQ5vfWVaCy6f6i9n6m9hI2ftZ+9nQiIfH2idIw=; b=CKRySxLZX6jZn3YwKvKzAWxITMeQrCoLxwT6uIcoFGqYHRKvmcMoLQrRXTLvFsIGXWNtOEv2gc21W7tjzH+auxCxswjEqpPcRRA1eyh2lWPjg/89c3+ujPORK9RqOTBBR5va6dBN/Y/YijPU+QUkVb/XdGTSo6lNNe4MGA3ssbzE6kjC5h6EwfNhgvMaWf5Ay21NOUtBtdn5/DrPJlfSLK9TfX7I6rxLfDQ++66TryAG1bEBVCBjnR2ybx6JK+ZulKFeOfY7++QHHZLFXPTPNjF5NspItUVaBOgffmyIcUjJSrO6d2+x20Np/BkZ0D7wUr8TNKPzk8QdisnGCSxgWA== 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=7rT+rgQ5vfWVaCy6f6i9n6m9hI2ftZ+9nQiIfH2idIw=; b=E8GmlFBzp0ddxo3NURFLjF14m2dVzIX32lefdZOp/MG9YGOcGObErfm2Z3o8csGPZb8PmygDFsS2PxrOgw2ziRp8vWu1Y9KWxKnyF+K+ozqr12tjswwyrnqIgcv0uikhNzF8bmjcx/qQ78eyncoA7+l2vwdfuvNGrWkvJEGapfl7ZIiLT7tHhKWat8V/DSbtKCmyZGHBxbltmZPDjhg/WRJe+LRErrRUAICuVRNLJSrRKdypbUSgi0tx5yyg87+tWFt4gr81cumOvK2r8mmaqopVsegUlLYNjryxz/g1pR3xrAT2s77EhAtt0Tz2yXIRbSR8kBaaPif8CGPg4OCVog== 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 BL0PR12MB4996.namprd12.prod.outlook.com (2603:10b6:208:1c6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Wed, 28 Dec 2022 00:43:52 +0000 Received: from IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::72da:3d0c:a811:be88]) by IA1PR12MB6604.namprd12.prod.outlook.com ([fe80::72da:3d0c:a811:be88%9]) with mapi id 15.20.5944.016; Wed, 28 Dec 2022 00:43:52 +0000 Message-ID: <2cc8378a-3f74-d4b5-613d-f9112806ec92@nvidia.com> Date: Tue, 27 Dec 2022 16:43:48 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 2/7] hte: Add Tegra234 provider From: Dipen Patel To: Thierry Reding Cc: 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, robh+dt@kernel.org, timestamp@lists.linux.dev References: <20221103174523.29592-1-dipenp@nvidia.com> <20221103174523.29592-3-dipenp@nvidia.com> <1a186be2-498a-a63b-a383-c165a9f8e732@nvidia.com> Content-Language: en-US X-Nvconfidentiality: public In-Reply-To: <1a186be2-498a-a63b-a383-c165a9f8e732@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BY5PR17CA0022.namprd17.prod.outlook.com (2603:10b6:a03:1b8::35) To IA1PR12MB6604.namprd12.prod.outlook.com (2603:10b6:208:3a0::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6604:EE_|BL0PR12MB4996:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b2c8a38-5335-4e26-dc50-08dae86c9753 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H99hE9Zx7L+z7F5MjTBK3s4pIqHJCrFTmLlYtm1/CaphU+ruO5gWRfSfsqb3bfqaIJc8jTDNhnP639k2DSlTZkbqdWlAN+WWjVQ6tHPUhiNajSs+YpTnch0wKw1vOfvEps3g4MeTdVBCKCe4d6vJVuj+KLjxRKklCvCAi7H/1jjMXu5H8CtlGn3x5+COAMFdeobxN7FLXJJpi5F3fXTBxjvrGferGa+cFiiwEG3tBswWvaJWht7UAdTKHKWGF9YaZQ8YSgXOkg7g9rOAmGdZfic3sJHnGNjtz2Kml68P6cLAn0XxUSbBK7UU+0fc8ozb0A0mDBtbHHUPPIHAW35uuqyPj+AHM77fd9svvJxeuHqVUfVjQFenOjR7fDoFoSaj6KIgufs/bovVuB4Knhp2fQXXKeGxEr2jo4fwQwTDywSu9i6Jq8vo1WOL7c7AU7Lpw8wKRuC7thSZqv1fCYcDP1HflFacZTMgA4q3FSZ0I0+Cjw/RaEezo2gnPu3finDQrQNrUw4LKQOvEABiM8Mtsigb6+VUzGRGfrhyCK3ttegXQQ/sWQ2vpCwOrhMsdM+ysi2zUmaB/IjuOi8H2TS09XZnAWg+61cs5jiDkO0uY+N9iG1kluuR6AEAARXiMTw9GIvZKiiSE2vLkFbPJXLd9HGVjXH66Zi+ImJ2nrm9iIIKXoydL96DL7RAqHlixmA8ovk63NN5Kk71DSgc/eBOQtnmtC/Ar+6kMPsju95iq4w= 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:(13230022)(4636009)(39860400002)(396003)(376002)(366004)(136003)(346002)(451199015)(38100700002)(83380400001)(31696002)(86362001)(4326008)(8676002)(66946007)(66556008)(41300700001)(316002)(66476007)(6916009)(2906002)(5660300002)(8936002)(186003)(2616005)(6512007)(26005)(478600001)(6486002)(53546011)(6666004)(6506007)(31686004)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y0lOcGpCdW9SM3JaaFZqUENkd2FqdjkyRVVDN0pyUWJaRzFJN2pqR3ZZdEYv?= =?utf-8?B?N0VSNnFtUnBRQmNPYlhPcTNXQ1lVTkpOdkVlNnF2eHIvT0NHenBkakxHdlpD?= =?utf-8?B?Vmt0ejF4L2F3a0NzTFVBWmYrY1pTVFNEaTlSYlhSQ1FodytJNlZtTjZjMURy?= =?utf-8?B?aVNUbG9RUmRkL3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=?utf-8?B?djhESmNkcWFjVmJYdVBnRXh5c2t3NXg1WS9zNFBrUTk1dmIzL1BsaGc0NGJn?= =?utf-8?B?WS9KRUlUbEE5WHRzNHhNWTF4ZExmblVVNjBDc2lTa1Q5TmNRWGdtNDJVTG1K?= =?utf-8?Q?9IS+nkttzjIr2vZ9+bD9rJKq0?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b2c8a38-5335-4e26-dc50-08dae86c9753 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6604.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2022 00:43:52.1501 (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: JW0oIIS8I5icDfqPXJVZPhfCiqxcr0owp4sym/S+VG7ggkZ4p9QMOpYTX3WGbO45VkehZiQfPBwcgXy37oR4JQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4996 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE autolearn=ham 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 11/29/22 7:00 PM, Dipen Patel wrote: > On 11/11/22 8:01 AM, Thierry Reding wrote: >> On Thu, Nov 03, 2022 at 10:45:18AM -0700, Dipen Patel wrote: >>> The Tegra234 AON GPIO instance and LIC IRQ support HTE. For the GPIO >>> HTE support, it requires to add mapping between GPIO and HTE framework. >>> >>> Signed-off-by: Dipen Patel >>> --- >>> drivers/hte/hte-tegra194-test.c | 2 +- >>> drivers/hte/hte-tegra194.c | 124 ++++++++++++++++++++++++++++++-- >>> 2 files changed, 121 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c >>> index 5d776a185bd6..d79c28a80517 100644 >>> --- a/drivers/hte/hte-tegra194-test.c >>> +++ b/drivers/hte/hte-tegra194-test.c >>> @@ -16,7 +16,7 @@ >>> #include >>> >>> MODULE_DEVICE_TABLE(of, tegra_hte_of_match); >>> @@ -635,8 +742,17 @@ static int tegra_hte_probe(struct platform_device *pdev) >>> >>> gc->match_from_linedata = tegra_hte_match_from_linedata; >>> >>> - hte_dev->c = gpiochip_find("tegra194-gpio-aon", >>> - tegra_get_gpiochip_from_name); >>> + 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; >> >> I'm wondering: instead of doing this cumbersome lookup, perhaps it would >> be easier to create a direct link to the right GPIO controller with a >> phandle? > Possible, need to see if gpiod framework has API exposed to get the gpiochip from > the phandle. Thierry, I can not find any API which can help retrieve gpio_chip from the GPIO controller phandle. I need gpio_chip->base to map GPIO line to GTE mapping. >> >> Thierry >