+ vt-binding-add-sysfs-support.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     VT binding: Add sysfs support

has been added to the -mm tree.  Its filename is

     vt-binding-add-sysfs-support.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: VT binding: Add sysfs support
From: "Antonino A. Daplas" <adaplas@xxxxxxxxx>


Add sysfs attributes for binding and unbinding VT console drivers.  The
attributes are located in /sys/class/tty/console and are namely:

    A. backend - list registered drivers in the following format:

    "I C: Description"

    Where: I  = ID number of the driver
           C  = status of the driver which can be:

		S = system driver
		B = bound modular driver
		U = unbound modular driver

	   Description - text description of the driver

    B. bind - binds a driver to the console layer

       echo <ID> > /sys/class/tty/console/bind

    C. unbind - unbinds a driver from the console layer

       echo <ID> > /sys/class/tty/console/unbind

The tty layer does nothing to these attributes except create them and punt all
requests to the VT layer.

Signed-off-by: Antonino Daplas <pol.net>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/tty_io.c |   53 +++++++++++++++++++++++++++++++++++++++-
 include/linux/tty.h   |   19 ++++++++++++++
 2 files changed, 71 insertions(+), 1 deletion(-)

diff -puN drivers/char/tty_io.c~vt-binding-add-sysfs-support drivers/char/tty_io.c
--- devel/drivers/char/tty_io.c~vt-binding-add-sysfs-support	2006-06-09 01:56:15.000000000 -0700
+++ devel-akpm/drivers/char/tty_io.c	2006-06-09 01:56:15.000000000 -0700
@@ -3231,6 +3231,47 @@ static struct cdev ptmx_cdev;
 static struct cdev vc0_cdev;
 #endif
 
+static ssize_t store_bind(struct class_device *class_device,
+			  const char *buf, size_t count)
+{
+	int index = simple_strtoul(buf, NULL, 0);
+
+	vt_bind(index);
+	return count;
+}
+
+static ssize_t store_unbind(struct class_device *class_device,
+			    const char *buf, size_t count)
+{
+	int index = simple_strtoul(buf, NULL, 0);
+
+	vt_unbind(index);
+	return count;
+}
+
+static ssize_t show_con_drivers(struct class_device *class_device, char *buf)
+{
+	return vt_show_drivers(buf);
+}
+
+static struct class_device_attribute class_device_attrs[] = {
+	__ATTR(bind,   S_IWUSR, NULL, store_bind),
+	__ATTR(unbind, S_IWUSR, NULL, store_unbind),
+	__ATTR(backend, S_IRUGO, show_con_drivers, NULL),
+};
+
+static struct class_device *console_class_device;
+
+static int console_init_class_device(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
+		class_device_create_file(console_class_device,
+					 &class_device_attrs[i]);
+	return 0;
+}
+
 /*
  * Ok, now we can initialize the rest of the tty devices and can count
  * on memory allocations, interrupts etc..
@@ -3249,7 +3290,17 @@ static int __init tty_init(void)
 	    register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
 		panic("Couldn't register /dev/console driver\n");
 	devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console");
-	class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console");
+	console_class_device = class_device_create(tty_class, NULL,
+						   MKDEV(TTYAUX_MAJOR, 1),
+						   NULL, "console");
+	if (IS_ERR(console_class_device)) {
+		printk(KERN_WARNING "Unable to create class device "
+		       "for console; errno = %ldn",
+		       PTR_ERR(console_class_device));
+		console_class_device = NULL;
+	} else
+		console_init_class_device();
+
 
 #ifdef CONFIG_UNIX98_PTYS
 	cdev_init(&ptmx_cdev, &ptmx_fops);
diff -puN include/linux/tty.h~vt-binding-add-sysfs-support include/linux/tty.h
--- devel/include/linux/tty.h~vt-binding-add-sysfs-support	2006-06-09 01:56:15.000000000 -0700
+++ devel-akpm/include/linux/tty.h	2006-06-09 01:56:15.000000000 -0700
@@ -347,6 +347,25 @@ extern void console_print(const char *);
 extern int vt_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg);
 
+#ifdef CONFIG_VT
+extern int vt_bind(int index);
+extern int vt_unbind(int index);
+extern int vt_show_drivers(char *buf);
+#else
+static inline int vt_bind(int index)
+{
+	return 0;
+}
+static inline int vt_unbind(int index)
+{
+	return 0;
+}
+static inline int vt_show_drivers(char *buf)
+{
+	return 0;
+}
+#endif
+
 static inline dev_t tty_devnum(struct tty_struct *tty)
 {
 	return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
_

Patches currently in -mm which might be from adaplas@xxxxxxxxx are

git-intelfb.patch
savagefb-allocate-space-for-current-and-saved-register.patch
savagefb-add-state-save-and_restore-hooks.patch
savagefb-add-state-save-and_restore-hooks-fix.patch
fbdev-more-accurate-sync-range-extrapolation.patch
nvidiafb-revise-pci_device_id-table.patch
atyfb-fix-hardware-cursor-handling.patch
atyfb-remove-unneeded-calls-to-wait_for_idle.patch
atyfb-set-correct-acceleration-flags.patch
epson1355fb-update-platform-code.patch
vesafb-update-platform-code.patch
vfb-update-platform-code.patch
vga16fb-update-platform-code.patch
fbdev-static-pseudocolor-with-depth-less-than-4-does.patch
savagefb-whitespace-cleanup.patch
fbdev-firmware-edid-fixes.patch
nvidiafb-add-support-for-geforce-6100-and-related-chipsets.patch
vesafb-fix-return-code-of-vesafb_setcolreg.patch
vesafb-prefer-vga-registers-over-pmi.patch
atyfb-fix-dead-code.patch
fbdev-coverity-bug-85.patch
fbdev-coverity-bug-90.patch
backlight-fix-kconfig-dependency.patch
detaching-fbcon-fix-vgacon-to-allow-retaking-of-the.patch
detaching-fbcon-fix-give_up_console.patch
detaching-fbcon-remove-calls-to-pci_disable_device.patch
detaching-fbcon-add-sysfs-class-device-entry-for-fbcon.patch
detaching-fbcon-clean-up-exit-code.patch
detaching-fbcon-add-capability-to-attach-detach-fbcon.patch
detaching-fbcon-update-documentation.patch
vt-binding-add-binding-unbinding-support-for-the-vt.patch
vt-binding-add-sysfs-support.patch
vt-binding-update-fbcon-to-support-binding.patch
vt-binding-fbcon-update-documentation.patch
vt-binding-add-new-doc-file-describing-the-feature.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux