diff options
| author | Valerio Setti <vsetti@baylibre.com> | 2026-07-10 23:09:50 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-07-27 14:39:23 +0100 |
| commit | df3c987ab3d70146e2c657bc50efe8737aa4da28 (patch) | |
| tree | d58de2d62bd9696a6e945183394930a46a5e56ed /include/uapi | |
| parent | 6b44ad3ec83b4f06bb6959f4e75998c7d7f7f070 (diff) | |
| download | linux-df3c987ab3d70146e2c657bc50efe8737aa4da28.tar.gz linux-df3c987ab3d70146e2c657bc50efe8737aa4da28.zip | |
ASoC: meson: aiu-encoder-i2s: reflect bs quirk in hw constraints
Currently the only check for bs-quirk is implemented in hw_params(), but
this is too late: nothing in the refined hw parameters hints at the
restriction, so userspace has no way to know the configuration is
invalid until the setup fails, as Jerome pointed out during review [1].
Add hw rules on CHANNELS and SAMPLE_BITS at startup() so that the
restriction shows up during parameter refinement instead. The rules
are refined against the committed configuration of the opposite
stream:
- if it uses the quirk, the current stream is narrowed to the same
8ch/16-bit configuration;
- otherwise, selecting a 16-bit physical width limits the stream to
2 channels, and selecting 8 channels requires a physical width
larger than 16 bits.
The rules key on the physical width while the quirk is defined on the
significant bits. This is safe because S16_LE is the only format
supported by the encoder where both are 16 bits.
The check in aiu_encoder_i2s_set_clocks() is kept as the last backstop:
both streams may be refined concurrently before either commits its
configuration.
The rules are only registered on GX platforms where the bs-quirk exists
and only when the DAI has a stream in the opposite direction.
[1] https://lore.kernel.org/r/1jik7pebk7.fsf@starbuckisacylon.baylibre.com/
Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Link: https://lore.kernel.org/r/1jik7pebk7.fsf@starbuckisacylon.baylibre.com/
Link: https://patch.msgid.link/20260710-aiu-improve-quirk-check-v1-2-2fdd1b6f8896@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions
