示例#1
0
static int	gpio_sw_pull_get(struct gpio_sw_classdev *gpio_sw_cdev)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret;
    ret =   sw_gpio_getpull(gpio->cdev.pio_hdle);
    return ret;
}
示例#2
0
static int	gpio_sw_data_get(struct gpio_sw_classdev *gpio_sw_cdev)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret;
    ret = __gpio_get_value(gpio->cdev.pio_hdle);
    return ret;
}
示例#3
0
static int	gpio_sw_drv_level_get(struct gpio_sw_classdev *gpio_sw_cdev)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret;
    ret =   sw_gpio_getdrvlevel(gpio->cdev.pio_hdle);
    GPIO_SW_DEBUG("in gpio_sw_drv_level_get ret is %d",ret);
    return ret;
}
示例#4
0
static int	gpio_sw_data_get(struct gpio_sw_classdev *gpio_sw_cdev)
{
	struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
	struct gpio_sw_platdata *pd = gpio->pdata;
	int ret;
	ret=get_gpio_member_value( gpio->cdev.pio_hdle , pd->name , data_4 );
	return ret;
}
示例#5
0
static int	gpio_sw_drv_level_get(struct gpio_sw_classdev *gpio_sw_cdev)
{
	struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
	struct gpio_sw_platdata *pd = gpio->pdata;
	int ret;
	ret=get_gpio_member_value( gpio->cdev.pio_hdle , pd->name , drv_level_3 );
	GPIO_SW_DEBUG("in gpio_sw_drv_level_get ret is %d",ret);
	return ret;
}
示例#6
0
static int	gpio_sw_data_set(struct gpio_sw_classdev *gpio_sw_cdev,int  data)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);

    GPIO_SW_DEBUG("attending gpio_sw_data_set \n");
    GPIO_SW_DEBUG("pio_hdle is %u \n",gpio->cdev.pio_hdle);

    __gpio_set_value(gpio->cdev.pio_hdle, data);
    gpio_sw_cdev->data=data;
    GPIO_SW_DEBUG("left gpio_sw_data_set \n");
    return 0;
}
示例#7
0
static int	gpio_sw_cfg_set(struct gpio_sw_classdev *gpio_sw_cdev,int  mul_sel)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret ;

    GPIO_SW_DEBUG("attending gpio_sw_cfg_set \n");
    GPIO_SW_DEBUG("pio_hdle is %u \n",gpio->cdev.pio_hdle);

    ret = sw_gpio_setcfg(gpio->cdev.pio_hdle, mul_sel);
    if ( !ret )
        gpio_sw_cdev->mul_sel=mul_sel;
    GPIO_SW_DEBUG("left gpio_sw_cfg_set \n");
    return ret;
}
示例#8
0
static int	gpio_sw_drv_level_set(struct gpio_sw_classdev *gpio_sw_cdev,int  drv_level)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret ;

    GPIO_SW_DEBUG("attending gpio_sw_drv_level_set \n");
    GPIO_SW_DEBUG("pio_hdle is %u \n",gpio->cdev.pio_hdle);

    ret = sw_gpio_setdrvlevel(gpio->cdev.pio_hdle, drv_level);
    if ( !ret )
        gpio_sw_cdev->drv_level=drv_level;
    GPIO_SW_DEBUG("left gpio_sw_drv_level_set \n");
    return ret ;
}
示例#9
0
static int	gpio_sw_pull_set(struct gpio_sw_classdev *gpio_sw_cdev,int  pull)
{
    struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
    int ret ;

    GPIO_SW_DEBUG("attending gpio_sw_pull_set \n");
    GPIO_SW_DEBUG("pio_hdle is %u \n",gpio->cdev.pio_hdle);

    ret =   sw_gpio_setpull(gpio->cdev.pio_hdle, pull);
    if ( !ret )
        gpio_sw_cdev->pull=pull;
    GPIO_SW_DEBUG("left gpio_sw_pull_set \n");
    return ret ;
}
示例#10
0
static int	gpio_sw_drv_level_set(struct gpio_sw_classdev *gpio_sw_cdev,int  drv_level)
{
	struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
	struct gpio_sw_platdata *pd = gpio->pdata;
	int ret ;

	GPIO_SW_DEBUG("attending gpio_sw_drv_level_set \n");
	GPIO_SW_DEBUG("pio_hdle is %x \n",gpio->cdev.pio_hdle);

	ret =  gpio_set_one_pin_driver_level (gpio->cdev.pio_hdle, drv_level, pd->name);
	if ( !ret )
	gpio_sw_cdev->drv_level=drv_level;
	GPIO_SW_DEBUG("left gpio_sw_drv_level_set \n");
	return ret ;
}
示例#11
0
static int	gpio_sw_data_set(struct gpio_sw_classdev *gpio_sw_cdev,int  data)
{
	struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
	struct gpio_sw_platdata *pd = gpio->pdata;
	int ret ;

	GPIO_SW_DEBUG("attending gpio_sw_data_set \n");
	GPIO_SW_DEBUG("pio_hdle is %x \n",gpio->cdev.pio_hdle);

	ret =  gpio_write_one_pin_value (gpio->cdev.pio_hdle, data, pd->name);
	if ( !ret )
	gpio_sw_cdev->data=data;
	GPIO_SW_DEBUG("left gpio_sw_data_set \n");
	return ret ;
}
示例#12
0
static int	gpio_sw_pull_set(struct gpio_sw_classdev *gpio_sw_cdev,int  pull)
{
	struct gpio_sw *gpio = to_gpio(gpio_sw_cdev);
	struct gpio_sw_platdata *pd = gpio->pdata;
	int ret ;

	GPIO_SW_DEBUG("attending gpio_sw_pull_set \n");
	GPIO_SW_DEBUG("pio_hdle is %x \n",gpio->cdev.pio_hdle);

	ret =   gpio_set_one_pin_pull (gpio->cdev.pio_hdle, pull, pd->name);
	if ( !ret )
	gpio_sw_cdev->pull=pull;
	GPIO_SW_DEBUG("left gpio_sw_pull_set \n");
	return ret ;
}
示例#13
0
static void s3c24xx_led_set(struct led_classdev *led_cdev,
			    enum led_brightness value)
{
	struct s3c24xx_gpio_led *led = to_gpio(led_cdev);
	struct s3c24xx_led_platdata *pd = led->pdata;

	/* there will be a short delay between setting the output and
	 * going from output to input when using tristate. */

	s3c2410_gpio_setpin(pd->gpio, (value ? 1 : 0) ^
			    (pd->flags & S3C24XX_LEDF_ACTLOW));

	if (pd->flags & S3C24XX_LEDF_TRISTATE)
		s3c2410_gpio_cfgpin(pd->gpio,
			value ? S3C2410_GPIO_OUTPUT : S3C2410_GPIO_INPUT);

}
static void s3c24xx_led_set(struct led_classdev *led_cdev,
			    enum led_brightness value)
{
	struct s3c24xx_gpio_led *led = to_gpio(led_cdev);
	struct s3c24xx_led_platdata *pd = led->pdata;

	/*                                                           
                                                    */

	s3c2410_gpio_setpin(pd->gpio, (value ? 1 : 0) ^
			    (pd->flags & S3C24XX_LEDF_ACTLOW));

	if (pd->flags & S3C24XX_LEDF_TRISTATE)
		s3c2410_gpio_cfgpin(pd->gpio,
			value ? S3C2410_GPIO_OUTPUT : S3C2410_GPIO_INPUT);

}
示例#15
0
static void s3c24xx_led_set(struct led_classdev *led_cdev,
			    enum led_brightness value)
{
	struct s3c24xx_gpio_led *led = to_gpio(led_cdev);
	struct s3c24xx_led_platdata *pd = led->pdata;
	int state = (value ? 1 : 0) ^ (pd->flags & S3C24XX_LEDF_ACTLOW);

	/* there will be a short delay between setting the output and
	 * going from output to input when using tristate. */

	gpio_set_value(pd->gpio, state);

	if (pd->flags & S3C24XX_LEDF_TRISTATE) {
		if (value)
			gpio_direction_output(pd->gpio, state);
		else
			gpio_direction_input(pd->gpio);
	}
}