Merge remote-tracking branch 'asoc/topic/rt5640' into asoc-next

This commit is contained in:
Mark Brown 2013-10-24 11:24:11 +01:00
commit a6f849f752
1 changed files with 21 additions and 3 deletions

View File

@ -21,6 +21,7 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/acpi.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
@ -926,7 +927,7 @@ static int rt5640_set_dmic2_event(struct snd_soc_dapm_widget *w,
return 0; return 0;
} }
void hp_amp_power_on(struct snd_soc_codec *codec) static void hp_amp_power_on(struct snd_soc_codec *codec)
{ {
struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
@ -1609,7 +1610,8 @@ static int rt5640_hw_params(struct snd_pcm_substream *substream,
rt5640->lrck[dai->id] = params_rate(params); rt5640->lrck[dai->id] = params_rate(params);
pre_div = get_clk_info(rt5640->sysclk, rt5640->lrck[dai->id]); pre_div = get_clk_info(rt5640->sysclk, rt5640->lrck[dai->id]);
if (pre_div < 0) { if (pre_div < 0) {
dev_err(codec->dev, "Unsupported clock setting\n"); dev_err(codec->dev, "Unsupported clock setting %d for DAI %d\n",
rt5640->lrck[dai->id], dai->id);
return -EINVAL; return -EINVAL;
} }
frame_size = snd_soc_params_to_frame_size(params); frame_size = snd_soc_params_to_frame_size(params);
@ -1977,13 +1979,20 @@ static int rt5640_suspend(struct snd_soc_codec *codec)
rt5640_reset(codec); rt5640_reset(codec);
regcache_cache_only(rt5640->regmap, true); regcache_cache_only(rt5640->regmap, true);
regcache_mark_dirty(rt5640->regmap); regcache_mark_dirty(rt5640->regmap);
if (gpio_is_valid(rt5640->pdata.ldo1_en))
gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 0);
return 0; return 0;
} }
static int rt5640_resume(struct snd_soc_codec *codec) static int rt5640_resume(struct snd_soc_codec *codec)
{ {
rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY); struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
if (gpio_is_valid(rt5640->pdata.ldo1_en)) {
gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 1);
msleep(400);
}
return 0; return 0;
} }
@ -2080,6 +2089,14 @@ static const struct i2c_device_id rt5640_i2c_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id);
#ifdef CONFIG_ACPI
static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 },
{ },
};
MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
#endif
static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device_node *np) static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device_node *np)
{ {
rt5640->pdata.in1_diff = of_property_read_bool(np, rt5640->pdata.in1_diff = of_property_read_bool(np,
@ -2199,6 +2216,7 @@ static struct i2c_driver rt5640_i2c_driver = {
.driver = { .driver = {
.name = "rt5640", .name = "rt5640",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.acpi_match_table = ACPI_PTR(rt5640_acpi_match),
}, },
.probe = rt5640_i2c_probe, .probe = rt5640_i2c_probe,
.remove = rt5640_i2c_remove, .remove = rt5640_i2c_remove,