summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/max98390.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/max98390.c')
-rw-r--r--sound/soc/codecs/max98390.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/sound/soc/codecs/max98390.c b/sound/soc/codecs/max98390.c
index 7a5260ff8d6b..3dd4dd94bc37 100644
--- a/sound/soc/codecs/max98390.c
+++ b/sound/soc/codecs/max98390.c
@@ -13,7 +13,6 @@
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
-#include <linux/of_gpio.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/time.h>
@@ -24,7 +23,7 @@
#include "max98390.h"
-static struct reg_default max98390_reg_defaults[] = {
+static const struct reg_default max98390_reg_defaults[] = {
{MAX98390_INT_EN1, 0xf0},
{MAX98390_INT_EN2, 0x00},
{MAX98390_INT_EN3, 0x00},
@@ -535,8 +534,7 @@ static SOC_ENUM_SINGLE_DECL(max98390_current_limit,
static int max98390_ref_rdc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
@@ -555,8 +553,7 @@ static int max98390_ref_rdc_put(struct snd_kcontrol *kcontrol,
static int max98390_ref_rdc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
@@ -568,8 +565,7 @@ static int max98390_ref_rdc_get(struct snd_kcontrol *kcontrol,
static int max98390_ambient_temp_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
@@ -586,8 +582,7 @@ static int max98390_ambient_temp_put(struct snd_kcontrol *kcontrol,
static int max98390_ambient_temp_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
@@ -599,8 +594,7 @@ static int max98390_ambient_temp_get(struct snd_kcontrol *kcontrol,
static int max98390_adaptive_rdc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
dev_warn(component->dev, "Put adaptive rdc not supported\n");
@@ -611,8 +605,7 @@ static int max98390_adaptive_rdc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
int rdc, rdc0;
- struct snd_soc_component *component =
- snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
@@ -633,9 +626,9 @@ static int max98390_dsm_calib_get(struct snd_kcontrol *kcontrol,
static int max98390_dsm_calib_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct max98390_priv *max98390 = snd_soc_component_get_drvdata(component);
- struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
unsigned int rdc, rdc_cal_result, rdc_integer, rdc_factor, temp, val;
snd_soc_dapm_mutex_lock(dapm);
@@ -944,7 +937,6 @@ static int max98390_probe(struct snd_soc_component *component)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int max98390_suspend(struct device *dev)
{
struct max98390_priv *max98390 = dev_get_drvdata(dev);
@@ -968,10 +960,9 @@ static int max98390_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops max98390_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(max98390_suspend, max98390_resume)
+ SYSTEM_SLEEP_PM_OPS(max98390_suspend, max98390_resume)
};
static const struct snd_soc_component_driver soc_codec_dev_max98390 = {
@@ -1104,7 +1095,7 @@ static int max98390_i2c_probe(struct i2c_client *i2c)
}
static const struct i2c_device_id max98390_i2c_id[] = {
- { "max98390", 0},
+ { "max98390"},
{},
};
@@ -1131,9 +1122,9 @@ static struct i2c_driver max98390_i2c_driver = {
.name = "max98390",
.of_match_table = of_match_ptr(max98390_of_match),
.acpi_match_table = ACPI_PTR(max98390_acpi_match),
- .pm = &max98390_pm,
+ .pm = pm_ptr(&max98390_pm),
},
- .probe_new = max98390_i2c_probe,
+ .probe = max98390_i2c_probe,
.id_table = max98390_i2c_id,
};