#include <linux/module.h>
#include <linux/kernel.h>
-#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
-#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/init.h>
-#include <linux/vmalloc.h>
-#include <linux/dma-mapping.h>
-#include <linux/interrupt.h>
-#include <linux/workqueue.h>
-#include <linux/wait.h>
#include <linux/platform_device.h>
-#include <linux/clk.h>
#include <linux/spinlock.h>
#include <linux/io.h>
-#include <linux/uaccess.h>
+#include <linux/mfd/glamo.h>
#include <asm/div64.h>
struct resource *reg;
struct resource *fb_res;
char __iomem *base;
- struct glamofb_platform_data *mach_info;
+ struct glamo_fb_platform_data *mach_info;
char __iomem *cursor_addr;
int cursor_on;
u_int32_t pseudo_pal[16];
};
static void glamo_output_enable(struct glamofb_handle *gfb) {
- struct glamo_core *gcore = gfb->mach_info->glamo;
+ struct glamo_core *gcore = gfb->mach_info->core;
if (gfb->output_enabled)
return;
}
static void glamo_output_disable(struct glamofb_handle *gfb) {
- struct glamo_core *gcore = gfb->mach_info->glamo;
+ struct glamo_core *gcore = gfb->mach_info->core;
if (!gfb->output_enabled)
return;
{
int i;
- if (glamo->mach_info->glamo->suspending) {
- dev_err(&glamo->mach_info->glamo->pdev->dev,
+ if (glamo->mach_info->core->suspending) {
+ dev_err(&glamo->mach_info->core->pdev->dev,
"IGNORING glamofb_run_script while "
"suspended\n");
return -EBUSY;
{
struct glamofb_handle *glamo = info->par;
- if (glamo->mach_info->glamo->suspending) {
- dev_err(&glamo->mach_info->glamo->pdev->dev,
+ if (glamo->mach_info->core->suspending) {
+ dev_err(&glamo->mach_info->core->pdev->dev,
"IGNORING glamofb_check_var while "
"suspended\n");
return -EBUSY;
{
int glamo_rot;
- if (glamo->mach_info->glamo->suspending) {
- dev_err(&glamo->mach_info->glamo->pdev->dev,
+ if (glamo->mach_info->core->suspending) {
+ dev_err(&glamo->mach_info->core->pdev->dev,
"IGNORING rotate_lcd while "
"suspended\n");
return;
static void glamofb_program_mode(struct glamofb_handle* gfb) {
int sync, bp, disp, fp, total;
unsigned long flags;
- struct glamo_core *gcore = gfb->mach_info->glamo;
+ struct glamo_core *gcore = gfb->mach_info->core;
struct fb_var_screeninfo *var = &gfb->fb->var;
dev_dbg(&gcore->pdev->dev,
if (var->pixclock)
glamo_engine_reclock(gcore,
GLAMO_ENGINE_LCD,
- gfb->fb->var.pixclock);
+ (1000000000UL / gfb->fb->var.pixclock) * 1000);
reg_set_bit_mask(gfb,
GLAMO_REG_LCD_WIDTH,
static struct fb_videomode *glamofb_find_mode(struct fb_info *info,
struct fb_var_screeninfo *var) {
struct glamofb_handle *glamo = info->par;
- struct glamofb_platform_data *mach_info = glamo->mach_info;
+ struct glamo_fb_platform_data *mach_info = glamo->mach_info;
struct fb_videomode *mode;
int i;
struct fb_var_screeninfo *var = &info->var;
struct fb_videomode *mode;
- if (glamo->mach_info->glamo->suspending) {
- dev_err(&glamo->mach_info->glamo->pdev->dev,
+ if (glamo->mach_info->core->suspending) {
+ dev_err(&glamo->mach_info->core->pdev->dev,
"IGNORING glamofb_set_par while "
"suspended\n");
return -EBUSY;
struct glamofb_handle *glamo = info->par;
unsigned int val;
- if (glamo->mach_info->glamo->suspending) {
- dev_err(&glamo->mach_info->glamo->pdev->dev,
+ if (glamo->mach_info->core->suspending) {
+ dev_err(&glamo->mach_info->core->pdev->dev,
"IGNORING glamofb_set_par while "
"suspended\n");
return -EBUSY;
static int glamofb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg) {
struct glamofb_handle *gfb = (struct glamofb_handle*)info->par;
- struct glamo_core *gcore = gfb->mach_info->glamo;
+ struct glamo_core *gcore = gfb->mach_info->core;
int retval = -ENOTTY;
switch (cmd) {
{
int timeout = 2000000;
- if (gfb->mach_info->glamo->suspending) {
- dev_err(&gfb->mach_info->glamo->pdev->dev,
+ if (gfb->mach_info->core->suspending) {
+ dev_err(&gfb->mach_info->core->pdev->dev,
"IGNORING glamofb_cmd_mode while "
"suspended\n");
return -EBUSY;
{
int timeout = 200000;
- if (gfb->mach_info->glamo->suspending) {
- dev_err(&gfb->mach_info->glamo->pdev->dev,
+ if (gfb->mach_info->core->suspending) {
+ dev_err(&gfb->mach_info->core->pdev->dev,
"IGNORING glamofb_cmd_write while "
"suspended\n");
return -EBUSY;
int rc = -EIO;
struct fb_info *fbinfo;
struct glamofb_handle *glamofb;
- struct glamofb_platform_data *mach_info = pdev->dev.platform_data;
+ struct glamo_fb_platform_data *mach_info = pdev->dev.platform_data;
printk(KERN_INFO "SMEDIA Glamo frame buffer driver (C) 2007 "
"Openmoko, Inc.\n");
fbinfo->var.accel_flags = 0;
fbinfo->var.vmode = FB_VMODE_NONINTERLACED;
- glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD);
- glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD);
+ glamo_engine_enable(mach_info->core, GLAMO_ENGINE_LCD);
+ glamo_engine_reset(mach_info->core, GLAMO_ENGINE_LCD);
glamofb->output_enabled = 1;
glamofb->mode_set = 1;
static int glamofb_resume(struct platform_device *pdev)
{
struct glamofb_handle *gfb = platform_get_drvdata(pdev);
- struct glamofb_platform_data *mach_info = pdev->dev.platform_data;
+ struct glamo_fb_platform_data *mach_info = pdev->dev.platform_data;
/* OK let's allow framebuffer ops again */
/* gfb->fb->screen_base = ioremap(gfb->fb_res->start,
resource_size(gfb->fb_res)); */
- glamo_engine_enable(mach_info->glamo, GLAMO_ENGINE_LCD);
- glamo_engine_reset(mach_info->glamo, GLAMO_ENGINE_LCD);
+ glamo_engine_enable(mach_info->core, GLAMO_ENGINE_LCD);
+ glamo_engine_reset(mach_info->core, GLAMO_ENGINE_LCD);
printk(KERN_ERR"spin_lock_init\n");
spin_lock_init(&gfb->lock_cmd);