From patchwork Tue Mar 7 13:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 65482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2429831wrd; Tue, 7 Mar 2023 05:31:32 -0800 (PST) X-Google-Smtp-Source: AK7set9EHbxFY7wWIwJKKux623NrIvg520atDy4z0bPRIYvXL9rmpeE4I0iiA4/eBs1/GhUm+sBR X-Received: by 2002:a05:6a00:8d:b0:5a8:a82a:bd8b with SMTP id c13-20020a056a00008d00b005a8a82abd8bmr13065019pfj.20.1678195892463; Tue, 07 Mar 2023 05:31:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678195892; cv=pass; d=google.com; s=arc-20160816; b=DJrjv+XFfyCrbJt740zvRUmdzg0bk+i+KcFk7grOgRuHNlC+x/IxbZSxhWE9gzGp1G niYVO8AYiBgvr7OBWBjR64n9TY2avnU2/R80dHS0EXTPGrZRjSjIhlllOUfoNf0TdxIt CE+Crtipeldg6hgA21gKHHeSjWvf7CV1zFKJyj49daubxAAKbLBOPYw5oYS23rvVRL3s 1+Q7ieMzhcH0zT6Ei9XlQIoxf3qSWRU3htWa0Yt32X2rvB1yaeaqnzdWAS6+C/2vlM6z 93MF2bF8qASAi9GRPHxQz+IknQnC2Bx4eM17DCJpM565E/kz4wx+1ShTq+yzfCKTyyiI 66sA== 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=wjyG72zJ+UWaKGbJ7NW/B0gGnMMjzMpPk3Y5H/ZSQD5+tRLRlIJN+bLrd3lg6Ec3WO eaz726t+/UPvqpk+7GwjgD+38tDqFOiG29eccChJGstD7d3DJIVMpb5CD4qbD/MDxhXp 9YMKHwn3fSn0rVY8sZDEnOzWJ56isxFcIkT+eRxWo6zsrGkzRlR47yhC7TyAs9gZiW8t WgwROhmmOn08GgP4aXq7WSmr2qa+OfiqYKxl4OblJdg5zd8jxJm0hW8vKabtRT7GXxcP r2Rpzhc+1FNJI0chkIaRDInfGTlGmy4rqVYSsyBul8BjiaprCRmlNa5pdJ3COXd6ner/ baPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=sX5nDirs; 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 q19-20020aa79613000000b005a8b856ad4csi11113067pfg.205.2023.03.07.05.31.20; Tue, 07 Mar 2023 05:31:32 -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=sX5nDirs; 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 S229835AbjCGN2N (ORCPT + 99 others); Tue, 7 Mar 2023 08:28:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjCGN2L (ORCPT ); Tue, 7 Mar 2023 08:28:11 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A305D3AB9 for ; Tue, 7 Mar 2023 05:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cTRS2nkGjkCB5HoQr/wkH5SYvEjSjo9aqklizwFjCYXTjbvK/5xc6q9NHGjtd9H9a0MRpeVLqkl+m43ZLBzZW8G92eLS17TCDCek3F2e152Kr1GbZ5Ir7Tznxm6sNEfDijGaSsSZ9rMWiys88w1Z3lsnez5hl6hMQ5zinivz6r4wIRTUdEtQENU6VY7AlI5F/uavo27QMYIvjDhTrUi0oTKLOCLFwFXJJf3lzGkfqgRjIsjDZV5Uf/jy5SWDBoRtKZKNnVMJFgas3Ey13l62l75drxy8I9oOXTR8K0SKClbHyTAtqCqxPGexjMBDqaFUyzKYBeneTZVAe9xrApg4TA== 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=Wc7TN4irYbJSV9AoEuVw/pF4zbd5RsT88b5WA8w47O5FyLyW/lvxNpXaQuVcWrpP7pFOoNF7QbGgAXFb8VdU08BGVFenjb2I4a4su+YreVYDXmbUsbQ5zV2qIpIuvWEv6uckSJEbXJ9pXvzXBO/RmAycu5/uR+BglVZl8wUJQlGAuYemeXFhJEzCDPk1a1ZxWCzkymqtrKHiWfK+CUPIQ/PVsu0E9UgIZhUHFwJS5yyYpbmUjWzSJGGQBFSn0QzqlZPeLJ7CSd3xoRgRCgCF9124IGxx8+HeqKGtC4rIRNZalfSltXItj7OvsLqg8odfiL6bXenHzd4ekxPvshNgSg== 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=sX5nDirsIRi0WdnVaSYe1VEXjiqZAl+XQ7IB3aL54C4nrg+5R55NIgOS89BJVnqxp1kBno9W07TKDL5zisW/qbgeYJ3uQBdu2EVxoR5Q1pQ3aQAXny99TG0sbshygKsi+tBzrOJEwA7vX26oyuUfbrV9l+eFO7tss/6FobkyjsA= Received: from DS7PR03CA0300.namprd03.prod.outlook.com (2603:10b6:5:3ad::35) by SN7PR12MB7324.namprd12.prod.outlook.com (2603:10b6:806:29b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 13:27:40 +0000 Received: from DM6NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::6f) by DS7PR03CA0300.outlook.office365.com (2603:10b6:5:3ad::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 13:27:40 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT067.mail.protection.outlook.com (10.13.172.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 13:27:39 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 07:27:37 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 05:27:37 -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; Tue, 7 Mar 2023 07:27:33 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , Vijendar Mukunda , Bard Liao , Sanyog Kale , open list Subject: [PATCH V6 1/8] soundwire: export sdw_compute_slave_ports() function Date: Tue, 7 Mar 2023 19:01:28 +0530 Message-ID: <20230307133135.545952-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307133135.545952-1-Vijendar.Mukunda@amd.com> References: <20230307133135.545952-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT067:EE_|SN7PR12MB7324:EE_ X-MS-Office365-Filtering-Correlation-Id: 71ec8ecc-41bc-4c18-9ae0-08db1f0fb980 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C1voAZjMsAWJmZDJMM9U9Id9q5llOIE8xxVJyso3478G+Q/S0IAP36VqzfZxVTTosf3htFYFbBoWUHshgt0UoW1MjKqurl42LVCmW8tlPfHypyLn4hz/VqDN5HM7MXSz9WiQKNtrYJngbSw+Jlqfa/jj8FXp35VPmik/Iuz3Vo3Q9XxAvsW95RnIEnue2DtvhCTWAZAk3tFpdGJ3BvK+HHH5X3Z3uMSEUxG3/R5CoZU2PzZ9J3Mdrm+rn2knf1/md72CUziuGRz9xLs3DqpcZQg+k0nfdQGqaT5ug+7ILguVuTMn3MEBdg6nl910k57yV5PHDgQzwvaVHiu6EgpdnrAhKY9kVMq5u25lWliaBOevuj3PqsfXaVgjsGnsshXZJC70LIM2MLQVcu4v5wbEzd0kMB5xFcdYZoBskm6UnpUtWJ+s/dRpwNoWyK7yXCa3JhBYc/RvKsfTcajByrr32B+LB6F4VCCsTZcAfilgiuVOIVBehj8JkReAJr29/QKu7j0X4d1ubeJuqhBZsX8rljhpLWCKsfc2U4nYItPGKw1iIYFlnzByD6jabRnBTd+Pm8Sbf7UB7E1w/QGYCpCQdOZZjq4ffKExlGNNyHqG+uV+EyoFoZGa3zYm6GRXeY+7VUQaSRc/PP7/a8jPd5tLBjV/ZiknJsOG22JIXSXztdEfCIf36PhUIX3cvLZkKYR8IMyxG6CYQVtkRj/DOgefzugPdb6IwbbmkRQ7aenFxs0= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199018)(40470700004)(36840700001)(46966006)(478600001)(5660300002)(47076005)(336012)(86362001)(426003)(966005)(186003)(36756003)(40460700003)(1076003)(2906002)(2616005)(7696005)(26005)(40480700001)(82310400005)(70586007)(70206006)(81166007)(4326008)(8676002)(6916009)(82740400003)(6666004)(83380400001)(8936002)(36860700001)(316002)(41300700001)(54906003)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 13:27:39.9459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71ec8ecc-41bc-4c18-9ae0-08db1f0fb980 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7324 X-Spam-Status: No, score=-2.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, URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759715936120352105?= X-GMAIL-MSGID: =?utf-8?q?1759715936120352105?= 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,