leds-adp5520.c (df07cf81268192e42c4cdf91f5f4bf9aaac1b2f0) leds-adp5520.c (98ea1ea20cb7090d5ae2003c23fc8a7f14fca4c7)
1/*
2 * LEDs driver for Analog Devices ADP5520/ADP5501 MFD PMICs
3 *
4 * Copyright 2009 Analog Devices Inc.
5 *
6 * Loosely derived from leds-da903x:
7 * Copyright (C) 2008 Compulab, Ltd.
8 * Mike Rapoport <mike@compulab.co.il>

--- 71 unchanged lines hidden (view full) ---

80 ret |= adp5520_set_bits(dev, ADP5520_LED_CONTROL,
81 ADP5520_LED3_EN);
82 break;
83 }
84
85 return ret;
86}
87
1/*
2 * LEDs driver for Analog Devices ADP5520/ADP5501 MFD PMICs
3 *
4 * Copyright 2009 Analog Devices Inc.
5 *
6 * Loosely derived from leds-da903x:
7 * Copyright (C) 2008 Compulab, Ltd.
8 * Mike Rapoport <mike@compulab.co.il>

--- 71 unchanged lines hidden (view full) ---

80 ret |= adp5520_set_bits(dev, ADP5520_LED_CONTROL,
81 ADP5520_LED3_EN);
82 break;
83 }
84
85 return ret;
86}
87
88static int __devinit adp5520_led_prepare(struct platform_device *pdev)
88static int adp5520_led_prepare(struct platform_device *pdev)
89{
90 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data;
91 struct device *dev = pdev->dev.parent;
92 int ret = 0;
93
94 ret |= adp5520_write(dev, ADP5520_LED1_CURRENT, 0);
95 ret |= adp5520_write(dev, ADP5520_LED2_CURRENT, 0);
96 ret |= adp5520_write(dev, ADP5520_LED3_CURRENT, 0);
97 ret |= adp5520_write(dev, ADP5520_LED_TIME, pdata->led_on_time << 6);
98 ret |= adp5520_write(dev, ADP5520_LED_FADE, FADE_VAL(pdata->fade_in,
99 pdata->fade_out));
100
101 return ret;
102}
103
89{
90 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data;
91 struct device *dev = pdev->dev.parent;
92 int ret = 0;
93
94 ret |= adp5520_write(dev, ADP5520_LED1_CURRENT, 0);
95 ret |= adp5520_write(dev, ADP5520_LED2_CURRENT, 0);
96 ret |= adp5520_write(dev, ADP5520_LED3_CURRENT, 0);
97 ret |= adp5520_write(dev, ADP5520_LED_TIME, pdata->led_on_time << 6);
98 ret |= adp5520_write(dev, ADP5520_LED_FADE, FADE_VAL(pdata->fade_in,
99 pdata->fade_out));
100
101 return ret;
102}
103
104static int __devinit adp5520_led_probe(struct platform_device *pdev)
104static int adp5520_led_probe(struct platform_device *pdev)
105{
106 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data;
107 struct adp5520_led *led, *led_dat;
108 struct led_info *cur_led;
109 int ret, i;
110
111 if (pdata == NULL) {
112 dev_err(&pdev->dev, "missing platform data\n");

--- 107 unchanged lines hidden ---
105{
106 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data;
107 struct adp5520_led *led, *led_dat;
108 struct led_info *cur_led;
109 int ret, i;
110
111 if (pdata == NULL) {
112 dev_err(&pdev->dev, "missing platform data\n");

--- 107 unchanged lines hidden ---