Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342779
b: refs/heads/master
c: 1858fe9
h: refs/heads/master
i:
  342777: bc28603
  342775: 7ccbf2a
v: v3
  • Loading branch information
Javier Martin authored and Mark Brown committed Nov 1, 2012
1 parent c4f9a13 commit 8073172
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a405387c6825b1fc1956e22b10160b0f31536f3f
refs/heads/master: 1858fe97c87c33c4975e291ecbbd6c1a20315674
1 change: 1 addition & 0 deletions trunk/include/sound/tlv320aic32x4.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct aic32x4_pdata {
u32 power_cfg;
u32 micpga_routing;
bool swapdacs;
int rstn_gpio;
};

#endif
14 changes: 14 additions & 0 deletions trunk/sound/soc/codecs/tlv320aic32x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/cdev.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -65,6 +66,7 @@ struct aic32x4_priv {
u32 power_cfg;
u32 micpga_routing;
bool swapdacs;
int rstn_gpio;
};

/* 0dB min, 1dB steps */
Expand Down Expand Up @@ -627,10 +629,20 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
{
struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
u32 tmp_reg;
int ret;

codec->hw_write = (hw_write_t) i2c_master_send;
codec->control_data = aic32x4->control_data;

if (aic32x4->rstn_gpio >= 0) {
ret = devm_gpio_request_one(codec->dev, aic32x4->rstn_gpio,
GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn");
if (ret != 0)
return ret;
ndelay(10);
gpio_set_value(aic32x4->rstn_gpio, 1);
}

snd_soc_write(codec, AIC32X4_RESET, 0x01);

/* Power platform configuration */
Expand Down Expand Up @@ -723,10 +735,12 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c,
aic32x4->power_cfg = pdata->power_cfg;
aic32x4->swapdacs = pdata->swapdacs;
aic32x4->micpga_routing = pdata->micpga_routing;
aic32x4->rstn_gpio = pdata->rstn_gpio;
} else {
aic32x4->power_cfg = 0;
aic32x4->swapdacs = false;
aic32x4->micpga_routing = 0;
aic32x4->rstn_gpio = -1;
}

ret = snd_soc_register_codec(&i2c->dev,
Expand Down

0 comments on commit 8073172

Please sign in to comment.