lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180307163211.rytfli5tb47yhtug@dell>
Date:   Wed, 7 Mar 2018 16:32:11 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Sebastian Reichel <sebastian.reichel@...labora.co.uk>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Tony Lindgren <tony@...mide.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
        linux-omap@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCHv5 3/5] mfd: motorola-cpcap: Add audio-codec support

On Fri, 23 Feb 2018, Sebastian Reichel wrote:

> From: Sebastian Reichel <sre@...nel.org>
> 
> Add support for the audio-codec node by converting from
> devm_of_platform_populate() to devm_mfd_add_devices().
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.co.uk>
> ---
>  drivers/mfd/motorola-cpcap.c | 51 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 50 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> index d2cc1eabac05..f6c79a4ccb55 100644
> --- a/drivers/mfd/motorola-cpcap.c
> +++ b/drivers/mfd/motorola-cpcap.c
> @@ -18,6 +18,7 @@
>  #include <linux/regmap.h>
>  #include <linux/sysfs.h>
>  
> +#include <linux/mfd/core.h>
>  #include <linux/mfd/motorola-cpcap.h>
>  #include <linux/spi/spi.h>
>  
> @@ -216,6 +217,53 @@ static const struct regmap_config cpcap_regmap_config = {
>  	.val_format_endian = REGMAP_ENDIAN_LITTLE,
>  };
>  
> +static const struct mfd_cell cpcap_mfd_devices[] = {
> +	{
> +		.name          = "cpcap_adc",
> +		.of_compatible = "motorola,mapphone-cpcap-adc",
> +	}, {
> +		.name          = "cpcap_battery",
> +		.of_compatible = "motorola,cpcap-battery",
> +	}, {
> +		.name          = "cpcap-charger",
> +		.of_compatible = "motorola,mapphone-cpcap-charger",
> +	}, {
> +		.name          = "cpcap-regulator",
> +		.of_compatible = "motorola,mapphone-cpcap-regulator",
> +	}, {
> +		.name          = "cpcap-rtc",
> +		.of_compatible = "motorola,cpcap-rtc",
> +	}, {
> +		.name          = "cpcap-pwrbutton",
> +		.of_compatible = "motorola,cpcap-pwrbutton",
> +	}, {
> +		.name          = "cpcap-usb-phy",
> +		.of_compatible = "motorola,mapphone-cpcap-usb-phy",
> +	}, {
> +		.name          = "cpcap-led",
> +		.id            = 0,
> +		.of_compatible = "motorola,cpcap-led-red",
> +	}, {
> +		.name          = "cpcap-led",
> +		.id            = 1,
> +		.of_compatible = "motorola,cpcap-led-green",
> +	}, {
> +		.name          = "cpcap-led",
> +		.id            = 2,
> +		.of_compatible = "motorola,cpcap-led-blue",
> +	}, {
> +		.name          = "cpcap-led",
> +		.id            = 3,
> +		.of_compatible = "motorola,cpcap-led-adl",
> +	}, {
> +		.name          = "cpcap-led",
> +		.id            = 4,
> +		.of_compatible = "motorola,cpcap-led-cp",
> +	}, {
> +		.name          = "cpcap-codec",
> +	}
> +};

With none of the entries containing platform_data /me wonders why you
can't still use devm_of_platform_populate()?

>  static int cpcap_probe(struct spi_device *spi)
>  {
>  	const struct of_device_id *match;
> @@ -260,7 +308,8 @@ static int cpcap_probe(struct spi_device *spi)
>  	if (ret)
>  		return ret;
>  
> -	return devm_of_platform_populate(&cpcap->spi->dev);
> +	return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
> +				    ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
>  }
>  
>  static struct spi_driver cpcap_driver = {

-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ