Bug#611149: general and model-specific patches for pommed

2011-02-04 Thread Julien BLACHE
Andrew Engelbrecht naturalt...@gmail.com wrote:

Hi Andrew,

Your patches look good!

The fadeval typo was a nice catch, it's also evidence that not a lot of
people use pommed on PowerPC Macs anymore...

Regarding the keyboard ID patch:

 +#define ADB_PRODUCT_ID_KEYBOARD_32   0x22c4
 +/* Keyboard as found on the Powerbook5,4 */
 +#define ADB_PRODUCT_ID_KEYBOARD_54   0x22c3

I guess your keyboard is a QWERTY layout, right?

That would mean 0x22c3 is the ID for the ANSI keyboard, 0x22c4 the ID
for the ISO keyboard and the JIS keyboard would be 0x22c5.

JB.

-- 
 Julien BLACHE - Debian  GNU/Linux Developer - jbla...@debian.org 
 
 Public key available on http://www.jblache.org - KeyID: F5D6 5169 
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#611149: general and model-specific patches for pommed

2011-02-04 Thread Andrew Engelbrecht
Yes, my keyboard is QWERTY.

-Andrew

On Fri, Feb 4, 2011 at 1:10 PM, Julien BLACHE jbla...@debian.org wrote:
 Andrew Engelbrecht naturalt...@gmail.com wrote:

 Hi Andrew,

 Your patches look good!

 The fadeval typo was a nice catch, it's also evidence that not a lot of
 people use pommed on PowerPC Macs anymore...

 Regarding the keyboard ID patch:

 +#define ADB_PRODUCT_ID_KEYBOARD_32       0x22c4
 +/* Keyboard as found on the Powerbook5,4 */
 +#define ADB_PRODUCT_ID_KEYBOARD_54       0x22c3

 I guess your keyboard is a QWERTY layout, right?

 That would mean 0x22c3 is the ID for the ANSI keyboard, 0x22c4 the ID
 for the ISO keyboard and the JIS keyboard would be 0x22c5.

 JB.

 --
  Julien BLACHE - Debian  GNU/Linux Developer - jbla...@debian.org

  Public key available on http://www.jblache.org - KeyID: F5D6 5169
  GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#611149: general and model-specific patches for pommed

2011-02-03 Thread Andrew Engelbrecht
Hello Julien,

I've been having some fun diving into your code and making a few
adjustments. I've attached four very small patches (plus an
alternative) to this email. I'll also print them below and describe my
reasoning for their content; I hope you don't mind my doing so.

--- pommed/evdev.h.orig 2010-11-13 05:42:17.0 -0500
+++ pommed/evdev.h  2011-02-03 16:38:40.0 -0500
@@ -9,8 +9,10 @@
 /** ADB Devices **/

 /* Keyboard as found on the PowerBook3,2 */
-#define ADB_PRODUCT_ID_KEYBOARD   0x22c4
-/* Special PowerBook buttons as found on the PowerBook3,2 */
+#define ADB_PRODUCT_ID_KEYBOARD_32   0x22c4
+/* Keyboard as found on the Powerbook5,4 */
+#define ADB_PRODUCT_ID_KEYBOARD_54   0x22c3
+/* Special PowerBook buttons as found on the PowerBook3,2 and 5,4 */
 #define ADB_PRODUCT_ID_PBBUTTONS  0x771f


^ This adds the pid for the Powerbook5,4's ADB keyboard.


--- pommed/evdev.c.orig 2010-11-13 05:42:17.0 -0500
+++ pommed/evdev.c  2011-02-03 16:42:09.0 -0500
@@ -343,7 +343,8 @@
   if (id[ID_VENDOR] != 0x0001)
 return 0;

-  if (product == ADB_PRODUCT_ID_KEYBOARD)
+  if ((product == ADB_PRODUCT_ID_KEYBOARD_32)
+  || (product == ADB_PRODUCT_ID_KEYBOARD_54))
 {
   logdebug( - ADB keyboard\n);


^ This patch and the one above it solve the main bug I was posting,
which turns out was caused by rejecting the keyboard as not being an
internal one. That caused the auto-timer to time out regardless of
keyboard activity.


--- pommed/pmac/kbd_backlight.c.orig2010-11-13 05:42:17.0 -0500
+++ pommed/pmac/kbd_backlight.c 2011-02-03 20:27:42.0 -0500
@@ -228,7 +228,7 @@
{
  fadeval += step;

- adb_write_kbd_value(fd, (unsigned char)val);
+ adb_write_kbd_value(fd, (unsigned char)fadeval);

  logdebug(KBD backlight value faded to %d\n, (int)fadeval);


^ I stumbled-upon this one by mistake. I noticed that fadeval wasn't
being used in the for loop, and that it was used in this context by
kbd_lmu_backlight_set(), a similar function to this one.


--- pommed/evdev.c.orig 2011-02-03 22:21:13.0 -0500
+++ pommed/evdev.c  2011-02-03 22:38:13.0 -0500
@@ -170,6 +170,9 @@
  break;

kbd_backlight_step(STEP_DOWN);
+   if ((kbd_bck_info.level == KBD_BACKLIGHT_OFF)
+!(kbd_bck_info.inhibit  KBD_INHIBIT_USER))
+ kbd_backlight_inhibit_set(KBD_INHIBIT_USER);
break;

  case KEY_KBDILLUMUP:
@@ -178,6 +181,8 @@
if (!has_kbd_backlight())
  break;

+   if (kbd_bck_info.inhibit  KBD_INHIBIT_USER)
+ kbd_backlight_inhibit_clear(KBD_INHIBIT_USER);
kbd_backlight_step(STEP_UP);
break;


^ The first part of this last patch has the effect of inhibiting the
keyboard backlight if the user turns down the brightness with the
dimming key all the way to zero. This stops the backlight from doing
that boucing effect, caused by the ALS reactivating the backlight as
soon as it is reaches zero brightness. Pressing the toggle button
turns the backlight back on, as does the brightness increase button...

^ The second part allows the brightness up key to re-enable the
backlight if it has been turned-off by the user using the keyboard.

patch2_alt-pommed-evdev.c.diff is an alternative to the fourth patch
above (patch2-pommed-evdev.c.diff) with less condition testing, but
probably not as good perfomance-wise. Either one should be applied
after the first three.

Just as a note, I'm running the modified pommed right now and its
working great. Although, after toggling the backlight on for the first
time under a certain conditions, the backlight can be a bit low even
if it was bright before, but subsequent toggles behave normally as far
as I can tell. I don't know what causes that.

I hope that you like these patches and apply them to Squeeze. I
release them under the same liscense as pommed, or a later one at your
discretion. : )

Thanks for a great program!
-Andrew
--- pommed/evdev.h.orig	2010-11-13 05:42:17.0 -0500
+++ pommed/evdev.h	2011-02-03 16:38:40.0 -0500
@@ -9,8 +9,10 @@
 /** ADB Devices **/
 
 /* Keyboard as found on the PowerBook3,2 */
-#define ADB_PRODUCT_ID_KEYBOARD   0x22c4
-/* Special PowerBook buttons as found on the PowerBook3,2 */
+#define ADB_PRODUCT_ID_KEYBOARD_32   0x22c4
+/* Keyboard as found on the Powerbook5,4 */
+#define ADB_PRODUCT_ID_KEYBOARD_54   0x22c3
+/* Special PowerBook buttons as found on the PowerBook3,2 and 5,4 */
 #define ADB_PRODUCT_ID_PBBUTTONS  0x771f
 
 
--- pommed/evdev.c.orig	2010-11-13 05:42:17.0 -0500
+++ pommed/evdev.c	2011-02-03 16:42:09.0 -0500
@@ -343,7 +343,8 @@
   if (id[ID_VENDOR] != 0x0001)
 return 0;
 
-  if (product == ADB_PRODUCT_ID_KEYBOARD)
+  if ((product == ADB_PRODUCT_ID_KEYBOARD_32)
+  || (product == ADB_PRODUCT_ID_KEYBOARD_54))
 {