[alsa-devel] [PATCH 2/3] ASoC: da7219: Add ACPI parsing support

Mark Brown broonie at kernel.org
Fri May 6 14:39:09 CEST 2016


On Thu, May 05, 2016 at 11:53:05AM +0100, Adam Thomson wrote:

> @@ -27,7 +28,6 @@
>  #include "da7219.h"
>  #include "da7219-aad.h"
> 
> -
>  /*
>   * Detection control
>   */

Random whitespace change.

>  static struct fwnode_handle *da7219_aad_of_named_fwhandle(struct device *dev,
>  							  const char *name)
>  {
> @@ -551,6 +571,9 @@ static struct fwnode_handle *da7219_aad_of_named_fwhandle(struct device *dev,
>  			of_node = to_of_node(child);
>  			if (of_node_cmp(of_node->name, name) == 0)
>  				return child;
> +		} else if (is_acpi_data_node(child)) {
> +			if (da7219_aad_of_acpi_node_matched(child, name))
> +				return child;
>  		}
>  	}
> 

This seems messy.  It is a function with a DT specific name that's
matching ACPI stuff and the fwnode API isn't hiding anything for us
which suggests this isn't something that's expected to work
transparently.  At least the naming needs to be corrected, and if this
*is* supposed to be something we do in ACPI I'd expect the handling to
be pushed into the fwnode API rather than open coded in a driver - at
the minute I'm unsure if this is messy because it's a bad idea to do
this at all or if it's just the naming and so on.

> -	/* Handle any DT/platform data */
> -	if ((codec->dev->of_node) && (da7219->pdata))
> +	/* Handle any DT/ACPI/platform data */
> +	if (((codec->dev->of_node) || is_acpi_node(codec->dev->fwnode)) &&
> +	    (da7219->pdata))
>  		da7219->pdata->aad_pdata = da7219_aad_of_to_pdata(codec);
> 
>  	da7219_aad_handle_pdata(codec);

Surely we should be able to check if there's firmware data without
enumerating every possible firmware type?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20160506/53143540/attachment.sig>


More information about the Alsa-devel mailing list