/* Parameters : pin_number : The GPIO Pin number to program the direction for from 0 to 31 pin_value : The Direction of the GPIO Pin under reference. 0 = Input direction 1 = Output direction  */
int cx231xx_set_gpio_direction(struct cx231xx *dev, int pin_number, int pin_value)
/* Parameters : pin_number : The GPIO Pin number to program the direction for from 0 to 31 pin_value : The Direction of the GPIO Pin under reference. 0 = Input direction 1 = Output direction  */
int cx231xx_set_gpio_direction(struct cx231xx *dev, int pin_number, int pin_value)
{
	int status = 0;
	u32 value = 0;
	if (pin_number >= 32)
		return -EINVAL;
	if (pin_value == 0)
		value = dev->gpio_dir & (~(1 << pin_number));
	else
		value = dev->gpio_dir | (1 << pin_number);
	status = cx231xx_set_gpio_bit(dev, value, (u8 *) &dev->gpio_val);
	dev->gpio_dir = value;
	return status;
}