leds-mc13783.c (df07cf81268192e42c4cdf91f5f4bf9aaac1b2f0) leds-mc13783.c (98ea1ea20cb7090d5ae2003c23fc8a7f14fca4c7)
1/*
2 * LEDs driver for Freescale MC13783
3 *
4 * Copyright (C) 2010 Philippe Rétornaz
5 *
6 * Based on leds-da903x:
7 * Copyright (C) 2008 Compulab, Ltd.
8 * Mike Rapoport <mike@compulab.co.il>

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

123{
124 struct mc13783_led *led;
125
126 led = container_of(led_cdev, struct mc13783_led, cdev);
127 led->new_brightness = value;
128 schedule_work(&led->work);
129}
130
1/*
2 * LEDs driver for Freescale MC13783
3 *
4 * Copyright (C) 2010 Philippe Rétornaz
5 *
6 * Based on leds-da903x:
7 * Copyright (C) 2008 Compulab, Ltd.
8 * Mike Rapoport <mike@compulab.co.il>

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

123{
124 struct mc13783_led *led;
125
126 led = container_of(led_cdev, struct mc13783_led, cdev);
127 led->new_brightness = value;
128 schedule_work(&led->work);
129}
130
131static int __devinit mc13783_led_setup(struct mc13783_led *led, int max_current)
131static int mc13783_led_setup(struct mc13783_led *led, int max_current)
132{
133 int shift = 0;
134 int mask = 0;
135 int value = 0;
136 int reg = 0;
137 int ret, bank;
138
139 switch (led->id) {

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

176
177 ret = mc13xxx_reg_rmw(led->master, reg, mask << shift,
178 value << shift);
179
180 mc13xxx_unlock(led->master);
181 return ret;
182}
183
132{
133 int shift = 0;
134 int mask = 0;
135 int value = 0;
136 int reg = 0;
137 int ret, bank;
138
139 switch (led->id) {

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

176
177 ret = mc13xxx_reg_rmw(led->master, reg, mask << shift,
178 value << shift);
179
180 mc13xxx_unlock(led->master);
181 return ret;
182}
183
184static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
184static int mc13783_leds_prepare(struct platform_device *pdev)
185{
186 struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
187 struct mc13xxx *dev = dev_get_drvdata(pdev->dev.parent);
188 int ret = 0;
189 int reg = 0;
190
191 mc13xxx_lock(dev);
192

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

257
258 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_0, reg);
259
260out:
261 mc13xxx_unlock(dev);
262 return ret;
263}
264
185{
186 struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
187 struct mc13xxx *dev = dev_get_drvdata(pdev->dev.parent);
188 int ret = 0;
189 int reg = 0;
190
191 mc13xxx_lock(dev);
192

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

257
258 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_0, reg);
259
260out:
261 mc13xxx_unlock(dev);
262 return ret;
263}
264
265static int __devinit mc13783_led_probe(struct platform_device *pdev)
265static int mc13783_led_probe(struct platform_device *pdev)
266{
267 struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
268 struct mc13xxx_led_platform_data *led_cur;
269 struct mc13783_led *led, *led_dat;
270 int ret, i;
271 int init_led = 0;
272
273 if (pdata == NULL) {

--- 119 unchanged lines hidden ---
266{
267 struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
268 struct mc13xxx_led_platform_data *led_cur;
269 struct mc13783_led *led, *led_dat;
270 int ret, i;
271 int init_led = 0;
272
273 if (pdata == NULL) {

--- 119 unchanged lines hidden ---