From d822bb68177a63a45e3afe54d8c1d289497b9133 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E4=BC=9F?= Date: Sat, 15 May 2010 08:06:32 +0000 Subject: [PATCH] modify adc driver and adc key driver --- .config | 57 +++++++++++++++++++++++++++-- arch/arm/mach-rk2818/board-midsdk.c | 28 -------------- arch/arm/mach-rk2818/devices.c | 30 +++++++++++++++ arch/arm/mach-rk2818/devices.h | 2 + drivers/staging/Makefile | 2 +- drivers/staging/rk2818/rk2818_adc.c | 8 +--- 6 files changed, 88 insertions(+), 39 deletions(-) diff --git a/.config b/.config index 22afaf7228e7..9a8fe8a8f879 100644 --- a/.config +++ b/.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.32.9 -# Wed May 12 07:05:50 2010 +# Sat May 15 16:04:46 2010 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -487,6 +487,9 @@ CONFIG_MTD_CFI_I2=y # # Self-contained MTD device drivers # +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_M25P80 is not set +# CONFIG_MTD_SST25L is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set @@ -538,6 +541,7 @@ CONFIG_UID_STAT=y # EEPROM support # # CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set # CONFIG_EEPROM_LEGACY is not set # CONFIG_EEPROM_MAX6875 is not set # CONFIG_EEPROM_93CX6 is not set @@ -578,6 +582,7 @@ CONFIG_MII=y CONFIG_DM9000=y CONFIG_DM9000_DEBUGLEVEL=4 # CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set +# CONFIG_ENC28J60 is not set # CONFIG_ETHOC is not set # CONFIG_SMC911X is not set # CONFIG_SMSC911X is not set @@ -591,6 +596,7 @@ CONFIG_DM9000_DEBUGLEVEL=4 # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set # CONFIG_B44 is not set # CONFIG_KS8842 is not set +# CONFIG_KS8851 is not set # CONFIG_KS8851_MLL is not set # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set @@ -627,12 +633,29 @@ CONFIG_INPUT_KEYRESET=y # # Input Device Drivers # -# CONFIG_INPUT_KEYBOARD is not set +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ADP5588 is not set +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_QT2160 is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_GPIO is not set +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_KEYBOARD_RK28ADC=y # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TABLET is not set CONFIG_INPUT_TOUCHSCREEN=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_AD7877 is not set # CONFIG_TOUCHSCREEN_AD7879_I2C is not set +# CONFIG_TOUCHSCREEN_AD7879_SPI is not set # CONFIG_TOUCHSCREEN_AD7879 is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_FUJITSU is not set @@ -666,7 +689,10 @@ CONFIG_INPUT_GPIO=y # # Hardware I/O ports # -# CONFIG_SERIO is not set +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set # CONFIG_GAMEPORT is not set # @@ -689,6 +715,7 @@ CONFIG_DEVMEM=y # # Non-8250 serial port support # +# CONFIG_SERIAL_MAX3100 is not set CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_RK2818=y @@ -715,6 +742,12 @@ CONFIG_I2C_HELPER_AUTO=y # CONFIG_I2C_RK2818=y +# +# Now, there are two I2C interfaces selected by developer, I2C0 and I2C1. +# +CONFIG_I2C0_RK2818=y +CONFIG_I2C1_RK2818=y + # # Miscellaneous I2C Chip support # @@ -769,6 +802,9 @@ CONFIG_GPIOLIB=y # # SPI GPIO expanders: # +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_GPIO_MC33880 is not set # # AC97 GPIO expanders: @@ -813,7 +849,9 @@ CONFIG_SSB_POSSIBLE=y # CONFIG_MFD_WM831X is not set # CONFIG_MFD_WM8350_I2C is not set # CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_MC13783 is not set # CONFIG_AB3100_CORE is not set +# CONFIG_EZX_PCAP is not set CONFIG_REGULATOR=y CONFIG_REGULATOR_DEBUG=y # CONFIG_REGULATOR_FIXED_VOLTAGE is not set @@ -866,6 +904,7 @@ CONFIG_FB=y # Frame buffer hardware drivers # # CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_RK2818 is not set # CONFIG_FB_VIRTUAL is not set # CONFIG_FB_METRONOME is not set # CONFIG_FB_MB862XX is not set @@ -978,6 +1017,7 @@ CONFIG_MMC_BLOCK_DEFERRED_RESUME=y # CONFIG_MMC_SDHCI is not set # CONFIG_MMC_AT91 is not set # CONFIG_MMC_ATMELMCI is not set +# CONFIG_MMC_SPI is not set # CONFIG_MEMSTICK is not set CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y @@ -989,6 +1029,7 @@ CONFIG_LEDS_CLASS=y # CONFIG_LEDS_GPIO is not set # CONFIG_LEDS_LP3944 is not set # CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_DAC124S085 is not set # CONFIG_LEDS_BD2802 is not set # @@ -1045,6 +1086,14 @@ CONFIG_RTC_HYM8563=y # # SPI RTC drivers # +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_DS3234 is not set +# CONFIG_RTC_DRV_PCF2123 is not set # # Platform RTC drivers @@ -1109,6 +1158,8 @@ CONFIG_ANDROID_LOW_MEMORY_KILLER=y # # CONFIG_RAR_REGISTER is not set # CONFIG_IIO is not set +CONFIG_RK28=y +CONFIG_RK28_ADC=y # # File systems diff --git a/arch/arm/mach-rk2818/board-midsdk.c b/arch/arm/mach-rk2818/board-midsdk.c index f83e4bf10876..9c70e8b5f98d 100644 --- a/arch/arm/mach-rk2818/board-midsdk.c +++ b/arch/arm/mach-rk2818/board-midsdk.c @@ -245,34 +245,6 @@ static struct spi_board_info board_spi_devices[] = { }, }; -/*ADC*/ -static struct resource rk2818_adc_resource[] = { - { - .start = IRQ_NR_ADC, - .end = IRQ_NR_ADC, - .flags = IORESOURCE_IRQ, - }, - { - .start = RK2818_ADC_PHYS, - .end = RK2818_ADC_PHYS + RK2818_ADC_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - -}; - -struct platform_device rk2818_device_adc = { - .name = "rk2818-adc", - .id = -1, - .num_resources = ARRAY_SIZE(rk2818_adc_resource), - .resource = rk2818_adc_resource, -}; - - -struct platform_device rk2818_device_adckey = { - .name = "rk2818-adckey", - .id = -1, - .dev.parent = &rk2818_device_adc.dev, -}; /*rk2818_fb gpio information*/ static struct rk2818_fb_gpio rk2818_fb_gpio_info = { diff --git a/arch/arm/mach-rk2818/devices.c b/arch/arm/mach-rk2818/devices.c index 65d1ed19279b..2587f298779e 100644 --- a/arch/arm/mach-rk2818/devices.c +++ b/arch/arm/mach-rk2818/devices.c @@ -232,3 +232,33 @@ struct platform_device rk2818_device_dm9k = { .platform_data = &dm9k_platdata, } }; + +/*ADC*/ +static struct resource rk2818_adc_resource[] = { + { + .start = IRQ_NR_ADC, + .end = IRQ_NR_ADC, + .flags = IORESOURCE_IRQ, + }, + { + .start = RK2818_ADC_PHYS, + .end = RK2818_ADC_PHYS + RK2818_ADC_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + +}; + +struct platform_device rk2818_device_adc = { + .name = "rk2818-adc", + .id = -1, + .num_resources = ARRAY_SIZE(rk2818_adc_resource), + .resource = rk2818_adc_resource, +}; + + +struct platform_device rk2818_device_adckey = { + .name = "rk2818-adckey", + .id = -1, + .dev.parent = &rk2818_device_adc.dev, +}; + diff --git a/arch/arm/mach-rk2818/devices.h b/arch/arm/mach-rk2818/devices.h index 505fdff65bce..a85cbebc1f41 100644 --- a/arch/arm/mach-rk2818/devices.h +++ b/arch/arm/mach-rk2818/devices.h @@ -27,4 +27,6 @@ extern struct rk2818_i2c_platform_data default_i2c0_data; extern struct rk2818_i2c_platform_data default_i2c1_data; extern struct platform_device rk2818_device_dm9k; extern struct platform_device rk2818_device_fb; +extern struct platform_device rk2818_device_adc; +extern struct platform_device rk2818_device_adckey; #endif diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index 0da3c0b529c2..a585333ce795 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -44,4 +44,4 @@ obj-$(CONFIG_VME_BUS) += vme/ obj-$(CONFIG_RAR_REGISTER) += rar/ obj-$(CONFIG_DX_SEP) += sep/ obj-$(CONFIG_IIO) += iio/ -obj-$(CONFIG_RK28) += rk28/ +obj-$(CONFIG_RK28) += rk2818/ diff --git a/drivers/staging/rk2818/rk2818_adc.c b/drivers/staging/rk2818/rk2818_adc.c index 9fb5b8ed4eb3..e953e447a316 100644 --- a/drivers/staging/rk2818/rk2818_adc.c +++ b/drivers/staging/rk2818/rk2818_adc.c @@ -1,10 +1,4 @@ -/* arch/arm/plat-s3c24xx/adc.c - * - * Copyright (c) 2008 Simtec Electronics - * http://armlinux.simtec.co.uk/ - * Ben Dooks , - * - * S3C24XX ADC device core +/* arch/staging/rk2818/rk2818_adc.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- 2.34.1