28 Apr, 2008

40 commits

  • RTRACE() does exactly the same thing as the standard pr_debug() call, so just
    use the latter.

    Signed-off-by: Jean Delvare
    Acked-by: Benjamin Herrenschmidt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Fix CONFIG_FB_RADEON_DEBUG. DEBUG must be defined before including any kernel
    header, otherwise dev_dbg() resolves to a no-op. Also, when debugging is
    disabled, don't set DEBUG at all instead of setting it to 0, to comply with
    what the kernel headers expect.

    Signed-off-by: Jean Delvare
    Acked-by: Benjamin Herrenschmidt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Additionally provide PCI device id in character format if possible. (The
    printable characters were commonly used to identify the cards.)

    Signed-off-by: Andreas Herrmann
    Cc: "Antonino A. Daplas"
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Herrmann
     
  • Fix incorrect length for strncat by replacing it with strlcat

    Signed-off-by: Roel Kluin
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     
  • Add removed option "mode" to keep compatibility with existing setups. The
    option is back for pm2fb, tridentfb and vt8623fb drivers.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Add the option "mode_option". It also moves mtrr variable to devinitdata
    section.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Add the option "mode_option". This is one step toward changing all fb
    drivers to have common "mode_option" parameter.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Change the option "mode" into "mode_option".

    This is one step toward changing all fb drivers to have common "mode_option"
    parameter.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Add names of drivers converted to "mode_option" parameter.

    This is one step toward changing all fb drivers to have common "mode_option"
    parameter.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Add the option "mode_option".

    This is one step toward changing all fb drivers to have common "mode_option"
    parameter.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Change the option "mode_option" into "mode". It also adds __init attribute to
    tridentfb_setup function.

    This is one step toward changing all fb drivers to have common "mode_option"
    parameter.

    Signed-off-by: Krzysztof Helt
    Cc: Alain Kalker
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Change the option "mode_option" into "mode".

    This is one step toward changing all fb drivers to have common "mode_option"
    parameter.

    Signed-off-by: Krzysztof Helt
    Cc: Alain Kalker
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Free buffer when the framebuffer can't be registered

    Signed-off-by: Roel Kluin
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     
  • Fix limit check in FBIOPUT_CON2FBMAP ioctl.

    Signed-off-by: Peter Samuelson
    Cc: Geert Uytterhoeven
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Samuelson
     
  • Prior to suspend, we allocate and switch to a new VT; after suspend, we switch
    back to the original VT. This can be slow, and is completely unnecessary if
    the framebuffer we're using can restore video properly.

    This adds a hook that allows drivers to select whether or not to do this vt
    switch, and changes the gxfb driver to call this hook. It also adds a module
    param to gxfb to allow controlling of the vt switch (defaulting to no switch).

    (Note: I'm not convinced that console_sem is the best way to protect this, but
    we should probably have some form of locking..)

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Cc: Pavel Machek
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • This adds the ability to suspend/resume the gxfb driver, which includes:
    - The addition of a Graphics Processor register table in gxfb.h, and
    associated GP handling.
    - Register and palette saving code; registers are stored in gxfb_par.
    A few MSR values are saved as well.
    - gx_powerup and gx_powerdown functions which restore/save registers and
    enable/disable graphic engines.
    - gxfb_suspend/gxfb_resume

    Originally based on a patch by Jordan Crouse.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • We want to stop sharing stuff with gx1fb; it makes little sense. There were
    fields in geodefb_par that weren't being used, there was little point to the
    DC/VP ops callbacks, etc. This implements the following:

    - Create gxfb_par (based on geodefb_par), place it in gxfb.h
    - Drop display_gx.h and video_gx.h. The last few patches moved most
    stuff into gxfb.h anyways, so there was very little left.
    - Drop the geode_{dc,vid}_ops stuff. Un-static functions, add
    declarations to gxfb.h.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • This continues the gxfb header cleanups. MSRs are defined in geode.h; the
    specific bits we care about are defined in gxfb.h.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • This does the following in preparation for register saving:
    - moves the register definitions from video_gx.h and display_gx.h into
    gxfb.h.
    - renames GX_* registers to match their section (ie, VP_).
    - renames register bitfields to match the data sheet (ie,
    DC_DCFG_TGEN -> DC_DISPLAY_CFG_TGEN).
    - for DC registers, rather than defining to specific addresses, use
    an enum to number them sequentially and just multiply by 4(bytes) to
    access them (in read_dc/write_dc).
    - for VP and FP registers, use an enum and multiple by 8 (bytes). They're
    64bit registers.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • This creates read_dc/write_dc, read_vp/write_vp, and read_fp/write_fp for
    reading and updating those registers. It creates gxfb.h to house these.

    We also drop a no-op readl() from gx_set_mode. Other than that, there should
    be no functionality change.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • Use a command line option (vram) rather than hardcoding the vram size. LxFB
    already does this; it's useful for machines that can't query the BIOS for fb
    size. This patch originated from David Woodhouse, was modified by Jordan
    Crouse, and was then modified further by me.

    This also adds some gxfb documentation in Documentation/fb.

    Signed-off-by: Andres Salomon
    Cc: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • Drop the class/class_mask stuff; it's unnecessary as long as the vendor and
    device IDs match.

    Signed-off-by: Andres Salomon
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • When the FP strap is enabled, don't turn on the CRT DACs - that will save
    about 35 mA of power.

    Updated/cleaned up by Andres Salomon.

    Signed-off-by: Andres Salomon
    Signed-off-by: Jordan Crouse
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jordan Crouse
     
  • While running in flatpanel mode it is important to change the FP sync bits (VG
    register 0x408) rather then the CRT sync bits (VG register 0x008). This patch
    keeps the CRT sync bits at default when a flatpanel exists.

    Note that this also fixes inverted logic; we want CRT_VSYNC_POL to be set (ie,
    vsync is normally high) when FB_SYNC_VERT_HIGH_ACT is unset.

    Signed-off-by: Jordan Crouse
    Signed-off-by: Andres Salomon
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jordan Crouse
     
  • This is generic VSA2 detection. It's used by OLPC to determine whether or not
    the BIOS contains VSA2, but since other BIOSes are coming out that don't use
    the VSA (ie, tinybios), it might end up being useful for others.

    Signed-off-by: Andres Salomon
    Acked-by: Alan Cox
    Cc: Jordan Crouse
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • This cleans up a few MSR-using drivers in the following manner:
    - Ensures MSRs are all defined in asm/geode.h, rather than in misc
    places
    - Makes the naming consistent; cs553[56] ones begin with MSR_,
    GX-specific ones start with MSR_GX_, and LX-specific ones start
    with MSR_LX_. Also, make the names match the data sheet.
    - Use MSR names rather than numbers in source code
    - Document the fact that the LX's MSR_PADSEL has the wrong value
    in the data sheet. That's, uh, good to note.

    Signed-off-by: Andres Salomon
    Acked-by: Jordan Crouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andres Salomon
     
  • Use __u32 for max_len to match the declaration of length in the struct
    fb_bitfield.

    Suppresses sparse shadowed variable warnings from the nested max()
    macros:
    drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
    drivers/video/console/fbcon.h:130:8: originally declared here
    drivers/video/console/fbcon.h:130:8: warning: symbol '_x' shadows an earlier one
    drivers/video/console/fbcon.h:130:8: originally declared here
    drivers/video/console/fbcon.h:130:8: warning: symbol '_y' shadows an earlier one
    drivers/video/console/fbcon.h:130:8: originally declared here

    [akpm@linux-foundation.org: fix constness]
    Signed-off-by: Harvey Harrison
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     
  • Fix error values returned in some code branches in the pm2fb_probe() function.

    Signed-off-by: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
    (d)) but is perhaps more readable.

    An extract of the semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @haskernel@
    @@

    #include

    @depends on haskernel@
    expression n,d;
    @@

    (
    - (n + d - 1) / d
    + DIV_ROUND_UP(n,d)
    |
    - (n + (d - 1)) / d
    + DIV_ROUND_UP(n,d)
    )

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP((n),d)
    + DIV_ROUND_UP(n,d)

    @depends on haskernel@
    expression n,d;
    @@

    - DIV_ROUND_UP(n,(d))
    + DIV_ROUND_UP(n,d)
    //

    Signed-off-by: Julia Lawall
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Signed-off-by: Anton Vorontsov
    Cc: "Antonino A. Daplas"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Add support for the framebuffers with non-native endianness. This is done via
    FBINFO_FOREIGN_ENDIAN flag that will be used by the drivers. Depending on the
    host endianness this flag will be overwritten by FBINFO_BE_MATH internal flag,
    or cleared.

    Tested to work on MPC8360E-RDK (BE) + Fujitsu MINT framebuffer (LE).

    Signed-off-by: Anton Vorontsov
    Cc: "Antonino A. Daplas"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc:
    Cc: Clemens Koller
    Cc: Krzysztof Helt
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Currently, if a perfect match in terms of resolution is not found,
    fb_find_mode() only looks for a best-fit mode among modes with a higher
    resolution than the one requested. Thus, if the user requests a resolution
    higher than the largest supported one, they are dropped to the default mode
    (usually a low resolution one).

    Change this behaviour so that all valid video modes are considered when
    looking for a best-fit mode, while still preferring modes with a higher
    resolution.

    Signed-off-by: Michal Januszewski
    Cc: Krzysztof Helt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Januszewski
     
  • Add a new function gpiochip_reserve() to reserve ranges of gpios that platform
    code has pre-allocated. That is, this marks gpio numbers which will be
    claimed by drivers that haven't yet been loaded, and thus are not available
    for dynamic gpio number allocation.

    [akpm@linux-foundation.org: remove unneeded __must_check]
    [david-b@pacbell.net: don't export gpiochip_reserve (section fix)]
    Signed-off-by: Anton Vorontsov
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • If gpio_chip->base is negative during registration, gpiolib performs dynamic
    base allocation. This is useful for devices that aren't always present, such
    as GPIOs on hotplugged devices rather than mainboards. (This behavior was
    previously specified but not implemented.)

    To avoid using any numbers that may have been explicitly assigned but not yet
    registered, this dynamic allocation assigns GPIO numbers from the biggest
    number on down, instead of from the smallest on up.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Introduce a gpio_is_valid() predicate; use it in gpiolib.

    Signed-off-by: Guennadi Liakhovetski
    [ use inline function; follow the gpio_* naming convention;
    work without gpiolib; all programming interfaces need docs ]
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • Use the newly introduced owner field in struct gpio_chip to protect the
    current (small) set of non-SOC GPIO drivers from being unloaded while any of
    their GPIOs are in use.

    Signed-off-by: Guennadi Liakhovetski
    [ add mcp23s08 and pcf857x ]
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • As long as one or more GPIOs on a gpio chip are used its driver should not be
    unloaded. The existing mechanism (gpiochip_remove failure) doesn't address
    that, since rmmod can no longer be made to fail by having the cleanup code
    report errors. Module usecounts are the solution.

    Assuming standard "initialize struct to zero" policies, this change won't
    affect SOC platform drivers. However, drivers for external chips (on I2C and
    SPI busses) should be updated if they can be built as modules.

    Signed-off-by: Guennadi Liakhovetski
    [ gpio_ensure_requested() needs to update module usecounts too ]
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • Nothing in between of them and the later declaration with body
    needs them.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ilpo Järvinen
     
  • Since CONFIG_AVMB1_COMPAT is not a Kconfig variable, move it out of the
    Kconfig namespace.

    Signed-off-by: Robert P. J. Day
    Acked-by: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • capifs_remount may reach 'return' statement without freeing of memory
    allocated by kstrdup call

    Signed-off-by: Cyrill Gorcunov
    Cc: Karsten Keil
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cyrill Gorcunov