1. 01 3月, 2011 1 次提交
    • H
      davinci: tnetv107x: fix register indexing for GPIOs numbers > 31 · c284d9fa
      Hirosh Dabui 提交于
      This patch fix a bug in the register indexing for GPIOs numbers >  31
      to get the relevant hardware registers of tnetv107x to control the GPIOs.
      
      In the structure tnetv107x_gpio_regs:
      
      struct tnetv107x_gpio_regs {
                  u32     idver;
                  u32     data_in[3];
                  u32     data_out[3];
                  u32     direction[3];
                  u32     enable[3];
      };
      
      The GPIO hardware register addresses of tnetv107x are stored.
      The chip implements 3 registers of each entity to serve 96 GPIOs,
      each register provides a subset of 32 GPIOs.
      The driver provides these macros: gpio_reg_set_bit, gpio_reg_get_bit
      and gpio_reg_clear_bit.
      
      The bug implied the use of macros to access the relevant hardware
      register e.g. the driver code used the macro like this:
      'gpio_reg_clear_bit(&reg->data_out, gpio)'
      
      But it has to be used like this:
      'gpio_reg_clear_bit(reg->data_out, gpio)'.
      
      The different results are shown here:
      - &reg->data_out + 1 (it will add the full array size of data_out i.e. 12 bytes)
      - reg->data_out + 1 (it will increment only the size of data_out i.e. only 4 bytes)
      Acked-by: NCyril Chemparathy <cyril@ti.com>
      Signed-off-by: NHirosh Dabui <hirosh.dabui@snom.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      c284d9fa
  2. 22 6月, 2010 1 次提交
    • C
      Davinci: tnetv107x initial gpio support · d92c7962
      Cyril Chemparathy 提交于
      This patch adds support for the tnetv107x gpio controller.
      
      Key differences between davinci and tnetv107x controllers:
       - register map - davinci's controller is organized into banks of 32 gpios,
         tnetv107x has a single space with arrays of registers for in, out,
         direction, etc.
       - davinci's controller has separate set/clear registers for output, tnetv107x
         has a single direct mapped register.
      
      This patch does not yet add gpio irq support on this controller.
      Signed-off-by: NCyril Chemparathy <cyril@ti.com>
      Signed-off-by: NKevin Hilman <khilman@deeprootsystems.com>
      d92c7962