From: Ryan Lee <ryans.lee@maximintegrated.com>
To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org,
mark.rutland@arm.com, perex@perex.cz, tiwai@suse.com,
arnd@arndb.de, michael@amarulasolutions.com,
oder_chiou@realtek.com, yesanishhere@gmail.com,
jacob@teenage.engineering, Damien.Horsley@imgtec.com,
bardliao@realtek.com, kuninori.morimoto.gx@renesas.com,
petr@barix.com, lars@metafoo.de, nh6z@nh6z.net,
ryans.lee@maximintegrated.com, alsa-devel@alsa-project.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org
Subject: [PATCH 09/10] Added ACPI support. Changed snd_kcontrol_chip to snd_soc_kcontrol_codec
Date: Fri, 3 Mar 2017 23:52:47 +0900 [thread overview]
Message-ID: <1488552768-14901-10-git-send-email-ryans.lee@maximintegrated.com> (raw)
In-Reply-To: <1488552768-14901-1-git-send-email-ryans.lee@maximintegrated.com>
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
---
snd_kcontrol_chip was changed to snd_soc_kcontrol_codec.
acpi_match_table was added.
sound/soc/codecs/max98927.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c
index 6eb745bd..0614936 100755
--- a/sound/soc/codecs/max98927.c
+++ b/sound/soc/codecs/max98927.c
@@ -10,7 +10,7 @@
* option) any later version.
*/
-#include <linux/delay.h>
+#include <linux/acpi.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/regmap.h>
@@ -144,7 +144,7 @@ static int max98927_reg_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol, unsigned int reg,
unsigned int mask, unsigned int shift)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
int data;
@@ -157,7 +157,7 @@ static int max98927_reg_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol, unsigned int reg,
unsigned int mask, unsigned int shift)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
unsigned int sel = ucontrol->value.integer.value[0];
@@ -473,7 +473,7 @@ static DECLARE_TLV_DB_SCALE(max98927_digital_tlv, -1600, 25, 0);
static int max98927_spk_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
ucontrol->value.integer.value[0] = max98927->spk_gain;
@@ -485,7 +485,7 @@ static int max98927_spk_gain_get(struct snd_kcontrol *kcontrol,
static int max98927_spk_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
unsigned int sel = ucontrol->value.integer.value[0];
@@ -503,7 +503,7 @@ static int max98927_spk_gain_put(struct snd_kcontrol *kcontrol,
static int max98927_digital_gain_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
ucontrol->value.integer.value[0] = max98927->digital_gain;
@@ -515,7 +515,7 @@ static int max98927_digital_gain_get(struct snd_kcontrol *kcontrol,
static int max98927_digital_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+ struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
unsigned int sel = ucontrol->value.integer.value[0];
@@ -1002,17 +1002,27 @@ static const struct i2c_device_id max98927_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, max98927_i2c_id);
+#if defined(CONFIG_OF)
static const struct of_device_id max98927_of_match[] = {
{ .compatible = "maxim,max98927", },
{ }
};
MODULE_DEVICE_TABLE(of, max98927_of_match);
+#endif
+
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id max98927_acpi_match[] = {
+ { "MX98927", 0 },
+ {},
+};
+MODULE_DEVICE_TABLE(acpi, max98927_acpi_match);
+#endif
static struct i2c_driver max98927_i2c_driver = {
.driver = {
.name = "max98927",
- .owner = THIS_MODULE,
.of_match_table = of_match_ptr(max98927_of_match),
+ .acpi_match_table = ACPI_PTR(max98927_acpi_match),
.pm = NULL,
},
.probe = max98927_i2c_probe,
--
2.7.4
next prev parent reply other threads:[~2017-03-03 14:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 14:52 [PATCH 00/10] ALSA SoC MAX98927 driver - revision Ryan Lee
2017-03-03 14:52 ` [PATCH 01/10] ALSA SoC MAX98927 driver - Initial release Ryan Lee
2017-03-06 10:35 ` Mark Brown
[not found] ` <1488552768-14901-2-git-send-email-ryans.lee-zxKO94PEStzToO697jQleEEOCMrvLtNR@public.gmane.org>
2017-03-12 14:11 ` Rob Herring
2017-03-03 14:52 ` [PATCH 02/10] Updated max98927_reg table with physical defaults. Replaced max98927.h for better legibility Ryan Lee
2017-03-06 10:30 ` Mark Brown
2017-03-03 14:52 ` [PATCH 03/10] Removed the secondary device initialization from the primary device initialization. Removed manual register configuration from devicetree Ryan Lee
2017-03-03 14:52 ` [PATCH 04/10] Modified indentation Ryan Lee
2017-03-03 14:52 ` [PATCH 05/10] Replaced pr_err by dev_err. Modified debug message Ryan Lee
2017-03-03 14:52 ` [PATCH 06/10] Added mask variable to apply it in one round after the switch Ryan Lee
2017-03-03 14:52 ` [PATCH 07/10] Modified initialization code of VI sensing Ryan Lee
2017-03-03 14:52 ` [PATCH 08/10] Added DAI Sel Mux and minor updates Ryan Lee
2017-03-03 14:52 ` Ryan Lee [this message]
2017-03-03 14:52 ` [PATCH 10/10] Added vendor prefix. Added range information Ryan Lee
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=1488552768-14901-10-git-send-email-ryans.lee@maximintegrated.com \
--to=ryans.lee@maximintegrated.com \
--cc=Damien.Horsley@imgtec.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnd@arndb.de \
--cc=bardliao@realtek.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jacob@teenage.engineering \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michael@amarulasolutions.com \
--cc=nh6z@nh6z.net \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=petr@barix.com \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.com \
--cc=yesanishhere@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).