Lines Matching refs:offset

34 	int offset;  member
37 static int broadwell_gpio_request(struct udevice *dev, unsigned offset, in broadwell_gpio_request() argument
49 debug("%s: request bank %d offset %d: ", __func__, priv->bank, offset); in broadwell_gpio_request()
51 if (!(val & (1UL << offset))) { in broadwell_gpio_request()
60 static int broadwell_gpio_direction_input(struct udevice *dev, unsigned offset) in broadwell_gpio_direction_input() argument
65 setio_32(&regs->config[priv->offset + offset], CONFA_DIR_INPUT); in broadwell_gpio_direction_input()
70 static int broadwell_gpio_get_value(struct udevice *dev, unsigned offset) in broadwell_gpio_get_value() argument
75 return inl(&regs->config[priv->offset + offset]) & CONFA_LEVEL_HIGH ? in broadwell_gpio_get_value()
79 static int broadwell_gpio_set_value(struct udevice *dev, unsigned offset, in broadwell_gpio_set_value() argument
85 debug("%s: dev=%s, offset=%d, value=%d\n", __func__, dev->name, offset, in broadwell_gpio_set_value()
87 clrsetio_32(&regs->config[priv->offset + offset], CONFA_OUTPUT_HIGH, in broadwell_gpio_set_value()
93 static int broadwell_gpio_direction_output(struct udevice *dev, unsigned offset, in broadwell_gpio_direction_output() argument
99 broadwell_gpio_set_value(dev, offset, value); in broadwell_gpio_direction_output()
100 clrio_32(&regs->config[priv->offset + offset], CONFA_DIR_INPUT); in broadwell_gpio_direction_output()
105 static int broadwell_gpio_get_function(struct udevice *dev, unsigned offset) in broadwell_gpio_get_function() argument
109 u32 mask = 1UL << offset; in broadwell_gpio_get_function()
113 if (inl(&regs->config[priv->offset + offset]) & CONFA_DIR_INPUT) in broadwell_gpio_get_function()
136 priv->offset = priv->bank * 32; in broadwell_gpio_probe()