aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2010-04-17 15:44:57 -0400
committerJonathan Corbet <corbet@lwn.net>2010-05-07 19:17:39 -0400
commit2b78a963c800252a0016785813cc5140c006145c (patch)
treed343095ca5eeff68ec69824ca87ccee2634a94ca /drivers/video
parent2fed547c0298e1465d62b34a75a7b76353fee7d3 (diff)
viafb: make procfs entries optional
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Kconfig14
-rw-r--r--drivers/video/via/viafbdev.c8
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 22c1662de964..fd55c279915c 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1522,6 +1522,20 @@ config FB_VIA
1522 To compile this driver as a module, choose M here: the 1522 To compile this driver as a module, choose M here: the
1523 module will be called viafb. 1523 module will be called viafb.
1524 1524
1525if FB_VIA
1526
1527config FB_VIA_DIRECT_PROCFS
1528 bool "direct hardware access via procfs (DEPRECATED)(DANGEROUS)"
1529 depends on FB_VIA
1530 default n
1531 help
1532 Allow direct hardware access to some output registers via procfs.
1533 This is dangerous but may provide the only chance to get the
1534 correct output device configuration.
1535 Its use is strongly discouraged.
1536
1537endif
1538
1525config FB_NEOMAGIC 1539config FB_NEOMAGIC
1526 tristate "NeoMagic display support" 1540 tristate "NeoMagic display support"
1527 depends on FB && PCI 1541 depends on FB && PCI
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 51e9106138ce..3d033186a822 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -1326,6 +1326,8 @@ static void parse_dvi_port(void)
1326 output_interface); 1326 output_interface);
1327} 1327}
1328 1328
1329#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1330
1329/* 1331/*
1330 * The proc filesystem read/write function, a simple proc implement to 1332 * The proc filesystem read/write function, a simple proc implement to
1331 * get/set the value of DPA DVP0, DVP0DataDriving, DVP0ClockDriving, DVP1, 1333 * 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)
1715 remove_proc_entry("viafb", NULL); 1717 remove_proc_entry("viafb", NULL);
1716} 1718}
1717 1719
1720#endif /* CONFIG_FB_VIA_DIRECT_PROCFS */
1721
1718static int parse_mode(const char *str, u32 *xres, u32 *yres) 1722static int parse_mode(const char *str, u32 *xres, u32 *yres)
1719{ 1723{
1720 char *ptr; 1724 char *ptr;
@@ -1943,7 +1947,9 @@ int __devinit via_fb_pci_probe(struct viafb_dev *vdev)
1943 viafbinfo->node, viafbinfo->fix.id, default_var.xres, 1947 viafbinfo->node, viafbinfo->fix.id, default_var.xres,
1944 default_var.yres, default_var.bits_per_pixel); 1948 default_var.yres, default_var.bits_per_pixel);
1945 1949
1950#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1946 viafb_init_proc(&viaparinfo->shared->proc_entry); 1951 viafb_init_proc(&viaparinfo->shared->proc_entry);
1952#endif
1947 viafb_init_dac(IGA2); 1953 viafb_init_dac(IGA2);
1948 return 0; 1954 return 0;
1949 1955
@@ -1970,7 +1976,9 @@ void __devexit via_fb_pci_remove(struct pci_dev *pdev)
1970 unregister_framebuffer(viafbinfo); 1976 unregister_framebuffer(viafbinfo);
1971 if (viafb_dual_fb) 1977 if (viafb_dual_fb)
1972 unregister_framebuffer(viafbinfo1); 1978 unregister_framebuffer(viafbinfo1);
1979#ifdef CONFIG_FB_VIA_DIRECT_PROCFS
1973 viafb_remove_proc(viaparinfo->shared->proc_entry); 1980 viafb_remove_proc(viaparinfo->shared->proc_entry);
1981#endif
1974 framebuffer_release(viafbinfo); 1982 framebuffer_release(viafbinfo);
1975 if (viafb_dual_fb) 1983 if (viafb_dual_fb)
1976 framebuffer_release(viafbinfo1); 1984 framebuffer_release(viafbinfo1);