From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E887CC10F27 for ; Mon, 9 Mar 2020 17:33:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C01C42253D for ; Mon, 9 Mar 2020 17:33:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gqTdXUn7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="DQxdAFgB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C01C42253D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:MIME-Version :In-Reply-To:References:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+HsphV03ftYNaeeMLsMIJYaJoGZvj4/oi2Z3MC88fK8=; b=gqTdXUn7TT2iMf uBZytnVZcr7W8J5Zm/se6hKWOdhEFUNxdpJo/o2AFNtvZoteEpFxr8IUNZlG/ja5uAowetonmfupZ 7j/r+iqEt1MnhdmpF8gtlchEOszx5FgfySPVOXXaP1Eq9LVoPc9FICWQo/w6pz6ah/ViJRnq1IzPz yGZLZxKncVDD3cA29McbOLjAFAT4DPXKCXOItilnIx+DQxikyIJ3dyY1NpIE+r+Ns29TKq0vY7eqW SlSbtYDi1jFWXCDd2FjSAfsN7iTOsK7DhP+tAndSnoUeBl1THJfsS0GPpEwUOx2Jf6jJkulhvi9G1 pJ8qVt51Z20PjBlgiSnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jBMHb-0000fo-5R; Mon, 09 Mar 2020 17:33:39 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jBMHX-0000fM-QC for linux-arm-kernel@lists.infradead.org; Mon, 09 Mar 2020 17:33:37 +0000 Received: by mail-lf1-x12b.google.com with SMTP id i19so2483705lfl.1 for ; Mon, 09 Mar 2020 10:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=bgiHSLTQXM8E0mv0SF7G09UBPAaNCg/++oKU9IO6Jv0=; b=DQxdAFgBLzOAYx5M0Q2Fh/zkVoV6kRmCETSjJWCX2qfbDblPeSMRSyXVWiyOt5Ig3w gMJcpRqwnRBelmbxOy+sO0cchBZqoMdedCWSBBTnV3n3ng/yHVlq3GqcCNbjCr0OjUSN bIhthscycsWpgsCe1Hw6pRZIVFPhvr5K67Giw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=bgiHSLTQXM8E0mv0SF7G09UBPAaNCg/++oKU9IO6Jv0=; b=cFCQQ9rYV0xmHiRCV8vMua7ptQ8qjvCx4wWXlHiF8KOIgsdi5sfBjDnmCb86XcjGk0 a7nQBHkiBJhEKWR30S4YvKoBQH9ZSsX45sl+D2mbGAI7J/flxq/zaXgN97oLdnEVBXcD Sgg7MCNcOXFuSAs525Y4p4bOmbt3RZ0U3m9qUlxpeRB3ukGVfuMsLNUIpQe+oPKXNKDD tUDi5KJ6qvBEOZg9PlA4VG9XiAtoETnHT04ebITyI9YA9/GaegXsfl0B0y6Hy/U8mgq8 MdAsFfmUdi0YqhfDu/+2ujzuSw617a6JfINJQQNcdo7Cx/xTVcwqMuCZQoGANw3U+Cgc 08ug== X-Gm-Message-State: ANhLgQ2lqEj++TD9IhcAkue5iP9FeyLwQWaGC28poiI6etOSOMxy/pnZ Kq1ryTUA22iVlxXvyD3os7qCjJfMv0hBh5gqZGKl/Q== X-Google-Smtp-Source: ADFU+vuq3eH9wkuVNiO3iVGw7rhwXN2qPoAEtL/Vxw8RjRXO3sz1OPnFMpu3+6cw1VwM6E+14wRoY4uUL6ksq3D8aLA= X-Received: by 2002:ac2:4834:: with SMTP id 20mr9943688lft.93.1583775213105; Mon, 09 Mar 2020 10:33:33 -0700 (PDT) From: Kevin Li References: <20200306222705.13309-1-kevin-ke.li@broadcom.com> <20200309123307.GE4101@sirena.org.uk> In-Reply-To: <20200309123307.GE4101@sirena.org.uk> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQK6AtPk+W1UvlC/8YJn5FlJAEq5hQGCyJpIpmw/bzA= Date: Mon, 9 Mar 2020 10:33:30 -0700 Message-ID: <69138568e9c18afa57d5edba6be9887b@mail.gmail.com> Subject: RE: [PATCH] ASoC: brcm: Add DSL/PON SoC audio driver To: Mark Brown X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200309_103335_853110_A867FC88 X-CRM114-Status: GOOD ( 11.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Kuninori Morimoto , Scott Branden , Liam Girdwood , Ray Jui , Takashi Iwai , Jaroslav Kysela , bcm-kernel-feedback-list@broadcom.com, Stephen Boyd , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mark, The SoC I2S block we currently have shares one clock and frame sync signal for both playback and capture stream, plus playback and capture can only have one master at a time. If we set playback and capture master at same time, it will have jitter on clock and FS. Based on above, for playback and capture, whichever starts first, it will be master, another stream will be slave if it starts before the first stream shutting down. So working as master or slave for a stream is depending on another stream's status. Same thing for shutting down a stream. A master stream shutting down will have to set another stream to master if another stream is on working status as a slave. A glitch/Jitter will happen at this moment. But we minimize it. That is why this master/slave mode handles in startup/shutdown functions. Not sure how other company handles this kind of I2S block. Let me know if it is still not clear. Yes, set_fmt() is not needed. Will be addressed along with rest questions you mentioned on the next patch, with a patch version. Thanks! Kevin > + struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai); > + struct regmap *regmap_i2s = i2s_priv->regmap_i2s; > + > + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { > + regmap_update_bits(regmap_i2s, I2S_TX_CFG, > + I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | > + I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, > + I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | > + I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE); > + regmap_write(regmap_i2s, I2S_TX_IRQ_CTL, 0); > + regmap_write(regmap_i2s, I2S_TX_IRQ_IFF_THLD, 0); > + regmap_write(regmap_i2s, I2S_TX_IRQ_OFF_THLD, 1); > + > + regmap_read(regmap_i2s, I2S_RX_CFG_2, &slaveMode); > + if (slaveMode & I2S_RX_SLAVE_MODE_MASK) > + regmap_update_bits(regmap_i2s, I2S_TX_CFG_2, > + I2S_TX_SLAVE_MODE_MASK, > + I2S_TX_MASTER_MODE); > + else > + regmap_update_bits(regmap_i2s, I2S_TX_CFG_2, > + I2S_TX_SLAVE_MODE_MASK, > + I2S_TX_SLAVE_MODE); Setting master or slave mode should be done with a set_fmt() operation but your set_fmt() operation was empty. How would this be configured? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel