summaryrefslogtreecommitdiffstats
path: root/board/gdsys/common/dp501.c
diff options
context:
space:
mode:
authorDirk Eibach <dirk.eibach@gdsys.cc>2016-03-16 09:20:11 +0100
committerStefan Roese <sr@denx.de>2016-03-21 09:19:53 +0100
commite9cb21d0e891e95350da6ec3f8623018fd246187 (patch)
treef2ecda4743d759a95388359e1ae5ddf329223fdb /board/gdsys/common/dp501.c
parent83d95b67d3731e39292d858924ade3be68c167af (diff)
downloadblackbird-obmc-uboot-e9cb21d0e891e95350da6ec3f8623018fd246187.tar.gz
blackbird-obmc-uboot-e9cb21d0e891e95350da6ec3f8623018fd246187.zip
strider: Add DP501 support for cpu model
Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board/gdsys/common/dp501.c')
-rw-r--r--board/gdsys/common/dp501.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/board/gdsys/common/dp501.c b/board/gdsys/common/dp501.c
index d35aee0879..54e7f63f69 100644
--- a/board/gdsys/common/dp501.c
+++ b/board/gdsys/common/dp501.c
@@ -12,6 +12,16 @@
#include <errno.h>
#include <i2c.h>
+#define DP501_I2C_ADDR 0x08
+
+#ifdef CONFIG_SYS_DP501_I2C
+int dp501_i2c[] = CONFIG_SYS_DP501_I2C;
+#endif
+
+#ifdef CONFIG_SYS_DP501_BASE
+int dp501_base[] = CONFIG_SYS_DP501_BASE;
+#endif
+
static void dp501_setbits(u8 addr, u8 reg, u8 mask)
{
u8 val;
@@ -125,3 +135,24 @@ void dp501_powerdown(u8 addr)
{
dp501_setbits(addr, 0x0a, 0x30); /* power down encoder, standby mode */
}
+
+
+int dp501_probe(unsigned screen, bool power)
+{
+#ifdef CONFIG_SYS_DP501_BASE
+ uint8_t dp501_addr = dp501_base[screen];
+#else
+ uint8_t dp501_addr = DP501_I2C_ADDR;
+#endif
+
+#ifdef CONFIG_SYS_DP501_I2C
+ i2c_set_bus_num(dp501_i2c[screen]);
+#endif
+
+ if (i2c_probe(dp501_addr))
+ return -1;
+
+ dp501_powerup(dp501_addr);
+
+ return 0;
+}
OpenPOWER on IntegriCloud