[alsa-devel] [PATCH 06/10] ALSA: Add firmware caching to CA0132 codec.

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Sep 25 13:26:35 CEST 2012

On Thu, Sep 20, 2012 at 08:29:17PM -0700, Ian Minett wrote:

> +static int request_firmware_cached(const struct firmware **firmware_p,
> +	const char *name, struct device *device)
> +{
> +	if (*firmware_p)
> +		return 0;  /* already loaded */
> +	return request_firmware(firmware_p, name, device);
> +}

This looks *awfully* like it should be a part of the generic firmware
loading infrastructure rather than driver local (the name of the
function is even likely to collide with something in the core code).

More generally, why is this driver different to other Linux drivers
which don't normally cache the firmware?  There's some uses for this
(see all the hassle with suspend and resume on USB devices...) so it
seems like it'd be useful to have in the framework, possibly as the
default behaviour and probably with a mechanism to discard the firmware.

More information about the Alsa-devel mailing list