From 9ea13292d1d315c16436748fd41265b07a8b8d14 Mon Sep 17 00:00:00 2001 From: kfx Date: Tue, 7 Aug 2012 09:55:59 +0800 Subject: [PATCH] rk2928: 'adc&keypad support' and 'lvds' and 'lcd' --- arch/arm/configs/rk2928_sdk_defconfig | 1 - arch/arm/mach-rk2928/board-rk2928-sdk.c | 1 + arch/arm/mach-rk2928/devices.c | 24 ++++++++++++++++++++ drivers/adc/plat/rk30_adc.c | 2 ++ drivers/input/keyboard/rk29_keys.c | 2 +- drivers/video/display/screen/lcd_hsd100pxn.c | 4 ++-- drivers/video/rockchip/lvds/rk_lvds.h | 2 +- 7 files changed, 31 insertions(+), 5 deletions(-) diff --git a/arch/arm/configs/rk2928_sdk_defconfig b/arch/arm/configs/rk2928_sdk_defconfig index fb18b35ad28e..32ceab278ca3 100755 --- a/arch/arm/configs/rk2928_sdk_defconfig +++ b/arch/arm/configs/rk2928_sdk_defconfig @@ -22,7 +22,6 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_ARCH_RK2928=y -CONFIG_WIFI_CONTROL_FUNC=y CONFIG_RK_DEBUG_UART=2 CONFIG_FIQ_DEBUGGER=y CONFIG_FIQ_DEBUGGER_NO_SLEEP=y diff --git a/arch/arm/mach-rk2928/board-rk2928-sdk.c b/arch/arm/mach-rk2928/board-rk2928-sdk.c index 2a433f41c3e8..06ac44d87620 100755 --- a/arch/arm/mach-rk2928/board-rk2928-sdk.c +++ b/arch/arm/mach-rk2928/board-rk2928-sdk.c @@ -1154,6 +1154,7 @@ static void __init rk2928_board_init(void) { gpio_request(POWER_ON_PIN, "poweronpin"); gpio_direction_output(POWER_ON_PIN, GPIO_HIGH); + gpio_free(POWER_ON_PIN); pm_power_off = rk30_pm_power_off; diff --git a/arch/arm/mach-rk2928/devices.c b/arch/arm/mach-rk2928/devices.c index 04038a26456b..2fba48058870 100755 --- a/arch/arm/mach-rk2928/devices.c +++ b/arch/arm/mach-rk2928/devices.c @@ -29,6 +29,27 @@ #include #include +#ifdef CONFIG_ADC_RK30 +static struct resource rk30_adc_resource[] = { + { + .start = IRQ_SARADC, + .end = IRQ_SARADC, + .flags = IORESOURCE_IRQ, + }, + { + .start = RK2928_SARADC_PHYS, + .end = RK2928_SARADC_PHYS + RK2928_SARADC_SIZE - 1, + .flags = IORESOURCE_MEM, + }, +}; + +struct platform_device device_adc = { + .name = "rk30-adc", + .id = -1, + .num_resources = ARRAY_SIZE(rk30_adc_resource), + .resource = rk30_adc_resource, +}; +#endif static u64 dma_dmamask = DMA_BIT_MASK(32); @@ -748,6 +769,9 @@ static int __init rk2928_init_devices(void) rk2928_init_uart(); rk2928_init_i2c(); rk2928_init_spim(); +#ifdef CONFIG_ADC_RK30 + platform_device_register(&device_adc); +#endif #ifdef CONFIG_KEYS_RK29 platform_device_register(&device_keys); #endif diff --git a/drivers/adc/plat/rk30_adc.c b/drivers/adc/plat/rk30_adc.c index fbfb26a940b5..a8536fce8ece 100755 --- a/drivers/adc/plat/rk30_adc.c +++ b/drivers/adc/plat/rk30_adc.c @@ -128,6 +128,7 @@ static int rk30_adc_probe(struct platform_device *pdev) struct resource *res; int ret; + printk("%s: start\n", __func__); adc = adc_alloc_host(&pdev->dev, sizeof(struct rk30_adc_device), SARADC_CHN_MASK); if (!adc) return -ENOMEM; @@ -266,6 +267,7 @@ static struct platform_driver rk30_adc_driver = { static int __init rk30_adc_init(void) { + printk("%s: start\n", __func__); return platform_driver_register(&rk30_adc_driver); } subsys_initcall(rk30_adc_init); diff --git a/drivers/input/keyboard/rk29_keys.c b/drivers/input/keyboard/rk29_keys.c index b5881d5b5e93..d184b51a1e0a 100755 --- a/drivers/input/keyboard/rk29_keys.c +++ b/drivers/input/keyboard/rk29_keys.c @@ -32,7 +32,7 @@ #define INVALID_ADVALUE 10 -#if 0 +#if 1 #define key_dbg(bdata, format, arg...) \ dev_printk(KERN_INFO , &bdata->input->dev , format , ## arg) #else diff --git a/drivers/video/display/screen/lcd_hsd100pxn.c b/drivers/video/display/screen/lcd_hsd100pxn.c index 4f07324430ba..c11fa732613c 100755 --- a/drivers/video/display/screen/lcd_hsd100pxn.c +++ b/drivers/video/display/screen/lcd_hsd100pxn.c @@ -8,11 +8,11 @@ /* Base */ -#define OUT_TYPE SCREEN_RGB +#define OUT_TYPE SCREEN_LVDS #define OUT_FACE OUT_D888_P666 #define OUT_CLK 65000000 -#define LCDC_ACLK 500000000//312000000 //29 lcdc axi DMA ƵÂÊ +#define LCDC_ACLK 300000000//312000000 //29 lcdc axi DMA ƵÂÊ /* Timing */ #define H_PW 10 diff --git a/drivers/video/rockchip/lvds/rk_lvds.h b/drivers/video/rockchip/lvds/rk_lvds.h index 3916fad54a90..f5289344d885 100644 --- a/drivers/video/rockchip/lvds/rk_lvds.h +++ b/drivers/video/rockchip/lvds/rk_lvds.h @@ -2,7 +2,7 @@ #define RK_LVDS_H #define LVDS_CON0_OFFSET 0x150 -#define LVDS_CON0_REG (RK2928_GRF_PHYS + LVDS_CON0_OFFSET) +#define LVDS_CON0_REG (RK2928_GRF_BASE + LVDS_CON0_OFFSET) #define LVDSRdReg() __raw_readl(LVDS_CON0_REG) #define LVDSWrReg(val) __raw_writel( val ,LVDS_CON0_REG) -- 2.34.1