Lines Matching refs:gpio

37 int gpio_request(unsigned gpio, const char *label)  in gpio_request()  argument
39 if (gpio >= MAX_NUM_GPIOS) in gpio_request()
45 int gpio_free(unsigned gpio) in gpio_free() argument
52 int gpio_direction_input(unsigned gpio) in gpio_direction_input() argument
60 ctrlr = gpio >> 5; in gpio_direction_input()
61 line = gpio & (0x1F); in gpio_direction_input()
66 clrbits_be32(&im->gpio[ctrlr].dir, line_mask); in gpio_direction_input()
72 int gpio_direction_output(unsigned gpio, int value) in gpio_direction_output() argument
84 gpio_set_value(gpio, value); in gpio_direction_output()
87 ctrlr = gpio >> 5; in gpio_direction_output()
88 line = gpio & (0x1F); in gpio_direction_output()
94 setbits_be32(&im->gpio[ctrlr].dir, line_mask); in gpio_direction_output()
100 int gpio_get_value(unsigned gpio) in gpio_get_value() argument
108 ctrlr = gpio >> 5; in gpio_get_value()
109 line = gpio & (0x1F); in gpio_get_value()
115 return (in_be32(&im->gpio[ctrlr].dat) & line_mask) != 0; in gpio_get_value()
119 int gpio_set_value(unsigned gpio, int value) in gpio_set_value() argument
132 ctrlr = gpio >> 5; in gpio_set_value()
133 line = gpio & (0x1F); in gpio_set_value()
144 out_be32(&im->gpio[ctrlr].dat, gpio_output_value[ctrlr]); in gpio_set_value()
155 out_be32(&im->gpio[0].dir, CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION); in mpc83xx_gpio_init_f()
156 out_be32(&im->gpio[0].odr, CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN); in mpc83xx_gpio_init_f()
157 out_be32(&im->gpio[0].dat, CONFIG_MPC83XX_GPIO_0_INIT_VALUE); in mpc83xx_gpio_init_f()
158 out_be32(&im->gpio[0].ier, 0xFFFFFFFF); /* Clear all events */ in mpc83xx_gpio_init_f()
159 out_be32(&im->gpio[0].imr, 0); in mpc83xx_gpio_init_f()
160 out_be32(&im->gpio[0].icr, 0); in mpc83xx_gpio_init_f()
164 out_be32(&im->gpio[1].dir, CONFIG_MPC83XX_GPIO_1_INIT_DIRECTION); in mpc83xx_gpio_init_f()
165 out_be32(&im->gpio[1].odr, CONFIG_MPC83XX_GPIO_1_INIT_OPEN_DRAIN); in mpc83xx_gpio_init_f()
166 out_be32(&im->gpio[1].dat, CONFIG_MPC83XX_GPIO_1_INIT_VALUE); in mpc83xx_gpio_init_f()
167 out_be32(&im->gpio[1].ier, 0xFFFFFFFF); /* Clear all events */ in mpc83xx_gpio_init_f()
168 out_be32(&im->gpio[1].imr, 0); in mpc83xx_gpio_init_f()
169 out_be32(&im->gpio[1].icr, 0); in mpc83xx_gpio_init_f()