Commit e4ac87fe authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

add debugging

parent e314e30f
......@@ -46,6 +46,7 @@ static void gpi_calculate(struct controller_block *gpi)
reg = am335x_read32(base, AM335X_GPIO_REG_DATAIN);
in = reg & gpi->private->bitmask;
log_send(LOG_T_DEBUG, "%s: 0x%lx 0x%lx %d", gpo->name, reg, gpi->private->bitmask, in);
priv->in = in;
}
......@@ -133,6 +134,8 @@ struct controller_block * block_am335x_gpi_create(char *name, va_list ap)
gpi->private->bitmask = 1 << pin_nr;
notpin = ~gpi->private->bitmask;
am335x_write32(base, AM335X_GPIO_REG_CTRL, 0);
am335x_write32(base, AM335X_GPIO_REG_LEVELDETECT0,
am335x_read32(base, AM335X_GPIO_REG_LEVELDETECT0) & notpin);
am335x_write32(base, AM335X_GPIO_REG_LEVELDETECT1,
......
......@@ -50,6 +50,10 @@ static void gpo_calculate(struct controller_block *gpo)
AM335X_GPIO_REG_SETDATAOUT :
AM335X_GPIO_REG_CLEARDATAOUT;
am335x_write32(base, regoff, gpo->private->bitmask);
reg = am335x_read32(base, AM335X_GPIO_REG_DATAOUT);
log_send(LOG_T_DEBUG, "%s: 0x%lx 0x%lx %d", gpo->name, reg, gpi->private->bitmask,
out);
}
......@@ -135,6 +139,8 @@ struct controller_block * block_am335x_gpo_create(char *name, va_list ap)
gpo->private->bitmask = 1 << pin_nr;
notpin = ~gpo->private->bitmask;
am335x_write32(base, AM335X_GPIO_REG_CTRL, 0);
am335x_write32(base, AM335X_GPIO_REG_LEVELDETECT0,
am335x_read32(base, AM335X_GPIO_REG_LEVELDETECT0) & notpin);
am335x_write32(base, AM335X_GPIO_REG_LEVELDETECT1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment