diff --git a/drivers/misc/scaler/Kconfig b/drivers/misc/scaler/Kconfig deleted file mode 100644 index b621148a093d..000000000000 --- a/drivers/misc/scaler/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# all auto modem control drivers configuration -# - -menuconfig SCALER_DEVICE - bool "Scaler Device Support" - default n - -if SCALER_DEVICE - -config SCALER_DEVICE_DDC - bool "Scaler Device Support DDC Read EDID" - default n - -source "drivers/misc/scaler/chips/Kconfig" -endif diff --git a/drivers/misc/scaler/Makefile b/drivers/misc/scaler/Makefile deleted file mode 100644 index 2284543338e0..000000000000 --- a/drivers/misc/scaler/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for the display core. -# - -obj-$(CONFIG_SCALER_DEVICE) += chips/ -obj-$(CONFIG_SCALER_DEVICE) += scaler-core.o -obj-$(CONFIG_SCALER_DEVICE) += scaler-sysfs.o -obj-$(CONFIG_SCALER_DEVICE_DDC) += scaler-edid.o diff --git a/drivers/misc/scaler/chips/Kconfig b/drivers/misc/scaler/chips/Kconfig deleted file mode 100644 index 78b4c9ee88f1..000000000000 --- a/drivers/misc/scaler/chips/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -#config tv5735 support inport type and output type -# - -config SCALER_TV5735 - bool "Support tv5735 chip" - default n - -config SCALER_TEST - bool "test chip" - default n diff --git a/drivers/misc/scaler/chips/Makefile b/drivers/misc/scaler/chips/Makefile deleted file mode 100644 index b633d1ff59ad..000000000000 --- a/drivers/misc/scaler/chips/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_SCALER_TV5735) += tv5735.o -obj-$(CONFIG_SCALER_TEST) += test.o diff --git a/drivers/misc/scaler/chips/test.c b/drivers/misc/scaler/chips/test.c deleted file mode 100644 index b98f75797301..000000000000 --- a/drivers/misc/scaler/chips/test.c +++ /dev/null @@ -1,143 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - Copyright (c) 2010 by Rockchip. -*/ -#include -#include -#include -#include - -struct scaler_chip_dev *chip = NULL; - -//enbale chip to process image -static void set_cur_inport(void) -{ - struct scaler_input_port *iport = NULL; - int ddc_sel_level = -1; - - list_for_each_entry(iport, &chip->iports, next) { - - if (iport->id == chip->cur_inport_id) { - if (iport->id == 1) - ddc_sel_level = chip->pdata->ddc_sel_level; - else - ddc_sel_level = !chip->pdata->ddc_sel_level; - if (chip->pdata->ddc_sel_gpio > 0) - gpio_direction_output(chip->pdata->ddc_sel_gpio, ddc_sel_level); - gpio_set_value(iport->led_gpio, GPIO_HIGH); - }else { - gpio_set_value(iport->led_gpio, GPIO_LOW); - } - } -} - -static int test_parse_cmd(unsigned int cmd, unsigned long arg) -{ - printk("test: parse scaler cmd %u\n",cmd); - - switch (cmd) { - case SCALER_IOCTL_SET_CUR_INPUT: - set_cur_inport(); - break; - default: - break; - } - - return 0; -} - -static void test_start(void) -{ - scaler_switch_default_screen(); -} - -static int test_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - struct scaler_platform_data *pdata = client->dev.platform_data; - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { - dev_err(&client->adapter->dev, "%s failed ENODEV\n\n", __func__); - return -ENODEV; - } - - if (!pdata) { - printk("%s: client private data not define\n", __func__); - return -1; - } - - scaler_init_platform(pdata); - - chip = alloc_scaler_chip(); - if (!chip) { - printk("%s: alloc scaler chip memory failed.\n", __func__); - return -1; - }else { - chip->client = client; - chip->pdata = pdata; - memcpy((void *)chip->name, (void *)client->name, (strlen(client->name) + 1)); - } - - if (init_scaler_chip(chip, pdata) != 0) - goto err; - //implement parse cmd function - chip->parse_cmd = test_parse_cmd; - chip->start = test_start; - - //register - if (register_scaler_chip(chip) != 0) - goto err; - - return 0; -err: - free_scaler_chip(chip); - return -1; -} - -static int test_i2c_remove(struct i2c_client *client) -{ - - printk("%s: \n", __func__); - unregister_scaler_chip(chip); - free_scaler_chip(chip); - chip = NULL; - return 0; -} - - -static const struct i2c_device_id test_i2c_id[] ={ - {"aswitch", 0}, - {} -}; -MODULE_DEVICE_TABLE(i2c, test_i2c_id); - -static struct i2c_driver test_i2c_driver = { - .driver = { - .name = "aswitch" - }, - .probe = test_i2c_probe, - .remove = test_i2c_remove, - .id_table = test_i2c_id, -}; - -static int __init test_init(void) -{ - int ret = 0; - printk("%s: \n", __func__); - - ret = i2c_add_driver(&test_i2c_driver); - if(ret < 0){ - printk("%s, register i2c device, error\n", __func__); - return ret; - } - - return 0; -} - -static void __exit test_exit(void) -{ - printk("%s: \n", __func__); -} - -module_init(test_init); -module_exit(test_exit); - diff --git a/drivers/misc/scaler/chips/tv5735.c b/drivers/misc/scaler/chips/tv5735.c deleted file mode 100644 index a507d3508b5c..000000000000 --- a/drivers/misc/scaler/chips/tv5735.c +++ /dev/null @@ -1,326 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - Copyright (c) 2010 by Rockchip. -*/ -#include -#include -#include -#include -#include -#include "tv_setting.h" - - -#define TV_DEV_NAME "trueview" -#define TV_I2C_RATE (400*1000) - -static struct timer_list timer; -static int vga_in_det = 0; -static int vga_offset = 0; -static struct scaler_chip_dev *chip = NULL; - -/*** I2c operate ***/ -static int tv_select_bank(struct i2c_client *client, char bank) -{ - u8 sel_bank = 0xf0; - return i2c_master_reg8_send(client, sel_bank, &bank, 1, TV_I2C_RATE); -} - -static int tv_read_single_data(struct i2c_client *client, char reg) -{ - int ret; - unsigned char val; - - ret = i2c_master_reg8_recv(client, reg, &val, 1, TV_I2C_RATE); - if (ret != 1) - printk("%s: read reg8 value error:%d\n", __func__, ret); - - return val; -} - -static inline int tv_write_single_data(struct i2c_client *client, char reg, char value) -{ - return i2c_master_reg8_send(client, reg, &value, 1, TV_I2C_RATE); -} - -static void tv5735_init_reg(unsigned char *regs, int len) -{ - int i, ret = -1; - char reg, val; - - if (chip == NULL) - return; - - for (i = 0; i < len; i += 2) { - reg = regs[i + 0]; - val = regs[i + 1]; - - if (reg == 0xff && val == 0xff) - break; - - //ret = i2c_master_reg8_send(chip->client, reg, &val, 1, TV_I2C_RATE); - ret = tv_write_single_data(chip->client, reg, val); - if (ret != 1) - printk("%s: write reg = %d failed.\n", __func__, reg); - } - -} - -static void set_cur_inport(void) -{ - struct scaler_input_port *iport = NULL; - int ddc_sel_level = -1; - - list_for_each_entry(iport, &chip->iports, next) { - if (iport->id == chip->cur_inport_id) { - gpio_set_value(iport->led_gpio, GPIO_HIGH); - - if (iport->id == 1) - ddc_sel_level = chip->pdata->ddc_sel_level; - else - ddc_sel_level = !chip->pdata->ddc_sel_level; - if (chip->pdata->ddc_sel_gpio > 0) - gpio_direction_output(chip->pdata->ddc_sel_gpio, ddc_sel_level); - - if (iport->type == SCALER_IN_RGB) { - if (vga_in_det) - del_timer_sync(&timer); - tv5735_init_reg(regs[iport->type].regs, regs[iport->type].len); - } - if (iport->type == SCALER_IN_VGA) { - tv5735_init_reg(vga2vga_regs[vga_offset].regs, vga2vga_regs[vga_offset].len); - if (vga_in_det) - add_timer(&timer); - } - }else { - gpio_set_value(iport->led_gpio, GPIO_LOW); - } - } -} - -static int parse_cmd(unsigned int cmd, unsigned long arg) -{ - printk("tv5735: parse scaler cmd %u\n",cmd); - - switch (cmd) { - case SCALER_IOCTL_SET_CUR_INPUT: - set_cur_inport(); - break; - default: - break; - } - - return 0; -} - -//enbale chip to process image -static void tv5735_start(void) -{ - scaler_switch_default_screen(); - set_cur_inport(); - //tv5735_init_reg(regs[chip->cur_in_type].regs, regs[chip->cur_in_type].len); -} - -static int tv_hardware_is_ok(struct i2c_client *client) -{ - unsigned char reg_val= 0; - unsigned chip_id = 0; - - if (tv_select_bank(client, 0) == 1) { - reg_val = tv_read_single_data(client, 0x0b); - chip_id = reg_val; - - msleep(10); - reg_val = tv_read_single_data(client, 0x0c); - chip_id = (chip_id << 8) | reg_val; - - msleep(10); - reg_val = tv_read_single_data(client, 0x0d); - chip_id = (chip_id << 8) | reg_val; - printk("%s: Chip Id %#x\n", client->name, chip_id); - return 0; - }else { - return -1; - } -} - -/************pc v\hsync***************/ -static void timer_callbak_func(unsigned long arg) -{ - int offset = -0, val1 = -1, val2 = -1; - int hsync_cnt = 0, vsync_cnt = 0; - unsigned long vtime, htime; - struct scaler_platform_data *pdata = (struct scaler_platform_data*)arg; - - vtime = jiffies + msecs_to_jiffies(200); - val1 = gpio_get_value(pdata->vga_vsync_gpio); - while (time_after(vtime, jiffies)) { - val2 = gpio_get_value(pdata->vga_vsync_gpio); - if (val1 != val2) { - vsync_cnt++; - val1 = val2; - } - } - //printk("vsync cnt = %d\n", vsync_cnt); - - htime = jiffies + msecs_to_jiffies(100); - val1 = gpio_get_value(pdata->vga_hsync_gpio); - while (time_after(htime, jiffies)) { - val2 = gpio_get_value(pdata->vga_hsync_gpio); - if (val1 != val2) { - hsync_cnt++; - val1 = val2; - } - } - //printk("hsync cnt = %d\n", hsync_cnt); - - //set reg - offset = vga_offset; - if (hsync_cnt > 10500 && hsync_cnt < 11500) - offset = 0; - if (hsync_cnt > 12000 && hsync_cnt < 12700) - offset = 1; - if (hsync_cnt > 9100 && hsync_cnt < 9600) - offset = 2; - - - if (offset != vga_offset) { - vga_offset = offset; - tv5735_init_reg(vga2vga_regs[offset].regs, - vga2vga_regs[offset].len); - } - - mod_timer(&timer, (jiffies + msecs_to_jiffies(100))); -} - -static void setup_detect_pcsync_timer(const struct scaler_platform_data *pdata) -{ - if (pdata->vga_hsync_gpio > 0) { - if (gpio_request(pdata->vga_hsync_gpio, NULL) != 0) { - printk("%s: request pc hsync detect pin failed\n", __func__); - }else { - if (pdata->vga_vsync_gpio > 0) { - if (gpio_request(pdata->vga_vsync_gpio, NULL) != 0) { - gpio_free(pdata->vga_hsync_gpio); - printk("%s: request pc vsync detect pin failed\n", __func__); - }else { - gpio_direction_input(pdata->vga_hsync_gpio); - gpio_direction_input(pdata->vga_vsync_gpio); - init_timer(&timer); - timer.function = timer_callbak_func; - timer.data = (unsigned long)pdata; - timer.expires = jiffies + msecs_to_jiffies(3000); - vga_in_det = 1; - }//request vsync - }else {//defined vsync - gpio_free(pdata->vga_hsync_gpio); - } - }//request hsync - }//defined hsync - - -} -/********************pc v\hsync************************/ - -static int tv_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) -{ - int res; - struct scaler_platform_data *pdata = client->dev.platform_data; - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { - res = -ENODEV; - dev_err(&client->adapter->dev, "%s failed %d\n\n", __func__, res); - return -1; - } - - if (!pdata) { - printk("%s: client private data not define\n", __func__); - return -1; - } - - scaler_init_platform(pdata); - - if (tv_hardware_is_ok(client) != 0) { - printk("%s chip hardware not ready\n", client->name); - return -1; - } - - //alloc chip memory - chip = alloc_scaler_chip(); - if (!chip) { - printk("%s: alloc scaler chip memory failed.\n", __func__); - return -1; - }else { - chip->client = client; - chip->pdata = pdata; - memcpy((void *)chip->name, (void *)client->name, (strlen(client->name) + 1)); - } - - //init chip - if (init_scaler_chip(chip, pdata) != 0) { - goto err; - } - - //implement parse cmd function - chip->parse_cmd = parse_cmd; - chip->start = tv5735_start; - - //register chip - if (register_scaler_chip(chip) != 0) { - printk("%s: register scaler chip failed\n", __func__); - goto err; - } - setup_detect_pcsync_timer(pdata); - - return 0; -err: - free_scaler_chip(chip); - return -1; -} - -static int tv_i2c_remove(struct i2c_client *client) -{ - - printk("%s: \n", __func__); - unregister_scaler_chip(chip); - free_scaler_chip(chip); - chip = NULL; - return 0; -} - - -static const struct i2c_device_id tv_i2c_id[] ={ - {"tv5735", 0}, {} -}; -MODULE_DEVICE_TABLE(i2c, tv_i2c_id); - -static struct i2c_driver tv_i2c_driver = { - .id_table = tv_i2c_id, - .driver = { - .name = "tv5735" - }, - .probe = tv_i2c_probe, - .remove = tv_i2c_remove, -}; - -static int __init tv_init(void) -{ - int ret = 0; - printk("%s: \n", __func__); - - ret = i2c_add_driver(&tv_i2c_driver); - if(ret < 0){ - printk("%s, register i2c device, error\n", __func__); - return ret; - } - - return 0; -} - -static void __exit tv_exit(void) -{ - printk("%s: \n", __func__); -} - -module_init(tv_init); -module_exit(tv_exit); - diff --git a/drivers/misc/scaler/chips/tv_setting.h b/drivers/misc/scaler/chips/tv_setting.h deleted file mode 100644 index a75d2b8ed540..000000000000 --- a/drivers/misc/scaler/chips/tv_setting.h +++ /dev/null @@ -1,2741 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include -/****************rgb to vga**************/ -unsigned char tv1280_720to1280_720_reg[]= -{ - 0xf0, 0x05, - 0x00, 0x00, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x00, - 0x07, 0x00, - 0x08, 0x00, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0x00, - 0x0c, 0x00, - 0x0e, 0x00, - 0x0f, 0x00, - 0x11, 0x00, - 0x12, 0x00, - 0x13, 0x00, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1e, 0x00, - 0x1f, 0x00, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x24, 0x00, - 0x25, 0x00, - 0x26, 0x00, - 0x27, 0x00, - 0x2a, 0x00, - 0x2d, 0x00, - 0x2e, 0x00, - 0x2f, 0x00, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0x00, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0x00, - 0x37, 0x00, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3e, 0x00, - 0x3f, 0x00, - 0x40, 0x00, - 0x41, 0x00, - 0x42, 0x00, - 0x43, 0x00, - 0x44, 0x00, - 0x45, 0x00, - 0x46, 0x00, - 0x47, 0x00, - 0x48, 0x00, - 0x49, 0x00, - 0x4a, 0x00, - 0x4b, 0x00, - 0x4c, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x55, 0x00, - 0x56, 0x00, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x63, 0x00, - - 0xf0, 0x00, - 0x40, 0x04, - 0x41, 0x75, - 0x43, 0x00, - 0x44, 0x01, - 0x45, 0x00, - 0x46, 0x00, - 0x47, 0x08, - 0x48, 0x40, - 0x49, 0x00, - 0x4a, 0x00, - 0x4b, 0x02, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x40, - 0x50, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - - 0xf0, 0x01, - 0x00, 0x71, - 0x01, 0xe0, - 0x02, 0x64, - 0x03, 0x60, - 0x04, 0x60, - 0x05, 0x60, - 0x06, 0x60, - 0x07, 0x60, - 0x08, 0x60, - 0x09, 0x60, - 0x0a, 0x60, - 0x0b, 0xce, - 0x0c, 0x84, - 0x0d, 0x01, - 0x0e, 0x71, - 0x0f, 0x06, - 0x10, 0x84, - 0x11, 0x05, - 0x12, 0xcc, - 0x13, 0x00, - 0x14, 0xcd, - 0x15, 0x04, - 0x16, 0xe1, - 0x17, 0x00, - 0x18, 0xec, - 0x19, 0x04, - 0x1a, 0x1e, - 0x1b, 0x01, - 0x1c, 0xe5, - 0x1d, 0x02, - 0x1e, 0x1b, - 0x1f, 0x00, - 0x20, 0xd9, - 0x21, 0x00, - 0x22, 0xdb, - 0x23, 0x00, - 0x24, 0x30, - 0x25, 0x00, - 0x26, 0x37, - 0x27, 0x00, - 0x28, 0x00, - 0x29, 0x00, - 0x2a, 0x00, - 0x85, 0xed, - 0x86, 0x02, - 0x30, 0x03, - 0x31, 0x95, - 0x32, 0xed, - 0x33, 0x81, - 0x34, 0x00, - 0x35, 0x88, - 0x36, 0x00, - 0x37, 0x71, - 0x38, 0x06, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x0f, - 0x3c, 0x06, - 0x3d, 0x07, - 0x3e, 0x01, - 0x3f, 0x01, - 0x40, 0x00, - 0x41, 0x28, - 0x42, 0x00, - 0x43, 0xe7, - 0x44, 0x02, - 0x45, 0x17, - 0x46, 0x00, - 0x47, 0x00, - 0x48, 0x00, - 0x49, 0x05, - 0x4a, 0x00, - 0x4b, 0xe6, - 0x4c, 0x02, - 0x4d, 0x16, - 0x4e, 0x00, - 0x4f, 0x05, - 0x50, 0x06, - 0x51, 0x05, - 0x52, 0x01, - 0x53, 0x00, - 0x54, 0x00, - 0x55, 0x00, - 0x60, 0xd0, - 0x61, 0x22, - 0x62, 0x20, - 0x63, 0x27, - 0x64, 0x41, - 0x65, 0x3e, - 0x66, 0xb2, - 0x67, 0x9a, - 0x68, 0x4e, - 0x69, 0xd6, - 0x6a, 0xb1, - 0x6b, 0x8e, - 0x6c, 0x7c, - 0x6d, 0x63, - 0x6e, 0x8b, - 0x6f, 0x76, - 0x70, 0x70, - 0x71, 0x62, - 0x72, 0x85, - 0x73, 0x69, - 0x74, 0x53, - 0x75, 0x48, - 0x76, 0x5d, - 0x77, 0x94, - 0x78, 0xb2, - 0x79, 0x46, - 0x7a, 0xc6, - 0x7b, 0xee, - 0x7c, 0x8c, - 0x7d, 0x62, - 0x7e, 0x76, - 0x7f, 0x9c, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x35, - 0x83, 0x00, - - 0xf0, 0x02, - 0x00, 0x87, - 0x01, 0x03, - 0x02, 0xc0, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x05, - 0x07, 0x05, - 0x08, 0x07, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0x04, - 0x0c, 0x1c, - 0x0d, 0x18, - 0x0e, 0x7f, - 0x0f, 0x49, - 0x10, 0x21, - 0x11, 0x88, - 0x12, 0x0e, - 0x13, 0x00, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0x80, - 0x17, 0x24, - 0x18, 0xd2, - 0x19, 0xd0, - 0x1a, 0x00, - 0x1b, 0x10, - 0x1f, 0x10, - 0x20, 0x51, - 0x21, 0x02, - 0x22, 0x04, - 0x23, 0x0f, - 0x24, 0x00, - 0x26, 0x40, - 0x27, 0x0c, - 0x28, 0x00, - 0x29, 0x00, - 0x2a, 0x00, - 0x2b, 0x00, - 0x2c, 0x00, - 0x2d, 0x00, - 0x2e, 0x00, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x04, - 0x32, 0x34, - 0x33, 0x00, - 0x34, 0x88, - 0x35, 0x47, - 0x36, 0x03, - 0x37, 0x0b, - 0x38, 0x04, - 0x39, 0x64, - 0x3a, 0x0b, - 0x3b, 0x7f, - 0x3c, 0x00, - - 0xf0, 0x04, - 0x00, 0x10, - 0x01, 0x30, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x30, - 0x05, 0x11, - 0x06, 0x42, - 0x07, 0x30, - 0x08, 0x01, - 0x09, 0x94, - 0x0a, 0x11, - 0x0b, 0x7f, - 0x0c, 0x00, - 0x0d, 0x74, - 0x0e, 0x00, - 0x0f, 0x06, - 0x10, 0x00, - 0x11, 0x92, - 0x12, 0x01, - 0x13, 0x01, - 0x14, 0x96, - 0x15, 0x05, - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x20, 0x00, - 0x21, 0x2b, - 0x22, 0x03, - 0x23, 0x1f, - 0x24, 0xff, - 0x25, 0xff, - 0x26, 0x0f, - 0x27, 0xff, - 0x28, 0xff, - 0x29, 0x1f, - 0x2b, 0xa4, - 0x2c, 0x1e, - 0x2d, 0x00, - 0x2e, 0x80, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0x08, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0x10, - 0x37, 0xf4, - 0x38, 0x00, - 0x39, 0xf4, - 0x3a, 0x00, - 0x3b, 0x02, - 0x3c, 0x00, - 0x3d, 0x04, - 0x3e, 0x03, - 0x3f, 0x00, - 0x40, 0x04, - 0x41, 0x00, - 0x42, 0x68, - 0x43, 0x00, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0x07, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0x07, - 0x4a, 0x01, - 0x4b, 0x44, - 0x4d, 0x60, - 0x4e, 0x28, - 0x4f, 0x3e, - 0x50, 0xc0, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x90, - 0x55, 0x01, - 0x56, 0x00, - 0x57, 0xc8, - 0x58, 0x00, - 0x59, 0x64, - 0x5a, 0x00, - 0x5b, 0x80, - - 0xf0, 0x00, - 0x90, 0x00, - 0x91, 0x00, - 0x92, 0x00, - 0x93, 0x00, - 0x94, 0x00, - 0x95, 0x00, - 0x96, 0x00, - 0x97, 0x00, - 0x98, 0x00, - - 0xf0, 0x03, - 0x00, 0x00, - 0x01, 0x9f, - 0x02, 0xd5, - 0x03, 0x2e, - 0x04, 0x0a, - 0x05, 0x35, - 0x06, 0x09, - 0x07, 0xe9, - 0x08, 0x82, - 0x09, 0x01, - 0x0a, 0x7c, - 0x0b, 0xf5, - 0x0c, 0x59, - 0x0d, 0xeb, - 0x0e, 0x22, - 0x0f, 0x00, - 0x10, 0x3f, - 0x11, 0x05, - 0x12, 0x0f, - 0x13, 0xe9, - 0x14, 0x92, - 0x15, 0x01, - 0x16, 0x55, - 0x17, 0x83, - 0x18, 0x3f, - 0x19, 0x02, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x00, - 0x1f, 0x00, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x24, 0x64, - 0x25, 0x03, - 0x26, 0x00, - 0x27, 0xcf, - 0x28, 0x00, - 0x29, 0x00, - 0x2a, 0x11, - 0x2b, 0x91, - 0x2c, 0xe0, - 0x2d, 0x2f, - 0x2e, 0x20, - 0x2f, 0xf0, - 0x30, 0x40, - 0x31, 0x3a, - 0x32, 0x88, - 0x33, 0x00, - 0x34, 0x00, - 0x35, 0x80, - 0x36, 0x1c, - 0x37, 0x27, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3c, 0x00, - 0x3d, 0x00, - 0x3e, 0x80, - 0x3f, 0x00, - 0x40, 0x03, - 0x41, 0x03, - 0x42, 0x00, - 0x43, 0x00, - 0x44, 0xf8, - 0x45, 0x1e, - 0x46, 0xf8, - 0x47, 0x1e, - 0x48, 0xf8, - 0x49, 0x1e, - 0x4a, 0xd0, - 0x4b, 0x20, - 0x4c, 0xf8, - 0x4d, 0x09, - 0x4e, 0x0b, - 0x4f, 0x1e, - 0x50, 0x30, - 0x51, 0x00, - 0x52, 0x30, - 0x53, 0x08, - 0x54, 0x24, - 0x55, 0x0a, - 0x56, 0x8b, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x1a, - 0x5c, 0x00, - 0x5d, 0xc4, - 0x5e, 0x7f, - 0x5f, 0x04, - 0x60, 0xac, - 0x61, 0x9c, - 0x62, 0x80, - 0x63, 0x0a, - 0x64, 0xe9, - 0x65, 0xff, - 0x66, 0x7f, - 0x67, 0x40, - 0x68, 0xe5, - 0x69, 0x0d, - 0x6a, 0xd8, - 0x6b, 0xff, - 0x6c, 0x3f, - 0x6d, 0x0c, - 0x6e, 0xc1, - 0x6f, 0x42, - 0x70, 0x1c, - 0x71, 0x00, - 0x72, 0x00, - 0x73, 0xbc, - 0x74, 0x05, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x00, - 0x83, 0x00, - 0x84, 0x00, - 0x85, 0x00, - 0x86, 0x00, - 0x87, 0x00, - 0x88, 0x00, - 0x89, 0x00, - 0x8a, 0x00, - 0x8b, 0x00, - 0x8c, 0x00, - 0x8d, 0x00, - 0x8e, 0x00, - 0x8f, 0x00, - - 0xf0, 0x00, - 0x44, 0x25, - 0x45, 0x09, - 0x4f, 0x70, - - 0xf0, 0x04, - 0x00, 0x82, - - 0xf0, 0x05, - 0x11, 0x80, - 0x18, 0x80, - 0x19, 0x80, - - 0xFF, 0xFF, -}; - -/*****************vga to vga*******************/ -unsigned char tv1440_900to1440_900_reg[]= -{ - 0xf0, 0x05, - 0x00, 0x00, - 0x02, 0x9e, - 0x03, 0x31, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x40, - 0x07, 0x40, - 0x08, 0x40, - 0x09, 0x6e, - 0x0a, 0x6e, - 0x0b, 0x6e, - 0x0c, 0x00, - 0x0e, 0x20, - 0x0f, 0x00, - 0x11, 0x30, - 0x12, 0x72, - 0x13, 0x05, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0x50, - 0x17, 0x05, - 0x18, 0x11, - 0x19, 0x01, - 0x1e, 0x80, - 0x1f, 0x03, - 0x20, 0x18, - 0x21, 0x20, - 0x22, 0x0f, - 0x23, 0x00, - 0x24, 0x40, - 0x25, 0x00, - 0x26, 0x05, - 0x27, 0x00, - 0x2a, 0x0f, - 0x2d, 0x04, - 0x2e, 0x00, - 0x2f, 0x04, - 0x31, 0x2f, - 0x32, 0x00, - 0x33, 0x28, - 0x34, 0x03, - 0x35, 0x15, - 0x36, 0x00, - 0x37, 0x0a, - 0x38, 0x07, - 0x39, 0x12, - 0x3a, 0x20, - 0x3b, 0x00, - 0x3e, 0x30, - 0x3f, 0x03, - 0x40, 0x0b, - 0x41, 0x10, - 0x42, 0x00, - 0x43, 0x1f, - 0x44, 0x00, - 0x45, 0x00, - 0x46, 0x00, - 0x47, 0x05, - 0x48, 0x00, - 0x49, 0x20, - 0x4a, 0x00, - 0x4b, 0x50, - 0x4c, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x51, 0x02, - 0x52, 0x00, - 0x53, 0x06, - 0x54, 0x00, - 0x55, 0x08, - 0x56, 0x36, - 0x57, 0x44, - 0x58, 0x00, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x63, 0x00, - - 0xf0, 0x00, - 0x40, 0x3c, - 0x41, 0x85, - 0x43, 0x00, - 0x44, 0x01, - 0x45, 0x00, - 0x46, 0x5f, - 0x47, 0x07, - 0x48, 0x00, - 0x49, 0x00, - 0x4a, 0x00, - 0x4b, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - - 0xf0, 0x01, - 0x00, 0x62, - 0x01, 0xf0, - 0x02, 0x67, - 0x03, 0x1a, - 0x04, 0x1a, - 0x05, 0x1a, - 0x06, 0x1a, - 0x07, 0x1a, - 0x08, 0x1a, - 0x09, 0x1a, - 0x0a, 0x1a, - 0x0b, 0xc7, - 0x0c, 0x90, - 0x0d, 0x06, - 0x0e, 0x3f, - 0x0f, 0x05, - 0x10, 0x30, - 0x11, 0x00, - 0x12, 0xe2, - 0x13, 0x00, - 0x14, 0x0f, - 0x15, 0x00, - 0x16, 0xf7, - 0x17, 0x00, - 0x18, 0x2a, - 0x19, 0x00, - 0x1a, 0x1a, - 0x1b, 0x01, - 0x1c, 0x02, - 0x1d, 0x00, - 0x1e, 0x11, - 0x1f, 0x00, - 0x20, 0xb3, - 0x21, 0x00, - 0x22, 0x6a, - 0x23, 0x04, - 0x24, 0x0c, - 0x25, 0x00, - 0x26, 0xf7, - 0x27, 0x00, - 0x28, 0x04, - 0x29, 0x00, - 0x2a, 0x00, - 0x85, 0xa5, - 0x86, 0x03, - 0x30, 0x01, - 0x31, 0x95, - 0x32, 0xed, - 0x33, 0x81, - 0x34, 0x00, - 0x35, 0x88, - 0x36, 0x00, - 0x37, 0xa3, - 0x38, 0x04, - 0x39, 0xf2, - 0x3a, 0x03, - 0x3b, 0x23, - 0x3c, 0x09, - 0x3d, 0xa3, - 0x3e, 0x01, - 0x3f, 0x10, - 0x40, 0x00, - 0x41, 0x37, - 0x42, 0x00, - 0x43, 0x8c, - 0x44, 0x04, - 0x45, 0x54, - 0x46, 0x00, - 0x47, 0x10, - 0x48, 0x00, - 0x49, 0x16, - 0x4a, 0x00, - 0x4b, 0x8d, - 0x4c, 0x04, - 0x4d, 0x53, - 0x4e, 0x00, - 0x4f, 0x23, - 0x50, 0x09, - 0x51, 0xa3, - 0x52, 0x01, - 0x53, 0xff, - 0x54, 0xff, - 0x55, 0xff, - 0x60, 0xd0, - 0x61, 0x22, - 0x62, 0x20, - 0x63, 0x27, - 0x64, 0x41, - 0x65, 0x3e, - 0x66, 0xb2, - 0x67, 0x9a, - 0x68, 0x4e, - 0x69, 0xd6, - 0x6a, 0xb1, - 0x6b, 0x8e, - 0x6c, 0x7c, - 0x6d, 0x63, - 0x6e, 0x8b, - 0x6f, 0x76, - 0x70, 0x70, - 0x71, 0x62, - 0x72, 0x85, - 0x73, 0x69, - 0x74, 0x53, - 0x75, 0x48, - 0x76, 0x5d, - 0x77, 0x94, - 0x78, 0xb2, - 0x79, 0x46, - 0x7a, 0xc6, - 0x7b, 0xee, - 0x7c, 0x8c, - 0x7d, 0x62, - 0x7e, 0x76, - 0x7f, 0x9c, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x35, - 0x83, 0x00, - - 0xf0, 0x02, - 0x00, 0x82, - 0x01, 0x03, - 0x02, 0xc0, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x06, - 0x07, 0x00, - 0x08, 0x08, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0x0c, - 0x0c, 0x12, - 0x0d, 0x00, - 0x0e, 0x00, - 0x0f, 0x59, - 0x10, 0x21, - 0x11, 0x88, - 0x12, 0x04, - 0x13, 0x00, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0xb0, - 0x17, 0x24, - 0x18, 0xf2, - 0x19, 0xa9, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1f, 0x10, - 0x20, 0x51, - 0x21, 0x02, - 0x22, 0x04, - 0x23, 0x0f, - 0x24, 0x00, - 0x26, 0x00, - 0x27, 0x0c, - 0x28, 0x00, - 0x29, 0x00, - 0x2a, 0x00, - 0x2b, 0x00, - 0x2c, 0x00, - 0x2d, 0x00, - 0x2e, 0x00, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x24, - 0x33, 0x00, - 0x34, 0x66, - 0x35, 0x48, - 0x36, 0x03, - 0x37, 0x40, - 0x38, 0x04, - 0x39, 0x64, - 0x3a, 0x1b, - 0x3b, 0x28, - 0x3c, 0x54, - - 0xf0, 0x04, - 0x00, 0x10, - 0x01, 0x30, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x30, - 0x05, 0x11, - 0x06, 0x42, - 0x07, 0x30, - 0x08, 0x01, - 0x09, 0x94, - 0x0a, 0x11, - 0x0b, 0x7f, - 0x0c, 0x00, - 0x0d, 0x74, - 0x0e, 0x00, - 0x0f, 0x06, - 0x10, 0x00, - 0x11, 0x92, - 0x12, 0x01, - 0x13, 0x01, - 0x14, 0x96, - 0x15, 0x05, - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x20, 0x00, - 0x21, 0x2b, - 0x22, 0x03, - 0x23, 0x1f, - 0x24, 0xff, - 0x25, 0xff, - 0x26, 0x0f, - 0x27, 0xff, - 0x28, 0xff, - 0x29, 0x1f, - 0x2b, 0xa4, - 0x2c, 0x1e, - 0x2d, 0x00, - 0x2e, 0x80, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0x08, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0x10, - 0x37, 0x14, - 0x38, 0x01, - 0x39, 0x14, - 0x3a, 0x01, - 0x3b, 0x02, - 0x3c, 0x00, - 0x3d, 0x04, - 0x3e, 0x03, - 0x3f, 0x00, - 0x40, 0x04, - 0x41, 0x00, - 0x42, 0x68, - 0x43, 0x00, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0x07, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0x07, - 0x4a, 0x01, - 0x4b, 0x44, - 0x4d, 0x60, - 0x4e, 0x28, - 0x4f, 0x3e, - 0x50, 0xc0, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0xe2, - 0x55, 0x01, - 0x56, 0x00, - 0x57, 0x01, - 0x58, 0x01, - 0x59, 0x81, - 0x5a, 0x00, - 0x5b, 0x80, - - 0xf0, 0x00, - 0x90, 0x82, - 0x91, 0x00, - 0x92, 0x4e, - 0x93, 0xc5, - 0x94, 0x00, - 0x95, 0x10, - 0x96, 0x10, - 0x97, 0x00, - 0x98, 0x00, - - 0xf0, 0x03, - 0x00, 0x20, - 0x01, 0x8a, - 0x02, 0x57, - 0x03, 0x3a, - 0x04, 0x11, - 0x05, 0x57, - 0x06, 0x12, - 0x07, 0xa3, - 0x08, 0x13, - 0x09, 0x01, - 0x0a, 0x9a, - 0x0b, 0x00, - 0x0c, 0x00, - 0x0d, 0x00, - 0x0e, 0x60, - 0x0f, 0x00, - 0x10, 0x3a, - 0x11, 0xa7, - 0x12, 0x18, - 0x13, 0xa3, - 0x14, 0xf3, - 0x15, 0x01, - 0x16, 0xa0, - 0x17, 0xf2, - 0x18, 0x3f, - 0x19, 0x02, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x00, - 0x1f, 0x00, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x24, 0x66, - 0x25, 0x03, - 0x26, 0x00, - 0x27, 0xcf, - 0x28, 0x80, - 0x29, 0x40, - 0x2a, 0x11, - 0x2b, 0xa3, - 0x2c, 0xe0, - 0x2d, 0x48, - 0x2e, 0x00, - 0x2f, 0xff, - 0x30, 0x40, - 0x31, 0x3f, - 0x32, 0x24, - 0x33, 0x40, - 0x34, 0x80, - 0x35, 0x80, - 0x36, 0x1c, - 0x37, 0x28, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3c, 0x00, - 0x3d, 0x00, - 0x3e, 0x80, - 0x3f, 0x00, - 0x40, 0x03, - 0x41, 0x03, - 0x42, 0x00, - 0x43, 0x00, - 0x44, 0xf8, - 0x45, 0x18, - 0x46, 0xf8, - 0x47, 0x18, - 0x48, 0xf8, - 0x49, 0x18, - 0x4a, 0xf8, - 0x4b, 0x18, - 0x4c, 0xf8, - 0x4d, 0x0a, - 0x4e, 0x0b, - 0x4f, 0x1c, - 0x50, 0x20, - 0x51, 0x00, - 0x52, 0x30, - 0x53, 0x08, - 0x54, 0x24, - 0x55, 0x0a, - 0x56, 0x8b, - 0x57, 0xc0, - 0x58, 0x60, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x5d, 0x00, - 0x5e, 0x00, - 0x5f, 0x00, - 0x60, 0x0c, - 0x61, 0x00, - 0x62, 0x00, - 0x63, 0x00, - 0x64, 0x00, - 0x65, 0x10, - 0x66, 0x00, - 0x67, 0x00, - 0x68, 0x00, - 0x69, 0x00, - 0x6a, 0x00, - 0x6b, 0x20, - 0x6c, 0x00, - 0x6d, 0x3b, - 0x6e, 0xb1, - 0x6f, 0x53, - 0x70, 0x26, - 0x71, 0x00, - 0x72, 0x00, - 0x73, 0xad, - 0x74, 0x86, - 0x80, 0x02, - 0x81, 0x00, - 0x82, 0x95, - 0x83, 0x40, - 0x84, 0x5a, - 0x85, 0xed, - 0x86, 0x00, - 0x87, 0x00, - 0x88, 0x00, - 0x89, 0x00, - 0x8a, 0x00, - 0x8b, 0x00, - 0x8c, 0x00, - 0x8d, 0x00, - 0x8e, 0x00, - 0x8f, 0x00, - - 0xf0, 0x00, - 0x44, 0x25, - 0x45, 0x01, - 0x4f, 0x30, - - 0xf0, 0x04, - 0x00, 0x82, - - 0xf0, 0x05, - 0x11, 0xb0, - 0x18, 0x91, - 0x19, 0x81, - - 0xf0, 0x05, - 0x02, 0x1e, - - 0xFF, 0xFF, -}; - -unsigned char tv1280_1024to1440_900_reg[]= -{ - 0xf0, 0x05, - 0x00, 0x10, - 0x02, 0x9e, - 0x03, 0x31, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x40, - 0x07, 0x40, - 0x08, 0x40, - 0x09, 0x6e, - 0x0a, 0x6e, - 0x0b, 0x6e, - 0x0c, 0x00, - 0x0e, 0x20, - 0x0f, 0x00, - 0x11, 0x30, - 0x12, 0xf1, - 0x13, 0x04, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0x10, - 0x17, 0x05, - 0x18, 0x21, - 0x19, 0x01, - 0x1e, 0x80, - 0x1f, 0x01, - 0x20, 0x18, - 0x21, 0x20, - 0x22, 0x0f, - 0x23, 0x00, - 0x24, 0x40, - 0x25, 0x00, - 0x26, 0x05, - 0x27, 0x00, - 0x2a, 0x0f, - 0x2d, 0x04, - 0x2e, 0x00, - 0x2f, 0x04, - 0x31, 0x2f, - 0x32, 0x00, - 0x33, 0x28, - 0x34, 0x03, - 0x35, 0x15, - 0x36, 0x00, - 0x37, 0x0a, - 0x38, 0x07, - 0x39, 0x12, - 0x3a, 0x20, - 0x3b, 0x00, - 0x3e, 0x30, - 0x3f, 0x03, - 0x40, 0x0b, - 0x41, 0x10, - 0x42, 0x00, - 0x43, 0x1f, - 0x44, 0x00, - 0x45, 0x00, - 0x46, 0x00, - 0x47, 0x05, - 0x48, 0x00, - 0x49, 0x20, - 0x4a, 0x00, - 0x4b, 0x50, - 0x4c, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x51, 0x02, - 0x52, 0x00, - 0x53, 0x06, - 0x54, 0x00, - 0x55, 0x00, - 0x56, 0x36, - 0x57, 0x44, - 0x58, 0x00, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x63, 0x00, - - 0xf0, 0x00, - 0x40, 0x3c, - 0x41, 0x65, - 0x43, 0x00, - 0x44, 0x01, - 0x45, 0x00, - 0x46, 0x5f, - 0x47, 0x07, - 0x48, 0x00, - 0x49, 0x00, - 0x4a, 0x00, - 0x4b, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - - 0xf0, 0x01, - 0x00, 0x62, - 0x01, 0xe0, - 0x02, 0x6f, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x00, - 0x07, 0x00, - 0x08, 0x00, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0xc0, - 0x0c, 0x0c, - 0x0d, 0x15, - 0x0e, 0xf1, - 0x0f, 0x04, - 0x10, 0xb6, - 0x11, 0x04, - 0x12, 0xc4, - 0x13, 0x00, - 0x14, 0xb6, - 0x15, 0x04, - 0x16, 0xf0, - 0x17, 0x00, - 0x18, 0xb6, - 0x19, 0x04, - 0x1a, 0xf0, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x25, - 0x1f, 0x00, - 0x20, 0xc8, - 0x21, 0x00, - 0x22, 0xcc, - 0x23, 0x00, - 0x24, 0x8a, - 0x25, 0x00, - 0x26, 0x90, - 0x27, 0x00, - 0x28, 0x04, - 0x29, 0x00, - 0x2a, 0x00, - 0x85, 0x29, - 0x86, 0x04, - 0x30, 0x01, - 0x31, 0x95, - 0x32, 0xed, - 0x33, 0x81, - 0x34, 0x00, - 0x35, 0x88, - 0x36, 0x00, - 0x37, 0xa3, - 0x38, 0x04, - 0x39, 0xf2, - 0x3a, 0x03, - 0x3b, 0x23, - 0x3c, 0x09, - 0x3d, 0xa3, - 0x3e, 0x01, - 0x3f, 0x10, - 0x40, 0x00, - 0x41, 0x37, - 0x42, 0x00, - 0x43, 0x8c, - 0x44, 0x04, - 0x45, 0x54, - 0x46, 0x00, - 0x47, 0x10, - 0x48, 0x00, - 0x49, 0x16, - 0x4a, 0x00, - 0x4b, 0x8d, - 0x4c, 0x04, - 0x4d, 0x53, - 0x4e, 0x00, - 0x4f, 0x23, - 0x50, 0x09, - 0x51, 0xa3, - 0x52, 0x01, - 0x53, 0xff, - 0x54, 0xff, - 0x55, 0xff, - 0x60, 0xd0, - 0x61, 0x22, - 0x62, 0x20, - 0x63, 0x27, - 0x64, 0x41, - 0x65, 0x3e, - 0x66, 0xb2, - 0x67, 0x9a, - 0x68, 0x4e, - 0x69, 0xd6, - 0x6a, 0xb1, - 0x6b, 0x8e, - 0x6c, 0x7c, - 0x6d, 0x63, - 0x6e, 0x8b, - 0x6f, 0x76, - 0x70, 0x70, - 0x71, 0x62, - 0x72, 0x85, - 0x73, 0x69, - 0x74, 0x53, - 0x75, 0x48, - 0x76, 0x5d, - 0x77, 0x94, - 0x78, 0xb2, - 0x79, 0x46, - 0x7a, 0xc6, - 0x7b, 0xee, - 0x7c, 0x8c, - 0x7d, 0x62, - 0x7e, 0x76, - 0x7f, 0x9c, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x35, - 0x83, 0x00, - - 0xf0, 0x02, - 0x00, 0x82, - 0x01, 0x03, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x06, - 0x07, 0x00, - 0x08, 0x08, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0x0c, - 0x0c, 0x12, - 0x0d, 0x00, - 0x0e, 0x00, - 0x0f, 0x59, - 0x10, 0x21, - 0x11, 0x88, - 0x12, 0x04, - 0x13, 0x00, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0xb0, - 0x17, 0x24, - 0x18, 0xf2, - 0x19, 0xa9, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1f, 0x10, - 0x20, 0x51, - 0x21, 0x02, - 0x22, 0x04, - 0x23, 0x0f, - 0x24, 0x00, - 0x26, 0x00, - 0x27, 0x0c, - 0x28, 0x30, - 0x29, 0x23, - 0x2a, 0x23, - 0x2b, 0x23, - 0x2c, 0x23, - 0x2d, 0x23, - 0x2e, 0x23, - 0x2f, 0x23, - 0x30, 0x23, - 0x31, 0x00, - 0x32, 0x24, - 0x33, 0x00, - 0x34, 0x66, - 0x35, 0x48, - 0x36, 0x03, - 0x37, 0x40, - 0x38, 0x04, - 0x39, 0x64, - 0x3a, 0x1b, - 0x3b, 0x28, - 0x3c, 0x54, - - 0xf0, 0x04, - 0x00, 0x10, - 0x01, 0x30, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x30, - 0x05, 0x11, - 0x06, 0x42, - 0x07, 0x30, - 0x08, 0x01, - 0x09, 0x94, - 0x0a, 0x11, - 0x0b, 0x7f, - 0x0c, 0x00, - 0x0d, 0x74, - 0x0e, 0x00, - 0x0f, 0x06, - 0x10, 0x00, - 0x11, 0x92, - 0x12, 0x01, - 0x13, 0x01, - 0x14, 0x96, - 0x15, 0x05, - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x20, 0x00, - 0x21, 0x2b, - 0x22, 0x03, - 0x23, 0x1f, - 0x24, 0xff, - 0x25, 0xff, - 0x26, 0x1f, - 0x27, 0xff, - 0x28, 0xff, - 0x29, 0x1f, - 0x2b, 0xa4, - 0x2c, 0x1e, - 0x2d, 0x00, - 0x2e, 0x80, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0x04, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0x0c, - 0x37, 0xf1, - 0x38, 0x00, - 0x39, 0xf1, - 0x3a, 0x00, - 0x3b, 0x02, - 0x3c, 0x00, - 0x3d, 0x04, - 0x3e, 0x03, - 0x3f, 0x00, - 0x40, 0x04, - 0x41, 0x00, - 0x42, 0x68, - 0x43, 0x00, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0x03, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0x03, - 0x4a, 0x01, - 0x4b, 0x44, - 0x4d, 0x60, - 0x4e, 0x28, - 0x4f, 0x3e, - 0x50, 0xc0, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0xe0, - 0x55, 0x01, - 0x56, 0x00, - 0x57, 0xf0, - 0x58, 0x00, - 0x59, 0x78, - 0x5a, 0x00, - 0x5b, 0x80, - - 0xf0, 0x00, - 0x90, 0x82, - 0x91, 0x00, - 0x92, 0x4e, - 0x93, 0xc5, - 0x94, 0x00, - 0x95, 0x10, - 0x96, 0x10, - 0x97, 0x00, - 0x98, 0x00, - - 0xf0, 0x03, - 0x00, 0x20, - 0x01, 0xa7, - 0x02, 0x55, - 0x03, 0x3a, - 0x04, 0x29, - 0x05, 0xc5, - 0x06, 0x0c, - 0x07, 0xa3, - 0x08, 0xb3, - 0x09, 0x01, - 0x0a, 0x74, - 0x0b, 0x00, - 0x0c, 0x00, - 0x0d, 0x00, - 0x0e, 0x60, - 0x0f, 0x00, - 0x10, 0x6b, - 0x11, 0x45, - 0x12, 0x12, - 0x13, 0xa3, - 0x14, 0xf3, - 0x15, 0x01, - 0x16, 0x83, - 0x17, 0xf3, - 0x18, 0x3f, - 0x19, 0x02, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x00, - 0x1f, 0x00, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x24, 0x66, - 0x25, 0x03, - 0x26, 0x00, - 0x27, 0xcf, - 0x28, 0x80, - 0x29, 0x40, - 0x2a, 0x11, - 0x2b, 0xa3, - 0x2c, 0xe0, - 0x2d, 0x48, - 0x2e, 0x00, - 0x2f, 0xff, - 0x30, 0x40, - 0x31, 0x3f, - 0x32, 0x24, - 0x33, 0x40, - 0x34, 0x80, - 0x35, 0x80, - 0x36, 0x1c, - 0x37, 0x28, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3c, 0x00, - 0x3d, 0x00, - 0x3e, 0x80, - 0x3f, 0x00, - 0x40, 0x03, - 0x41, 0x03, - 0x42, 0x00, - 0x43, 0x00, - 0x44, 0xf8, - 0x45, 0x18, - 0x46, 0xf8, - 0x47, 0x18, - 0x48, 0xf8, - 0x49, 0x18, - 0x4a, 0xf8, - 0x4b, 0x18, - 0x4c, 0xf8, - 0x4d, 0x0a, - 0x4e, 0x0b, - 0x4f, 0x1c, - 0x50, 0x20, - 0x51, 0x00, - 0x52, 0x30, - 0x53, 0x08, - 0x54, 0x24, - 0x55, 0x0a, - 0x56, 0x8b, - 0x57, 0xc0, - 0x58, 0x60, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x5d, 0x00, - 0x5e, 0x00, - 0x5f, 0x00, - 0x60, 0x0c, - 0x61, 0x00, - 0x62, 0x00, - 0x63, 0x00, - 0x64, 0x00, - 0x65, 0x10, - 0x66, 0x00, - 0x67, 0x00, - 0x68, 0x00, - 0x69, 0x00, - 0x6a, 0x00, - 0x6b, 0x20, - 0x6c, 0x00, - 0x6d, 0x3b, - 0x6e, 0xb1, - 0x6f, 0x53, - 0x70, 0x26, - 0x71, 0x00, - 0x72, 0x00, - 0x73, 0xad, - 0x74, 0x86, - 0x80, 0x02, - 0x81, 0x00, - 0x82, 0x95, - 0x83, 0x40, - 0x84, 0x5a, - 0x85, 0xed, - 0x86, 0x00, - 0x87, 0x00, - 0x88, 0x00, - 0x89, 0x00, - 0x8a, 0x00, - 0x8b, 0x00, - 0x8c, 0x00, - 0x8d, 0x00, - 0x8e, 0x00, - 0x8f, 0x00, - - 0xf0, 0x00, - 0x44, 0x25, - 0x45, 0x01, - 0x4f, 0x30, - - 0xf0, 0x04, - 0x00, 0x82, - - 0xf0, 0x05, - 0x11, 0xb0, - 0x18, 0xa1, - 0x19, 0x81, - - 0xf0, 0x05, - 0x02, 0x1e, - - 0xFF, 0xFF, -}; -unsigned char tv1280_1024to1280_1024_reg[]= -{ - 0xf0, 0x05, - 0x00, 0x10, - 0x02, 0x9e, - 0x03, 0x31, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x40, - 0x07, 0x40, - 0x08, 0x40, - 0x09, 0x6e, - 0x0a, 0x6e, - 0x0b, 0x6e, - 0x0c, 0x00, - 0x0e, 0x20, - 0x0f, 0x00, - 0x11, 0x30, - 0x12, 0xf1, - 0x13, 0x04, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0x10, - 0x17, 0x05, - 0x18, 0x21, - 0x19, 0x01, - 0x1e, 0x80, - 0x1f, 0x01, - 0x20, 0x18, - 0x21, 0x20, - 0x22, 0x0f, - 0x23, 0x00, - 0x24, 0x40, - 0x25, 0x00, - 0x26, 0x05, - 0x27, 0x00, - 0x2a, 0x0f, - 0x2d, 0x04, - 0x2e, 0x00, - 0x2f, 0x04, - 0x31, 0x2f, - 0x32, 0x00, - 0x33, 0x28, - 0x34, 0x03, - 0x35, 0x15, - 0x36, 0x00, - 0x37, 0x0a, - 0x38, 0x07, - 0x39, 0x12, - 0x3a, 0x20, - 0x3b, 0x00, - 0x3e, 0x30, - 0x3f, 0x03, - 0x40, 0x0b, - 0x41, 0x10, - 0x42, 0x00, - 0x43, 0x1f, - 0x44, 0x00, - 0x45, 0x00, - 0x46, 0x00, - 0x47, 0x05, - 0x48, 0x00, - 0x49, 0x20, - 0x4a, 0x00, - 0x4b, 0x50, - 0x4c, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x51, 0x02, - 0x52, 0x00, - 0x53, 0x06, - 0x54, 0x00, - 0x55, 0x00, - 0x56, 0x36, - 0x57, 0x44, - 0x58, 0x00, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x63, 0x00, - - 0xf0, 0x00, - 0x40, 0x3c, - 0x41, 0x65, - 0x43, 0x00, - 0x44, 0x01, - 0x45, 0x00, - 0x46, 0x5f, - 0x47, 0x07, - 0x48, 0x00, - 0x49, 0x00, - 0x4a, 0x00, - 0x4b, 0x00, - 0x4d, 0x00, - 0x4e, 0x00, - 0x4f, 0x00, - 0x50, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x57, 0x00, - 0x58, 0x00, - 0x59, 0x00, - - 0xf0, 0x01, - 0x00, 0x62, - 0x01, 0xe0, - 0x02, 0x6f, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x00, - 0x07, 0x00, - 0x08, 0x00, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0xc0, - 0x0c, 0x0c, - 0x0d, 0x15, - 0x0e, 0xf1, - 0x0f, 0x04, - 0x10, 0xb6, - 0x11, 0x04, - 0x12, 0xc4, - 0x13, 0x00, - 0x14, 0xb6, - 0x15, 0x04, - 0x16, 0xf0, - 0x17, 0x00, - 0x18, 0xb6, - 0x19, 0x04, - 0x1a, 0xf0, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x25, - 0x1f, 0x00, - 0x20, 0xc8, - 0x21, 0x00, - 0x22, 0xcc, - 0x23, 0x00, - 0x24, 0x8a, - 0x25, 0x00, - 0x26, 0x90, - 0x27, 0x00, - 0x28, 0x04, - 0x29, 0x00, - 0x2a, 0x00, - 0x85, 0x29, - 0x86, 0x04, - 0x30, 0x01, - 0x31, 0x95, - 0x32, 0xed, - 0x33, 0x81, - 0x34, 0x00, - 0x35, 0x88, - 0x36, 0x00, - 0x37, 0xa3, - 0x38, 0x04, - 0x39, 0xf2, - 0x3a, 0x03, - 0x3b, 0x23, - 0x3c, 0x09, - 0x3d, 0xa3, - 0x3e, 0x01, - 0x3f, 0x10, - 0x40, 0x00, - 0x41, 0x37, - 0x42, 0x00, - 0x43, 0x8c, - 0x44, 0x04, - 0x45, 0x54, - 0x46, 0x00, - 0x47, 0x10, - 0x48, 0x00, - 0x49, 0x16, - 0x4a, 0x00, - 0x4b, 0x8d, - 0x4c, 0x04, - 0x4d, 0x53, - 0x4e, 0x00, - 0x4f, 0x23, - 0x50, 0x09, - 0x51, 0xa3, - 0x52, 0x01, - 0x53, 0xff, - 0x54, 0xff, - 0x55, 0xff, - 0x60, 0xd0, - 0x61, 0x22, - 0x62, 0x20, - 0x63, 0x27, - 0x64, 0x41, - 0x65, 0x3e, - 0x66, 0xb2, - 0x67, 0x9a, - 0x68, 0x4e, - 0x69, 0xd6, - 0x6a, 0xb1, - 0x6b, 0x8e, - 0x6c, 0x7c, - 0x6d, 0x63, - 0x6e, 0x8b, - 0x6f, 0x76, - 0x70, 0x70, - 0x71, 0x62, - 0x72, 0x85, - 0x73, 0x69, - 0x74, 0x53, - 0x75, 0x48, - 0x76, 0x5d, - 0x77, 0x94, - 0x78, 0xb2, - 0x79, 0x46, - 0x7a, 0xc6, - 0x7b, 0xee, - 0x7c, 0x8c, - 0x7d, 0x62, - 0x7e, 0x76, - 0x7f, 0x9c, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x35, - 0x83, 0x00, - - 0xf0, 0x02, - 0x00, 0x82, - 0x01, 0x03, - 0x02, 0xc0, - 0x03, 0x00, - 0x04, 0x00, - 0x05, 0x00, - 0x06, 0x06, - 0x07, 0x00, - 0x08, 0x08, - 0x09, 0x00, - 0x0a, 0x00, - 0x0b, 0x0c, - 0x0c, 0x12, - 0x0d, 0x00, - 0x0e, 0x00, - 0x0f, 0x59, - 0x10, 0x21, - 0x11, 0x88, - 0x12, 0x04, - 0x13, 0x00, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0xb0, - 0x17, 0x24, - 0x18, 0xf2, - 0x19, 0xa9, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1f, 0x10, - 0x20, 0x51, - 0x21, 0x02, - 0x22, 0x04, - 0x23, 0x0f, - 0x24, 0x00, - 0x26, 0x40, - 0x27, 0x00, - 0x28, 0x00, - 0x29, 0x00, - 0x2a, 0x00, - 0x2b, 0x00, - 0x2c, 0x00, - 0x2d, 0x00, - 0x2e, 0x00, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x24, - 0x33, 0x00, - 0x34, 0x66, - 0x35, 0x48, - 0x36, 0x03, - 0x37, 0x40, - 0x38, 0x04, - 0x39, 0x64, - 0x3a, 0x1b, - 0x3b, 0x28, - 0x3c, 0x54, - - 0xf0, 0x04, - 0x00, 0x10, - 0x01, 0x30, - 0x02, 0x00, - 0x03, 0x00, - 0x04, 0x30, - 0x05, 0x11, - 0x06, 0x42, - 0x07, 0x30, - 0x08, 0x01, - 0x09, 0x94, - 0x0a, 0x11, - 0x0b, 0x7f, - 0x0c, 0x00, - 0x0d, 0x74, - 0x0e, 0x00, - 0x0f, 0x06, - 0x10, 0x00, - 0x11, 0x92, - 0x12, 0x01, - 0x13, 0x01, - 0x14, 0x96, - 0x15, 0x05, - 0x16, 0x00, - 0x17, 0x00, - 0x18, 0x00, - 0x19, 0x00, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x20, 0x00, - 0x21, 0x2b, - 0x22, 0x03, - 0x23, 0x1f, - 0x24, 0xff, - 0x25, 0xff, - 0x26, 0x1f, - 0x27, 0xff, - 0x28, 0xff, - 0x29, 0x1f, - 0x2b, 0xa4, - 0x2c, 0x1e, - 0x2d, 0x00, - 0x2e, 0x80, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0x04, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0x0c, - 0x37, 0xf1, - 0x38, 0x00, - 0x39, 0xf1, - 0x3a, 0x00, - 0x3b, 0x02, - 0x3c, 0x00, - 0x3d, 0x04, - 0x3e, 0x03, - 0x3f, 0x00, - 0x40, 0x04, - 0x41, 0x00, - 0x42, 0x68, - 0x43, 0x00, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0x03, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0x03, - 0x4a, 0x01, - 0x4b, 0x44, - 0x4d, 0x60, - 0x4e, 0x28, - 0x4f, 0x3e, - 0x50, 0xc0, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0xe0, - 0x55, 0x01, - 0x56, 0x00, - 0x57, 0xf0, - 0x58, 0x00, - 0x59, 0x78, - 0x5a, 0x00, - 0x5b, 0x80, - - 0xf0, 0x00, - 0x90, 0x82, - 0x91, 0x00, - 0x92, 0x4e, - 0x93, 0xc5, - 0x94, 0x00, - 0x95, 0x10, - 0x96, 0x10, - 0x97, 0x00, - 0x98, 0x00, - - 0xf0, 0x03, - 0x00, 0x30, - 0x01, 0xf1, - 0x02, 0x94, - 0x03, 0x42, - 0x04, 0x92, - 0x05, 0xb4, - 0x06, 0x0b, - 0x07, 0x29, - 0x08, 0x84, - 0x09, 0x02, - 0x0a, 0x00, - 0x0b, 0x40, - 0x0c, 0x05, - 0x0d, 0x00, - 0x0e, 0x30, - 0x0f, 0x00, - 0x10, 0xce, - 0x11, 0xe4, - 0x12, 0x10, - 0x13, 0x29, - 0x14, 0x94, - 0x15, 0x02, - 0x16, 0xff, - 0x17, 0xf3, - 0x18, 0x3f, - 0x19, 0x02, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x00, - 0x1f, 0x00, - 0x20, 0x00, - 0x21, 0x00, - 0x22, 0x00, - 0x23, 0x00, - 0x24, 0x66, - 0x25, 0x03, - 0x26, 0x00, - 0x27, 0xcf, - 0x28, 0x80, - 0x29, 0x40, - 0x2a, 0x11, - 0x2b, 0xa3, - 0x2c, 0xe0, - 0x2d, 0x48, - 0x2e, 0x00, - 0x2f, 0xff, - 0x30, 0x40, - 0x31, 0x3f, - 0x32, 0x24, - 0x33, 0x40, - 0x34, 0x80, - 0x35, 0x80, - 0x36, 0x1c, - 0x37, 0x28, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3c, 0x00, - 0x3d, 0x00, - 0x3e, 0x80, - 0x3f, 0x00, - 0x40, 0x03, - 0x41, 0x03, - 0x42, 0x00, - 0x43, 0x00, - 0x44, 0xf8, - 0x45, 0x18, - 0x46, 0xf8, - 0x47, 0x18, - 0x48, 0xf8, - 0x49, 0x18, - 0x4a, 0xf8, - 0x4b, 0x18, - 0x4c, 0xf8, - 0x4d, 0x0a, - 0x4e, 0x0b, - 0x4f, 0x1c, - 0x50, 0x20, - 0x51, 0x00, - 0x52, 0x30, - 0x53, 0x08, - 0x54, 0x24, - 0x55, 0x0a, - 0x56, 0x8b, - 0x57, 0xc0, - 0x58, 0x60, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x5d, 0x00, - 0x5e, 0x00, - 0x5f, 0x00, - 0x60, 0x0c, - 0x61, 0x00, - 0x62, 0x00, - 0x63, 0x00, - 0x64, 0x00, - 0x65, 0x10, - 0x66, 0x00, - 0x67, 0x00, - 0x68, 0x00, - 0x69, 0x00, - 0x6a, 0x00, - 0x6b, 0x20, - 0x6c, 0x00, - 0x6d, 0x3b, - 0x6e, 0xb1, - 0x6f, 0x53, - 0x70, 0x26, - 0x71, 0x00, - 0x72, 0x00, - 0x73, 0xad, - 0x74, 0x86, - 0x80, 0x02, - 0x81, 0x00, - 0x82, 0x95, - 0x83, 0x40, - 0x84, 0x5a, - 0x85, 0xed, - 0x86, 0x00, - 0x87, 0x00, - 0x88, 0x00, - 0x89, 0x00, - 0x8a, 0x00, - 0x8b, 0x00, - 0x8c, 0x00, - 0x8d, 0x00, - 0x8e, 0x00, - 0x8f, 0x00, - - 0xf0, 0x00, - 0x44, 0x25, - 0x45, 0x01, - 0x4f, 0x30, - - 0xf0, 0x04, - 0x00, 0x82, - - 0xf0, 0x05, - 0x11, 0xb0, - 0x18, 0xa1, - 0x19, 0x81, - - 0xf0, 0x05, - 0x02, 0x1e, - - 0xFF, 0xFF, -}; - -unsigned char tv1024_768to1024_768_reg[] = -{ - 0xf0, 0x05, - 0x00, 0xd0, - 0x02, 0x9e, - 0x03, 0xf1, - 0x04, 0xc0, - 0x05, 0xc0, - 0x06, 0xc0, - 0x07, 0xc0, - 0x08, 0xc0, - 0x09, 0x6e, - 0x0a, 0x6e, - 0x0b, 0x6e, - 0x0c, 0xc0, - 0x0e, 0x60, - 0x0f, 0x00, - 0x11, 0x30, - 0x12, 0x3f, - 0x13, 0xc5, - 0x14, 0x00, - 0x15, 0xc0, - 0x16, 0x10, - 0x17, 0xce, - 0x18, 0x11, - 0x19, 0x01, - 0x1e, 0xcc, - 0x1f, 0x01, - 0x20, 0xd8, - 0x21, 0x20, - 0x22, 0x0f, - 0x23, 0x00, - 0x24, 0x40, - 0x25, 0xc0, - 0x26, 0x05, - 0x27, 0xc0, - 0x2a, 0x0f, - 0x2d, 0x04, - 0x2e, 0x00, - 0x2f, 0x04, - 0x31, 0x2f, - 0x32, 0xcc, - 0x33, 0x28, - 0x34, 0x03, - 0x35, 0x15, - 0x36, 0xc0, - 0x37, 0x0a, - 0x38, 0x07, - 0x39, 0x12, - 0x3a, 0x20, - 0x3b, 0x88, - 0x3e, 0xf0, - 0x3f, 0x03, - 0x40, 0x0b, - 0x41, 0x10, - 0x42, 0xc0, - 0x43, 0x1f, - 0x44, 0xc0, - 0x45, 0x00, - 0x46, 0xc0, - 0x47, 0x05, - 0x48, 0xc0, - 0x49, 0x20, - 0x4a, 0xc0, - 0x4b, 0x50, - 0x4c, 0xc0, - 0x4d, 0x00, - 0x4e, 0xc0, - 0x4f, 0x00, - 0x50, 0xc0, - 0x51, 0x02, - 0x52, 0xc0, - 0x53, 0x06, - 0x54, 0xc0, - 0x55, 0x08, - 0x56, 0x36, - 0x57, 0x44, - 0x58, 0x00, - 0x59, 0xc0, - 0x5a, 0x00, - 0x5b, 0xc8, - 0x5c, 0x00, - 0x63, 0x80, - - 0xf0, 0x00, - 0x40, 0xbc, - 0x41, 0x65, - 0x43, 0xc0, - 0x44, 0x01, - 0x45, 0x00, - 0x46, 0xdf, - 0x47, 0xc7, - 0x48, 0x00, - 0x49, 0x80, - 0x4a, 0xc0, - 0x4b, 0xc8, - 0x4d, 0xc0, - 0x4e, 0xcc, - 0x4f, 0x00, - 0x50, 0xcc, - 0x52, 0x00, - 0x53, 0x00, - 0x54, 0x00, - 0x57, 0x4c, - 0x58, 0x00, - 0x59, 0x00, - - 0xf0, 0x01, - 0x00, 0x62, - 0x01, 0xf0, - 0x02, 0x67, - 0x03, 0x05, - 0x04, 0x05, - 0x05, 0x05, - 0x06, 0x05, - 0x07, 0x05, - 0x08, 0x05, - 0x09, 0x05, - 0x0a, 0x05, - 0x0b, 0xc0, - 0x0c, 0x88, - 0x0d, 0x06, - 0x0e, 0x3f, - 0x0f, 0xcd, - 0x10, 0x50, - 0x11, 0xc8, - 0x12, 0x4f, - 0x13, 0xc9, - 0x14, 0x4f, - 0x15, 0xc8, - 0x16, 0x67, - 0x17, 0xc9, - 0x18, 0x10, - 0x19, 0xc8, - 0x1a, 0x63, - 0x1b, 0xc9, - 0x1c, 0x04, - 0x1d, 0xc8, - 0x1e, 0x06, - 0x1f, 0xc8, - 0x20, 0x3a, - 0x21, 0xc1, - 0x22, 0x3e, - 0x23, 0xc1, - 0x24, 0x27, - 0x25, 0xc1, - 0x26, 0x2e, - 0x27, 0xc1, - 0x28, 0x04, - 0x29, 0xcc, - 0x2a, 0x00, - 0x85, 0x25, - 0x86, 0xcb, - 0x30, 0xc1, - 0x31, 0x95, - 0x32, 0xed, - 0x33, 0x81, - 0x34, 0x00, - 0x35, 0x88, - 0x36, 0x00, - 0x37, 0xa3, - 0x38, 0xcc, - 0x39, 0xf2, - 0x3a, 0xcb, - 0x3b, 0x23, - 0x3c, 0xc9, - 0x3d, 0xa3, - 0x3e, 0xc1, - 0x3f, 0x10, - 0x40, 0xc0, - 0x41, 0x37, - 0x42, 0xc0, - 0x43, 0x8c, - 0x44, 0xc4, - 0x45, 0x54, - 0x46, 0xc0, - 0x47, 0x10, - 0x48, 0xc0, - 0x49, 0x16, - 0x4a, 0xc0, - 0x4b, 0x8d, - 0x4c, 0xc4, - 0x4d, 0x53, - 0x4e, 0xc0, - 0x4f, 0x23, - 0x50, 0xc9, - 0x51, 0xa3, - 0x52, 0xc1, - 0x53, 0xff, - 0x54, 0xff, - 0x55, 0xff, - 0x60, 0xd0, - 0x61, 0x22, - 0x62, 0x20, - 0x63, 0x27, - 0x64, 0xc1, - 0x65, 0x3e, - 0x66, 0xb2, - 0x67, 0x9a, - 0x68, 0xce, - 0x69, 0xd6, - 0x6a, 0xb1, - 0x6b, 0x8e, - 0x6c, 0x7c, - 0x6d, 0xe3, - 0x6e, 0x8b, - 0x6f, 0xf6, - 0x70, 0xf0, - 0x71, 0xe2, - 0x72, 0x85, - 0x73, 0xe9, - 0x74, 0xd3, - 0x75, 0xc8, - 0x76, 0xdd, - 0x77, 0x94, - 0x78, 0xb2, - 0x79, 0xc6, - 0x7a, 0xc6, - 0x7b, 0xee, - 0x7c, 0x8c, - 0x7d, 0xe2, - 0x7e, 0xf6, - 0x7f, 0x9c, - 0x80, 0x00, - 0x81, 0x00, - 0x82, 0x35, - 0x83, 0xc0, - - 0xf0, 0x02, - 0x00, 0x82, - 0x01, 0x03, - 0x02, 0xcc, - 0x03, 0xc0, - 0x04, 0x80, - 0x05, 0x80, - 0x06, 0x06, - 0x07, 0x00, - 0x08, 0x08, - 0x09, 0x00, - 0x0a, 0x4c, - 0x0b, 0x8c, - 0x0c, 0xd2, - 0x0d, 0x80, - 0x0e, 0x80, - 0x0f, 0x59, - 0x10, 0x21, - 0x11, 0x8c, - 0x12, 0x84, - 0x13, 0x88, - 0x14, 0x00, - 0x15, 0x00, - 0x16, 0xbc, - 0x17, 0x24, - 0x18, 0xf6, - 0x19, 0xa9, - 0x1a, 0x00, - 0x1b, 0x00, - 0x1f, 0x10, - 0x20, 0x5d, - 0x21, 0xca, - 0x22, 0xc4, - 0x23, 0xcf, - 0x24, 0xc8, - 0x26, 0x4c, - 0x27, 0x8c, - 0x28, 0x0c, - 0x29, 0x00, - 0x2a, 0x00, - 0x2b, 0x00, - 0x2c, 0x00, - 0x2d, 0x00, - 0x2e, 0x00, - 0x2f, 0x00, - 0x30, 0x00, - 0x31, 0x00, - 0x32, 0x24, - 0x33, 0x80, - 0x34, 0x66, - 0x35, 0x48, - 0x36, 0x03, - 0x37, 0x40, - 0x38, 0x04, - 0x39, 0x64, - 0x3a, 0x1b, - 0x3b, 0xa8, - 0x3c, 0xd4, - - 0xf0, 0x04, - 0x00, 0x10, - 0x01, 0x30, - 0x02, 0x00, - 0x03, 0xc0, - 0x04, 0xb8, - 0x05, 0xdd, - 0x06, 0xca, - 0x07, 0xb8, - 0x08, 0xcd, - 0x09, 0x94, - 0x0a, 0xdd, - 0x0b, 0xff, - 0x0c, 0xc0, - 0x0d, 0xfc, - 0x0e, 0xc8, - 0x0f, 0xc6, - 0x10, 0xc0, - 0x11, 0xda, - 0x12, 0xc9, - 0x13, 0xc9, - 0x14, 0xde, - 0x15, 0xcd, - 0x16, 0xc8, - 0x17, 0xc8, - 0x18, 0xc8, - 0x19, 0x88, - 0x1a, 0x88, - 0x1b, 0x88, - 0x1c, 0x88, - 0x1d, 0x88, - 0x20, 0x08, - 0x21, 0x2b, - 0x22, 0xc3, - 0x23, 0x1f, - 0x24, 0xff, - 0x25, 0xff, - 0x26, 0xcf, - 0x27, 0xff, - 0x28, 0xff, - 0x29, 0xdf, - 0x2b, 0xa4, - 0x2c, 0xde, - 0x2d, 0xc0, - 0x2e, 0xcc, - 0x2f, 0xc0, - 0x30, 0xc0, - 0x31, 0x00, - 0x32, 0x00, - 0x33, 0xc8, - 0x34, 0x00, - 0x35, 0x00, - 0x36, 0xd0, - 0x37, 0xfb, - 0x38, 0xcc, - 0x39, 0xfb, - 0x3a, 0xcc, - 0x3b, 0x02, - 0x3c, 0x00, - 0x3d, 0xc4, - 0x3e, 0x03, - 0x3f, 0x00, - 0x40, 0xc4, - 0x41, 0x00, - 0x42, 0x68, - 0x43, 0x00, - 0x44, 0xff, - 0x45, 0xff, - 0x46, 0xc7, - 0x47, 0xff, - 0x48, 0xff, - 0x49, 0xc7, - 0x4a, 0x4d, - 0x4b, 0xcc, - 0x4d, 0x60, - 0x4e, 0xe8, - 0x4f, 0xfe, - 0x50, 0xc0, - 0x51, 0x00, - 0x52, 0x00, - 0x53, 0xc0, - 0x54, 0xe2, - 0x55, 0x01, - 0x56, 0xc0, - 0x57, 0x01, - 0x58, 0xcd, - 0x59, 0x81, - 0x5a, 0xcc, - 0x5b, 0xcc, - - 0xf0, 0x00, - 0x90, 0x82, - 0x91, 0x00, - 0x92, 0x4e, - 0x93, 0xc5, - 0x94, 0x00, - 0x95, 0x10, - 0x96, 0x10, - 0x97, 0x00, - 0x98, 0x00, - - 0xf0, 0x03, - 0x00, 0x20, - 0x01, 0x8a, - 0x02, 0x56, - 0x03, 0xb2, - 0x04, 0x30, - 0x05, 0x66, - 0x06, 0x11, - 0x07, 0x23, - 0x08, 0xdb, - 0x09, 0x80, - 0x0a, 0xa8, - 0x0b, 0xa0, - 0x0c, 0x68, - 0x0d, 0x06, - 0x0e, 0x08, - 0x0f, 0x80, - 0x10, 0x6b, - 0x11, 0x06, - 0x12, 0x17, - 0x13, 0x23, - 0x14, 0x0b, - 0x15, 0x82, - 0x16, 0x26, - 0x17, 0xff, - 0x18, 0xff, - 0x19, 0x02, - 0x1a, 0x0c, - 0x1b, 0x00, - 0x1c, 0x00, - 0x1d, 0x00, - 0x1e, 0x00, - 0x1f, 0xc0, - 0x20, 0x00, - 0x21, 0xc8, - 0x22, 0x00, - 0x23, 0xc8, - 0x24, 0x66, - 0x25, 0x03, - 0x26, 0x0c, - 0x27, 0xcf, - 0x28, 0x80, - 0x29, 0x40, - 0x2a, 0xdd, - 0x2b, 0xa3, - 0x2c, 0xe0, - 0x2d, 0x48, - 0x2e, 0x00, - 0x2f, 0xff, - 0x30, 0x40, - 0x31, 0xff, - 0x32, 0x24, - 0x33, 0x40, - 0x34, 0x80, - 0x35, 0x80, - 0x36, 0x1c, - 0x37, 0x27, - 0x38, 0x00, - 0x39, 0x00, - 0x3a, 0x00, - 0x3b, 0x00, - 0x3c, 0x00, - 0x3d, 0x00, - 0x3e, 0xc4, - 0x3f, 0x00, - 0x40, 0xcb, - 0x41, 0x03, - 0x42, 0x8c, - 0x43, 0xc0, - 0x44, 0xf8, - 0x45, 0x1e, - 0x46, 0xf8, - 0x47, 0x1e, - 0x48, 0xf8, - 0x49, 0xd8, - 0x4a, 0xf8, - 0x4b, 0xd8, - 0x4c, 0xf8, - 0x4d, 0xca, - 0x4e, 0x8e, - 0x4f, 0xdc, - 0x50, 0x20, - 0x51, 0x00, - 0x52, 0x38, - 0x53, 0x08, - 0x54, 0x24, - 0x55, 0x0a, - 0x56, 0x8b, - 0x57, 0xc0, - 0x58, 0x60, - 0x59, 0x00, - 0x5a, 0x00, - 0x5b, 0x00, - 0x5c, 0x00, - 0x5d, 0x00, - 0x5e, 0x00, - 0x5f, 0x00, - 0x60, 0x0c, - 0x61, 0x00, - 0x62, 0x00, - 0x63, 0x00, - 0x64, 0x00, - 0x65, 0x10, - 0x66, 0x00, - 0x67, 0x00, - 0x68, 0x00, - 0x69, 0x00, - 0x6a, 0x00, - 0x6b, 0x20, - 0x6c, 0xc0, - 0x6d, 0x3b, - 0x6e, 0xb1, - 0x6f, 0x53, - 0x70, 0x26, - 0x71, 0x08, - 0x72, 0x00, - 0x73, 0xad, - 0x74, 0x86, - 0x80, 0x02, - 0x81, 0x44, - 0x82, 0x95, - 0x83, 0x40, - 0x84, 0x5a, - 0x85, 0xed, - 0x86, 0x00, - 0x87, 0x00, - 0x88, 0x00, - 0x89, 0xc0, - 0x8a, 0x00, - 0x8b, 0xc0, - 0x8c, 0x00, - 0x8d, 0xc8, - 0x8e, 0x00, - 0x8f, 0xc8, - - 0xf0, 0x00, - 0x44, 0x25, - 0x45, 0x01, - 0x4f, 0x30, - - 0xf0, 0x04, - 0x00, 0x82, - - 0xf0, 0x05, - 0x11, 0xb0, - 0x18, 0x91, - 0x19, 0x81, - - 0xf0, 0x05, - 0x02, 0x1e, - - 0xFF, 0xFF, -}; -/***********************/ - -struct tv_reg { - unsigned char *regs; - unsigned int len; -}; - -struct tv_reg vga2vga_regs[] = { - [0]= { - .regs = tv1440_900to1440_900_reg, - .len = ARRAY_SIZE(tv1440_900to1440_900_reg), - }, - [1] = { - .regs = tv1280_1024to1280_1024_reg, - .len = ARRAY_SIZE(tv1280_1024to1280_1024_reg), - }, - [2] = { - .regs = tv1024_768to1024_768_reg, - .len = ARRAY_SIZE(tv1024_768to1024_768_reg), - }, -}; - -struct tv_reg regs[SCALER_IN_NUMS] = { - [SCALER_IN_VGA] = { - .regs = tv1440_900to1440_900_reg, - .len = ARRAY_SIZE(tv1440_900to1440_900_reg), - }, - [SCALER_IN_RGB] = { - .regs = tv1280_720to1280_720_reg, - .len = ARRAY_SIZE(tv1280_720to1280_720_reg), - }, -}; diff --git a/drivers/misc/scaler/scaler-core.c b/drivers/misc/scaler/scaler-core.c deleted file mode 100644 index 8983173faf5f..000000000000 --- a/drivers/misc/scaler/scaler-core.c +++ /dev/null @@ -1,567 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * - * Copyright (C) 2012 Rockchip - * - *--------------------------------- - * version 1.0 2012-9-13 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SCALER_CORE_VERSION "v1.0.0" -#define SCALER_CORE_NAME "scaler-core" -#define SCALER_DEV_NAME "scaler-ctrl" - -static DEFINE_MUTEX(mutex_chips); -static DEFINE_MUTEX(mutex_ports); - -static struct scaler_device *sdev = NULL; -static unsigned short chip_ids = 0; //只增不减 -static unsigned int port_ids = 0; -extern int scaler_sysfs_create(struct scaler_device *sdev); -extern int scaler_sysfs_remove(struct scaler_device *sdev); - -static const char const *scaler_output_name[] = { - "output type", - "LVDS", - "VGA", - "RGB", - "HDMI", - "DP", -}; - -const char const *scaler_input_name[] = { - "input tpye", - "VGA", - "RGB", - "HDMI", - "DP", - "DVI", - "YPBPR", - "YCBCR", - "MYDP", - "IDP", -}; - -static const char const *scaler_func_name[] ={ - "This Scaler Function Type Is:", - "convertor", - "switch", - "full function", -}; - -static void scaler_led_on(int gpio) -{ - gpio_set_value(gpio, GPIO_HIGH); -} -static void scaler_led_off(int gpio) -{ - gpio_set_value(gpio, GPIO_LOW); -} - -static void default_start(void) -{ -} - -static void default_stop(void) -{ -} - -static int default_read(unsigned short reg, int bytes, void *desc) -{ - return 0; -} - -static int default_write(unsigned short reg, int bytes, void *desc) -{ - return 0; -} - -static int default_parse_cmd(unsigned int cmd, unsigned long arg) -{ - return 0; -} - -//alloc chip dev memory and init default value -struct scaler_chip_dev *alloc_scaler_chip(void) -{ - struct scaler_chip_dev *p = kzalloc(sizeof(struct scaler_chip_dev), GFP_KERNEL); - if (p) { - strcpy(p->name, "unknown"); - //init default operation function - p->start = default_start; - p->stop = default_stop; - p->read = default_read; - p->write = default_write; - p->parse_cmd = default_parse_cmd; - //init list head - INIT_LIST_HEAD(&p->next); - INIT_LIST_HEAD(&p->oports); - INIT_LIST_HEAD(&p->iports); - } - return p; -} - -int scaler_init_platform(struct scaler_platform_data *pdata) -{ - printk("%s: init scaler platform\n", SCALER_CORE_NAME); - - if (pdata->init_hw) { - pdata->init_hw(); - msleep(5); - } - - //power - if (pdata->power_gpio > 0) { - if (!gpio_request(pdata->power_gpio, NULL)) { - if (pdata->power_level != GPIO_HIGH && - pdata->power_level != GPIO_LOW) { - printk("%s: power pin level use default high\n", SCALER_CORE_NAME); - pdata->power_level = GPIO_HIGH; - } - gpio_direction_output(pdata->power_gpio, pdata->power_level); - }else - printk("%s: request vga power gpio failed\n", SCALER_CORE_NAME); - }else - printk("%s: Don't defined power gpio pin\n", SCALER_CORE_NAME); - - //vga 5v en - if (pdata->vga5v_gpio > 0) { - if (!gpio_request(pdata->vga5v_gpio, NULL)) { - if (pdata->vga5v_level != GPIO_HIGH && - pdata->vga5v_level != GPIO_LOW) { - printk("%s: vga5ven pin level use default high\n", SCALER_CORE_NAME); - pdata->vga5v_level = GPIO_HIGH; - } - gpio_direction_output(pdata->vga5v_gpio, pdata->vga5v_level); - }else - printk("%s: request vga5ven gpio failed\n", SCALER_CORE_NAME); - msleep(10); - }else - printk("%s: Don't defined vga5ven gpio pin\n", SCALER_CORE_NAME); - - //ddc select - if (pdata->ddc_sel_gpio > 0) { - if (!gpio_request(pdata->ddc_sel_gpio, NULL)) { - if (pdata->ddc_sel_level != GPIO_HIGH && - pdata->ddc_sel_level != GPIO_LOW) { - printk("%s: ddc select pin level use default high\n", SCALER_CORE_NAME); - pdata->ddc_sel_level = GPIO_HIGH; - } - gpio_direction_output(pdata->ddc_sel_gpio, pdata->ddc_sel_level); - }else - printk("%s: request ddc select gpio failed\n", SCALER_CORE_NAME); - msleep(10); - }else - printk("%s: Don't defined ddc select gpio pin\n", SCALER_CORE_NAME); -} - -int init_scaler_chip(struct scaler_chip_dev *chip, struct scaler_platform_data *pdata) -{ - int i; - struct scaler_output_port *oport = NULL; - struct scaler_input_port *iport = NULL; - - if (!chip || !pdata) { - printk("%s: chip or pdata is null.\n", SCALER_CORE_NAME); - return -1; - } - - //set scaler function type - if (pdata->func_type > SCALER_FUNC_INVALID && - pdata->func_type < SCALER_FUNC_NUMS) { - chip->func_type = pdata->func_type; - }else { - printk("%s: not defined scaer function type\n", SCALER_CORE_NAME); - chip->func_type = SCALER_FUNC_FULL; - } - printk("%s: %s %s\n", chip->name, scaler_func_name[0], scaler_func_name[chip->func_type]); - - //set scaler support input type - for (i = 0; i < pdata->iport_size; i++) { - iport = kzalloc(sizeof(struct scaler_input_port), GFP_KERNEL); - if (!iport) { - printk("%s: kzalloc input port memeory failed.\n", SCALER_CORE_NAME); - return -1; - }else { - iport->max_hres = 1920; - iport->max_vres = 1080; - iport->freq = 60; - //input port id - mutex_lock(&mutex_ports); - iport->id = ++port_ids; - mutex_unlock(&mutex_ports); - //input port type - iport->type = pdata->iports[i].type; - //the first input port is default - if (!chip->cur_inport_id) { - chip->cur_in_type = iport->type; - chip->cur_inport_id = iport->id; - printk("%s: default %s %s\n", chip->name, scaler_input_name[0], scaler_input_name[iport->type]); - } - - //init and request input gpio of indicator lamp - if (pdata->iports[i].led_gpio > 0) { - iport->led_gpio = pdata->iports[i].led_gpio; - if (!gpio_request(iport->led_gpio, NULL)) { - gpio_direction_output(iport->led_gpio, GPIO_HIGH); - }else { - printk("%s: request %s gpio failed\n", chip->name, - scaler_input_name[pdata->iports[i].type], iport->id); - } - } - - //add input of chip - list_add_tail(&iport->next, &chip->iports); - printk("%s: support %s %s led_gpio %d\n", chip->name, scaler_input_name[0], - scaler_input_name[pdata->iports[i].type], iport->id, iport->led_gpio); - }//if (!iport) - }//for() - - //set scaler output type - for (i = 0; i < pdata->oport_size; i++) { - oport = kzalloc(sizeof(struct scaler_output_port), GFP_KERNEL); - if (!oport) { - printk("%s: kzalloc output port memeory failed.\n", SCALER_CORE_NAME); - return -1; - }else { - oport->max_hres = 1920; - oport->max_vres = 1080; - oport->freq = 60; - //output port id - mutex_lock(&mutex_ports); - oport->id = ++port_ids; - mutex_unlock(&mutex_ports); - //output port type - oport->type = pdata->oports[i].type; - //the first output port is default - if (!chip->cur_outport_id) { - chip->cur_out_type = oport->type; - chip->cur_outport_id = oport->id; - printk("%s: default %s %s\n", chip->name, scaler_output_name[0], scaler_output_name[oport->type]); - } - - //init and request output gpio of indicator lamp - if (pdata->oports[i].led_gpio > 0) { - oport->led_gpio = pdata->oports[i].led_gpio; - if (!gpio_request(oport->led_gpio, NULL)) { - gpio_direction_output(oport->led_gpio, GPIO_HIGH); - }else { - printk("%s: request %s gpio failed\n", chip->name, scaler_output_name[pdata->oports[i].type], oport->id); - } - } - - list_add_tail(&oport->next, &chip->oports); - printk("%s: support %s %s led_gpio %d\n", chip->name, scaler_output_name[0], - scaler_output_name[pdata->oports[i].type], oport->id, oport->led_gpio); - }// if (!oport) - }//for() - - - return 0; -} - -//free scaler chip memory -void free_scaler_chip(struct scaler_chip_dev *chip) -{ - struct scaler_output_port *out = NULL; - struct scaler_input_port *in = NULL; - if (chip) { - printk("%s: free %s chip memory resource\n", - SCALER_CORE_NAME, chip->name, chip->id); - list_for_each_entry(out, &chip->oports, next) { - kfree(out); - } - - list_for_each_entry(in, &chip->iports, next) { - if (in->led_gpio > 0) - gpio_free(in->led_gpio); - kfree(in); - } - - kfree(chip); - } -} - -//register chip to scaler core -int register_scaler_chip(struct scaler_chip_dev *chip) -{ - int res = -1; - struct scaler_input_port *in; - struct scaler_output_port *out; - - if (chip && sdev) { - res = 0; - - //start chip to process - chip->start(); - - //power on input indicator lamp - list_for_each_entry(in, &chip->iports, next){ - if (in->id == chip->cur_inport_id) - scaler_led_on(in->led_gpio); - else - scaler_led_off(in->led_gpio); - } - - //power on output indicator lamp - list_for_each_entry(out, &chip->oports, next){ - if (out->id == chip->cur_outport_id) - scaler_led_on(out->led_gpio); - else - scaler_led_off(out->led_gpio); - } - //add chip to scaler core - mutex_lock(&mutex_chips); - chip->id = ++chip_ids; //chip id only grow - list_add_tail(&chip->next, &sdev->chips); - mutex_unlock(&mutex_chips); - printk("%s: register scaler chip %s success.\n", - SCALER_CORE_NAME, chip->name, chip->id); - }else { - printk("%s: register scaler chip %s failed.\n", - SCALER_CORE_NAME, chip->name, chip->id); - } - - return res; -} - -//unregister chip to scaler core -int unregister_scaler_chip(struct scaler_chip_dev *chip) -{ - int res = -1; - struct scaler_input_port *in; - struct scaler_output_port *out; - - if (chip && sdev) { - res = 0; - - chip->stop(); - - //power off input indicator lamp - list_for_each_entry(in, &chip->iports, next){ - if (in->id == chip->cur_inport_id) - scaler_led_off(in->led_gpio); - } - - //power off output indicator lamp - list_for_each_entry(out, &chip->oports, next){ - if (out->id == chip->cur_outport_id) - scaler_led_off(out->led_gpio); - } - - //del chip from scaler core - mutex_lock(&mutex_chips); - list_del(&chip->next); - mutex_unlock(&mutex_chips); - printk("%s: unregister scaler chip %s success.\n", __func__, chip->name, chip->id); - } - - return res; -} - -/*** cdev operate ***/ -static int scaler_file_open(struct inode *inode, struct file *filp) -{ - return 0; -} - -static int scaler_file_close(struct inode *inode, struct file *filp) -{ - return 0; -} - -static ssize_t scaler_file_read(struct file *filp, char *buf, size_t count, loff_t *f_pos) -{ - return 0; -} - -static ssize_t scaler_file_write(struct file *filp, const char *buf, size_t count, loff_t *f_pos) -{ - return 0; -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) -static long scaler_file_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -#else -static int scaler_file_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) -#endif -{ - int iport_id; - struct scaler_chip_dev *chip = NULL; - struct scaler_input_port *iport = NULL; - - - switch(cmd) { - case 0: - printk("get cur input cmd %#x\n", SCALER_IOCTL_GET_CUR_INPUT); - printk("set cur input cmd %#x\n", SCALER_IOCTL_SET_CUR_INPUT); - break; - case SCALER_IOCTL_SET_CUR_INPUT: - //choose input channel; - copy_from_user(&iport_id, (void *)arg, sizeof(int)); - - list_for_each_entry(chip, &sdev->chips, next) { - if (chip->cur_inport_id != iport_id) { - list_for_each_entry(iport, &chip->iports, next) {//if iport belong to this chip - if (iport->id == iport_id) { - chip->cur_inport_id = iport_id; - chip->cur_in_type = iport->type; - chip->parse_cmd(cmd, arg); - break; - } - }//list iports - } - }//list chips - - break; - case SCALER_IOCTL_GET_CUR_INPUT: - list_for_each_entry(chip, &sdev->chips, next) { - iport_id = chip->cur_inport_id; - }//list chips - copy_to_user((void *)arg, &iport_id, sizeof(int)); - printk("current input port id %d\n", iport_id); - break; - default: - //default_parse_cmd(cmd, arg); - break; - } - - - return 0; -} - -struct file_operations scaler_fops = { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) - .unlocked_ioctl =scaler_file_ioctl, -#else - .ioctl =scaler_file_ioctl, //定义所有对scaler操作的cmd -#endif - .read =scaler_file_read, - .write = scaler_file_write, - .open = scaler_file_open, - .release = scaler_file_close, -}; - -//注册一个scaler的字符设备 供别的设备操作scaler -static int scaler_register_chrdev(void) -{ - int ret = 0; - - ret = alloc_chrdev_region(&sdev->devno, 0, 1, SCALER_DEV_NAME); - if(ret != 0){ - printk("%s, can't allocate chrdev devno.\n", __func__); - return ret; - }else { - printk("%s: Scaler chrdev devno(%d,%d).\n", __func__, MAJOR(sdev->devno), MINOR(sdev->devno)); - } - - // initialize character device driver - sdev->cdev = cdev_alloc(); - if (!sdev->cdev) { - printk("%s: cdev alloc failed.\n", __func__); - goto err1; - } - - cdev_init(sdev->cdev, &scaler_fops); - sdev->cdev->owner = THIS_MODULE; - ret = cdev_add(sdev->cdev, sdev->devno, 1); - if(ret < 0){ - printk("%s, add character device error, ret %d\n", __func__, ret); - goto err2; - } - - sdev->class = class_create(THIS_MODULE, "scaler"); - if(!sdev->class){ - printk("%s, create class failed\n", __func__); - goto err3; - } - - sdev->dev = device_create(sdev->class, NULL, sdev->devno, sdev, SCALER_DEV_NAME); - if (!sdev->dev) { - printk("%s: create device failed\n", __func__); - goto err4; - } - - - return 0; - -err4: - class_destroy(sdev->class); -err3: - cdev_del(sdev->cdev); -err2: - kfree(sdev->cdev); -err1: - unregister_chrdev_region(sdev->devno, 1); - - return -1; -} - -static void scaler_unregister_chrdev(void) -{ - cdev_del(sdev->cdev); - unregister_chrdev_region(sdev->devno, 1); - kfree(sdev->cdev); - device_destroy(sdev->class, sdev->devno); - class_destroy(sdev->class); -} - -static int __init rk_scaler_init(void) -{ - printk("%s: SCALER CORE VERSION: %s\n", __func__, SCALER_CORE_VERSION); - - sdev = kzalloc(sizeof(struct scaler_device), GFP_KERNEL); - if (!sdev) { - printk("%s: malloc scaler devices failed.\n", __func__); - return -1; - }else { - INIT_LIST_HEAD(&sdev->chips); - } - - if (scaler_register_chrdev() < 0) { - printk("%s: scaler register chrdev failed.\n", __func__); - goto err1; - } - - if (scaler_sysfs_create(sdev) < 0) { - printk("%s: scaler sysfs create faild.\n", __func__); - goto err2; - } - - return 0; -err2: - scaler_unregister_chrdev(); -err1: - kfree(sdev); - - return -1; -} - -static void __exit rk_scaler_exit(void) -{ - printk("%s\n", __func__); - scaler_sysfs_remove(sdev); - scaler_unregister_chrdev(); - kfree(sdev); -} - -subsys_initcall(rk_scaler_init); -module_exit(rk_scaler_exit); - -MODULE_AUTHOR("linjh "); -MODULE_DESCRIPTION("RK Scaler Device Driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/misc/scaler/scaler-edid.c b/drivers/misc/scaler/scaler-edid.c deleted file mode 100644 index 21a94d2cf752..000000000000 --- a/drivers/misc/scaler/scaler-edid.c +++ /dev/null @@ -1,479 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include -#include -#include -#include -#include -#include - -//#include -#include -#include "../../video/edid.h" - -#define DDC_ADDR 0x50 //read 0xa0 write 0xa1 -#define DDC_I2C_RATE 100*1000 -#define DEFAULT_MODE 3 - -#undef SDEBUG - -#ifdef SDEBUG -#define SPRINTK(fmt, args...) printk(fmt,## args) -#else -#define SPRINTK(fmt, args...) -#endif - -static struct scaler_ddc_dev -{ - unsigned char *edid; - struct i2c_client *client; - struct fb_monspecs specs; - struct list_head modelist; - struct fb_videomode *mode; -}*ddev = NULL; - -static const struct fb_videomode default_modedb[] = { - //name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag(used for vic) -#if defined(CONFIG_CLK_RK30_BOX) -{ "1024x768p@60Hz", 60, 1024, 768, KHZ2PICOS(65000), 160, 24, 29, 3, 136, 6, 0, 0, 0 }, -{ "1280x720p@60Hz", 60, 1280, 720, KHZ2PICOS(74250), 220, 110, 20, 5, 40, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -{ "1280x1024p@60Hz", 60, 1280, 1024, KHZ2PICOS(108000), 248, 48, 38, 1, 112, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -{ "1366x768p@60Hz", 60, 1366, 768, KHZ2PICOS(85500), 213, 70, 24, 3, 143, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -{ "1440x900p@60Hz", 60, 1440, 900, KHZ2PICOS(106500), 232, 80, 25, 3, 152, 6, FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -{ "1680x1050p@60Hz", 60, 1680, 1050, KHZ2PICOS(146250), 280, 104, 30, 3, 176, 6, FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -{ "1920x1080p@60Hz", 60, 1920, 1080, KHZ2PICOS(148500), 148, 88, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 0 }, -#else -//{ "640x480p@60Hz", 60, 640, 480, KHZ2PICOS(25175), 48, 16, 33, 10, 96, 2, 0, 0, 1 }, -{ "720x480p@60Hz", 60, 720, 480, KHZ2PICOS(27000), 60, 16, 30, 9, 62, 6, 0, 0, 2 }, -{ "720x576p@50Hz", 50, 720, 576, KHZ2PICOS(27000), 68, 12, 39, 5, 64, 5, 0, 0, 17 }, -{ "1280x720p@50Hz", 50, 1280, 720, KHZ2PICOS(74250), 220, 440, 20, 5, 40, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 19 }, -{ "1280x720p@60Hz", 60, 1280, 720, KHZ2PICOS(74250), 220, 110, 20, 5, 40, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 4 }, -{ "1920x1080p@50Hz", 50, 1920, 1080, KHZ2PICOS(148500), 148, 528, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 31 }, -{ "1920x1080p@60Hz", 60, 1920, 1080, KHZ2PICOS(148500), 148, 88, 36, 4, 44, 5, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 0, 16 }, -#endif -}; - -static int scaler_mode2screen(const struct fb_videomode *modedb, struct rk29fb_screen *screen) -{ - if(modedb == NULL || screen == NULL) - return -1; - - memset(screen, 0, sizeof(struct rk29fb_screen)); - /* screen type & face */ - screen->type = SCREEN_RGB; - screen->face = OUT_P888; - //screen->lvds_format = LVDS_8BIT_1; //lvds data format - - /* Screen size */ - screen->x_res = modedb->xres; - screen->y_res = modedb->yres; - - /* Timing */ - screen->pixclock = PICOS2KHZ(modedb->pixclock); - screen->pixclock /= 250; - screen->pixclock *= 250; - screen->pixclock *= 1000; - printk(" pixclock is %d\n", screen->pixclock); - screen->lcdc_aclk = 300000000; - - screen->left_margin = modedb->left_margin ; - screen->right_margin = modedb->right_margin; - screen->hsync_len = modedb->hsync_len; - screen->upper_margin = modedb->upper_margin ; - screen->lower_margin = modedb->lower_margin; - screen->vsync_len = modedb->vsync_len; - /* Pin polarity */ - if(FB_SYNC_HOR_HIGH_ACT & modedb->sync) - screen->pin_hsync = 1; - else - screen->pin_hsync = 0; - - if(FB_SYNC_VERT_HIGH_ACT & modedb->sync) - screen->pin_vsync = 1; - else - screen->pin_vsync = 0; - - screen->pin_den = 0; - screen->pin_dclk = 1; - - /* Swap rule */ - screen->swap_rb = 0; - screen->swap_rg = 0; - screen->swap_gb = 0; - screen->swap_delta = 0; - screen->swap_dumy = 0; - - /* Operation function*/ - screen->init = NULL; - screen->standby = NULL; - return 0; -} - -void set_vga_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info) -{ - scaler_mode2screen(&default_modedb[DEFAULT_MODE], screen); -} - -static int scaler_edid_read(char *buf, int len) -{ - int rc; - - if (ddev == NULL || ddev->client == NULL) - return -ENODEV; - - if (buf == NULL) - return -ENOMEM; - - // Check ddc i2c communication is available or not. - rc = i2c_master_reg8_recv(ddev->client, 0, buf, 6, DDC_I2C_RATE); - if(rc == 6) { - /************DEBUG*************/ - SPRINTK("EDID HEAD: "); - for (rc = 0; rc < 6; rc++) - SPRINTK(" %#X", buf[rc]); - SPRINTK("\n"); - /************DEBUG*************/ - - memset(buf, 0, len); - // Read EDID. - rc = i2c_master_reg8_recv(ddev->client, 0, buf, len, DDC_I2C_RATE); - if(rc == len) - return 0; - } - - printk("unable to read EDID block.\n"); - return -EIO; -} - -/* - *read edid of monitor and parse it - */ -static int scaler_parse_vga_edid(void) -{ - int i ; - struct fb_monspecs *specs = NULL; - if (ddev == NULL) { - return -ENODEV; - }else { - specs = &ddev->specs; - //free old edid - if (ddev->edid) { - kfree(ddev->edid); - ddev->edid = NULL; - } - ddev->edid = kzalloc(EDID_LENGTH, GFP_KERNEL); - if (!ddev->edid) - return -ENOMEM; - - //read edid - if (!scaler_edid_read(ddev->edid, EDID_LENGTH)) { - //free old fb_monspecs - if(specs->modedb) - kfree(specs->modedb); - memset(specs, 0, sizeof(struct fb_monspecs)); - //parse edid to fb_monspecs - fb_edid_to_monspecs(ddev->edid, specs); - - /********** DEBUG ***********/ - SPRINTK("========================================\n"); - SPRINTK("Display Information (EDID)\n"); - SPRINTK("========================================\n"); - SPRINTK(" EDID Version %d.%d\n", (int) specs->version, (int) specs->revision); - SPRINTK(" Serial Number: %s\n", specs->serial_no); - SPRINTK(" ASCII Block: %s\n", specs->ascii); - SPRINTK(" Monitor Name: %s\n", specs->monitor); - SPRINTK(" Display Characteristics:\n"); - for (i = 0; i < specs->modedb_len; i++) - SPRINTK(" %4d x %4d @%d [clk: %ldKHZ]\n", specs->modedb[i].xres, specs->modedb[i].yres, - specs->modedb[i].refresh, PICOS2KHZ(specs->modedb[i].pixclock)); - SPRINTK("========================================\n"); - /********** DEBUG ***********/ - }else { - return -EIO; - } - } - printk("scaler-ddc: read and parse vga edid success.\n"); - return 0; -} - -static void scaler_set_default_modelist(void) -{ - int i; - struct fb_videomode *mode = NULL; - struct list_head *modelist = &ddev->modelist; - - fb_destroy_modelist(modelist); - - for(i = 0; i < ARRAY_SIZE(default_modedb); i++) - { - mode = (struct fb_videomode *)&default_modedb[i]; - fb_add_videomode(mode, modelist); - } -} - -/* - * Check mode 1920x1080p@60Hz is in modedb or not. - * If exist, set it as output moe. - * If not exist, try mode 1280x720p@60Hz. - * If both mode not exist, try 720x480p@60Hz. - */ -static int scaler_check_mode(struct fb_videomode *mode) -{ - struct fb_monspecs *specs = NULL; - struct list_head *modelist = NULL; - struct fb_videomode *tmp_mode = NULL; - unsigned int pixclock; - int i; - - if (ddev == NULL) - return -ENODEV; - specs = &ddev->specs; - modelist = &ddev->modelist; - - fb_destroy_modelist(modelist); - - if (mode) { - - for(i = 0; i < ARRAY_SIZE(default_modedb); i++) { - tmp_mode = (struct fb_videomode *)&default_modedb[i]; - pixclock = PICOS2KHZ(tmp_mode->pixclock); - pixclock /= 250; - pixclock *= 250; - pixclock *= 1000; - if( (pixclock <= specs->dclkmax) && - (tmp_mode->xres <= mode->xres) && (tmp_mode->yres <= mode->yres) && - (tmp_mode->refresh <= specs->vfmax) && (tmp_mode->refresh >= specs->vfmin) - ) { - fb_add_videomode(tmp_mode, modelist); - } - } - } - - return 0; -} - -/* - * Find monitor prefered video mode. If not find, - * @specs init info of monitor - */ -struct fb_videomode *scaler_find_max_mode(void) -{ - struct fb_videomode *mode = NULL/*, *nearest_mode = NULL*/; - struct fb_monspecs *specs = NULL; - int i, pixclock; - - if (ddev == NULL) - return NULL; - specs = &ddev->specs; - if(specs->modedb_len) { - - - /* Get max resolution timing */ - mode = &specs->modedb[0]; - for (i = 0; i < specs->modedb_len; i++) { - if(specs->modedb[i].xres > mode->xres) - mode = &specs->modedb[i]; - else if( (specs->modedb[i].xres == mode->xres) && (specs->modedb[i].yres > mode->yres) ) - mode = &specs->modedb[i]; - } - - // For some monitor, the max pixclock read from EDID is smaller - // than the clock of max resolution mode supported. We fix it. - pixclock = PICOS2KHZ(mode->pixclock); - pixclock /= 250; - pixclock *= 250; - pixclock *= 1000; - if(pixclock == 148250000) - pixclock = 148500000; - if(pixclock > specs->dclkmax) - specs->dclkmax = pixclock; - - printk("scaler-ddc: max mode %dx%d@%d[pixclock-%ld KHZ]\n", mode->xres, mode->yres, - mode->refresh, PICOS2KHZ(mode->pixclock)); - } - - return mode; -} - -static struct fb_videomode *scaler_find_best_mode(void) -{ - int res = -1; - struct fb_videomode *mode = NULL, *best = NULL; - - res = scaler_parse_vga_edid(); - if (res == 0) { - mode = scaler_find_max_mode(); - if (mode) { - scaler_check_mode(mode); - best = (struct fb_videomode *)fb_find_nearest_mode(mode, &ddev->modelist); - } - } else { - printk("scaler-ddc: read and parse edid failed errno:%d.\n", res); - } - - return best; -} - -int scaler_switch_screen(struct fb_videomode *mode) -{ - struct rk29fb_screen screen; - - if (mode) { - scaler_mode2screen(mode, &screen); -#ifdef CONFIG_ARCH_RK29 - return FB_Switch_Screen(&screen, 1); -#else - return rk_fb_switch_screen(&screen, 1, 0); -#endif - } - printk("scaler-ddc: fb_videomode is null\n"); - return -1; -} - -int scaler_switch_default_screen(void) -{ - int res; - struct fb_videomode *mode = NULL; - - if (ddev == NULL) { - printk("scaler-ddc: No DDC Dev.\n"); - return -ENODEV; - } - - mode = scaler_find_best_mode(); - if (mode) { - printk("scaler-ddc: best mode %dx%d@%d[pixclock-%ld KHZ]\n", mode->xres, mode->yres, - mode->refresh, PICOS2KHZ(mode->pixclock)); - ddev->mode = mode; - res = scaler_switch_screen(mode); - }else { - res = -1; - printk("scaler-ddc: Don't find best mode\n"); - } - - return res; -} -EXPORT_SYMBOL(scaler_switch_default_screen); - -struct fb_videomode *scaler_get_cmode(void) -{ - struct fb_videomode *mode = NULL; - if (ddev != NULL) - mode = ddev->mode; - return mode; -} -EXPORT_SYMBOL(scaler_get_cmode); - - -static int scaler_ddc_probe(struct i2c_client *client,const struct i2c_device_id *id) -{ - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) - return -ENODEV; - - ddev = kzalloc(sizeof(struct scaler_ddc_dev), GFP_KERNEL); - if (ddev == NULL) - return -ENOMEM; - - INIT_LIST_HEAD(&ddev->modelist); - ddev->client = client; - ddev->mode = &default_modedb[DEFAULT_MODE]; - scaler_set_default_modelist(); - - printk("%s: success.\n", __func__); - - return 0; -} - -static int __devexit scaler_ddc_remove(struct i2c_client *client) -{ - if(ddev->edid) - kfree(ddev->edid); - if (ddev->specs.modedb) - kfree(ddev->specs.modedb); - kfree(ddev); - return 0; -} - -static const struct i2c_device_id scaler_ddc_id[] = { - { "scaler_ddc", 0 }, - { } -}; - -static struct i2c_driver scaler_ddc_driver = { - .driver = { - .name = "scaler_ddc", - .owner = THIS_MODULE, - }, - .probe = scaler_ddc_probe, - .remove = scaler_ddc_remove, - .id_table = scaler_ddc_id, -}; - -static int __init scaler_ddc_init(void) -{ - return i2c_add_driver(&scaler_ddc_driver); -} - -static void __exit scaler_ddc_exit(void) -{ - i2c_del_driver(&scaler_ddc_driver); -} - -subsys_initcall(scaler_ddc_init); -module_exit(scaler_ddc_exit); - - -/************SYSFS DEBUG ***********/ -void scaler_ddc_is_ok(void) -{ - int rc = -1; - char buf[8]; - if (ddev != NULL) { - rc = i2c_master_reg8_recv(ddev->client, 0, buf, 8, DDC_I2C_RATE); - if(rc == 8) { - if (buf[0] == 0x00 && buf[1] == 0xff && buf[2] == 0xff && buf[3] == 0xff && - buf[4] == 0xff && buf[5] == 0xff && buf[6] == 0xff && buf[7] == 0x00) - printk("scaler-ddc: is ok\n"); - else - printk("scaler-ddc: io error"); - }else - printk("scaler-ddc: i2c error\n"); - }else - printk("scaler-ddc: unknown error\n"); -} - -void scaler_current_mode(void) -{ - if (ddev != NULL && ddev->mode != NULL) - printk("scaler-ddc: cmode %dx%d@%d\n", ddev->mode->xres, ddev->mode->yres, - ddev->mode->refresh); - else - printk("scaler-ddc: unknown mode\n"); -} - -void scaler_test_read_vga_edid(void) -{ - int i = 0, res; - struct fb_monspecs *specs = NULL; - - res = scaler_parse_vga_edid(); - if (res == 0) { - specs = &ddev->specs; - - printk("========================================\n"); - printk("Display Information (EDID)\n"); - printk("========================================\n"); - printk(" EDID Version %d.%d\n", (int) specs->version, (int) specs->revision); - printk(" Serial Number: %s\n", specs->serial_no); - printk(" ASCII Block: %s\n", specs->ascii); - printk(" Monitor Name: %s\n", specs->monitor); - printk(" Display Characteristics:\n"); - for (i = 0; i < specs->modedb_len; i++) - printk(" %4d x %4d @%d [clk: %ldKHZ]\n", specs->modedb[i].xres, specs->modedb[i].yres, - specs->modedb[i].refresh, PICOS2KHZ(specs->modedb[i].pixclock)); - printk("========================================\n"); - - }else{ - printk("scaler-ddc: read and parse failed errno %d\n", res); - } -} diff --git a/drivers/misc/scaler/scaler-sysfs.c b/drivers/misc/scaler/scaler-sysfs.c deleted file mode 100644 index 846ea78a495a..000000000000 --- a/drivers/misc/scaler/scaler-sysfs.c +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include -#include -#include -#include -#include - -extern void scaler_test_read_vga_edid(void); -extern void scaler_ddc_is_ok(void); -extern void scaler_current_mode(void); -extern const char const *scaler_input_name[]; - -static ssize_t scaler_chips_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct scaler_chip_dev *chip = NULL; - struct scaler_device *sdev = dev_get_drvdata(dev); - - list_for_each_entry(chip, &sdev->chips, next) { - printk("name: %s\n", chip->name, chip->id); - } - - return 0; -} -static DEVICE_ATTR(chips, 0664, scaler_chips_show, NULL); - -static ssize_t scaler_iport_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - int iports = 0; - struct scaler_chip_dev *chip = NULL; - struct scaler_input_port *in = NULL; - struct scaler_device *sdev = dev_get_drvdata(dev); - - list_for_each_entry(chip, &sdev->chips, next) { - - list_for_each_entry(in, &chip->iports, next) { - iports++; - printk("id = %d type = %s gpio = %d\n", in->id, - scaler_input_name[in->type], in->led_gpio); - } - } - - return sprintf(buf, "%d\n", iports); -} -static DEVICE_ATTR(iports, 0664, scaler_iport_show, NULL); - -static ssize_t scaler_cur_iport_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct scaler_chip_dev *chip = NULL; - //struct scaler_input_port *in = NULL; - struct scaler_device *sdev = dev_get_drvdata(dev); - - list_for_each_entry(chip, &sdev->chips, next) { - - printk("id = %d type = %s\n", chip->cur_inport_id, - scaler_input_name[chip->cur_in_type]); - } - return 0; -} -static DEVICE_ATTR(cur_iport, 0664, scaler_cur_iport_show, NULL); - -static ssize_t scaler_cmode_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - scaler_current_mode(); - return 0; -} - -static DEVICE_ATTR(current_mode, 0664, scaler_cmode_show, NULL); - -static ssize_t scaler_edid_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - scaler_test_read_vga_edid(); - return 0; -} -static DEVICE_ATTR(edid, 0664, scaler_edid_show, NULL); - -static ssize_t scaler_ddc_status_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - scaler_ddc_is_ok(); - return 0; -} -static DEVICE_ATTR(ddc_status, 0664, scaler_ddc_status_show, NULL); - -static struct attribute *scaler_attributes[] = { - &dev_attr_chips.attr, - &dev_attr_iports.attr, - &dev_attr_cur_iport.attr, - &dev_attr_current_mode.attr, - &dev_attr_edid.attr, - &dev_attr_ddc_status.attr, - NULL -}; - -static mode_t scaler_attr_is_visible(struct kobject *kobj, - struct attribute *attr, int n) -{ - mode_t mode = attr->mode; - - return mode; -} - -static const struct attribute_group scaler_attr_group = { - .is_visible = scaler_attr_is_visible, - .attrs = scaler_attributes, -}; - - -int scaler_sysfs_create(struct scaler_device *sdev) -{ - int err; - - err = sysfs_create_group(&sdev->dev->kobj, &scaler_attr_group); - - return err; -} - -int scaler_sysfs_remove(struct scaler_device *sdev) -{ - sysfs_remove_group(&sdev->dev->kobj, &scaler_attr_group); - return 0; -} diff --git a/include/linux/scaler-core.h b/include/linux/scaler-core.h deleted file mode 100644 index b2b187de72d8..000000000000 --- a/include/linux/scaler-core.h +++ /dev/null @@ -1,172 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __SCALER_CORE_H__ -#define __SCALER_CORE_H__ -#include -#include -#include -#include -#include -#include - -struct scaler_platform_data; - -struct display_edid { - char *data; - char *ext_data; -}; - -enum scaler_output_type { - SCALER_OUT_INVALID = 0, - SCALER_OUT_LVDS, - SCALER_OUT_VGA, - SCALER_OUT_RGB, - SCALER_OUT_HDMI, - SCALER_OUT_DP, - SCALER_OUT_NUMS, -}; - -enum scaler_input_type { - SCALER_IN_INVALID = 0, - SCALER_IN_VGA, - SCALER_IN_RGB, - SCALER_IN_HDMI, - SCALER_IN_DP, - SCALER_IN_DVI, - SCALER_IN_YPBPR, - SCALER_IN_YCBCR, - SCALER_IN_MYDP, - SCALER_IN_IDP, - SCALER_IN_NUMS, -}; - -enum scaler_bus_type { - SCALER_BUS_TYPE_INVALID = 0, - SCALER_BUS_TYPE_UART, - SCALER_BUS_TYPE_I2C, - SCALER_BUS_TYPE_SPI, - SCALER_BUS_TYPE_NUMS, -}; - -/* - * the function of scaler, for example convertor or switch -*/ -enum scaler_function_type { - SCALER_FUNC_INVALID = 0, - SCALER_FUNC_CONVERTOR, //转换器 - SCALER_FUNC_SWITCH, //切换开关多选一输出 - SCALER_FUNC_FULL, //全功能 - SCALER_FUNC_NUMS, -}; - -struct scaler_output_port { - int id; - int max_hres; - int max_vres; - int freq; - int led_gpio; //working led - enum scaler_output_type type; - struct list_head next; -}; - -struct scaler_input_port { - int id; - int max_hres; - int max_vres; - int freq; //HZ - int led_gpio; //working led - enum scaler_input_type type; - struct list_head next; -}; - -struct scaler_chip_dev { - char id; - char name[I2C_NAME_SIZE]; - struct i2c_client *client; - - struct scaler_platform_data *pdata; - - enum scaler_function_type func_type; - struct list_head iports; - struct list_head oports; - enum scaler_input_type cur_in_type; - enum scaler_output_type cur_out_type; - int cur_inport_id; - int cur_outport_id; - - //enable chip to process image - void (*start)(void); - //disable chip to process image - void (*stop)(void); - void (*reset)(char active); - void (*suspend)(void); - void (*resume)(void); - - // - int (*read)(unsigned short reg, int bytes, void *dest); - int (*write)(unsigned short reg, int bytes, void *src); - int (*parse_cmd)(unsigned int cmd, unsigned long arg); - int (*update_firmware)(void *data); - - //scaler chip dev list - struct list_head next; -}; - -struct scaler_platform_data { - int int_gpio; - int reset_gpio; - int status_gpio; //check chip if work on lower power mode or normal mode. - - int power_gpio; - int power_level; - int vga5v_gpio; - int vga5v_level; - int ddc_sel_gpio; - int ddc_sel_level; //ddc dev default select by defined the first input port in iports - int vga_hsync_gpio; //detect vga-in v\hsync clk by gpio - int vga_vsync_gpio; - - char *firmware; - //function type - enum scaler_function_type func_type; - - //config in and out - struct scaler_input_port *iports; - struct scaler_output_port *oports; - int iport_size; - int oport_size; - - int (*init_hw)(void); - int (*exit_hw)(void); -}; - -struct scaler_device { - struct class *class; - struct device *dev; - struct cdev *cdev; - dev_t devno; - - struct display_edid edid; - - struct list_head chips; -}; - -//scaler core -int scaler_init_platform(struct scaler_platform_data *pdata); -struct scaler_chip_dev *alloc_scaler_chip(void); -//free chip memory and port memory -void free_scaler_chip(struct scaler_chip_dev *chip); -int init_scaler_chip(struct scaler_chip_dev *chip, struct scaler_platform_data *pdata); -int register_scaler_chip(struct scaler_chip_dev *chip); -int unregister_scaler_chip(struct scaler_chip_dev *chip); - -//edid -int scaler_switch_default_screen(void); -struct fb_videmode *scaler_get_cmode(void); - -//fs ioctl -#define SCALER_IOCTL_MAGIC 'a' -#define SCALER_IOCTL_POWER _IOW(SCALER_IOCTL_MAGIC, 0x00, char) -#define SCALER_IOCTL_GET_CUR_INPUT _IOR(SCALER_IOCTL_MAGIC, 0x01, int) -#define SCALER_IOCTL_SET_CUR_INPUT _IOW(SCALER_IOCTL_MAGIC, 0x02, int) - -#endif