Thread (3 messages) 3 messages, 2 authors, 2014-05-12

Re: [PATCH v3] video: mx3fb: Add backlight control support

From: Tomi Valkeinen <hidden>
Date: 2014-05-09 09:11:29

On 08/05/14 17:38, Alexander Stein wrote:
quoted hunk ↗ jump to hunk
This patch add backlight control support to allow dimming the backlight
using the internal PWM. Currently the brightness is set fixed to a
maximum of 255.

Signed-off-by: Alexander Stein <redacted>
---
Changes in v3:
* Add a more descriptive commit message

Changes in v2:
* rebased to v3.15-rc4

 drivers/video/fbdev/mx3fb.c | 98 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 142e860..10a7244 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -27,6 +27,7 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 #include <linux/dma/ipu-dma.h>
+#include <linux/backlight.h>
 
 #include <linux/platform_data/dma-imx.h>
 #include <linux/platform_data/video-mx3fb.h>
@@ -34,6 +35,12 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
+#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+	(defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) && \
+		defined(CONFIG_MX3FB_MODULE))
+#define PWM_BACKLIGHT_AVAILABLE
+#endif
I'm not very fond of this kind of ifdeffery. It makes the driver rather
messy and confusing, especially if large blocks of code are inside the
ifdefs.

Can't you just make the driver select BACKLIGHT_CLASS_DEVICE?

 Tomi

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help