[PATCH 30/30] viafb: make procfs entries optional

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Corbet
Date: Wednesday, April 28, 2010 - 3:17 pm

From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>

viafb: make procfs entries optional

This patch adds a config option to enable procfs entries for direct
hardware access. This was the old behaviour but the option defaults
to no as this is really ugly and should not be needed if the driver
works correct (and if it doesn't, it needs to be fixed).
That stuff is really something that should
- not be needed at all (the driver should be capable of doing it)
- not be there (debugfs would be better for such things)
So add this option just for backwards compatiblity.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
 drivers/video/Kconfig        |   14 ++++++++++++++
 drivers/video/via/viafbdev.c |    8 ++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index a969f76..f263564 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1531,6 +1531,20 @@ config FB_VIA_CAMERA
 	   Chrome9 chipsets.  Currently only tested on OLPC xo-1.5 systems
 	   with ov7670 sensors.
 
+if FB_VIA
+
+config FB_VIA_DIRECT_PROCFS
+	bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)"
+	depends on FB_VIA
+	default n
+	help
+	  Allow direct hardware access to some output registers via procfs.
+	  This is dangerous but may provide the only chance to get the
+	  correct output device configuration.
+	  Its use is strongly discouraged.
+
+endif
+
 config FB_NEOMAGIC
 	tristate "NeoMagic display support"
 	depends on FB && PCI
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 51e9106..3d03318 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1326,6 +1326,8 @@ static void parse_dvi_port(void)
 		  output_interface);
 }
 
+#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
+
 /*
  * The proc filesystem read/write function, a simple proc implement to
  * get/set the value of DPA  DVP0,   DVP0DataDriving,  DVP0ClockDriving, DVP1,
@@ -1715,6 +1717,8 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
 	remove_proc_entry("viafb", NULL);
 }
 
+#endif /* CONFIG_FB_VIA_DIRECT_PROCFS */
+
 static int parse_mode(const char *str, u32 *xres, u32 *yres)
 {
 	char *ptr;
@@ -1943,7 +1947,9 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
 		  viafbinfo->node, viafbinfo->fix.id, default_var.xres,
 		  default_var.yres, default_var.bits_per_pixel);
 
+#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
 	viafb_init_proc(&viaparinfo->shared->proc_entry);
+#endif
 	viafb_init_dac(IGA2);
 	return 0;
 
@@ -1970,7 +1976,9 @@ void __devexit via_fb_pci_remove(struct pci_dev *pdev)
 	unregister_framebuffer(viafbinfo);
 	if (viafb_dual_fb)
 		unregister_framebuffer(viafbinfo1);
+#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
 	viafb_remove_proc(viaparinfo->shared->proc_entry);
+#endif
 	framebuffer_release(viafbinfo);
 	if (viafb_dual_fb)
 		framebuffer_release(viafbinfo1);
-- 
1.7.0.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 02/30] viafb: use proper pci config API, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 04/30] viafb: Retain GEMODE reserved bits, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 05/30] viafb: Unify duplicated set_bpp() code, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 12/30] viafb: Move core stuff into via-core.c, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 13/30] viafb: Separate global and fb-specific data, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 14/30] viafb: add a driver for GPIO lines, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 15/30] viafb: package often used basic io functions, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 19/30] viafb: Introduce viafb_find_i2c_adapter(), Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 20/30] via: Rationalize vt1636 detection, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 22/30] viafb: Add a simple VX855 DMA engine driver, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 25/30] viafb: unify modesetting functions, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 27/30] viafb: replace inb/outb, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 28/30] viafb: improve misc register handling, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 29/30] viafb: fix proc entry removal, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
[PATCH 30/30] viafb: make procfs entries optional, Jonathan Corbet, (Wed Apr 28, 3:17 pm)
Re: [RFC] Second OLPC Viafb series, v2, Bruno Prémont, (Thu Apr 29, 10:26 am)
Re: [RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Fri Apr 30, 8:39 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Florian Tobias Schan ..., (Fri Apr 30, 11:07 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Jonathan Corbet, (Fri Apr 30, 11:22 am)
Re: [PATCH 13/30] viafb: Separate global and fb-specific data, Florian Tobias Schan ..., (Fri Apr 30, 11:43 am)
Re: [PATCH 02/30] viafb: use proper pci config API, Florian Tobias Schan ..., (Sat May 1, 7:01 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Florian Tobias Schan ..., (Sat May 1, 8:02 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Jonathan Corbet, (Sat May 1, 8:08 am)
Re: [PATCH 12/30] viafb: Move core stuff into via-core.c, Florian Tobias Schan ..., (Sat May 1, 8:29 am)
Re: [RFC] Second OLPC Viafb series, v2, Florian Tobias Schan ..., (Sat May 1, 2:28 pm)
Re: [RFC] Second OLPC Viafb series, v2, Jonathan Corbet, (Sat May 1, 3:57 pm)
Re: [PATCH 24/30] viafb: Add a driver for the video captur ..., Florian Tobias Schan ..., (Sat May 1, 6:18 pm)
Re: [PATCH 02/30] viafb: use proper pci config API, Jonathan Corbet, (Mon May 3, 7:37 pm)