|
Subject: Re: Some h2200 kernel patches Newsgroups: gmane.comp.handhelds.linux.kernel Date: 2007-04-23 15:55:57 GMT (1 year, 18 weeks, 2 days, 2 hours and 18 minutes ago) On Fri, Apr 20, 2007 at 12:29:24AM +0200, Michal Panczyk wrote: > Ok. > Here's what I have done: > > I have abandoned changes in h2200_battery.c and unselected it in .conifg > I have added ds2760_battery to defconfig - I am not sure if that's ok > but I thought that would be safer. > > Finally - I have modified the h2200.c file: > I have treated the hx4700.c as template and added some code informing > the ds2760_battery about the h2200 battery parameters. > > I am not sure if the "amount" of code is enough. > I don't have hx4700 and I have not found any information (parameters) > about h2200 backup battery - I have skipped it.... > Aslo I am not sure if I added it in the right place - after hwuart > stuff and before "Initialisation ". > I am not sure if something like ".parent = &h2200_hamcop.dev," is > needed or not .... > > The kernel compiles but I would like to get some comments before I > load it in to my h2200.... > > Hi Michal, Following patch adds pda_power device also. TODO: h2200_leds must be converted to new LEDs class. Paul, would you move h2200_battery from driver/hwmon/battery to arch/arm/mach-pxa/h2200/deprecated? Good day! Subject: [PATCH 1/1] h2200: use pda_power and ds2760_battery. It fixes build. Signed-off-by: Michal Panczyk <mpanczyk@...> Signed-off-by: Anton Vorontsov <cbou@...> --- arch/arm/configs/h2200_defconfig | 104 ++++++++++++++++++++++---------------- arch/arm/mach-pxa/h2200/h2200.c | 89 +++++++++++++++++++++++++++++--- 2 files changed, 141 insertions(+), 52 deletions(-) diff --git a/arch/arm/configs/h2200_defconfig b/arch/arm/configs/h2200_defconfig index 002bb03..2b4e0f1 100644 --- a/arch/arm/configs/h2200_defconfig +++ b/arch/arm/configs/h2200_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.19-hh8 -# Fri Jan 12 14:16:27 2007 +# Linux kernel version: 2.6.20-hh7 +# Mon Apr 23 19:22:56 2007 # CONFIG_ARM=y # CONFIG_GENERIC_TIME is not set @@ -11,6 +11,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_MTD_XIP=y @@ -39,6 +41,7 @@ CONFIG_SYSVIPC=y # CONFIG_UTS_NS is not set # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set +CONFIG_SYSFS_DEPRECATED=y # CONFIG_RELAY is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -78,7 +81,9 @@ CONFIG_KMOD=y # Block layer # CONFIG_BLOCK=y +# CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_LSF is not set # # IO Schedulers @@ -112,6 +117,7 @@ CONFIG_DEFAULT_IOSCHED="deadline" # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_IOP32X is not set # CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IOP13XX is not set # CONFIG_ARCH_IXP4XX is not set # CONFIG_ARCH_IXP2000 is not set # CONFIG_ARCH_IXP23XX is not set @@ -124,6 +130,8 @@ CONFIG_ARCH_PXA=y # CONFIG_ARCH_SHARK is not set # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set +# CONFIG_BOARD_IRQ_MAP_SMALL is not set +CONFIG_BOARD_IRQ_MAP_BIG=y CONFIG_DMABOUNCE=y # @@ -153,23 +161,29 @@ CONFIG_ARCH_H2200=y # CONFIG_MACH_BLUEANGEL is not set # CONFIG_MACH_HTCBEETLES is not set # CONFIG_MACH_HW6900 is not set +# CONFIG_MACH_HTCATHENA is not set # CONFIG_ARCH_AXIMX3 is not set # CONFIG_ARCH_AXIMX5 is not set +# CONFIG_MACH_X50 is not set # CONFIG_ARCH_ROVERP1 is not set # CONFIG_ARCH_ROVERP5P is not set # CONFIG_MACH_XSCALE_PALMLD is not set # CONFIG_MACH_T3XSCALE is not set +# CONFIG_MACH_RECON is not set # CONFIG_PXA_SHARPSL is not set # CONFIG_MACH_TRIZEPS4 is not set CONFIG_PXA25x=y -# CONFIG_SA1100_H3100 is not set -# CONFIG_SA1100_H3600 is not set -# CONFIG_SA1100_H3800 is not set # # Linux As Bootloader # # CONFIG_LAB is not set +CONFIG_PXA_IPAQ=y + +# +# XScale-based iPAQ +# +CONFIG_IPAQ_HANDHELD=y # # Processor Type @@ -188,20 +202,11 @@ CONFIG_CPU_CP15_MMU=y # CONFIG_ARM_THUMB=y # CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_IWMMXT is not set CONFIG_XSCALE_PMU=y # CONFIG_KEXEC is not set # -# Compaq/iPAQ Platforms -# -CONFIG_PXA_IPAQ=y - -# -# XScale-based iPAQ -# -CONFIG_IPAQ_HANDHELD=y - -# # Compaq/iPAQ Drivers # @@ -287,6 +292,7 @@ CONFIG_BINFMT_ELF=y CONFIG_PM=y # CONFIG_PM_LEGACY is not set # CONFIG_PM_DEBUG is not set +# CONFIG_DPM_DEBUG is not set # CONFIG_PM_SYSFS_DEPRECATED is not set CONFIG_APM=y @@ -333,6 +339,7 @@ CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set # # IP: Virtual Server Configuration @@ -363,24 +370,12 @@ CONFIG_BRIDGE_NETFILTER=y # Core Netfilter Configuration # # CONFIG_NETFILTER_NETLINK is not set +# CONFIG_NF_CONNTRACK_ENABLED is not set # CONFIG_NETFILTER_XTABLES is not set # # IP: Netfilter Configuration # -CONFIG_IP_NF_CONNTRACK=m -# CONFIG_IP_NF_CT_ACCT is not set -# CONFIG_IP_NF_CONNTRACK_MARK is not set -# CONFIG_IP_NF_CONNTRACK_EVENTS is not set -# CONFIG_IP_NF_CT_PROTO_SCTP is not set -CONFIG_IP_NF_FTP=m -CONFIG_IP_NF_IRC=m -# CONFIG_IP_NF_NETBIOS_NS is not set -# CONFIG_IP_NF_TFTP is not set -# CONFIG_IP_NF_AMANDA is not set -# CONFIG_IP_NF_PPTP is not set -# CONFIG_IP_NF_H323 is not set -# CONFIG_IP_NF_SIP is not set # CONFIG_IP_NF_QUEUE is not set # @@ -538,6 +533,7 @@ CONFIG_MTD_PARTITIONS=y # User Modules And Translation Layers # CONFIG_MTD_CHAR=m +CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set @@ -663,6 +659,7 @@ CONFIG_IDE_GENERIC=m # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=m +# CONFIG_SCSI_TGT is not set # CONFIG_SCSI_NETLINK is not set CONFIG_SCSI_PROC_FS=y @@ -683,6 +680,7 @@ CONFIG_CHR_DEV_SG=m # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set # # SCSI Transports @@ -867,6 +865,8 @@ CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_NEWTON=m # CONFIG_KEYBOARD_STOWAWAY is not set CONFIG_GPIO_KEYS=y +# CONFIG_GPIODEV_KEYS is not set +# CONFIG_GPIODEV_DIAGONAL is not set CONFIG_KEYBOARD_H2200=y # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set @@ -881,7 +881,7 @@ CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set # CONFIG_TOUCHSCREEN_TOUCHWIN is not set -CONFIG_TOUCHSCREEN_SAMCOP=y +# CONFIG_TOUCHSCREEN_UCB1400 is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_UINPUT=m @@ -914,8 +914,10 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_PXA=y CONFIG_SERIAL_PXA_CONSOLE=y CONFIG_SERIAL_PXA_COUNT=4 +# CONFIG_SERIAL_PXA_IR is not set CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_RS232_SERIAL is not set CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set @@ -940,10 +942,7 @@ CONFIG_HW_RANDOM=y # CONFIG_SA1100_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set - -# -# Ftape, the floppy tape device driver -# +# CONFIG_TIHTC is not set # # PCMCIA character devices @@ -1014,7 +1013,6 @@ CONFIG_W1_CON=y # 1-wire Bus Masters # # CONFIG_W1_MASTER_DS2482 is not set -# CONFIG_W1_SAMCOP is not set CONFIG_W1_DS1WM=y # @@ -1057,6 +1055,7 @@ CONFIG_HWMON=y # CONFIG_SENSORS_LM92 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_SMSC47M192 is not set # CONFIG_SENSORS_SMSC47B397 is not set @@ -1064,16 +1063,20 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83791D is not set # CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # CONFIG_SENSORS_W83627EHF is not set # CONFIG_HWMON_DEBUG_CHIP is not set # -# Hardware Monitoring - Battery +# Hardware Monitoring - external power and batteries # +CONFIG_EXTERNAL_POWER=y CONFIG_BATTERY=y -CONFIG_H2200_BATTERY=m +CONFIG_PDA_POWER=y +CONFIG_DS2760_BATTERY=y +# CONFIG_APM_POWER is not set # # L3 serial bus support @@ -1090,6 +1093,7 @@ CONFIG_SOC_MQ11XX=y # CONFIG_SOC_SAMCOP is not set CONFIG_SOC_HAMCOP=y CONFIG_SOC_SAMCOP_DMA=y +# CONFIG_SOC_SAMCOP_DMA_DEBUG is not set # CONFIG_HTC_ASIC2 is not set # CONFIG_HTC_ASIC3 is not set # CONFIG_HTC_ASIC3_DS1WM is not set @@ -1104,8 +1108,7 @@ CONFIG_SOC_SAMCOP_DMA=y # Multimedia Capabilities Port drivers # # CONFIG_MCP is not set -# CONFIG_ADC_ADS7846_SSP is not set -CONFIG_ADC_SAMCOP=y +# CONFIG_ADC is not set # CONFIG_TIFM_CORE is not set # @@ -1222,6 +1225,7 @@ CONFIG_SND_VERBOSE_PROCFS=y CONFIG_SND_H2200=y CONFIG_SND_PXA2xx_I2SOUND=y # CONFIG_SND_PXA2XX_AC97 is not set +# CONFIG_SND_RECON is not set # # PCMCIA devices @@ -1241,6 +1245,11 @@ CONFIG_SND_UDA1380=y # CONFIG_SOUND_PRIME is not set # +# HID Devices +# +CONFIG_HID=y + +# # USB support # CONFIG_USB_ARCH_HAS_HCD=y @@ -1279,6 +1288,7 @@ CONFIG_USB_ETH=m # CONFIG_USB_G_SERIAL is not set # CONFIG_USB_MIDI_GADGET is not set # CONFIG_USB_G_CHAR is not set +# CONFIG_USB_PXA2XX_GPIO is not set # # MMC/SD Card support @@ -1289,7 +1299,6 @@ CONFIG_MMC_BLOCK=y # CONFIG_MMC_PXA is not set # CONFIG_MMC_TIFM_SD is not set # CONFIG_MMC_TMIO is not set -CONFIG_MMC_SAMCOP=y # # Real Time Clock @@ -1414,7 +1423,6 @@ CONFIG_RAMFS=y # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set -# CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y @@ -1465,7 +1473,6 @@ CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set -# CONFIG_CODA_FS_OLD_API is not set CONFIG_AFS_FS=m CONFIG_RXRPC=m # CONFIG_9P_FS is not set @@ -1521,6 +1528,11 @@ CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # +# Distributed Lock Manager +# +# CONFIG_DLM is not set + +# # Profiling support # # CONFIG_PROFILING is not set @@ -1532,6 +1544,8 @@ CONFIG_NLS_UTF8=m CONFIG_ENABLE_MUST_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_DETECT_SOFTLOCKUP=y @@ -1548,15 +1562,12 @@ CONFIG_DEBUG_MUTEXES=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_FS is not set # CONFIG_DEBUG_VM is not set # CONFIG_DEBUG_LIST is not set CONFIG_FRAME_POINTER=y CONFIG_FORCED_INLINING=y -# CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_WAITQ is not set CONFIG_DEBUG_ERRORS=y # CONFIG_DEBUG_LL is not set @@ -1575,6 +1586,7 @@ CONFIG_CRYPTO_BLKCIPHER=m CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m @@ -1583,8 +1595,10 @@ CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_TGR192=m +# CONFIG_CRYPTO_GF128MUL is not set CONFIG_CRYPTO_ECB=m CONFIG_CRYPTO_CBC=m +# CONFIG_CRYPTO_LRW is not set CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m @@ -1609,6 +1623,7 @@ CONFIG_CRYPTO_CRC32C=m # # Library routines # +CONFIG_BITREVERSE=y CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set CONFIG_CRC32=y @@ -1616,3 +1631,4 @@ CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_PLIST=y +CONFIG_IOMAP_COPY=y diff --git a/arch/arm/mach-pxa/h2200/h2200.c b/arch/arm/mach-pxa/h2200/h2200.c index 7712ff8..32e0bc2 100644 --- a/arch/arm/mach-pxa/h2200/h2200.c +++ b/arch/arm/mach-pxa/h2200/h2200.c @@ -58,6 +58,8 @@ #include <asm/arch/h2200-gpio.h> #include <asm/arch/h2200-irqs.h> #include <asm/arch/h2200-init.h> +#include <linux/pda_power.h> +#include <linux/ds2760_battery.h> #include "../generic.h" @@ -260,6 +262,84 @@ static struct platform_pxa_serial_funcs h2200_hwuart_funcs = { .configure = h2200_hwuart_configure, }; +/* Battery door (lacks appropriate driver), taken from h2200_battery. */ + +#if 0 +static irqreturn_t h2200_battery_door_isr (int isr, void *data) +{ + int door_open = GET_H2200_GPIO(BATT_DOOR_N) ? 0 : 1; + + if (door_open) + printk(KERN_ERR "battery door opened!\n"); + else + printk(KERN_ERR "battery door closed\n"); + + return IRQ_HANDLED; +} + + /* Install an interrupt handler for battery door open/close. */ + set_irq_type(H2200_IRQ(BATT_DOOR_N), IRQT_BOTHEDGE); + request_irq(H2200_IRQ(BATT_DOOR_N), h2200_battery_door_isr, + SA_SAMPLE_RANDOM, "battery door", NULL); + +#endif + +/* Power */ + +static int h2200_is_ac_online(void) +{ + return !GET_H2200_GPIO(AC_IN_N); +} + +static void h2200_set_charge(int flags) +{ + SET_H2200_GPIO(CHG_EN, !!flags); + return; +} + +static struct pda_power_pdata h2200_power_pdata = { + .is_ac_online = h2200_is_ac_online, + .set_charge = h2200_set_charge, +}; + +static struct resource h2200_power_resourses[] = { + [0] = { + .name = "ac", + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | + IORESOURCE_IRQ_LOWEDGE, + .start = H2200_IRQ(AC_IN_N), + .end = H2200_IRQ(AC_IN_N), + }, +}; + +static struct platform_device h2200_power = { + .name = "pda-power", + .id = -1, + .resource = h2200_power_resourses, + .num_resources = ARRAY_SIZE(h2200_power_resourses), + .dev = { + .platform_data = &h2200_power_pdata, + }, +}; + +/* Battery */ + +static struct ds2760_platform_data ds2760_pdata = { + .battery_info = { + .name = "main-battery", + .main_battery = 1, + .voltage_max_design = 4400, + }, +}; + +static struct platform_device h2200_battery = { + .name = "ds2760-battery", + .id = -1, + .dev = { + .platform_data = &ds2760_pdata, + }, +}; + /***************************************************************************/ /* Initialisation */ /***************************************************************************/ @@ -430,14 +510,6 @@ static struct platform_device h2200_gpio_keys = { }, }; -static struct platform_device h2200_battery = { - .name = "h2200 battery", - .id = -1, - .dev = { - .parent = &h2200_hamcop.dev, - }, -}; - static struct platform_device h2200_buttons = { .name = "h2200 buttons", .id = -1, @@ -453,6 +525,7 @@ h2200_init (void) platform_device_register(&h2200_hamcop); platform_device_register(&h2200_gpio_keys); platform_device_register(&h2200_battery); + platform_device_register(&h2200_power); platform_device_register(&h2200_buttons); pxa_set_udc_info (&h2200_udc_mach_info); pxa_set_ficp_info(&h2200_ficp_platform_data); -- 1.5.1.1-dirty |
|
|