diff options
-rw-r--r-- | bus.c | 42 | ||||
-rw-r--r-- | i2c.c | 2 |
2 files changed, 1 insertions, 43 deletions
@@ -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) { @@ -8,7 +8,7 @@ #include <glib.h> -#define I2C_BUS "/dev/i2c-3" +#define I2C_BUS "/dev/i2c-2" gboolean write_error_flagged; gboolean read_error_flagged; |