summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2010-07-15 12:08:07 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-07-16 17:41:32 -0500
commit184de70057ae33df858639ed3f03e32d2cace1af (patch)
treee4501e04ac8f127b6ca8a0d336d43c7ea4a646c3 /sound
parente427a61599390155edf8ab6b2faf209553e7c007 (diff)
ASoC: SDP4430: Configure TPS61305 to provide VDDHF
Latest versions of SDP4430 ES2.0 have a TPS61305 boost converter to provide VDDHF supply. TPS61305 needs to be configured via I2C in order to provide the appropriate power supply. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/sdp4430.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c
index 1373a9164217..fc8d8dc44ab9 100644
--- a/sound/soc/omap/sdp4430.c
+++ b/sound/soc/omap/sdp4430.c
@@ -21,6 +21,7 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
+#include <linux/i2c.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
@@ -45,6 +46,27 @@
static int twl6040_power_mode;
static struct snd_soc_card snd_soc_sdp4430;
+static struct i2c_client *tps61305_client;
+static struct i2c_board_info tps61305_hwmon_info = {
+ I2C_BOARD_INFO("tps61305", 0x33),
+};
+
+static int sdp4430_tps61305_configure(void)
+{
+ u8 data[2];
+
+ data[0] = 0x01;
+ data[1] = 0x60;
+ if (i2c_master_send(tps61305_client, data, 2) != 2)
+ printk(KERN_ERR "I2C write to TSP61305 failed\n");
+
+ data[0] = 0x02;
+ if (i2c_master_send(tps61305_client, data, 2) != 2)
+ printk(KERN_ERR "I2C write to TSP61305 failed\n");
+
+ return 0;
+}
+
static int sdp4430_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
@@ -343,6 +365,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()) {
@@ -355,6 +378,20 @@ static int __init sdp4430_soc_init(void)
snd_soc_register_dais(&null_dai, 1);
#endif
+ adapter = i2c_get_adapter(1);
+ if (!adapter) {
+ printk(KERN_ERR "can't get i2c adapter\n");
+ return -ENODEV;
+ }
+
+ tps61305_client = i2c_new_device(adapter, &tps61305_hwmon_info);
+ if (!tps61305_client) {
+ printk(KERN_ERR "can't add i2c device\n");
+ return -ENODEV;
+ }
+
+ sdp4430_tps61305_configure();
+
sdp4430_snd_device = platform_device_alloc("soc-audio", -1);
if (!sdp4430_snd_device) {
printk(KERN_ERR "Platform device allocation failed\n");
@@ -391,6 +428,7 @@ module_init(sdp4430_soc_init);
static void __exit sdp4430_soc_exit(void)
{
platform_device_unregister(sdp4430_snd_device);
+ i2c_unregister_device(tps61305_client);
}
module_exit(sdp4430_soc_exit);