diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-02-12 06:15:23 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-03 08:19:45 -0400 |
commit | a4419f3eac875e66a01b654024f6eda17d0dd558 (patch) | |
tree | 01399565784f6722d3979e8b751e3f5eaed35452 | |
parent | 14e6a0918ab3f54b7574141eeab649853a5ac931 (diff) |
OMAPDSS: n8x0: remove platform backlight calls
The n8x0 panel contains support to call platform backlight functions.
These are not used by any board, and can be removed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
-rw-r--r-- | drivers/video/omap2/displays/panel-n8x0.c | 74 | ||||
-rw-r--r-- | include/video/omap-panel-data.h | 2 |
2 files changed, 0 insertions, 76 deletions
diff --git a/drivers/video/omap2/displays/panel-n8x0.c b/drivers/video/omap2/displays/panel-n8x0.c index 9c6b5fafeb2e..9c55c9152863 100644 --- a/drivers/video/omap2/displays/panel-n8x0.c +++ b/drivers/video/omap2/displays/panel-n8x0.c | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
6 | #include <linux/gpio.h> | 6 | #include <linux/gpio.h> |
7 | #include <linux/spi/spi.h> | 7 | #include <linux/spi/spi.h> |
8 | #include <linux/backlight.h> | ||
9 | #include <linux/fb.h> | 8 | #include <linux/fb.h> |
10 | 9 | ||
11 | #include <video/omapdss.h> | 10 | #include <video/omapdss.h> |
@@ -69,7 +68,6 @@ static struct panel_drv_data { | |||
69 | 68 | ||
70 | struct omap_dss_device *dssdev; | 69 | struct omap_dss_device *dssdev; |
71 | struct spi_device *spidev; | 70 | struct spi_device *spidev; |
72 | struct backlight_device *bldev; | ||
73 | 71 | ||
74 | int blizzard_ver; | 72 | int blizzard_ver; |
75 | } s_drv_data; | 73 | } s_drv_data; |
@@ -424,55 +422,10 @@ static const struct rfbi_timings n8x0_panel_timings = { | |||
424 | .cs_pulse_width = 0, | 422 | .cs_pulse_width = 0, |
425 | }; | 423 | }; |
426 | 424 | ||
427 | static int n8x0_bl_update_status(struct backlight_device *dev) | ||
428 | { | ||
429 | struct omap_dss_device *dssdev = dev_get_drvdata(&dev->dev); | ||
430 | struct panel_n8x0_data *bdata = get_board_data(dssdev); | ||
431 | struct panel_drv_data *ddata = get_drv_data(dssdev); | ||
432 | int r; | ||
433 | int level; | ||
434 | |||
435 | mutex_lock(&ddata->lock); | ||
436 | |||
437 | if (dev->props.fb_blank == FB_BLANK_UNBLANK && | ||
438 | dev->props.power == FB_BLANK_UNBLANK) | ||
439 | level = dev->props.brightness; | ||
440 | else | ||
441 | level = 0; | ||
442 | |||
443 | dev_dbg(&dssdev->dev, "update brightness to %d\n", level); | ||
444 | |||
445 | if (!bdata->set_backlight) | ||
446 | r = -EINVAL; | ||
447 | else | ||
448 | r = bdata->set_backlight(dssdev, level); | ||
449 | |||
450 | mutex_unlock(&ddata->lock); | ||
451 | |||
452 | return r; | ||
453 | } | ||
454 | |||
455 | static int n8x0_bl_get_intensity(struct backlight_device *dev) | ||
456 | { | ||
457 | if (dev->props.fb_blank == FB_BLANK_UNBLANK && | ||
458 | dev->props.power == FB_BLANK_UNBLANK) | ||
459 | return dev->props.brightness; | ||
460 | |||
461 | return 0; | ||
462 | } | ||
463 | |||
464 | static const struct backlight_ops n8x0_bl_ops = { | ||
465 | .get_brightness = n8x0_bl_get_intensity, | ||
466 | .update_status = n8x0_bl_update_status, | ||
467 | }; | ||
468 | |||
469 | static int n8x0_panel_probe(struct omap_dss_device *dssdev) | 425 | static int n8x0_panel_probe(struct omap_dss_device *dssdev) |
470 | { | 426 | { |
471 | struct panel_n8x0_data *bdata = get_board_data(dssdev); | 427 | struct panel_n8x0_data *bdata = get_board_data(dssdev); |
472 | struct panel_drv_data *ddata; | 428 | struct panel_drv_data *ddata; |
473 | struct backlight_device *bldev; | ||
474 | struct backlight_properties props; | ||
475 | int r; | ||
476 | 429 | ||
477 | dev_dbg(&dssdev->dev, "probe\n"); | 430 | dev_dbg(&dssdev->dev, "probe\n"); |
478 | 431 | ||
@@ -491,40 +444,13 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) | |||
491 | dssdev->ctrl.rfbi_timings = n8x0_panel_timings; | 444 | dssdev->ctrl.rfbi_timings = n8x0_panel_timings; |
492 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; | 445 | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; |
493 | 446 | ||
494 | memset(&props, 0, sizeof(props)); | ||
495 | props.max_brightness = 127; | ||
496 | props.type = BACKLIGHT_PLATFORM; | ||
497 | bldev = backlight_device_register(dev_name(&dssdev->dev), &dssdev->dev, | ||
498 | dssdev, &n8x0_bl_ops, &props); | ||
499 | if (IS_ERR(bldev)) { | ||
500 | r = PTR_ERR(bldev); | ||
501 | dev_err(&dssdev->dev, "register backlight failed\n"); | ||
502 | return r; | ||
503 | } | ||
504 | |||
505 | ddata->bldev = bldev; | ||
506 | |||
507 | bldev->props.fb_blank = FB_BLANK_UNBLANK; | ||
508 | bldev->props.power = FB_BLANK_UNBLANK; | ||
509 | bldev->props.brightness = 127; | ||
510 | |||
511 | n8x0_bl_update_status(bldev); | ||
512 | |||
513 | return 0; | 447 | return 0; |
514 | } | 448 | } |
515 | 449 | ||
516 | static void n8x0_panel_remove(struct omap_dss_device *dssdev) | 450 | static void n8x0_panel_remove(struct omap_dss_device *dssdev) |
517 | { | 451 | { |
518 | struct panel_drv_data *ddata = get_drv_data(dssdev); | ||
519 | struct backlight_device *bldev; | ||
520 | |||
521 | dev_dbg(&dssdev->dev, "remove\n"); | 452 | dev_dbg(&dssdev->dev, "remove\n"); |
522 | 453 | ||
523 | bldev = ddata->bldev; | ||
524 | bldev->props.power = FB_BLANK_POWERDOWN; | ||
525 | n8x0_bl_update_status(bldev); | ||
526 | backlight_device_unregister(bldev); | ||
527 | |||
528 | dev_set_drvdata(&dssdev->dev, NULL); | 454 | dev_set_drvdata(&dssdev->dev, NULL); |
529 | } | 455 | } |
530 | 456 | ||
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h index 6b55839b73fc..0c3b46d3daf3 100644 --- a/include/video/omap-panel-data.h +++ b/include/video/omap-panel-data.h | |||
@@ -56,8 +56,6 @@ struct panel_n8x0_data { | |||
56 | void (*platform_disable)(struct omap_dss_device *dssdev); | 56 | void (*platform_disable)(struct omap_dss_device *dssdev); |
57 | int panel_reset; | 57 | int panel_reset; |
58 | int ctrl_pwrdown; | 58 | int ctrl_pwrdown; |
59 | |||
60 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | ||
61 | }; | 59 | }; |
62 | 60 | ||
63 | /** | 61 | /** |