From patchwork Fri Nov 18 02:58:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 22083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp746420wrr; Thu, 17 Nov 2022 19:00:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf47yJYLiLeGDboeprYRGEPcZAikEd3YEw4CQM9o8EofGw/M1m3zoB3h/PmewlQwzXwLWORn X-Received: by 2002:a17:902:70c9:b0:188:abb9:288 with SMTP id l9-20020a17090270c900b00188abb90288mr5467182plt.123.1668740409686; Thu, 17 Nov 2022 19:00:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668740409; cv=none; d=google.com; s=arc-20160816; b=y3kG9S+5fBm6HTRL0lXNcn4Jh+ehsuqlujmqSk6+Fcn/RlhIFCu6a+IvoTSGXTF5ck 1Zs/7DmmXhxH43UAJF+m8MugEfDaE/wOR+8MlNGmekk7spEuAu1UXXg3oycXxUJ9gc+4 ceYER1wrF4YG5r7kdTh2OTEJMQIdG8fHOO9PCeSr/FgzvhJuQFG/mWbaw+b2fycJU6Mv ooNPTCyJj1/m2hM2Nl2RbSGWWSTnuRE+/gBk+Ic8bPRir01BrnjtW1nnFrmCtfU1ROhn HqViKsDQDS6L7nT30u0vHSkh4CzZGxnpynh2fLsXZ/FIMfT2LV7vEBD4ZMf0tTtyyM4p +rBw== 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=v/uwZVZwwdM/3A1Vnqh+nrzlgDfom5V0vT0zJpmeigQ=; b=ORI5CglRSGVGEvV9/op8OeZmiei4BZ4D6pmCM18NTn5OO/Ai/U1YdE7pOsee7eWv7f yquRPg4kcvDCyE0z2aSrOHK2ZVqmJy65C7jFx6WmyGbJpolV4TiaOAelQCilLWxac4gz EGKo4EkbErVBEc61yy1iMOKtQ/DsqpSx6jv3EZA6p66yz+hq50bm1B30GXzOraAiNyMg snedXXc5V0UT0WAzpk52BXWzFyXsEMkSUYcuGozK5o8jJUFNotSIzf/vFdVFDbZ1VcL2 WiP3GJ1cvfebivjyjYLPzaoX1nx8FV1YR3unyEpaEzlaYtu6m/oSgJB/rH2lm7yACnfN 70OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Wobzqc/j"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a63f24d000000b0046eca85c48dsi2383812pgk.110.2022.11.17.18.59.56; Thu, 17 Nov 2022 19:00:09 -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=@intel.com header.s=Intel header.b="Wobzqc/j"; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234942AbiKRC4D (ORCPT + 99 others); Thu, 17 Nov 2022 21:56:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240815AbiKRCz4 (ORCPT ); Thu, 17 Nov 2022 21:55:56 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE5BC8F3C8 for ; Thu, 17 Nov 2022 18:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668740148; x=1700276148; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZsbjKmI8r3wmxokls6Yj3fJektnJREEilC4V+S5EGkY=; b=Wobzqc/jyiDO6BP/gtVvcPK8iwh40W829Vzn3jenNyT4eNrdEthV8bsC a671MQneNiK8f0ETX0kkpl5aCvDDGKYtGDaH2IoxuoquwNxQogLhNCw4l mINS6Ua8MUwthPkrXMmJnfgbhoGwPx9aEa7SHVN3C7fxFhYTloQA3XTDt y0832dYVVJm9rjQq6dq4kaOYLkvVIEdZTH0TLH/3+c9NQ2aW46CDgWZwY SMRZ6SZF51XcR43y06mt1fmqiItufXjxcFDF195i4+jHocbz28Hy4RBEX Obqu9XzGtBkHQDb9+RIeTDeZpU7/hlnQfJfzDtJFza4x7RM3ckerlNNi8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="296400628" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="296400628" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 18:55:48 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="642347884" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="642347884" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 18:55:45 -0800 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, vkoul@kernel.org, bard.liao@intel.com, peter.ujfalusi@linux.intel.com, ranjani.sridharan@linux.intel.com, vinod.koul@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] ASoC/soundwire: remove is_sdca boolean property Date: Fri, 18 Nov 2022 10:58:06 +0800 Message-Id: <20221118025807.534863-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221118025807.534863-1-yung-chuan.liao@linux.intel.com> References: <20221118025807.534863-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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?1749801143477000903?= X-GMAIL-MSGID: =?utf-8?q?1749801143477000903?= From: Pierre-Louis Bossart The Device_ID registers already tell us if a device supports the SDCA specification or not, in hindsight we never needed a property when the information is reported by both hardware and ACPI. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Acked-by: Mark Brown Reviewed-by: Charles Keepax --- drivers/soundwire/bus.c | 4 ++-- include/linux/soundwire/sdw.h | 2 -- sound/soc/codecs/rt1316-sdw.c | 1 - sound/soc/codecs/rt1318-sdw.c | 1 - sound/soc/codecs/rt711-sdca-sdw.c | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 76515c33e639..c23275b443ac 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -1587,7 +1587,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) goto io_err; } - if (slave->prop.is_sdca) { + if (slave->id.class_id) { ret = sdw_read_no_pm(slave, SDW_DP0_INT); if (ret < 0) { dev_err(&slave->dev, @@ -1724,7 +1724,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) goto io_err; } - if (slave->prop.is_sdca) { + if (slave->id.class_id) { ret = sdw_read_no_pm(slave, SDW_DP0_INT); if (ret < 0) { dev_err(&slave->dev, diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 9e4537f409c2..8fb458931772 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -365,7 +365,6 @@ struct sdw_dpn_prop { * @sink_dpn_prop: Sink Data Port N properties * @scp_int1_mask: SCP_INT1_MASK desired settings * @quirks: bitmask identifying deltas from the MIPI specification - * @is_sdca: the Slave supports the SDCA specification */ struct sdw_slave_prop { u32 mipi_revision; @@ -389,7 +388,6 @@ struct sdw_slave_prop { struct sdw_dpn_prop *sink_dpn_prop; u8 scp_int1_mask; u32 quirks; - bool is_sdca; }; #define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0) diff --git a/sound/soc/codecs/rt1316-sdw.c b/sound/soc/codecs/rt1316-sdw.c index 2db7ee6c6d33..fbc7e9c0254d 100644 --- a/sound/soc/codecs/rt1316-sdw.c +++ b/sound/soc/codecs/rt1316-sdw.c @@ -203,7 +203,6 @@ static int rt1316_read_prop(struct sdw_slave *slave) prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY; prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY; - prop->is_sdca = true; prop->paging_support = true; diff --git a/sound/soc/codecs/rt1318-sdw.c b/sound/soc/codecs/rt1318-sdw.c index f85f5ab2c6d0..8bc379215c34 100644 --- a/sound/soc/codecs/rt1318-sdw.c +++ b/sound/soc/codecs/rt1318-sdw.c @@ -353,7 +353,6 @@ static int rt1318_read_prop(struct sdw_slave *slave) prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY; prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY; - prop->is_sdca = true; prop->paging_support = true; diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c index 88a8392a58ed..693e11ed8d08 100644 --- a/sound/soc/codecs/rt711-sdca-sdw.c +++ b/sound/soc/codecs/rt711-sdca-sdw.c @@ -186,7 +186,6 @@ static int rt711_sdca_read_prop(struct sdw_slave *slave) prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY; prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY; - prop->is_sdca = true; prop->paging_support = true; From patchwork Fri Nov 18 02:58:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 22087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp759909wrr; Thu, 17 Nov 2022 19:44:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mRUK7ByShxG/qM2S0zos8D4ReLgzDJ6s8Cf09dN8HjKGsCT/D8QwHeTxw41Yr6sqx1pzd X-Received: by 2002:a63:fa45:0:b0:476:e63a:99b6 with SMTP id g5-20020a63fa45000000b00476e63a99b6mr4855220pgk.60.1668743097898; Thu, 17 Nov 2022 19:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668743097; cv=none; d=google.com; s=arc-20160816; b=ukekPUGDQuLaXlsc4dTETos/AlWw3X0B08l4UpSIlQq9L+WK92n1TGpeEPMSWbutR+ bLhoipkReJnRup9YrX0GJEgCfJp+OHOjXtr5vxnoB+Fx9KLizrJ/PgvQ9FzoATgiA9C1 /jyXA68IsUWFy1U5uBnOuiicnRzH+DmTwNV02gCMUY9WWyTIJzU6H68vPO3qmSwkcxI3 InUg5WyEpr33W53AcMh50WyMX6+uCoTaY0pmbOmqK3+FBDUFx4wuY92SRDYPFIlijamD GhYPN5e6HKdb6STOqMzIT95bEdiDUBnkJMChjqEPs/uyJIipXTn7fvz2YpEuT3ep+5iw 94RA== 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=RpKQeZmM4RI6h73te63xvfYoZcPYky5EHfvuV3XJxS8=; b=MtY+MG6wdWFwWd6dMuBDysvkvOmLuspw4H/6wkrBi5WTcMIgHozvOniO2MWQPXq6b4 no9dJrQxbXLlKmen3RBNE2CzIqtz+hlzUrI/a86rqjLb/ufMfHjvB67ZfyogODEfRqQ+ YHPytTf9Q+A3d0JXOb4Edk/v7hG27YRrj0P4x6GY/Kqwu/rpuKY5Hj1tbvVHGMHGvQ4+ 2IJgSB/Uvavj+AdOcc+QiK2REhHxseDqtt+7ZicN2IHKWQ0KmFQ8rXqAGu2zNUNPNtDG XN0E3kRr6dZHPh0Ly3blaTMExUrrTmjknTbb/9sixFkVrf79vwkeqhx0g1gqoeLyZZ1W LmDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d1rT+eaM; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a17090a4e8300b0021616a303b8si2426890pjh.83.2022.11.17.19.44.21; Thu, 17 Nov 2022 19:44:57 -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=@intel.com header.s=Intel header.b=d1rT+eaM; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240913AbiKRC4H (ORCPT + 99 others); Thu, 17 Nov 2022 21:56:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240832AbiKRCz6 (ORCPT ); Thu, 17 Nov 2022 21:55:58 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC1A48F3DB for ; Thu, 17 Nov 2022 18:55:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668740150; x=1700276150; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sFoTlN5v6r79HUZxzN2vBniRQPFO0vULAV0J7b3pGgI=; b=d1rT+eaM5kkMPiHBh6J6r6/k32GDbSdXw49xy5N4ROc0W3KI774tXeSN Ot9CUmrfDO9gW7t+cyBg2l4RHxG/sJ/vPh/1fXzLBA92b7rdwidFaaP/H ybvocJlAf3DO5VqBOdfdjFHGycKmdbyaqklagU9dXc+Q4SyGI81rBbllA JvcqiAyM2hDsR14xmNNSOqfErGBirZ45rtdYEBrrwAdeGxHYtbP5m32C+ 73475wHrTvB9dAsnxlkwoTlaHH7LbU5UGjd0mnRl8ylzBaZ9Oe7W68Mck D1Hes5u7P3p+3xLSdw1tr8jNE/tiBqAB+pbsHEJ8XM5NmuYFjWuh7B8fq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="296400633" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="296400633" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 18:55:50 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10534"; a="642347898" X-IronPort-AV: E=Sophos;i="5.96,172,1665471600"; d="scan'208";a="642347898" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2022 18:55:48 -0800 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, vkoul@kernel.org, bard.liao@intel.com, peter.ujfalusi@linux.intel.com, ranjani.sridharan@linux.intel.com, vinod.koul@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] soundwire: enable optional clock registers for SoundWire 1.2 devices Date: Fri, 18 Nov 2022 10:58:07 +0800 Message-Id: <20221118025807.534863-3-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221118025807.534863-1-yung-chuan.liao@linux.intel.com> References: <20221118025807.534863-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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?1749803963102162106?= X-GMAIL-MSGID: =?utf-8?q?1749803963102162106?= From: Pierre-Louis Bossart The bus supports the mandatory clock registers for SDCA devices, these registers can also be optionally supported by SoundWire 1.2 devices that don't follow the SDCA class specification. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Reviewed-by: Charles Keepax --- drivers/soundwire/bus.c | 7 ++++--- include/linux/soundwire/sdw.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index c23275b443ac..55d393247a0f 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -1233,10 +1233,11 @@ static int sdw_slave_set_frequency(struct sdw_slave *slave) /* * frequency base and scale registers are required for SDCA - * devices. They may also be used for 1.2+/non-SDCA devices, - * but we will need a DisCo property to cover this case + * devices. They may also be used for 1.2+/non-SDCA devices. + * Driver can set the property, we will need a DisCo property + * to discover this case from platform firmware. */ - if (!slave->id.class_id) + if (!slave->id.class_id && !slave->prop.clock_reg_supported) return 0; if (!mclk_freq) { diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index 8fb458931772..9a49263c53cf 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -365,6 +365,9 @@ struct sdw_dpn_prop { * @sink_dpn_prop: Sink Data Port N properties * @scp_int1_mask: SCP_INT1_MASK desired settings * @quirks: bitmask identifying deltas from the MIPI specification + * @clock_reg_supported: the Peripheral implements the clock base and scale + * registers introduced with the SoundWire 1.2 specification. SDCA devices + * do not need to set this boolean property as the registers are required. */ struct sdw_slave_prop { u32 mipi_revision; @@ -388,6 +391,7 @@ struct sdw_slave_prop { struct sdw_dpn_prop *sink_dpn_prop; u8 scp_int1_mask; u32 quirks; + bool clock_reg_supported; }; #define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)