Lines Matching refs:offset
25 static unsigned int bit_cfg_reg(unsigned int offset) in bit_cfg_reg() argument
31 if (offset < 16) in bit_cfg_reg()
32 return 8 * offset; in bit_cfg_reg()
34 return 8 * (offset - 16) + 0x100; in bit_cfg_reg()
42 static int octeon_gpio_dir_in(struct gpio_chip *chip, unsigned offset) in octeon_gpio_dir_in() argument
46 cvmx_write_csr(gpio->register_base + bit_cfg_reg(offset), 0); in octeon_gpio_dir_in()
50 static void octeon_gpio_set(struct gpio_chip *chip, unsigned offset, int value) in octeon_gpio_set() argument
53 u64 mask = 1ull << offset; in octeon_gpio_set()
58 static int octeon_gpio_dir_out(struct gpio_chip *chip, unsigned offset, in octeon_gpio_dir_out() argument
64 octeon_gpio_set(chip, offset, value); in octeon_gpio_dir_out()
69 cvmx_write_csr(gpio->register_base + bit_cfg_reg(offset), cfgx.u64); in octeon_gpio_dir_out()
73 static int octeon_gpio_get(struct gpio_chip *chip, unsigned offset) in octeon_gpio_get() argument
78 return ((1ull << offset) & read_bits) != 0; in octeon_gpio_get()