From patchwork Mon Nov 14 10:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 19664 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2073083wru; Mon, 14 Nov 2022 02:37:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5axiQj50LadA5iXhMjPIMriBKniZNdUV/YIJ5iUqGuMucPN2MC2ZaaffXSbF5Ig1ePO0Vy X-Received: by 2002:a17:906:950e:b0:7ae:b9fc:8668 with SMTP id u14-20020a170906950e00b007aeb9fc8668mr9160544ejx.257.1668422259989; Mon, 14 Nov 2022 02:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422259; cv=none; d=google.com; s=arc-20160816; b=wKfhiYYocpc0NH29AArBFWWU3McywXI9ILgnatYlXeiHxvRwtvgk0Kl9CDhqjZMNBc Vo+3cnDv0kuFF7TLvOHzOgAodmDgU/jDWaSuf+oVDjqfky5aiO1mQHHQ0XTV7C6UEROY GFlsmAEbSmS0ePjisUsAkoO10fgbiNmhWnRe8QoqMMbVhNtsc1HNc50h1B5DxWcDLEhZ K8AB7XI23bKkg4j8m+O514E5HFNC4+LUnWHe1jlvN0a7a81F8FzhEmEvnOdB4opIN9lg prOSEsrwAJ4+mz40klcOSHH2L586njhmWaFY9JvLhgZYweT5UnYrVPTkMdr2DjJJbt2d EC0g== 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=C8x7Ea1yZLWaFKtwstq1Od1PDFQoikXzXfnEcLWKVII=; b=IF1x6Xe1uAijZd2d0vbbS7S1c3jFaLX7P9qoT7Jsk+bfbqWGQHlImVxhpzqaMsvGcN ORDqX3xL+a1m4gkqYSjXCTJ5CZLpeY6Ob3pFLW5UI1EL6ehvNYkNe4kTxeDYWwtyipYV rTwDxmejzApjOxkwYtXyFoQFa1EkGpc0HGJDR54hviTio3lh96uNDdDfNrKSazmlKjt8 885QH14siFgNGtHOjSU3bvI4qxrm4Q4L9lt5AxN/i80Em2vUAkYX2MFh5sAPv/KGd0he WWrBFOvDljBVKf4nVLDZkdfY1GhelxT3ZxuWBM+2Yf5wtXGleThWdavpqWTf/zei3vvb YzLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=e1YAP1ug; 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 da1-20020a056402176100b0045ca3839229si7436591edb.274.2022.11.14.02.37.16; Mon, 14 Nov 2022 02:37:39 -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=e1YAP1ug; 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 S236266AbiKNKa0 (ORCPT + 99 others); Mon, 14 Nov 2022 05:30:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236290AbiKNKaP (ORCPT ); Mon, 14 Nov 2022 05:30:15 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80439F587 for ; Mon, 14 Nov 2022 02:30:13 -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 2AE8Wcib019990; Mon, 14 Nov 2022 04:29:58 -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=C8x7Ea1yZLWaFKtwstq1Od1PDFQoikXzXfnEcLWKVII=; b=e1YAP1ugITfHvKDsVwx72xPsI9UncP9PEijRMVBJhZbyJQhBn9iiMhYO/jOkSaOgP2TV BzKqkHUDmgrEm7lZdf8Oy5ckgLeaG2FwNMR0uSpDuKfrdXYJ3yiZ+heunxttNCPlVuQ8 Ck7+1xHfBOZNrRNKlRHkIsAeaXiUTk0Vx6LcCCVotI/4sCm0K3DrtuTKErHNxql1BBaW 8ucTmVoD73ARMQtc+YSbjaCW8jVe0gLv5xHc17pRP4ZpRL8W1Q6uGq86tGd/1SaQZP1i /lyM1JjOqkhZpQpwXNmDa61ijYo1Ux2JbAZXLmFiSMyLqSLoNI0AMSWsfEhp3Itj7Gf+ WQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kt8sst0ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 04:29:57 -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.15; Mon, 14 Nov 2022 04:29:56 -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.15 via Frontend Transport; Mon, 14 Nov 2022 04:29:56 -0600 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 46360477; Mon, 14 Nov 2022 10:29:56 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 1/4] soundwire: bus: export sdw_nwrite_no_pm and sdw_nread_no_pm functions Date: Mon, 14 Nov 2022 10:29:53 +0000 Message-ID: <20221114102956.914468-2-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> References: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: q_2AKa7BIDTaXnRa-EPavF79D2krWaPW X-Proofpoint-ORIG-GUID: q_2AKa7BIDTaXnRa-EPavF79D2krWaPW 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?1749467539466164300?= X-GMAIL-MSGID: =?utf-8?q?1749467539466164300?= 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. Signed-off-by: Simon Trimmer Signed-off-by: Charles Keepax --- 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 14 10:29:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 19665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2073343wru; Mon, 14 Nov 2022 02:38:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Ui33m81Z/kD2KmIg7vzQ8RlzPX9hqgp8UtY72S5bAVgMiVdmzyAcpSAMo/ZHYRqUkz+dx X-Received: by 2002:a17:902:f643:b0:186:8bd9:eca3 with SMTP id m3-20020a170902f64300b001868bd9eca3mr13371965plg.0.1668422314555; Mon, 14 Nov 2022 02:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422314; cv=none; d=google.com; s=arc-20160816; b=TYoKZ+0rC9/3US9CR/C/felOhJ/qadJyWppOWtnTxy3Qj6enb475pMuB4UbnQE6QcT QzxNkMUlmhSKrtj81a+jVvcgn2P5xgLWa5VJb9EAa/Y2uzanSy9JfZMXOHsdGM+6hyCy yNKt/5Fot9ia5ROhssouvXkyJVlnXaxjvPxrQpbIu7fIrxkx9nJZQcuM6Tn6u8KWMQDH XYWvBV459y2jySRn5WKh4Nx5YViGGuaBNqn6rc5aFdeKGiFXRbKiJ6LCxeg+MWE/iGVS ifTb6efd3oANAn+CKqc5bIMILs4mDVKihPeqrRkzB5X/3Li5e1DbGEAQNKWRVF/T06Aq IEYg== 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=b32hXKJIPViLBZgGML5MZnvwImfcHKYM9AxZYNqCqcU=; b=dDah1F7CVNdnTOqfkLgasCCPIUsvFI8gbFS05+kzrplzJHH98JO2f7JEirkWWRNWCi cIfTfQwG9FwDcHf/Doz8aWVwJdKEObLrjyJLFY50XC/IBWs1mlx2kQQS3fLiuLoneoO/ RzgUBg+KkdPAa1XO1/2kamxgdkWuK0TLCPJXrNzS5iau6LsUQr6YCkcClMBy56kgSeck 0eJ6iZr4XPwUfWxsGs89vEoVJYGjqEOZwQEkrVy5c/FSv7AzBaXz32ee0NIcVVslJSnl K4874VEX1/yOW3WUFTOUuZD2WTMa+Q0WiMZuYFytxtIrkpCRL5s5GmdoYjYQ2Itiyp/b aNeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lilYEVsp; 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 k25-20020a634b59000000b0046fe64444fcsi9706118pgl.839.2022.11.14.02.38.21; Mon, 14 Nov 2022 02:38:34 -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=lilYEVsp; 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 S236331AbiKNKaQ (ORCPT + 99 others); Mon, 14 Nov 2022 05:30:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236266AbiKNKaP (ORCPT ); Mon, 14 Nov 2022 05:30:15 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F7EF031 for ; Mon, 14 Nov 2022 02:30:12 -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 2AE8Wcid019990; Mon, 14 Nov 2022 04:29:58 -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=b32hXKJIPViLBZgGML5MZnvwImfcHKYM9AxZYNqCqcU=; b=lilYEVspR3Y1LPIAlWCyuDL9Vf4FyJG35akAtKOVIugLcmG7TsQ2mbSfT2gYrV1j8Aj/ C884tpvrx/UrX/6xqyGXd+NIGm5WFAkjnQwdRqxCMbitngSWLosuIR7kcxijG5dU2aBz kjVteywMtIGkxErwZVUBLOut+w+l8N+5lDb/p5eoU5SJoE0QHIvFIi2Oa7uX90jbF0gM j17w9tI8siDlNG0Vzue231NPkxA4Mu1JFxWiDwngyVbGDOMYxO7gEGKUktTmiB9QUyit f2hTS2RRBGWk1Tmp0tPdPVZRy0yfuObBF6RnR8USR/uTSXkx2mp1PUh+HJiXaRCax0RG ww== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kt8sst0cm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 04:29:58 -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.15; Mon, 14 Nov 2022 04:29:56 -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.15 via Frontend Transport; Mon, 14 Nov 2022 04:29:56 -0600 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 56BB3B12; Mon, 14 Nov 2022 10:29:56 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 2/4] soundwire: Provide build stubs for common functions Date: Mon, 14 Nov 2022 10:29:54 +0000 Message-ID: <20221114102956.914468-3-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> References: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: iMsjegMcVmelEZf2jHDKFBECtcuZu3N2 X-Proofpoint-ORIG-GUID: iMsjegMcVmelEZf2jHDKFBECtcuZu3N2 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?1749467597205041680?= X-GMAIL-MSGID: =?utf-8?q?1749467597205041680?= 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. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart --- 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 14 10:29:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 19667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2073479wru; Mon, 14 Nov 2022 02:39:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf42XGKPotjsJPR+jTapqjg9d5OHQ8eIO/a4SvvlJ812oy5EHkkkAGbY+/n9qDy41V8V6VpZ X-Received: by 2002:a05:6a00:3485:b0:571:fa1d:85b7 with SMTP id cp5-20020a056a00348500b00571fa1d85b7mr6392391pfb.39.1668422342065; Mon, 14 Nov 2022 02:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422342; cv=none; d=google.com; s=arc-20160816; b=uzYFqbvn+swzHVb6kKBAafFOf2CW2visfAftOJLeVxjJ1jq0u25CoPoyBT9NH2wGD6 tOYih3gB7JWlOgH+0+tXQRk6vHTBWTGiVYnUcuJelJU1XNW9amTeGRbKNuXh6y2Cbmm2 +XxMr2faNSdJr42xTtT7Fhzhqg59BG2Jtf4Jaon6YeEnm9k+1fSDahjBABYlEXtSi3ic rQMPcPcRkvMYdAMXam8MneaC47D6t/oso6/uRp2oMxEM3CFtRzVUWSp/qWeRGA3bZqS6 FwX0Xo+fru6FSkGXnZMsLrJ+gdZPJtv3h70thgObZqfIUmIXBFoeesIXoontKwaQNG6b tEMA== 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=wR8WznTLjHtXuxSzrfRxj5uzxnQfyrE3rhFbBYPUl9E=; b=e4B4jWk3Ht1wMQwV8G8RT0N6sT7sCVGlrtroMixCnK1dWj06hDDVdLDMYc1vZ8w0KY bBcSWAOj7f65den6bqSw6amb18o0WxJ71z38eGukHb9cmy57v7DrdVzWU+K2piDL6d1S 3k3zubLkhL+uxkQM+tugAGhyyr+mYxdEhFQbdQL5iHJtp4fDDSgsn7tvSRpaNsdyqWif Ss8o7mMiCdIyUaUDquDr0e3sS8Nat6eoQra5XcOAYX+IJNaFdoElVtzhclGMfgyK/n6S WR1eMg0AbyQKXnYzYOZ0WrZ3LxCtZvqVnGr0us7a6p/hFJxv/Lodo9cmEz+ZBeOGjkza yZ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=Pz4b01vd; 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 w14-20020a17090a8a0e00b002135a4d80d7si9029683pjn.188.2022.11.14.02.38.49; Mon, 14 Nov 2022 02:39:02 -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=Pz4b01vd; 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 S236484AbiKNKbu (ORCPT + 99 others); Mon, 14 Nov 2022 05:31:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236564AbiKNKbP (ORCPT ); Mon, 14 Nov 2022 05:31:15 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B55714D2C for ; Mon, 14 Nov 2022 02:31:13 -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 2AE8Wcie019990; Mon, 14 Nov 2022 04:29:59 -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=wR8WznTLjHtXuxSzrfRxj5uzxnQfyrE3rhFbBYPUl9E=; b=Pz4b01vd4pkAmDey1/iXQitssuwC7GwX/0K9JnvGvgzq+o8fE3FKSzfVCrzQ8Jc8bLdH hUZSQjs7aVA0wl0SY5u41xvH6fdat2Wubil7qfcEUfs9dZQ3KTbUesGKBmTQyQFnxmGC CaKTjyNWg9bPUOBXfPX6p5I7RVetKAbVq68YEF28OxaYf5e9Qyzy5eI30XtRmrsNR3C0 zEr97UTqDoo65QFwA6CpB4DA0ybLEgHy07ISEsYOJSeJ2ryxUpVICeaRcVYBvHHCjexb 7CQ+/rz5wt7GIMPpJhiwKZUDjCrLGKKpBh2AmtA1srIZGO+B0LUVym/B/Ge74BkQwZdG uA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kt8sst0cm-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 04:29:59 -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.15; Mon, 14 Nov 2022 04:29:56 -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.15 via Frontend Transport; Mon, 14 Nov 2022 04:29:56 -0600 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 66CF8B2F; Mon, 14 Nov 2022 10:29:56 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 3/4] soundwire: debugfs: Switch to sdw_read_no_pm Date: Mon, 14 Nov 2022 10:29:55 +0000 Message-ID: <20221114102956.914468-4-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> References: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: Q3wEA4SA0jb2CYzwI9IxJadDNNpQfAj0 X-Proofpoint-ORIG-GUID: Q3wEA4SA0jb2CYzwI9IxJadDNNpQfAj0 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?1749467625568582166?= X-GMAIL-MSGID: =?utf-8?q?1749467625568582166?= It is rather inefficient to be constantly enabling/disabling the PM runtime as we print out each individual register, switch to holding a PM runtime reference across the whole register output. Signed-off-by: Charles Keepax --- drivers/soundwire/debugfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c index 49900cd207bc7..0718e9cda138a 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,10 @@ 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) + return ret; + ret = scnprintf(buf, RD_BUF, "Register Value\n"); /* DP0 non-banked registers */ @@ -112,6 +117,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 14 10:29:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 19666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2073374wru; Mon, 14 Nov 2022 02:38:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf6R/pa92QfsV0sP06rW6zlnvJDF4ztjyPFiX5jPVi/fGqToVPcXucu3w9vd3bWLhlt2zIQA X-Received: by 2002:a17:903:1305:b0:185:3ecb:d464 with SMTP id iy5-20020a170903130500b001853ecbd464mr13441304plb.78.1668422319870; Mon, 14 Nov 2022 02:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422319; cv=none; d=google.com; s=arc-20160816; b=gtAz5Mqjru1I7MSS43Cyy7ToEyl4BtRNELl4+lY+4D7YW4I2cQFtKh6EIDeu7SFANi ymZfnRrFoMX7qPzio5k3R/wwMwrMwph+BnUhKMcfbfD7vCvQI6Hy85yo6WluMARYfWnP xlNIVSVXoLXRj0CtAGyrRGLaNny/PghtzEkHK3/DI/BvFEjjHv98pR7Gf0Kx2Is8wAjJ QZueLcyieO8WwVu2p8kyOYmLTzuu7bdu4ZFJxgrgbzvPBV3UxnOCdPxW2KLZWj2LLBZj JKyjTAUeOvtwlJTlUaMfMe3TLkFRa8KF6nXt4QyCWjmtzh8UWqUcR1ZGDaxg7VVpNv4f wvyg== 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=MkrQQO/rMS+/NwhSJyDSR/0qlVfWLkI1ekIUmlwClk8=; b=riPY0/sKWiiLPOvcdU4hT3Orb2nypyVvi+dZP95RJ91R0hP/0cy1cUnmiWuDSJqR5o S9vVesfwNZcJknb4dQdmIMvQ9zlkDt1yaMQOnI6uqfiRFo2ET4qI5LcLB7koKFljj7cy VmU7shyByh3LoTkZai/cMjnm3gfjfkQXVuh+zLv80wtu+qgVscuHgnQRN3q0LE6trRKt wwmC3rR4zT2Jt1SwZw8NoTZXx4g4W4ZMvGrs9LWbuw5Mgi+RXDP5oNp+ptaa78qmqVEg tWrtSzCSxFoVeJdKMoWV+BpAnd4bUxYjgIK+rjkOoC/EAhI0ethWQGItX4a6y6o8DjrM i05w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=SYjzWDkt; 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 h69-20020a638348000000b0045f5e2b350esi8610219pge.466.2022.11.14.02.38.26; Mon, 14 Nov 2022 02:38:39 -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=SYjzWDkt; 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 S235633AbiKNKaj (ORCPT + 99 others); Mon, 14 Nov 2022 05:30:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236314AbiKNKaQ (ORCPT ); Mon, 14 Nov 2022 05:30:16 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26486F596 for ; Mon, 14 Nov 2022 02:30:14 -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 2AE8Wcif019990; Mon, 14 Nov 2022 04:29:59 -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=MkrQQO/rMS+/NwhSJyDSR/0qlVfWLkI1ekIUmlwClk8=; b=SYjzWDktP9/zUEfocjVG8Y3be1bsi3Fxyx86bZz53nw2Kex4jsTM35cak8qy1xMgPXxC ZkgAniXvMIxFgtQWLE7Xa3nrvTb2uPgR+//veGNk4+CHIZrNp9csyS7+/wXKcabQBqgC bXi9kUVAOO7i0CKTb2FSWHh8cPP8EIzx2f4X7oDFpXGLB2oD+j666g3bV1sZzIbh4RXL P/vaVS8IHm1F9xYua546bN01k1vcM90ToqPAj90qTzZiDTQ8dn9ROinTsvPkJspdNlj6 MSj4N0gyGBoPOuh2+ypiee3QP491VFctzqvoacBOmlweCta7Bl3lPcdZGPqx6bR0eZY7 sQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3kt8sst0cm-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 04:29:59 -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.15; Mon, 14 Nov 2022 04:29:56 -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.15 via Frontend Transport; Mon, 14 Nov 2022 04:29:56 -0600 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 6C48EB38; Mon, 14 Nov 2022 10:29:56 +0000 (UTC) From: Charles Keepax To: CC: , , , , , Subject: [PATCH 4/4] soundwire: stream: Move remaining register accesses over to no_pm Date: Mon, 14 Nov 2022 10:29:56 +0000 Message-ID: <20221114102956.914468-5-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> References: <20221114102956.914468-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: eEFxQxHBInaqwQyfmT2KyYsPujWPgq8T X-Proofpoint-ORIG-GUID: eEFxQxHBInaqwQyfmT2KyYsPujWPgq8T 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?1749467602433385301?= X-GMAIL-MSGID: =?utf-8?q?1749467602433385301?= 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. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart --- 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,