aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/viafbdev.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-04-17video: move fbdev to drivers/video/fbdevTomi Valkeinen1-2176/+0
The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers, fbdev framework files. Make some order into the chaos by creating drivers/video/fbdev directory, and move all fbdev related files there. No functionality is changed, although I guess it is possible that some subtle Makefile build order related issue could be created by this patch. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Clark <robdclark@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-01-03Drivers: video: remove __dev* attributes.Greg Kroah-Hartman1-6/+6
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-08video/via: Convert to kstrtou8_from_userPeter Huewe1-22/+12
This patch replaces the code for getting an number from a userspace buffer by a simple call to kstrou8_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-03-08viafb: avoid refresh and mode lookup in set_parFlorian Tobias Schandinat1-18/+14
As check_var already ensures that the mode is valid there is no need to do those expensive lookups here again. The only thing that might change is that the deprecated interface could report slightly different refresh rates due to rounding errors. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-03-04viafb: LCD bpp cleanupFlorian Tobias Schandinat1-1/+1
This patch removes redundant bits per pixel information by using the one storged in var directly. Simplifies code without any functional changes. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-21viafb: another workaround for OLPCs weird wiringFlorian Tobias Schandinat1-2/+4
On OLPC we must not touch this I2C bus or it will hang. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-13viafb: add initial EDID supportFlorian Tobias Schandinat1-7/+19
This patch adds support for using EDID data on CRT and DVP1 for initial configuration if viafb_mode or viafb_mode1 are not present. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-10viafb: add auxiliary device management infrastructureFlorian Tobias Schandinat1-0/+27
This patch adds the basic infrastructure and a few stub drivers for devices that are connected via I2C busses. The infrastructure will be used to replace and extend the support that is scattered throughout viafb. The stub drivers are not very useful yet but they show how the infrastructure works, provide information about the chips integrated into a system and maybe gather some testers as it would be very difficult for a single person to get a sane test environment. The only thing this actually does is probing the I2C busses which will hopefully not cause any regressions. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-17viafb: replace strict_strtoul to kstrto* and check return valueWang Shaoyan1-58/+68
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning: drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-17Merge commit 'v3.1-rc2' into HEADFlorian Tobias Schandinat1-3/+3
2011-08-07viafb: get rid of the remaining modetable structure assumptionsFlorian Tobias Schandinat1-11/+3
This patch removes the remaining places where assumptions about the structure of the modetable were made. Aside from some places where assumptions are made that certain modes are in the modetable the only code dealing with the modetable and not just a single mode is in viamode. This will allow chaniging the modetable and use other sources for videomodes like the subsystem or EDID. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-06viafb: add new funcions to select a single modeFlorian Tobias Schandinat1-12/+12
This patch introduces 2 new functions for selecting a single mode based on hres, vres and refresh rate and changes some uses to use those. The advantage is that it is less error prone than doing the selection based on refresh rate everywhere and allows replacing the modetable structure. This includes a little change that users may notice: If a refresh rate was given as module parameters but does not exist in the modetable prior to this patch a refresh rate of 60 was assumed and after this patch the closest supported refresh rate to the one provided by the user is used. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: remove superfluous mode lookupFlorian Tobias Schandinat1-2/+0
As the result is not used anywhere there is no need to perform the lookup at all. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-07-17viafb: improve pitch handlingFlorian Tobias Schandinat1-3/+8
This patch adds checks for minimum and maximum pitch size to prevent invalid settings which could otherwise crash the machine. Also the alignment is done in a slightly more readable way. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@kernel.org
2011-06-27viafbdev: fix compilation warning for unused variableNikanth Karthikesan1-2/+2
viafbdev: Fix compilation warning for unused variable for #ifdef MODULE Fix compilation warning when #ifdef MODULE drivers/video/via/viafbdev.c: In function ‘viafb_init’: drivers/video/via/viafbdev.c:2019: warning: unused variable ‘r’ Signed-off-by: Nikanth Karthikesan <nikanth@google.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-27viafb: use display information in info not in var for panningFlorian Tobias Schandinat1-2/+3
As Laurent pointed out we must not use any information in the passed var besides xoffset, yoffset and vmode as otherwise applications might abuse it. Also use the aligned fix.line_length and not the (possible) unaligned xres_virtual. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@kernel.org
2011-05-22Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6Linus Torvalds1-23/+39
* 'viafb-next' of git://github.com/schandinat/linux-2.6: (24 commits) viafb: Automatic OLPC XO-1.5 configuration viafb: remove unused CEA mode viafb: try to map less memory in case of failure viafb: use write combining for video ram viafb: add X server compatibility mode viafb: reduce OLPC refresh a bit viafb: fix OLPC XO 1.5 device connection viafb: fix OLPC DCON refresh rate viafb: delete clock and PLL initialization viafb: replace custom return values viafb: some small cleanup for global variables viafb: gather common good, old VGA initialization in one place viafb: add engine clock support viafb: add VIA slapping capability viafb: split clock and PLL code to an extra file viafb: add primary/secondary clock on/off switches viafb: add clock source selection and PLL power management support viafb: prepare for PLL separation viafb: call viafb_get_clk_value only in viafb_set_vclock viafb: remove unused max_hres/vres ...
2011-05-11viafb: Automatic OLPC XO-1.5 configurationDaniel Drake1-9/+30
Currently, a long set of viafb options are needed to get the XO-1.5 laptop to output video (there is only 1 configuration that works, that can't really be autodetected). This patch automatically detects and configures viafb for the XO-1.5 laptop, meaning all that is required for working display is that viafb is loaded. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-07Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6Linus Torvalds1-36/+38
* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6: efifb: Add override for 11" Macbook Air 3,1 efifb: Support overriding fields FW tells us with the DMI data. fb: Reduce priority of resource conflict message savagefb: Remove obsolete else clause in savage_setup_i2c_bus savagefb: Set up I2C based on chip family instead of card id savagefb: Replace magic register address with define drivers/video/bfin-lq035q1-fb.c: introduce missing kfree video: s3c-fb: fix checkpatch errors and warning efifb: support AMD Radeon HD 6490 s3fb: fix Virge/GX2 fbcon: Remove unused 'display *p' variable from fb_flashcursor() fbdev: sh_mobile_lcdcfb: fix module lock acquisition fbdev: sh_mobile_lcdcfb: add blanking support viafb: initialize margins correct viafb: refresh rate bug collection sh: mach-ap325rxa: move backlight control code sh: mach-ecovec24: support for main lcd backlight
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-27viafb: some small cleanup for global variablesFlorian Tobias Schandinat1-9/+7
We do not need viafb_second{,_virtual}_{xres,yres} outside of viafbdev.c so move them there and eliminate the virtual ones where the only sane usage is done during initalization. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-03-21viafb: kill crt_setting_informationFlorian Tobias Schandinat1-5/+2
As the iga path is the only remaining information which is also handled by the active devices there is no reason to keep it. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-03-21viafb: initialize margins correctFlorian Tobias Schandinat1-20/+11
This patch initializes the margins for the initial mode correct. This is required to get the desired initial refresh rate. Also do more verbose sanity checking to prevent misbehavior. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-03-16viafb: refresh rate bug collectionFlorian Tobias Schandinat1-17/+28
This patch fixes multiple issues with the handling of refresh rates especially for multi-display setups. If you experienced problems with wrong refresh rates this patch might fix them. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-03-09video via: make local variables staticStephen Hemminger1-3/+3
Many local variables should be declared static. Found by sparse, compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-01-26console: rename acquire/release_console_sem() to console_lock/unlock()Torben Hohn1-4/+4
The -rt patches change the console_semaphore to console_mutex. As a result, a quite large chunk of the patches changes all acquire/release_console_sem() to acquire/release_console_mutex() This commit makes things use more neutral function names which dont make implications about the underlying lock. The only real change is the return value of console_trylock which is inverted from try_acquire_console_sem() This patch also paves the way to switching console_sem from a semaphore to a mutex. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert] Signed-off-by: Torben Hohn <torbenh@gmx.de> Cc: Thomas Gleixner <tglx@tglx.de> Cc: Greg KH <gregkh@suse.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-09viafb: General power management infrastructureDaniel Drake1-19/+15
Multiple devices need S/R hooks (framebuffer, GPIO, camera). Add infrastructure and convert existing framebuffer code to the new model. This patch should create no functional change. Based on earlier work by Jonathan Corbet. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2010-10-24viafb: add initial VX900 supportFlorian Tobias Schandinat1-2/+4
This patch adds basic support for the new VX900 IGP. Almost everything that was implemented for other IGPs is expected to work also on VX900 after this patch. The only known issue is that on the CRT output mode setting does not always work. It is clear that the possibility for regressions is zero. A big thanks to VIA Technologies for making this possible and supporting this work. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Jonathan Corbet <corbet@lwn.net>
2010-10-24viafb: fix hardware acceleration for suspend & resumeFlorian Tobias Schandinat1-1/+3
This patch splits the acceleration initialization in two parts: The first is only called during probe and is used to allocate resources. The second part is also called on resume to reinitalize the 2D engine. This should fix all acceleration issues after resume most notable an "invisible" cursor and as we do nothing special it is reasonable to assume that it works on all supported IGPs. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-10-24viafb: make suspend and resume work (on all machines?)Florian Tobias Schandinat1-10/+0
This patch removes the dangerous suspend and resume code that was developed for VX855 only. After this the framebuffer is expected to cause no longer serious (freezing) issues on any machines. However the hardware acceleration is broken now so only doing resume with unaccelerated framebuffers is save. This did not work previously as the 2D engine is not mapped if the framebuffer is not accelerated. The acceleration issue will be addressed later. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-10-24viafb: restore display on resumeFlorian Tobias Schandinat1-0/+3
This patch makes viafb restore the display on resume by calling viafb_set_par. Resumeing has still its issues: - will probably freeze most machines (for me on VX800 reliable on the second resume) - under some configurations the screen appears on the wrong output device (reason unknown) Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-10-24Minimal support for viafb suspend/resumeDeepak Saxena1-0/+46
This patch adds minimal support for suspend/resume of the VIA framebuffer device. It requires a version of OFW that restores the video mode. This patch is OLPC-specific as the proper upstream solution is to move the VIA video path to using the kernel modesetting infrastructure and doing a proper save/restore in the kernel. [jc: extensive changes for 2.6.34 merge] Signed-off-by: Deepak Saxena <dsaxena@laptop.org> [fts: viafb_driver moved from viafbdev.c to via-core.c] Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-09-24viafb: rename output devicesFlorian Tobias Schandinat1-5/+5
Now it looks like we finally know enough about the output devices to give them proper names. As VIA_96 is often referred to as DVP0 rename it to VIA_DVP0. As VIA_6C and VIA_93 seem to exist only on CLE266 and "replace" DVP0 and DVP1 there rename them to VIA_LDVP0 and VIA_LDVP1 (L as legacy). The proc names were changed accordingly which should be harmless as they were just introduced and not beyond RFC state. This patch should make things a bit more comfortable and less scary. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
2010-09-24viafb: add a mapping of supported output devicesFlorian Tobias Schandinat1-0/+48
This patch maps supported output devices to IGP versions. This list may contain errors as most of it is derived of the driver source but it should be correct enough to provide a good help. The devices are exported via a proc entry in the same format as those showing the output devices per IGA. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
2010-09-24viafb: introduce per output device power managementFlorian Tobias Schandinat1-6/+10
This patch moves common parts of dvi.c, lcd.c and vt1636.c to hw.c to start a per output device power management. There should be no runtime changes aside that this patch enables the proc interface to enable/disable devices when needed which greatly increases the chances that changes to the output device configuration will work. However the power management is not yet complete so it might fail on some configurations. As this area is quite complex and touches undocumented things there is a slight chance of regressions. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-09-24viafb: add interface for output device configurationFlorian Tobias Schandinat1-24/+151
This patch extends the proc entry to contain a possibility to view and change the output devices for each IGA. This is useful for debugging output problems as it provides a reliable way to query which low level devices are active after VIAs output device configuration nightmare happended. It's as well suitable for daily use as one can change the output configuration on the fly for example to connect a projector. At the moment it's still unstable. The reason is that we have to handle a bunch of undocumented output devices (those without a proper name) and that this patch is the first step to collect and verify the needed information. Basically the only configuration change that is expected to work at the moment is switching output devices between IGA1 and IGA2. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
2010-09-24viafb: propagate __init and __devinitFlorian Tobias Schandinat1-4/+4
There are a lot of init functions which are not marked as such. Fix this. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-07-23viafb: fix accel_flags check_var bugFlorian Tobias Schandinat1-2/+2
viafb: fix accel_flags check_var bug In check_var we should check and modify the var given and not the one which is currently active. So this code was obviously wrong. Probably this was doing no harm because all acceleration functions also check whether acceleration is possible. (otherwise I would expect this to lead to a null pointer dereference) Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-07-23viafb: probe cleanupsFlorian Tobias Schandinat1-24/+3
viafb: probe cleanups Removal of strange special cases that must not exist as well as a useless check. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-07-23viafb: remove ioctls which break the framebuffer interfaceFlorian Tobias Schandinat1-251/+0
viafb: remove ioctls which break the framebuffer interface The ioctls VIAFB_SET_DEVICE, VIAFB_SET_DEVICE_INFO and VIAFB_SET_SECOND_MODE are removed because they prevent a clean framebuffer driver because they modify the hardware and/or the internal structures. There are no known applications using these ioctls so no breakage is expected. Additionaly the main functionality was duplicating the framebuffer interface so there really should not exist any user. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-07-23viafb: update fix before calculating depthFlorian Tobias Schandinat1-1/+1
viafb: update fix before calculating depth As the depth calculation depends on information in fix it is saner to do the update first. No runtime change expected as the value visual in fix used never changes to MONO. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
2010-05-27drivers/video/via: use memdup_userJulia Lawall1-8/+3
Use memdup_user when user data is immediately copied into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; position p; identifier l1,l2; @@ - to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( - to==NULL + IS_ERR(to) || ...) { <+... when != goto l1; - -ENOMEM + PTR_ERR(to) ...+> } - if (copy_from_user(to, from, size) != 0) { - <+... when != goto l2; - -EFAULT - ...+> - } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Scott Fang <ScottFang@viatech.com.cn> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-20Merge branch 'viafb-next' of git://git.lwn.net/linux-2.6Linus Torvalds1-94/+87
* 'viafb-next' of git://git.lwn.net/linux-2.6: (35 commits) viafb: move some include files to include/linux viafb: Eliminate some global.h references viafb: get rid of i2c debug cruft viafb: fold via_io.h into via-core.h viafb: Fix initialization error paths viafb: Do not remove gpiochip under spinlock viafb: make procfs entries optional viafb: fix proc entry removal viafb: improve misc register handling viafb: replace inb/outb viafb: move some modesetting functions to a seperate file viafb: unify modesetting functions viafb: Reserve framebuffer memory for the upcoming camera driver viafb: Add a simple VX855 DMA engine driver viafb: Add a simple interrupt management infrastructure via: Rationalize vt1636 detection viafb: Introduce viafb_find_i2c_adapter() via: Do not attempt I/O on inactive I2C adapters viafb: Turn GPIO and i2c into proper platform devices viafb: Convert GPIO and i2c to the new indexed port ops ...
2010-05-11viafb: move some include files to include/linuxJonathan Corbet1-2/+2
These are the files which should be available to subdevices compiled outside of drivers/video/via. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2010-05-07viafb: make procfs entries optionalFlorian Tobias Schandinat1-0/+8
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>
2010-05-07viafb: fix proc entry removalFlorian Tobias Schandinat1-6/+7
viafb: fix proc entry removal Trying to remove unregistered proc entries became painful and is useless anyway. So remove the removal of an entry that was never registered and duplicate the logic for one which is added conditionally. Additionally move the removal above releasing fb_info as we still need the information. This prevents tainting the kernel by the procfs warn on and avoiding access to already freed memory is probably also a good idea. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2010-05-07viafb: unify modesetting functionsFlorian Tobias Schandinat1-8/+9
viafb: unify modesetting functions This patch unifies some cleaned up modesetting functions to prepare for moving them to an extra file. This includes make them use via_io and changing there names to reflect that they do not depend on anything framebuffer specific. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2010-05-07viafb: Separate global and fb-specific dataJonathan Corbet1-31/+23
This patch moves data of interest into a new viafb_dev structure which describes the device as a whole; the idea here is to create a separation between what all devices may need and what the framebuffer device in particular needs. I've also made some small steps toward thinning out the global.h mess. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2010-05-07viafb: Move core stuff into via-core.cJonathan Corbet1-55/+14
The first step toward turning viafb into a multifunction driver. This patch creates a new via-core.c file which serves as the main PCI driver; everything else comes below that. Some work has been done to rationalize the i2c drivers in this new scheme. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2010-04-27viafb: rework the I2C support in the VIA framebuffer driverHarald Welte1-3/+3
This patch changes the way how the various I2C busses are used internally inside the viafb driver: Previosuly, only a single i2c_adapter was created, even though two different hardware I2C busses are accessed: A structure member in a global variable was modified to indicate the bus to be used. Now, all existing hardware busses are registered with the i2c core, and the viafb_i2c_{read,write}byte[s]() function take the adapter number as function call parameter, rather than referring to the global structure member. [jc: even more painful merge with mainline changes ->2.6.34] [jc: painful merge with OLPC changes] Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>