From patchwork Sat Oct 8 18:51:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 13001849 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30FCDC4332F for ; Sat, 8 Oct 2022 18:52:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbiJHSw0 (ORCPT ); Sat, 8 Oct 2022 14:52:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiJHSwP (ORCPT ); Sat, 8 Oct 2022 14:52:15 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2102.outbound.protection.outlook.com [40.107.94.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 326053F330; Sat, 8 Oct 2022 11:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UK8YSbhbUK1McfBEBYPqigpeW2PF7o5ED7+LOqb6r8VVLvjKWbCC/UQXrM6kfKrXQ5RmfQnFiOQoHXQepS1It7U761xlBKP/n4JTafTapggmOAPvL2l/ezueY2bh+k6A8r74LfcKb8aTF0SgI6MnYX+XpoYdCaHJgsf9ycvwa8jN9JD0MTJYGScJTf2SfLJFdiPkkeTBrWt3zkbibtVxIsREbuFmFZvitmJlFHPwLQkgiXhtv/b0CvVauXImOead5rEIDKaPoLq2N8uwZMwtqQRQhhhfBchlshQKwOiTo6sUkgya1ibr4S9rxF4clCXWs8STcVXKYwyXJhnthv0jvg== 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=sx6uo+k8oxp1Me10hVVjNIFbJRnKU3QiS1p0xRQWsDw=; b=NNFYT47o8EvSHWPzWnQN2PH8t1IKgstLCOpXQR/EkV18f4jvFs7eSszeMyG/8W3kpoWvZTueIE8wL0vYQ+sZJyVItmeA6GKocMk0KgoXzBFF+h30aVbZlRDZQ7FnR+hZgQ9pt+KTkGpj9ghjJ0t7Dg0j6WqrvEKT2ZxuuFy1RX2E2Fg0x5XfPVt3TuAxcf3lJfqeNwoI37tsoPgLoziYGd+CW1M2efIWCJc5omSGVlO1OXj24jA3FP4xaXP6KWC8JRx2QJT6v4X8/7AHQ3zko2FYspxqu0EiPGcuFuvX7E20z51uJY1Y9QiHiWJAiNrOYypQTo2n6D4X3dQ+DAupew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sx6uo+k8oxp1Me10hVVjNIFbJRnKU3QiS1p0xRQWsDw=; b=ehpfOfuTSYQc6aygODKLCeQ19Zinz7Y0BeLnJRtGM2lBeqD+7u+4H9TBYzHoqzPYnkHBw1/PkSfdiPQgSU+YArYZO2q/fYTkVVplsoTAxyTH9voy8xvovCaODJVfFHCTzEGzjxfUj/UBwwAfkWMIl8XLvrYu+u8/dSJwj6Tlod0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by PH7PR10MB6129.namprd10.prod.outlook.com (2603:10b6:510:1f7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Sat, 8 Oct 2022 18:52:09 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f%7]) with mapi id 15.20.5676.028; Sat, 8 Oct 2022 18:52:09 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Russell King , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones Subject: [RFC v4 net-next 09/17] net: dsa: felix: add support for MFD configurations Date: Sat, 8 Oct 2022 11:51:44 -0700 Message-Id: <20221008185152.2411007-10-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221008185152.2411007-1-colin.foster@in-advantage.com> References: <20221008185152.2411007-1-colin.foster@in-advantage.com> X-ClientProxiedBy: MW4PR03CA0304.namprd03.prod.outlook.com (2603:10b6:303:dd::9) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|PH7PR10MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: 62010382-8f5c-47c8-a519-08daa95e3382 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9K7PSjnfptsj0i3HAvY0okp+kopvpV0ILIth7JouzLBPM1YT3WaQEKVjcVNJNN1blNywc/KB3rBEvEH+dqFDpX4KkFb8JazIisvSopKCpgKESxlIKTzZ21T7ATfjbbi90l6RolkDjM9CeAPFeJgMN3nad+vlGrz+T6v0UxOicCV4Ri/5bbwILej28iadZi9HJ8BpNbhLbUEibQ0EXD2+45jHLkUHG+PHnOn6h4bm9XPDAiZW5CIWwhWNYB4GE1L1m+9AiGPDsMe6ajRSv2cnyie6KPcJIsNjDEs4QTWmeV/EfC/Hzq4rRhACnEHWLJIt+cfUp5LVzPdQz5lLe3Dlzyiw2YyZJAHDsfcPmYmSiqo7scuK6BLgS8qaATQf+PdUeJ4AEQ+1M8cwycDrYuo1fi+w6kRPX+r6Un/IWyaNg5v9CHlWQkiK2GAV6+q335XhFbpgZ3ZEJqLlgswTn2Of6fut8+ylcmwKHF9puoHGhEk5B3n/gG7+TJLRlHZ9L2uY4jXivrR6hIQEdgKwaYcHfg9EKHhxtOOfJDE8tV6cEiRUHb6KAQUEguz/CSLIsWuBV0VSd8KmHrfdZzzX+LcttfeIZbvF8XDKk83FmgotcBe6IYGY0D/SFEwk9Nh6DZyBP5v07Gaun6H1kjPbVQU+atKxXVouUZWrqnL8iAgZvi3u6ivizwPRIZwPtjNm9tZuShcPUswgN/nnG1HdtsloSUGgaYsLWw+yvIfVvrVXSHiQ1NOXWw3dVk5YoBTXsHV7ycidZI5xA3gUVhvgFEBdOg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(39830400003)(376002)(366004)(136003)(396003)(451199015)(44832011)(186003)(6512007)(6666004)(26005)(6486002)(6506007)(2616005)(316002)(54906003)(38100700002)(38350700002)(52116002)(4326008)(86362001)(83380400001)(1076003)(478600001)(36756003)(7416002)(2906002)(41300700001)(8676002)(66476007)(8936002)(5660300002)(66946007)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam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+HVC5UVb5bBnmFgb3UVW+OWfCja3f1gjdf39w9yxdQn0EEY7RqQSDtjjDJflpHuA3cX0mliL+fwchrMsH0pBGcd5FE47TV2akVppv0JHuH5B7zlRA5oPWfxtsFqQdtdT2Xjwl97eO76bZhJeJ6wjkuIqFEmAJQvaBM5Ds15DKxJl4PhGe8NlLsKmF2JubXYm5vca3T6zlG0/oLJzwQqkpYGVbDRlyZkcCP1nagZ3LsD4IzujTKJ/yPPYW4eGDj8CEINjyD17jMFJy3J1NWnSBR/dmuNmahzN7cBXlOTCfwzDTqC1CoHig6cnBSahWkxw6BF3gCONCJ+uxTCaB6sXlOElbANc5N23k4R5yFkbaxzDn14ygVZ8t73YmILvtOiOnLo/GT+KL7qvgsVddJm2xbue8y92UPzTzPm2rdbgwYOJ9vGIJiinJhOOwyHPW6jEvDlTJiMWKljwNPhG1xPTN0T464nmhi0/PH+sibv2X8UqNZQmytaYfoTDo0dmxuNSJ5AWiaLK2BkKN8RcwdLVix0C4qJt5IsX3c9RJyPv6Y7CTyYggBAM3F+9OnzxKyl9EOFmrc6AD2Uy9kbpZSYo= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62010382-8f5c-47c8-a519-08daa95e3382 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2022 18:52:08.4285 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u3tgrZabUOJbyeKdtCE1He3MB7miL1ZnSGFOYU+2mPbWvQkfffCBFkt9SFH5nyS1pEPbMYbxctZQ4cgQzYEcnsHgFLsAUwvdwtcsRQbT4iQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC The architecture around the VSC7512 differs from existing felix drivers. In order to add support for all the chip's features (pinctrl, MDIO, gpio) the device had to be laid out as a multi-function device (MFD). One difference between an MFD and a standard platform device is that the regmaps are allocated to the parent device before the child devices are probed. As such, there is no need for felix to initialize new regmaps in these configurations, they can simply be requested from the parent device. Add support for MFD configurations by performing this request from the parent device. Signed-off-by: Colin Foster --- v4 * New patch --- drivers/net/dsa/ocelot/felix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 1d938675bd3a..fb0a0f7e42ac 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1325,6 +1325,13 @@ static struct regmap *felix_request_regmap_by_name(struct felix *felix, struct resource res; int i; + /* In an MFD configuration, regmaps are registered directly to the + * parent device before the child devices are probed, so there is no + * need to initialize a new one. + */ + if (!felix->info->resources) + return dev_get_regmap(ocelot->dev->parent, resource_name); + for (i = 0; i < felix->info->num_resources; i++) { if (strcmp(resource_name, felix->info->resources[i].name)) continue;