Lines Matching refs:offset

35 static int imx_rgpio2p_is_output(struct gpio_regs *regs, int offset)  in imx_rgpio2p_is_output()  argument
41 return val & (1 << offset) ? 1 : 0; in imx_rgpio2p_is_output()
44 static void imx_rgpio2p_bank_direction(struct gpio_regs *regs, int offset, in imx_rgpio2p_bank_direction() argument
53 l |= 1 << offset; in imx_rgpio2p_bank_direction()
56 l &= ~(1 << offset); in imx_rgpio2p_bank_direction()
61 static void imx_rgpio2p_bank_set_value(struct gpio_regs *regs, int offset, in imx_rgpio2p_bank_set_value() argument
65 writel((1 << offset), &regs->gpio_psor); in imx_rgpio2p_bank_set_value()
67 writel((1 << offset), &regs->gpio_pcor); in imx_rgpio2p_bank_set_value()
70 static int imx_rgpio2p_bank_get_value(struct gpio_regs *regs, int offset) in imx_rgpio2p_bank_get_value() argument
72 return (readl(&regs->gpio_pdir) >> offset) & 0x01; in imx_rgpio2p_bank_get_value()
75 static int imx_rgpio2p_direction_input(struct udevice *dev, unsigned offset) in imx_rgpio2p_direction_input() argument
80 imx_rgpio2p_bank_direction(bank->regs, offset, IMX_RGPIO2P_DIRECTION_IN); in imx_rgpio2p_direction_input()
85 static int imx_rgpio2p_direction_output(struct udevice *dev, unsigned offset, in imx_rgpio2p_direction_output() argument
91 imx_rgpio2p_bank_set_value(bank->regs, offset, value); in imx_rgpio2p_direction_output()
94 imx_rgpio2p_bank_direction(bank->regs, offset, IMX_RGPIO2P_DIRECTION_OUT); in imx_rgpio2p_direction_output()
99 static int imx_rgpio2p_get_value(struct udevice *dev, unsigned offset) in imx_rgpio2p_get_value() argument
103 return imx_rgpio2p_bank_get_value(bank->regs, offset); in imx_rgpio2p_get_value()
106 static int imx_rgpio2p_set_value(struct udevice *dev, unsigned offset, in imx_rgpio2p_set_value() argument
111 imx_rgpio2p_bank_set_value(bank->regs, offset, value); in imx_rgpio2p_set_value()
116 static int imx_rgpio2p_get_function(struct udevice *dev, unsigned offset) in imx_rgpio2p_get_function() argument
121 if (imx_rgpio2p_is_output(bank->regs, offset)) in imx_rgpio2p_get_function()