Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1602845lqt; Wed, 20 Mar 2024 08:40:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxf0h/K8IMEoBw/8tH2DazDpKyW2nFbwM6UaIUjN/360LznsOLSlcbdR7ZyWyScPiJlYG0kJtRhj/msBqOg6gZmY5kewy8gtp5cfKhwg== X-Google-Smtp-Source: AGHT+IF4Db/aE+mAPb1UzocrJ6ndlvq1iAxDOMKMy6egLhflQMd+p4E+NKMeTUPKsqV/ZT1UQcU7 X-Received: by 2002:a05:6a00:2e96:b0:6e6:136b:f41 with SMTP id fd22-20020a056a002e9600b006e6136b0f41mr20428425pfb.3.1710949238258; Wed, 20 Mar 2024 08:40:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710949238; cv=pass; d=google.com; s=arc-20160816; b=MQOylfsqQvbWuhAxAuvzlCmzfldYU4qXTY3kg8vzmmsy441FRDfUQlb16l6QyJm2QR 8d1uIFP3aeu5RKp4wiTTEJVpCOGlqAj+FstVsYu3Qsm3+EH8acR+mpGx/EY6jcgfuYHY JnBS+zRg1xKSCR/YRO2dvTi1aBfJAqIctoJ29H6CqjDAixswhNdPH2CNvdtPEPQPJUam xo8QXwHFmRht0YA/wFrTbmPy+2qEhfSrbzZi7j1Pk5nJnLeEDh+JazOspRSHXV6VKad+ nkbpzSQ7XBjM1sQ9F0MxaIIguUO78sJkR9y9d28oFhtnPievBp+8iShQJ4+dVqUpqR8j LFqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=jxYGnvFML+VTUWkD++QvXGadpkGwkGYbiArVcV37wmI=; fh=7dJBgcR0I8YSZwFXO9dzjGoh4ssAulMC9SWSKlhQjCA=; b=ZoCLtzjDiWxWdvF4XpOGMg/ffq5il6oxA5j/zT72M7XiKGgxIYIjjF2TUruDGe3M32 xY9YjpXPfU6L3mFWZE1huCM9bvTVqAsr9ACIVkv3yn9TzXHXTMymVJh7ven/tRA5LlMw 2rrMApTdY4ZV7yS4iS0XxMRxbeY0y3rEfhVT/TppNy4JP0mc0AVPzj8ZVfPTaHyIdygw OOZmV8vmbuPu5oz3kUwC9uEO5pZ27ojCbv2sMclgpRiVuT3Tf+86Uyue8OWxlv1uMdgo Ln6AhLUqQsq1hvnntN8ROwNvnC2EPFRxpdEaEs0HxT1aOOxl62z0ZEVFmr+f9U1Kbvc6 pdcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q6wC8N0T; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-109109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fa28-20020a056a002d1c00b006e6b5510f84si14114250pfb.252.2024.03.20.08.40.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 08:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q6wC8N0T; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-109109-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B1629B2299C for ; Wed, 20 Mar 2024 15:40:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8156535D0; Wed, 20 Mar 2024 15:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q6wC8N0T" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C17239AF4; Wed, 20 Mar 2024 15:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710949227; cv=none; b=YwRjpNl5W5MVOI0UWF/Q8jO25QpkgrLwv5lXWH+FFTGr6NQv4m1yGvbdO5TCB7e4q/KzGa0coJk6Vdkktzmq7oQ7z9VdtIUbHA6mHl632rx39rLaEH/4rDFzb6u0UFjl1StS2D4znWeZPNkh6GhNfbiAoctLgXx8EfHnZ1VGE74= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710949227; c=relaxed/simple; bh=yBSdj607UAc5s+hvP7CPVuKFZYFu/uVZGG+qtqxl8+I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NFkDPaiiX3vk9yWRW4BCLXUqEEu7vsVrrh/QnRSiv04aTRDGqRWJ2gbd8tL9udI0Ky8moQXU7M8yX6FmHuu9NwJaE6UUp0tIPGs9rFMjupe8s2u5HmUra1q++M5lXnYrXpUBMpJ07YSJfPo+Y/sddcDeajMPF44U/vVQdROyWB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q6wC8N0T; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d41d1bedc9so121421681fa.3; Wed, 20 Mar 2024 08:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710949224; x=1711554024; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jxYGnvFML+VTUWkD++QvXGadpkGwkGYbiArVcV37wmI=; b=Q6wC8N0TbpvdQ8+2lbGY6AnO8TbzfuGgOJDNnnaIyyO1lMn4wPdyAObUhr9I6lo2vJ JoayA2WtV49LxGzzXxKni1rXMdK5MdTY/LEZhqBcoGkyuRVefEqVz48p0sC0wkhSz/Pq qOfQndGyWae6/2RKUs7i5pZcSkZNRNhe2zx3J+/jL4tJomvI3QNahQqnngBIpXji4iL5 +Cx/cbnn7K/cwC/nC+lbQCqfpitbfzfv6M8lgpr7rInFxHae2O/rS5z0McO3fJpnVKir rG2Q5JBJCrztRqm21meWviO3q3SVvIfy7hGnqlVuSEPIgFqa2l30R6FcAYTnEKQm41Rl h/jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710949224; x=1711554024; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jxYGnvFML+VTUWkD++QvXGadpkGwkGYbiArVcV37wmI=; b=OyBmJcNdRzjYhexnX+tuGLRq9aBNTrd8oMXKDjsHD0JES7rffTP9NFdSwUaYx8OPHE 16v8gdUXxydNzPHGo7SjBnDmZjNMF0pYkgIdvZrWB2Mu/2j9flEPPpfGNYOFAN74SB2u c4ZWoV0wBhfHb7aW3zMesjCcevpHAjmjX3cYlLCqRMACh7fwY06BTRCL/m8Q/mkPAIhM XNHmmPuQqGvliG4dNXtwMgYQItYFukS8o4yYXF19wg90Blc48BG0SbBOW1e9250eDMAS UWHgK//HiwI5s8VluIGrCnf+u0NCTy8pRHBnopaYeAxOLpCmNIAJ7VwxhMiJj00zfufY GoWw== X-Forwarded-Encrypted: i=1; AJvYcCV2ZO8HGxPbpbwah08lqnwwpyUlOp8fmo4U06l+n5BQlkb0JHLQDCMGq7EiK7AsXkxb/wRRv3uBsPPA2ft+gdN26AjyhbUYabqmrgYdK5kaELlHxoaAiqFyqdkyO7h1+4QjaJNINbV2Bg== X-Gm-Message-State: AOJu0YzyoRvHzdbZVkT7bZTLNhW/tNUC16IudDRbSWWMh8P5Erfe1L2D jKjB9GWlKeDmCzGTdgTcpb4zgPBAI6Se5kvehcNhHY1wV2IRriQh X-Received: by 2002:a05:651c:388:b0:2d4:707d:8b3c with SMTP id e8-20020a05651c038800b002d4707d8b3cmr10212936ljp.18.1710949223984; Wed, 20 Mar 2024 08:40:23 -0700 (PDT) Received: from ?IPV6:2001:999:708:5b57:30d6:2195:bb7b:bb94? ([2001:999:708:5b57:30d6:2195:bb7b:bb94]) by smtp.gmail.com with ESMTPSA id v23-20020a2e87d7000000b002d2b76dd76esm2196040ljj.57.2024.03.20.08.40.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Mar 2024 08:40:23 -0700 (PDT) Message-ID: <7925bbe5-17e8-42cb-a5f0-4f3e06810a90@gmail.com> Date: Wed, 20 Mar 2024 17:42:05 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 13/13] ASoC: ti: davinci-i2s: Opitonally drive DX pin during capture streams Content-Language: en-US To: Bastien Curutchet , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Thomas Petazzoni , herve.codina@bootlin.com, christophercordahi@nanometrics.ca References: <20240315112745.63230-1-bastien.curutchet@bootlin.com> <20240315112745.63230-14-bastien.curutchet@bootlin.com> <00182d1d-ef29-457f-9e3e-6e9b57592118@gmail.com> <0bb26153-8bcb-475f-8892-5eb925fec538@bootlin.com> From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= In-Reply-To: <0bb26153-8bcb-475f-8892-5eb925fec538@bootlin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Bastien, On 20/03/2024 10:52, Bastien Curutchet wrote: > Hi Péter, > > On 3/19/24 19:29, Péter Ujfalusi wrote: >> >> >> On 15/03/2024 13:27, Bastien Curutchet wrote: >>> The McBSP's DX pin that outputs serial data during playback streams can >>> be used during capture streams to repeatedly output a chosen pattern. >>> For instance, this can be useful to drive an active-low signal during >>> captures (by choosing <0> as output pattern). >> >> Are there really any other use of this than to pull down or up the DX >> pin (0 or 0xffff) > > I don't know, indeed today I can only think about these two patterns. > I tried to do something in a 'generic' way so it can evolve if needed. I think the definition of the 'ti,drive-dx' is somehow odd. It allows you to set it to 0x1234 and the DX pin will show 0x1234 when you capture 32bit. If you capture 16bit then it will transmit 0x12 (or 0x34?), no? If you have 4 channel capture then I won't speculate what will be on the DX pin ;) Would not be better to say that the DX pin will be driven low or high during capture _and_ disable the playback support? > >> If you just use the pin as GPIO then you don't need to change anything >> in the driver, The playback would not erach the pin, so no need to >> block it. >> >>> Enable this behaviour when the device-tree property 'ti,drive-dx' is >>> present. DX pin is driven with the provided pattern every time a >>> capture stream is launched. >> >> It is an interesting use of the hardware... You are controlling an >> external device (light an LED when capture is on)? > > Yes I control the chip select pin of the ADC that is sending data to DR > pin, that's why I need the DX pin to be synchronized with capture > streams. I see. Still a a novel use of a feature ;) > >>> This property is not compatible with classic playback stream so >>> davinci_i2s_trigger() returns an error if a playback stream is started >>> while 'ti,drive-dx' flag is present. >> >> Propbaly add the .startup() callback and block the playback right there? >> > > Ok, TBH my mastery of the sound subsystem is not high enough to have an > opinion of where this should go so I'll trust you on this. It would be more elegant to only create PCM for the capture in this case, but I would not bother with it. Stopping user right at startup time is second better. >>> >>> This has been tested on a board designed of a DAVINCI/OMAP-L138 where >>> the DX pin is linked to the chip select pin of the converters of the >>> capture side. >> >> Isn't the DX will be pulled down as soon as the McBSP is enabled? >> Can you just re-configure the PUPD_SEL for the pin group to make the pin >> to be pulled the other way? >> > > Well, the acquisition chain in my use case is a bit convoluted. The DX > pin's main purpose is to drive ADC chip select but it is also connected > to other components and all this needs synchronization upon captures. OK, thanks for the explanation. -- Péter