From patchwork Mon Nov 21 14:14:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 23778 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1614005wrr; Mon, 21 Nov 2022 06:16:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4MeSMiSZttA+fkO4fXeYxmaDR4CNy4LOn6VPriIBJRMA5dMl+R8kDWhz8PQ37/mygHxe8t X-Received: by 2002:a17:90b:2305:b0:218:7bf3:864c with SMTP id mt5-20020a17090b230500b002187bf3864cmr18324314pjb.33.1669040211356; Mon, 21 Nov 2022 06:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669040211; cv=none; d=google.com; s=arc-20160816; b=Ts689csDKgpj4aACuum4kyGzgteaDs6t2Tsm1m1tJzcvEl1TE0Il9/d10hYRMjthDr 8/fEbeSIqL4hahleTS8tIC8xdLfZR/UBRPvHqqt+Yq3G/Kd9re3bY6W+4FJ2La2b7+b9 vdbIPlh7ZBhFpgj23Sz82I8ezevk/UKfoQp4sWK9eMsWmoTtELuEsB/CN7bbTa7BccdP 46gAKOVbdFkjFkwi/ErpaIvofd/mlPLbi8pRrteGndW2l8pAQg8FORolE8cbUa8MIGPU n6SCzgJl4slbd6vHZS3EYB1HGmKz7B+MhYilkl9arARr/+KpyTtS3xiuJmMn/ORiHQYv H7zA== ARC-Message-Signature: i=1; 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=mupvctPGaU35812hSFyzhP2oIlKUT9wSBkdlvNT0TOY=; b=PAJGkUrrHCFfNuCWnYrD1TAnRiEpwYGJQQ16U9JClrwIecdMR8f/L+ogYIFBIcIE3t b9D9jmSmKflbVvGVe0QX/PqvoU1KBnJ7CHIEmC9tRUNUP7pxR1yB+V8JjfKzcAIgIuZB KN63U8UGmlqo704muMskWjuNK2gAt7qphdvKcR1+qgnF6SSM1C5UVHnZQAQ6ZUvzWUKL /oqgt1by8TiI7jrypVFGuMlq83vKf0zM4a2L+rCXd0JEjUXYj//7956MwK4NtnMNYPba /hGBczjVgf7HJPgpxKfwUnT5xlZKLN4Gh/ruh8gRNtxLSeh3Mtu06nj6Rv0w+yLJq8c5 bo9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=fhdUnVpv; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a631355000000b00476daceffc3si7596255pgt.278.2022.11.21.06.16.10; Mon, 21 Nov 2022 06:16:51 -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=@cirrus.com header.s=PODMain02222019 header.b=fhdUnVpv; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbiKUOPt (ORCPT + 99 others); Mon, 21 Nov 2022 09:15:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbiKUOPZ (ORCPT ); Mon, 21 Nov 2022 09:15:25 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3038262EE for ; Mon, 21 Nov 2022 06:14:16 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALCr4Bw002700; Mon, 21 Nov 2022 08:14:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=mupvctPGaU35812hSFyzhP2oIlKUT9wSBkdlvNT0TOY=; b=fhdUnVpvFgC6uNd31tOaYBBij5GsErHtB33C7CfbOXonSxNigG1jL2kzeWEYuCManEa1 1ZXRZUpE8EQNRoFUZNCTC23BTlYzQyR06qS2KPt9V7xzRCbo5T+Ee8rpmupi6+jFSZX7 Q3+4l5poSXhi4Q0R7iNaYp67HdXc+RZYHQmvMHuh+MmnDaU8oae2zW5mSkx4XsjD4spk y+hIEcPnw5vFfvNOiJNtcP36SzgI6xrlRe1CIECzW+bCGC3aSHZPSXu/L7T+DWU9zRNt e5Ze7ws2kjTC+YM5nLG9xMdqHVCLscqvPFIyQubTGHIfjBivOmQRhFsUlel43T9oeSfz IA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kxvet283r-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 08:14:08 -0600 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Mon, 21 Nov 2022 08:14:06 -0600 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.20 via Frontend Transport; Mon, 21 Nov 2022 08:14:06 -0600 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 7B636B38; Mon, 21 Nov 2022 14:14:06 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH v3 2/4] soundwire: Provide build stubs for common functions Date: Mon, 21 Nov 2022 14:14:04 +0000 Message-ID: <20221121141406.3840561-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221121141406.3840561-1-ckeepax@opensource.cirrus.com> References: <20221121141406.3840561-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 1Nmg1w26ts7BVPKEM0TeCsXlxQg-kj73 X-Proofpoint-GUID: 1Nmg1w26ts7BVPKEM0TeCsXlxQg-kj73 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS 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?1750115508763313822?= X-GMAIL-MSGID: =?utf-8?q?1750115508763313822?= Provide stub functions when CONFIG_SOUNDWIRE is not set for functions that are quite likely to be used from common code on devices supporting multiple control buses. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Charles Keepax --- No changes since v2. include/linux/soundwire/sdw.h | 92 +++++++++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 10 deletions(-) diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 902ed46f76c80..4f80cba898f11 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -1021,15 +1021,8 @@ int sdw_stream_add_master(struct sdw_bus *bus, struct sdw_port_config *port_config, unsigned int num_ports, struct sdw_stream_runtime *stream); -int sdw_stream_add_slave(struct sdw_slave *slave, - struct sdw_stream_config *stream_config, - struct sdw_port_config *port_config, - unsigned int num_ports, - struct sdw_stream_runtime *stream); int sdw_stream_remove_master(struct sdw_bus *bus, struct sdw_stream_runtime *stream); -int sdw_stream_remove_slave(struct sdw_slave *slave, - struct sdw_stream_runtime *stream); int sdw_startup_stream(void *sdw_substream); int sdw_prepare_stream(struct sdw_stream_runtime *stream); int sdw_enable_stream(struct sdw_stream_runtime *stream); @@ -1040,8 +1033,20 @@ int sdw_bus_prep_clk_stop(struct sdw_bus *bus); int sdw_bus_clk_stop(struct sdw_bus *bus); int sdw_bus_exit_clk_stop(struct sdw_bus *bus); -/* messaging and data APIs */ +int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id); +void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id); + +#if IS_ENABLED(CONFIG_SOUNDWIRE) +int sdw_stream_add_slave(struct sdw_slave *slave, + struct sdw_stream_config *stream_config, + struct sdw_port_config *port_config, + unsigned int num_ports, + struct sdw_stream_runtime *stream); +int sdw_stream_remove_slave(struct sdw_slave *slave, + struct sdw_stream_runtime *stream); + +/* messaging and data APIs */ int sdw_read(struct sdw_slave *slave, u32 addr); int sdw_write(struct sdw_slave *slave, u32 addr, u8 value); int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value); @@ -1053,7 +1058,74 @@ int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 * int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val); int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val); -int sdw_compare_devid(struct sdw_slave *slave, struct sdw_slave_id id); -void sdw_extract_slave_id(struct sdw_bus *bus, u64 addr, struct sdw_slave_id *id); +#else + +static inline int sdw_stream_add_slave(struct sdw_slave *slave, + struct sdw_stream_config *stream_config, + struct sdw_port_config *port_config, + unsigned int num_ports, + struct sdw_stream_runtime *stream) +{ + return 0; +} + +static inline int sdw_stream_remove_slave(struct sdw_slave *slave, + struct sdw_stream_runtime *stream) +{ + return 0; +} + +/* messaging and data APIs */ +static inline int sdw_read(struct sdw_slave *slave, u32 addr) +{ + return 0; +} + +static inline int sdw_write(struct sdw_slave *slave, u32 addr, u8 value) +{ + return 0; +} + +static inline int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value) +{ + return 0; +} + +static inline int sdw_read_no_pm(struct sdw_slave *slave, u32 addr) +{ + return 0; +} + +static inline int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) +{ + return 0; +} + +static inline int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) +{ + return 0; +} + +static inline int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) +{ + return 0; +} + +static inline int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) +{ + return 0; +} + +static inline int sdw_update(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) +{ + return 0; +} + +static inline int sdw_update_no_pm(struct sdw_slave *slave, u32 addr, u8 mask, u8 val) +{ + return 0; +} + +#endif /* CONFIG_SOUNDWIRE */ #endif /* __SOUNDWIRE_H */