summaryrefslogtreecommitdiff
path: root/board/nvidia/nyan-big/nyan-big.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-04-14 21:03:29 -0600
committerTom Warren <twarren@nvidia.com>2015-05-13 09:24:08 -0700
commit0deba29c202695f3e166256d87515b99b74adc8e (patch)
tree2a3452b2f32535eba1687e6d3f8bd0eb3e86f7d9 /board/nvidia/nyan-big/nyan-big.c
parent346451b5888c4663bccef4c5203357319aa41f99 (diff)
tegra: nyan-big: Add LCD PMIC init and board ID
Add required setup for the LCD display, and a function to provide the board ID. This requires GPIOs to be available prior to relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'board/nvidia/nyan-big/nyan-big.c')
-rw-r--r--board/nvidia/nyan-big/nyan-big.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/board/nvidia/nyan-big/nyan-big.c b/board/nvidia/nyan-big/nyan-big.c
index d4d2496639..ae8874bbd2 100644
--- a/board/nvidia/nyan-big/nyan-big.c
+++ b/board/nvidia/nyan-big/nyan-big.c
@@ -6,8 +6,11 @@
*/
#include <common.h>
-#include <asm/arch/gpio.h>
+#include <errno.h>
+#include <asm/gpio.h>
#include <asm/arch/pinmux.h>
+#include <power/as3722.h>
+#include <power/pmic.h>
#include "pinmux-config-nyan-big.h"
/*
@@ -25,3 +28,32 @@ void pinmux_init(void)
pinmux_config_drvgrp_table(nyan_big_drvgrps,
ARRAY_SIZE(nyan_big_drvgrps));
}
+
+int tegra_board_id(void)
+{
+ static const int vector[] = {GPIO_PQ3, GPIO_PT1, GPIO_PX1,
+ GPIO_PX4, -1};
+
+ gpio_claim_vector(vector, "board_id%d");
+ return gpio_get_values_as_int(vector);
+}
+
+int tegra_lcd_pmic_init(int board_id)
+{
+ struct udevice *pmic;
+ int ret;
+
+ ret = as3722_get(&pmic);
+ if (ret)
+ return -ENOENT;
+
+ if (board_id == 0)
+ as3722_write(pmic, 0x00, 0x3c);
+ else
+ as3722_write(pmic, 0x00, 0x50);
+ as3722_write(pmic, 0x12, 0x10);
+ as3722_write(pmic, 0x0c, 0x07);
+ as3722_write(pmic, 0x20, 0x10);
+
+ return 0;
+}