mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
update rk29-fb driver
This commit is contained in:
208
arch/arm/mach-rk29/board-rk29sdk.c
Normal file → Executable file
208
arch/arm/mach-rk29/board-rk29sdk.c
Normal file → Executable file
@@ -76,11 +76,219 @@ static struct rk29_gpio_bank rk29_gpiobankinit[] = {
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************************
|
||||
* lcd devices
|
||||
* author: zyw@rock-chips.com
|
||||
*****************************************************************************************/
|
||||
//#ifdef CONFIG_LCD_TD043MGEA1
|
||||
#define LCD_TXD_PIN RK29_PIN0_PA6 // ÂÒÌî,µÃÐÞ¸Ä
|
||||
#define LCD_CLK_PIN RK29_PIN0_PA7 // ÂÒÌî,µÃÐÞ¸Ä
|
||||
#define LCD_CS_PIN RK29_PIN0_PB6 // ÂÒÌî,µÃÐÞ¸Ä
|
||||
#define LCD_TXD_MUX_NAME GPIOE_U1IR_I2C1_NAME
|
||||
#define LCD_CLK_MUX_NAME NULL
|
||||
#define LCD_CS_MUX_NAME GPIOH6_IQ_SEL_NAME
|
||||
#define LCD_TXD_MUX_MODE 0
|
||||
#define LCD_CLK_MUX_MODE 0
|
||||
#define LCD_CS_MUX_MODE 0
|
||||
//#endif
|
||||
static int rk29_lcd_io_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
#if 0
|
||||
rk29_mux_api_set(LCD_CS_MUX_NAME, LCD_CS_MUX_MODE);
|
||||
if (LCD_CS_PIN != INVALID_GPIO) {
|
||||
ret = gpio_request(LCD_CS_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
goto err1;
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
|
||||
rk29_mux_api_set(LCD_CLK_MUX_NAME, LCD_CLK_MUX_MODE);
|
||||
if (LCD_CLK_PIN != INVALID_GPIO) {
|
||||
ret = gpio_request(LCD_CLK_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
goto err2;
|
||||
printk(">>>>>> lcd clk gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
|
||||
rk29_mux_api_set(LCD_TXD_MUX_NAME, LCD_TXD_MUX_MODE);
|
||||
if (LCD_TXD_PIN != INVALID_GPIO) {
|
||||
ret = gpio_request(LCD_TXD_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
goto err3;
|
||||
printk(">>>>>> lcd txd gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err3:
|
||||
if (LCD_CLK_PIN != INVALID_GPIO) {
|
||||
gpio_free(LCD_CLK_PIN);
|
||||
}
|
||||
err2:
|
||||
if (LCD_CS_PIN != INVALID_GPIO) {
|
||||
gpio_free(LCD_CS_PIN);
|
||||
}
|
||||
err1:
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rk29_lcd_io_deinit(void)
|
||||
{
|
||||
int ret = 0;
|
||||
#if 0
|
||||
gpio_direction_output(LCD_CLK_PIN, 0);
|
||||
gpio_set_value(LCD_CLK_PIN, GPIO_HIGH);
|
||||
gpio_direction_output(LCD_TXD_PIN, 0);
|
||||
gpio_set_value(LCD_TXD_PIN, GPIO_HIGH);
|
||||
|
||||
gpio_free(LCD_CS_PIN);
|
||||
rk29_mux_api_mode_resume(LCD_CS_MUX_NAME);
|
||||
gpio_free(LCD_CLK_PIN);
|
||||
gpio_free(LCD_TXD_PIN);
|
||||
rk29_mux_api_mode_resume(LCD_TXD_MUX_NAME);
|
||||
rk29_mux_api_mode_resume(LCD_CLK_MUX_NAME);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct rk29lcd_info rk29_lcd_info = {
|
||||
//.txd_pin = LCD_TXD_PIN,
|
||||
//.clk_pin = LCD_CLK_PIN,
|
||||
//.cs_pin = LCD_CS_PIN,
|
||||
.io_init = rk29_lcd_io_init,
|
||||
.io_deinit = rk29_lcd_io_deinit,
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************************
|
||||
* frame buffe devices
|
||||
* author: zyw@rock-chips.com
|
||||
*****************************************************************************************/
|
||||
|
||||
#define FB_ID 0
|
||||
#define FB_DISPLAY_ON_PIN RK29_PIN0_PB1 // ÂÒÌî,µÃÐÞ¸Ä
|
||||
#define FB_LCD_STANDBY_PIN INVALID_GPIO
|
||||
#define FB_MCU_FMK_PIN INVALID_GPIO
|
||||
|
||||
#if 0
|
||||
#define FB_DISPLAY_ON_VALUE GPIO_LOW
|
||||
#define FB_LCD_STANDBY_VALUE 0
|
||||
|
||||
#define FB_DISPLAY_ON_MUX_NAME GPIOB1_SMCS1_MMC0PCA_NAME
|
||||
#define FB_DISPLAY_ON_MUX_MODE IOMUXA_GPIO0_B1
|
||||
|
||||
#define FB_LCD_STANDBY_MUX_NAME NULL
|
||||
#define FB_LCD_STANDBY_MUX_MODE 1
|
||||
|
||||
#define FB_MCU_FMK_PIN_MUX_NAME NULL
|
||||
#define FB_MCU_FMK_MUX_MODE 0
|
||||
|
||||
#define FB_DATA0_16_MUX_NAME GPIOC_LCDC16BIT_SEL_NAME
|
||||
#define FB_DATA0_16_MUX_MODE 1
|
||||
|
||||
#define FB_DATA17_18_MUX_NAME GPIOC_LCDC18BIT_SEL_NAME
|
||||
#define FB_DATA17_18_MUX_MODE 1
|
||||
|
||||
#define FB_DATA19_24_MUX_NAME GPIOC_LCDC24BIT_SEL_NAME
|
||||
#define FB_DATA19_24_MUX_MODE 1
|
||||
|
||||
#define FB_DEN_MUX_NAME CXGPIO_LCDDEN_SEL_NAME
|
||||
#define FB_DEN_MUX_MODE 1
|
||||
|
||||
#define FB_VSYNC_MUX_NAME CXGPIO_LCDVSYNC_SEL_NAME
|
||||
#define FB_VSYNC_MUX_MODE 1
|
||||
|
||||
#define FB_MCU_FMK_MUX_NAME NULL
|
||||
#define FB_MCU_FMK_MUX_MODE 0
|
||||
#endif
|
||||
static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
|
||||
{
|
||||
int ret = 0;
|
||||
#if 0
|
||||
if(fb_setting->data_num <=16)
|
||||
rk29_mux_api_set(FB_DATA0_16_MUX_NAME, FB_DATA0_16_MUX_MODE);
|
||||
if(fb_setting->data_num >16 && fb_setting->data_num<=18)
|
||||
rk29_mux_api_set(FB_DATA17_18_MUX_NAME, FB_DATA17_18_MUX_MODE);
|
||||
if(fb_setting->data_num >18)
|
||||
rk29_mux_api_set(FB_DATA19_24_MUX_NAME, FB_DATA19_24_MUX_MODE);
|
||||
|
||||
if(fb_setting->vsync_en)
|
||||
rk29_mux_api_set(FB_VSYNC_MUX_NAME, FB_VSYNC_MUX_MODE);
|
||||
|
||||
if(fb_setting->den_en)
|
||||
rk29_mux_api_set(FB_DEN_MUX_NAME, FB_DEN_MUX_MODE);
|
||||
|
||||
if(fb_setting->mcu_fmk_en && FB_MCU_FMK_MUX_NAME && (FB_MCU_FMK_PIN != INVALID_GPIO))
|
||||
{
|
||||
rk29_mux_api_set(FB_MCU_FMK_MUX_NAME, FB_MCU_FMK_MUX_MODE);
|
||||
ret = gpio_request(FB_MCU_FMK_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(FB_MCU_FMK_PIN);
|
||||
printk(">>>>>> FB_MCU_FMK_PIN gpio_request err \n ");
|
||||
}
|
||||
gpio_direction_input(FB_MCU_FMK_PIN);
|
||||
}
|
||||
|
||||
if(fb_setting->disp_on_en && FB_DISPLAY_ON_MUX_NAME && (FB_DISPLAY_ON_PIN != INVALID_GPIO))
|
||||
{
|
||||
rk29_mux_api_set(FB_DISPLAY_ON_MUX_NAME, FB_DISPLAY_ON_MUX_MODE);
|
||||
ret = gpio_request(FB_DISPLAY_ON_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(FB_DISPLAY_ON_PIN);
|
||||
printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
|
||||
if(fb_setting->disp_on_en && FB_LCD_STANDBY_MUX_NAME && (FB_LCD_STANDBY_PIN != INVALID_GPIO))
|
||||
{
|
||||
rk29_mux_api_set(FB_LCD_STANDBY_MUX_NAME, FB_LCD_STANDBY_MUX_MODE);
|
||||
ret = gpio_request(FB_LCD_STANDBY_PIN, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(FB_LCD_STANDBY_PIN);
|
||||
printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct rk29fb_info rk29_fb_info = {
|
||||
.fb_id = FB_ID,
|
||||
//.disp_on_pin = FB_DISPLAY_ON_PIN,
|
||||
//.disp_on_value = FB_DISPLAY_ON_VALUE,
|
||||
//.standby_pin = FB_LCD_STANDBY_PIN,
|
||||
//.standby_value = FB_LCD_STANDBY_VALUE,
|
||||
//.mcu_fmk_pin = FB_MCU_FMK_PIN,
|
||||
.lcd_info = &rk29_lcd_info,
|
||||
.io_init = rk29_fb_io_init,
|
||||
};
|
||||
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
#ifdef CONFIG_UART1_RK29
|
||||
&rk29_device_uart1,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_RK29
|
||||
&rk29_device_fb,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VIVANTE
|
||||
&rk29_device_gpu,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
static void __init rk29_gic_init_irq(void)
|
||||
|
||||
60
arch/arm/mach-rk29/devices.c
Normal file → Executable file
60
arch/arm/mach-rk29/devices.c
Normal file → Executable file
@@ -114,4 +114,62 @@ struct platform_device rk29_device_uart3 = {
|
||||
.num_resources = ARRAY_SIZE(resources_uart3),
|
||||
.resource = resources_uart3,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VIVANTE
|
||||
static struct resource resources_gpu[] = {
|
||||
[0] = {
|
||||
.name = "gpu_irq",
|
||||
.start = IRQ_GPU,
|
||||
.end = IRQ_GPU,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[1] = {
|
||||
.name = "gpu_base",
|
||||
.start = RK29_GPU_PHYS,
|
||||
.end = RK29_GPU_PHYS + (256 << 10),
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[2] = {
|
||||
.name = "gpu_mem",
|
||||
.start = 0x66400000, //0x67C00000,
|
||||
.end = 0x66400000 + (28 << 20), //0x67C00000 + (4 << 20),
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
struct platform_device rk29_device_gpu = {
|
||||
.name = "galcore",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(resources_gpu),
|
||||
.resource = resources_gpu,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FB_RK29
|
||||
/* rk29 fb resource */
|
||||
static struct resource rk29_fb_resource[] = {
|
||||
[0] = {
|
||||
.start = RK29_LCDC_PHYS,
|
||||
.end = RK29_LCDC_PHYS + RK29_LCDC_SIZE - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_LCDC,
|
||||
.end = IRQ_LCDC,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
/*platform_device*/
|
||||
extern struct rk29fb_info rk29_fb_info;
|
||||
struct platform_device rk29_device_fb = {
|
||||
.name = "rk29-fb",
|
||||
.id = 4,
|
||||
.num_resources = ARRAY_SIZE(rk29_fb_resource),
|
||||
.resource = rk29_fb_resource,
|
||||
.dev = {
|
||||
.platform_data = &rk29_fb_info,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
2
arch/arm/mach-rk29/devices.h
Normal file → Executable file
2
arch/arm/mach-rk29/devices.h
Normal file → Executable file
@@ -21,5 +21,7 @@ extern struct platform_device rk29_device_uart0;
|
||||
extern struct platform_device rk29_device_uart1;
|
||||
extern struct platform_device rk29_device_uart2;
|
||||
extern struct platform_device rk29_device_uart3;
|
||||
extern struct platform_device rk29_device_gpu;
|
||||
extern struct platform_device rk29_device_fb;
|
||||
|
||||
#endif
|
||||
32
arch/arm/mach-rk29/include/mach/board.h
Normal file → Executable file
32
arch/arm/mach-rk29/include/mach/board.h
Normal file → Executable file
@@ -17,6 +17,38 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define INVALID_GPIO -1
|
||||
|
||||
struct rk29lcd_info{
|
||||
u32 lcd_id;
|
||||
u32 txd_pin;
|
||||
u32 clk_pin;
|
||||
u32 cs_pin;
|
||||
int (*io_init)(void);
|
||||
int (*io_deinit)(void);
|
||||
};
|
||||
|
||||
struct rk29_fb_setting_info{
|
||||
u8 data_num;
|
||||
u8 vsync_en;
|
||||
u8 den_en;
|
||||
u8 mcu_fmk_en;
|
||||
u8 disp_on_en;
|
||||
u8 standby_en;
|
||||
};
|
||||
|
||||
struct rk29fb_info{
|
||||
u32 fb_id;
|
||||
u32 disp_on_pin;
|
||||
u8 disp_on_value;
|
||||
u32 standby_pin;
|
||||
u8 standby_value;
|
||||
u32 mcu_fmk_pin;
|
||||
struct rk29lcd_info *lcd_info;
|
||||
int (*io_init)(struct rk29_fb_setting_info *fb_setting);
|
||||
int (*io_deinit)(void);
|
||||
};
|
||||
|
||||
void __init rk29_map_common_io(void);
|
||||
void __init rk29_clock_init(void);
|
||||
|
||||
|
||||
52
drivers/video/Kconfig
Normal file → Executable file
52
drivers/video/Kconfig
Normal file → Executable file
@@ -18,7 +18,7 @@ config VGASTATE
|
||||
config VIDEO_OUTPUT_CONTROL
|
||||
tristate "Lowlevel video output switch controls"
|
||||
help
|
||||
This framework adds support for low-level control of the video
|
||||
This framework adds support for low-level control of the video
|
||||
output switch.
|
||||
|
||||
menuconfig FB
|
||||
@@ -626,7 +626,7 @@ config FB_STI
|
||||
BIOS routines contained in a ROM chip in HP PA-RISC based machines.
|
||||
Enabling this option will implement the linux framebuffer device
|
||||
using calls to the STI BIOS routines for initialisation.
|
||||
|
||||
|
||||
If you enable this option, you will get a planar framebuffer device
|
||||
/dev/fb which will work on the most common HP graphic cards of the
|
||||
NGLE family, including the artist chips (in the 7xx and Bxxx series),
|
||||
@@ -1065,36 +1065,36 @@ config FB_I810
|
||||
select FB_CFB_IMAGEBLIT
|
||||
select VGASTATE
|
||||
help
|
||||
This driver supports the on-board graphics built in to the Intel 810
|
||||
This driver supports the on-board graphics built in to the Intel 810
|
||||
and 815 chipsets. Say Y if you have and plan to use such a board.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called i810fb.
|
||||
|
||||
For more information, please read
|
||||
For more information, please read
|
||||
<file:Documentation/fb/intel810.txt>
|
||||
|
||||
config FB_I810_GTF
|
||||
bool "use VESA Generalized Timing Formula"
|
||||
depends on FB_I810
|
||||
help
|
||||
If you say Y, then the VESA standard, Generalized Timing Formula
|
||||
If you say Y, then the VESA standard, Generalized Timing Formula
|
||||
or GTF, will be used to calculate the required video timing values
|
||||
per video mode. Since the GTF allows nondiscrete timings
|
||||
per video mode. Since the GTF allows nondiscrete timings
|
||||
(nondiscrete being a range of values as opposed to discrete being a
|
||||
set of values), you'll be able to use any combination of horizontal
|
||||
set of values), you'll be able to use any combination of horizontal
|
||||
and vertical resolutions, and vertical refresh rates without having
|
||||
to specify your own timing parameters. This is especially useful
|
||||
to maximize the performance of an aging display, or if you just
|
||||
have a display with nonstandard dimensions. A VESA compliant
|
||||
to maximize the performance of an aging display, or if you just
|
||||
have a display with nonstandard dimensions. A VESA compliant
|
||||
monitor is recommended, but can still work with non-compliant ones.
|
||||
If you need or want this, then select this option. The timings may
|
||||
not be compliant with Intel's recommended values. Use at your own
|
||||
If you need or want this, then select this option. The timings may
|
||||
not be compliant with Intel's recommended values. Use at your own
|
||||
risk.
|
||||
|
||||
If you say N, the driver will revert to discrete video timings
|
||||
If you say N, the driver will revert to discrete video timings
|
||||
using a set recommended by Intel in their documentation.
|
||||
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config FB_I810_I2C
|
||||
@@ -1212,10 +1212,10 @@ config FB_MATROX_G
|
||||
G450/G550 secondary head and digital output are supported without
|
||||
additional modules.
|
||||
|
||||
The driver starts in monitor mode. You must use the matroxset tool
|
||||
(available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to
|
||||
swap primary and secondary head outputs, or to change output mode.
|
||||
Secondary head driver always start in 640x480 resolution and you
|
||||
The driver starts in monitor mode. You must use the matroxset tool
|
||||
(available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to
|
||||
swap primary and secondary head outputs, or to change output mode.
|
||||
Secondary head driver always start in 640x480 resolution and you
|
||||
must use fbset to change it.
|
||||
|
||||
Do not forget that second head supports only 16 and 32 bpp
|
||||
@@ -1298,7 +1298,7 @@ config FB_RADEON_I2C
|
||||
select FB_DDC
|
||||
default y
|
||||
help
|
||||
Say Y here if you want DDC/I2C support for your Radeon board.
|
||||
Say Y here if you want DDC/I2C support for your Radeon board.
|
||||
|
||||
config FB_RADEON_BACKLIGHT
|
||||
bool "Support for backlight control"
|
||||
@@ -1498,7 +1498,7 @@ config FB_NEOMAGIC
|
||||
select VGASTATE
|
||||
help
|
||||
This driver supports notebooks with NeoMagic PCI chips.
|
||||
Say Y if you have such a graphics card.
|
||||
Say Y if you have such a graphics card.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called neofb.
|
||||
@@ -1553,7 +1553,7 @@ config FB_VOODOO1
|
||||
select FB_CFB_COPYAREA
|
||||
select FB_CFB_IMAGEBLIT
|
||||
---help---
|
||||
Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or
|
||||
Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or
|
||||
Voodoo2 (cvg) based graphics card.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
@@ -1935,7 +1935,17 @@ config FB_RK2818
|
||||
select FB_CFB_IMAGEBLIT
|
||||
---help---
|
||||
Framebuffer driver for RK2818 Platform,select it if you using rk2818
|
||||
|
||||
|
||||
config FB_RK29
|
||||
tristate "RK29 lcd control"
|
||||
depends on FB
|
||||
select FB_CFB_FILLRECT
|
||||
select FB_CFB_COPYAREA
|
||||
select FB_CFB_IMAGEBLIT
|
||||
---help---
|
||||
Framebuffer driver for RK29 Platform,select it if you using rk29
|
||||
|
||||
|
||||
config FB_SM501
|
||||
tristate "Silicon Motion SM501 framebuffer support"
|
||||
depends on FB && MFD_SM501
|
||||
|
||||
1
drivers/video/Makefile
Normal file → Executable file
1
drivers/video/Makefile
Normal file → Executable file
@@ -121,6 +121,7 @@ obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/
|
||||
obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o
|
||||
obj-$(CONFIG_FB_PS3) += ps3fb.o
|
||||
obj-$(CONFIG_FB_RK2818) += rk2818_fb.o
|
||||
obj-$(CONFIG_FB_RK29) += rk29_fb.o
|
||||
obj-$(CONFIG_FB_SM501) += sm501fb.o
|
||||
obj-$(CONFIG_FB_XILINX) += xilinxfb.o
|
||||
obj-$(CONFIG_FB_SH_MOBILE_LCDC) += sh_mobile_lcdcfb.o
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
@@ -39,9 +39,9 @@ int anx7150_init(void);
|
||||
int anx7150_standby(u8 enable);
|
||||
|
||||
|
||||
void set_hdmi_info(struct rk28fb_screen *screen)
|
||||
void set_hdmi_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
struct rk28fb_screen *screen2 = screen + 1;
|
||||
struct rk29fb_screen *screen2 = screen + 1;
|
||||
|
||||
/* ****************** 576p ******************* */
|
||||
/* screen type & face */
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
void set_hdmi_info(struct rk28fb_screen *screen)
|
||||
void set_hdmi_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
memset(screen, 0, sizeof(struct rk28fb_screen));
|
||||
memset(screen, 0, sizeof(struct rk29fb_screen));
|
||||
screen->face = OUT_P666;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
@@ -117,7 +117,7 @@ int lcd_refresh(u8 arg)
|
||||
|
||||
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen)
|
||||
void set_lcd_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/* Timing */
|
||||
#define H_PW 10
|
||||
#define H_BP 206
|
||||
#define H_BP 206
|
||||
#define H_VD 800
|
||||
#define H_FP 40
|
||||
|
||||
@@ -33,21 +33,21 @@
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
|
||||
#define DRVDelayUs(i) udelay(i*2)
|
||||
|
||||
int init(void);
|
||||
int standby(u8 enable);
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk2918lcd_info *lcd_info )
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
@@ -153,7 +153,7 @@ void spi_screenreg_set(u32 Data)
|
||||
CS_SET();
|
||||
CLK_CLR();
|
||||
TXD_CLR();
|
||||
DRVDelayUs(2);
|
||||
DRVDelayUs(2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* This Lcd Driver is HSD070IDW1 write by cst 2009.10.27 */
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
@@ -35,21 +35,21 @@
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
|
||||
#define DRVDelayUs(i) udelay(i*2)
|
||||
|
||||
int init(void);
|
||||
int standby(u8 enable);
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
@@ -83,12 +83,12 @@ void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info
|
||||
|
||||
/* Operation function*/
|
||||
/*screen->init = init;*/
|
||||
screen->init = NULL;
|
||||
screen->init = NULL;
|
||||
screen->standby = standby;
|
||||
if(lcd_info)
|
||||
gLcd_info = lcd_info;
|
||||
}
|
||||
//cannot need init,so set screen->init = null at rk28_fb.c file
|
||||
//cannot need init,so set screen->init = null at rk29_fb.c file
|
||||
|
||||
void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
{
|
||||
@@ -218,19 +218,19 @@ int standby(u8 enable)
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_deinit();
|
||||
#else
|
||||
|
||||
|
||||
GPIOSetPinDirection(GPIOPortB_Pin3, GPIO_OUT);
|
||||
GPIOSetPinDirection(GPIOPortB_Pin2, GPIO_OUT);
|
||||
|
||||
if(enable)
|
||||
{
|
||||
GPIOSetPinLevel(GPIOPortB_Pin3, GPIO_LOW);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin2, GPIO_HIGH);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin3, GPIO_LOW);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin2, GPIO_HIGH);
|
||||
}
|
||||
else
|
||||
{
|
||||
GPIOSetPinLevel(GPIOPortB_Pin3, GPIO_HIGH);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin2, GPIO_LOW);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin3, GPIO_HIGH);
|
||||
GPIOSetPinLevel(GPIOPortB_Pin2, GPIO_LOW);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
@@ -15,7 +15,7 @@
|
||||
/* Timing */
|
||||
#define H_PW 8
|
||||
#define H_BP 6
|
||||
#define H_VD 320 //***800
|
||||
#define H_VD 320 //***800
|
||||
#define H_FP 60
|
||||
|
||||
#define V_PW 12
|
||||
@@ -24,10 +24,10 @@
|
||||
#define V_FP 40
|
||||
|
||||
/* Other */
|
||||
#define DCLK_POL 0
|
||||
#define DCLK_POL 0
|
||||
#define SWAP_RB 0
|
||||
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
int init(void);
|
||||
int standby(u8 enable);
|
||||
|
||||
@@ -39,10 +39,10 @@ int standby(u8 enable);
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
|
||||
@@ -52,41 +52,41 @@ static void screen_set_iomux(u8 enable)
|
||||
int ret=-1;
|
||||
if(enable)
|
||||
{
|
||||
rk2818_mux_api_set(GPIOH6_IQ_SEL_NAME, 0);
|
||||
ret = gpio_request(RK2818_PIN_PH6, NULL);
|
||||
rk29_mux_api_set(GPIOH6_IQ_SEL_NAME, 0);
|
||||
ret = gpio_request(RK29_PIN_PH6, NULL);
|
||||
if(0)//(ret != 0)
|
||||
{
|
||||
gpio_free(RK2818_PIN_PH6);
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
gpio_free(RK29_PIN_PH6);
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
goto pin_err;
|
||||
}
|
||||
|
||||
rk2818_mux_api_set(GPIOE_I2C0_SEL_NAME, 1);
|
||||
}
|
||||
|
||||
ret = gpio_request(RK2818_PIN_PE5, NULL);
|
||||
rk29_mux_api_set(GPIOE_I2C0_SEL_NAME, 1);
|
||||
|
||||
ret = gpio_request(RK29_PIN_PE5, NULL);
|
||||
if(0)//(ret != 0)
|
||||
{
|
||||
gpio_free(RK2818_PIN_PE5);
|
||||
printk(">>>>>> lcd clk gpio_request err \n ");
|
||||
gpio_free(RK29_PIN_PE5);
|
||||
printk(">>>>>> lcd clk gpio_request err \n ");
|
||||
goto pin_err;
|
||||
}
|
||||
|
||||
ret = gpio_request(RK2818_PIN_PE4, NULL);
|
||||
}
|
||||
|
||||
ret = gpio_request(RK29_PIN_PE4, NULL);
|
||||
if(0)//(ret != 0)
|
||||
{
|
||||
gpio_free(RK2818_PIN_PE4);
|
||||
printk(">>>>>> lcd txd gpio_request err \n ");
|
||||
gpio_free(RK29_PIN_PE4);
|
||||
printk(">>>>>> lcd txd gpio_request err \n ");
|
||||
goto pin_err;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_free(RK2818_PIN_PH6);
|
||||
// rk2818_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
gpio_free(RK29_PIN_PH6);
|
||||
// rk29_mux_api_set(CXGPIO_HSADC_SEL_NAME, 1);
|
||||
|
||||
gpio_free(RK2818_PIN_PE5);
|
||||
gpio_free(RK2818_PIN_PE4);
|
||||
rk2818_mux_api_set(GPIOE_I2C0_SEL_NAME, 0);
|
||||
gpio_free(RK29_PIN_PE5);
|
||||
gpio_free(RK29_PIN_PE4);
|
||||
rk29_mux_api_set(GPIOE_I2C0_SEL_NAME, 0);
|
||||
}
|
||||
return ;
|
||||
pin_err:
|
||||
@@ -100,8 +100,8 @@ void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
#define DRVDelayUs(i) udelay(i*2)
|
||||
|
||||
u32 i;
|
||||
u32 control_bit;
|
||||
|
||||
u32 control_bit;
|
||||
|
||||
|
||||
TXD_OUT();
|
||||
CLK_OUT();
|
||||
@@ -114,10 +114,10 @@ void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
CLK_SET();
|
||||
DRVDelayUs(2);
|
||||
|
||||
CS_CLR();
|
||||
control_bit = 0x70<<8;
|
||||
Addr = (control_bit | Addr);
|
||||
//printk("addr is 0x%x \n", Addr);
|
||||
CS_CLR();
|
||||
control_bit = 0x70<<8;
|
||||
Addr = (control_bit | Addr);
|
||||
//printk("addr is 0x%x \n", Addr);
|
||||
for(i = 0; i < 16; i++) //reg
|
||||
{
|
||||
if(Addr &(1<<(15-i)))
|
||||
@@ -130,17 +130,17 @@ void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
DRVDelayUs(2);
|
||||
CLK_SET();
|
||||
DRVDelayUs(2);
|
||||
}
|
||||
}
|
||||
|
||||
CS_SET();
|
||||
TXD_SET();
|
||||
CLK_SET();
|
||||
TXD_SET();
|
||||
CLK_SET();
|
||||
DRVDelayUs(2);
|
||||
CS_CLR();
|
||||
|
||||
control_bit = 0x72<<8;
|
||||
Data = (control_bit | Data);
|
||||
//printk("data is 0x%x \n", Data);
|
||||
CS_CLR();
|
||||
|
||||
control_bit = 0x72<<8;
|
||||
Data = (control_bit | Data);
|
||||
//printk("data is 0x%x \n", Data);
|
||||
for(i = 0; i < 16; i++) //data
|
||||
{
|
||||
if(Data &(1<<(15-i)))
|
||||
@@ -161,29 +161,29 @@ void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
DRVDelayUs(2);
|
||||
}
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
|
||||
{
|
||||
//printk("lcd_hx8357 set_lcd_info \n");
|
||||
//printk("lcd_hx8357 set_lcd_info \n");
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
screen->face = OUT_FACE;
|
||||
|
||||
|
||||
/* Screen size */
|
||||
screen->x_res = H_VD;
|
||||
screen->y_res = V_VD;
|
||||
|
||||
/* Timing */
|
||||
screen->pixclock = OUT_CLK;
|
||||
screen->left_margin = H_BP; /*>2*/
|
||||
screen->right_margin = H_FP; /*>2*/
|
||||
screen->hsync_len = H_PW; /*>2*/ //***all > 326, 4<PW+BP<15,
|
||||
screen->upper_margin = V_BP; /*>2*/
|
||||
screen->lower_margin = V_FP; /*>2*/
|
||||
screen->vsync_len = V_PW; /*>6*/
|
||||
screen->left_margin = H_BP; /*>2*/
|
||||
screen->right_margin = H_FP; /*>2*/
|
||||
screen->hsync_len = H_PW; /*>2*/ //***all > 326, 4<PW+BP<15,
|
||||
screen->upper_margin = V_BP; /*>2*/
|
||||
screen->lower_margin = V_FP; /*>2*/
|
||||
screen->vsync_len = V_PW; /*>6*/
|
||||
|
||||
/* Pin polarity */
|
||||
screen->pin_hsync = 0;
|
||||
screen->pin_vsync = 0;
|
||||
screen->pin_hsync = 0;
|
||||
screen->pin_vsync = 0;
|
||||
screen->pin_den = 0;
|
||||
screen->pin_dclk = DCLK_POL;
|
||||
|
||||
@@ -202,12 +202,12 @@ void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info
|
||||
}
|
||||
|
||||
int init(void)
|
||||
{
|
||||
{
|
||||
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_init();
|
||||
|
||||
#if 0 //***Õâ¾ä´úÂëÊDz»ÊÇд´íÁË
|
||||
#if 0 //***Õâ¾ä´úÂëÊDz»ÊÇд´íÁË
|
||||
spi_screenreg_set(0x02, 0x07);
|
||||
spi_screenreg_set(0x03, 0x5f);
|
||||
spi_screenreg_set(0x04, 0x17);
|
||||
@@ -243,136 +243,136 @@ int init(void)
|
||||
spi_screenreg_set(0x20, 0xF0);
|
||||
spi_screenreg_set(0x21, 0xF0);
|
||||
spi_screenreg_set(0x22, 0x09);
|
||||
#else
|
||||
spi_screenreg_set(0xff, 0x00);
|
||||
spi_screenreg_set(0x16, 0x08);
|
||||
spi_screenreg_set(0x01, 0x02);
|
||||
spi_screenreg_set(0xe2, 0x00);
|
||||
spi_screenreg_set(0xe3, 0x00);
|
||||
spi_screenreg_set(0xf2, 0x00);
|
||||
spi_screenreg_set(0xe4, 0x1c);
|
||||
spi_screenreg_set(0xe5, 0x1c);
|
||||
spi_screenreg_set(0xe6, 0x00);
|
||||
spi_screenreg_set(0xe7, 0x1c);
|
||||
|
||||
spi_screenreg_set(0x19, 0x01);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x2a, 0x00);
|
||||
spi_screenreg_set(0x2b, 0x13);
|
||||
spi_screenreg_set(0x2f, 0x01);
|
||||
spi_screenreg_set(0x02, 0x00);
|
||||
spi_screenreg_set(0x03, 0x00);
|
||||
spi_screenreg_set(0x04, 0x01);
|
||||
spi_screenreg_set(0x05, 0x3f);
|
||||
spi_screenreg_set(0x06, 0x00);
|
||||
spi_screenreg_set(0x07, 0x00);
|
||||
#else
|
||||
spi_screenreg_set(0xff, 0x00);
|
||||
spi_screenreg_set(0x16, 0x08);
|
||||
spi_screenreg_set(0x01, 0x02);
|
||||
spi_screenreg_set(0xe2, 0x00);
|
||||
spi_screenreg_set(0xe3, 0x00);
|
||||
spi_screenreg_set(0xf2, 0x00);
|
||||
spi_screenreg_set(0xe4, 0x1c);
|
||||
spi_screenreg_set(0xe5, 0x1c);
|
||||
spi_screenreg_set(0xe6, 0x00);
|
||||
spi_screenreg_set(0xe7, 0x1c);
|
||||
|
||||
spi_screenreg_set(0x08, 0x01);
|
||||
spi_screenreg_set(0x09, 0xdf);
|
||||
spi_screenreg_set(0x24, 0x91);
|
||||
spi_screenreg_set(0x25, 0x8a);
|
||||
spi_screenreg_set(0x29, 0x01);
|
||||
spi_screenreg_set(0x18, 0x22);
|
||||
spi_screenreg_set(0x1b, 0x30);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1d, 0x22);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x40, 0x00);
|
||||
spi_screenreg_set(0x41, 0x3c);
|
||||
spi_screenreg_set(0x42, 0x38);
|
||||
spi_screenreg_set(0x43, 0x34);
|
||||
spi_screenreg_set(0x44, 0x2e);
|
||||
spi_screenreg_set(0x45, 0x2f);
|
||||
spi_screenreg_set(0x46, 0x41);
|
||||
spi_screenreg_set(0x47, 0x7d);
|
||||
spi_screenreg_set(0x48, 0x0b);
|
||||
spi_screenreg_set(0x49, 0x05);
|
||||
spi_screenreg_set(0x4a, 0x06);
|
||||
spi_screenreg_set(0x4b, 0x12);
|
||||
spi_screenreg_set(0x4c, 0x16);
|
||||
spi_screenreg_set(0x50, 0x10);
|
||||
spi_screenreg_set(0x51, 0x11);
|
||||
spi_screenreg_set(0x52, 0x0b);
|
||||
spi_screenreg_set(0x53, 0x07);
|
||||
spi_screenreg_set(0x54, 0x03);
|
||||
spi_screenreg_set(0x55, 0x3f);
|
||||
spi_screenreg_set(0x56, 0x02);
|
||||
spi_screenreg_set(0x57, 0x3e);
|
||||
spi_screenreg_set(0x58, 0x09);
|
||||
spi_screenreg_set(0x59, 0x0d);
|
||||
spi_screenreg_set(0x5a, 0x19);
|
||||
spi_screenreg_set(0x5b, 0x1a);
|
||||
spi_screenreg_set(0x5c, 0x14);
|
||||
spi_screenreg_set(0x5d, 0xc0);
|
||||
spi_screenreg_set(0x1a, 0x05);
|
||||
mdelay(10);
|
||||
|
||||
spi_screenreg_set(0x1c, 0x03);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1f, 0x90);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1f, 0xd2);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x28, 0x04);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x28, 0x3c);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x80, 0x00);
|
||||
spi_screenreg_set(0x81, 0x00);
|
||||
spi_screenreg_set(0x82, 0x00);
|
||||
spi_screenreg_set(0x83, 0x00);
|
||||
|
||||
spi_screenreg_set(0x60, 0x08);
|
||||
spi_screenreg_set(0x31, 0x02);
|
||||
spi_screenreg_set(0x32, 0x08 /*0x00*/);
|
||||
spi_screenreg_set(0x17, 0x60); //***RGB666
|
||||
spi_screenreg_set(0x2d, 0x1f);
|
||||
spi_screenreg_set(0xe8, 0x90);
|
||||
#endif
|
||||
spi_screenreg_set(0x19, 0x01);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x2a, 0x00);
|
||||
spi_screenreg_set(0x2b, 0x13);
|
||||
spi_screenreg_set(0x2f, 0x01);
|
||||
spi_screenreg_set(0x02, 0x00);
|
||||
spi_screenreg_set(0x03, 0x00);
|
||||
spi_screenreg_set(0x04, 0x01);
|
||||
spi_screenreg_set(0x05, 0x3f);
|
||||
spi_screenreg_set(0x06, 0x00);
|
||||
spi_screenreg_set(0x07, 0x00);
|
||||
|
||||
spi_screenreg_set(0x08, 0x01);
|
||||
spi_screenreg_set(0x09, 0xdf);
|
||||
spi_screenreg_set(0x24, 0x91);
|
||||
spi_screenreg_set(0x25, 0x8a);
|
||||
spi_screenreg_set(0x29, 0x01);
|
||||
spi_screenreg_set(0x18, 0x22);
|
||||
spi_screenreg_set(0x1b, 0x30);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1d, 0x22);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x40, 0x00);
|
||||
spi_screenreg_set(0x41, 0x3c);
|
||||
spi_screenreg_set(0x42, 0x38);
|
||||
spi_screenreg_set(0x43, 0x34);
|
||||
spi_screenreg_set(0x44, 0x2e);
|
||||
spi_screenreg_set(0x45, 0x2f);
|
||||
spi_screenreg_set(0x46, 0x41);
|
||||
spi_screenreg_set(0x47, 0x7d);
|
||||
spi_screenreg_set(0x48, 0x0b);
|
||||
spi_screenreg_set(0x49, 0x05);
|
||||
spi_screenreg_set(0x4a, 0x06);
|
||||
spi_screenreg_set(0x4b, 0x12);
|
||||
spi_screenreg_set(0x4c, 0x16);
|
||||
spi_screenreg_set(0x50, 0x10);
|
||||
spi_screenreg_set(0x51, 0x11);
|
||||
spi_screenreg_set(0x52, 0x0b);
|
||||
spi_screenreg_set(0x53, 0x07);
|
||||
spi_screenreg_set(0x54, 0x03);
|
||||
spi_screenreg_set(0x55, 0x3f);
|
||||
spi_screenreg_set(0x56, 0x02);
|
||||
spi_screenreg_set(0x57, 0x3e);
|
||||
spi_screenreg_set(0x58, 0x09);
|
||||
spi_screenreg_set(0x59, 0x0d);
|
||||
spi_screenreg_set(0x5a, 0x19);
|
||||
spi_screenreg_set(0x5b, 0x1a);
|
||||
spi_screenreg_set(0x5c, 0x14);
|
||||
spi_screenreg_set(0x5d, 0xc0);
|
||||
spi_screenreg_set(0x1a, 0x05);
|
||||
mdelay(10);
|
||||
|
||||
spi_screenreg_set(0x1c, 0x03);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1f, 0x90);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1f, 0xd2);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x28, 0x04);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x28, 0x3c);
|
||||
mdelay(40);
|
||||
spi_screenreg_set(0x80, 0x00);
|
||||
spi_screenreg_set(0x81, 0x00);
|
||||
spi_screenreg_set(0x82, 0x00);
|
||||
spi_screenreg_set(0x83, 0x00);
|
||||
|
||||
spi_screenreg_set(0x60, 0x08);
|
||||
spi_screenreg_set(0x31, 0x02);
|
||||
spi_screenreg_set(0x32, 0x08 /*0x00*/);
|
||||
spi_screenreg_set(0x17, 0x60); //***RGB666
|
||||
spi_screenreg_set(0x2d, 0x1f);
|
||||
spi_screenreg_set(0xe8, 0x90);
|
||||
#endif
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_deinit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int standby(u8 enable) //***enable =1 means suspend, 0 means resume
|
||||
int standby(u8 enable) //***enable =1 means suspend, 0 means resume
|
||||
{
|
||||
|
||||
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_init();
|
||||
if(enable) {
|
||||
//printk("---------hx8357 screen suspend--------------\n");
|
||||
#if 0
|
||||
spi_screenreg_set(0x03, 0xde);
|
||||
#if 0
|
||||
spi_screenreg_set(0x03, 0xde);
|
||||
#else
|
||||
//modify by robert
|
||||
#if 0
|
||||
spi_screenreg_set(0x1f, 0x91);
|
||||
spi_screenreg_set(0x1f, 0x91);
|
||||
spi_screenreg_set(0x19, 0x00);
|
||||
#else
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
msleep(10);
|
||||
spi_screenreg_set(0x28, 0x24);
|
||||
msleep(10);
|
||||
spi_screenreg_set(0x28, 0x04);
|
||||
#endif
|
||||
//modify end
|
||||
#endif
|
||||
} else {
|
||||
#endif
|
||||
} else {
|
||||
//printk("--------- hx8357 screen resume--------------\n ");
|
||||
#if 0
|
||||
spi_screenreg_set(0x03, 0x5f);
|
||||
#else
|
||||
#if 0
|
||||
spi_screenreg_set(0x03, 0x5f);
|
||||
#else
|
||||
//modify by robert
|
||||
#if 0
|
||||
spi_screenreg_set(0x19, 0x01);
|
||||
spi_screenreg_set(0x1f, 0x90);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x19, 0x01);
|
||||
spi_screenreg_set(0x1f, 0x90);
|
||||
mdelay(10);
|
||||
spi_screenreg_set(0x1f, 0xd2);
|
||||
#else
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
spi_screenreg_set(0x28, 0x38);
|
||||
msleep(10);
|
||||
spi_screenreg_set(0x28, 0x3c);
|
||||
msleep(10);
|
||||
@@ -380,10 +380,10 @@ int standby(u8 enable) //***enable =1 means suspend, 0 means resume
|
||||
spi_screenreg_set(0x81, 0x00);
|
||||
spi_screenreg_set(0x82, 0x00);
|
||||
spi_screenreg_set(0x83, 0x00);
|
||||
|
||||
|
||||
#endif
|
||||
//modify end
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if(gLcd_info)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
@@ -34,10 +34,10 @@
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
#define TXD_IN() gpio_direction_input(TXD_PORT)
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
|
||||
#define delay_us(i) udelay(i)
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
|
||||
u32 spi_screenreg_get(u32 Addr)
|
||||
{
|
||||
@@ -422,7 +422,7 @@ int lcd_standby(u8 enable)
|
||||
}
|
||||
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk2918lcd_info *lcd_info )
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
@@ -378,7 +378,7 @@ int lcd_disparea(u8 area)
|
||||
|
||||
}
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen)
|
||||
void set_lcd_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen)
|
||||
void set_lcd_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
memset(screen, 0, sizeof(struct rk28fb_screen));
|
||||
memset(screen, 0, sizeof(struct rk29fb_screen));
|
||||
screen->face = OUT_P666;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
@@ -118,41 +118,41 @@ void s1d13521if_init_gpio(void)
|
||||
{
|
||||
int i;
|
||||
int ret=0;
|
||||
|
||||
rk2818_mux_api_set(GPIOC_LCDC18BIT_SEL_NAME, IOMUXB_GPIO0_C01);
|
||||
rk2818_mux_api_set(GPIOC_LCDC24BIT_SEL_NAME, IOMUXB_GPIO0_C2_7);
|
||||
|
||||
|
||||
rk29_mux_api_set(GPIOC_LCDC18BIT_SEL_NAME, IOMUXB_GPIO0_C01);
|
||||
rk29_mux_api_set(GPIOC_LCDC24BIT_SEL_NAME, IOMUXB_GPIO0_C2_7);
|
||||
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
if(i == 1 || i == 6)//HIRQ, HRDY
|
||||
{
|
||||
ret = gpio_request(GPIO_RESET_L+i, NULL);
|
||||
ret = gpio_request(GPIO_RESET_L+i, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(GPIO_RESET_L+i);
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
}
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
}
|
||||
gpio_direction_input(GPIO_RESET_L+i);
|
||||
gpio_free(GPIO_RESET_L+i);
|
||||
}
|
||||
}
|
||||
else //RESET_L, HD/C, HCS_L, HRD_L, HWE_L, RMODE
|
||||
{
|
||||
ret = gpio_request(GPIO_RESET_L+i, NULL);
|
||||
if(ret != 0)
|
||||
{
|
||||
gpio_free(GPIO_RESET_L+i);
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
}
|
||||
printk(">>>>>> lcd cs gpio_request err \n ");
|
||||
}
|
||||
gpio_direction_output(GPIO_RESET_L+i, 0);
|
||||
gpio_set_value(GPIO_RESET_L+i, GPIO_HIGH);
|
||||
gpio_free(GPIO_RESET_L+i);
|
||||
gpio_free(GPIO_RESET_L+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void s1d13521if_set_reset(void)
|
||||
{
|
||||
gpio_request(GPIO_RMODE, 0);
|
||||
gpio_request(GPIO_RMODE, 0);
|
||||
gpio_set_value(GPIO_RMODE, GPIO_HIGH);
|
||||
gpio_request(GPIO_RESET_L, 0);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
@@ -31,21 +31,24 @@
|
||||
#define CLK_PORT gLcd_info->clk_pin
|
||||
#define CS_PORT gLcd_info->cs_pin
|
||||
|
||||
#if 0
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
#endif
|
||||
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
int init(void);
|
||||
int standby(u8 enable);
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
@@ -84,7 +87,7 @@ void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info
|
||||
gLcd_info = lcd_info;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
{
|
||||
|
||||
@@ -155,13 +158,15 @@ void spi_screenreg_set(u32 Addr, u32 Data)
|
||||
DRVDelayUs(2);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int init(void)
|
||||
{
|
||||
{
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_init();
|
||||
|
||||
#if 0
|
||||
spi_screenreg_set(0x02, 0x07);
|
||||
spi_screenreg_set(0x03, 0x5f);
|
||||
spi_screenreg_set(0x04, 0x17);
|
||||
@@ -197,6 +202,7 @@ int init(void)
|
||||
spi_screenreg_set(0x20, 0xF0);
|
||||
spi_screenreg_set(0x21, 0xF0);
|
||||
spi_screenreg_set(0x22, 0x09);
|
||||
#endif
|
||||
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_deinit();
|
||||
@@ -204,14 +210,16 @@ int init(void)
|
||||
}
|
||||
|
||||
int standby(u8 enable)
|
||||
{
|
||||
{
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_init();
|
||||
#if 0
|
||||
if(enable) {
|
||||
spi_screenreg_set(0x03, 0xde);
|
||||
} else {
|
||||
spi_screenreg_set(0x03, 0x5f);
|
||||
}
|
||||
#endif
|
||||
if(gLcd_info)
|
||||
gLcd_info->io_deinit();
|
||||
return 0;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include <mach/board.h>
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
|
||||
/* Base */
|
||||
#define OUT_TYPE SCREEN_RGB
|
||||
#define OUT_FACE OUT_P888
|
||||
@@ -34,20 +34,20 @@
|
||||
#define CS_OUT() gpio_direction_output(CS_PORT, 0)
|
||||
#define CS_SET() gpio_set_value(CS_PORT, GPIO_HIGH)
|
||||
#define CS_CLR() gpio_set_value(CS_PORT, GPIO_LOW)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_OUT() gpio_direction_output(CLK_PORT, 0)
|
||||
#define CLK_SET() gpio_set_value(CLK_PORT, GPIO_HIGH)
|
||||
#define CLK_CLR() gpio_set_value(CLK_PORT, GPIO_LOW)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_OUT() gpio_direction_output(TXD_PORT, 0)
|
||||
#define TXD_SET() gpio_set_value(TXD_PORT, GPIO_HIGH)
|
||||
#define TXD_CLR() gpio_set_value(TXD_PORT, GPIO_LOW)
|
||||
|
||||
#define DRVDelayUs(i) udelay(i*2)
|
||||
|
||||
static struct rk2818lcd_info *gLcd_info = NULL;
|
||||
static struct rk29lcd_info *gLcd_info = NULL;
|
||||
int lcd_init(void);
|
||||
int lcd_standby(u8 enable);
|
||||
|
||||
void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info )
|
||||
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
|
||||
{
|
||||
/* screen type & face */
|
||||
screen->type = OUT_TYPE;
|
||||
|
||||
@@ -33,7 +33,7 @@ typedef enum _MCU_STATUS {
|
||||
|
||||
|
||||
/* Sceen description */
|
||||
struct rk28fb_screen {
|
||||
struct rk29fb_screen {
|
||||
/* screen type & out face */
|
||||
u16 type;
|
||||
u16 face;
|
||||
@@ -79,8 +79,8 @@ struct rk28fb_screen {
|
||||
|
||||
};
|
||||
|
||||
extern void set_lcd_info(struct rk28fb_screen *screen, struct rk2818lcd_info *lcd_info);
|
||||
extern void set_tv_info(struct rk28fb_screen *screen);
|
||||
extern void set_hdmi_info(struct rk28fb_screen *screen);
|
||||
extern void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info);
|
||||
extern void set_tv_info(struct rk29fb_screen *screen);
|
||||
extern void set_hdmi_info(struct rk29fb_screen *screen);
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <linux/delay.h>
|
||||
#include "../../rk2818_fb.h"
|
||||
#include "../../rk29_fb.h"
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
|
||||
void set_tv_info(struct rk28fb_screen *screen)
|
||||
void set_tv_info(struct rk29fb_screen *screen)
|
||||
{
|
||||
memset(screen, 0, sizeof(struct rk28fb_screen));
|
||||
memset(screen, 0, sizeof(struct rk29fb_screen));
|
||||
screen->face = OUT_P666;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user