leds-ns2.c (688d794c4c3f8b08c814381ee2edd3ede5856056) | leds-ns2.c (9d04cbaadf563db3ba04426c317d3e84bc27bac1) |
---|---|
1/* 2 * leds-ns2.c - Driver for the Network Space v2 (and parents) dual-GPIO LED 3 * 4 * Copyright (C) 2010 LaCie 5 * 6 * Author: Simon Guinot <sguinot@lacie.com> 7 * 8 * Based on leds-gpio.c by Raphael Assenat <raph@8d.com> --- 179 unchanged lines hidden (view full) --- 188static int 189create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat, 190 const struct ns2_led *template) 191{ 192 int ret; 193 enum ns2_led_modes mode; 194 195 ret = devm_gpio_request_one(&pdev->dev, template->cmd, | 1/* 2 * leds-ns2.c - Driver for the Network Space v2 (and parents) dual-GPIO LED 3 * 4 * Copyright (C) 2010 LaCie 5 * 6 * Author: Simon Guinot <sguinot@lacie.com> 7 * 8 * Based on leds-gpio.c by Raphael Assenat <raph@8d.com> --- 179 unchanged lines hidden (view full) --- 188static int 189create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat, 190 const struct ns2_led *template) 191{ 192 int ret; 193 enum ns2_led_modes mode; 194 195 ret = devm_gpio_request_one(&pdev->dev, template->cmd, |
196 GPIOF_DIR_OUT | gpio_get_value(template->cmd), | 196 gpio_get_value(template->cmd) ? 197 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, |
197 template->name); 198 if (ret) { 199 dev_err(&pdev->dev, "%s: failed to setup command GPIO\n", 200 template->name); 201 return ret; 202 } 203 204 ret = devm_gpio_request_one(&pdev->dev, template->slow, | 198 template->name); 199 if (ret) { 200 dev_err(&pdev->dev, "%s: failed to setup command GPIO\n", 201 template->name); 202 return ret; 203 } 204 205 ret = devm_gpio_request_one(&pdev->dev, template->slow, |
205 GPIOF_DIR_OUT | gpio_get_value(template->slow), | 206 gpio_get_value(template->slow) ? 207 GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, |
206 template->name); 207 if (ret) { 208 dev_err(&pdev->dev, "%s: failed to setup slow GPIO\n", 209 template->name); 210 return ret; 211 } 212 213 rwlock_init(&led_dat->rw_lock); --- 170 unchanged lines hidden --- | 208 template->name); 209 if (ret) { 210 dev_err(&pdev->dev, "%s: failed to setup slow GPIO\n", 211 template->name); 212 return ret; 213 } 214 215 rwlock_init(&led_dat->rw_lock); --- 170 unchanged lines hidden --- |