From patchwork Fri Mar 10 16:25:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 67544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp973073wrd; Fri, 10 Mar 2023 08:38:14 -0800 (PST) X-Google-Smtp-Source: AK7set+SS6BWf3+LQXuKQ/KPk4rnBNSdntYuJadb4aNLn6YFY2eGAFal3mbXqamspsshDqrPNeqh X-Received: by 2002:a17:903:41c1:b0:19c:d550:8cd4 with SMTP id u1-20020a17090341c100b0019cd5508cd4mr32048605ple.7.1678466294145; Fri, 10 Mar 2023 08:38:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678466294; cv=pass; d=google.com; s=arc-20160816; b=kOUKxuyCHWZd2omYOhRCkHHDdrQatxmWim7Z2EBr2Hgddug6Itf5iXTZ8TdLxYVErK XypcIdimuFD61ZnvCKldtx7erF/9p7IwObMO4FJT+wTSyVI2J16UnW8QYYmOytAB5OIr 43w0Nxnfr4t2R1NEbtisAa3qGsWj1B2Y5sRUbqhJlTXytPkJxV9K2UwczcSDowTekShF fqEdlnYTSPNlH3z4i6BkAW/0ZjsKF1u2hXvBkzTL3NLqBKIy/iayBUUqthil8omiYE7R 6iG0OUAC54v72sbcywKwsk3u467C3aw4BA/PPhy2jJCaCAaW7PV1AI0t2ECdyKDwaozr t50w== 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=Fp9qBCzwKJdG7pC5ocTktMHSHHIFpMUF1onoGkFzAW0fYTY3ap9qnD6vuxmzUif5kP mgleK6r5W6uW1nBvBd3YSKsjJ38BJOnV1+9dt544vHCJh2egmY8YYdh8MOHS0fs8BwEz OC3TnJHSBlh8Hs9DL7ljdw8lrXoICe+pvVhCQcoVDkU7TMnXqZb1l3sDyMttpcgI/TE/ X741Wn6u2hVFavYYU2yNxunWonjPiq4tcyAW6iMs8KrZtgpM8c32QRZs0LA3Bdl6mZ59 JRR4c2Z5lO4y4J5y5WB/LoCDtyTMqplvOFXaQhV0iJzUrHGgNg90gjHJ6VkdaTupiTC/ HQWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Z9Rl3Tj2; 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 ky8-20020a170902f98800b0019f1a62c097si202234plb.15.2023.03.10.08.38.01; Fri, 10 Mar 2023 08:38:14 -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=Z9Rl3Tj2; 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 S230043AbjCJQ03 (ORCPT + 99 others); Fri, 10 Mar 2023 11:26:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjCJQ0I (ORCPT ); Fri, 10 Mar 2023 11:26:08 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ECC82DE48 for ; Fri, 10 Mar 2023 08:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dGxFgrBFckn4MzYT9o+mHRIrMeEyb+0Tmnb5H1F2RaeVhoeX5MiEmNF6iJbApCuqehBsvg3YNMvVbzL7bekor39cY0CWRLkS3/+mmlvZ+S8RfuI8HdhP68P04iAVAj2TqJg7BozxZ8dhsnM9j4mC6t4iJVwTEP9Ba49YJbct6p5g67+pEX5YFVKeZeJ7BalJgnSmw9Iav2bwpVsALj+gnCe90qaGj0S7KhPDwAiISCo09X7xGZ8RpbMAPZTyTJrGOIoWDa9f5zlIhtgiFuXAD9fs2Qbp9Ar3pyYjl1V07JioUv3JJSn8Pi1lToMpv1HzisLnJ6kICpJHSEUzjOMF1Q== 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=ZW2By+JhJNu/cC2VT9tL/39NOTg2bBjcYVhuyoAjoSHdtHjFy6iprywQs8VQlTb/qWnmaA65ubRf5kwJY5qljmHwgQNjSFcwdaFhPPS+UO0j240B+TXMw3kVuzhoH1OaNoCMwk95NE/Vkinv6ynFbpwpVq2e7mWJyhgS6O8M7FO62crjE6NjHiqa1tCC2IQ0flJ5PmOADovNGE10xhxond6zyWlPoCvwYJ1dpr4Ga3PEk3hxXnLtGwHvAYUAuCHB56xBfBC4D13v7iyZ0kFzz5IVGOR2V6ViopQIIMl3KxVq0snyoj4lRc2UCred9+8e+XaqLoDockGrRu5Eh3jJjw== 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=Z9Rl3Tj2xjpuicUeLMAcmWahyRW2Ab8PmLvYxB/N9Vho5wQzuURF01Qt5ygLGxlZFNF7Xewf7ZsTYidkBF76ecLPgdY00dvGJSb6d9jGuXn05PQvshEKQ/YVkOPa8f2fOZWBDmdE5ch6ZbzogWj3Wq2vWRIM11+IvD33/FDabPU= Received: from BN9PR03CA0383.namprd03.prod.outlook.com (2603:10b6:408:f7::28) by CH0PR12MB8577.namprd12.prod.outlook.com (2603:10b6:610:18b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 16:22:09 +0000 Received: from BN8NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f7:cafe::e7) by BN9PR03CA0383.outlook.office365.com (2603:10b6:408:f7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 16:22:08 +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 BN8NAM11FT046.mail.protection.outlook.com (10.13.177.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 16:22:08 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 10 Mar 2023 10:22:04 -0600 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 10 Mar 2023 10:22:01 -0600 From: Vijendar Mukunda To: CC: , , , , , , , , , Vijendar Mukunda , Bard Liao , Sanyog Kale , open list Subject: [PATCH V7 1/8] soundwire: export sdw_compute_slave_ports() function Date: Fri, 10 Mar 2023 21:55:47 +0530 Message-ID: <20230310162554.699766-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230310162554.699766-1-Vijendar.Mukunda@amd.com> References: <20230310162554.699766-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT046:EE_|CH0PR12MB8577:EE_ X-MS-Office365-Filtering-Correlation-Id: d7aa6dee-a2a2-4ea3-787d-08db2183985d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2y4FIZVMImuYE2x0eXwEHLliVTye453u/M4lSt/ZwFY4Ph2VI9CdeM0PcviWOt5CFlus+fkcPBcbhCum+N2D978tf2/bPP5ccvRZp7lE0An3pw0nxfY6PsccdKl9SM5DHW/VkQ8r3Ied9ed0zcXyoLfWcvdsk8yIow/kcEK0fFMRZtBicNpf9eikNTtv2bcw6KFribf2ZYvKc3hue43zqDKk7Ldjb9srRLbDcWkler67D74y6pBvuyolJ7+D2tNkxA7Xp4hrYbPrAyh7F/IlfLQ94rKpYQlOw0NbFRh/5X+OGPXTCqwPr+PsSolqerDK+ITHlTHWyKo3VHd70r2QiOhDnCiD03VX5XrbvQqxfLUFcBI7WnwcOTIYdBLgPmzkH5k2G3GNGVBmQF5T57+T1ysozErsEpSxWRpSdNRXXwM4/ymBrTa7WXOD4LhKAOi9eQYAYQuT1U1ZHyz0X/+JAth8SdnEISav1m3n8AhdSC4y7enK9el9pHcA+4E9BG2tmKs4ruY18BOJHK47UrV37vZCSzlGc1/tE4tfKvxs8e4Mohx8cMWCbgR7HRCY0cNnMIqIo3SnhKgVeeTeS0cP3W7EsLsrHd4byB8KKdrHzb4wAwBVhV9xUVF3rQgaK54Fe3uO4rMwoQiTOL8SikaqkIz7ur4xypt9EYGpGoADZ50AbP0mBHOrJSTfxerOCuBxfRjRc+xBOA8VeSk3/BpYDWiaAPTrcqG9hPq5Vmp2AwA= 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)(396003)(136003)(376002)(346002)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(2906002)(5660300002)(26005)(8936002)(36756003)(41300700001)(70206006)(1076003)(4326008)(6916009)(40460700003)(70586007)(8676002)(316002)(54906003)(86362001)(7696005)(478600001)(356005)(40480700001)(966005)(6666004)(36860700001)(82740400003)(186003)(2616005)(81166007)(82310400005)(336012)(83380400001)(426003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 16:22:08.3283 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7aa6dee-a2a2-4ea3-787d-08db2183985d 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: BN8NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8577 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?1759999472725579241?= X-GMAIL-MSGID: =?utf-8?q?1759999472725579241?= 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,