diff options
| -rw-r--r-- | drivers/video/via/Makefile | 2 | ||||
| -rw-r--r-- | drivers/video/via/global.h | 1 | ||||
| -rw-r--r-- | drivers/video/via/tbl1636.c | 71 | ||||
| -rw-r--r-- | drivers/video/via/tbl1636.h | 34 | ||||
| -rw-r--r-- | drivers/video/via/vt1636.c | 65 |
5 files changed, 42 insertions, 131 deletions
diff --git a/drivers/video/via/Makefile b/drivers/video/via/Makefile index d496adb0f832..96f01ee2a412 100644 --- a/drivers/video/via/Makefile +++ b/drivers/video/via/Makefile | |||
| @@ -5,5 +5,5 @@ | |||
| 5 | obj-$(CONFIG_FB_VIA) += viafb.o | 5 | obj-$(CONFIG_FB_VIA) += viafb.o |
| 6 | 6 | ||
| 7 | viafb-y :=viafbdev.o hw.o via_i2c.o dvi.o lcd.o ioctl.o accel.o \ | 7 | viafb-y :=viafbdev.o hw.o via_i2c.o dvi.o lcd.o ioctl.o accel.o \ |
| 8 | via_utility.o vt1636.o global.o tblDPASetting.o viamode.o tbl1636.o \ | 8 | via_utility.o vt1636.o global.o tblDPASetting.o viamode.o \ |
| 9 | via-core.o via-gpio.o via_modesetting.o | 9 | via-core.o via-gpio.o via_modesetting.o |
diff --git a/drivers/video/via/global.h b/drivers/video/via/global.h index 28221a062dda..38ef5ac66953 100644 --- a/drivers/video/via/global.h +++ b/drivers/video/via/global.h | |||
| @@ -48,7 +48,6 @@ | |||
| 48 | #include "via_utility.h" | 48 | #include "via_utility.h" |
| 49 | #include "vt1636.h" | 49 | #include "vt1636.h" |
| 50 | #include "tblDPASetting.h" | 50 | #include "tblDPASetting.h" |
| 51 | #include "tbl1636.h" | ||
| 52 | 51 | ||
| 53 | /* External struct*/ | 52 | /* External struct*/ |
| 54 | 53 | ||
diff --git a/drivers/video/via/tbl1636.c b/drivers/video/via/tbl1636.c deleted file mode 100644 index 2d8453429d4a..000000000000 --- a/drivers/video/via/tbl1636.c +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. | ||
| 3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | ||
| 4 | |||
| 5 | * This program is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU General Public | ||
| 7 | * License as published by the Free Software Foundation; | ||
| 8 | * either version 2, or (at your option) any later version. | ||
| 9 | |||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | ||
| 12 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| 13 | * A PARTICULAR PURPOSE.See the GNU General Public License | ||
| 14 | * for more details. | ||
| 15 | |||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., | ||
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "global.h" | ||
| 23 | struct IODATA COMMON_INIT_TBL_VT1636[] = { | ||
| 24 | /* Index, Mask, Value */ | ||
| 25 | /* Set panel power sequence timing */ | ||
| 26 | {0x10, 0xC0, 0x00}, | ||
| 27 | /* T1: VDD on - Data on. Each increment is 1 ms. (50ms = 031h) */ | ||
| 28 | {0x0B, 0xFF, 0x40}, | ||
| 29 | /* T2: Data on - Backlight on. Each increment is 2 ms. (210ms = 068h) */ | ||
| 30 | {0x0C, 0xFF, 0x31}, | ||
| 31 | /* T3: Backlight off -Data off. Each increment is 2 ms. (210ms = 068h)*/ | ||
| 32 | {0x0D, 0xFF, 0x31}, | ||
| 33 | /* T4: Data off - VDD off. Each increment is 1 ms. (50ms = 031h) */ | ||
| 34 | {0x0E, 0xFF, 0x68}, | ||
| 35 | /* T5: VDD off - VDD on. Each increment is 100 ms. (500ms = 04h) */ | ||
| 36 | {0x0F, 0xFF, 0x68}, | ||
| 37 | /* LVDS output power up */ | ||
| 38 | {0x09, 0xA0, 0xA0}, | ||
| 39 | /* turn on back light */ | ||
| 40 | {0x10, 0x33, 0x13} | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct IODATA DUAL_CHANNEL_ENABLE_TBL_VT1636[] = { | ||
| 44 | /* Index, Mask, Value */ | ||
| 45 | {0x08, 0xF0, 0xE0} /* Input Data Mode Select */ | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct IODATA SINGLE_CHANNEL_ENABLE_TBL_VT1636[] = { | ||
| 49 | /* Index, Mask, Value */ | ||
| 50 | {0x08, 0xF0, 0x00} /* Input Data Mode Select */ | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct IODATA DITHERING_ENABLE_TBL_VT1636[] = { | ||
| 54 | /* Index, Mask, Value */ | ||
| 55 | {0x0A, 0x70, 0x50} | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct IODATA DITHERING_DISABLE_TBL_VT1636[] = { | ||
| 59 | /* Index, Mask, Value */ | ||
| 60 | {0x0A, 0x70, 0x00} | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct IODATA VDD_ON_TBL_VT1636[] = { | ||
| 64 | /* Index, Mask, Value */ | ||
| 65 | {0x10, 0x20, 0x20} | ||
| 66 | }; | ||
| 67 | |||
| 68 | struct IODATA VDD_OFF_TBL_VT1636[] = { | ||
| 69 | /* Index, Mask, Value */ | ||
| 70 | {0x10, 0x20, 0x00} | ||
| 71 | }; | ||
diff --git a/drivers/video/via/tbl1636.h b/drivers/video/via/tbl1636.h deleted file mode 100644 index d906055f1511..000000000000 --- a/drivers/video/via/tbl1636.h +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. | ||
| 3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | ||
| 4 | |||
| 5 | * This program is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU General Public | ||
| 7 | * License as published by the Free Software Foundation; | ||
| 8 | * either version 2, or (at your option) any later version. | ||
| 9 | |||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | ||
| 12 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| 13 | * A PARTICULAR PURPOSE.See the GNU General Public License | ||
| 14 | * for more details. | ||
| 15 | |||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., | ||
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef _TBL1636_H_ | ||
| 23 | #define _TBL1636_H_ | ||
| 24 | #include "hw.h" | ||
| 25 | |||
| 26 | extern struct IODATA COMMON_INIT_TBL_VT1636[8]; | ||
| 27 | extern struct IODATA DUAL_CHANNEL_ENABLE_TBL_VT1636[1]; | ||
| 28 | extern struct IODATA SINGLE_CHANNEL_ENABLE_TBL_VT1636[1]; | ||
| 29 | extern struct IODATA DITHERING_ENABLE_TBL_VT1636[1]; | ||
| 30 | extern struct IODATA DITHERING_DISABLE_TBL_VT1636[1]; | ||
| 31 | extern struct IODATA VDD_ON_TBL_VT1636[1]; | ||
| 32 | extern struct IODATA VDD_OFF_TBL_VT1636[1]; | ||
| 33 | |||
| 34 | #endif /* _VIA_TBL1636_H_ */ | ||
diff --git a/drivers/video/via/vt1636.c b/drivers/video/via/vt1636.c index 90aad12c2c4d..60e4192c2b34 100644 --- a/drivers/video/via/vt1636.c +++ b/drivers/video/via/vt1636.c | |||
| @@ -23,6 +23,34 @@ | |||
| 23 | #include <linux/via_i2c.h> | 23 | #include <linux/via_i2c.h> |
| 24 | #include "global.h" | 24 | #include "global.h" |
| 25 | 25 | ||
| 26 | static const struct IODATA common_init_data[] = { | ||
| 27 | /* Index, Mask, Value */ | ||
| 28 | /* Set panel power sequence timing */ | ||
| 29 | {0x10, 0xC0, 0x00}, | ||
| 30 | /* T1: VDD on - Data on. Each increment is 1 ms. (50ms = 031h) */ | ||
| 31 | {0x0B, 0xFF, 0x40}, | ||
| 32 | /* T2: Data on - Backlight on. Each increment is 2 ms. (210ms = 068h) */ | ||
| 33 | {0x0C, 0xFF, 0x31}, | ||
| 34 | /* T3: Backlight off -Data off. Each increment is 2 ms. (210ms = 068h)*/ | ||
| 35 | {0x0D, 0xFF, 0x31}, | ||
| 36 | /* T4: Data off - VDD off. Each increment is 1 ms. (50ms = 031h) */ | ||
| 37 | {0x0E, 0xFF, 0x68}, | ||
| 38 | /* T5: VDD off - VDD on. Each increment is 100 ms. (500ms = 04h) */ | ||
| 39 | {0x0F, 0xFF, 0x68}, | ||
| 40 | /* LVDS output power up */ | ||
| 41 | {0x09, 0xA0, 0xA0}, | ||
| 42 | /* turn on back light */ | ||
| 43 | {0x10, 0x33, 0x13} | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* Index, Mask, Value */ | ||
| 47 | static const struct IODATA dual_channel_enable_data = {0x08, 0xF0, 0xE0}; | ||
| 48 | static const struct IODATA single_channel_enable_data = {0x08, 0xF0, 0x00}; | ||
| 49 | static const struct IODATA dithering_enable_data = {0x0A, 0x70, 0x50}; | ||
| 50 | static const struct IODATA dithering_disable_data = {0x0A, 0x70, 0x00}; | ||
| 51 | static const struct IODATA vdd_on_data = {0x10, 0x20, 0x20}; | ||
| 52 | static const struct IODATA vdd_off_data = {0x10, 0x20, 0x00}; | ||
| 53 | |||
| 26 | u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information | 54 | u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information |
| 27 | *plvds_setting_info, struct lvds_chip_information *plvds_chip_info, | 55 | *plvds_setting_info, struct lvds_chip_information *plvds_chip_info, |
| 28 | u8 index) | 56 | u8 index) |
| @@ -55,52 +83,41 @@ void viafb_init_lvds_vt1636(struct lvds_setting_information | |||
| 55 | int reg_num, i; | 83 | int reg_num, i; |
| 56 | 84 | ||
| 57 | /* Common settings: */ | 85 | /* Common settings: */ |
| 58 | reg_num = ARRAY_SIZE(COMMON_INIT_TBL_VT1636); | 86 | reg_num = ARRAY_SIZE(common_init_data); |
| 59 | 87 | for (i = 0; i < reg_num; i++) | |
| 60 | for (i = 0; i < reg_num; i++) { | ||
| 61 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, | 88 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, |
| 62 | plvds_chip_info, | 89 | plvds_chip_info, common_init_data[i]); |
| 63 | COMMON_INIT_TBL_VT1636[i]); | ||
| 64 | } | ||
| 65 | 90 | ||
| 66 | /* Input Data Mode Select */ | 91 | /* Input Data Mode Select */ |
| 67 | if (plvds_setting_info->device_lcd_dualedge) { | 92 | if (plvds_setting_info->device_lcd_dualedge) |
| 68 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, | 93 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, |
| 69 | plvds_chip_info, | 94 | plvds_chip_info, dual_channel_enable_data); |
| 70 | DUAL_CHANNEL_ENABLE_TBL_VT1636[0]); | 95 | else |
| 71 | } else { | ||
| 72 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, | 96 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, |
| 73 | plvds_chip_info, | 97 | plvds_chip_info, single_channel_enable_data); |
| 74 | SINGLE_CHANNEL_ENABLE_TBL_VT1636[0]); | ||
| 75 | } | ||
| 76 | 98 | ||
| 77 | if (plvds_setting_info->LCDDithering) { | 99 | if (plvds_setting_info->LCDDithering) |
| 78 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, | 100 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, |
| 79 | plvds_chip_info, | 101 | plvds_chip_info, dithering_enable_data); |
| 80 | DITHERING_ENABLE_TBL_VT1636[0]); | 102 | else |
| 81 | } else { | ||
| 82 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, | 103 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, |
| 83 | plvds_chip_info, | 104 | plvds_chip_info, dithering_disable_data); |
| 84 | DITHERING_DISABLE_TBL_VT1636[0]); | ||
| 85 | } | ||
| 86 | } | 105 | } |
| 87 | 106 | ||
| 88 | void viafb_enable_lvds_vt1636(struct lvds_setting_information | 107 | void viafb_enable_lvds_vt1636(struct lvds_setting_information |
| 89 | *plvds_setting_info, | 108 | *plvds_setting_info, |
| 90 | struct lvds_chip_information *plvds_chip_info) | 109 | struct lvds_chip_information *plvds_chip_info) |
| 91 | { | 110 | { |
| 92 | |||
| 93 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, plvds_chip_info, | 111 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, plvds_chip_info, |
| 94 | VDD_ON_TBL_VT1636[0]); | 112 | vdd_on_data); |
| 95 | } | 113 | } |
| 96 | 114 | ||
| 97 | void viafb_disable_lvds_vt1636(struct lvds_setting_information | 115 | void viafb_disable_lvds_vt1636(struct lvds_setting_information |
| 98 | *plvds_setting_info, | 116 | *plvds_setting_info, |
| 99 | struct lvds_chip_information *plvds_chip_info) | 117 | struct lvds_chip_information *plvds_chip_info) |
| 100 | { | 118 | { |
| 101 | |||
| 102 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, plvds_chip_info, | 119 | viafb_gpio_i2c_write_mask_lvds(plvds_setting_info, plvds_chip_info, |
| 103 | VDD_OFF_TBL_VT1636[0]); | 120 | vdd_off_data); |
| 104 | } | 121 | } |
| 105 | 122 | ||
| 106 | bool viafb_lvds_identify_vt1636(u8 i2c_adapter) | 123 | bool viafb_lvds_identify_vt1636(u8 i2c_adapter) |
