06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

02 Aug, 2010

4 commits

  • Adds support for encoding display mode information
    in the device tree using verbatim EDID block.

    If the EDID entry in the DIU node is present, the
    driver will build mode database using EDID data
    and allow setting the display modes from this database.
    Otherwise display mode will be set using mode
    entries from driver's internal database as usual.

    This patch also updates device tree bindings.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • MPC5121 DIU configuration/setup as initialized by the boot
    loader currently will get lost while booting Linux. As a
    result displaying the boot splash is not possible through
    the boot process.

    To prevent this we reserve configured DIU frame buffer
    address range while booting and preserve AOI descriptor
    and gamma table so that DIU continues displaying through
    the whole boot process. On first open from user space
    DIU frame buffer driver releases the reserved frame
    buffer area and continues to operate as usual.

    Signed-off-by: John Rigby
    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • Some DIU structures will be used in platform code in
    subsequent MPC5121 DIU patch, so we move this header
    to be able to include it elsewhere.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Timur Tabi
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     
  • On MPC5121e Rev 2.0 re-configuring the DIU area descriptor
    by writing new descriptor address doesn't always work.
    As a result, DIU continues to display using old area descriptor
    even if the new one has been written to the descriptor register of
    the plane.

    Add the code from Freescale MPC5121EADS BSP for writing descriptor
    addresses properly. This fixes the problem for Rev 2.0 silicon.

    Signed-off-by: Anatolij Gustschin
    Signed-off-by: Grant Likely

    Anatolij Gustschin
     

22 May, 2010

1 commit

  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

19 May, 2010

1 commit


07 Apr, 2010

1 commit

  • Made necessary by 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use
    one lockdep class per sysfs attribute").

    Prevents further "key xxx not in .data" bug-reports. Although some
    attributes could probably be converted to static ones, this is left for
    people having hardware to test.

    Found by this semantic patch:

    @ init @
    type T;
    identifier A;
    @@

    T {
    ...
    struct device_attribute A;
    ...
    };

    @ main extends init @
    expression E;
    statement S;
    identifier err;
    T *name;
    @@

    ... when != sysfs_attr_init(&name->A.attr);
    (
    + sysfs_attr_init(&name->A.attr);
    if (device_create_file(E, &name->A))
    S
    |
    + sysfs_attr_init(&name->A.attr);
    err = device_create_file(E, &name->A);
    )

    While reviewing, I put the initialization to apropriate places.

    Signed-off-by: Wolfram Sang
    Cc: Eric W. Biederman
    Cc: Greg KH
    Cc: Benjamin Herrenschmidt
    Cc: Grant Likely
    Cc: Mike Isely
    Cc: Mauro Carvalho Chehab
    Cc: Sujith Thomas
    Cc: Matthew Garrett
    Cc: Len Brown
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     

17 Feb, 2010

1 commit


09 Jul, 2009

1 commit


01 Jul, 2009

1 commit

  • Add a mutex to avoid a circular locking problem between the mm layer
    semaphore and fbdev ioctl mutex through the fb_mmap() call.

    Also, add mutex to all places where smem_start and smem_len fields change
    so the mutex inside the fb_mmap() is actually used. Changing of these
    fields before calling the framebuffer_register() are not mutexed.

    This is 2.6.31 material. It removes one lockdep (fb_mmap() and
    register_framebuffer()) but there is still another one (fb_release() and
    register_framebuffer()). It also cleans up handling of the smem_start and
    smem_len fields used by mutexed section of the fb_mmap().

    Signed-off-by: Krzysztof Helt
    Cc: Peter Zijlstra
    Cc: "Rafael J. Wysocki"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     

06 Apr, 2009

1 commit

  • The driver should pass a device that specifies internal DMA ops, but
    currently NULL pointers are passed, and thus following bug pops up:

    Freescale DIU driver
    ------------[ cut here ]------------
    kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237!
    Oops: Exception in kernel mode, sig: 5 [#1]
    ...
    NIP [c01658b4] allocate_buf+0x0/0x8
    LR [c0306554] fsl_diu_probe+0x2b4/0x518
    Call Trace:
    [df02be10] [c030638c] fsl_diu_probe+0xec/0x518 (unreliable)
    [df02be60] [c020cdec] of_platform_device_probe+0x5c/0x84
    [df02be80] [c018f5d0] really_probe+0x78/0x1a0
    [df02bea0] [c018f7c0] __driver_attach+0xa4/0xa8
    [df02bec0] [c018ea00] bus_for_each_dev+0x60/0x9c
    [df02bef0] [c018f414] driver_attach+0x24/0x34
    [df02bf00] [c018f168] bus_add_driver+0x12c/0x1cc
    [df02bf20] [c018fbdc] driver_register+0x6c/0x110
    [df02bf30] [c020ccb4] of_register_driver+0x54/0x70
    [df02bf40] [c03d0a50] fsl_diu_init+0x70/0xa4
    ...

    This patch fixes the issue.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Kumar Gala

    Anton Vorontsov
     

15 Aug, 2008

2 commits


06 Aug, 2008

1 commit

  • of_node_put is needed before discarding a value received from
    of_find_node_by_type, eg in error handling code.

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

    //
    @@
    struct device_node *n;
    struct device_node *n1;
    struct device_node *n2;
    statement S;
    identifier f1,f2;
    expression E1,E2;
    constant C;
    @@

    n = of_find_node_by_type(...)
    ...
    if (!n) S
    ... when != of_node_put(n)
    when != n1 = f1(n,...)
    when != E1 = n
    when any
    when strict
    (
    + of_node_put(n);
    return -C;
    |
    of_node_put(n);
    |
    n2 = f2(n,...)
    |
    E2 = n
    |
    return ...;
    )
    //

    Signed-off-by: Julia Lawall
    Acked-by: Krzysztof Helt
    Cc: Timur Tabi
    Cc: York Sun
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     

25 Jul, 2008

1 commit

  • Update the Freescale DIU driver to use page_alloc_exact() to allocate a
    DMA buffer. This also eliminates the rheap-based memory allocator. We
    can do this now because commit 6ccf61f9 allows us to allocate 8MB
    physically- contiguous memory blocks.

    [akpm@linux-foundation.org: fix printk warnings]
    Signed-off-by: Timur Tabi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Timur Tabi
     

09 Jul, 2008

1 commit

  • On 2.6.26-rc9, the commit 05946bce839b4fed5442dbfab77060fb75e051f3
    ("fsl_diu_fb: fix build with CONFIG_PM=y, plus fix some warnings")
    breaks its previous fix f969c5672b16b857e5231ad3c78f08d8ef3305aa
    ("fsl-diu-db: compile fix")

    This patch reverts the broken part.

    Signed-off-by: Takashi Iwai
    Acked-by: Anton Vorontsov
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     

05 Jul, 2008

1 commit

  • This patch fixes following build error when CONFIG_PM is set.

    CC drivers/video/fsl-diu-fb.o
    drivers/video/fsl-diu-fb.c: In function 'fsl_diu_suspend':
    drivers/video/fsl-diu-fb.c:1327: error: 'ofdev' undeclared (first use in this function)
    drivers/video/fsl-diu-fb.c:1327: error: (Each undeclared identifier is reported only once
    drivers/video/fsl-diu-fb.c:1327: error: for each function it appears in.)
    drivers/video/fsl-diu-fb.c: In function 'fsl_diu_resume':
    drivers/video/fsl-diu-fb.c:1337: error: 'ofdev' undeclared (first use in this function)

    While I'm at it, also fix this warning:

    drivers/video/fsl-diu-fb.c: In function 'fsl_diu_alloc':
    drivers/video/fsl-diu-fb.c:314: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'phys_addr_t'

    And these section mismatches:

    ..from the function fsl_diu_remove() to the function .exit.text:uninstall_fb()
    ..from the function fsl_diu_remove() to the function .exit.text:uninstall_fb()
    ..from the function install_fb() to the variable .devinit.data:fsl_diu_mode_db
    ..from the function install_fb() to the variable .devinit.data:fsl_diu_mode_db
    ..from the function fsl_diu_probe() to the function .exit.text:uninstall_fb()
    ..from the function fsl_diu_probe() to the function .exit.text:uninstall_fb()

    Also, some sparse fixes: make two functions static, and use NULL where
    appropriate. There are still a lot of sparse warnings, mainly wrt absence
    of __iomem annotations, but some will require ugly __force stuff. I'll leave
    them for now, since proper fix would be not that trivial as few one-liners
    below.

    Signed-off-by: Anton Vorontsov
    Cc: Timur Tabi
    Cc: Antonino Daplas
    Cc: York Sun
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

12 Jun, 2008

1 commit


28 Apr, 2008

1 commit

  • The following features are supported:
    plane 0 works as a regular frame buffer, can be accessed by /dev/fb0
    plane 1 has two AOIs (area of interest), can be accessed by /dev/fb1 and /dev/fb2
    plane 2 has two AOIs, can be accessed by /dev/fb3 and /dev/fb4
    Special ioctls support AOIs

    All /dev/fb* can be used as regular frame buffer devices, except hardware
    change can only be made through /dev/fb0. Changing pixel clock has no effect
    on other fbs.

    Limitation of usage of AOIs:
    AOIs on the same plane can not be horizonally overlapped
    AOIs have horizonal order, i.e. AOI0 should be always on top of AOI1
    AOIs can not beyond phisical display area. Application should check AOI geometry
    before changing physical resolution on /dev/fb0

    required command line parameters to preallocate memory for frame buffer diufb.

    optional command line parameters to set modes and monitor
    video=fslfb:[resolution][,bpp][,monitor]
    Syntax:

    Resolution
    xres x yres-bpp@refresh_rate, the -bpp and @refresh_rate are optional
    eg, 1024x768, 1280x1024, 1280x1024-32, 1280x1024@60, 1280x1024-32@60, 1280x480-32@60

    Bpp
    bpp=32, bpp=24, or bpp=16

    Monitor
    monitor=0, monitor=1, monitor=2
    0 is DVI
    1 is Single link LVDS
    2 is Double link LVDS

    Note: switching monitor is a board feather, not DIU feather. MPC8610HPCD has three
    monitor ports to swtich to. MPC5121ADS doesn't have additional monitor port. So switching
    monirot port for MPC5121ADS has no effect.

    If compiled as a module, it takes pamameters mode, bpp, monitor with the same syntax above.

    Signed-off-by: York Sun
    Signed-off-by: Timur Tabi
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    York Sun