From: Lars-Peter Clausen <lars@metafoo.de>
To: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] ASoC: ssm2602: add device tree bindings
Date: Mon, 29 Sep 2014 10:50:24 +0200 [thread overview]
Message-ID: <54291D50.30002@metafoo.de> (raw)
In-Reply-To: <1411891072-22637-1-git-send-email-stefan.kristiansson@saunalahti.fi>
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@saunalahti.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.
> + { }
> +};
[...]
next prev parent reply other threads:[~2014-09-29 8:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-28 7:57 [PATCH 1/2] ASoC: ssm2602: add device tree bindings Stefan Kristiansson
2014-09-29 8:50 ` Lars-Peter Clausen [this message]
[not found] ` <54291D50.30002-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-09-29 14:34 ` Stefan Kristiansson
2014-09-29 14:34 ` Stefan Kristiansson
2014-09-29 14:49 ` Lars-Peter Clausen
[not found] ` <20140929143452.GA11763-YASU2+sLF5DjzPUptC8vukB+6BGkLq7r@public.gmane.org>
2014-09-29 14:49 ` Stefan Kristiansson
2014-09-29 14:49 ` Stefan Kristiansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54291D50.30002@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan.kristiansson@saunalahti.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.