From 1b9e4b2d49283eee706bc58e42c4ac30cff4017f Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Mon, 23 Jun 2014 21:38:51 +0900 Subject: - Pinmux config is done in DT now - It looks like the i2c buses are now start at 0. --- bus.c | 42 ------------------------------------------ i2c.c | 2 +- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/bus.c b/bus.c index bf3ef02..2b6582b 100644 --- a/bus.c +++ b/bus.c @@ -84,19 +84,6 @@ static void util_unmapmemoryblock(void* block, size_t len) } } -static void pinmux_configurepin(char* pin, int options_and_mode) -{ - char path[256]; - snprintf(path, sizeof(path), "/sys/kernel/debug/omap_mux/%s", pin); - FILE* node = fopen(path, "w"); - if (node != NULL) { - fprintf(node, "0x%02x\n", (options_and_mode & 0xff)); - fclose(node); - } else { - printf("Failed to configure pin %s (%s)\n", pin, path); - } -} - #define REGLEN 0x10000000 static volatile uint32_t* registers = NULL; @@ -198,35 +185,6 @@ static void gpmc_setup(void) int WRACCESSTIME = DATA_READY; int config6 = WRACCESSTIME << 24; - //uart5 stuff - pinmux_configurepin("lcd_data9", BIDIR | PULL_UP | MODE_4); - pinmux_configurepin("lcd_data8", MODE_4); - pinmux_configurepin("lcd_data14", BIDIR | PULL_UP | MODE_6); - pinmux_configurepin("lcd_data15", MODE_6); - // - - pinmux_configurepin("gpmc_csn0", PULL_UP | MODE_0); - pinmux_configurepin("gpmc_oen_ren", PULL_UP | MODE_0); - pinmux_configurepin("gpmc_wen", PULL_UP | MODE_0); - - pinmux_configurepin("gpmc_ad7", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad6", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad5", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad4", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad3", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad2", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad1", BIDIR | PULL_UP | MODE_0); - pinmux_configurepin("gpmc_ad0", BIDIR | PULL_UP | MODE_0); - - pinmux_configurepin("lcd_data0", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data1", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data2", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data3", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data4", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data5", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data6", PULL_UP | MODE_1); - pinmux_configurepin("lcd_data7", PULL_UP | MODE_1); - gpmc_mapregisters(); if (registers != MAP_FAILED) { diff --git a/i2c.c b/i2c.c index dc52337..3b3042f 100644 --- a/i2c.c +++ b/i2c.c @@ -8,7 +8,7 @@ #include -#define I2C_BUS "/dev/i2c-3" +#define I2C_BUS "/dev/i2c-2" gboolean write_error_flagged; gboolean read_error_flagged; -- cgit