diff options
| author | David Anders <x0132446@ti.com> | 2011-05-31 09:23:03 +0100 |
|---|---|---|
| committer | Andy Green <andy.green@linaro.org> | 2011-05-31 11:04:32 +0100 |
| commit | 62a8c6676e31937c0017c5857986fcc7ef0f6afa (patch) | |
| tree | 1e34572bc56d97c4e8de07e43598180c3900cf47 /sound | |
| parent | 3c79a28bc37dea2217a4ff54632f1714ed09218f (diff) | |
ASoC: sdp4430: Configure TPS6130x to provide VDDHF
SDP4430 uses a TPS6130X boost converter to provide
TWL6040 VDDHF supply. TPS61300/TPS61301 have ENVM to
force voltage regulation mode which is connected to
TWL6040 GPO2, and there is no need to explicitly enable
the regulator. TPS61305/TPS61306 don't have ENVM, so
it's required to enable voltage regulation mode through
i2c registers.
Change-Id: Iedfcf2933563d9c1fa07e290de6fd473374276a9
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: David Anders <x0132446@ti.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/soc/omap/sdp4430.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index 9c35d39d853..b250f4e6fc6 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -22,6 +22,7 @@ #include <linux/clk.h> #include <linux/platform_device.h> #include <sound/core.h> +#include <linux/i2c.h> #include <sound/pcm.h> #include <sound/soc.h> #include <sound/jack.h> @@ -45,6 +46,28 @@ static int twl6040_power_mode; +static struct i2c_client *tps6130x_client; +static struct i2c_board_info tps6130x_hwmon_info = { + I2C_BOARD_INFO("tps6130x", 0x33), +}; + +/* configure the TPS6130x Handsfree Boost Converter */ +static int sdp4430_tps6130x_configure(void) +{ + u8 data[2]; + + data[0] = 0x01; + data[1] = 0x60; + if (i2c_master_send(tps6130x_client, data, 2) != 2) + printk(KERN_ERR "I2C write to TPS6130x failed\n"); + + data[0] = 0x02; + if (i2c_master_send(tps6130x_client, data, 2) != 2) + printk(KERN_ERR "I2C write to TPS6130x failed\n"); + + return 0; +} + static int sdp4430_mcpdm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -1051,6 +1074,7 @@ static struct platform_device *sdp4430_snd_device; static int __init sdp4430_soc_init(void) { + struct i2c_adapter *adapter; int ret; if (!machine_is_omap_4430sdp() && !machine_is_omap4_panda()) { @@ -1074,6 +1098,22 @@ static int __init sdp4430_soc_init(void) if (ret) goto err; + adapter = i2c_get_adapter(1); + if (!adapter) { + printk(KERN_ERR "can't get i2c adapter\n"); + return -ENODEV; + } + + tps6130x_client = i2c_new_device(adapter, &tps6130x_hwmon_info); + if (!tps6130x_client) { + printk(KERN_ERR "can't add i2c device\n"); + return -ENODEV; + } + + /* Only configure the TPS6130x on SDP4430 */ + if (machine_is_omap_4430sdp()) + sdp4430_tps6130x_configure(); + /* Codec starts in HP mode */ twl6040_power_mode = 1; @@ -1089,6 +1129,7 @@ module_init(sdp4430_soc_init); static void __exit sdp4430_soc_exit(void) { platform_device_unregister(sdp4430_snd_device); + i2c_unregister_device(tps6130x_client); } module_exit(sdp4430_soc_exit); |
