From patchwork Mon Feb 13 09:40:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 56134 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2253477wrn; Mon, 13 Feb 2023 01:38:43 -0800 (PST) X-Google-Smtp-Source: AK7set+HrMm0YCWGVDPFsW1da5h4lHdS0MwVlSowcbAbXBgKD8BWdQJZQXUzRvlQX+Jn8Qx3zWCj X-Received: by 2002:a17:906:9142:b0:881:23a:aba5 with SMTP id y2-20020a170906914200b00881023aaba5mr24465729ejw.11.1676281123457; Mon, 13 Feb 2023 01:38:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676281123; cv=pass; d=google.com; s=arc-20160816; b=RGUNGJkBzVWoo0w7mbt3cnfuX06HAi2mylE6vUFsUCTpqbI7I/L84Y4PntCqv/ebma dQHbg1s5PB+mObhiSrKb72dIyNkFt7ciRnz0TKERFHp5+Sg8XnUs9FvKdtLN367VWtSm eiNKdof16BLWkrbeoV6jPop8JSdo/YmQgaaw6IqUdct8dSEivvNdD0GaJDU6Qs/HM6Ng xfxngTe+i0MaJ+Y9/yBNS91PEV6q6Vt5cWc9AexoOVzWcFflv3qgxckWkPlUYBESQbfq Dh3FArnamhGfKmiXT5BjQstMSZU9bYyH4KAKNiJ9m/M20LBLjH1VEmFzzdWwjampbEhg X6Fg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WUrMAhuQVof+ju/n9q/rmSwMNJzF/yYd0v9PWitn7Oc=; b=TDI1M3x4ya5tPEc9WQ1WVgsbywQ79lhbDOamuSpWa00tuhyRVmalhepx7tqDYlkPpK Z9o2qyOym/EJY6Yd6V7VvNYbu+xlEVXcm/xNEO8X37xfQqw3WbKfEZhgl51jZ4P+yfBz hBP2wyHOuS59scldReAZTAfFssYNFk7Y7vEjv1zNhQqa4Kt3pfTgu1t8KW3E+J6W//ik ai2q+/p9Si+Jf6NdwufvoGKZRRd31gJQBKTeDri09R8WUtUlVoFbq/l7KjT/Td+HAFPF ixobIg3jNI6SDo5T8Km7kFulQBpL5fNy0P8Wtdcupe0A/bfuZyNV3fYj0fKmJYzYUsYu HXSA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="XPP6/984"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id we22-20020a170907235600b0087880aa5e39si13914922ejb.505.2023.02.13.01.38.20; Mon, 13 Feb 2023 01:38:43 -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=@amd.com header.s=selector1 header.b="XPP6/984"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230395AbjBMJhz (ORCPT + 99 others); Mon, 13 Feb 2023 04:37:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbjBMJhi (ORCPT ); Mon, 13 Feb 2023 04:37:38 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2040.outbound.protection.outlook.com [40.107.220.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E735A3A9E for ; Mon, 13 Feb 2023 01:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C4E0LdXmlkbaGtFQppW0jpC9bGedgBDBbt9J6vKrlNaqMG8OfeQRI1fqReSCZy6IxEI/M1/fjJL78Z1BSNsbzgU+/tKyEDcv7oR6nyJsbPOO5OxjEsh4SnvjR8eeVQWxIknH3lOKyitNu0MNiWG+2M9Um9At3dQylmgDPbRs/eHFQFiJ7vQj3ukl7djMVJqrOqSKUET194dNPDfT7Bkol1cyqegMKe79jHHKkkzAC5i7jUUHAPHseSleVYXikEBLT0WIkQ2W34PelJHardeoiO8IezyJuGLNz2Lq25LOer4mJmiAkgX6GXXftoWkHagMX6Aja7HvL5J+kkav0zOyjw== 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=WUrMAhuQVof+ju/n9q/rmSwMNJzF/yYd0v9PWitn7Oc=; b=IzF+NYhl5MlrbH04SX/n6ePOKzqB4EOajP9vHxwZpaFVdoonHSU00GKiKldt8NQk5J6j0mhw7IF7mb7WVs05FiqbtuqotOIdGtXUGOdZnMSsrN1Onb/J49IMqaDIHspVUIiJwFUnuicF+ODoQ+YFhdqUGCkA3TPACN4MVGFEYrh1aqcUZkek4t+B1v+b1GEmU+8lHvu8tnWI8L1drPHe9VHHU2M5wzDbt02uIXr8pZHfe299mhOF+jaTHtnUeC+zJK2NBOMhmqG4jHbCnkhUsAsFeESeXo5t28iBmUaFfb6rtCXLhGt/9C23PVofAIH8bsfxYK9O8Wb4W1nvESXUGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WUrMAhuQVof+ju/n9q/rmSwMNJzF/yYd0v9PWitn7Oc=; b=XPP6/984Ij8aXYnx5b4HkrPY5lDpH0tGW5wbcjGnM9RIB/0hWGnDtbK5Mo+9IdsBg0QCd19WZ5p+hx2kU8rl+J6G5KhH2++qJ16v0qPeq6FbkJB92mCu98upaU2aApNBg3TKwacZ0RlZisJYiONdfNIBqV0LNZLu5sg/S8deEyM= Received: from MW4PR04CA0280.namprd04.prod.outlook.com (2603:10b6:303:89::15) by SJ0PR12MB5610.namprd12.prod.outlook.com (2603:10b6:a03:423::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.23; Mon, 13 Feb 2023 09:37:34 +0000 Received: from CO1NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::3d) by MW4PR04CA0280.outlook.office365.com (2603:10b6:303:89::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24 via Frontend Transport; Mon, 13 Feb 2023 09:37:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT082.mail.protection.outlook.com (10.13.175.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.24 via Frontend Transport; Mon, 13 Feb 2023 09:37:34 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 13 Feb 2023 03:37:32 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 13 Feb 2023 01:37:32 -0800 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 13 Feb 2023 03:37:28 -0600 From: Vijendar Mukunda To: CC: , , , , , , Vijendar Mukunda , Pierre-Louis Bossart , Bard Liao , Sanyog Kale , "moderated list:SOUNDWIRE SUBSYSTEM" , open list Subject: [PATCH V2 1/8] soundwire: export sdw_compute_slave_ports() function Date: Mon, 13 Feb 2023 15:10:24 +0530 Message-ID: <20230213094031.2231058-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230213094031.2231058-1-Vijendar.Mukunda@amd.com> References: <20230213094031.2231058-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT082:EE_|SJ0PR12MB5610:EE_ X-MS-Office365-Filtering-Correlation-Id: e404cca7-b2ac-4e79-3979-08db0da5ef9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D13IR/44ZSHPDzjUKYQO3kORHa8hZJJFQ45ztgSd18jAnBouaiGGm9dkbnKsW6KuSRRBkRReGGjdnngOsQ8het0XuFTgkJ11Eq9Ay17n2oZ4Xot7+Hx3eYwFXHLZX0aU9NWpGZBnS/nZmks3zQN3XZ2F3qTNpRFn2rGKHqjCHY8mJ6nHsRkOvfiPwnZd5CbY94u0T6GS+suRkJqMYnoOvnwVt2IxeYqXF8iED8/ZEW6t/sHu6iyWKeLMMwv336N6MJi/kemzcddNdc6dGVIuXO+PNi+2VPIvafvw0boDh56Tfa9WWY2CL22iz4TqAeESgIPoMg7Gij9LGjWPD0c4DTLUuePqcneQ0ic+/Sepqg3s5hTb475W6bc4She5O38vu4iWoP4lMlj9TBRKYdMqMcBl56XtooX3QrITy8hbW+oegLSbRL81TvfDziB7UMiqCUsucNbFVNuqmIHDS0l6mE4CLtskk4dZbc0pTkjpt+Hxot+Wd0Hc6XbDhhtHf2bHDKntFzPyIAWK90WfSNHH9X3w2sRXqxZDvg+LiS/Tm+kzpkufxJyNBQO3Hhwc2xvDWOpdBmjrUsWaKnezkoHA/nOSovdws9taN1HBV4y3c4k4PXQX2EaVMi/rIQyqSkHKZ/Wi6uDW3YXLPDocPEmnWkadD4SFMlSlIxrHuZyS88Z5B+fHDLQlX6XVc9IkcLSKtR8nqWXfJ/MNr+hcN6naRRyU2OWGrjOMTAO9gM+a3eDY8SuSvQUXuj5dZ4jy0B2QEzYprNK4nWKSntT3eTiVRw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199018)(46966006)(36840700001)(40470700004)(40460700003)(36756003)(426003)(2616005)(336012)(47076005)(83380400001)(82740400003)(356005)(36860700001)(81166007)(40480700001)(82310400005)(41300700001)(5660300002)(2906002)(6666004)(26005)(1076003)(186003)(8936002)(316002)(966005)(8676002)(54906003)(86362001)(7696005)(6916009)(70206006)(70586007)(4326008)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2023 09:37:34.1965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e404cca7-b2ac-4e79-3979-08db0da5ef9a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5610 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757708155385944442?= X-GMAIL-MSGID: =?utf-8?q?1757708155385944442?= Export sdw_compute_slave_ports() function to use it in another soundwire manager module. Move sdw_transport_data structure to bus header file to export sdw_compute_slave_ports() function. Signed-off-by: Vijendar Mukunda Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/lkml/20230201165944.3169125-1-Vijendar.Mukunda@amd.com --- drivers/soundwire/bus.h | 9 +++++++++ drivers/soundwire/generic_bandwidth_allocation.c | 12 +++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/soundwire/bus.h b/drivers/soundwire/bus.h index 96927a143796..0ea0412842c5 100644 --- a/drivers/soundwire/bus.h +++ b/drivers/soundwire/bus.h @@ -144,6 +144,13 @@ struct sdw_master_runtime { struct list_head bus_node; }; +struct sdw_transport_data { + int hstart; + int hstop; + int block_offset; + int sub_block_offset; +}; + struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, enum sdw_data_direction direction, unsigned int port_num); @@ -212,5 +219,7 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val void sdw_clear_slave_status(struct sdw_bus *bus, u32 request); int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size); +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt, + struct sdw_transport_data *t_data); #endif /* __SDW_BUS_H */ diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c index f7c66083a4dd..39543048baa7 100644 --- a/drivers/soundwire/generic_bandwidth_allocation.c +++ b/drivers/soundwire/generic_bandwidth_allocation.c @@ -28,15 +28,8 @@ struct sdw_group { unsigned int *rates; }; -struct sdw_transport_data { - int hstart; - int hstop; - int block_offset; - int sub_block_offset; -}; - -static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt, - struct sdw_transport_data *t_data) +void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt, + struct sdw_transport_data *t_data) { struct sdw_slave_runtime *s_rt = NULL; struct sdw_port_runtime *p_rt; @@ -85,6 +78,7 @@ static void sdw_compute_slave_ports(struct sdw_master_runtime *m_rt, } } } +EXPORT_SYMBOL(sdw_compute_slave_ports); static void sdw_compute_master_ports(struct sdw_master_runtime *m_rt, struct sdw_group_params *params,