Commit Graph

20 Commits (4221a9918e38b7494cee341dda7b7b4bb8c04bde)

Author SHA1 Message Date
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Nicolas Pitre 2f82af08fc Nicolas Pitre has a new email address
Due to problems at cam.org, my nico@cam.org email address is no longer
valid.  FRom now on, nico@fluxnic.net should be used instead.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-15 09:37:12 -07:00
Dmitry Torokhov bd96f37895 Input: pxa27x_keypad - allow modifying keymap from userspace
Tested-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-09-10 22:11:34 -07:00
Dmitry Torokhov b0010911d5 Input: pxa27x_keypad - switch to using dev_pm_ops
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-26 11:20:52 -07:00
Dmitry Torokhov 52ec7752b4 Input: pxa27x_keypad - remove extra clk_disable
clk_disable() in remove method is not needed since we already
have clk_disable in pxa27x_keypad_close().

Also make sure the driver uses resource_size() and helpers from
include/input/matrix_keypad.h

Tested-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-22 22:33:47 -07:00
Russell King e0d8b13ae1 [ARM] pxa: don't pass a consumer clock name for devices with unique clocks
Where devices only have one consumer, passing a consumer clock ID
has no real benefit.  Remove it.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-11-27 12:38:23 +00:00
Russell King a09e64fbc0 [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
This just leaves include/asm-arm/plat-* to deal with.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:55:48 +01:00
Russell King 0f8469a54f [ARM] Eliminate useless includes of asm/mach-types.h
There are 43 includes of asm/mach-types.h by files that don't
reference anything from that file.  Remove these unnecessary
includes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-07 09:40:04 +01:00
Dmitry Torokhov 15439dd37f Merge branch 'for-linus' into next
Conflicts:

	drivers/input/mouse/appletouch.c
2008-06-17 12:02:44 -04:00
Eric Miao 39ab9ddeb3 Input: pxa27x_keypad - add wakeup support
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-06-02 11:20:55 -04:00
Antonio Ospite 471637a575 Input: pxa27x_keypad - miscellaneous fixes
1. Set input bits for direct keys codes
2. Set input bits for rotary encoder codes only if rotary
   encoder is enabled
3. Enable EV_REL only if rotary encoder is enabled and rel_codes
   are set up

Signed-off-by: Antonio Ospite <ao2@openezx.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-05-28 14:35:52 -04:00
Kay Sievers d7b5247bbc Input: add MODULE_ALIAS() to hotpluggable platform modules
Since 43cc71eed1, the platform modalias
is prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable
"input" platform drivers, to re-enable auto loading.

[dbrownell@users.sourceforge.net: more drivers, registration fixes]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-24 13:24:59 -04:00
Samuel Ortiz 688dad4f4c Input: pxa27x - fix keypad KPC macros
We want to mask (key_number - 1), not key_number. The current
implementation works fine for all values but the maximum one,
i.e. 8.

Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-03-20 09:48:14 -04:00
Eric Miao 76cb44e1a8 Input: pxa27x_keypad - add debounce_interval to the keypad platform data
Currently, only one debounce_interval is introduced for both direct and
matrix keys. This is true in most cases, although the keypad controller
supports different debounce for direct/matrix keys.

Some platforms do require this to be tuned, instead of the default
reset value of 100ms.

Rotary encoder will always use zero debounce time for now to achieve
certain sensitivity.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:59:23 -05:00
Eric Miao 9c60debd2a Input: pxa27x_keypad - use device resources for I/O memory mapping and IRQ
1. use ioremap() for registers access, this improves the portability
   of the driver (e.g. same IP on different processor with different
   I/O memory range), and make it possible to remove those registers
   definition in pxa-regs.h as PXA is undergoing a clean-up of that
   header file

2. use device specific IRQ instead of hardcoded IRQ_KEYPAD, same
   reason as above

3. clean up the error handling path in _probe()

4. remove DRIVER_NAME and use pdev->name when necessary, we don't
   actually need a constant string literals

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:59:15 -05:00
Eric Miao 62059d9e91 Input: pxa27x_keypad - enable rotary encoders and direct keys
1. Rotary encoder events can be configured either as relative events
   as the legacy code does or as any specified key code, this is
   useful on some platform which uses the rotary keys as
   KEY_{UP/DOWN/LEFT/RIGHT}

2. Add support for direct keys, the corresponding keycodes for each
   direct key can now be specified within the platform data

3. Remove the direct/rotary key detection code from the IRQ handler
   to dedicated functions to improve readability

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:59:03 -05:00
Eric Miao d7416f9eaa Input: pxa27x_keypad - introduce pxa27x_keypad_config()
Introduce pxa27x_keypad_config() for keypad registers configuration
and remove the reg_kpc, reg_kprec from platform data structure
so that configurations of keypad registers can be centralized to a
single function.

It can also be re-used when resuming.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:58:52 -05:00
Eric Miao 1814db6969 Input: pxa27x_keypad - introduce driver structure and use KEY() to define matrix keys
1. Introduce the "struct pxa27x_keypad" structure for driver specific
    information, such as "struct clk", generated matrix key codes and
    so on

 2. Use KEY() macro to define matrix keys, instead of original 8x8 map
    this makes definition easier with keypad where keys are sparse

 3. Keep a generated array in "struct pxa27x_keypad" for fast lookup

 4. Separate the matrix scan into a dedicated function for readability
    and report only those keys whose state has been changed, instead
    of report all states

 5. Make use of KPAS to decide the faster path if only one key has been
    detected

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:58:37 -05:00
Eric Miao 1a1cd739a4 Input: pxa27x_keypad - remove pin configuration from the driver
The pin configurations will slowly be moved to the board specific code
at initialization thus to make the driver more generic.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:58:00 -05:00
Eric Miao 0e5f11aa80 Input: pxa27x_keypad - rename the driver (was pxa27x_keyboard)
The controller should really be called keypad, and also align
the naming of functions and structures to use "pxa27x_keypad"
as prefix, instead of "pxakbd".

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-31 00:56:46 -05:00