[PATCH 08/13] drm/i2c: tda998x: move audio routing configuration
Sven Van Asbroeck
thesven73 at gmail.com
Wed Jun 12 15:36:59 UTC 2019
On Tue, Jun 11, 2019 at 7:02 AM Russell King <rmk+kernel at armlinux.org.uk> wrote:
>
> Move the mux and clocking selection out of tda998x_configure_audio()
> into the parent functions, so we can validate this when parameters
> are set outside of the audio mutex.
>
> Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
> ---
+/* Configure the TDA998x audio data and clock routing. */
+static int tda998x_derive_routing(struct tda998x_priv *priv,
+ struct tda998x_audio_settings *s,
+ unsigned int route)
+{
+ s->route = &tda998x_audio_route[route];
+ s->ena_ap = priv->audio_port_enable[route];
+ if (s->ena_ap == 0) {
+ dev_err(&priv->hdmi->dev, "no audio configuration found\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
Nit: priv is nearly unused in this function.
Maybe delegate the error log to the caller, in that case we could just pass
route and const audio_port_enable to the function. Instead of passing in the
'kitchen sink' priv ?
More information about the dri-devel
mailing list