From patchwork Mon Nov 21 14:14:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 23777 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1613780wrr; Mon, 21 Nov 2022 06:16:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf5hPOPF62VmXZ4hGNjGb7V1hIDClnyhDfNmx7hscIQBxil0auig34fkQtnC8touKqKFSqov X-Received: by 2002:adf:ce06:0:b0:236:e06b:ec12 with SMTP id p6-20020adfce06000000b00236e06bec12mr11097896wrn.69.1669040187071; Mon, 21 Nov 2022 06:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669040187; cv=none; d=google.com; s=arc-20160816; b=HwuiQgpZQKRIYK3fb3QCk92nJYFCfl+oicxsYS3vUUaAJhs66zAG7gu9xHmF0Lw0Wb eSQ0E7RmjTI693G04ayf2XYj0pgi2S1HTAreSXSI3iFk+lNfIiLXJfBzFQ+JgN1hX4gl qSTLrENRh02c8ldmJVdfEhZfc0vdL4uTbEuEF+Io6XWZpq8ZaVSgZwphSybcbkBRT1Z8 UD7LzNQSbZP7bLPHd3ZvNo+2DQrtFMC3cZl869/DLda2Md3A38BXWpaH4pyRIkXfYsv0 j5pysvknSghf6wQnaNfKeAZUDHTIFsYjgYbqZvt93c2V9mjdjAk6q6QRxp+/WwJczWYt JBbA== 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=WILxXOGhVNe0I1FxujLIVVqB4+tPaZ++Vr7hhtDWbqs=; b=jMgKk/BG+vV+0+uso0aQDgPA5V7lnuSsBFimi5DOzMiYXCwXF7GQaJNT/EgKSeSkOf fLGkVnCbjxZSDoN8/leq/Zb8S6tNs9QMEsK1qpmmcHS5Z0pUmzPDbTHXKtSoSvqLqevV 2/GVm/9hptBCvaHWmJSu6AnFVTMLwR6Fq9BvAkwy0iE5duvNWs9Z4rzuLSfsieYCWhMM nqfnI6pZIgXA/Pe7j8xn27hCpk7XSp4GXtgzthWdWgoqmL867Q40Ila4Y5LyH7RnRxM9 ybC2XdQCt4k/VtLfmqbAEr1JTRk743p0llDUOVR028AJpzjCG3qBlb5xggDwMEsqJ4OI xaFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=ioerokhu; 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 ga31-20020a1709070c1f00b007878c9d73a2si10379507ejc.426.2022.11.21.06.15.53; Mon, 21 Nov 2022 06:16:27 -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=ioerokhu; 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 S229960AbiKUOPp (ORCPT + 99 others); Mon, 21 Nov 2022 09:15:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbiKUOPZ (ORCPT ); Mon, 21 Nov 2022 09:15:25 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DB762E6 for ; Mon, 21 Nov 2022 06:14:16 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALCtMm7002614; 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=WILxXOGhVNe0I1FxujLIVVqB4+tPaZ++Vr7hhtDWbqs=; b=ioerokhuKZoqvR3K7pix02NpMfGyL5qqW/rEMGyoyPYhLNNWG8p5v0sUuylsvXhA3TGM WFLXnRTT/bEWsWraN17qyfuxjACGpxfJBH0Lv/85J3/viX27+UU7Oft2m/A12NsHkhHG lP3pVekYOm12/9iguPtag9SIMSU99db7quQThGvaTbh5uq6MYgVrv7WmWT0g+r6d5Gyv cD3jnkx2PfNtg0dB18yU+14vUZ1z1Sa2w2f6JxnCwkqKHuCRC4pQaEFTxBECh1l3AzWJ E8P/9fISQXJDtL+Ytrvtoa5FGqYeZAhGzhKrnZXItGlp0K4jmjBGU9LYtfqcbBzJzNSn NQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3kxwe6t7hc-1 (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 ediex01.ad.cirrus.com (198.61.84.80) 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 6CB70B12; Mon, 21 Nov 2022 14:14:06 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH v3 1/4] soundwire: bus: export sdw_nwrite_no_pm and sdw_nread_no_pm functions Date: Mon, 21 Nov 2022 14:14:03 +0000 Message-ID: <20221121141406.3840561-2-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: T_-eze7Qsgl43ayYLL3p2fVkp_rWd3ob X-Proofpoint-GUID: T_-eze7Qsgl43ayYLL3p2fVkp_rWd3ob 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?1750115483280897712?= X-GMAIL-MSGID: =?utf-8?q?1750115483280897712?= From: Simon Trimmer The commit 167790abb90f ("soundwire: export sdw_write/read_no_pm functions") exposed the single byte no_pm versions of the IO functions that can be used without touching PM, export the multi byte no_pm versions for the same reason. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Simon Trimmer Signed-off-by: Charles Keepax --- Changes since v2: - Added Pierre's reviewed-by. drivers/soundwire/bus.c | 8 ++++---- include/linux/soundwire/sdw.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 76515c33e639e..ef4878258afad 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -414,8 +414,7 @@ int sdw_fill_msg(struct sdw_msg *msg, struct sdw_slave *slave, * all clients need to use the pm versions */ -static int -sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) +int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) { struct sdw_msg msg; int ret; @@ -430,9 +429,9 @@ sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) ret = 0; return ret; } +EXPORT_SYMBOL(sdw_nread_no_pm); -static int -sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) +int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) { struct sdw_msg msg; int ret; @@ -447,6 +446,7 @@ sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val) ret = 0; return ret; } +EXPORT_SYMBOL(sdw_nwrite_no_pm); int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value) { diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 9e4537f409c29..902ed46f76c80 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -1047,7 +1047,9 @@ int sdw_write(struct sdw_slave *slave, u32 addr, u8 value); int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value); int sdw_read_no_pm(struct sdw_slave *slave, u32 addr); int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); +int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val); int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val); +int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val); 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); 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 */ From patchwork Mon Nov 21 14:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 23780 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1614868wrr; Mon, 21 Nov 2022 06:18:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf51f12vX+Vla8q4BBpGyo0jS042S0x/pL5KCXmdarkviI/c94cs/X1Z5S4TuWEgBp3fjIvK X-Received: by 2002:a05:6402:3807:b0:45c:a651:87f1 with SMTP id es7-20020a056402380700b0045ca65187f1mr41424edb.359.1669040292205; Mon, 21 Nov 2022 06:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669040292; cv=none; d=google.com; s=arc-20160816; b=LFZcb/rNYu+F7wU901vM7+t5ZkpfXAXJPNIYE1nrbybMhmuoOlTf0NwNdP88D2DIrI nCFAT/WXU3TjO4H3x/+I18M0gZjsqdTGisFY9y1vjHbuqbA1Fr0YAzlo7UauyEDqFfnM TVRd8xPtqbdsJ+1i/tSEFDayjYon/pgdnWhl6SBBBQ/AC8cgieGAFy/Lq2avaXhDlj9M 2NDd2oxYSwzxwg+4O0gv0lYOMST7cs/30F8IOH3/HGY6XS4kUp8AbJCW3Pcs7VNGSvt7 4hYijZubQI0DRZv5FSjQ1OSVFIMtdb0n9KCHObH6WTr71uQZNRoFUIz7KVhpordUdfVW aG0Q== 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=HOjHRSQXtgdhVwHZ+HgWlY2gRn1pGVLV5kYH7Y3cWP4=; b=o0owkRWZz457fc4ETM2xYiOg7JBlkAbF4nhe+nOBoV8/cGNSsms4PHcV16PZmBQGMx LMPkBDvC78hYuPX/C6H7ShsuWUWG3SBjZI0mr6Mm5B4hSV/TLJ6F+SGNYllvgT73kRa3 0F1Q1X1vWz7trTjKQpDxYZ6ebh8KHGjr6qo7I+FdS5tmi2xvSPlMemQLP+t7BSYmdmW5 JnX1tjeUcdtUcskk14x3nQUJ4NMKVwVuM0jAg35ly3JISpPIuNPi0t6Pmkh7Mk6GyDg+ C9N57xKOiBexivyLgfMCcB9vRr4Ow16LsGDhL6NY9ShynTmlfoygmXkD7Z86rpzfjEor oJiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="b9/wyJYV"; 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 xh13-20020a170906da8d00b007ae4c686a4dsi9283481ejb.649.2022.11.21.06.17.15; Mon, 21 Nov 2022 06:18:12 -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="b9/wyJYV"; 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 S230150AbiKUOQF (ORCPT + 99 others); Mon, 21 Nov 2022 09:16:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiKUOP0 (ORCPT ); Mon, 21 Nov 2022 09:15:26 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00F5D1005 for ; Mon, 21 Nov 2022 06:14:16 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALCtMm8002614; Mon, 21 Nov 2022 08:14:09 -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=HOjHRSQXtgdhVwHZ+HgWlY2gRn1pGVLV5kYH7Y3cWP4=; b=b9/wyJYVR6zKDn7TmOWEyZp7y2CGDoT4s1dh4aL9ulfPmV6CkboCudhC1Pws0wYdp/ft lW/rlzCsPPkHWWks2Xn6dOv2pfmNB7xFiVI29vVwYyQl2LnLw0OCvfFN3CYLguEXOct1 ltQCKz//iPx4ntYBHjf6p0RMYI7tL6YhRXgLoQQCc8F7ykT3PkN5x813h4W9q5KjHmJN ZM5a19acfKNEJQTp5TxULRNaEA91BbCzLe6/OoTdskVYih2SoQ6fZ8Kn8inbHdG398JE VU4tDfY11ZMBxupqdp2vs4BGIZesYtIYlFSGS9tO1oZCQfz5lroE5n79R3tqHMowbSn1 cw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3kxwe6t7hc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 08:14:09 -0600 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) 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 ediex01.ad.cirrus.com (198.61.84.80) 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 8D8DCB2F; Mon, 21 Nov 2022 14:14:06 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH v3 3/4] soundwire: debugfs: Switch to sdw_read_no_pm Date: Mon, 21 Nov 2022 14:14:05 +0000 Message-ID: <20221121141406.3840561-4-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: qPXzth3N1MEWtS2ZGVhcfBvE3yho6Y1O X-Proofpoint-GUID: qPXzth3N1MEWtS2ZGVhcfBvE3yho6Y1O 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?1750115593392067552?= X-GMAIL-MSGID: =?utf-8?q?1750115593392067552?= It is rather inefficient to be constantly playing with the runtime PM reference for each individual register, switch to holding a PM runtime reference across the whole register output. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Charles Keepax --- Changes since v2: - Added Pierre's reviewed-by. - Fixed memory leak of buf on error path. drivers/soundwire/debugfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c index 49900cd207bc7..dea782e0edc4b 100644 --- a/drivers/soundwire/debugfs.c +++ b/drivers/soundwire/debugfs.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,7 @@ static ssize_t sdw_sprintf(struct sdw_slave *slave, { int value; - value = sdw_read(slave, reg); + value = sdw_read_no_pm(slave, reg); if (value < 0) return scnprintf(buf + pos, RD_BUF - pos, "%3x\tXX\n", reg); @@ -55,6 +56,12 @@ static int sdw_slave_reg_show(struct seq_file *s_file, void *data) if (!buf) return -ENOMEM; + ret = pm_runtime_resume_and_get(&slave->dev); + if (ret < 0 && ret != -EACCES) { + kfree(buf); + return ret; + } + ret = scnprintf(buf, RD_BUF, "Register Value\n"); /* DP0 non-banked registers */ @@ -112,6 +119,10 @@ static int sdw_slave_reg_show(struct seq_file *s_file, void *data) } seq_printf(s_file, "%s", buf); + + pm_runtime_mark_last_busy(&slave->dev); + pm_runtime_put(&slave->dev); + kfree(buf); return 0; From patchwork Mon Nov 21 14:14:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 23779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1614519wrr; Mon, 21 Nov 2022 06:17:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5uqtb74okmPfbJBdFMBirYy/OlPsWqj4CYbacKjGhHqqrc5sdHJPsCR+TaiqCkPjImZRUe X-Received: by 2002:a17:906:4556:b0:7ae:eaf1:c9e3 with SMTP id s22-20020a170906455600b007aeeaf1c9e3mr15647609ejq.551.1669040265004; Mon, 21 Nov 2022 06:17:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669040264; cv=none; d=google.com; s=arc-20160816; b=VYzipbXm5xHd5E0r1NR3WwpCngojUpkFdsnm3DNt4tMxMtL1lQlITgRtoL6w2/K6ci 2Wm0UNY1q4CFMx2wEVrjEaGRNeglbLDXFTOFKugnhgQt5A2dmkiU4CcG6/Qp5ntIRheQ Y/N9qOY0myLR5wFcUfx0QLW9ulmBCI4aCeBneDMGjTFqON4ZhwgNJu6vQDAAUqxmm7iA Y8yk1qCZRgdHDC3D9QgNwT9zvyOZcU3q4lDzFqCQOJHHhbOF7CwOg9om0xmiKlmRVUrz Baxe0eIpv2KrZDtdDwr0RXsJKhiOmpsx9kY0KeES6ukrzUNQrJ7Ht9TrkPY0HEtr6z3R xeHA== 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=1PeK3bms+IaPxcTW0cokINfe1642tn7T3FwGji4GBoA=; b=YB/nwDqmAc9uYuWvMp9bvVH5+QkYFc+3tWjr9K9xgF227WKAbyx21ILezDe4V3UqcZ qQ3/ZFj1qKrVb/Z/gW+4uA5DxPpGJZmd2srjBa0pO98O8uDZLH4avX7u4XuZI5ILUOZ8 xzdFXiftyLnxsG8uEI8b4mO912hu1QJScYh+Xd+VAMfIx2cTUe4BO1pyEi1h5WSfM7u5 PZ5XlWHQZq/N5h2Dxip7aEzbcmcowu+fh1zyO6PgpPcKSOi4CQdBpTPa5sDBD8VDx8wZ fBlPorPPNyWAmA8BwYJy8k76d9MHZ7g7pb3pWyePtv57dSAZX+w2GKWEhagT2QNvfKLP x/ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="DOxSu/Im"; 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 r14-20020aa7cfce000000b00463a61c257dsi8547502edy.524.2022.11.21.06.17.15; Mon, 21 Nov 2022 06:17:44 -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="DOxSu/Im"; 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 S230492AbiKUOQJ (ORCPT + 99 others); Mon, 21 Nov 2022 09:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230318AbiKUOP0 (ORCPT ); Mon, 21 Nov 2022 09:15:26 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7348CE44 for ; Mon, 21 Nov 2022 06:14:18 -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 2ALCr4Bx002700; Mon, 21 Nov 2022 08:14:09 -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=1PeK3bms+IaPxcTW0cokINfe1642tn7T3FwGji4GBoA=; b=DOxSu/ImhjUT7GBsfIKcw4ZyPmFnObyOJrLWPJx8huTjgT24Dl3yv8+wAInG8YeZ0HDG wKXnkBnX13u7MliSf1Ry/yc2kA/aezf9XFM/Es2le4cag+BqZPR4IiemaWCCmFMUf1JV QMKPsgMO3/hfzGcZ+vlKttznU/vE0AVkQxFMe0bsPz6veBXal1GCzutLrdfe0xk06Xzy HMEKvM51KoJPhRU++S8iL6mmMALBghgu7cdHDVwCBYIiy2XYpjCTXedu0TLgmSIHLiXv t4LwgrGdLQVu5pRnDGNoY2NevrAf6Kc+yLgfixwl9EdnLlzkU/e/MCQu1lnGVci7BbsW MA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kxvet283r-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 08:14:09 -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 9DF85468; Mon, 21 Nov 2022 14:14:06 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH v3 4/4] soundwire: stream: Move remaining register accesses over to no_pm Date: Mon, 21 Nov 2022 14:14:06 +0000 Message-ID: <20221121141406.3840561-5-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: Yj30PiP-VfJoLzeufnmghbBgSdGbfJl4 X-Proofpoint-GUID: Yj30PiP-VfJoLzeufnmghbBgSdGbfJl4 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?1750115565126353851?= X-GMAIL-MSGID: =?utf-8?q?1750115565126353851?= There is no need to play with the runtime reference everytime a register is accessed. All the remaining "pm" style register accesses trace back to 4 functions: sdw_prepare_stream sdw_deprepare_stream sdw_enable_stream sdw_disable_stream Any sensible implementation will need to hold a runtime reference across all those functions, it makes no sense to be allowing the device/bus to suspend whilst streams are being prepared/enabled. And certainly in the case of the all existing users, they all call these functions from hw_params/prepare/trigger/hw_free callbacks in ALSA, which will have already runtime resumed all the audio devices associated during the open callback. Reviewed-by: Pierre-Louis Bossart Signed-off-by: Charles Keepax --- No changes since v2. drivers/soundwire/bus.c | 2 +- drivers/soundwire/stream.c | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index ef4878258afad..d87a188fcce1e 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -1214,7 +1214,7 @@ int sdw_configure_dpn_intr(struct sdw_slave *slave, val &= ~SDW_DPN_INT_PORT_READY; } - ret = sdw_update(slave, addr, (mask | SDW_DPN_INT_PORT_READY), val); + ret = sdw_update_no_pm(slave, addr, (mask | SDW_DPN_INT_PORT_READY), val); if (ret < 0) dev_err(&slave->dev, "SDW_DPN_INTMASK write failed:%d\n", val); diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index bd502368339e5..df3b36670df4c 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -81,14 +81,14 @@ static int _sdw_program_slave_port_params(struct sdw_bus *bus, } /* Program DPN_OffsetCtrl2 registers */ - ret = sdw_write(slave, addr1, t_params->offset2); + ret = sdw_write_no_pm(slave, addr1, t_params->offset2); if (ret < 0) { dev_err(bus->dev, "DPN_OffsetCtrl2 register write failed\n"); return ret; } /* Program DPN_BlockCtrl3 register */ - ret = sdw_write(slave, addr2, t_params->blk_pkg_mode); + ret = sdw_write_no_pm(slave, addr2, t_params->blk_pkg_mode); if (ret < 0) { dev_err(bus->dev, "DPN_BlockCtrl3 register write failed\n"); return ret; @@ -105,7 +105,7 @@ static int _sdw_program_slave_port_params(struct sdw_bus *bus, /* Program DPN_SampleCtrl2 register */ wbuf = FIELD_GET(SDW_DPN_SAMPLECTRL_HIGH, t_params->sample_interval - 1); - ret = sdw_write(slave, addr3, wbuf); + ret = sdw_write_no_pm(slave, addr3, wbuf); if (ret < 0) { dev_err(bus->dev, "DPN_SampleCtrl2 register write failed\n"); return ret; @@ -115,7 +115,7 @@ static int _sdw_program_slave_port_params(struct sdw_bus *bus, wbuf = FIELD_PREP(SDW_DPN_HCTRL_HSTART, t_params->hstart); wbuf |= FIELD_PREP(SDW_DPN_HCTRL_HSTOP, t_params->hstop); - ret = sdw_write(slave, addr4, wbuf); + ret = sdw_write_no_pm(slave, addr4, wbuf); if (ret < 0) dev_err(bus->dev, "DPN_HCtrl register write failed\n"); @@ -163,7 +163,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, wbuf = FIELD_PREP(SDW_DPN_PORTCTRL_DATAMODE, p_params->data_mode); wbuf |= FIELD_PREP(SDW_DPN_PORTCTRL_FLOWMODE, p_params->flow_mode); - ret = sdw_update(s_rt->slave, addr1, 0xF, wbuf); + ret = sdw_update_no_pm(s_rt->slave, addr1, 0xF, wbuf); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_PortCtrl register write failed for port %d\n", @@ -173,7 +173,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, if (!dpn_prop->read_only_wordlength) { /* Program DPN_BlockCtrl1 register */ - ret = sdw_write(s_rt->slave, addr2, (p_params->bps - 1)); + ret = sdw_write_no_pm(s_rt->slave, addr2, (p_params->bps - 1)); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_BlockCtrl1 register write failed for port %d\n", @@ -184,7 +184,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, /* Program DPN_SampleCtrl1 register */ wbuf = (t_params->sample_interval - 1) & SDW_DPN_SAMPLECTRL_LOW; - ret = sdw_write(s_rt->slave, addr3, wbuf); + ret = sdw_write_no_pm(s_rt->slave, addr3, wbuf); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_SampleCtrl1 register write failed for port %d\n", @@ -193,7 +193,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, } /* Program DPN_OffsetCtrl1 registers */ - ret = sdw_write(s_rt->slave, addr4, t_params->offset1); + ret = sdw_write_no_pm(s_rt->slave, addr4, t_params->offset1); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_OffsetCtrl1 register write failed for port %d\n", @@ -203,7 +203,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, /* Program DPN_BlockCtrl2 register*/ if (t_params->blk_grp_ctrl_valid) { - ret = sdw_write(s_rt->slave, addr5, t_params->blk_grp_ctrl); + ret = sdw_write_no_pm(s_rt->slave, addr5, t_params->blk_grp_ctrl); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_BlockCtrl2 reg write failed for port %d\n", @@ -214,7 +214,7 @@ static int sdw_program_slave_port_params(struct sdw_bus *bus, /* program DPN_LaneCtrl register */ if (slave_prop->lane_control_support) { - ret = sdw_write(s_rt->slave, addr6, t_params->lane_ctrl); + ret = sdw_write_no_pm(s_rt->slave, addr6, t_params->lane_ctrl); if (ret < 0) { dev_err(&s_rt->slave->dev, "DPN_LaneCtrl register write failed for port %d\n", @@ -319,9 +319,9 @@ static int sdw_enable_disable_slave_ports(struct sdw_bus *bus, * it is safe to reset this register */ if (en) - ret = sdw_write(s_rt->slave, addr, p_rt->ch_mask); + ret = sdw_write_no_pm(s_rt->slave, addr, p_rt->ch_mask); else - ret = sdw_write(s_rt->slave, addr, 0x0); + ret = sdw_write_no_pm(s_rt->slave, addr, 0x0); if (ret < 0) dev_err(&s_rt->slave->dev, @@ -476,9 +476,9 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, addr = SDW_DPN_PREPARECTRL(p_rt->num); if (prep) - ret = sdw_write(s_rt->slave, addr, p_rt->ch_mask); + ret = sdw_write_no_pm(s_rt->slave, addr, p_rt->ch_mask); else - ret = sdw_write(s_rt->slave, addr, 0x0); + ret = sdw_write_no_pm(s_rt->slave, addr, 0x0); if (ret < 0) { dev_err(&s_rt->slave->dev, @@ -491,7 +491,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, wait_for_completion_timeout(port_ready, msecs_to_jiffies(dpn_prop->ch_prep_timeout)); - val = sdw_read(s_rt->slave, SDW_DPN_PREPARESTATUS(p_rt->num)); + val = sdw_read_no_pm(s_rt->slave, SDW_DPN_PREPARESTATUS(p_rt->num)); if ((val < 0) || (val & p_rt->ch_mask)) { ret = (val < 0) ? val : -ETIMEDOUT; dev_err(&s_rt->slave->dev,