aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/xilinxfb.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/video/xilinxfb.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/video/xilinxfb.c')
-rw-r--r--drivers/video/xilinxfb.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 0c9ce88e95e8..77dea015ff69 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -32,10 +32,14 @@
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/of_device.h> 33#include <linux/of_device.h>
34#include <linux/of_platform.h> 34#include <linux/of_platform.h>
35#include <linux/of_address.h>
35#include <linux/io.h> 36#include <linux/io.h>
36#include <linux/xilinxfb.h> 37#include <linux/xilinxfb.h>
37#include <linux/slab.h> 38#include <linux/slab.h>
39
40#ifdef CONFIG_PPC_DCR
38#include <asm/dcr.h> 41#include <asm/dcr.h>
42#endif
39 43
40#define DRIVER_NAME "xilinxfb" 44#define DRIVER_NAME "xilinxfb"
41 45
@@ -123,10 +127,10 @@ struct xilinxfb_drvdata {
123 registers */ 127 registers */
124 void __iomem *regs; /* virt. address of the control 128 void __iomem *regs; /* virt. address of the control
125 registers */ 129 registers */
126 130#ifdef CONFIG_PPC_DCR
127 dcr_host_t dcr_host; 131 dcr_host_t dcr_host;
128 unsigned int dcr_len; 132 unsigned int dcr_len;
129 133#endif
130 void *fb_virt; /* virt. address of the frame buffer */ 134 void *fb_virt; /* virt. address of the frame buffer */
131 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 135 dma_addr_t fb_phys; /* phys. address of the frame buffer */
132 int fb_alloced; /* Flag, was the fb memory alloced? */ 136 int fb_alloced; /* Flag, was the fb memory alloced? */
@@ -152,9 +156,10 @@ static void xilinx_fb_out_be32(struct xilinxfb_drvdata *drvdata, u32 offset,
152{ 156{
153 if (drvdata->flags & PLB_ACCESS_FLAG) 157 if (drvdata->flags & PLB_ACCESS_FLAG)
154 out_be32(drvdata->regs + (offset << 2), val); 158 out_be32(drvdata->regs + (offset << 2), val);
159#ifdef CONFIG_PPC_DCR
155 else 160 else
156 dcr_write(drvdata->dcr_host, offset, val); 161 dcr_write(drvdata->dcr_host, offset, val);
157 162#endif
158} 163}
159 164
160static int 165static int
@@ -383,8 +388,11 @@ static int xilinxfb_release(struct device *dev)
383 if (drvdata->flags & PLB_ACCESS_FLAG) { 388 if (drvdata->flags & PLB_ACCESS_FLAG) {
384 iounmap(drvdata->regs); 389 iounmap(drvdata->regs);
385 release_mem_region(drvdata->regs_phys, 8); 390 release_mem_region(drvdata->regs_phys, 8);
386 } else 391 }
392#ifdef CONFIG_PPC_DCR
393 else
387 dcr_unmap(drvdata->dcr_host, drvdata->dcr_len); 394 dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
395#endif
388 396
389 kfree(drvdata); 397 kfree(drvdata);
390 dev_set_drvdata(dev, NULL); 398 dev_set_drvdata(dev, NULL);
@@ -396,22 +404,19 @@ static int xilinxfb_release(struct device *dev)
396 * OF bus binding 404 * OF bus binding
397 */ 405 */
398 406
399static int __devinit 407static int __devinit xilinxfb_of_probe(struct platform_device *op)
400xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
401{ 408{
402 const u32 *prop; 409 const u32 *prop;
403 u32 *p; 410 u32 *p;
404 u32 tft_access; 411 u32 tft_access;
405 struct xilinxfb_platform_data pdata; 412 struct xilinxfb_platform_data pdata;
406 struct resource res; 413 struct resource res;
407 int size, rc, start; 414 int size, rc;
408 struct xilinxfb_drvdata *drvdata; 415 struct xilinxfb_drvdata *drvdata;
409 416
410 /* Copy with the default pdata (not a ptr reference!) */ 417 /* Copy with the default pdata (not a ptr reference!) */
411 pdata = xilinx_fb_default_pdata; 418 pdata = xilinx_fb_default_pdata;
412 419
413 dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match);
414
415 /* Allocate the driver data region */ 420 /* Allocate the driver data region */
416 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 421 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
417 if (!drvdata) { 422 if (!drvdata) {
@@ -437,7 +442,10 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
437 dev_err(&op->dev, "invalid address\n"); 442 dev_err(&op->dev, "invalid address\n");
438 goto err; 443 goto err;
439 } 444 }
440 } else { 445 }
446#ifdef CONFIG_PPC_DCR
447 else {
448 int start;
441 res.start = 0; 449 res.start = 0;
442 start = dcr_resource_start(op->dev.of_node, 0); 450 start = dcr_resource_start(op->dev.of_node, 0);
443 drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0); 451 drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0);
@@ -447,6 +455,7 @@ xilinxfb_of_probe(struct platform_device *op, const struct of_device_id *match)
447 goto err; 455 goto err;
448 } 456 }
449 } 457 }
458#endif
450 459
451 prop = of_get_property(op->dev.of_node, "phys-size", &size); 460 prop = of_get_property(op->dev.of_node, "phys-size", &size);
452 if ((prop) && (size >= sizeof(u32)*2)) { 461 if ((prop) && (size >= sizeof(u32)*2)) {
@@ -493,7 +502,7 @@ static struct of_device_id xilinxfb_of_match[] __devinitdata = {
493}; 502};
494MODULE_DEVICE_TABLE(of, xilinxfb_of_match); 503MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
495 504
496static struct of_platform_driver xilinxfb_of_driver = { 505static struct platform_driver xilinxfb_of_driver = {
497 .probe = xilinxfb_of_probe, 506 .probe = xilinxfb_of_probe,
498 .remove = __devexit_p(xilinxfb_of_remove), 507 .remove = __devexit_p(xilinxfb_of_remove),
499 .driver = { 508 .driver = {
@@ -511,13 +520,13 @@ static struct of_platform_driver xilinxfb_of_driver = {
511static int __init 520static int __init
512xilinxfb_init(void) 521xilinxfb_init(void)
513{ 522{
514 return of_register_platform_driver(&xilinxfb_of_driver); 523 return platform_driver_register(&xilinxfb_of_driver);
515} 524}
516 525
517static void __exit 526static void __exit
518xilinxfb_cleanup(void) 527xilinxfb_cleanup(void)
519{ 528{
520 of_unregister_platform_driver(&xilinxfb_of_driver); 529 platform_driver_unregister(&xilinxfb_of_driver);
521} 530}
522 531
523module_init(xilinxfb_init); 532module_init(xilinxfb_init);