Lines Matching +full:int +full:- +full:gpios

5  * SPDX-License-Identifier:	GPL-2.0+
19 static int bcm2835_gpio_direction_input(struct udevice *dev, unsigned gpio) in bcm2835_gpio_direction_input()
21 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_direction_input() local
24 val = readl(&gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_input()
27 writel(val, &gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_input()
32 static int bcm2835_gpio_direction_output(struct udevice *dev, unsigned gpio, in bcm2835_gpio_direction_output()
33 int value) in bcm2835_gpio_direction_output()
35 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_direction_output() local
40 val = readl(&gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_output()
43 writel(val, &gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_direction_output()
48 static int bcm2835_get_value(const struct bcm2835_gpios *gpios, unsigned gpio) in bcm2835_get_value() argument
52 val = readl(&gpios->reg->gplev[BCM2835_GPIO_COMMON_BANK(gpio)]); in bcm2835_get_value()
57 static int bcm2835_gpio_get_value(struct udevice *dev, unsigned gpio) in bcm2835_gpio_get_value()
59 const struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_get_value() local
61 return bcm2835_get_value(gpios, gpio); in bcm2835_gpio_get_value()
64 static int bcm2835_gpio_set_value(struct udevice *dev, unsigned gpio, in bcm2835_gpio_set_value()
65 int value) in bcm2835_gpio_set_value()
67 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_set_value() local
68 u32 *output_reg = value ? gpios->reg->gpset : gpios->reg->gpclr; in bcm2835_gpio_set_value()
76 int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio) in bcm2835_gpio_get_func_id()
78 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_get_func_id() local
81 val = readl(&gpios->reg->gpfsel[BCM2835_GPIO_FSEL_BANK(gpio)]); in bcm2835_gpio_get_func_id()
86 static int bcm2835_gpio_get_function(struct udevice *dev, unsigned offset) in bcm2835_gpio_get_function()
88 int funcid = bcm2835_gpio_get_func_id(dev, offset); in bcm2835_gpio_get_function()
109 static int bcm2835_gpio_probe(struct udevice *dev) in bcm2835_gpio_probe()
111 struct bcm2835_gpios *gpios = dev_get_priv(dev); in bcm2835_gpio_probe() local
115 uc_priv->bank_name = "GPIO"; in bcm2835_gpio_probe()
116 uc_priv->gpio_count = BCM2835_GPIO_COUNT; in bcm2835_gpio_probe()
117 gpios->reg = (struct bcm2835_gpio_regs *)plat->base; in bcm2835_gpio_probe()
124 {.compatible = "brcm,bcm2835-gpio"},
128 static int bcm2835_gpio_ofdata_to_platdata(struct udevice *dev) in bcm2835_gpio_ofdata_to_platdata()
135 return -EINVAL; in bcm2835_gpio_ofdata_to_platdata()
137 plat->base = addr; in bcm2835_gpio_ofdata_to_platdata()