Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp22020pxv; Tue, 13 Jul 2021 20:26:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0yQAzV94UX77UvQuHPKcWkY1LJY+FJi1+1w8HwhjvKnnAHocpY3v1yH+w9w8sYCEIN9DI X-Received: by 2002:a50:ff09:: with SMTP id a9mr10188741edu.368.1626233219327; Tue, 13 Jul 2021 20:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626233219; cv=none; d=google.com; s=arc-20160816; b=tmTJRM6UeaCm4qAwKNw5u9sD9JloQyQIw+EmOjX5MlH8lbcf5dD0PnV3pMY2B1aRT6 Km7wN+xqfxLENvvYm3W/QBcp/j3UdVpBd8fI4Gbi1eqkDszEJ0S2IDzhFJxkDI4cP5v/ rDr1E3S9oSH52kXij4Lg5x1qvrS5+uHz2PmpvbI33z9ThEUtC2BfKjuidgXS2+bjxxNN 8tCNwzejnAVAI8/IhnLIslku3PJ+z7UKwwYBVMYUNhiGRloLuznvjuzrFqWsPR49COLF NwTwdwaoLf0M40BSxCXYncXhBWVRGlVhpWgsmad4udcuaZSLIaYq6+9asvrNoGxIm4J7 ZJ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=farcZx+W25kQ5KcqqgR9Po+SauyUnPUuXkH4RZZRPs0=; b=a9qZmqzSsz5+NTNE9twDbFwD7xLnh8OgDksvpqeCaa1LNUbQ2rovUF7ryS3Mevd60I mD0lMFS090yzretszUbv/Ke8/WBdLpKj8EkHOLTDXc7LvNSki/eBvTUo1R/ljj/spKdX Wia5kpuTKuirsCyP8WX790RNg/vYh8WOl46lONsVeyfija4m1YgvFWVGD27tZpDCgXoH DKCa8ixwXARctisI+MGUZ2eE9h7/Ph1fJDKfd0vvpqOxTpO35L3WvEIEg8rqSL/zT0Pu ldbzm8xkIx4/uPao5Pban43E6I4D+79Z062noIuS90aHUtM03qQlrF9s7+KJhD5E0ANq 8S9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w21si933398edt.351.2021.07.13.20.26.36; Tue, 13 Jul 2021 20:26:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237849AbhGNDZg (ORCPT + 99 others); Tue, 13 Jul 2021 23:25:36 -0400 Received: from mga14.intel.com ([192.55.52.115]:9200 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237850AbhGNDZf (ORCPT ); Tue, 13 Jul 2021 23:25:35 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10044"; a="210095751" X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="210095751" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 20:22:43 -0700 X-IronPort-AV: E=Sophos;i="5.84,238,1620716400"; d="scan'208";a="459818176" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 20:22:36 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, srinivas.kandagatla@linaro.org, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, bard.liao@intel.com Subject: [PATCH 06/10] soundwire: add flag to ignore all command/control for mockup devices Date: Wed, 14 Jul 2021 11:22:05 +0800 Message-Id: <20210714032209.11284-7-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714032209.11284-1-yung-chuan.liao@linux.intel.com> References: <20210714032209.11284-1-yung-chuan.liao@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart SoundWire mockup devices don't take part in the command/control protocol, so all commands will complete with -ENODATA or Command_Ignored results. With a flag, we can suppress such errors in the bus management and make it appear as if all read/writes succeed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao --- include/linux/soundwire/sdw.h | 3 +++ sound/soc/codecs/sdw-mockup.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h index a48ac3e77301..76ce3f3ac0f2 100644 --- a/include/linux/soundwire/sdw.h +++ b/include/linux/soundwire/sdw.h @@ -661,6 +661,8 @@ struct sdw_slave_ops { * initialized * @first_interrupt_done: status flag tracking if the interrupt handling * for a Slave happens for the first time after enumeration + * @is_mockup_device: status flag used to squelch errors in the command/control + * protocol for SoundWire mockup devices */ struct sdw_slave { struct sdw_slave_id id; @@ -683,6 +685,7 @@ struct sdw_slave { struct completion initialization_complete; u32 unattach_request; bool first_interrupt_done; + bool is_mockup_device; }; #define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev) diff --git a/sound/soc/codecs/sdw-mockup.c b/sound/soc/codecs/sdw-mockup.c index a4f79eb2c69d..8ea13cfa9f8e 100644 --- a/sound/soc/codecs/sdw-mockup.c +++ b/sound/soc/codecs/sdw-mockup.c @@ -263,6 +263,8 @@ static int sdw_mockup_sdw_probe(struct sdw_slave *slave, dev_set_drvdata(dev, sdw_mockup); sdw_mockup->slave = slave; + slave->is_mockup_device = true; + ret = devm_snd_soc_register_component(dev, &snd_soc_sdw_mockup_component, sdw_mockup_dai, -- 2.17.1