Lines Matching +full:gpio +full:- +full:leds
1 /* drivers/leds/leds-s3c24xx.c
7 * S3C24XX - LEDs GPIO driver
16 #include <linux/leds.h>
17 #include <linux/gpio.h>
20 #include <linux/platform_data/leds-s3c24xx.h>
22 #include <mach/regs-gpio.h>
23 #include <plat/gpio-cfg.h>
41 struct s3c24xx_led_platdata *pd = led->pdata; in s3c24xx_led_set()
42 int state = (value ? 1 : 0) ^ (pd->flags & S3C24XX_LEDF_ACTLOW); in s3c24xx_led_set()
47 gpio_set_value(pd->gpio, state); in s3c24xx_led_set()
49 if (pd->flags & S3C24XX_LEDF_TRISTATE) { in s3c24xx_led_set()
51 gpio_direction_output(pd->gpio, state); in s3c24xx_led_set()
53 gpio_direction_input(pd->gpio); in s3c24xx_led_set()
59 struct s3c24xx_led_platdata *pdata = dev_get_platdata(&dev->dev); in s3c24xx_led_probe()
63 led = devm_kzalloc(&dev->dev, sizeof(struct s3c24xx_gpio_led), in s3c24xx_led_probe()
66 return -ENOMEM; in s3c24xx_led_probe()
68 led->cdev.brightness_set = s3c24xx_led_set; in s3c24xx_led_probe()
69 led->cdev.default_trigger = pdata->def_trigger; in s3c24xx_led_probe()
70 led->cdev.name = pdata->name; in s3c24xx_led_probe()
71 led->cdev.flags |= LED_CORE_SUSPENDRESUME; in s3c24xx_led_probe()
73 led->pdata = pdata; in s3c24xx_led_probe()
75 ret = devm_gpio_request(&dev->dev, pdata->gpio, "S3C24XX_LED"); in s3c24xx_led_probe()
79 /* no point in having a pull-up if we are always driving */ in s3c24xx_led_probe()
81 s3c_gpio_setpull(pdata->gpio, S3C_GPIO_PULL_NONE); in s3c24xx_led_probe()
83 if (pdata->flags & S3C24XX_LEDF_TRISTATE) in s3c24xx_led_probe()
84 gpio_direction_input(pdata->gpio); in s3c24xx_led_probe()
86 gpio_direction_output(pdata->gpio, in s3c24xx_led_probe()
87 pdata->flags & S3C24XX_LEDF_ACTLOW ? 1 : 0); in s3c24xx_led_probe()
91 ret = devm_led_classdev_register(&dev->dev, &led->cdev); in s3c24xx_led_probe()
93 dev_err(&dev->dev, "led_classdev_register failed\n"); in s3c24xx_led_probe()