From patchwork Thu Mar 2 06:21:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 13156749 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6FF9C678D4 for ; Thu, 2 Mar 2023 06:19:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7E08120F; Thu, 2 Mar 2023 07:18:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E08120F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677737985; bh=yp8RLSmw3aI1IVHzEmhfg90finRqfsFgLM2AbnpTh4I=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RgPsvW5+g+t2zap0PsMHYj0sWyLVGeFyKtSsuKCNLb0+dO89pl3SyCCg0XUka2tJ9 +OrMKZTlJDifEQIuOkhlLxzgjcOknuEPJBESgIwsryLLgu6GZD+R2YObCDiL1nICpW Hhdz66zHKym9kdm0wk/BjWqIUHn5kXPp7azhE6II= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7EDB3F80520; Thu, 2 Mar 2023 07:18:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10988F80520; Thu, 2 Mar 2023 07:18:42 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::626]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0DCACF804FE for ; Thu, 2 Mar 2023 07:18:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0DCACF804FE Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=2Nvotz9D ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I8/o3FKnWXx5/gI0oP6XqTVVRgGMpTKgIB8WrGY6zGQMdSw4uFURjYdbs8f3WIu2vUO40UowyTz96E/Sl5iQA2Uud3lrNG25c0iZJVe/q1mwmf+j2jNt5dg+ahEjTZD6CJ5txucqK3GIFM9wY6vrm03gu7EIKUkgErTDXWorI+TIhobnpWnCZgDJTltidM60AP80iJJXJVprsXLMKHSfz5yxo1M3YKT6ZdFdpI5Rxx7f5dDwONzyDAs9m3gGQZX/kRZdppXuRSjWlgzZtLuJzCpT+Nq0TI3Hxowv1xaFv8unnqGqLABTaaLYxkB0U5p6TQQGMCdFGzdGrHwWIQ/GVQ== 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=ce1VSyT2Q9up/aXyu2vSwrPm+hIlSQwZlSQWQmOqqm91DlH1jDalInQfHUUn45VBf1aYrX1OQqlOAmxhFmNiKZivjXsYWNKwlpcioUt+GX034keTVYao3Ym7vtxhMcpl+IxZCPZ0gxDexYvxGEY08M13/ola6aJavhKYXCw0G/o/Amzvfb3+F68krmkyMKZEpxd38eyH4UXGbKWKv9VxRl6b0LSfbYyIlCDcwGPNLStMGH0poUdXuia79J+xYENU5NzTMMpYMlQ9cIzmXDq2pkOWQEmYSxbecM2jkVN+nnuTl/Pvxo7OaqCmo6BJFfvx9xedTCAieWBH7X7nFBcEeQ== 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=2Nvotz9DI0fZaiWt1GjkcpZ5hNrfGaSD92jLycSrYmN+ifEkkNoqCGW73WZ7M0RwgESQ1shAxJg/TeKhsFaH5mESsRCxwK0sXCcbbjRhI3UEMQxjezhaZj5yEv5p+3j/p4LZSs0xkM6RxR3Wfzf3d1UdjeCnPWqNtHKv3R37P2c= Received: from MW4PR04CA0212.namprd04.prod.outlook.com (2603:10b6:303:87::7) by SN7PR12MB6768.namprd12.prod.outlook.com (2603:10b6:806:268::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21; Thu, 2 Mar 2023 06:18:32 +0000 Received: from CO1NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87:cafe::f2) by MW4PR04CA0212.outlook.office365.com (2603:10b6:303:87::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.19 via Frontend Transport; Thu, 2 Mar 2023 06:18:32 +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 CO1NAM11FT026.mail.protection.outlook.com (10.13.175.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6156.18 via Frontend Transport; Thu, 2 Mar 2023 06:18:31 +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; Thu, 2 Mar 2023 00:17:38 -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; Wed, 1 Mar 2023 22:17:04 -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; Thu, 2 Mar 2023 00:17:01 -0600 From: Vijendar Mukunda To: Subject: [PATCH V5 1/8] soundwire: export sdw_compute_slave_ports() function Date: Thu, 2 Mar 2023 11:51:00 +0530 Message-ID: <20230302062107.207845-2-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302062107.207845-1-Vijendar.Mukunda@amd.com> References: <20230302062107.207845-1-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT026:EE_|SN7PR12MB6768:EE_ X-MS-Office365-Filtering-Correlation-Id: 13818eaf-fc3d-446b-a42f-08db1ae5f27e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 372cou+41Ly5IcMLl9bZ0rXn0/GDBFPhTL82QKY8/mfGGgJk7xN63aP90ga6IpugglkUupZ/1F+ChMcoSFuvNmpD+5kSe4+kS9ailjC5pGPOi3ltxyxw13V5YdM+qCx3+24j0/QHVk76GY5qWIrW3e8CWjj6sY9YkWx/dVuCJKUIT8uv1wmnLoTiJp8MraI4zjL5rDpieCoV/mjfQ2hCwy8t6csygAsWbQbkFhyzZ8O/sOXSOg5tY/QftHql9UcRmKS72ardyU8onyKNt9alvCRInfocW2NNBbwRZjq56ByEQJ26L7tv3nctLCOixzGcmTzxiObIOIrkgVCnN45Nylu0HNScTH57MT2D/bj5ay/2d/nPpSp7cgCpA45UdePEj9HKdz5PDA1ZN0bEVt9T3MUuvhsPd9N5c4kFBNoqi5TmDBRt2PJssXAXYORwtc2D0dnPw4eKg03X1qle43KrfMedStOk46UIgrCrKXARz7UPDbKRZ7y1KQhE4KQyQfWoniH+Bvjx+/FnNKTLMkWlwdorVGzrRdl7cWbvpntRQokXVNNxpzCtKVBw0WEzWsaZKVVNjRdHgo8on3ytcPo2+Bh4Xqs7Ajr9J2kFCBE8WvfU9Leag4CGB3np2zF3hzgIJZMBsCnRTxeyfbwGOpZNdHPOgfG3vZoyMphRmgH2YRJhMDdsSD2KBV0/pfLMF1MK4f9H4jzMweyMwZGbNzfJ0FtgFok1+vRLCt8CZIluAsY= 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)(346002)(396003)(136003)(376002)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(1076003)(26005)(40460700003)(70206006)(41300700001)(8676002)(7696005)(356005)(82310400005)(70586007)(6916009)(40480700001)(4326008)(8936002)(36756003)(86362001)(5660300002)(2616005)(966005)(82740400003)(186003)(336012)(81166007)(47076005)(426003)(54906003)(316002)(2906002)(478600001)(83380400001)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2023 06:18:31.9713 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13818eaf-fc3d-446b-a42f-08db1ae5f27e 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: CO1NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6768 Message-ID-Hash: OZ52VCJCTB4KWFLQLP5EOCEO7TNGNIED X-Message-ID-Hash: OZ52VCJCTB4KWFLQLP5EOCEO7TNGNIED X-MailFrom: Vijendar.Mukunda@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, Basavaraj.Hiregoudar@amd.com, Sunil-kumar.Dommati@amd.com, Mario.Limonciello@amd.com, amadeuszx.slawinski@linux.intel.com, Mastan.Katragadda@amd.com, Arungopal.kondaveeti@amd.com, Vijendar Mukunda , Bard Liao , Sanyog Kale , open list X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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,