Delete the allegedly obsolete "bank_size" member of struct mtd_info.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/maps includes flash maps for the Beech and Arctic PowerPC
405LP based boards. However, the 405LP was discontinued before any
quantity were distributed and those boards no longer have kernel
support in general. Therefore, this patch removes this obsolete code.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Squashes a compiler warning, and provides more useful information in
the case messed up device tree information.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Remove broken URLs (www.scyld.com) from network drivers' logging output.
URLs in comments and other strings are left intact.
Signed-off-by: Markus Dahms <dahms@fh-brandenburg.de>
Acked-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
igned-off-by: Adrian Bunk <bunk@stusta.de>
Many files include the filename at the beginning, serveral used a wrong one.
Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Fix various typos in kernel docs and Kconfigs, 2.6.21-rc4.
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
This makes the new iSeries virtual console drivers (nvc_iseries) the
default and prevents viocons being built unless explicitly selected.
Also it makes no sense to have the console as a module.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Correct documentation in genrtc.c to refer to the correct /proc
file that's used to export information: /proc/driver/rtc.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Fix remaining misspellings of "depreciated" to "deprecated."
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Fix the misspellings of "propogate", "writting" and (oh, the shame
:-) "kenrel" in the source tree.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Make devres.c ready for adding to DocBook.
Add devres.c to DocBook.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
We have a standard suffix to associate a designation string to a sensor:
_label. Use it instead of _position so that libsensors will catch it.
(This isn't implemented yet, but should be soon.)
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Let the applesmc device export its address to userspace. libsensors needs
this to recognize the device and give it a unique ID.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is to fix unnecessary __meminit definition. These are exported for
kernel modules.
I compiled on ia64/x86-64 with memory hotplug on/off.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When the rtc_update_irq() callsites stopped passing in the
class_dev, the rtc_dev references weren't fixed. Fix it up,
so we pass in the proper pointer.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Optimize fault kprobe handling just like powerpc.
[SPARC]: Wire up utimensat syscall.
[SPARC64]: Fix request_irq() ignored result warnings in PCI controller code.
[SPARC64]: Kill asm-sparc64/pbm.h
[ATYFB]: Fix sparc includes.
[QLA2XXX]: Fix build on sparc.
[SPARC64]: Removal of trivial pci_controller_info uses.
[SPARC64]: Move index info pci_pbm_info.
[SPARC64]: Move {setup,teardown}_msi_irq into pci_pbm_info.
[SPARC64]: Move pci_ops into pci_pbm_info.
[SPARC64] SBUS: Error interrupt registry cleanups.
[SPARC64] PCI: Use root list of pbm's instead of pci_controller_info's
[SPARC64] PCI: Kill PROM_PCIRNG_MAX and PROM_PCIIMAP_MAX.
[SPARC64] PCI: Use common routine to fetch PBM properties.
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (58 commits)
[SCSI] zfcp: clear boxed flag on unit reopen.
[SCSI] zfcp: clear adapter failed flag if an fsf request times out.
[SCSI] zfcp: rework request ID management.
[SCSI] zfcp: Fix deadlock between zfcp ERP and SCSI
[SCSI] zfcp: Locking for req_no and req_seq_no
[SCSI] zfcp: print S_ID and D_ID with 3 bytes
[SCSI] ipr: Use PCI-E reset API for new ipr adapter
[SCSI] qla2xxx: Update version number to 8.01.07-k7.
[SCSI] qla2xxx: Add MSI support.
[SCSI] qla2xxx: Correct pci_set_msi() usage semantics.
[SCSI] qla2xxx: Attempt to stop firmware only if it had been previously executed.
[SCSI] qla2xxx: Honor NVRAM port-down-retry-count settings.
[SCSI] qla2xxx: Error-out during probe() if we're unable to complete HBA initialization.
[SCSI] zfcp: Stop system after memory corruption
[SCSI] mesh: cleanup variable usage in interrupt handler
[SCSI] megaraid: replace yield() with cond_resched()
[SCSI] megaraid: fix warnings when CONFIG_PROC_FS=n
[SCSI] aacraid: correct SUN products to README
[SCSI] aacraid: superfluous adapter reset for IBM 8 series ServeRAID controllers
[SCSI] aacraid: kexec fix (reset interrupt handler)
...
Add an InfiniBand driver for Mellanox ConnectX adapters. Because
these adapters can also be used as ethernet NICs and Fibre Channel
HBAs, the driver is split into two modules:
mlx4_core: Handles low-level things like device initialization and
processing firmware commands. Also controls resource allocation
so that the InfiniBand, ethernet and FC functions can share a
device without stepping on each other.
mlx4_ib: Handles InfiniBand-specific things; plugs into the
InfiniBand midlayer.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
When memory pinned with ib_umem_get() is released, ib_umem_release()
needs to subtract the amount of memory being unpinned from
mm->locked_vm. However, ib_umem_release() may be called with
mm->mmap_sem already held for writing if the memory is being released
as part of an munmap() call, so it is sometimes necessary to defer
this accounting into a workqueue.
However, the work struct used to defer this accounting is dynamically
allocated before it is queued, so there is the possibility of failing
that allocation. If the allocation fails, then ib_umem_release has no
choice except to bail out and leave the process with a permanently
elevated locked_vm.
Fix this by allocating the structure to defer accounting as part of
the original struct ib_umem, so there's no possibility of failing a
later allocation if creating the struct ib_umem and pinning memory
succeeds.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Export ib_umem_get()/ib_umem_release() and put low-level drivers in
control of when to call ib_umem_get() to pin and DMA map userspace,
rather than always calling it in ib_uverbs_reg_mr() before calling the
low-level driver's reg_user_mr method.
Also move these functions to be in the ib_core module instead of
ib_uverbs, so that driver modules using them do not depend on
ib_uverbs.
This has a number of advantages:
- It is better design from the standpoint of making generic code a
library that can be used or overridden by device-specific code as
the details of specific devices dictate.
- Drivers that do not need to pin userspace memory regions do not
need to take the performance hit of calling ib_mem_get(). For
example, although I have not tried to implement it in this patch,
the ipath driver should be able to avoid pinning memory and just
use copy_{to,from}_user() to access userspace memory regions.
- Buffers that need special mapping treatment can be identified by
the low-level driver. For example, it may be possible to solve
some Altix-specific memory ordering issues with mthca CQs in
userspace by mapping CQ buffers with extra flags.
- Drivers that need to pin and DMA map userspace memory for things
other than memory regions can use ib_umem_get() directly, instead
of hacks using extra parameters to their reg_phys_mr method. For
example, the mlx4 driver that is pending being merged needs to pin
and DMA map QP and CQ buffers, but it does not need to create a
memory key for these buffers. So the cleanest solution is for mlx4
to call ib_umem_get() in the create_qp and create_cq methods.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
We now use pci_device_to_OF_node() to get properties
and of_get_property() returns const pointers.
Signed-off-by: David S. Miller <davem@davemloft.net>
As mmc_detect_change() can be called from irq context, using
claim (which can sleep) is inherently unsafe. Use the host
spinlock instead, which also is faster.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Change Kconfig objects from "menu, config" into "menuconfig" so
that the user can disable the whole feature without having to
enter the menu first.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Socket power must be fully controlled by adapter driver. This also prevents
unnecessary power-off of the socket when media driver is unloaded, yet
media remains in the socket.
Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (32 commits)
Use menuconfig objects - hwmon
hwmon/smsc47b397: Use dynamic sysfs callbacks
hwmon/smsc47b397: Convert to a platform driver
hwmon/w83781d: Deprecate W83627HF support
hwmon/w83781d: Use dynamic sysfs callbacks
hwmon/w83781d: Be less i2c_client-centric
hwmon/w83781d: Clean up conversion macros
hwmon/w83781d: No longer use i2c-isa
hwmon/ams: Do not print error on systems without apple motion sensor
hwmon/ams: Fix I2C read retry logic
hwmon: New AD7416, AD7417 and AD7418 driver
hwmon/coretemp: Add documentation
hwmon: New coretemp driver
i386: Use functions from library in msr driver
i386: Add safe variants of rdmsr_on_cpu and wrmsr_on_cpu
hwmon/lm75: Use dynamic sysfs callbacks
hwmon/lm78: Use dynamic sysfs callbacks
hwmon/lm78: Be less i2c_client-centric
hwmon/lm78: No longer use i2c-isa
hwmon: New max6650 driver
...
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (40 commits)
[netdrvr] atl1: fix build
pasemi_mac: Use local-mac-address instead of mac-address if available
pasemi_mac: PHY support
pasemi_mac: Add msglevel support and "debug" module param
pasemi_mac: Logic cleanup / rx performance improvements
pasemi_mac: Minor cleanup / define fixes
pasemi_mac: Add SKB reuse / copy-break
pasemi_mac: Timer and interrupt fixes
pasemi_mac: Abstract and fix up interrupt restart routines
pasemi_mac: Move the IRQ mapping from the PCI layer to the driver
tc35815: Remove unnecessary skb->dev assignment
drivers/net/dm9000: Convert to generic boolean
AT91RM9200 Ethernet: Fix multicast addressing
AT91RM9200 Ethernet: Support additional PHYs
PCMCIA-NETDEV : xirc2ps_cs: bugfix of multicast code
sky2: re-enable 88E8056 for most motherboards
MIPS: Drop unnecessary CONFIG_ISA from RBTX49XX
ne: MIPS: Use platform_driver for ne on RBTX49XX
ne: Add NEEDS_PORTLIST to control ISA auto-probe
ne: Misc fixes for platform driver.
...
Fix conflict in drivers/net/pasemi_mac.c (get_property() got renamed to
of_get_property()) manually.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6:
via: Make sure we flush write-combining using a follow-up read.
via: Try to improve command-buffer chaining.
drm: remove old taskqueue remnant
drm: rename badly named define and cleanup ioctl code spacing
radeon: Don't mess up page flipping when a file descriptor is closed.
drm/radeon: upgrade to 1.27 - make PCI GART more flexible
* master.kernel.org:/pub/scm/linux/kernel/git/dtor/input:
Input: move USB miscellaneous devices under drivers/input/misc
Input: move USB mice under drivers/input/mouse
Input: move USB gamepads under drivers/input/joystick
Input: move USB touchscreens under drivers/input/touchscreen
Input: move USB tablets under drivers/input/tablet
Input: i8042 - fix AUX port detection with some chips
Input: aaed2000_kbd - convert to use polldev library
Input: drivers/usb/input - usb_buffer_free() cleanup
Input: synaptics - don't complain about failed resets
Input: pull input.h into uinpit.h
Input: drivers/usb/input - fix sparse warnings (signedness)
Input: evdev - fix some sparse warnings (signedness, shadowing)
Input: drivers/joystick - fix various sparse warnings
Input: force feedback - make sure effect is present before playing
drivers/video/sm501fb.c: In function 'sm501fb_cursor':
drivers/video/sm501fb.c:992: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/video/sm501fb.c:992: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add support for the video controller IP block included into Xilinx ML300 and
ML403 reference designs.
Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch fixes incorrect targets of jumps when an error occurs in the
pm2fb_probe.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch adds a macro to register PCI ids table and corrects type of
xxxfb_fix variable to avoid modpost warnings.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch removes two redundant fields in the pm2fb_par structure.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
More corrections to skeletonfb.c file:
- fixed types of more arguments
- removed returned values in void functions
- removed not existing fb_poll function
- fixed closing comment typo
- corrected misleading constant name ADDR
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Acked-By: James Simmons <jsimmons@infradead.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
vga16fb does not just support 8-pixel wide rectangles, but rectangles with
widths in multiples of 8.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported by James Pearson as:
boot to run level 3
if not root, then make sure /dev/console is writeable
login and type:
setterm -blank 0
start X
type into an xterm:
while true; do echo "" > /dev/console; usleep 100000; done
while the above loop is running switch to the text console and back
again (Ctrl-Alt-F1 then Ctrl-Alt-F7)
... and the screen will be shifting (and wrapping) to the left.
This problem stems from continuously writing text to the system console (which
is in KD_TEXT mode) while the foreground console is in KD_GRAPHICS
mode. Somewhere along the way, console printing got confused and omitted the
KD_GRAPHICS/KD_TEXT test. Thus, vgacon attempted to scroll the screen of X,
which causes X to shift.
Fix by disallowing vgacon to touch the hardware when the vc is in KD_GRAPHICS
mode. A definitive fix entails a full audit of the console code.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change Kconfig objects from "menu, config" into "menuconfig" so that the user
can disable the whole feature without having to enter the menu first.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is a port of accelerated functions from 2.4 kernel. Only fillrect and
copyarea are accelerated. Fillrect is not accelerated in 24-bit mode.
[adaplas]
Add appropriate flags
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Move s3fb_get_tilemax to svgalib.c as svga_get_tilemax, because it reports
limitation of other code from svgalib (svga_settile, svga_tilecopy, ...)
Limit font width to 8 pixels in 4 bpp mode.
Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch disables a memory clock setting if a board has been initialized by
BIOS. This allows using the memory clock set by manufacturer of the board.
This patch also sets default clock for 3dlabs Permedia 2V reference board's
clock to 75MHz (BIOS setting for EONtronic Permedia 2Vboard), because the
default 83MHz can be too high.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch resets transparency settings when depth changes. Otherwise the 16
and 24-bit modes work incorrectly after switching from 32-bit mode.
Signed-off-by: Krzysztof Helt < krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- Check the console-to-fb mapping in fbcon_get_requirement(), otherwise the
value returned may not be valid for the driver.
- Minor cleanup
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Clean up exit patch of fb_set_var():
- consolidate all return values into a single local variable
- ensure that return values are valid error codes
- fix fb_set_var() returning success when fb_check_caps() failed
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The virtual console driver uses a semaphore as mutex. Use the mutex API
instead of the (binary) semaphore.
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reorganize atyfb clock init code so command line clock overrides are effective
for all chips. The old code would silently ignore some of the command line
clock overrides with some chips.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Wait 5 ms instead of 500 us for the SPLL to lock. This matches the
recommendation in mach64 programmer's guide.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1) sets 'palette access disabled' during read from AR10.
This is usually documented as needed for access AR01-AR0F,
but on ARK Logic card it is needed for AR10 (otherwise read
returns some nonsence and save_vga_text() returns before do
anything).
2) do not restore AR10, because it was not changed during
3) remove modification of misc reg:
/* force graphics mode */
vga_w(state->vgabase, VGA_MIS_W, misc | 1);
as comment is misleading - LSB of misc reg does not set/reset graphics
mode, but set color/mono adresses of CRT and some other regs.
but these regs are not used during save/restore fonts.
(it worked even when (misc | 1) was replaced by (misc & ~1) ).
Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Implement fb_get_caps(). This will allow the driver to tell upper layer that
it can only support 256 8x16 bitmaps when in tileblitting mode
(var->bits_per_pixel == 0);
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Check if the mode can properly display the screen. This will be needed by
drivers where the capability is not constant with each mode. The function
fb_set_var() will query fbcon the requirement, then it will query the driver
(via a new hook fb_get_caps()) its capability. If the driver's capability
cannot handle fbcon's requirement, then fb_set_var() will fail.
For example, if a particular driver supports 2 modes where:
mode1 = can only display 8x16 bitmaps
mode2 = can display any bitmap
then if current mode = mode2 and current font = 12x22
fbset <mode1> /* mode1 cannot handle 12x22 */
fbset will fail
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If the chip locks up, we get into a long polling loop,
where the softlockup detector kicks in.
See https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=151878
for an example.
[adaplas]
Chip lockup can occur at 3 points (flush, sync, and wait). Consolidate and
allow the driver to go to safe mode cleanly.
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch adds restrictions to calculations of m, n and p factors
which sets the pixclock for the Permedia 2V. I found during tests
that synchronization is unstable if m (divisor) is bigger than
half of the n (numerator). The patch disallows such settings
combination.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Permedia 2V uses its own registers to set a memory clock. The
patch adds these registers and uses them in the set_memclock()
function.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patch adds support for 3dlabs Permedia reference board.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Switch to pci_get refcounting APIs
[adaplas]
Fix a long-standing bug where the return value of
pci_find_slot()/pci_get_bus_and_slot() is ignored.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This fixes broken fbcon on Virge VX in 24 bpp mode, and contains several
other small updates.
Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Some drivers may reset the var->activate field on fb_check_var(). This can
lead to undefined behavior. For example, doing fbset -a <option> with vga16fb
will only modify the active console instead of modifying all.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fontmaps can be 256 or 512 in length. The only driver that can do tileblitting
can only handle 256 characters. Check for this when setting the font.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If tileblitting is enabled (text mode), the hardware can only accept 8x16
bitmaps. Advertise this to the upper layer. And to ensure that an appropriate
font is always available, select an 8x16 font in Kconfig.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Advertise that vga16fb can only handle widths that are 8-pixel-multiple only
(software limitation). To ensure that a legal font is available, SELECT an
8x16 font in Kconfig.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fbcon_set_font() will now check if the new font dimensions can be drawn by the
driver (by checking pixmap.blit_x and blit_y). Similarly, add 2 new
parameters to get_default_font(), font_w and font_h, to further aid in the
font selection process.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
A few drivers are not capable of blitting rectangles of any dimension.
vga16fb can only blit 8-pixel wide rectangles, while s3fb (in tileblitting
mode) can only blit 8x16 rectangles. For example, loading a 12x22 font in
vga16fb will result in a corrupt display.
Advertise this limitation/capability in info->pixmap.blit_x and blit_y. These
fields are 32-bit arrays (font max is 32x32 only), ie, if bit 7 is set, then
width/height of 7+1 is supported.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Consolidate common drawing functions into a single header file.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since vfb's framebuffer is vmalloc'ed, use the fb_sys_read() and
fb_sys_write().
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since hecubafb's framebuffer is vmalloc'ed, use fb_sys_read().
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since arcfb's framebuffer is vmalloc'ed, use the fb_sys_read().
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The functions fb_read() and fb_write in fbmem.c assume that the framebuffer
is in IO memory. However, we have 3 drivers (hecubafb, arcfb, and vfb)
where the framebuffer is allocated from system RAM (via vmalloc). Using
__raw_read/__raw_write (fb_readl/fb_writel) for these drivers is
illegal, especially in other platforms.
Create file read and write methods for these types of drivers. These are
named fb_sys_read() and fb_sys_write().
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It is unnecessary to pass struct file to fb_read() and fb_write() in struct
fb_ops. For consistency with the other methods, pass struct fb_info instead.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since vfb's framebuffer is vmalloc'ed, use the sys_* drawing functions
instead of cfb_*.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since hecubafb's framebuffer is vmalloc'ed, use the sys_* drawing functions
instead of cfb_*.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Since arcfb's framebuffer is vmalloc'ed, use the sys_* drawing functions
instead of cfb_*.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The generic drawing functions (cfbimgblt, cfbcopyarea, cfbfillrect) assume
that the framebuffer is in IO memory. However, we have 3 drivers (hecubafb,
arcfb, and vfb) where the framebuffer is allocated from system RAM (via
vmalloc). Using _raw_read/write and family for these drivers (as used in
the cfb* functions) is illegal, especially in other platforms.
Create 3 new drawing functions, based almost entirely from the original
except that the framebuffer memory is assumed to be in system RAM.
These are named as sysimgblt, syscopyarea, and sysfillrect.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fix a long-standing bug. The mask used to detect a 100Mhz or 133Mhz chipset
is incorrect. (The only side effect of this bug is that it will choose an
incorrect watermark).
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The framebuffer memory is allocated from system RAM (vmalloc'ed). Add __force
annotations.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add sparse annotations and use fb_read/fb_write and family to access the
framebuffer.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The framebuffer memory is allocated from system RAM (vmalloc'ed). Add __force
annotations.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add sparse annotations and use fb_read/fb_write family to access the
framebuffer.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Kill the following in fb_defio.c:
drivers/video/fb_defio.c:40:43: warning: incorrect type in argument 1 (different address spaces)
drivers/video/fb_defio.c:40:43: expected void *addr
drivers/video/fb_defio.c:40:43: got char [noderef] *screen_base<asn:2>
The framebuffer memory of these types of devices are allocated from system
RAM.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If the current framebuffer console is rotated (rotate != 0), doing an
"fbset -a" will corrupt the current console. Fix by updating the current
console only after all non-visible consoles have been updated.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Instead of directly linking vgastate.o by individual drivers, create a Kconfig
option VGASTATE which can be 'SELECT'ed by individual drivers instead.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Allow the saving and restoration of VGA text mode. The state is saved on the
first open and restored on the last close. Because of the VGA registers are
linearly mapped to the MMIO space, MMIO access is used which is not limited to
X86 platforms nor to the primary display device.
An echo 0 > /sys/class/vtconsole/vtcon1/bind will convert the display from
graphics to text mode.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Use already defined VGAwCR/VGArCR functions to access the i2c bus.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Allow the saving and restoration of VGA text mode. The state is saved on the
first open and restored on the last close. Because of the non-linear mapping
of the VGA registers to the MMIO space, this will be done only on X86
platforms where the device is the primary display.
An echo 0 > /sys/class/vtconsole/vtcon1/bind will convert the display from
graphics to text mode.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Following the programming advice laid down in the gcc manual, make
sure the case "..." operator has spaces on either side.
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is mainly correction of types, typos and missing characters in the
skeletonfb.c file found while trying to prepare a new fb driver.
[adaplas]
Additions on power management and fixes as per akpm
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Use Read/WriteCrtc() to access CRTC registers in nv_i2c.c. These are safer
because it uses the correct CRTC base (0x3bx or 0x3dx).
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- Ensure that CRTC registers are accessible by unlocking them on set_par(),
otherwise i2c reading will fail.
- The function nvidia_vga_protect(), does not protect the VGA registers, but
turns off the screen. Rename it to nvidia_screen_off().
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixed reversed DDC port so assignments are congruent with nvidiafb's and X's
nv driver.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Various cleanups to rivafb/nvidiafb's I2C code:
* Drop useless par->bus.
* Refactor I2C bus deletion code.
* Drop useless variable initialization.
* Remove unneeded include of <linux/i2c-id.h>.
* Simplify +1/-1.
* Add __devinit tags where possible.
[adaplas]
The varible initialization are not useless. However, rivafb must
check if i2c bus are created properly before reading the EDID
block.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I2C bus creation may fail, let rivafb handle that case properly.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Let the hardware monitoring drivers probe the second rivafb/nvidiafb I2C bus
for devices.
Signed-off-by: Jean Delvare <khali@linux-fr>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It was always intended for the logo to be drawn only if both fbcon and the
driver that is mapped to it are both compiled statically. Currently, if fbcon
is loaded prior to the driver, the logo is not shown. Reverse the order, and
the code may attempt to draw the logo which is __initdata. By accident, this
bug is rarely seen because this method of loading the modules is not common
and secondly, a code in fb_prepare_logo() that checks the height of the logo
(now a random value) rarely succeeds.
Fix by drawing the logo only if both fbcon and the driver are statically
compiled.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/s3fb.c:1078: warning: ignoring return value of 'pci_enable_device', declared with attribute warn_unused_result
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Create a variable, default_utf8, that defines the system-wide default UTF-8
setting. This variable can be altered via sysfs. If the variable is properly
set, this should mimimize breakage of UTF-8 encoded consoles when doing a
reset or echo -e '\033c' and of newly opened/allocated consoles.
This is based from patches by Jan Engelhardt and Paul LeoNerd Evans.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
When the cursor and echo are disabled on the current console, pressing a
key will cause a black rectangle to be painted in the cursor's position.
Fix this by not touching the framebuffer in fbcon_cursor() when the
cursor is off.
Signed-off-by: Michal Januszewski <spock@gentoo.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/usb/misc/sisusbvga/sisusb_con.c:1436: warning: initialization from incompatible pointer type
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add color support to the "underline" and "italic" attributes as in
OpenBSD/NetBSD-style (vt220) and xterm.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Acked-by: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Allow for the palette to be exposed and changed via sysfs. A call to
/usr/bin/reset will slurp the new definitions in for the current console.
Already posted at http://lkml.org/lkml/2006/1/15/149
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
After I added some debugging printks I've found that code became a bit
confused because it believed that primary monitor is 1920x540, but later it
found in CRTC0's registers that panel size is 1920x1200 (Windows also agree
that 1920x1200 is primary monitor, and 1920x1080i secondary one).
When I applied attached patch then my monitor became as happy as it was
before I connected HDMI cable to secondary output.
Signed-off-by: Petr Vandrovec <vandrove@vc.cvut.cz>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Added support for radeon xpress 200m(rs480). Note that the card doesn't
like dynclk turned on.
Signed-off-by: Johan Henriksson <jhn98032@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Correct the image offsets when rotating the logo. Before image->dx and
image->dy were always zero, so nobody ever noticed.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-By: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fb_do_show_logo() updates:
- Use width and height of the passed image instead of the global variable
fb_logo
- Explicitly pass the number of logos to draw
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-By: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fbcon_prepare_logo(): Avoid vertical overflow when making space for the logo
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-By: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add accelerated panning and accelerated color and mono image drawing.
Please apply.
Signed-off-by: James Simmons <jsimmons@infradead.org>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org> (tested, too!)
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is support for the TC variations of the TGA boards (properly known as
SFB+ or Smart Frame Buffer Plus boards). The 8-plane SFB+ board uses the
Bt459 RAMDAC (unlike its PCI TGA counterpart, which uses the Bt485), so
bits have been added to support this chip as well.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: James Simmons <jsimmons@infradead.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There are cases when we do not want to wait on the delay for automatically
updating the "real" framebuffer, this implements a simple ->fsync() hook
for explicitly flushing the deferred I/O work. The ->page_mkwrite()
handler will rearm the work queue normally.
(akpm: nuke unneeded ifdefs, forward-delcare struct dentry)
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Acked-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This implements deferred IO support in fbdev. Deferred IO is a way to delay
and repurpose IO. This implementation is done using mm's page_mkwrite and
page_mkclean hooks in order to detect, delay and then rewrite IO. This
functionality is used by hecubafb.
[adaplas]
This is useful for graphics hardware with no directly addressable/mappable
framebuffer. Implementing this will allow the "framebuffer" to be accesible
from user space via mmap().
Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fill transp->msb_right with the correct value. fbcon ignores this, but user
apps may not.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show_pan will display the value of the xoffset twice, instead of the xoffset
and yoffset. Fix.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Make nvidiafb use fb_ddc_read(). This patch was submitted before but was
reverted due to problems in a non-x86 platform. This includes a fix for that
where ddc reading is bypassed if there is no DDC bus (duh).
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If there is less than RING_MIN_FREE available in the ring buffer,
dinfo->ring_space is set to a big value forcing wait_ring to return.
Fix by making ring space = 0 if ring space < RING_MIN_FREE.
Signed-off-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This particular monitor does not have a limits block and has only one set of
monitor timings. Fix by adding a limits block to the EDID and extend the
horizontal sync frequency range to 30 kHz and 75 Khz.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Add the new display class. This is meant to unite the various solutions to
display units ie acpi output device, auxdisplay and the defunct lcd class
in the backlight directory.
Signed-off-by: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I have a problem with blanking. The soundcard uses speakers of the monitor.
Sound is muted when the screen blanks due to a bug in aty128fb.c.
Here is a fragment of linux/fb.h
/* VESA Blanking Levels */
#define VESA_NO_BLANKING 0
#define VESA_VSYNC_SUSPEND 1
#define VESA_HSYNC_SUSPEND 2
#define VESA_POWERDOWN 3
enum {
/* screen: unblanked, hsync: on, vsync: on */
FB_BLANK_UNBLANK = VESA_NO_BLANKING,
/* screen: blanked, hsync: on, vsync: on */
FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
/* screen: blanked, hsync: on, vsync: off */
FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
/* screen: blanked, hsync: off, vsync: on */
FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
/* screen: blanked, hsync: off, vsync: off */
FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
};
So FB_BLANK_NORMAL is 1, FB_BLANK_VSYNC_SUSPEND is 2,
FB_BLANK_HSYNC_SUSPEND is 3, FB_BLANK_POWERDOWN is 4.
And now:
blank = FB_BLANK_NORMAL (1)
blank & FB_BLANK_HSYNC_SUSPEND (1 & 3) is true,
so normal blank caused hsync suspend and sound is muted.
Cc: James Simmons <jsimmons@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- add copyright
- move version one number upper and use MODULE_VERSION
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
and save thus approx. 160k of .bss
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- 0 is not NULL
- use unlikely to hit the icache in isr more likely
- remove or comment empty if/else paths
[akpm@linux-foundation.org: build fix]
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
and use locally stored card structure if possible
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tty has no longer flip buffers accessible externally. Fix it by moving the
code to the tty_*flip* helpers.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- do not init static variables to 0
- simplify cy_init_card -- use memset(0) and do not zero each element
separately, also reorder init, so that same entries are inited at one
place
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- add printk KERN_ levels to each printk
- substitute printk with dev_* when device struct is available
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
pde, ctl_phys and base_phys are useless -- they are never used.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Do not export internal card data to userspace. cytune doesn't use this
anyway.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Test if base addr is non-null in ISR to prove the card has been correctly
initialized. This is needed for DEBUG_SHIRQ for example.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Without this patch, the driver sometimes causes "IRQXX: Nobody cares". Fix it
by turning off irqs when releasing.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Do not register all tty devices at the init time, delay it for the time until
some device is found.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Move probing code to separate function for easy pci probing conversion.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There will be no other choice after introducing pci probing anyway.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fork remove code for pci -- move it to separate, new, function and don't care
about pci in the former.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Move Ze init code into new cy_init_Ze, because we will need it in another
place and it will make the code totally unreadable.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Make x86 COM ports into platform devices and don't probe for them
if we have PNP.
This prevents double discovery, where a device was found both by
the legacy probe and by 8250_pnp, e.g.,
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:02: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
This also means IRDA devices without a UART PNP ID will no longer be
claimed by the serial driver, which might require changes in IRDA
drivers and administration.
In addition to this patch, you may need to configure a setserial init
script, e.g., /etc/init.d/setserial, so it doesn't poke legacy UART
stuff back in. On Debian, "dpkg-reconfigure setserial" with the "kernel"
option does this.
To force the old legacy probe behavior even when we have PNPBIOS or
ACPI, load the new legacy_serial module (or build 8250 static) with
the "legacy_serial.force" option.
[akpm@linux-foundation.org: fix makefiles]
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Claim devices using PNP, unless the user explicitly specified device
addresses. This can be disabled with the "smsc-ircc2.nopnp" option.
This removes the need for probing legacy addresses and helps untangle IR
devices from serial8250 devices.
Sometimes the SMC device is at a legacy COM port address but does not use the
legacy COM IRQ. In this case, claiming the device using PNP rather than 8250
legacy probe means we can automatically use the correct IRQ rather than
forcing the user to use "setserial" to set the IRQ manually.
If the PNP claim doesn't work, make sure you don't have a setserial init
script, e.g., /etc/init.d/setserial, configured to poke in legacy COM port
resources for the IRDA device. That causes the serial driver to claim
resources needed by this driver.
Based on this patch by Ville Syrjälä:
http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/ir260_smsc_pnp.diff
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Acked-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
To determine whether the user specified a module parameter, use some #defines
instead of checking for bare magic numbers.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Some HP/Compaq firmware reports via ACPI that the SMCF010 IR device is
enabled, but in fact, it leaves the device partly disabled.
HP nw8240 BIOS 68DTV Ver. F.0F, released 9/15/2005 is one BIOS that has this
problem.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This series converts i386 and x86_64 legacy serial ports to be platform
devices and prevents probing for them if we have PNP.
This prevents double discovery, where a device was found both by the legacy
probe and by 8250_pnp.
This also prevents the serial driver from claiming IRDA devices (unless they
have a UART PNP ID). The serial legacy probe sometimes assumed the wrong IRQ,
so the user had to use "setserial" to fix it.
Removing the need for setserial to make IRDA devices work seems good, but it
does break some things. In particular, you may need to keep setserial from
poking legacy UART stuff back in by doing something like "dpkg-reconfigure
setserial" with the "kernel" option. Otherwise, the setserial-discovered
"UART" will claim resources and prevent the IRDA driver from loading.
This patch:
If we can discover devices using PNP, we can skip some legacy probes. This
flag ("pnp_platform_devices") indicates that PNPBIOS or PNPACPI is enabled and
should tell us about builtin devices.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Keith Owens <kaos@ocs.com.au>
Cc: Len Brown <lenb@kernel.org>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Russell King <rmk+serial@arm.linux.org.uk>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cyclades, cy_readX/writeX cleanup
- cy_readX are placeholders for readX, remove it
- move cy_writeX macros into do {} while(0) to be safe
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Include the new linux/kdebug.h instead of asm/kdebug.h.
Simply remove the asm/kdebug.h include if both had been included.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Replace CONFIG_PNPACPI with CONFIG_PNP, so it loads on ACPI-less PNPBIOS
systems.
Signed-off-by: Marko Vrh <mvrh@freeshells.ch>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This fixes a common glitch in how RTC drivers handle two "set alarm" modes,
by getting rid of the surprising/hidden one that was rarely implemented
correctly (and which could expose nonportable hardware-specific behavior).
The glitch comes from the /dev/rtcX logic implementing the legacy
RTC_ALM_SET (limited to 24 hours, needing RTC_AIE_ON) ioctl on top of the
RTC driver call providing access to the newer RTC_WKALM_SET (without those
limitations) by initializing the day/month/year fields to be invalid ...
that second mode.
Now, since few RTC drivers check those fields, and most hardware misbehaves
when faced with invalid date fields, many RTC drivers will set bogus alarm
times on those RTC_ALM_SET code paths. (Several in-tree drivers have that
issue, and I also noticed it with code reviews on several new RTC drivers.)
This patch ensures that RTC drivers never see such invalid alarm fields, by
moving some logic out of rtc-omap into the RTC_ALM_SET code and adding an
explicit check (which will prevent the issue on other code paths).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David says "884b4aaaa242a2db8c8252796f0118164a680ab5 should be reverted. It
added an rtc_merge_alarm() call to the 2.6.20 kernel, which hasn't yet been
used by any in-tree driver; this patch obviates the need for that call, and
uses a more robust approach."
Cc: Scott Wood <scottwood@freescale.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This works around a bug seen in some RTC-related ACPI table entries, and
tweaks related diagnostics to follow the ACPI convention.
The bug prevents misleading boot-time messages: platforms affected by this
bug wrongly report they can support alarms up to one year in the future,
when in fact the longest alarm is just 24 hours. That will surprise anyone
trying to use those extended alarms.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Remove /proc/acpi/alarm file when the rtc-cmos "wakealarm" file is available.
Instead, provide hooks that rtc-cmos will use.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I finally got around to testing the updated wakeup event hooks for rtc-cmos,
and they follow in two patches:
- Interface update ... when a simple enable_irq_wake() doesn't suffice,
the platform data can hold suspend/resume callback hooks.
- ACPI implementation ... provides callback hooks to do ACPI magic, and
eliminate the legacy /proc/acpi/alarm file.
The interface update could go into 2.6.21, but that's not essential; they
will be NOPs on most PCs, without the ACPI stuff.
I suspect the ACPI folk may have opinions about how to merge that second
patch, and how to obsolete that legacy procfs file. I'd like to see that
merge into 2.6.22 if possible...
As for how to kick it in ... two ways:
- The appended "rtcwake" program; updated since the last time it was
posted, it deals much better with timezones and DST.
- Write the /sys/class/rtc/.../wakealarm file, then go to sleep.
For some reason RTC wake from "swsusp" stopped working on a system where
it previously worked; the alarm setting appears to get clobbered. But
on the bright side, RTC wake from "standby" worked on a system that had
never been able to resume from that state before ... IDEACPI is my guess
as to why it finally started to work. It's the old "two steps forward,
one step back" dance, I guess.
- Dave
/* gcc -Wall -Os -o rtcwake rtcwake.c */
#include <stdio.h>
#include <getopt.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <linux/rtc.h>
/* constants from legacy PC/AT hardware */
#define RTC_PF 0x40
#define RTC_AF 0x20
#define RTC_UF 0x10
/*
* rtcwake -- enter a system sleep state until specified wakeup time.
*
* This uses cross-platform Linux interfaces to enter a system sleep state,
* and leave it no later than a specified time. It uses any RTC framework
* driver that supports standard driver model wakeup flags.
*
* This is normally used like the old "apmsleep" utility, to wake from a
* suspend state like ACPI S1 (standby) or S3 (suspend-to-RAM). Most
* platforms can implement those without analogues of BIOS, APM, or ACPI.
*
* On some systems, this can also be used like "nvram-wakeup", waking
* from states like ACPI S4 (suspend to disk). Not all systems have
* persistent media that are appropriate for such suspend modes.
*
* The best way to set the system's RTC is so that it holds the current
* time in UTC. Use the "-l" flag to tell this program that the system
* RTC uses a local timezone instead (maybe you dual-boot MS-Windows).
*/
static char *progname;
#ifdef DEBUG
#define VERSION "1.0 dev (" __DATE__ " " __TIME__ ")"
#else
#define VERSION "0.9"
#endif
static unsigned verbose;
static int rtc_is_utc = -1;
static int may_wakeup(const char *devname)
{
char buf[128], *s;
FILE *f;
snprintf(buf, sizeof buf, "/sys/class/rtc/%s/device/power/wakeup",
devname);
f = fopen(buf, "r");
if (!f) {
perror(buf);
return 0;
}
fgets(buf, sizeof buf, f);
fclose(f);
s = strchr(buf, '\n');
if (!s)
return 0;
*s = 0;
/* wakeup events could be disabled or not supported */
return strcmp(buf, "enabled") == 0;
}
/* all times should be in UTC */
static time_t sys_time;
static time_t rtc_time;
static int get_basetimes(int fd)
{
struct tm tm;
struct rtc_time rtc;
/* this process works in RTC time, except when working
* with the system clock (which always uses UTC).
*/
if (rtc_is_utc)
setenv("TZ", "UTC", 1);
tzset();
/* read rtc and system clocks "at the same time", or as
* precisely (+/- a second) as we can read them.
*/
if (ioctl(fd, RTC_RD_TIME, &rtc) < 0) {
perror("read rtc time");
return 0;
}
sys_time = time(0);
if (sys_time == (time_t)-1) {
perror("read system time");
return 0;
}
/* convert rtc_time to normal arithmetic-friendly form,
* updating tm.tm_wday as used by asctime().
*/
memset(&tm, 0, sizeof tm);
tm.tm_sec = rtc.tm_sec;
tm.tm_min = rtc.tm_min;
tm.tm_hour = rtc.tm_hour;
tm.tm_mday = rtc.tm_mday;
tm.tm_mon = rtc.tm_mon;
tm.tm_year = rtc.tm_year;
tm.tm_isdst = rtc.tm_isdst; /* stays unspecified? */
rtc_time = mktime(&tm);
if (rtc_time == (time_t)-1) {
perror("convert rtc time");
return 0;
}
if (verbose) {
if (!rtc_is_utc) {
printf("\ttzone = %ld\n", timezone);
printf("\ttzname = %s\n", tzname[daylight]);
gmtime_r(&rtc_time, &tm);
}
printf("\tsystime = %ld, (UTC) %s",
(long) sys_time, asctime(gmtime(&sys_time)));
printf("\trtctime = %ld, (UTC) %s",
(long) rtc_time, asctime(&tm));
}
return 1;
}
static int setup_alarm(int fd, time_t *wakeup)
{
struct tm *tm;
struct rtc_wkalrm wake;
tm = gmtime(wakeup);
wake.time.tm_sec = tm->tm_sec;
wake.time.tm_min = tm->tm_min;
wake.time.tm_hour = tm->tm_hour;
wake.time.tm_mday = tm->tm_mday;
wake.time.tm_mon = tm->tm_mon;
wake.time.tm_year = tm->tm_year;
wake.time.tm_wday = tm->tm_wday;
wake.time.tm_yday = tm->tm_yday;
wake.time.tm_isdst = tm->tm_isdst;
/* many rtc alarms only support up to 24 hours from 'now' ... */
if ((rtc_time + (24 * 60 * 60)) > *wakeup) {
if (ioctl(fd, RTC_ALM_SET, &wake.time) < 0) {
perror("set rtc alarm");
return 0;
}
if (ioctl(fd, RTC_AIE_ON, 0) < 0) {
perror("enable rtc alarm");
return 0;
}
/* ... so use the "more than 24 hours" request only if we must */
} else {
/* avoid an extra AIE_ON call */
wake.enabled = 1;
if (ioctl(fd, RTC_WKALM_SET, &wake) < 0) {
perror("set rtc wake alarm");
return 0;
}
}
return 1;
}
static void suspend_system(const char *suspend)
{
FILE *f = fopen("/sys/power/state", "w");
if (!f) {
perror("/sys/power/state");
return;
}
fprintf(f, "%s\n", suspend);
fflush(f);
/* this executes after wake from suspend */
fclose(f);
}
int main(int argc, char **argv)
{
static char *devname = "rtc0";
static unsigned seconds = 0;
static char *suspend = "standby";
int t;
int fd;
time_t alarm = 0;
progname = strrchr(argv[0], '/');
if (progname)
progname++;
else
progname = argv[0];
if (chdir("/dev/") < 0) {
perror("chdir /dev");
return 1;
}
while ((t = getopt(argc, argv, "d:lm:s:t:uVv")) != EOF) {
switch (t) {
case 'd':
devname = optarg;
break;
case 'l':
rtc_is_utc = 0;
break;
/* what system power mode to use? for now handle only
* standardized mode names; eventually when systems define
* their own state names, parse /sys/power/state.
*
* "on" is used just to test the RTC alarm mechanism,
* bypassing all the wakeup-from-sleep infrastructure.
*/
case 'm':
if (strcmp(optarg, "standby") == 0
|| strcmp(optarg, "mem") == 0
|| strcmp(optarg, "disk") == 0
|| strcmp(optarg, "on") == 0
) {
suspend = optarg;
break;
}
printf("%s: unrecognized suspend state '%s'\n",
progname, optarg);
goto usage;
/* alarm time, seconds-to-sleep (relative) */
case 's':
t = atoi(optarg);
if (t < 0) {
printf("%s: illegal interval %s seconds\n",
progname, optarg);
goto usage;
}
seconds = t;
break;
/* alarm time, time_t (absolute, seconds since 1/1 1970 UTC) */
case 't':
t = atoi(optarg);
if (t < 0) {
printf("%s: illegal time_t value %s\n",
progname, optarg);
goto usage;
}
alarm = t;
break;
case 'u':
rtc_is_utc = 1;
break;
case 'v':
verbose++;
break;
case 'V':
printf("%s: version %s\n", progname, VERSION);
break;
default:
usage:
printf("usage: %s [options]"
"\n\t"
"-d rtc0|rtc1|...\t(select rtc)"
"\n\t"
"-l\t\t\t(RTC uses local timezone)"
"\n\t"
"-m standby|mem|...\t(sleep mode)"
"\n\t"
"-s seconds\t\t(seconds to sleep)"
"\n\t"
"-t time_t\t\t(time to wake)"
"\n\t"
"-u\t\t\t(RTC uses UTC)"
"\n\t"
"-v\t\t\t(verbose messages)"
"\n\t"
"-V\t\t\t(show version)"
"\n",
progname);
return 1;
}
}
if (!alarm && !seconds) {
printf("%s: must provide wake time\n", progname);
goto usage;
}
/* REVISIT: if /etc/adjtime exists, read it to see what
* the util-linux version of hwclock assumes.
*/
if (rtc_is_utc == -1) {
printf("%s: assuming RTC uses UTC ...\n", progname);
rtc_is_utc = 1;
}
/* this RTC must exist and (if we'll sleep) be wakeup-enabled */
fd = open(devname, O_RDONLY);
if (fd < 0) {
perror(devname);
return 1;
}
if (strcmp(suspend, "on") != 0 && !may_wakeup(devname)) {
printf("%s: %s not enabled for wakeup events\n",
progname, devname);
return 1;
}
/* relative or absolute alarm time, normalized to time_t */
if (!get_basetimes(fd))
return 1;
if (verbose)
printf("alarm %ld, sys_time %ld, rtc_time %ld, seconds %u\n",
alarm, sys_time, rtc_time, seconds);
if (alarm) {
if (alarm < sys_time) {
printf("%s: time doesn't go backward to %s",
progname, ctime(&alarm));
return 1;
}
alarm += sys_time - rtc_time;
} else
alarm = rtc_time + seconds + 1;
if (setup_alarm(fd, &alarm) < 0)
return 1;
sync();
printf("%s: wakeup from \"%s\" using %s at %s",
progname, suspend, devname,
ctime(&alarm));
fflush(stdout);
usleep(10 * 1000);
if (strcmp(suspend, "on") != 0)
suspend_system(suspend);
else {
unsigned long data;
do {
t = read(fd, &data, sizeof data);
if (t < 0) {
perror("rtc read");
break;
}
if (verbose)
printf("... %s: %03lx\n", devname, data);
} while (!(data & RTC_AF));
}
if (ioctl(fd, RTC_AIE_OFF, 0) < 0)
perror("disable rtc alarm interrupt");
close(fd);
return 0;
}
This patch:
Make rtc-cmos do the relevant magic so this RTC can wake the system from a
sleep state. That magic comes in two basic flavors:
- Straightforward: enable_irq_wake(), the way it'd work on most SOC chips;
or generally with system sleep states which don't disable core IRQ logic.
- Roundabout, using non-IRQ platform hooks. This is needed with ACPI and
one almost-clone chip which uses a special wakeup-only alarm. (That's
the RTC used on Footbridge boards, FWIW, which don't do PM in Linux.)
A separate patch implements those hooks for ACPI platforms, so that rtc_cmos
can issue system wakeup events (and its sysfs "wakealarm" attribute works on
at least some systems).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Fix a goof in the revised classdev support for RTCs: make sure the /dev
node info is ready before the device is registered, not after. Otherwise
the /sys/class/rtc/rtcN/dev attribute won't be created and then udev won't
have the information it needs to create the /dev/rtcN node.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
RTC class suspend/resume support, re-initializing the system clock on resume
from the clock used to initialize it at boot time.
- The reinit-on-resume is hooked to the existing RTC_HCTOSYS config
option, on the grounds that a clock good enough for init must also
be good enough for re-init.
- Inlining a version of the code used by ARM, to save and restore the
delta between a selected RTC and the current system wall-clock time.
- Removes calls to that ARM code from AT91, OMAP1, and S3C RTCs. This
means that systems using those RTCs across suspend/resume will likely
want to change their kernel configs to enable RTC_HCTOSYS.
If HCTOSYS isn't using a second RTC (with battery?), this changes the
system's initial date from Jan 1970 to the epoch this hardware uses:
1998 for AT91, 2000 for OMAP1 (assuming no split power mode), etc.
This goes on top of the patch series removing "struct class_device" usage
from the RTC framework. That's all needed for class suspend()/resume().
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-By: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This simplifies the RTC procfs support by removing the class_interface that
hooks it into the rtc core. If it's configured, then sysfs support is now
part of the RTC core, and is never a separate module.
It also removes the class_interface hook, now that its last remaining user is
gone. (That API is usable only with a "struct class_device".)
It's another step towards being able to remove "struct class_device".
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-By: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>