as 比尔盖子 has not yet respond to this bug, remove it now. add if he fix these issues
This commit is contained in:
microcai committed 2015-08-28 13:36:08 +08:00
1 parent 828af60e8b
commit e5a37ca9a4
27 files changed
-424247

No files matched your search

-32
View File
@@ -1,32 +0,0 @@
DIST 3.18-ck1-broken-out.tar.bz2 60574 SHA256 acf220224c0827657bca36610d54b9393547f973459d2c37d5870ecae8e4d2d9
DIST 4.0-ck1-broken-out.tar.bz2 61005 SHA256 aea4cd03dee4c1c3f99089354565db6ed07b3c1ce033d9405aacb2fe99eb8ac2
DIST 4.1-ck2-broken-out.tar.bz2 61946 SHA256 5424b528b921eb5bcc1068a9425a3c7fb7508809bb8dee468b6418c2fcb33c5d
DIST aufs-sources-3.18.1+_p20150518.tar.xz 167248 SHA256 087c07d19f9da0315ce3170bb31f4e0b667caa78343e5daf01a721509b0cfe1f
DIST aufs-sources-4.0_p20150518.tar.xz 166024 SHA256 da653585bfd610bbc874b9f51c76777511a9b15eb662917f653af1ef8d255936
DIST aufs-sources-4.1_p20150629.tar.xz 166912 SHA256 b9927b15bfc6be7b72206529402b33ceb32b72fd36c84e28f34fb73218575cd0
DIST deblob-3.18 127087 SHA256 c720eabb3911f8dfa4398c4250853df4633018abebc01a509ee4a283c3e00941
DIST deblob-4.0 129952 SHA256 c3d8e9a9728d5c1fc11b1112f5343b14e46a8cf2880e10399a840bc94b6e2ad3
DIST deblob-4.1 130695 SHA256 2888a5a3b5e8e9ec242e4d702582fa1d739a1274fcd94643a9fb3516a210a8a7
DIST deblob-check-3.18 654232 SHA256 30f22602b6ddf2cbccc16ef25fdc4d92755f3972e1c671d7cab8b9d6865eb155
DIST deblob-check-4.0 670921 SHA256 042b511913187672d9a0512765e662ba5d4283812ebebf424f778eb08fa359bc
DIST deblob-check-4.1 674781 SHA256 54aa33e23a31ead6f982b830be86003c306b88f0d0a9f96c7dc66fe7cd274acb
DIST genpatches-3.18-16.base.tar.xz 444356 SHA256 9868f2d0a808026bbbe276193ef98a5bb65e881f6dbf347940d338e347b5a269
DIST genpatches-3.18-16.experimental.tar.xz 61624 SHA256 1bab18d2a9e3995dc466533d8df2bff16ebac6170e11bf31b6c51de3170b5696
DIST genpatches-3.18-16.extras.tar.xz 16188 SHA256 0861244845ec3dc87c5cc070ad413ac98fb435e51bc20cd41354cef8967216b9
DIST genpatches-4.0-7.base.tar.xz 159536 SHA256 9d1e84cb5133489f76aa3ee4ffdc6a28331bed0c6557e383bdf288ec9461ff3c
DIST genpatches-4.0-7.experimental.tar.xz 61636 SHA256 419952353e98ed36dcdb9a45fe73b52449ec6b6d969dbf228f4dfc2da880f261
DIST genpatches-4.0-7.extras.tar.xz 16276 SHA256 911ccb197f2c9514d8b4eacbdb7c059d709f64cb97632eae85cda99d61596ba4
DIST genpatches-4.1-10.base.tar.xz 210140 SHA256 d0ac2a9175fe72d0ddf23307a9c8d06102f48220886468e4c19c92855024d829
DIST genpatches-4.1-10.experimental.tar.xz 215988 SHA256 b4ab62875339a60623db576533638e12342815ba93091d16dca7a975c10ebf4c
DIST genpatches-4.1-10.extras.tar.xz 16184 SHA256 5d4492d3d535b3904fe917532b52d314bd52566832acdb1d01362e03472945da
DIST linux-3.18.tar.xz 80934708 SHA256 becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd
DIST linux-4.0.tar.xz 82313052 SHA256 0f2f7d44979bc8f71c4fc5d3308c03499c26a824dd311fdf6eef4dee0d7d5991
DIST linux-4.1.tar.xz 83017828 SHA256 caf51f085aac1e1cea4d00dbbf3093ead07b551fc07b31b2a989c05f8ea72d9f
DIST reiser4-for-3.18.6.patch.gz 623675 SHA256 067b7d297f556048d7dc1134d1764ed4db95a40e03ef57accf3d2477162d7862
DIST reiser4-for-4.0.4.patch.gz 623200 SHA256 1a8acae4f8a3d36d72d819e78b18464054503a8bf7221d5fef2625f030825521
DIST reiser4-for-4.1.4.patch.gz 623346 SHA256 28d775e97784e047be6c1279ec01d5ded6be8dffa6214dc6c6871d49b04ed483
DIST tuxonice-for-linux-3.18.13-2015-05-11.patch.bz2 127804 SHA256 2a95a32caa69c9fd2e3a2c1473f491f8c8b7809690abcd9a571702df662c6add
DIST tuxonice-for-linux-4.0.4-2015-06-04.patch.bz2 134035 SHA256 fe591fb892e1e4c8438314357e1e78ec2f2f40a68f87f1b334edb5ffe8069dac
DIST tuxonice-for-linux-4.1.5-2015-08-14.patch.bz2 133858 SHA256 ada3a931774838dc4752d1b2ba3000f35ac9dd75456bd7e2f1f0d88f2fc0c87c
DIST uksm-0.1.2.3-for-v3.18.patch 176801 SHA256 8f810dd873e37d6144f70b440880f4fac9fb0f58bf0486bb6e873e38a74c010f
DIST uksm-0.1.2.4-beta-for-linux-v4.0.patch 177017 SHA256 440a76585338fd57f93f381bf19260347ffe82fa1520f5cf57b6343807db634d
@@ -1,33 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
K_DEBLOB_AVAILABLE="1"
ck_version="1"
gentoo_version="16"
tuxonice_version="2015.05.11"
uksm_version="0.1.2.3"
aufs_kernel_version="3.18.1+_p20150518"
cjktty_kernel_version="3.18.14"
reiser4_kernel_version="3.18.6"
tuxonice_kernel_version="3.18.13"
uksm_kernel_version="3.18.0"
KEYWORDS="x86 amd64 mips"
SUPPORTED_USE="+additional +aufs +cjktty +ck +experimental +gentoo +uksm +reiser4 +thinkpad +tuxonice"
UNSUPPORTED_USE=""
UNIPATCH_EXCLUDE=""
OVERRIDE_AUFS_PATCHES=""
OVERRIDE_CJKTTY_PATCHES="1"
OVERRIDE_CK_PATCHES=""
OVERRIDE_REISER4_PATCHES=""
OVERRIDE_TUXONICE_PATCHES=""
OVERRIDE_UKSM_PATCHES=""
inherit e-sources
@@ -1,33 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
K_DEBLOB_AVAILABLE="1"
ck_version="1"
gentoo_version="7"
tuxonice_version="2015.06.04"
uksm_version="0.1.2.4-beta"
aufs_kernel_version="4.0_p20150518"
cjktty_kernel_version="3.18.14"
reiser4_kernel_version="4.0.4"
tuxonice_kernel_version="4.0.4"
uksm_kernel_version="4.0.0"
KEYWORDS="~amd64 ~x86 ~mips"
SUPPORTED_USE="+additional +aufs +ck +cjktty +experimental +gentoo +uksm +reiser4 +thinkpad +tuxonice"
UNSUPPORTED_USE=""
UNIPATCH_EXCLUDE=""
OVERRIDE_AUFS_PATCHES=""
OVERRIDE_CJKTTY_PATCHES="1"
OVERRIDE_CK_PATCHES=""
OVERRIDE_REISER4_PATCHES=""
OVERRIDE_TUXONICE_PATCHES=""
OVERRIDE_UKSM_PATCHES=""
inherit e-sources
@@ -1,33 +0,0 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
K_DEBLOB_AVAILABLE="1"
ck_version="2"
gentoo_version="10"
tuxonice_version="2015.08.14"
#uksm_version=""
aufs_kernel_version="4.1_p20150629"
cjktty_kernel_version="3.18.14"
reiser4_kernel_version="4.1.4"
tuxonice_kernel_version="4.1.5"
#uksm_kernel_version=""
KEYWORDS="~amd64 ~x86 ~mips"
SUPPORTED_USE="+additional +aufs +cjktty +ck +experimental +gentoo +reiser4 +thinkpad +tuxonice"
UNSUPPORTED_USE="uksm"
UNIPATCH_EXCLUDE=""
OVERRIDE_AUFS_PATCHES=""
OVERRIDE_CJKTTY_PATCHES="1"
OVERRIDE_CK_PATCHES=""
OVERRIDE_REISER4_PATCHES=""
OVERRIDE_TUXONICE_PATCHES=""
OVERRIDE_UKSM_PATCHES=""
inherit e-sources
File diff suppressed because it is too large. Load diff
@@ -1,56 +0,0 @@
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 978db34..0c7a121 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP
def_bool y
depends on VT_CONSOLE && PM_SLEEP
+config NR_TTY_DEVICES
+ int "Maximum tty device number"
+ depends on VT
+ range 12 63
+ default 63
+ ---help---
+ This option is used to change the number of tty devices in /dev.
+ The default value is 63. The lowest number you can set is 12,
+ 63 is also the upper limit so we don't overrun the serial
+ consoles.
+
+ If unsure, say 63.
+
config HW_CONSOLE
bool
depends on VT && !UML
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
index 4b59a26..b494f6a 100644
--- a/include/uapi/linux/vt.h
+++ b/include/uapi/linux/vt.h
@@ -3,12 +3,26 @@
/*
+ * We will make this definition solely for the purpose of making packages
+ * such as splashutils build, because they can not understand that
+ * NR_TTY_DEVICES is defined in the kernel configuration.
+ */
+#ifndef CONFIG_NR_TTY_DEVICES
+#define CONFIG_NR_TTY_DEVICES 63
+#endif
+
+/*
* These constants are also useful for user-level apps (e.g., VC
* resizing).
*/
#define MIN_NR_CONSOLES 1 /* must be at least 1 */
-#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
-#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
+
+/*
+ * NR_TTY_DEVICES:
+ * Value MUST be at least 11 and must never be higher then 63
+ */
+#define MAX_NR_CONSOLES CONFIG_NR_TTY_DEVICES /* serial lines start above this */
+#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES /* must be root to allocate above this */
/* Note: the ioctl VT_GETSTATE does not work for
consoles 16 and higher (since it returns a short) */
@@ -1,333 +0,0 @@
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 01d1c18..2a02d82 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -26,7 +26,8 @@
static int max_ypos = 25, max_xpos = 80;
static int current_ypos = 25, current_xpos;
-static void early_vga_write(struct console *con, const char *str, unsigned n)
+static void early_vga_write(struct console *con, const char *str, unsigned n,
+ unsigned int loglevel)
{
char c;
int i, k, j;
@@ -104,7 +105,8 @@ static int early_serial_putc(unsigned char ch)
return timeout ? 0 : -1;
}
-static void early_serial_write(struct console *con, const char *s, unsigned n)
+static void early_serial_write(struct console *con, const char *s, unsigned n,
+ unsigned int loglevel)
{
while (*s && n-- > 0) {
if (*s == '\n')
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index dc34a5b..020118b 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -116,7 +116,7 @@ static void braille_write(u16 *buf)
*c++ = csum;
*c++ = ETX;
- braille_co->write(braille_co, data, c - data);
+ braille_co->write(braille_co, data, c - data, 0);
}
/* Follow the VC cursor*/
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ba2f5e7..b649820 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -728,7 +728,8 @@ static int netconsole_netdev_event(struct notifier_block *this,
.notifier_call = netconsole_netdev_event,
};
-static void write_msg(struct console *con, const char *msg, unsigned int len)
+static void write_msg(struct console *con, const char *msg, unsigned int len,
+ unsigned int loglevel)
{
int frag, left;
unsigned long flags;
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 978db34..63e7160 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -75,6 +75,111 @@ config VT_CONSOLE_SLEEP
def_bool y
depends on VT_CONSOLE && PM_SLEEP
+menuconfig VT_CKO
+ bool "Colored kernel message output"
+ depends on VT_CONSOLE
+ ---help---
+ This option enables kernel messages to be emitted in
+ colors other than the default.
+
+ The color value you need to enter is composed (OR-ed)
+ of a foreground and a background color.
+
+ Foreground:
+ 0x00 = black, 0x08 = dark gray,
+ 0x01 = red, 0x09 = light red,
+ 0x02 = green, 0x0A = light green,
+ 0x03 = brown, 0x0B = yellow,
+ 0x04 = blue, 0x0C = light blue,
+ 0x05 = magenta, 0x0D = light magenta,
+ 0x06 = cyan, 0x0E = light cyan,
+ 0x07 = gray, 0x0F = white,
+
+ (Foreground colors 0x08 to 0x0F do not work when a VGA
+ console font with 512 glyphs is used.)
+
+ Background:
+ 0x00 = black, 0x40 = blue,
+ 0x10 = red, 0x50 = magenta,
+ 0x20 = green, 0x60 = cyan,
+ 0x30 = brown, 0x70 = gray,
+
+ For example, 0x1F would yield white on red.
+
+ If unsure, say N.
+
+config VT_PRINTK_EMERG_COLOR
+ hex "Emergency messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel emergency messages will
+ be printed to the console.
+
+config VT_PRINTK_ALERT_COLOR
+ hex "Alert messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel alert messages will
+ be printed to the console.
+
+config VT_PRINTK_CRIT_COLOR
+ hex "Critical messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel critical messages will
+ be printed to the console.
+
+config VT_PRINTK_ERR_COLOR
+ hex "Error messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel error messages will
+ be printed to the console.
+
+config VT_PRINTK_WARNING_COLOR
+ hex "Warning messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel warning messages will
+ be printed to the console.
+
+config VT_PRINTK_NOTICE_COLOR
+ hex "Notice messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel notice messages will
+ be printed to the console.
+
+config VT_PRINTK_INFO_COLOR
+ hex "Information messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel information messages will
+ be printed to the console.
+
+config VT_PRINTK_DEBUG_COLOR
+ hex "Debug messages color"
+ range 0x00 0xFF
+ depends on VT_CKO
+ default 0x07
+ ---help---
+ This option defines with which color kernel debug messages will
+ be printed to the console.
+
config HW_CONSOLE
bool
depends on VT && !UML
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index e33d38cb..d73fdfb 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2850,7 +2850,8 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)
* The console_lock must be held when we get here.
*/
static void
-serial8250_console_write(struct console *co, const char *s, unsigned int count)
+serial8250_console_write(struct console *co, const char *s, unsigned int count,
+ unsigned int loglevel)
{
struct uart_8250_port *up = &serial8250_ports[co->index];
struct uart_port *port = &up->port;
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index c100d63..bb28b49 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -98,7 +98,7 @@ static void __init serial_putc(struct uart_port *port, int c)
}
static void __init early_serial8250_write(struct console *console,
- const char *s, unsigned int count)
+ const char *s, unsigned int count, unsigned int loglevel)
{
struct uart_port *port = &early_device.port;
unsigned int ier;
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 61b1137..f1fa906 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -71,6 +71,7 @@
*/
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/tty.h>
@@ -2430,16 +2431,44 @@ int vt_kmsg_redirect(int new)
return kmsg_con;
}
+#ifdef CONFIG_VT_CKO
+static unsigned int printk_color[8] __read_mostly = {
+ CONFIG_VT_PRINTK_EMERG_COLOR, /* KERN_EMERG */
+ CONFIG_VT_PRINTK_ALERT_COLOR, /* KERN_ALERT */
+ CONFIG_VT_PRINTK_CRIT_COLOR, /* KERN_CRIT */
+ CONFIG_VT_PRINTK_ERR_COLOR, /* KERN_ERR */
+ CONFIG_VT_PRINTK_WARNING_COLOR, /* KERN_WARNING */
+ CONFIG_VT_PRINTK_NOTICE_COLOR, /* KERN_NOTICE */
+ CONFIG_VT_PRINTK_INFO_COLOR, /* KERN_INFO */
+ CONFIG_VT_PRINTK_DEBUG_COLOR, /* KERN_DEBUG */
+};
+module_param_array(printk_color, uint, NULL, S_IRUGO | S_IWUSR);
+
+static inline void vc_set_color(struct vc_data *vc, unsigned char color)
+{
+ vc->vc_color = color_table[color & 0xF] |
+ (color_table[(color >> 4) & 0x7] << 4) |
+ (color & 0x80);
+ update_attr(vc);
+}
+#else
+static unsigned int printk_color[8];
+static inline void vc_set_color(const struct vc_data *vc, unsigned char c)
+{
+}
+#endif
+
/*
* Console on virtual terminal
*
* The console must be locked when we get here.
*/
-static void vt_console_print(struct console *co, const char *b, unsigned count)
+static void vt_console_print(struct console *co, const char *b, unsigned count,
+ unsigned int loglevel)
{
struct vc_data *vc = vc_cons[fg_console].d;
- unsigned char c;
+ unsigned char current_color, c;
static DEFINE_SPINLOCK(printing_lock);
const ushort *start;
ushort cnt = 0;
@@ -2475,11 +2504,20 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
start = (ushort *)vc->vc_pos;
+ /*
+ * We always get a valid loglevel - <8> and "no level" is transformed
+ * to <4> in the typical kernel.
+ */
+ current_color = printk_color[loglevel];
+ vc_set_color(vc, current_color);
+
+
/* Contrived structure to try to emulate original need_wrap behaviour
* Problems caused when we have need_wrap set on '\n' character */
while (count--) {
c = *b++;
if (c == 10 || c == 13 || c == 8 || vc->vc_need_wrap) {
+ vc_set_color(vc, vc->vc_def_color);
if (cnt > 0) {
if (CON_IS_VISIBLE(vc))
vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, vc->vc_x);
@@ -2492,6 +2530,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
bs(vc);
start = (ushort *)vc->vc_pos;
myx = vc->vc_x;
+ vc_set_color(vc, current_color);
continue;
}
if (c != 13)
@@ -2499,6 +2538,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
cr(vc);
start = (ushort *)vc->vc_pos;
myx = vc->vc_x;
+ vc_set_color(vc, current_color);
if (c == 10 || c == 13)
continue;
}
@@ -2521,6 +2561,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
vc->vc_need_wrap = 1;
}
}
+ vc_set_color(vc, vc->vc_def_color);
set_cursor(vc);
notify_update(vc);
diff --git a/include/linux/console.h b/include/linux/console.h
index 7571a16..af01c35 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -118,7 +118,7 @@ static inline int con_debug_leave(void)
struct console {
char name[16];
- void (*write)(struct console *, const char *, unsigned);
+ void (*write)(struct console *, const char *, unsigned, unsigned int);
int (*read)(struct console *, char *, unsigned);
struct tty_driver *(*device)(struct console *, int *);
void (*unblank)(void);
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index be7c86b..8517cbe 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1282,7 +1282,7 @@ static void call_console_drivers(int level, const char *text, size_t len)
if (!cpu_online(smp_processor_id()) &&
!(con->flags & CON_ANYTIME))
continue;
- con->write(con, text, len);
+ con->write(con, text, len, level);
}
}
@@ -1732,7 +1732,7 @@ void early_vprintk(const char *fmt, va_list ap)
char buf[512];
int n = vscnprintf(buf, sizeof(buf), fmt, ap);
- early_console->write(early_console, buf, n);
+ early_console->write(early_console, buf, n, 0);
}
}
@@ -1,24 +0,0 @@
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/tty.c linux-2.6.23-rc9/arch/i386/boot/tty.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/tty.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/tty.c 2007-10-06 12:37:47.000000000 +0200
@@ -92,7 +92,7 @@
int getchar_timeout(void)
{
- int cnt = 30;
+ int cnt = 3;
int t0, t1;
t0 = gettime();
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/video.c linux-2.6.23-rc9/arch/i386/boot/video.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/video.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/video.c 2007-10-06 12:36:05.000000000 +0200
@@ -329,7 +329,7 @@
unsigned int sel;
puts("Press <ENTER> to see video modes available, "
- "<SPACE> to continue, or wait 30 sec\n");
+ "<SPACE> to continue, or wait 3 sec\n");
kbd_flush();
while (1) {
@@ -1,295 +0,0 @@
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 86c5236..9b8a637 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -46,6 +46,7 @@ detailed description):
- Fan control and monitoring: fan speed, fan enable/disable
- WAN enable and disable
- UWB enable and disable
+ - Charging control
A compatibility table by model and feature is maintained on the web
site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -1352,6 +1353,20 @@ Sysfs notes:
rfkill controller switch "tpacpi_uwb_sw": refer to
Documentation/rfkill.txt for details.
+Charging control
+----------------
+sysfs attribute groups: BAT0, BAT1, and so on, depending on how many batteries
+are supported by the embedded controller.
+
+This feature controls the battery charging process.
+
+battery sysfs attribute: start_charge_thresh
+
+ A percentage value from 0-99%, controlling when charging should start
+
+battery sysfs attribute: stop_charge_thresh
+
+ A percentage value from 1-100%, controlling when charging should stop
Multiple Commands, Module Parameters
------------------------------------
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 03ca6c1..fa29d82 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -323,6 +323,7 @@ static struct {
u32 sensors_pdrv_attrs_registered:1;
u32 sensors_pdev_attrs_registered:1;
u32 hotkey_poll_active:1;
+ u32 battery:1;
} tp_features;
static struct {
@@ -8350,6 +8351,236 @@ static struct ibm_struct fan_driver_data = {
.resume = fan_resume,
};
+
+/*************************************************************************
+ * Battery subdriver
+ */
+
+/* Modify battery_init() if you modify them */
+#define BATTERY_MAX_COUNT 3
+#define BATTERY_MAX_ATTRS 2
+
+static struct battery {
+ char name[3 + 1 + 1];
+ struct attribute_set *set;
+ struct dev_ext_attribute attributes[BATTERY_MAX_ATTRS];
+} batteries[BATTERY_MAX_COUNT];
+
+static int battery_attribute_get_battery(struct device_attribute *attr)
+{
+ return (int) (unsigned long) container_of(attr,
+ struct dev_ext_attribute,
+ attr)->var;
+}
+
+static int battery_read_threshold(int bat, char *threshold)
+{
+ int result = 0;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &result, threshold,
+ "dd", bat) || result < 0)
+ return -EIO;
+
+ /* Translate 0 to 100 for stop threshold */
+ if (strcmp(threshold, "BCSG") == 0 && (result & 0xFF) == 0)
+ return 100;
+ /* Bits 0 - 7 contain the current threshold */
+ return result & 0xFF;
+}
+
+static int battery_write_stop_charge_thresh(int bat, int value,
+ bool adjust_start);
+
+static int battery_write_start_charge_thresh(int bat, int value,
+ bool adjust_stop)
+{
+ int res = 0;
+
+ if (value < 0 || value > 99)
+ return -EINVAL;
+
+ /* Adjust the stop value if stop < new start value */
+ if (adjust_stop) {
+ int stop = battery_read_threshold(bat, "BCSG");
+ if (stop < 0)
+ return stop;
+ if (stop <= value)
+ res = battery_write_stop_charge_thresh(bat, value + 1,
+ FALSE);
+ if (res)
+ return res;
+ }
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BCCS", "dd",
+ value | (bat << 8)) || res < 0)
+ return -EIO;
+
+ return 0;
+}
+
+static int battery_write_stop_charge_thresh(int bat, int value,
+ bool adjust_start)
+{
+ int res = 0;
+
+ if (value < 1 || value > 100)
+ return -EINVAL;
+
+ /* Adjust the start value if start > new stop value */
+ if (adjust_start) {
+ int start = battery_read_threshold(bat, "BCTG");
+ if (start < 0)
+ return start;
+ if (value != 0)
+ res = battery_write_start_charge_thresh(bat, value - 1,
+ FALSE);
+ if (res)
+ return res;
+ }
+
+ /* 0 means default which seems to be 100%. */
+ if (value == 100)
+ value = 0;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BCSS", "dd",
+ value | (bat << 8)) || res < 0)
+ return -EIO;
+
+ return 0;
+}
+
+static ssize_t battery_start_charge_thresh_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res)
+ return res;
+ res = battery_write_start_charge_thresh(bat, value, TRUE);
+ return res ? res : count;
+}
+
+static ssize_t battery_stop_charge_thresh_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res)
+ return res;
+ res = battery_write_stop_charge_thresh(bat, value, TRUE);
+ return res ? res : count;
+}
+
+static ssize_t battery_start_charge_thresh_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value = battery_read_threshold(bat, "BCTG");
+
+ return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
+}
+
+static ssize_t battery_stop_charge_thresh_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value = battery_read_threshold(bat, "BCSG");
+
+ return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
+}
+
+static int __init battery_init(struct ibm_init_struct *iibm)
+{
+ int res;
+ int i;
+ int state;
+
+ vdbg_printk(TPACPI_DBG_INIT,
+ "initializing battery commands subdriver\n");
+
+ TPACPI_ACPIHANDLE_INIT(hkey);
+
+ /* Check whether getter for start threshold exists */
+ tp_features.battery = hkey_handle &&
+ acpi_evalf(hkey_handle, &state, "BCTG", "qdd", 1);
+
+ vdbg_printk(TPACPI_DBG_INIT, "battery commands are %s\n",
+ str_supported(tp_features.battery));
+
+ if (!tp_features.battery)
+ return 1;
+
+ for (i = 0; i < BATTERY_MAX_COUNT; i++) {
+ int j = 0;
+ if (!acpi_evalf(hkey_handle, &state, "BCTG", "qdd", i + 1))
+ continue;
+ /* If the sign bit was set, we could not get the start charge
+ * threshold of that battery. Let's assume that this battery
+ * (and all following ones) do not exist */
+ if (state < 0)
+ break;
+ /* Modify BATTERY_MAX_ATTRS if you add an attribute */
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(start_charge_thresh,
+ S_IWUSR | S_IRUGO,
+ battery_start_charge_thresh_show,
+ battery_start_charge_thresh_store),
+ .var = (void *)(unsigned long) (i + 1)
+ };
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(stop_charge_thresh,
+ S_IWUSR | S_IRUGO,
+ battery_stop_charge_thresh_show,
+ battery_stop_charge_thresh_store),
+ .var = (void *)(unsigned long) (i + 1)
+ };
+
+ strncpy(batteries[i].name, "BAT", 3);
+ batteries[i].name[3] = '0' + i;
+ batteries[i].name[4] = '\0';
+ batteries[i].set = create_attr_set(j, batteries[i].name);
+
+ for (j = j - 1; j >= 0; j--)
+ add_to_attr_set(batteries[i].set,
+ &batteries[i].attributes[j].attr.attr);
+
+ res = register_attr_set_with_sysfs(batteries[i].set,
+ &tpacpi_pdev->dev.kobj);
+
+ if (res)
+ return res;
+ }
+
+ return 0;
+}
+
+static void battery_exit(void)
+{
+ int i;
+
+ for (i = 0; i < BATTERY_MAX_COUNT; i++) {
+ if (batteries[i].set != NULL) {
+ delete_attr_set(batteries[i].set,
+ &tpacpi_pdev->dev.kobj);
+ }
+ }
+}
+
+static struct ibm_struct battery_driver_data = {
+ .name = "battery",
+ .exit = battery_exit,
+};
+
/****************************************************************************
****************************************************************************
*
@@ -8741,6 +8972,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
.data = &light_driver_data,
},
{
+ .init = battery_init,
+ .data = &battery_driver_data,
+ },
+ {
.init = cmos_init,
.data = &cmos_driver_data,
},
--
1.9.1
@@ -1,75 +0,0 @@
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8701,7 +8701,7 @@ static struct ibm_struct mute_led_driver_data = {
/* Modify battery_init() if you modify them */
#define BATTERY_MAX_COUNT 3
-#define BATTERY_MAX_ATTRS 2
+#define BATTERY_MAX_ATTRS 3
static struct battery {
char name[3 + 1 + 1];
@@ -8842,6 +8842,46 @@ static ssize_t battery_stop_charge_thresh_show(struct device *dev,
return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
}
+static ssize_t battery_force_discharge_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &value, "BDSG",
+ "dd", bat))
+ return -EIO;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", value & 0x1);
+}
+
+static ssize_t battery_force_discharge_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res || value > 1)
+ return res ? res : -EINVAL;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BDSG", "dd", bat))
+ return -EIO;
+
+ /* Keep the break on AC disconnect state */
+ value |= (res >> 1) & 0x1;
+ /* Set the battery */
+ value |= (bat << 8);
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BDSS",
+ "dd", (int) value) || res < 0)
+ return -EIO;
+ return count;
+}
+
static int __init battery_init(struct ibm_init_struct *iibm)
{
int res;
@@ -8885,6 +8924,13 @@ static int __init battery_init(struct ibm_init_struct *iibm)
S_IWUSR | S_IRUGO,
battery_stop_charge_thresh_show,
battery_stop_charge_thresh_store),
+ .var = (void *) (unsigned long) (i + 1)
+ };
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(force_discharge,
+ S_IWUSR | S_IRUGO,
+ battery_force_discharge_show,
+ battery_force_discharge_store),
.var = (void *)(unsigned long) (i + 1)
};
--
2.4.1
@@ -1,94 +0,0 @@
diff -urN a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
--- a/drivers/platform/x86/thinkpad_acpi.c 2013-07-01 06:13:29.000000000 +0800
+++ b/drivers/platform/x86/thinkpad_acpi.c 2013-08-18 17:11:22.639057195 +0800
@@ -2929,6 +2929,81 @@
"wakeup_hotunplug_complete");
}
+/* sysfs hotkey_mute_state --------------------------------------------- */
+enum {
+ TPACPI_AML_MUTE_READ_MASK = 0x01,
+ TPACPI_AML_MUTE_ERROR_STATE_MASK = 0x80000000,
+};
+
+static ssize_t hotkey_mute_state_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int state;
+
+ if (!acpi_evalf(hkey_handle, &state, "GSMS", "dd"))
+ return -EIO;
+
+ if (state & TPACPI_AML_MUTE_ERROR_STATE_MASK)
+ pr_warn("getting mute state failed.\n");
+
+ state &= TPACPI_AML_MUTE_READ_MASK;
+
+ return snprintf(buf, PAGE_SIZE, "%x\n", state);
+}
+
+static ssize_t hotkey_mute_state_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ unsigned long state;
+ int output;
+
+ if (parse_strtoul(buf, 25, &state))
+ return -EINVAL;
+
+ if (state != 1 && state != 0)
+ return -EINVAL;
+
+ if (!acpi_evalf(hkey_handle, &output, "SSMS", "dd", state))
+ return -EIO;
+
+ if (output & TPACPI_AML_MUTE_ERROR_STATE_MASK)
+ return -EIO;
+
+ return count;
+}
+
+static struct device_attribute dev_attr_hotkey_mute_state =
+ __ATTR(hotkey_mute_state, S_IWUSR | S_IRUGO,
+ hotkey_mute_state_show, hotkey_mute_state_store);
+
+/* sysfs hotkey_mute_enable -------------------------------------------- */
+static ssize_t hotkey_mute_enable_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ unsigned long state;
+ int output;
+
+ if (parse_strtoul(buf, 25, &state))
+ return -EINVAL;
+
+ if (state != 1 && state != 0)
+ return -EINVAL;
+
+ if (!acpi_evalf(hkey_handle, &output, "SHDA", "dd", state))
+ return -EIO;
+
+ if (output & TPACPI_AML_MUTE_ERROR_STATE_MASK)
+ return -EIO;
+
+ return count;
+}
+
+static struct device_attribute dev_attr_hotkey_mute_enable =
+ __ATTR(hotkey_mute_enable, S_IWUSR, NULL, hotkey_mute_enable_store);
+
/* --------------------------------------------------------------------- */
static struct attribute *hotkey_attributes[] __initdata = {
@@ -2945,6 +3020,8 @@
&dev_attr_hotkey_source_mask.attr,
&dev_attr_hotkey_poll_freq.attr,
#endif
+ &dev_attr_hotkey_mute_state.attr,
+ &dev_attr_hotkey_mute_enable.attr,
};
/*
@@ -1,41 +0,0 @@
From f35169d9071766afaf7192801978fcc0ab82ee08 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Thu, 22 Aug 2013 15:43:15 +0200
Subject: [PATCH 2/3] thinkpad_acpi: Support micmute LED
The micmute LED is currently unused. This patch allows it to be hooked
up to various LED triggers.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
drivers/platform/x86/thinkpad_acpi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 54d31c0..33b23cb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -5050,8 +5050,10 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
"tpacpi::unknown_led2",
"tpacpi::unknown_led3",
"tpacpi::thinkvantage",
+ "tpacpi::unknown_led4",
+ "tpacpi::micmute"
};
-#define TPACPI_SAFE_LEDS 0x1081U
+#define TPACPI_SAFE_LEDS 0x5081U
static inline bool tpacpi_is_led_restricted(const unsigned int led)
{
@@ -5274,7 +5276,7 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = {
{ /* Lenovo */
.vendor = PCI_VENDOR_ID_LENOVO,
.bios = TPACPI_MATCH_ANY, .ec = TPACPI_MATCH_ANY,
- .quirks = 0x1fffU,
+ .quirks = 0x5fffU,
},
{ /* IBM ThinkPads with no EC version string */
.vendor = PCI_VENDOR_ID_IBM,
--
1.8.3.2
@@ -1,12 +0,0 @@
diff -urN a/kernel/power/tuxonice_highlevel.c b/kernel/power/tuxonice_highlevel.c
--- a/kernel/power/tuxonice_highlevel.c 2014-05-24 06:01:34.749222646 +0800
+++ b/kernel/power/tuxonice_highlevel.c 2014-05-24 06:04:01.871226898 +0800
@@ -1188,7 +1188,7 @@
* If the program reports an error, retval = 256. Don't complain
* about that here.
*/
- if (retval && retval != 256)
+ if (retval && retval != 256 && retval != -2)
printk(KERN_ERR "Failed to launch userspace program '%s': "
"Error %d\n", command, retval);
File diff suppressed because it is too large. Load diff
@@ -1,56 +0,0 @@
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 978db34..0c7a121 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP
def_bool y
depends on VT_CONSOLE && PM_SLEEP
+config NR_TTY_DEVICES
+ int "Maximum tty device number"
+ depends on VT
+ range 12 63
+ default 63
+ ---help---
+ This option is used to change the number of tty devices in /dev.
+ The default value is 63. The lowest number you can set is 12,
+ 63 is also the upper limit so we don't overrun the serial
+ consoles.
+
+ If unsure, say 63.
+
config HW_CONSOLE
bool
depends on VT && !UML
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
index 4b59a26..b494f6a 100644
--- a/include/uapi/linux/vt.h
+++ b/include/uapi/linux/vt.h
@@ -3,12 +3,26 @@
/*
+ * We will make this definition solely for the purpose of making packages
+ * such as splashutils build, because they can not understand that
+ * NR_TTY_DEVICES is defined in the kernel configuration.
+ */
+#ifndef CONFIG_NR_TTY_DEVICES
+#define CONFIG_NR_TTY_DEVICES 63
+#endif
+
+/*
* These constants are also useful for user-level apps (e.g., VC
* resizing).
*/
#define MIN_NR_CONSOLES 1 /* must be at least 1 */
-#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
-#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
+
+/*
+ * NR_TTY_DEVICES:
+ * Value MUST be at least 11 and must never be higher then 63
+ */
+#define MAX_NR_CONSOLES CONFIG_NR_TTY_DEVICES /* serial lines start above this */
+#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES /* must be root to allocate above this */
/* Note: the ioctl VT_GETSTATE does not work for
consoles 16 and higher (since it returns a short) */
@@ -1,24 +0,0 @@
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/tty.c linux-2.6.23-rc9/arch/i386/boot/tty.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/tty.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/tty.c 2007-10-06 12:37:47.000000000 +0200
@@ -92,7 +92,7 @@
int getchar_timeout(void)
{
- int cnt = 30;
+ int cnt = 3;
int t0, t1;
t0 = gettime();
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/video.c linux-2.6.23-rc9/arch/i386/boot/video.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/video.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/video.c 2007-10-06 12:36:05.000000000 +0200
@@ -329,7 +329,7 @@
unsigned int sel;
puts("Press <ENTER> to see video modes available, "
- "<SPACE> to continue, or wait 30 sec\n");
+ "<SPACE> to continue, or wait 3 sec\n");
kbd_flush();
while (1) {
Whitespace-only changes.
@@ -1,295 +0,0 @@
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 86c5236..9b8a637 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -46,6 +46,7 @@ detailed description):
- Fan control and monitoring: fan speed, fan enable/disable
- WAN enable and disable
- UWB enable and disable
+ - Charging control
A compatibility table by model and feature is maintained on the web
site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -1352,6 +1353,20 @@ Sysfs notes:
rfkill controller switch "tpacpi_uwb_sw": refer to
Documentation/rfkill.txt for details.
+Charging control
+----------------
+sysfs attribute groups: BAT0, BAT1, and so on, depending on how many batteries
+are supported by the embedded controller.
+
+This feature controls the battery charging process.
+
+battery sysfs attribute: start_charge_thresh
+
+ A percentage value from 0-99%, controlling when charging should start
+
+battery sysfs attribute: stop_charge_thresh
+
+ A percentage value from 1-100%, controlling when charging should stop
Multiple Commands, Module Parameters
------------------------------------
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 03ca6c1..fa29d82 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -323,6 +323,7 @@ static struct {
u32 sensors_pdrv_attrs_registered:1;
u32 sensors_pdev_attrs_registered:1;
u32 hotkey_poll_active:1;
+ u32 battery:1;
} tp_features;
static struct {
@@ -8350,6 +8351,236 @@ static struct ibm_struct fan_driver_data = {
.resume = fan_resume,
};
+
+/*************************************************************************
+ * Battery subdriver
+ */
+
+/* Modify battery_init() if you modify them */
+#define BATTERY_MAX_COUNT 3
+#define BATTERY_MAX_ATTRS 2
+
+static struct battery {
+ char name[3 + 1 + 1];
+ struct attribute_set *set;
+ struct dev_ext_attribute attributes[BATTERY_MAX_ATTRS];
+} batteries[BATTERY_MAX_COUNT];
+
+static int battery_attribute_get_battery(struct device_attribute *attr)
+{
+ return (int) (unsigned long) container_of(attr,
+ struct dev_ext_attribute,
+ attr)->var;
+}
+
+static int battery_read_threshold(int bat, char *threshold)
+{
+ int result = 0;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &result, threshold,
+ "dd", bat) || result < 0)
+ return -EIO;
+
+ /* Translate 0 to 100 for stop threshold */
+ if (strcmp(threshold, "BCSG") == 0 && (result & 0xFF) == 0)
+ return 100;
+ /* Bits 0 - 7 contain the current threshold */
+ return result & 0xFF;
+}
+
+static int battery_write_stop_charge_thresh(int bat, int value,
+ bool adjust_start);
+
+static int battery_write_start_charge_thresh(int bat, int value,
+ bool adjust_stop)
+{
+ int res = 0;
+
+ if (value < 0 || value > 99)
+ return -EINVAL;
+
+ /* Adjust the stop value if stop < new start value */
+ if (adjust_stop) {
+ int stop = battery_read_threshold(bat, "BCSG");
+ if (stop < 0)
+ return stop;
+ if (stop <= value)
+ res = battery_write_stop_charge_thresh(bat, value + 1,
+ FALSE);
+ if (res)
+ return res;
+ }
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BCCS", "dd",
+ value | (bat << 8)) || res < 0)
+ return -EIO;
+
+ return 0;
+}
+
+static int battery_write_stop_charge_thresh(int bat, int value,
+ bool adjust_start)
+{
+ int res = 0;
+
+ if (value < 1 || value > 100)
+ return -EINVAL;
+
+ /* Adjust the start value if start > new stop value */
+ if (adjust_start) {
+ int start = battery_read_threshold(bat, "BCTG");
+ if (start < 0)
+ return start;
+ if (value != 0)
+ res = battery_write_start_charge_thresh(bat, value - 1,
+ FALSE);
+ if (res)
+ return res;
+ }
+
+ /* 0 means default which seems to be 100%. */
+ if (value == 100)
+ value = 0;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BCSS", "dd",
+ value | (bat << 8)) || res < 0)
+ return -EIO;
+
+ return 0;
+}
+
+static ssize_t battery_start_charge_thresh_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res)
+ return res;
+ res = battery_write_start_charge_thresh(bat, value, TRUE);
+ return res ? res : count;
+}
+
+static ssize_t battery_stop_charge_thresh_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res)
+ return res;
+ res = battery_write_stop_charge_thresh(bat, value, TRUE);
+ return res ? res : count;
+}
+
+static ssize_t battery_start_charge_thresh_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value = battery_read_threshold(bat, "BCTG");
+
+ return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
+}
+
+static ssize_t battery_stop_charge_thresh_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value = battery_read_threshold(bat, "BCSG");
+
+ return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
+}
+
+static int __init battery_init(struct ibm_init_struct *iibm)
+{
+ int res;
+ int i;
+ int state;
+
+ vdbg_printk(TPACPI_DBG_INIT,
+ "initializing battery commands subdriver\n");
+
+ TPACPI_ACPIHANDLE_INIT(hkey);
+
+ /* Check whether getter for start threshold exists */
+ tp_features.battery = hkey_handle &&
+ acpi_evalf(hkey_handle, &state, "BCTG", "qdd", 1);
+
+ vdbg_printk(TPACPI_DBG_INIT, "battery commands are %s\n",
+ str_supported(tp_features.battery));
+
+ if (!tp_features.battery)
+ return 1;
+
+ for (i = 0; i < BATTERY_MAX_COUNT; i++) {
+ int j = 0;
+ if (!acpi_evalf(hkey_handle, &state, "BCTG", "qdd", i + 1))
+ continue;
+ /* If the sign bit was set, we could not get the start charge
+ * threshold of that battery. Let's assume that this battery
+ * (and all following ones) do not exist */
+ if (state < 0)
+ break;
+ /* Modify BATTERY_MAX_ATTRS if you add an attribute */
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(start_charge_thresh,
+ S_IWUSR | S_IRUGO,
+ battery_start_charge_thresh_show,
+ battery_start_charge_thresh_store),
+ .var = (void *)(unsigned long) (i + 1)
+ };
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(stop_charge_thresh,
+ S_IWUSR | S_IRUGO,
+ battery_stop_charge_thresh_show,
+ battery_stop_charge_thresh_store),
+ .var = (void *)(unsigned long) (i + 1)
+ };
+
+ strncpy(batteries[i].name, "BAT", 3);
+ batteries[i].name[3] = '0' + i;
+ batteries[i].name[4] = '\0';
+ batteries[i].set = create_attr_set(j, batteries[i].name);
+
+ for (j = j - 1; j >= 0; j--)
+ add_to_attr_set(batteries[i].set,
+ &batteries[i].attributes[j].attr.attr);
+
+ res = register_attr_set_with_sysfs(batteries[i].set,
+ &tpacpi_pdev->dev.kobj);
+
+ if (res)
+ return res;
+ }
+
+ return 0;
+}
+
+static void battery_exit(void)
+{
+ int i;
+
+ for (i = 0; i < BATTERY_MAX_COUNT; i++) {
+ if (batteries[i].set != NULL) {
+ delete_attr_set(batteries[i].set,
+ &tpacpi_pdev->dev.kobj);
+ }
+ }
+}
+
+static struct ibm_struct battery_driver_data = {
+ .name = "battery",
+ .exit = battery_exit,
+};
+
/****************************************************************************
****************************************************************************
*
@@ -8741,6 +8972,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
.data = &light_driver_data,
},
{
+ .init = battery_init,
+ .data = &battery_driver_data,
+ },
+ {
.init = cmos_init,
.data = &cmos_driver_data,
},
--
1.9.1
@@ -1,75 +0,0 @@
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8701,7 +8701,7 @@ static struct ibm_struct mute_led_driver_data = {
/* Modify battery_init() if you modify them */
#define BATTERY_MAX_COUNT 3
-#define BATTERY_MAX_ATTRS 2
+#define BATTERY_MAX_ATTRS 3
static struct battery {
char name[3 + 1 + 1];
@@ -8842,6 +8842,46 @@ static ssize_t battery_stop_charge_thresh_show(struct device *dev,
return value < 0 ? value : snprintf(buf, PAGE_SIZE, "%d\n", value);
}
+static ssize_t battery_force_discharge_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int value;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &value, "BDSG",
+ "dd", bat))
+ return -EIO;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", value & 0x1);
+}
+
+static ssize_t battery_force_discharge_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int bat = battery_attribute_get_battery(attr);
+ int res = -EINVAL;
+ unsigned long value;
+
+ res = kstrtoul(buf, 0, &value);
+ if (res || value > 1)
+ return res ? res : -EINVAL;
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BDSG", "dd", bat))
+ return -EIO;
+
+ /* Keep the break on AC disconnect state */
+ value |= (res >> 1) & 0x1;
+ /* Set the battery */
+ value |= (bat << 8);
+
+ if (!hkey_handle || !acpi_evalf(hkey_handle, &res, "BDSS",
+ "dd", (int) value) || res < 0)
+ return -EIO;
+ return count;
+}
+
static int __init battery_init(struct ibm_init_struct *iibm)
{
int res;
@@ -8885,6 +8924,13 @@ static int __init battery_init(struct ibm_init_struct *iibm)
S_IWUSR | S_IRUGO,
battery_stop_charge_thresh_show,
battery_stop_charge_thresh_store),
+ .var = (void *) (unsigned long) (i + 1)
+ };
+ batteries[i].attributes[j++] = (struct dev_ext_attribute) {
+ .attr = __ATTR(force_discharge,
+ S_IWUSR | S_IRUGO,
+ battery_force_discharge_show,
+ battery_force_discharge_store),
.var = (void *)(unsigned long) (i + 1)
};
--
2.4.1
@@ -1,41 +0,0 @@
From f35169d9071766afaf7192801978fcc0ab82ee08 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Thu, 22 Aug 2013 15:43:15 +0200
Subject: [PATCH 2/3] thinkpad_acpi: Support micmute LED
The micmute LED is currently unused. This patch allows it to be hooked
up to various LED triggers.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
drivers/platform/x86/thinkpad_acpi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 54d31c0..33b23cb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -5050,8 +5050,10 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
"tpacpi::unknown_led2",
"tpacpi::unknown_led3",
"tpacpi::thinkvantage",
+ "tpacpi::unknown_led4",
+ "tpacpi::micmute"
};
-#define TPACPI_SAFE_LEDS 0x1081U
+#define TPACPI_SAFE_LEDS 0x5081U
static inline bool tpacpi_is_led_restricted(const unsigned int led)
{
@@ -5274,7 +5276,7 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = {
{ /* Lenovo */
.vendor = PCI_VENDOR_ID_LENOVO,
.bios = TPACPI_MATCH_ANY, .ec = TPACPI_MATCH_ANY,
- .quirks = 0x1fffU,
+ .quirks = 0x5fffU,
},
{ /* IBM ThinkPads with no EC version string */
.vendor = PCI_VENDOR_ID_IBM,
--
1.8.3.2
@@ -1,12 +0,0 @@
diff -urN a/kernel/power/tuxonice_highlevel.c b/kernel/power/tuxonice_highlevel.c
--- a/kernel/power/tuxonice_highlevel.c 2014-05-24 06:01:34.749222646 +0800
+++ b/kernel/power/tuxonice_highlevel.c 2014-05-24 06:04:01.871226898 +0800
@@ -1188,7 +1188,7 @@
* If the program reports an error, retval = 256. Don't complain
* about that here.
*/
- if (retval && retval != 256)
+ if (retval && retval != 256 && retval != -2)
printk(KERN_ERR "Failed to launch userspace program '%s': "
"Error %d\n", command, retval);
File diff suppressed because it is too large. Load diff
@@ -1,56 +0,0 @@
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 978db34..0c7a121 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -75,6 +75,19 @@ config VT_CONSOLE_SLEEP
def_bool y
depends on VT_CONSOLE && PM_SLEEP
+config NR_TTY_DEVICES
+ int "Maximum tty device number"
+ depends on VT
+ range 12 63
+ default 63
+ ---help---
+ This option is used to change the number of tty devices in /dev.
+ The default value is 63. The lowest number you can set is 12,
+ 63 is also the upper limit so we don't overrun the serial
+ consoles.
+
+ If unsure, say 63.
+
config HW_CONSOLE
bool
depends on VT && !UML
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
index 4b59a26..b494f6a 100644
--- a/include/uapi/linux/vt.h
+++ b/include/uapi/linux/vt.h
@@ -3,12 +3,26 @@
/*
+ * We will make this definition solely for the purpose of making packages
+ * such as splashutils build, because they can not understand that
+ * NR_TTY_DEVICES is defined in the kernel configuration.
+ */
+#ifndef CONFIG_NR_TTY_DEVICES
+#define CONFIG_NR_TTY_DEVICES 63
+#endif
+
+/*
* These constants are also useful for user-level apps (e.g., VC
* resizing).
*/
#define MIN_NR_CONSOLES 1 /* must be at least 1 */
-#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
-#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
+
+/*
+ * NR_TTY_DEVICES:
+ * Value MUST be at least 11 and must never be higher then 63
+ */
+#define MAX_NR_CONSOLES CONFIG_NR_TTY_DEVICES /* serial lines start above this */
+#define MAX_NR_USER_CONSOLES CONFIG_NR_TTY_DEVICES /* must be root to allocate above this */
/* Note: the ioctl VT_GETSTATE does not work for
consoles 16 and higher (since it returns a short) */
@@ -1,24 +0,0 @@
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/tty.c linux-2.6.23-rc9/arch/i386/boot/tty.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/tty.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/tty.c 2007-10-06 12:37:47.000000000 +0200
@@ -92,7 +92,7 @@
int getchar_timeout(void)
{
- int cnt = 30;
+ int cnt = 3;
int t0, t1;
t0 = gettime();
diff -Naur linux-2.6.23-rc9.orig/arch/i386/boot/video.c linux-2.6.23-rc9/arch/i386/boot/video.c
--- linux-2.6.23-rc9.orig/arch/x86/boot/video.c 2007-10-06 12:26:14.000000000 +0200
+++ linux-2.6.23-rc9/arch/x86/boot/video.c 2007-10-06 12:36:05.000000000 +0200
@@ -329,7 +329,7 @@
unsigned int sel;
puts("Press <ENTER> to see video modes available, "
- "<SPACE> to continue, or wait 30 sec\n");
+ "<SPACE> to continue, or wait 3 sec\n");
kbd_flush();
while (1) {
Whitespace-only changes.
@@ -1,41 +0,0 @@
From f35169d9071766afaf7192801978fcc0ab82ee08 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Thu, 22 Aug 2013 15:43:15 +0200
Subject: [PATCH 2/3] thinkpad_acpi: Support micmute LED
The micmute LED is currently unused. This patch allows it to be hooked
up to various LED triggers.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
drivers/platform/x86/thinkpad_acpi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 54d31c0..33b23cb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -5050,8 +5050,10 @@ static const char * const tpacpi_led_names[TPACPI_LED_NUMLEDS] = {
"tpacpi::unknown_led2",
"tpacpi::unknown_led3",
"tpacpi::thinkvantage",
+ "tpacpi::unknown_led4",
+ "tpacpi::micmute"
};
-#define TPACPI_SAFE_LEDS 0x1081U
+#define TPACPI_SAFE_LEDS 0x5081U
static inline bool tpacpi_is_led_restricted(const unsigned int led)
{
@@ -5274,7 +5276,7 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = {
{ /* Lenovo */
.vendor = PCI_VENDOR_ID_LENOVO,
.bios = TPACPI_MATCH_ANY, .ec = TPACPI_MATCH_ANY,
- .quirks = 0x1fffU,
+ .quirks = 0x5fffU,
},
{ /* IBM ThinkPads with no EC version string */
.vendor = PCI_VENDOR_ID_IBM,
--
1.8.3.2
Whitespace-only changes.