target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
static int aw9523_get_port_state(struct regmap *regmap, u8 pin,
				   u8 regbit, unsigned int *state)
{
	u8 reg;
	int dir;

	dir = aw9523_get_pin_direction(regmap, pin, regbit);
	if (dir < 0)
		return dir;

	if (dir == GPIO_LINE_DIRECTION_IN)
		reg = AW9523_REG_IN_STATE(pin);
	else
		reg = AW9523_REG_OUT_STATE(pin);

	return regmap_read(regmap, reg, state);
}
/*
 * aw9523_get_port_state - Get input or output state for entire port
 * @regmap: Regmap structure
 * @pin:    gpiolib pin number
 * @regbit: hw pin index, used to retrieve port number
 * @state:  returned port state
 *
 * Return: Zero for success or negative number for error
 */
Get input or output state for entire port
@regmap: Regmap structure
@pin:    gpiolib pin number
@regbit: hw pin index, used to retrieve port number
@state:  returned port state

Zero for success or negative number for error
Get input or output state for entire port @regmap : Regmap structure @pin : gpiolib pin number @regbit : hw pin index used to retrieve port number @state : returned port state Zero for success or negative number for error
static int aw9523_get_port_state(struct regmap *regmap, u8 pin,
				   u8 regbit, unsigned int *state)
{
	u8 reg;
	int dir;
	dir = aw9523_get_pin_direction(regmap, pin, regbit);
	if (dir < 0)
		return dir;
	if (dir == GPIO_LINE_DIRECTION_IN)
		reg = AW9523_REG_IN_STATE(pin);
	else
		reg = AW9523_REG_OUT_STATE(pin);
	return regmap_read(regmap, reg, state);
}
static int aw9523_get_port_state ( struct regmap * regmap , u8 pin , u8 regbit , unsigned int * state ) { u8 reg ; int dir ; dir = aw9523_get_pin_direction ( regmap , pin , regbit ) ; if ( dir < 0 ) return dir ; if ( dir == GPIO_LINE_DIRECTION_IN ) reg = AW9523_REG_IN_STATE ( pin ) ; else reg = AW9523_REG_OUT_STATE ( pin ) ; return regmap_read ( regmap , reg , state ) ; }
aw9523_get_port_state - Get input or output state for entire port
 @regmap: Regmap structure
 @pin:    gpiolib pin number
 @regbit: hw pin index, used to retrieve port number
 @state:  returned port state
aw9523_get_port_state - Get input or output state for entire port @regmap : Regmap structure @pin : gpiolib pin number @regbit : hw pin index used to retrieve port number @state : returned port state