19 Apr, 2008

28 commits

  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • This is partial because mainstone's keypad is really special, some of
    the keys like '1', '2', ... are actually connected to two row/column
    juntions, thus pressing '1' is equivalent to pressing 'A' & 'H'.

    This is really brain damanged since it makes distinguishing between
    pressing '1' and multiple keys pressing of 'A' & 'H' difficult.

    So these special keys are not supported for the time being.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • also update the clk definitions in pxa27x and pxa3xx.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • NOTE: currently don't know if the key code of KEY_SUSPEND is fit for
    such usage.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Changes include:

    1. rename MFP_LPM_WAKEUP_ENABLE into MFP_LPM_CAN_WAKEUP to indicate
    the board capability of this pin to wakeup the system

    2. add gpio_set_wake() and keypad_set_wake() to allow dynamically
    enable/disable wakeup from GPIOs and keypad GPIO

    * these functions are currently kept in mfp-pxa2xx.c due to their
    dependency to the MFP configuration

    3. pxa2xx_mfp_config() only gives early warning if MFP_LPM_CAN_WAKEUP
    is set on incorrect pins

    So that the GPIO's wakeup capability is now decided by the following:

    a) processor's capability: (only those GPIOs which have dedicated
    bits within PWER/PRER/PFER can wakeup the system), this is
    initialized by pxa{25x,27x}_init_mfp()

    b) board design decides:
    - whether the pin is designed to wakeup the system (some of
    the GPIOs are configured as other functions, which is not
    intended to be a wakeup source), by OR'ing the pin config
    with MFP_LPM_CAN_WAKEUP

    - which edge the pin is designed to wakeup the system, this
    may depends on external peripherals/connections, which is
    totally board specific; this is indicated by MFP_LPM_EDGE_*

    c) the corresponding device's (most likely the gpio_keys.c) wakeup
    attribute:

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • 1. the following code to configure PGSRx is no way portable and
    intuitive:

    - PGSR0 = 0x00008800;
    - PGSR1 = 0x00000002;
    - PGSR2 = 0x0001FC00;
    - PGSR3 = 0x00001F81;

    this is removed as low power state has already been encoded in
    the pin configuration definitions.

    Note: there is no specific reason for some of the GPIOs to drive
    high in low power mode as indicated by the above setting, those
    bits are ignored, and the result is validated to work.

    2. the following code to configure GPIO wakeup is removed as this
    is now totally handled by pxa2xx_mfp_config():

    - PWER = 0xC0000002;
    - PRER = 0x00000002;
    - PFER = 0x00000002;

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • for use by other platforms

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Pin configuration on pxa{25x,27x} has now separated from generic GPIO
    into dedicated mfp-pxa2xx.c by this patch. The name "mfp" is borrowed
    from pxa3xx and is used here to alert the difference between the two
    concepts: pin configuration and generic GPIOs. A GPIO can be called
    a "GPIO" _only_ when the corresponding pin is configured so.

    A pin configuration on pxa{25x,27x} is composed of:

    - alternate function selection (or pin mux as commonly called)
    - low power state or sleep state
    - wakeup enabling from low power mode

    The following MFP_xxx bit definitions in mfp.h are re-used:

    - MFP_PIN(x)
    - MFP_AFx
    - MFP_LPM_DRIVE_{LOW, HIGH}
    - MFP_LPM_EDGE_*

    Selecting alternate function on pxa{25x, 27x} involves configuration
    of GPIO direction register GPDRx, so a new bit and MFP_DIR_{IN, OUT}
    are introduced. And pin configurations are defined by the following
    two macros:

    - MFP_CFG_IN : for input alternate functions
    - MFP_CFG_OUT : for output alternate functions

    Every configuration should provide a low power state if it configured
    as output using MFP_CFG_OUT(). As a general guideline, the low power
    state should be decided to minimize the overall power dissipation. As
    an example, it is better to drive the pin as high level in low power
    mode if the GPIO is configured as an active low chip select.

    Pins configured as GPIO are defined by MFP_CFG_IN(). This is to avoid
    side effects when it is firstly configured as output. The actual
    direction of the GPIO is configured by gpio_direction_{input, output}

    Wakeup enabling on pxa{25x, 27x} is actually GPIO based wakeup, thus
    the device based enable_irq_wake() mechanism is not applicable here.

    E.g. invoking enable_irq_wake() with a GPIO IRQ as in the following
    code to enable OTG wakeup is by no means portable and intuitive, and
    it is valid _only_ when GPIO35 is configured as USB_P2_1:

    enable_irq_wake( gpio_to_irq(35) );

    To make things worse, not every GPIO is able to wakeup the system.
    Only a small number of them can, on either rising or falling edge,
    or when level is high (for keypad GPIOs).

    Thus, another new bit is introduced to indicate that the GPIO will
    wakeup the system:

    - MFP_LPM_WAKEUP_ENABLE

    The following macros can be used in platform code, and be OR'ed to
    the GPIO configuration to enable its wakeup:

    - WAKEUP_ON_EDGE_{RISE, FALL, BOTH}
    - WAKEUP_ON_LEVEL_HIGH

    The WAKEUP_ON_LEVEL_HIGH is used for keypad GPIOs _only_, there is
    no edge settings for those GPIOs.

    These WAKEUP_ON_* flags OR'ed on wrong GPIOs will be ignored in case
    that platform code author is careless enough.

    The tradeoff here is that the wakeup source is fully determined by
    the platform configuration, instead of enable_irq_wake().

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • two reasons:
    1. GPIO namings and their mode definitions are conceptually not part
    of the PXA register definitions

    2. this is actually a temporary move in the transition of PXA2xx to
    use MFP-alike APIs (as what PXA3xx is now doing), so that legacy
    code will still work and new code can be added in step by step

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • MFP configurations after resume should be done before the GPIO registers
    are restored. Move the mfp sysdev registeration to the same place where
    GPIO and IRQ sysdev(s) are registered to better control the order.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • The main issue here is that pxa3xx does not have GAFRx registers,
    access directly to these registers should be avoided for pxa3xx:

    1. introduce __gpio_is_occupied() to indicate the GAFRx and GPDRx
    registers are already configured on pxa{25x,27x} while returns
    0 always on pxa3xx

    2. pxa_gpio_mode(gpio | GPIO_IN) is replaced directly with assign-
    ment of GPDRx, the side effect of this change is that the pin
    _must_ be configured before use, pxa_gpio_irq_type() will not
    change the pin to GPIO, as this restriction is sane, esp. with
    the new MFP framework

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • To further clean up the GPIO and IRQ structure:

    1. pxa_init_irq_gpio() and pxa_init_gpio() combines into a single
    function pxa_init_gpio()

    2. assignment of set_wake merged into pxa_init_{irq,gpio}() as
    an argument

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • This makes the code better organized and simplified a bit. The change
    will lose a bit of performance when performing IRQ ack/mask/unmask,but
    that's not too much after checking the result binary.

    This patch also removes the ugly #ifdef CONFIG_PXA27x .. #endif by
    carefully not to access those pxa{27x,3xx} specific registers, this
    is done by keeping an internal IRQ number variable. The pxa-regs.h
    is also modified so registers for IRQ > PXA_IRQ(31) are made public
    even if CONFIG_PXA{27x,3xx} isn't defined (for pxa25x's sake)

    The incorrect assumption in the original code that internal irq starts
    from 0 is also corrected by comparing with PXA_IRQ(0).

    "struct sys_device" for the IRQ are reduced into one single device on
    pxa{27x,3xx}.

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • by

    1. wrapping long lines and making comments tidy

    2. using IRQ_TYPE_* instead of migration macros __IRQT_*

    3. introduce a pr_debug() for the commented printk(KERN_DEBUG ...)
    stuff

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • by:

    1. introduce dedicated pxa_{mask,unmask}_low_gpio()

    2. remove set_irq_chip(IRQ_GPIO_2_x, ...) which has already been
    initialized in pxa_init_irq()

    3. introduce dedicated pxa_init_gpio_set_wake()

    Signed-off-by: eric miao
    Signed-off-by: Russell King

    eric miao
     
  • 1. As David Brownell suggests, using ffs() is going to make the loop
    a bit faster (by avoiding unnecessary shift and iteration)

    2. Russell suggested find_{first,next}_bit() being used with the
    gedr[] array

    Signed-off-by: eric miao
    Cc: David Brownell
    Signed-off-by: Russell King

    eric miao
     
  • Enhanced GPIO alternate functions descriptions,
    taken from Intel PXA270 Developers Manual.

    Signed-off-by: Robert Jarzmik
    Signed-off-by: Russell King

    Robert Jarzmik
     
  • Signed-off-by: Mark Brown
    Acked-by: Takashi Iwai
    Acked-by: eric miao
    Signed-off-by: Russell King

    Mark Brown
     
  • Signed-off-by: Mark Brown
    Acked-by: Takashi Iwai
    Acked-by: eric miao
    Signed-off-by: Russell King

    Mark Brown
     
  • The AC97 clock rate on PXA3xx is generated with a configurable divider
    from sys_pll.

    Signed-off-by: Mark Brown
    Acked-by: eric miao
    Signed-off-by: Russell King

    Mark Brown
     
  • Signed-off-by: Mark Brown
    Acked-by: eric miao
    Signed-off-by: Russell King

    Mark Brown
     
  • Expose control of the PXA3xx 13MHz CLK_POUT pin via the clock API

    Signed-off-by: Mark Brown
    Signed-off-by: Russell King

    Mark Brown
     
  • Signed-off-by: Russell King

    Russell King
     

26 Mar, 2008

4 commits


25 Mar, 2008

8 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    [PATCH] get stack footprint of pathname resolution back to relative sanity
    [PATCH] double iput() on failure exit in hugetlb
    [PATCH] double dput() on failure exit in tiny-shmem
    [PATCH] fix up new filp allocators
    [PATCH] check for null vfsmount in dentry_open()
    [PATCH] reiserfs: eliminate private use of struct file in xattr
    [PATCH] sanitize hppfs
    hppfs pass vfsmount to dentry_open()
    [PATCH] restore export of do_kern_mount()

    Linus Torvalds
     
  • While backporting 72dc67a69690288538142df73a7e3ac66fea68dc, a gfn_to_page()
    call was duplicated instead of moved (due to an unrelated patch not being
    present in mainline). This caused a page reference leak, resulting in a
    fairly massive memory leak.

    Fix by removing the extraneous gfn_to_page() call.

    Signed-off-by: Avi Kivity

    Avi Kivity
     
  • init_rmode_tss was forgotten during the conversion from mmap_sem to
    slots_lock.

    INFO: task qemu-system-x86:3748 blocked for more than 120 seconds.
    Call Trace:
    [] __down_read+0x86/0x9e
    [] do_page_fault+0x346/0x78e
    [] trace_hardirqs_on_thunk+0x35/0x3a
    [] error_exit+0x0/0xa9
    [] copy_user_generic_string+0x17/0x40
    [] :kvm:kvm_write_guest_page+0x3e/0x5f
    [] :kvm_intel:init_rmode_tss+0xa7/0xf9
    [] :kvm_intel:vmx_vcpu_reset+0x10/0x38a
    [] :kvm:kvm_arch_vcpu_setup+0x20/0x53
    [] :kvm:kvm_vm_ioctl+0xad/0x1cf
    [] __lock_acquire+0x4f7/0xc28
    [] vfs_ioctl+0x21/0x6b
    [] do_vfs_ioctl+0x252/0x26b
    [] sys_ioctl+0x3c/0x5e
    [] system_call_after_swapgs+0x7b/0x80

    Signed-off-by: Marcelo Tosatti
    Signed-off-by: Avi Kivity

    Marcelo Tosatti
     
  • Do not assume that a shadow mapping will always point to the same host
    frame number. Fixes crash with madvise(MADV_DONTNEED).

    [avi: move after first printk(), add another printk()]

    Signed-off-by: Marcelo Tosatti
    Signed-off-by: Avi Kivity

    Marcelo Tosatti
     
  • is_rmap_pte() doesn't take into account io ptes, which have the avail bit set.

    Signed-off-by: Avi Kivity

    Avi Kivity
     
  • The vmx hardware state restore restores the tss selector and base address, but
    not its length. Usually, this does not matter since most of the tss contents
    is within the default length of 0x67. However, if a process is using ioperm()
    to grant itself I/O port permissions, an additional bitmap within the tss,
    but outside the default length is consulted. The effect is that the process
    will receive a SIGSEGV instead of transparently accessing the port.

    Fix by restoring the tss length. Note that i386 had this working already.

    Closes bugzilla 10246.

    Signed-off-by: Avi Kivity

    Avi Kivity
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    USB: Fix cut-and-paste error in rtl8150.c
    USB: ehci: stop vt6212 bus hogging
    USB: sierra: add another device id
    USB: sierra: dma fixes
    USB: add support for Motorola ROKR Z6 cellphone in mass storage mode
    USB: isd200: fix memory leak in isd200_get_inquiry_data
    USB: pl2303: another product ID
    USB: new quirk flag to avoid Set-Interface
    USB: fix gadgetfs class request delegation

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
    driver core: debug for bad dev_attr_show() return value.
    UIO: add pgprot_noncached() to UIO mmap code

    Linus Torvalds