mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:55 +00:00
Remove VGA driver from config and build, and delete the file
This commit is contained in:
@@ -42,10 +42,6 @@ config FB_MXC_SII9022
|
||||
depends on FB_MXC_SYNC_PANEL && MACH_MX51_EFIKAMX
|
||||
tristate "SII9022A HDMI Interface Chip"
|
||||
|
||||
config FB_MXC_CS8556
|
||||
depends on FB_MXC_SYNC_PANEL && MACH_MX51_EFIKAMX
|
||||
tristate "Myson CS8556 VGA Interface Chip"
|
||||
|
||||
config FB_MXC_MTL017
|
||||
depends on FB_MXC_SYNC_PANEL && MACH_MX51_EFIKASB
|
||||
tristate "Myson MTL017 LVDS Controller"
|
||||
|
||||
@@ -21,7 +21,6 @@ obj-$(CONFIG_FB_MXC_LDB) += ldb.o
|
||||
obj-$(CONFIG_FB_MXC_CH7026) += mxcfb_ch7026.o
|
||||
#obj-$(CONFIG_FB_MODE_HELPERS) += mxc_edid.o
|
||||
obj-$(CONFIG_FB_MXC_SII9022) += mxcfb_sii9022.o
|
||||
obj-$(CONFIG_FB_MXC_CS8556) += mxcfb_cs8556.o
|
||||
obj-$(CONFIG_FB_MXC_MTL017) += mxcfb_mtl017.o
|
||||
obj-$(CONFIG_FB_MXC_EINK_PANEL) += mxc_epdc_fb.o
|
||||
obj-$(CONFIG_FB_MXC_ELCDIF_FB) += mxc_elcdif_fb.o
|
||||
|
||||
@@ -1,565 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Pegatron Corporation. All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The code contained herein is licensed under the GNU General Public
|
||||
* License. You may obtain a copy of the GNU General Public License
|
||||
* Version 2 or later at the following locations:
|
||||
*
|
||||
* http://www.opensource.org/licenses/gpl-license.html
|
||||
* http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @defgroup Framebuffer Framebuffer Driver for SDC and ADC.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @file mxcfb_cs8556.c
|
||||
*
|
||||
* @brief MXC Frame buffer driver for SDC
|
||||
*
|
||||
* @ingroup Framebuffer
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Include files
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mxcfb.h>
|
||||
#include <linux/ipu.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
static struct i2c_client *cs8556_client;
|
||||
|
||||
static int lcd_init(void);
|
||||
static void lcd_poweron(struct fb_info *info);
|
||||
static void lcd_poweroff(void);
|
||||
|
||||
static void (*lcd_reset) (void);
|
||||
static struct regulator *io_reg;
|
||||
static struct regulator *core_reg;
|
||||
static struct regulator *analog_reg;
|
||||
|
||||
static struct fb_videomode mode = {
|
||||
"1024x768", 60, 1024, 768, 16081, 160, 56, 20, 3, 104, 4, 2, FB_VMODE_NONINTERLACED
|
||||
};
|
||||
|
||||
static void lcd_init_fb(struct fb_info *info)
|
||||
{
|
||||
struct fb_var_screeninfo var;
|
||||
|
||||
memset(&var, 0, sizeof(var));
|
||||
|
||||
fb_videomode_to_var(&var, &mode);
|
||||
|
||||
var.activate = FB_ACTIVATE_ALL;
|
||||
|
||||
acquire_console_sem();
|
||||
info->flags |= FBINFO_MISC_USEREVENT;
|
||||
fb_set_var(info, &var);
|
||||
fb_blank(info, FB_BLANK_UNBLANK);
|
||||
info->flags &= ~FBINFO_MISC_USEREVENT;
|
||||
release_console_sem();
|
||||
}
|
||||
|
||||
static int lcd_fb_event(struct notifier_block *nb, unsigned long val, void *v)
|
||||
{
|
||||
struct fb_event *event = v;
|
||||
|
||||
if (strcmp(event->info->fix.id, "DISP3 BG - DI1"))
|
||||
return 0;
|
||||
|
||||
switch (val) {
|
||||
case FB_EVENT_FB_REGISTERED:
|
||||
lcd_init_fb(event->info);
|
||||
lcd_poweron(event->info);
|
||||
break;
|
||||
case FB_EVENT_BLANK:
|
||||
if (*((int *)event->data) == FB_BLANK_UNBLANK)
|
||||
lcd_poweron(event->info);
|
||||
else
|
||||
lcd_poweroff();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct notifier_block nb = {
|
||||
.notifier_call = lcd_fb_event,
|
||||
};
|
||||
|
||||
/*!
|
||||
* This function is called whenever the SPI slave device is detected.
|
||||
*
|
||||
* @param spi the SPI slave device
|
||||
*
|
||||
* @return Returns 0 on SUCCESS and error on FAILURE.
|
||||
*/
|
||||
static int __devinit lcd_probe(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
int i;
|
||||
struct mxc_lcd_platform_data *plat = dev->platform_data;
|
||||
|
||||
if (plat) {
|
||||
lcd_reset = plat->reset;
|
||||
if (lcd_reset)
|
||||
lcd_reset();
|
||||
}
|
||||
|
||||
for (i = 0; i < num_registered_fb; i++) {
|
||||
if (strcmp(registered_fb[i]->fix.id, "DISP3 BG - DI1") == 0) {
|
||||
ret = lcd_init();
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
lcd_init_fb(registered_fb[i]);
|
||||
fb_show_logo(registered_fb[i], 0);
|
||||
lcd_poweron(registered_fb[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fb_register_client(&nb);
|
||||
return 0;
|
||||
err:
|
||||
if (io_reg)
|
||||
regulator_disable(io_reg);
|
||||
if (core_reg)
|
||||
regulator_disable(core_reg);
|
||||
if (analog_reg)
|
||||
regulator_disable(analog_reg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __devinit cs8556_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
int id_reg;
|
||||
cs8556_client = client;
|
||||
|
||||
return lcd_probe(&client->dev);
|
||||
}
|
||||
|
||||
static int __devexit cs8556_remove(struct i2c_client *client)
|
||||
{
|
||||
fb_unregister_client(&nb);
|
||||
lcd_poweroff();
|
||||
regulator_put(io_reg);
|
||||
regulator_put(core_reg);
|
||||
regulator_put(analog_reg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs8556_suspend(struct i2c_client *client, pm_message_t message)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cs8556_resume(struct i2c_client *client)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Hungwen
|
||||
u8 __devinitdata xga2xga_tbl1[] = {
|
||||
// 0x00 - 0x0F
|
||||
0x00,
|
||||
0x0E, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x10 - 0x1F
|
||||
0x10,
|
||||
//0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //RGB24
|
||||
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //RGB565
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x20 - 0x2F
|
||||
0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x30 - 0x3F
|
||||
0x30,
|
||||
0x3F, 0x05, 0x67, 0x00, 0x08, 0x01, 0x08, 0x05,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x40 - 0x4F
|
||||
0x40,
|
||||
0x1A, 0x03, 0x03, 0x00, 0x17, 0x00, 0x16, 0x03,
|
||||
0x00, 0x00, 0x9F, 0x00, 0x15, 0x00, 0x37, 0x00,
|
||||
// 0x50 - 0x5F
|
||||
0x50,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x60 - 0x6F
|
||||
0x60,
|
||||
0x1F, 0x05, 0x20, 0x00, 0xC0, 0x00, 0xC0, 0x04,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x38, 0x03,
|
||||
// 0x70 - 0x7F
|
||||
0x70,
|
||||
0x3D, 0x03, 0x0C, 0x00, 0x16, 0x00, 0x04, 0x03,
|
||||
0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x80 - 0x8F
|
||||
0x80,
|
||||
0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x90 - 0x9F
|
||||
0x90,
|
||||
0x04, 0x01, 0x11, 0x0D, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xA0 - 0xAF
|
||||
0xA0,
|
||||
0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
|
||||
0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
|
||||
// 0xB0 - 0xBF
|
||||
0xB0,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xC0 - 0xCF
|
||||
0xC0,
|
||||
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
|
||||
// 0xD0 - 0xDF
|
||||
0xD0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xE0 - 0xEF
|
||||
0xE0,
|
||||
//0x01, 0x06, 0x13, 0x00, 0x01, 0x02, 0x00, 0x00,
|
||||
0x01, 0x01, 0x03, 0x00, 0x01, 0x02, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xF0 - 0xFF
|
||||
0xF0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
u8 __devinitdata xga2xga_tbl2[] = {
|
||||
// 0x00 - 0x0F
|
||||
0x00,
|
||||
0x80, 0x10, 0x80, 0x00, 0x00, 0x00, 0x99, 0x11,
|
||||
0x2A, 0x00, 0x70, 0x30, 0x2A, 0x71, 0x9C, 0x00,
|
||||
// 0x10 - 0x1F
|
||||
0x10,
|
||||
0x10, 0x2A, 0x85, 0x82, 0x00, 0x00, 0xFF, 0x00,
|
||||
0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
|
||||
// 0x20 - 0x2F
|
||||
0x20,
|
||||
0x41, 0x09, 0x98, 0x08, 0xCC, 0x00, 0x4C, 0x08,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
|
||||
// 0x30 - 0x3F
|
||||
0x30,
|
||||
0x00, 0x01, 0xEE, 0x02, 0x3A, 0x07, 0x65, 0x04,
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x40 - 0x4F
|
||||
0x40,
|
||||
0x06, 0x40, 0x07, 0x30, 0x15, 0x10, 0x31, 0x02,
|
||||
0x33, 0x12, 0x34, 0x52, 0x38, 0x42, 0x39, 0x62,
|
||||
// 0x50 - 0x5F
|
||||
0x50,
|
||||
0x48, 0x12, 0x64, 0x04, 0x66, 0x14, 0x00, 0x10,
|
||||
0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10,
|
||||
// 0x60 - 0x6F
|
||||
0x60,
|
||||
0x7E, 0x10, 0x00, 0xF4, 0x10, 0x76, 0x08, 0x00,
|
||||
0x8A, 0x00, 0x8F, 0x11, 0x8F, 0x8F, 0x81, 0x00,
|
||||
// 0x70 - 0x7F
|
||||
0x70,
|
||||
0x03, 0x00, 0x89, 0x45, 0x01, 0x45, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x80 - 0x8F
|
||||
0x80,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x90 - 0x9F
|
||||
0x90,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xA0 - 0xAF
|
||||
0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xB0 - 0xBF
|
||||
0xB0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xC0 - 0xCF
|
||||
0xC0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xD0 - 0xDF
|
||||
0xD0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xE0 - 0xEF
|
||||
0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xF0 - 0xFF
|
||||
0xF0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
u8 __devinitdata wsvga2xga_tbl1[] = {
|
||||
// 0x00 - 0x0F
|
||||
0x00,
|
||||
0x0E, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x01,
|
||||
// 0x10 - 0x0F
|
||||
0x10,
|
||||
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x20 - 0x0F
|
||||
0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x30 - 0x0F
|
||||
0x30,
|
||||
0x7B, 0x04, 0x10, 0x00, 0x54, 0x00, 0x54, 0x04,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x40 - 0x0F
|
||||
0x40,
|
||||
0x97, 0x02, 0x03, 0x00, 0x12, 0x00, 0x6A, 0x02,
|
||||
0x00, 0x00, 0x50, 0x00, 0x14, 0x00, 0x17, 0x00,
|
||||
// 0x50 - 0x0F
|
||||
0x50,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x60 - 0x0F
|
||||
0x60,
|
||||
0x1F, 0x05, 0x20, 0x00, 0xC0, 0x00, 0xC0, 0x04,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x38, 0x03,
|
||||
// 0x70 - 0x0F
|
||||
0x70,
|
||||
0x3D, 0x03, 0x0C, 0x00, 0x16, 0x00, 0x04, 0x03,
|
||||
0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x80 - 0x0F
|
||||
0x80,
|
||||
0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x90 - 0x0F
|
||||
0x90,
|
||||
0x04, 0x01, 0x11, 0x0D, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xA0 - 0x0F
|
||||
0xA0,
|
||||
0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
|
||||
0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
|
||||
// 0xB0 - 0x0F
|
||||
0xB0,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xC0 - 0x0F
|
||||
0xC0,
|
||||
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,
|
||||
// 0xD0 - 0x0F
|
||||
0xD0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xE0 - 0x0F
|
||||
0xE0,
|
||||
0x01, 0x06, 0x13, 0x00, 0x01, 0x02, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xF0 - 0x0F
|
||||
0xF0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
u8 __devinitdata wsvga2xga_tbl2[] = {
|
||||
// 0x00 - 0x0F
|
||||
0x00,
|
||||
0x80, 0x10, 0x80, 0x00, 0x00, 0x00, 0x99, 0x11,
|
||||
0x2A, 0x00, 0x70, 0x30, 0x2A, 0x71, 0x9C, 0x00,
|
||||
// 0x10 - 0x0F
|
||||
0x10,
|
||||
0x10, 0x2A, 0x85, 0x82, 0x00, 0x00, 0xFF, 0x00,
|
||||
0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
|
||||
// 0x20 - 0x0F
|
||||
0x20,
|
||||
0x41, 0x01, 0x98, 0x08, 0xCC, 0x00, 0x4C, 0x08,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
|
||||
// 0x30 - 0x0F
|
||||
0x30,
|
||||
0x00, 0x01, 0xEE, 0x02, 0x3A, 0x07, 0x65, 0x04,
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x40 - 0x0F
|
||||
0x40,
|
||||
0x06, 0x40, 0x07, 0x30, 0x15, 0x10, 0x31, 0x02,
|
||||
0x33, 0x12, 0x34, 0x52, 0x38, 0x42, 0x39, 0x62,
|
||||
// 0x50 - 0x0F
|
||||
0x50,
|
||||
0x48, 0x12, 0x64, 0x04, 0x66, 0x14, 0x00, 0x10,
|
||||
0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10,
|
||||
// 0x60 - 0x0F
|
||||
0x60,
|
||||
0x7E, 0x10, 0x00, 0xF4, 0x10, 0x76, 0x08, 0x00,
|
||||
0x8A, 0x00, 0x8F, 0x11, 0x8F, 0x8F, 0x81, 0x00,
|
||||
// 0x70 - 0x0F
|
||||
0x70,
|
||||
0x03, 0x00, 0x89, 0x45, 0x01, 0x45, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x80 - 0x0F
|
||||
0x80,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0x90 - 0x0F
|
||||
0x90,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xA0 - 0x0F
|
||||
0xA0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xB0 - 0x0F
|
||||
0xB0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xC0 - 0x0F
|
||||
0xC0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xD0 - 0x0F
|
||||
0xD0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xE0 - 0x0F
|
||||
0xE0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
// 0xF0 - 0x0F
|
||||
0xF0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
|
||||
#define REGMAP_LENGTH (sizeof(reg_init) / (2*sizeof(u8)))
|
||||
#define BLOCK_TX_SIZE (16+1) //Must small than 32
|
||||
|
||||
/*
|
||||
* Send init commands to L4F00242T03
|
||||
*
|
||||
*/
|
||||
static int lcd_init(void)
|
||||
{
|
||||
int i, j;
|
||||
int dat;
|
||||
u8 *tables[] = { xga2xga_tbl1, xga2xga_tbl2 };
|
||||
int tbl_len[] = {
|
||||
sizeof(xga2xga_tbl1) / sizeof(u8),
|
||||
sizeof(xga2xga_tbl2) / sizeof(u8)
|
||||
};
|
||||
|
||||
dev_dbg(&cs8556_client->dev, "initializing CS8556AG\n");
|
||||
|
||||
/* read device ID */
|
||||
msleep(100);
|
||||
dat = i2c_smbus_read_byte_data(cs8556_client, 0x00);
|
||||
dev_dbg(&cs8556_client->dev, "read id = 0x%02X\n", dat);
|
||||
//if (dat != 0x54)
|
||||
// return -ENODEV;
|
||||
|
||||
// Writing configuration table.
|
||||
for (i = 0; i < 2; i++) {
|
||||
for (j = 0; j < tbl_len[i]; j += BLOCK_TX_SIZE) {
|
||||
if (i2c_smbus_write_i2c_block_data(cs8556_client, i,
|
||||
BLOCK_TX_SIZE, &(tables[i][j]) ) < 0) {
|
||||
printk("@_@ VGA controller init error!!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcd_on;
|
||||
/*
|
||||
* Send Power On commands to L4F00242T03
|
||||
*
|
||||
*/
|
||||
static void lcd_poweron(struct fb_info *info)
|
||||
{
|
||||
u16 data[4];
|
||||
u32 refresh;
|
||||
|
||||
if (lcd_on)
|
||||
return;
|
||||
|
||||
dev_dbg(&cs8556_client->dev, "turning on LCD\n");
|
||||
|
||||
data[0] = PICOS2KHZ(info->var.pixclock) / 10;
|
||||
data[2] = info->var.hsync_len + info->var.left_margin +
|
||||
info->var.xres + info->var.right_margin;
|
||||
data[3] = info->var.vsync_len + info->var.upper_margin +
|
||||
info->var.yres + info->var.lower_margin;
|
||||
|
||||
refresh = data[2] * data[3];
|
||||
refresh = (PICOS2KHZ(info->var.pixclock) * 1000) / refresh;
|
||||
data[1] = refresh * 100;
|
||||
|
||||
lcd_on = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send Power Off commands to L4F00242T03
|
||||
*
|
||||
*/
|
||||
static void lcd_poweroff(void)
|
||||
{
|
||||
if (!lcd_on)
|
||||
return;
|
||||
|
||||
dev_dbg(&cs8556_client->dev, "turning off LCD\n");
|
||||
|
||||
lcd_on = 0;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id cs8556_id[] = {
|
||||
{"cs8556", 0},
|
||||
{},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, cs8556_id);
|
||||
|
||||
static struct i2c_driver cs8556_driver = {
|
||||
.driver = {
|
||||
.name = "cs8556",
|
||||
},
|
||||
.probe = cs8556_probe,
|
||||
.remove = cs8556_remove,
|
||||
.suspend = cs8556_suspend,
|
||||
.resume = cs8556_resume,
|
||||
.id_table = cs8556_id,
|
||||
};
|
||||
|
||||
static int __init cs8556_init(void)
|
||||
{
|
||||
return i2c_add_driver(&cs8556_driver);
|
||||
}
|
||||
|
||||
static void __exit cs8556_exit(void)
|
||||
{
|
||||
i2c_del_driver(&cs8556_driver);
|
||||
}
|
||||
|
||||
module_init(cs8556_init);
|
||||
module_exit(cs8556_exit);
|
||||
|
||||
MODULE_AUTHOR("Pegatron Corporation");
|
||||
MODULE_DESCRIPTION("cs8556 VGA driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
Reference in New Issue
Block a user