From: Albert H. <he...@us...> - 2009-02-01 18:29:42
|
Update of /cvsroot/gc-linux/linux/drivers/misc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/misc Modified Files: Kconfig Makefile gcn-gqr.c gcn-mi.c gcn-mi.h Log Message: Merge 2.6.28. Also: - run checkpatch against the non-broken source code - add GPIO driver fixes - implement getgeo for the special block drivers - small fixes Index: gcn-gqr.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-gqr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-gqr.c 24 Feb 2008 18:05:32 -0000 1.3 +++ gcn-gqr.c 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,9 +2,9 @@ * drivers/misc/gcn-gqr.c * * Nintendo GameCube GQR driver - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Todd Jeffreys <to...@vo...> - * Copyright (C) 2007,2008 Albert Herranz + * Copyright (C) 2007,2008,2009 Albert Herranz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,10 +20,10 @@ #include <linux/ctype.h> #include <linux/sysctl.h> #include <linux/types.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static u32 gqr_values[8]; -static struct ctl_table_header *gqr_table_header = NULL; +static struct ctl_table_header *gqr_table_header; #define SPR_GQR0 912 #define SPR_GQR1 913 @@ -34,14 +34,14 @@ #define SPR_GQR6 918 #define SPR_GQR7 919 -#define MFSPR_CASE(i) case (i): *((u32*)table->data) = mfspr(SPR_GQR##i) -#define MTSPR_CASE(i) case (i): mtspr(SPR_GQR##i,*((u32*)table->data)) +#define MFSPR_CASE(i) case (i): (*((u32 *)table->data) = mfspr(SPR_GQR##i)) +#define MTSPR_CASE(i) case (i): mtspr(SPR_GQR##i, *((u32 *)table->data)) -static int proc_dogqr(ctl_table *table,int write,struct file *file, - void __user *buffer,size_t *lenp,loff_t *ppos) +static int proc_dogqr(ctl_table *table, int write, struct file *file, + void __user *buffer, size_t *lenp, loff_t *ppos) { int r; - + if (!write) { /* if they are reading, update the variable */ switch (table->data - (void *)gqr_values) { MFSPR_CASE(0); break; @@ -56,9 +56,9 @@ return -EFAULT; /* shouldn't happen */ } } - - r = proc_dointvec(table,write,file,buffer,lenp,ppos); - + + r = proc_dointvec(table, write, file, buffer, lenp, ppos); + if ((r == 0) && write) { /* if they are writing, update the reg */ switch (table->data - (void *)gqr_values) { MTSPR_CASE(0); break; @@ -73,7 +73,7 @@ return -EFAULT; /* shouldn't happen */ } } - + return r; } @@ -103,14 +103,15 @@ .ctl_name = CTL_UNNUMBERED, .procname = "gqr", .mode = 0555, - .child = gqr_members + .child = gqr_members, }, { .ctl_name = 0 } }; int __init gcngqr_init(void) { - if (!(gqr_table_header = register_sysctl_table(gqr_table))) { + gqr_table_header = register_sysctl_table(gqr_table); + if (!gqr_table_header) { printk(KERN_ERR "Unable to register GQR sysctl table\n"); return -ENOMEM; } Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/Kconfig,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Kconfig 15 Nov 2008 20:10:14 -0000 1.13 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.14 @@ -15,7 +15,7 @@ config ATMEL_PWM tristate "Atmel AT32/AT91 PWM support" - depends on AVR32 || ARCH_AT91 + depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 help This option enables device driver support for the PWM channels on certain Atmel prcoessors. Pulse Width Modulation is used for @@ -58,23 +58,23 @@ config GAMECUBE_GQR tristate "Nintendo GameCube/Wii Graphic Quantization Registers (GQR)" depends on GAMECUBE_COMMON - ---help--- + help This option enables device driver support for the Gekko/Broadway - processor's Graphic Quantization Registers. - These registers are used with the psql and psqst instrutions. + processors' Graphic Quantization Registers. + These registers are used with the psql and psqst instructions. The registers will appear in /proc/sys/gqr. config GAMECUBE_MI tristate "Nintendo GameCube Memory Interface (MI)" - depends on GAMECUBE && BROKEN + depends on GAMECUBE help If you say yes to this option, support will be included for the Memory Interface (MI) of the Nintendo GameCube. - + The MI allows one to setup up to four protected memory regions, catching invalid accesses to them. The MI catches out of bounds memory accesses too. - + If in doubt, say N here. config IBM_ASM @@ -167,6 +167,7 @@ depends on NEW_LEDS depends on BACKLIGHT_CLASS_DEVICE depends on SERIO_I8042 + depends on RFKILL select ACPI_WMI ---help--- This is a driver for newer Acer (and Wistron) laptops. It adds @@ -248,10 +249,20 @@ To compile this driver as a module, choose M here: the module will be called hp-wmi. +config ICS932S401 + tristate "Integrated Circuits ICS932S401" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Integrated Circuits + ICS932S401 clock control chips. + + This driver can also be built as a module. If so, the module + will be called ics932s401. + config MSI_LAPTOP tristate "MSI Laptop Extras" depends on X86 - depends on ACPI_EC + depends on ACPI depends on BACKLIGHT_CLASS_DEVICE ---help--- This is a driver for laptops built by MSI (MICRO-STAR @@ -267,10 +278,21 @@ If you have an MSI S270 laptop, say Y or M here. +config PANASONIC_LAPTOP + tristate "Panasonic Laptop Extras" + depends on X86 && INPUT && ACPI + depends on BACKLIGHT_CLASS_DEVICE + ---help--- + This driver adds support for access to backlight control and hotkeys + on Panasonic Let's Note laptops. + + If you have a Panasonic Let's note laptop (such as the R1(N variant), + R2, R3, R5, T2, W2 and Y2 series), say Y. + config COMPAL_LAPTOP tristate "Compal Laptop Extras" depends on X86 - depends on ACPI_EC + depends on ACPI depends on BACKLIGHT_CLASS_DEVICE ---help--- This is a driver for laptops built by Compal: @@ -431,6 +453,7 @@ depends on BACKLIGHT_CLASS_DEVICE depends on HWMON depends on EXPERIMENTAL + depends on RFKILL ---help--- This driver supports the Fn-Fx keys on Eee PC laptops. It also adds the ability to switch camera/wlan on/off. @@ -497,4 +520,6 @@ This option enables addition debugging code for the SGI GRU driver. If you are unsure, say N. +source "drivers/misc/c2port/Kconfig" + endif # MISC_DEVICES Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 15 Nov 2008 20:10:14 -0000 1.9 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.10 @@ -14,6 +14,7 @@ obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o obj-$(CONFIG_HP_WMI) += hp-wmi.o +obj-$(CONFIG_ICS932S401) += ics932s401.o obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o @@ -23,6 +24,7 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o +obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o @@ -30,6 +32,6 @@ obj-$(CONFIG_SGI_XP) += sgi-xp/ obj-$(CONFIG_SGI_GRU) += sgi-gru/ obj-$(CONFIG_HP_ILO) += hpilo.o +obj-$(CONFIG_C2PORT) += c2port/ obj-$(CONFIG_GAMECUBE_GQR) += gcn-gqr.o obj-$(CONFIG_GAMECUBE_MI) += gcn-mi.o - Index: gcn-mi.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-mi.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-mi.h 15 Nov 2008 20:10:14 -0000 1.3 +++ gcn-mi.h 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,8 +2,8 @@ * drivers/misc/gcn-mi.h * * Nintendo GameCube Memory Interface driver - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2004,2005,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2004,2005,2008,2009 Albert Herranz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Index: gcn-mi.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-mi.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gcn-mi.c 26 Mar 2008 20:15:20 -0000 1.8 +++ gcn-mi.c 1 Feb 2009 18:29:35 -0000 1.9 @@ -2,8 +2,8 @@ * drivers/misc/gcn-mi.c * * Nintendo GameCube Memory Interface (MI) driver. - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2004,2005,2007,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2004,2005,2007,2008,2009 Albert Herranz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -21,14 +21,9 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/proc_fs.h> -#include <asm/io.h> +#include <linux/io.h> #include "gcn-mi.h" -#ifdef CONFIG_PPC_MERGE -#include <platforms/embedded6xx/gamecube.h> -#else -#include <platforms/gamecube.h> -#endif #define MI_IRQ 7 @@ -63,7 +58,7 @@ unsigned long faults[MI_MAX_REGIONS+1]; unsigned long last_address; unsigned long last_address_faults; - spinlock_t lock; + spinlock_t lock; #ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_file; #endif @@ -74,35 +69,12 @@ #define DRV_MODULE_NAME "gcn-mi" #define DRV_DESCRIPTION "Nintendo GameCube Memory Interface driver" #define DRV_AUTHOR "Albert Herranz" - + #define PFX DRV_MODULE_NAME ": " #define mi_printk(level, format, arg...) \ printk(level PFX format , ## arg) - -/** - * - */ -static int mi_setup_default_regions(void) -{ - int retval = 0; - -#ifndef MODULE -#ifdef CONFIG_KEXEC - retval = gcn_mi_region_protect(GCN_PRESERVE_TO, GCN_PRESERVE_TO + - PAGE_ALIGN(GCN_PRESERVE_SIZE), MI_PROT_RO); - if (retval < 0) { - mi_printk(KERN_ERR, "unable to protect" - " kexec reserved memory\n"); - } -#endif /* CONFIG_KEXEC */ - -#endif /* MODULE */ - - return retval; -} - -/** +/* * */ static irqreturn_t mi_handler(int this_irq, void *data) @@ -120,9 +92,9 @@ cause = in_be16(MI_ICR); /* a fault was detected in some of the registered regions */ - if ( (cause & 0xf) != 0) { + if ((cause & 0xf) != 0) { for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (cause & (1 << region)) != 0 ) { + if ((cause & (1 << region)) != 0) { priv->faults[region]++; mi_printk(KERN_INFO, "bad access on region #%d" " at 0x%lx\n", region, address); @@ -131,7 +103,7 @@ } /* a fault was detected out of any registered region */ - if ( (cause & (1 << 4)) != 0 ) { + if ((cause & (1 << 4)) != 0) { priv->faults[MI_MAX_REGIONS]++; if (address == priv->last_address) { priv->last_address_faults++; @@ -158,7 +130,7 @@ } #ifdef CONFIG_PROC_FS -/** +/* * */ static int mi_proc_read(char *page, char **start, @@ -171,7 +143,7 @@ len = sprintf(page, "# <region> <faults>\n"); for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (priv->regions_bitmap & (1<<region)) != 0 ) { + if ((priv->regions_bitmap & (1<<region)) != 0) { len += sprintf(page+len, "%d\t%lu\n", region, priv->faults[region]); } @@ -184,7 +156,7 @@ #endif /* CONFIG_PROC_FS */ -/** +/* * */ static int mi_setup_irq(struct mi_private *priv) @@ -192,16 +164,15 @@ int retval; retval = request_irq(priv->irq, mi_handler, 0, DRV_MODULE_NAME, priv); - if (retval) { + if (retval) mi_printk(KERN_ERR, "request of irq%d failed\n", priv->irq); - } else { + else out_be16(MI_IMR, (1<<4)); /* do not mask all MI interrupts */ - } return retval; } -/** +/* * */ static int mi_probe(struct device *device, struct resource *mem, int irq) @@ -243,7 +214,6 @@ #endif /* CONFIG_PROC_FS */ mi_private = priv; - mi_setup_default_regions(); return 0; @@ -254,7 +224,7 @@ return retval; } -/** +/* * */ static void mi_shutdown(struct mi_private *priv) @@ -262,7 +232,7 @@ gcn_mi_region_unprotect_all(); } -/** +/* * */ static void mi_remove(struct mi_private *priv) @@ -281,7 +251,7 @@ mi_private = NULL; } -/** +/* * */ static int __init mi_drv_probe(struct device *device) @@ -294,13 +264,13 @@ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) return -ENODEV; - - mi_printk(KERN_INFO, "%s\n", DRV_DESCRIPTION); + + mi_printk(KERN_INFO, "%s\n", DRV_DESCRIPTION); return mi_probe(device, mem, irq); } -/** +/* * */ static int mi_drv_remove(struct device *device) @@ -315,7 +285,7 @@ return 0; } -/** +/* * */ static void mi_drv_shutdown(struct device *device) @@ -337,7 +307,7 @@ static struct resource mi_resources[] = { [0] = { .start = MI_BASE, - .end = MI_BASE + MI_SIZE -1, + .end = MI_BASE + MI_SIZE - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -354,7 +324,7 @@ .resource = mi_resources, }; -/** +/* * */ static int __init mi_init(void) @@ -362,14 +332,13 @@ int retval = 0; retval = driver_register(&mi_device_driver); - if (!retval) { + if (!retval) retval = platform_device_register(&mi_device); - } return retval; } -/** +/* * */ static void __exit mi_exit(void) @@ -382,9 +351,9 @@ module_exit(mi_exit); -/* Exported symbols */ +/* public interface */ -/** +/* * */ int gcn_mi_region_protect(unsigned long physlo, unsigned long physhi, int type) @@ -399,16 +368,14 @@ if (type < MI_PROT_NONE || type > MI_PROT_RW) return -EINVAL; - if ( (physlo & ~MI_PAGE_MASK) != 0 || (physhi & ~MI_PAGE_MASK) != 0 ) { + if ((physlo & ~MI_PAGE_MASK) != 0 || (physhi & ~MI_PAGE_MASK) != 0) return -EINVAL; - } free_regions = MI_MAX_REGIONS - priv->nr_regions; - if (free_regions <= 0) { + if (free_regions <= 0) return -ENOMEM; - } for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (priv->regions_bitmap & (1<<region)) == 0 ) + if ((priv->regions_bitmap & (1<<region)) == 0) break; } if (region >= MI_MAX_REGIONS) @@ -432,7 +399,7 @@ return region; } -/** +/* * */ int gcn_mi_region_unprotect(int region) @@ -444,12 +411,13 @@ if (region < 0 || region > MI_MAX_REGIONS) return -EINVAL; - + out_be16(MI_IMR, in_be16(MI_IMR) & ~(1 << region)); out_be32(MI_PROT_REGION0 + 4*region, 0); - out_be16(MI_PROT_TYPE, in_be16(MI_PROT_TYPE) | (MI_PROT_RW << 2*region)); + out_be16(MI_PROT_TYPE, + in_be16(MI_PROT_TYPE) | (MI_PROT_RW << 2*region)); - if ( (priv->regions_bitmap & (1<<region)) != 0 ) + if ((priv->regions_bitmap & (1<<region)) != 0) mi_printk(KERN_INFO, "region #%d unprotected\n", region); priv->regions_bitmap &= ~(1 << region); @@ -458,7 +426,7 @@ return 0; } -/** +/* * */ void gcn_mi_region_unprotect_all(void) @@ -466,12 +434,10 @@ int region; out_be16(MI_IMR, 0); - for (region = 0; region < MI_MAX_REGIONS; region++) { + for (region = 0; region < MI_MAX_REGIONS; region++) gcn_mi_region_unprotect(region); - } } MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); - |