On Tue, Jun 11, 2019 at 7:02 AM Russell King <rmk+ker...@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+ker...@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 ?
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to