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