All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Sokolovsky <pmiscml@gmail.com>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	Richard Purdie <rpurdie@rpsys.net>
Subject: Re: [PATCH 1/1] PXAFB: Support for backlight control
Date: Thu, 22 Feb 2007 12:33:35 +0200	[thread overview]
Message-ID: <1868738509.20070222123335@gmail.com> (raw)
In-Reply-To: <20070222083204.GN4641@enneenne.com>

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

Hello Rodolfo,

Thursday, February 22, 2007, 10:32:04 AM, you wrote:

> On Wed, Feb 21, 2007 at 06:26:08PM +0200, Paul Sokolovsky wrote:
k>>   Why? It's the same, except that it already exists, generic one (not
>> limited to pxafb), and requires 1 function (too bad that C doesn't
>> support lambda's):

> Ah, ok.

>>   I sent a bit of criticism for that too ;-). YMMV, but kernel
>> solutions are just bound to be pretty simple and generic and lack
>> any "niceties", which you'd likely want to do anyway eventually. For
>> example, what if you'll want to implement "fade out" effect for
>> keyboard backlight? Doing it in adhoc manner in kernel? Whereas with
>> the LCD classdev, you can write generic "fade out" trigger and
>> attach/detach it from userspace.

> I agree. I just wish to add a backlight support for my LCD and
> minikeypad.

> What do you suggest to me in order to accomplish such task?

  Well, I write exactly to share experience and work towards having
best practices for backlight, etc. control, reusable on wide range of
embedded/handheld devices.

  We in handhelds.org codebase have attached patch* to make corgi_bl
more suitable for general use. This patch was submitted to Richard
(so, more votes needed ;-) ). Otherwise, snippet I pasted is from real
machine implementation, HP iPaq h4000.

  As for keyboard backlight, another port we have, HTC Universal, has:
normal indicator LEDs, keyboard backlight, flashlight, ring vibra. All
of these are handled via Generic LED API:
http://handhelds.org/cgi-bin/cvsweb.cgi/linux/kernel26/arch/arm/mach-pxa/htcuniversal/htcuniversal_leds.c?rev=1.6&content-type=text/x-cvsweb-markup

  To show that it is not an anomaly, but hopefully, a trend, here's
vibra driver for the upcoming OpenMoko phone:
http://wiki.openmoko.org/wiki/Neo1973_Hardware#Vibrator

  So, if you have freedom to add keyboard backlight control to your
userspace, that would allow you to do many interesting things without
disturbing the kernel.

[*] Optimized for size, full one should patch <asm/arch/sharpsl.h> of
course.


> Thanks for your suggestions,

> Rodolfo




-- 
Best regards,
 Paul                            mailto:pmiscml@gmail.com

[-- Attachment #2: driver-corgi-bl-generalize.patch --]
[-- Type: application/octet-stream, Size: 1636 bytes --]

diff -N -U3 -r -x CVS ../linux-2.6.20/drivers/video/backlight/Kconfig ../linux-2.6.20-hh/drivers/video/backlight/Kconfig
--- ../linux-2.6.20/drivers/video/backlight/Kconfig	2007-02-04 18:44:54.000000000 +0000
+++ ../linux-2.6.20-hh/drivers/video/backlight/Kconfig	2006-12-18 12:41:24.000000000 +0000
@@ -44,7 +44,7 @@
 
 config BACKLIGHT_CORGI
 	tristate "Sharp Corgi Backlight Driver (SL Series)"
-	depends on BACKLIGHT_DEVICE && PXA_SHARPSL
+	depends on BACKLIGHT_DEVICE
 	default y
 	help
 	  If you have a Sharp Zaurus SL-C7xx, SL-Cxx00 or SL-6000x say y to enable the
diff -N -U3 -r -x CVS ../linux-2.6.20/drivers/video/backlight/corgi_bl.c ../linux-2.6.20-hh/drivers/video/backlight/corgi_bl.c
--- ../linux-2.6.20/drivers/video/backlight/corgi_bl.c	2007-02-04 18:44:54.000000000 +0000
+++ ../linux-2.6.20-hh/drivers/video/backlight/corgi_bl.c	2007-02-13 20:12:14.000000000 +0000
@@ -18,7 +18,7 @@
 #include <linux/mutex.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
-#include <asm/arch/sharpsl.h>
+#include <linux/corgi_bl.h>
 #include <asm/hardware/sharpsl_pm.h>
 
 static int corgibl_intensity;
diff -N -U3 -r -x CVS ../linux-2.6.20/include/linux/corgi_bl.h ../linux-2.6.20-hh/include/linux/corgi_bl.h
--- ../linux-2.6.20/include/linux/corgi_bl.h	1970-01-01 00:00:00.000000000 +0000
+++ ../linux-2.6.20-hh/include/linux/corgi_bl.h	2006-11-04 17:36:48.000000000 +0000
@@ -0,0 +1,10 @@
+/*
+ * Generic Backlight, from sharpsl.h
+ */
+struct corgibl_machinfo {
+	int max_intensity;
+	int default_intensity;
+	int limit_mask;
+	void (*set_bl_intensity)(int intensity);
+};
+extern void corgibl_limit_intensity(int limit);

WARNING: multiple messages have this Message-ID (diff)
From: Paul Sokolovsky <pmiscml@gmail.com>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org,
	<linux-fbdev-devel@lists.sourceforge.net>,
	Richard Purdie <rpurdie@rpsys.net>
Subject: Re: [PATCH 1/1] PXAFB: Support for backlight control
Date: Thu, 22 Feb 2007 12:33:35 +0200	[thread overview]
Message-ID: <1868738509.20070222123335@gmail.com> (raw)
In-Reply-To: <20070222083204.GN4641@enneenne.com>

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

Hello Rodolfo,

Thursday, February 22, 2007, 10:32:04 AM, you wrote:

> On Wed, Feb 21, 2007 at 06:26:08PM +0200, Paul Sokolovsky wrote:
k>>   Why? It's the same, except that it already exists, generic one (not
>> limited to pxafb), and requires 1 function (too bad that C doesn't
>> support lambda's):

> Ah, ok.

>>   I sent a bit of criticism for that too ;-). YMMV, but kernel
>> solutions are just bound to be pretty simple and generic and lack
>> any "niceties", which you'd likely want to do anyway eventually. For
>> example, what if you'll want to implement "fade out" effect for
>> keyboard backlight? Doing it in adhoc manner in kernel? Whereas with
>> the LCD classdev, you can write generic "fade out" trigger and
>> attach/detach it from userspace.

> I agree. I just wish to add a backlight support for my LCD and
> minikeypad.

> What do you suggest to me in order to accomplish such task?

  Well, I write exactly to share experience and work towards having
best practices for backlight, etc. control, reusable on wide range of
embedded/handheld devices.

  We in handhelds.org codebase have attached patch* to make corgi_bl
more suitable for general use. This patch was submitted to Richard
(so, more votes needed ;-) ). Otherwise, snippet I pasted is from real
machine implementation, HP iPaq h4000.

  As for keyboard backlight, another port we have, HTC Universal, has:
normal indicator LEDs, keyboard backlight, flashlight, ring vibra. All
of these are handled via Generic LED API:
http://handhelds.org/cgi-bin/cvsweb.cgi/linux/kernel26/arch/arm/mach-pxa/htcuniversal/htcuniversal_leds.c?rev=1.6&content-type=text/x-cvsweb-markup

  To show that it is not an anomaly, but hopefully, a trend, here's
vibra driver for the upcoming OpenMoko phone:
http://wiki.openmoko.org/wiki/Neo1973_Hardware#Vibrator

  So, if you have freedom to add keyboard backlight control to your
userspace, that would allow you to do many interesting things without
disturbing the kernel.

[*] Optimized for size, full one should patch <asm/arch/sharpsl.h> of
course.


> Thanks for your suggestions,

> Rodolfo




-- 
Best regards,
 Paul                            mailto:pmiscml@gmail.com

[-- Attachment #2: driver-corgi-bl-generalize.patch --]
[-- Type: application/octet-stream, Size: 1636 bytes --]

diff -N -U3 -r -x CVS ../linux-2.6.20/drivers/video/backlight/Kconfig ../linux-2.6.20-hh/drivers/video/backlight/Kconfig
--- ../linux-2.6.20/drivers/video/backlight/Kconfig	2007-02-04 18:44:54.000000000 +0000
+++ ../linux-2.6.20-hh/drivers/video/backlight/Kconfig	2006-12-18 12:41:24.000000000 +0000
@@ -44,7 +44,7 @@
 
 config BACKLIGHT_CORGI
 	tristate "Sharp Corgi Backlight Driver (SL Series)"
-	depends on BACKLIGHT_DEVICE && PXA_SHARPSL
+	depends on BACKLIGHT_DEVICE
 	default y
 	help
 	  If you have a Sharp Zaurus SL-C7xx, SL-Cxx00 or SL-6000x say y to enable the
diff -N -U3 -r -x CVS ../linux-2.6.20/drivers/video/backlight/corgi_bl.c ../linux-2.6.20-hh/drivers/video/backlight/corgi_bl.c
--- ../linux-2.6.20/drivers/video/backlight/corgi_bl.c	2007-02-04 18:44:54.000000000 +0000
+++ ../linux-2.6.20-hh/drivers/video/backlight/corgi_bl.c	2007-02-13 20:12:14.000000000 +0000
@@ -18,7 +18,7 @@
 #include <linux/mutex.h>
 #include <linux/fb.h>
 #include <linux/backlight.h>
-#include <asm/arch/sharpsl.h>
+#include <linux/corgi_bl.h>
 #include <asm/hardware/sharpsl_pm.h>
 
 static int corgibl_intensity;
diff -N -U3 -r -x CVS ../linux-2.6.20/include/linux/corgi_bl.h ../linux-2.6.20-hh/include/linux/corgi_bl.h
--- ../linux-2.6.20/include/linux/corgi_bl.h	1970-01-01 00:00:00.000000000 +0000
+++ ../linux-2.6.20-hh/include/linux/corgi_bl.h	2006-11-04 17:36:48.000000000 +0000
@@ -0,0 +1,10 @@
+/*
+ * Generic Backlight, from sharpsl.h
+ */
+struct corgibl_machinfo {
+	int max_intensity;
+	int default_intensity;
+	int limit_mask;
+	void (*set_bl_intensity)(int intensity);
+};
+extern void corgibl_limit_intensity(int limit);

  reply	other threads:[~2007-02-22 10:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 14:53 [PATCH 1/1] PXAFB: Support for backlight control Rodolfo Giometti
2007-02-21 16:00 ` Paul Sokolovsky
2007-02-21 16:00   ` Paul Sokolovsky
2007-02-21 16:12   ` Rodolfo Giometti
2007-02-21 16:26     ` Paul Sokolovsky
2007-02-21 16:26       ` Paul Sokolovsky
2007-02-22  8:32       ` Rodolfo Giometti
2007-02-22 10:33         ` Paul Sokolovsky [this message]
2007-02-22 10:33           ` Paul Sokolovsky
2007-02-22 16:37           ` Rodolfo Giometti
2007-02-22 17:11             ` Richard Purdie
2007-02-22 17:11               ` Richard Purdie
2007-02-28 16:54             ` [Linux-fbdev-devel] " James Simmons
2007-02-22  0:59 ` Richard Purdie
2007-02-22  0:59   ` Richard Purdie
2007-02-22  8:28   ` Rodolfo Giometti
2007-02-22  9:27     ` Richard Purdie
2007-02-22  9:27       ` Richard Purdie
2007-02-22  9:32       ` Rodolfo Giometti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1868738509.20070222123335@gmail.com \
    --to=pmiscml@gmail.com \
    --cc=giometti@enneenne.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.