aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski2015-07-18 14:23:25 +0200
committerPaul Kocialkowski2016-03-29 14:17:11 +0200
commit209d4f2e366cc67c9f1d54c543897066bdfd7705 (patch)
tree9510c10ace326edb16ee8679e0a9e0552f223361
parent480b94eba5c40a89537111d528a889c0d305a58a (diff)
WIP: sniper: AAT2870, BD2812, MUIC support
-rw-r--r--board/lg/sniper/sniper.c70
-rw-r--r--board/lg/sniper/sniper.h3
2 files changed, 73 insertions, 0 deletions
diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c
index 0662449c387..7524000b8bb 100644
--- a/board/lg/sniper/sniper.c
+++ b/board/lg/sniper/sniper.c
@@ -15,6 +15,7 @@
#include <asm/arch/mmc_host_def.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/mem.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <ns16550.h>
#include <twl4030.h>
@@ -88,14 +89,47 @@ int board_init(void)
return 0;
}
+unsigned char bd2812_registers[][2] = {
+ { 0x00, 0x00 },
+ { 0x01, 0x11 },
+ { 0x02, 0xf3 },
+ { 0x03, 0x32 },
+ { 0x04, 0x32 },
+ { 0x06, 0x32 },
+ { 0x07, 0x32 },
+ { 0x09, 0x00 },
+ { 0x0A, 0x00 },
+ { 0x0c, 0xf3 },
+ { 0x0d, 0x32 },
+ { 0x0e, 0x32 },
+ { 0x10, 0x32 },
+ { 0x11, 0x32 },
+ { 0x13, 0x00 },
+ { 0x14, 0x00 },
+ { 0x40, 0x00 },
+ { 0x41, 0x0f }
+};
+
+unsigned int bd2812_registers_count = sizeof(bd2812_registers) / (2 * sizeof(unsigned char));
+
int misc_init_r(void)
{
unsigned char keypad_matrix[64] = { 0 };
char reboot_mode[2] = { 0 };
unsigned char keys[3];
unsigned char data = 0;
+ unsigned int i;
int rc;
+ /* MUIC */
+
+ i2c_set_bus_num(1);
+
+ data = 0x00;
+ i2c_write(0x44, 0x03, 1, &data, 1);
+
+ i2c_set_bus_num(0);
+
/* Power button reset init */
twl4030_power_reset_init();
@@ -142,6 +176,42 @@ int misc_init_r(void)
omap_die_id_serial();
+ /* AAT2870 */
+
+ gpio_request(SNIPER_GPIO_LCD_CP_EN, "aat2870_en");
+ gpio_direction_output(SNIPER_GPIO_LCD_CP_EN, 0);
+ gpio_set_value(SNIPER_GPIO_LCD_CP_EN, 1);
+
+ udelay(50);
+
+ i2c_set_bus_num(1);
+
+ data = 0xff;
+ i2c_write(0x60, 0x00, 1, &data, 1);
+ data = 0xf4;
+ i2c_write(0x60, 0x03, 1, &data, 1);
+ data = 0x74;
+ i2c_write(0x60, 0x04, 1, &data, 1);
+ i2c_write(0x60, 0x05, 1, &data, 1);
+ i2c_write(0x60, 0x06, 1, &data, 1);
+
+ i2c_set_bus_num(0);
+
+ /* BD2812 */
+
+ gpio_request(SNIPER_GPIO_KEY_LED_RESET, "key_led_reset");
+ gpio_direction_output(SNIPER_GPIO_KEY_LED_RESET, 0);
+ gpio_set_value(SNIPER_GPIO_KEY_LED_RESET, 1);
+
+ udelay(50);
+
+ i2c_set_bus_num(1);
+
+ for (i = 0; i < bd2812_registers_count; i++)
+ i2c_write(0x1a, bd2812_registers[i][0], 1, &bd2812_registers[i][1], 1);
+
+ i2c_set_bus_num(0);
+
/* MUSB */
musb_register(&musb_platform_data, &musb_board_data, (void *)MUSB_BASE);
diff --git a/board/lg/sniper/sniper.h b/board/lg/sniper/sniper.h
index 0f81c437acc..e07a0016654 100644
--- a/board/lg/sniper/sniper.h
+++ b/board/lg/sniper/sniper.h
@@ -11,6 +11,9 @@
#include <asm/arch/mux.h>
+#define SNIPER_GPIO_LCD_CP_EN 62
+#define SNIPER_GPIO_KEY_LED_RESET 128
+
#define MUX_SNIPER() \
/* SDRC */ \
MUX_VAL(CP(SDRC_D0), (IEN | PTD | DIS | M0)) /* sdrc_d0 */\