From mboxrd@z Thu Jan 1 00:00:00 1970 From: sugar Subject: Re: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support Date: Wed, 7 Oct 2015 16:01:38 +0800 Message-ID: <5614D162.3020500@rock-chips.com> References: <1442979683-9441-1-git-send-email-sugar.zhang@rock-chips.com> <1442979683-9441-2-git-send-email-sugar.zhang@rock-chips.com> <20150923162433.GQ30445@sirena.org.uk> <5608F74C.3000104@rock-chips.com> <20150930184655.GX15635@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.139]) by alsa0.perex.cz (Postfix) with ESMTP id DE5622658CB for ; Wed, 7 Oct 2015 10:01:45 +0200 (CEST) In-Reply-To: <20150930184655.GX15635@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, heiko@sntech.de, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, tiwai@suse.com, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org List-Id: alsa-devel@alsa-project.org U29ycnkgZm9yIGxhdGUgcmVwbHksIHdlIHdlcmUgaW4gdGhlIE5hdGlvbmFsIERheSBIb2xpZGF5 LgoK5ZyoIDEwLzEvMjAxNSAwMjo0NiwgTWFyayBCcm93biDlhpnpgZM6Cj4gT24gTW9uLCBTZXAg MjgsIDIwMTUgYXQgMDQ6MTY6MTJQTSArMDgwMCwgc3VnYXIgd3JvdGU6Cj4+IOWcqCA5LzI0LzIw MTUgMDA6MjQsIE1hcmsgQnJvd24g5YaZ6YGTOgo+Cj4+PiBNeSBpbml0aWFsIHRob3VnaHQgaGVy ZSBpcyB0aGF0IHRoZSBtYWNoaW5lIGRyaXZlciBzaG91bGQgYmUgcmVzcG9uc2libGUKPj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GUgc3ltbWV0cmljX3JhdGVzIGZsYWcgY2FuJ3QgYmUgdXNl ZCB0byBjb3Zlcgo+IHRoaXMgY2FzZT8gIFdoYXQgeW91IGRlc2NyaWJlIGFib3ZlIGlzIGh0ZSBu b3JtYWwgcmVhc29uIGZvciBuZWVkaW5nIHRvCj4gZW5mb3JjZSBzeW1tZXRyaWNfcmF0ZXMuICBU aGUgZHJpdmVyIHNob3VsZCBiZSBhYmxlIHRvIGNoZWNrIGlmIHRoZSBmbGFnCj4gaGFzIGJlZW4g c2V0IGp1c3QgYXMgd2VsbCBhcyB0aGUgY29yZSBpcy4KPgoKR290IGl0LCBIb3cgYWJvdXQgdGhl IGZvbGxvd2luZyBtb2RpZnk/CgppZiAoZGFpLT5zeW1tZXRyaWNfcmF0ZXMpCglyZWdtYXBfdXBk YXRlX2JpdHMoaTJzLT5yZWdtYXAsIEkyU19DS1IsCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBJMlNfQ0tSX1RSQ01fTUFTSywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEkyU19DS1Jf VFJDTSh2YWwpKTsKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fXwpBbHNhLWRldmVsIG1haWxpbmcgbGlzdApBbHNhLWRldmVsQGFsc2EtcHJvamVjdC5vcmcK aHR0cDovL21haWxtYW4uYWxzYS1wcm9qZWN0Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL2Fsc2EtZGV2 ZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: sugar.zhang@rock-chips.com (sugar) Date: Wed, 7 Oct 2015 16:01:38 +0800 Subject: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support In-Reply-To: <20150930184655.GX15635@sirena.org.uk> References: <1442979683-9441-1-git-send-email-sugar.zhang@rock-chips.com> <1442979683-9441-2-git-send-email-sugar.zhang@rock-chips.com> <20150923162433.GQ30445@sirena.org.uk> <5608F74C.3000104@rock-chips.com> <20150930184655.GX15635@sirena.org.uk> Message-ID: <5614D162.3020500@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Sorry for late reply, we were in the National Day Holiday. ? 10/1/2015 02:46, Mark Brown ??: > On Mon, Sep 28, 2015 at 04:16:12PM +0800, sugar wrote: >> ? 9/24/2015 00:24, Mark Brown ??: > >>> My initial thought here is that the machine driver should be responsible >>> for setting this and then the DAI driver should check to see if >>> symmetric_rates are in use and configure itself appropriately. Is there >>> a reason why this won't work here? > >> It's for i2s ip configuration, in the most situation, there is no need >> to use this property, except one case: > >> In order to save gpio pins for other function use, we may use single >> lrck(tx or rx) pin. of course, it depends on product design. when in i2s >> slave mode, we need to configure this to share lrck with tx/rx inside i2s >> logic. > >> symmetric_rates flag works fine on rockchip platform, but it can't cover the >> above case. > >> Do you have any suggestion about this or maybe there is no need to upstream >> this special part? > > What makes you say that the symmetric_rates flag can't be used to cover > this case? What you describe above is hte normal reason for needing to > enforce symmetric_rates. The driver should be able to check if the flag > has been set just as well as the core is. > Got it, How about the following modify? if (dai->symmetric_rates) regmap_update_bits(i2s->regmap, I2S_CKR, I2S_CKR_TRCM_MASK, I2S_CKR_TRCM(val)); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbbJGICI (ORCPT ); Wed, 7 Oct 2015 04:02:08 -0400 Received: from regular2.263xmail.com ([211.157.152.4]:39839 "EHLO regular2.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987AbbJGICF (ORCPT ); Wed, 7 Oct 2015 04:02:05 -0400 X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:0;SPF:S; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ADDR-CHECKED: 0 X-RL-SENDER: sugar.zhang@rock-chips.com X-FST-TO: linux-arm-kernel@lists.infradead.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: sugar.zhang@rock-chips.com X-UNIQUE-TAG: <9a4b15ef36e60849cab89d21d92a2b26> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH 1/2] ASoC: rockchip: i2s: add 8 channels capture and lrck-mode support To: Mark Brown References: <1442979683-9441-1-git-send-email-sugar.zhang@rock-chips.com> <1442979683-9441-2-git-send-email-sugar.zhang@rock-chips.com> <20150923162433.GQ30445@sirena.org.uk> <5608F74C.3000104@rock-chips.com> <20150930184655.GX15635@sirena.org.uk> Cc: alsa-devel@alsa-project.org, heiko@sntech.de, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, linux-rockchip@lists.infradead.org, perex@perex.cz, linux-arm-kernel@lists.infradead.org From: sugar Message-ID: <5614D162.3020500@rock-chips.com> Date: Wed, 7 Oct 2015 16:01:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150930184655.GX15635@sirena.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for late reply, we were in the National Day Holiday. 在 10/1/2015 02:46, Mark Brown 写道: > On Mon, Sep 28, 2015 at 04:16:12PM +0800, sugar wrote: >> 在 9/24/2015 00:24, Mark Brown 写道: > >>> My initial thought here is that the machine driver should be responsible >>> for setting this and then the DAI driver should check to see if >>> symmetric_rates are in use and configure itself appropriately. Is there >>> a reason why this won't work here? > >> It's for i2s ip configuration, in the most situation, there is no need >> to use this property, except one case: > >> In order to save gpio pins for other function use, we may use single >> lrck(tx or rx) pin. of course, it depends on product design. when in i2s >> slave mode, we need to configure this to share lrck with tx/rx inside i2s >> logic. > >> symmetric_rates flag works fine on rockchip platform, but it can't cover the >> above case. > >> Do you have any suggestion about this or maybe there is no need to upstream >> this special part? > > What makes you say that the symmetric_rates flag can't be used to cover > this case? What you describe above is hte normal reason for needing to > enforce symmetric_rates. The driver should be able to check if the flag > has been set just as well as the core is. > Got it, How about the following modify? if (dai->symmetric_rates) regmap_update_bits(i2s->regmap, I2S_CKR, I2S_CKR_TRCM_MASK, I2S_CKR_TRCM(val));