[oe-commits] org.oe.dev merge of '038fd3d7de50165436251d3b2878a79da0607174'

hrw commit openembedded-commits at lists.openembedded.org
Mon Dec 31 09:23:30 UTC 2007


merge of '038fd3d7de50165436251d3b2878a79da0607174'
     and '29321c56759c63d4b992d128e3457c12842cc569'

Author: hrw at openembedded.org
Branch: org.openembedded.dev
Revision: 79319c36369f0f923164de8c8120fde2d07b63a1
ViewMTN: http://monotone.openembedded.org/revision/info/79319c36369f0f923164de8c8120fde2d07b63a1
Files:
1
packages/linux/linux-rp-2.6.23/hrw-add-wcf11-to-hostap.patch
packages/backsaver
packages/backsaver/files
packages/backsaver/backsaver_1.0.bb
packages/backsaver/files/Makefile
packages/backsaver/files/backsaver.c
packages/linux/linux-rp-2.6.23/defconfig-poodle
packages/linux/linux-rp_2.6.23.bb
Diffs:

#
# mt diff -r038fd3d7de50165436251d3b2878a79da0607174 -r79319c36369f0f923164de8c8120fde2d07b63a1
#
# 
# 
# patch "packages/linux/linux-rp-2.6.23/hrw-add-wcf11-to-hostap.patch"
#  from [153189a76a51142fd7ddc71a5f22d17e03aa0009]
#    to [1efe4a4eb08036c0edbd2f569a061877139f11df]
# 
============================================================
--- packages/linux/linux-rp-2.6.23/hrw-add-wcf11-to-hostap.patch	153189a76a51142fd7ddc71a5f22d17e03aa0009
+++ packages/linux/linux-rp-2.6.23/hrw-add-wcf11-to-hostap.patch	1efe4a4eb08036c0edbd2f569a061877139f11df
@@ -21,7 +21,7 @@ Acked-by: Pavel Roskin <proski at gnu.org>
  	PCMCIA_DEVICE_PROD_ID123(
  		"corega", "WL PCCL-11", "ISL37300P",
  		0xa21501a, 0x59868926, 0xc9049a39),
-+	PCMCIA_DEVICE_PROD_ID1234(
++	PCMCIA_DEVICE_PROD_ID123(
 +		"The Linksys Group, Inc.", "Wireless Network CF Card", "ISL37300P",
 +		0xa5f472c2, 0x9c05598d, 0xc9049a39),
  	PCMCIA_DEVICE_NULL


#
# mt diff -r29321c56759c63d4b992d128e3457c12842cc569 -r79319c36369f0f923164de8c8120fde2d07b63a1
#
# 
# 
# add_dir "packages/backsaver"
# 
# add_dir "packages/backsaver/files"
# 
# add_file "packages/backsaver/backsaver_1.0.bb"
#  content [0d0c4f9a9ba80e7aa02bea5496a3c61232e9fa5d]
# 
# add_file "packages/backsaver/files/Makefile"
#  content [00a197ea09957210ac9dc033925345efc4f70e57]
# 
# add_file "packages/backsaver/files/backsaver.c"
#  content [d7564187fea35403095f8066877e39ae7b23ca9e]
# 
# patch "packages/linux/linux-rp-2.6.23/defconfig-poodle"
#  from [9089b908d87d4678ba180892f1b7031db32f17f1]
#    to [09d7ed3a857d79fd98b743e6eb0e827e353a6ada]
# 
# patch "packages/linux/linux-rp_2.6.23.bb"
#  from [603e0da5a4842a65698a8cd0d2464f9e910f9f52]
#    to [5d7d03fa911c5c9239bbe6af4d43a4bdbdfea39e]
# 
============================================================
--- packages/backsaver/backsaver_1.0.bb	0d0c4f9a9ba80e7aa02bea5496a3c61232e9fa5d
+++ packages/backsaver/backsaver_1.0.bb	0d0c4f9a9ba80e7aa02bea5496a3c61232e9fa5d
@@ -0,0 +1,14 @@
+DESCRIPTION = "Lightweight backlight saver daemon"
+SECTION = "base"
+LICENSE="GPL"
+
+PR = "r0"
+
+SRC_URI = "file://Makefile \
+    file://backsaver.c"
+
+S = ${WORKDIR}
+
+do_install () {
+	oe_runmake 'prefix=${D}' install
+}
============================================================
--- packages/backsaver/files/Makefile	00a197ea09957210ac9dc033925345efc4f70e57
+++ packages/backsaver/files/Makefile	00a197ea09957210ac9dc033925345efc4f70e57
@@ -0,0 +1,8 @@
+backsaver: backsaver.o
+
+backsaver.o: backsaver.c
+
+install:
+	install -d ${prefix}/usr/bin/
+	# Needs to be installed suid to access sysfs & dev/input
+	install -m 4755 backsaver ${prefix}/usr/bin/
============================================================
--- packages/backsaver/files/backsaver.c	d7564187fea35403095f8066877e39ae7b23ca9e
+++ packages/backsaver/files/backsaver.c	d7564187fea35403095f8066877e39ae7b23ca9e
@@ -0,0 +1,256 @@
+/* 
+ *  backsaver - Small backlight power saver daemon
+ *
+ *  This app relies on contemporary Linux 2.6 intefaces, like
+ *  backlight class dev and generic input devices. Legacy interfaces
+ *  are not supported by design.
+ *
+ *  Copyright (C) 2007, 2008 Paul Sokolovsky <pmiscml at gmail.com>
+ *   
+ *  This program is free software; you can redistribute it and/or 
+ *  modify it under the terms of the GNU General Public License 
+ *  as published by the Free Software Foundation; either version 
+ *  2 of the License, or (at your option) any later version. 
+ */
+
+#include <getopt.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int opt_verbose;
+int opt_timeout = 2;
+int opt_power;
+int opt_brightness = -1;
+
+char readbuf[256];
+fd_set read_fds;
+fd_set work_fds;
+int fds[32];
+
+int bl_state = 1;
+
+#define BL_PATH "/sys/class/backlight/"
+
+/* Backlight device properties */
+char bldev_brightness_path[256] = BL_PATH;
+char bldev_power_path[256] = BL_PATH;
+int  bldev_max_brightness;
+int  bldev_saved_brightness;
+int  bldev_dim_brightness;
+
+void fatal(char *msg) 
+{
+    fprintf(stderr, "%s\n", msg);
+    exit(1);
+}
+
+int sysfs_get_value(char *fname)
+{
+    char buf[64];
+    int fd = open(fname, O_RDONLY);
+    int sz = read(fd, buf, sizeof(buf) - 1);
+    buf[sz] = 0;
+    close(fd);
+    return atoi(buf);
+}
+
+void sysfs_set_value(char *fname, int val)
+{
+    char buf[64];
+    int fd = open(fname, O_WRONLY);
+    int sz = sprintf(buf, "%d\n", val);
+    write(fd, buf, sz);
+    close(fd);
+}
+
+char *bldev_scan()
+{
+    static char name[256];
+    DIR *dir;
+    struct dirent *de;
+    int more_than_one = 0;
+    
+    dir = opendir(BL_PATH);
+    if (!dir)
+	fatal("Backlight device class does not seem to be support by kernel (" BL_PATH " is absent)");
+
+    *name = 0;
+    while (de = readdir(dir)) {
+	if (de->d_name[0] == '.')
+	    continue;
+	if (*name == 0) {
+	    strcpy(name, de->d_name);
+	} else {
+	    more_than_one = 1;
+	    break;
+	}
+    }
+
+    closedir(dir);
+    if (*name == 0)
+	fatal("There does not seem to be any backlight device available (" BL_PATH " is empty)");
+    if (more_than_one)
+	fatal("There seems to be several backlight devices available, use --device= option");
+
+    return name;
+}
+
+void bldev_init(char *bldev)
+{
+    strcat(bldev_brightness_path, bldev);
+    strcat(bldev_brightness_path, "/brightness");
+    strcat(bldev_power_path, bldev);
+    strcat(bldev_power_path, "/power");
+
+    char buf[PATH_MAX];
+    memcpy(buf, BL_PATH, sizeof(BL_PATH));
+    strcat(buf, bldev);
+    strcat(buf, "/max_brightness");
+    bldev_max_brightness = sysfs_get_value(buf);
+    
+    bldev_dim_brightness = bldev_max_brightness * opt_brightness / 100;
+}
+
+void set_backlight(int state) 
+{
+    if (!bl_state) {
+	if (opt_verbose)
+	    printf("BL off\n");
+	if (opt_power) {
+	    sysfs_set_value(bldev_power_path, 4);
+	} else {
+	    bldev_saved_brightness = sysfs_get_value(bldev_brightness_path);
+	    sysfs_set_value(bldev_brightness_path, bldev_dim_brightness);
+	}
+    } else {
+	if (opt_verbose)
+	    printf("BL on\n");
+	if (opt_power) {
+	    sysfs_set_value(bldev_power_path, 0);
+	} else {
+	    sysfs_set_value(bldev_brightness_path, bldev_saved_brightness);
+	}
+    }
+}
+
+#define INPUT_PATH "/dev/input/"
+
+int main_loop(int argc, char *argv[], int argstart) 
+{
+    fd_set read_fds;
+    struct timeval timeout;
+    int i, maxfd = 0, numfd = 0;
+    
+    FD_ZERO(&read_fds);
+    
+    if (argstart == argc) {
+	static char path[256] = INPUT_PATH;
+        DIR *dir;
+	struct dirent *de;
+	struct stat stat;
+    
+	dir = opendir(INPUT_PATH);
+	if (!dir)
+	    fatal("Cannot open generic input device directory (" INPUT_PATH " is absent)");
+
+	while (de = readdir(dir)) {
+	    if (de->d_name[0] == '.')
+		continue;
+	    strcpy(path + sizeof(INPUT_PATH) - 1, de->d_name);
+	    
+	    if (lstat(path, &stat))
+		fatal("Cannot stat input device to monitor");
+	    if (S_ISLNK(stat.st_mode)) {
+		if (opt_verbose)
+		    printf("Skipping symlink %s\n", path);
+		continue;
+	    }
+	    if (opt_verbose)
+		printf("Using %s\n", path);
+
+    	    int fd = open(path, O_RDONLY);
+	    if (fd == -1)
+		fatal("Cannot open input device to monitor");
+	    if (fd > maxfd)
+		maxfd = fd;
+	    fds[numfd++] = fd;
+	    FD_SET(fd, &read_fds);
+	}
+
+	closedir(dir);
+    } else {
+        for (i = argstart; i < argc; i++) {
+	    if (opt_verbose)
+		printf("Using: %s\n", argv[i]);
+    	    int fd = open(argv[i], O_RDONLY);
+	    if (fd == -1)
+		fatal("Cannot open input device to monitor");
+	    if (fd > maxfd)
+		maxfd = fd;
+	    fds[numfd++] = fd;
+	    FD_SET(fd, &read_fds);
+        }
+    }
+
+    timeout.tv_usec = 0;
+
+    while (1) {
+	memcpy(&work_fds, &read_fds, sizeof(read_fds));
+	timeout.tv_sec = opt_timeout;
+	i = select(maxfd + 1, &work_fds, NULL, NULL, &timeout);
+	if (opt_verbose)
+    	    printf("Select returned: %d\n", i);
+	if (i > 0) {
+	    if (!bl_state) {
+		bl_state = 1;
+		set_backlight(bl_state);
+	    }
+	    for (i = 0; i < numfd; i++) {
+		if (FD_ISSET(fds[i], &work_fds)) {
+		    int sz = read(fds[i], readbuf, sizeof(readbuf));
+		    if (opt_verbose)
+			printf("Discarded %d bytes from fd %d\n", sz, fds[i]);
+		}
+	    }
+	} else {
+	    if (bl_state) {
+		bl_state = 0;
+		set_backlight(bl_state);
+	    }
+	}
+	    
+    }
+}
+
+struct option options[] = {
+    { "verbose", no_argument, &opt_verbose, 1 },
+    { "timeout", required_argument, NULL, 't' },
+    { "power", no_argument, &opt_power, 1 },
+    { "brightness", required_argument, NULL, 'b' },
+    NULL
+}; 
+int main(int argc, char *argv[])
+{
+    int opt;
+    while ((opt = getopt_long(argc, argv, "?h", options, NULL)) != -1) {
+	switch (opt) {
+	case 't':
+	    opt_timeout = atoi(optarg);
+	    break;
+	case 'b':
+	    opt_brightness = atoi(optarg);
+	    break;
+	}
+    }
+    printf("%d\n", optind);
+    
+    char *bldev = bldev_scan();
+    bldev_init(bldev);
+    
+    return main_loop(argc, argv, optind);
+}
============================================================
--- packages/linux/linux-rp-2.6.23/defconfig-poodle	9089b908d87d4678ba180892f1b7031db32f17f1
+++ packages/linux/linux-rp-2.6.23/defconfig-poodle	09d7ed3a857d79fd98b743e6eb0e827e353a6ada
@@ -1136,11 +1136,14 @@ CONFIG_SND_SOC=m
 # System on Chip audio support
 #
 CONFIG_SND_SOC=m
-# CONFIG_SND_PXA2XX_SOC is not set
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_I2S=m
+CONFIG_SND_PXA2XX_SOC_POODLE=m
 
 #
 # SoC Audio support for SuperH
 #
+CONFIG_SND_SOC_WM8731=m
 
 #
 # Open Sound System
============================================================
--- packages/linux/linux-rp_2.6.23.bb	603e0da5a4842a65698a8cd0d2464f9e910f9f52
+++ packages/linux/linux-rp_2.6.23.bb	5d7d03fa911c5c9239bbe6af4d43a4bdbdfea39e
@@ -1,6 +1,6 @@ require linux-rp.inc
 require linux-rp.inc
 
-PR = "r18"
+PR = "r19"
 
 DEFAULT_PREFERENCE_qemuarm = "-1"
 DEFAULT_PREFERENCE_qemux86 = "-1"
@@ -44,6 +44,7 @@ SRC_URI = "${KERNELORG_MIRROR}pub/linux/
            ${RPSRC}/pxa25x_suspend_fixes-r0.patch;patch=1 \
            ${RPSRC}/poodle_lcd_hack-r0.patch;patch=1 \
            ${RPSRC}/poodle_asoc_fix-r0.patch;patch=1 \
+           ${RPSRC}/locomo_led_fix-r0.patch;patch=1 \
            file://w100fb-unused-var.patch;patch=1 \
            file://hostap-monitor-mode.patch;patch=1 \
            file://serial-add-support-for-non-standard-xtals-to-16c950-driver.patch;patch=1 \
@@ -100,7 +101,7 @@ SRC_URI_append_poodle = "\
 "
 
 SRC_URI_append_poodle = "\
-           ${RPSRC}/poodle_serial_vcc.patch;patch=1 \
+           ${RPSRC}/poodle_serial_vcc-r0.patch;patch=1 \
 "
 
 SRC_URI_append_tosa = "\






More information about the Openembedded-commits mailing list