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: <54291D50.30002@metafoo.de>
Date:	Mon, 29 Sep 2014 10:50:24 +0200
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
	linux-kernel@...r.kernel.org
CC:	alsa-devel@...a-project.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 1/2] ASoC: ssm2602: add device tree bindings

On 09/28/2014 09:57 AM, Stefan Kristiansson wrote:
> Allow the ssm2602/ssm2603/ssm2604 codec driver to be
> instantiated from the device tree.
>
> Also, add Kconfig prompts to allow manual selection of both the
> I2C and SPI configuration versions of the driver.
>
> Signed-off-by: Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>

Looks mostly good, but you should Cc both the devicetree and the ASoC 
maintainers.

[...]
> diff --git a/sound/soc/codecs/ssm2602-i2c.c b/sound/soc/codecs/ssm2602-i2c.c
> index abd63d5..0d9779d 100644
> --- a/sound/soc/codecs/ssm2602-i2c.c
> +++ b/sound/soc/codecs/ssm2602-i2c.c
> @@ -41,10 +41,19 @@ static const struct i2c_device_id ssm2602_i2c_id[] = {
>   };
>   MODULE_DEVICE_TABLE(i2c, ssm2602_i2c_id);
>
> +static const struct of_device_id ssm2602_of_match[] = {
> +	{ .compatible = "adi,ssm2602", },
> +	{ .compatible = "adi,ssm2603", },
> +	{ .compatible = "adi,ssm2604", },

Since the driver is supposed to behave different depending on the device you 
should set the driver data similar to like it is done in the ssm2602_i2c_id 
table and add code in the probe function to extract the driver data.

> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, ssm2602_of_match);
> +
>   static struct i2c_driver ssm2602_i2c_driver = {
>   	.driver = {
>   		.name = "ssm2602",
>   		.owner = THIS_MODULE,
> +		.of_match_table = ssm2602_of_match,
>   	},
>   	.probe = ssm2602_i2c_probe,
>   	.remove = ssm2602_i2c_remove,
> diff --git a/sound/soc/codecs/ssm2602-spi.c b/sound/soc/codecs/ssm2602-spi.c
> index 2bf55e2..fb4cc46 100644
> --- a/sound/soc/codecs/ssm2602-spi.c
> +++ b/sound/soc/codecs/ssm2602-spi.c
> @@ -26,10 +26,19 @@ static int ssm2602_spi_remove(struct spi_device *spi)
>   	return 0;
>   }
>
> +static const struct of_device_id ssm2602_of_match[] = {
> +	{ .compatible = "adi,ssm2602", },
> +	{ .compatible = "adi,ssm2603", },
> +	{ .compatible = "adi,ssm2604", },

The ssm2603 and ssm2604 do not have a SPI interface.

> +	{ }
> +};
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ