From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
herve.codina@bootlin.com, christophercordahi@nanometrics.ca
Subject: Re: [PATCH 13/13] ASoC: ti: davinci-i2s: Opitonally drive DX pin during capture streams
Date: Wed, 20 Mar 2024 09:52:37 +0100 [thread overview]
Message-ID: <0bb26153-8bcb-475f-8892-5eb925fec538@bootlin.com> (raw)
In-Reply-To: <00182d1d-ef29-457f-9e3e-6e9b57592118@gmail.com>
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.
> 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.
>> 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.
>>
>> 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.
I'll integrate your feedback about the code in next iteration, thank
you.
Best regards,
Bastien
next prev parent reply other threads:[~2024-03-20 8:52 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 11:27 [PATCH 00/13] ASoC: ti: davinci-i2s: Add features to McBSP driver Bastien Curutchet
2024-03-15 11:27 ` [PATCH 01/13] ASoC: dt-bindings: davinci-mcbsp: convert McBSP bindings to yaml schema Bastien Curutchet
2024-03-17 20:04 ` Rob Herring
2024-03-15 11:27 ` [PATCH 02/13] ASoC: dt-bindings: davinci-mcbsp: Add new properties Bastien Curutchet
2024-03-17 20:06 ` Rob Herring
2024-03-15 11:27 ` [PATCH 03/13] ASoC: ti: davinci-i2s: Remove the unused clk_input_pin attribute Bastien Curutchet
2024-03-15 11:27 ` [PATCH 04/13] ASoC: ti: davinci-i2s: Replace dev_err with dev_err_probe Bastien Curutchet
2024-03-15 14:07 ` Mark Brown
2024-03-15 14:23 ` Herve Codina
2024-03-15 14:40 ` Mark Brown
2024-03-18 7:40 ` Bastien Curutchet
2024-03-18 13:28 ` Mark Brown
2024-03-15 11:27 ` [PATCH 05/13] ASoC: ti: davinci-i2s: Use external clock to drive sample rate generator Bastien Curutchet
2024-03-15 11:27 ` [PATCH 06/13] ASoC: ti: davinci-i2s: Delete unnecessary assignment Bastien Curutchet
2024-03-15 11:27 ` [PATCH 07/13] ASoC: ti: davinci-i2s: Add TDM support Bastien Curutchet
2024-03-19 15:57 ` Péter Ujfalusi
2024-03-20 7:31 ` Bastien Curutchet
2024-03-20 15:14 ` Péter Ujfalusi
2024-03-15 11:27 ` [PATCH 08/13] ASoC: ti: davinci-i2s: Add handling of BP_FC format Bastien Curutchet
2024-03-15 11:27 ` [PATCH 09/13] ASoC: ti: davinci-i2s: Enable unexpected frame pulses detection Bastien Curutchet
2024-03-15 14:09 ` Mark Brown
2024-03-15 14:45 ` Bastien Curutchet
2024-03-15 14:54 ` Mark Brown
2024-03-15 11:27 ` [PATCH 10/13] ASoC: ti: davinci-i2s: Make free-running mode optional Bastien Curutchet
2024-03-15 14:10 ` Mark Brown
2024-03-15 11:27 ` [PATCH 11/13] ASoC: ti: davinci-i2s: Add S24_LE to supported formats Bastien Curutchet
2024-03-15 11:27 ` [PATCH 12/13] ASoC: dt-bindings: davinic-mcbsp: Add the 'ti,drive-dx' property Bastien Curutchet
2024-03-17 20:10 ` Rob Herring
2024-03-19 18:02 ` Péter Ujfalusi
2024-03-20 7:46 ` Bastien Curutchet
2024-03-15 11:27 ` [PATCH 13/13] ASoC: ti: davinci-i2s: Opitonally drive DX pin during capture streams Bastien Curutchet
2024-03-19 18:29 ` Péter Ujfalusi
2024-03-20 8:52 ` Bastien Curutchet [this message]
2024-03-20 15:42 ` Péter Ujfalusi
2024-03-20 20:30 ` Péter Ujfalusi
2024-03-21 15:14 ` Bastien Curutchet
2024-03-21 18:31 ` Péter Ujfalusi
2024-03-22 8:58 ` Bastien Curutchet
2024-03-29 13:24 ` Bastien Curutchet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0bb26153-8bcb-475f-8892-5eb925fec538@bootlin.com \
--to=bastien.curutchet@bootlin.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=christophercordahi@nanometrics.ca \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=herve.codina@bootlin.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@gmail.com \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox