git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev: convert eexpro to net_device_ops
[safe/jmp/linux-2.6]
/
drivers
/
video
/
sa1100fb.c
diff --git
a/drivers/video/sa1100fb.c
b/drivers/video/sa1100fb.c
index
78e5f19
..
076f946
100644
(file)
--- a/
drivers/video/sa1100fb.c
+++ b/
drivers/video/sa1100fb.c
@@
-114,7
+114,7
@@
* - convert dma address types to dma_addr_t
* - remove unused 'montype' stuff
* - remove redundant zero inits of init_var after the initial
* - convert dma address types to dma_addr_t
* - remove unused 'montype' stuff
* - remove redundant zero inits of init_var after the initial
- * mem
zero
.
+ * mem
set
.
* - remove allow_modeset (acornfb idea does not belong here)
*
* 2001/05/28: <rmk@arm.linux.org.uk>
* - remove allow_modeset (acornfb idea does not belong here)
*
* 2001/05/28: <rmk@arm.linux.org.uk>
@@
-160,7
+160,6
@@
* - Add patch 681/1 and clean up stork definitions.
*/
* - Add patch 681/1 and clean up stork definitions.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@
-168,21
+167,21
@@
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
+#include <linux/mm.h>
#include <linux/fb.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/cpufreq.h>
#include <linux/fb.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/cpufreq.h>
-#include <linux/device.h>
+#include <linux/
platform_
device.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
+#include <linux/mutex.h>
-#include <
asm
/hardware.h>
+#include <
mach
/hardware.h>
#include <asm/io.h>
#include <asm/io.h>
-#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
-#include <asm/uaccess.h>
-#include <asm/arch/assabet.h>
-#include <asm/arch/shannon.h>
+#include <mach/assabet.h>
+#include <mach/shannon.h>
/*
* debugging?
/*
* debugging?
@@
-816,7
+815,7
@@
static int sa1100fb_blank(int blank, struct fb_info *info)
return 0;
}
return 0;
}
-static int sa1100fb_mmap(struct fb_info *info,
struct file *file,
+static int sa1100fb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info;
struct vm_area_struct *vma)
{
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info;
@@
-853,7
+852,6
@@
static struct fb_ops sa1100fb_ops = {
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_blank = sa1100fb_blank,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_blank = sa1100fb_blank,
- .fb_cursor = soft_cursor,
.fb_mmap = sa1100fb_mmap,
};
.fb_mmap = sa1100fb_mmap,
};
@@
-1088,7
+1086,7
@@
static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
/*
* sa1100fb_handle_irq: Handle 'LCD DONE' interrupts.
*/
/*
* sa1100fb_handle_irq: Handle 'LCD DONE' interrupts.
*/
-static irqreturn_t sa1100fb_handle_irq(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t sa1100fb_handle_irq(int irq, void *dev_id)
{
struct sa1100fb_info *fbi = dev_id;
unsigned int lcsr = LCSR;
{
struct sa1100fb_info *fbi = dev_id;
unsigned int lcsr = LCSR;
@@
-1111,7
+1109,7
@@
static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)
{
u_int old_state;
{
u_int old_state;
-
down(&fbi->ctrlr_sem
);
+
mutex_lock(&fbi->ctrlr_lock
);
old_state = fbi->state;
old_state = fbi->state;
@@
-1196,16
+1194,16
@@
static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)
}
break;
}
}
break;
}
-
up(&fbi->ctrlr_sem
);
+
mutex_unlock(&fbi->ctrlr_lock
);
}
/*
* Our LCD controller task (which is called when we blank or unblank)
* via keventd.
*/
}
/*
* Our LCD controller task (which is called when we blank or unblank)
* via keventd.
*/
-static void sa1100fb_task(
void *dummy
)
+static void sa1100fb_task(
struct work_struct *w
)
{
{
- struct sa1100fb_info *fbi =
dummy
;
+ struct sa1100fb_info *fbi =
container_of(w, struct sa1100fb_info, task)
;
u_int state = xchg(&fbi->task_state, -1);
set_ctrlr_state(fbi, state);
u_int state = xchg(&fbi->task_state, -1);
set_ctrlr_state(fbi, state);
@@
-1309,17
+1307,17
@@
sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
* Power management hooks. Note that we won't be called from IRQ context,
* unlike the blank functions above, so we may sleep.
*/
* Power management hooks. Note that we won't be called from IRQ context,
* unlike the blank functions above, so we may sleep.
*/
-static int sa1100fb_suspend(struct device *dev, pm_message_t state)
+static int sa1100fb_suspend(struct
platform_
device *dev, pm_message_t state)
{
{
- struct sa1100fb_info *fbi =
dev
_get_drvdata(dev);
+ struct sa1100fb_info *fbi =
platform
_get_drvdata(dev);
set_ctrlr_state(fbi, C_DISABLE_PM);
return 0;
}
set_ctrlr_state(fbi, C_DISABLE_PM);
return 0;
}
-static int sa1100fb_resume(struct device *dev)
+static int sa1100fb_resume(struct
platform_
device *dev)
{
{
- struct sa1100fb_info *fbi =
dev
_get_drvdata(dev);
+ struct sa1100fb_info *fbi =
platform
_get_drvdata(dev);
set_ctrlr_state(fbi, C_ENABLE_PM);
return 0;
set_ctrlr_state(fbi, C_ENABLE_PM);
return 0;
@@
-1447,21
+1445,25
@@
static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
fbi->max_bpp / 8;
init_waitqueue_head(&fbi->ctrlr_wait);
fbi->max_bpp / 8;
init_waitqueue_head(&fbi->ctrlr_wait);
- INIT_WORK(&fbi->task, sa1100fb_task
, fbi
);
-
init_MUTEX(&fbi->ctrlr_sem
);
+ INIT_WORK(&fbi->task, sa1100fb_task);
+
mutex_init(&fbi->ctrlr_lock
);
return fbi;
}
return fbi;
}
-static int __init sa1100fb_probe(struct
device *
dev)
+static int __init sa1100fb_probe(struct
platform_device *p
dev)
{
struct sa1100fb_info *fbi;
{
struct sa1100fb_info *fbi;
- int ret;
+ int ret, irq;
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return -EINVAL;
if (!request_mem_region(0xb0100000, 0x10000, "LCD"))
return -EBUSY;
if (!request_mem_region(0xb0100000, 0x10000, "LCD"))
return -EBUSY;
- fbi = sa1100fb_init_fbinfo(dev);
+ fbi = sa1100fb_init_fbinfo(
&pdev->
dev);
ret = -ENOMEM;
if (!fbi)
goto failed;
ret = -ENOMEM;
if (!fbi)
goto failed;
@@
-1471,7
+1473,7
@@
static int __init sa1100fb_probe(struct device *dev)
if (ret)
goto failed;
if (ret)
goto failed;
- ret = request_irq(
IRQ_LCD, sa1100fb_handle_irq, SA_INTERRUPT
,
+ ret = request_irq(
irq, sa1100fb_handle_irq, IRQF_DISABLED
,
"LCD", fbi);
if (ret) {
printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
"LCD", fbi);
if (ret) {
printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
@@
-1489,11
+1491,11
@@
static int __init sa1100fb_probe(struct device *dev)
*/
sa1100fb_check_var(&fbi->fb.var, &fbi->fb);
*/
sa1100fb_check_var(&fbi->fb.var, &fbi->fb);
-
dev_set_drvdata(
dev, fbi);
+
platform_set_drvdata(p
dev, fbi);
ret = register_framebuffer(&fbi->fb);
if (ret < 0)
ret = register_framebuffer(&fbi->fb);
if (ret < 0)
- goto
failed
;
+ goto
err_free_irq
;
#ifdef CONFIG_CPU_FREQ
fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
#ifdef CONFIG_CPU_FREQ
fbi->freq_transition.notifier_call = sa1100fb_freq_transition;
@@
-1505,19
+1507,22
@@
static int __init sa1100fb_probe(struct device *dev)
/* This driver cannot be unloaded at the moment */
return 0;
/* This driver cannot be unloaded at the moment */
return 0;
-failed:
- dev_set_drvdata(dev, NULL);
+ err_free_irq:
+ free_irq(irq, fbi);
+ failed:
+ platform_set_drvdata(pdev, NULL);
kfree(fbi);
release_mem_region(0xb0100000, 0x10000);
return ret;
}
kfree(fbi);
release_mem_region(0xb0100000, 0x10000);
return ret;
}
-static struct device_driver sa1100fb_driver = {
- .name = "sa11x0-fb",
- .bus = &platform_bus_type,
+static struct platform_driver sa1100fb_driver = {
.probe = sa1100fb_probe,
.suspend = sa1100fb_suspend,
.resume = sa1100fb_resume,
.probe = sa1100fb_probe,
.suspend = sa1100fb_suspend,
.resume = sa1100fb_resume,
+ .driver = {
+ .name = "sa11x0-fb",
+ },
};
int __init sa1100fb_init(void)
};
int __init sa1100fb_init(void)
@@
-1525,7
+1530,7
@@
int __init sa1100fb_init(void)
if (fb_get_options("sa1100fb", NULL))
return -ENODEV;
if (fb_get_options("sa1100fb", NULL))
return -ENODEV;
- return driver_register(&sa1100fb_driver);
+ return
platform_
driver_register(&sa1100fb_driver);
}
int __init sa1100fb_setup(char *options)
}
int __init sa1100fb_setup(char *options)