26 Apr, 2012

1 commit


19 Apr, 2012

11 commits

  • * Only provide debugfs-relates ops when CONFIG_DEBUG_FS is enabled.
    * Implement pin_config_group_dbg_show op.
    * Implement pin_config_config_dbg_show op.

    Signed-off-by: Stephen Warren
    Acked-by: Linus Walleij

    Stephen Warren
     
  • Rather than having a single tegra-pinctrl driver that determines whether
    it's running on Tegra20 or Tegra30, instead have separate drivers for
    each that call into utility functions to implement the majority of the
    driver. This change is based on review feedback of the SPEAr pinctrl
    driver, which had originally copied to Tegra driver structure.

    This requires that the two drivers have unique names. Update a couple
    spots in arch/arm/mach-tegra for the name change.

    Signed-off-by: Stephen Warren
    Acked-by: Linus Walleij

    Stephen Warren
     
  • This adds a complete pinmux configuration to all Tegra20 device tree
    files. This allows removal of board-dt-tegra20.c's use of the pinmux
    board files, and the special device tree handling in board-pinmux.c.

    Signed-off-by: Stephen Warren
    Acked-by: Linus Walleij
    Acked-by: Olof Johansson

    Stephen Warren
     
  • This adds a minimal pinmux configuration to the Tegra Cardhu device
    tree. Initially, just the built-in eMMC and SD card slot are configured.

    Signed-off-by: Stephen Warren
    Acked-by: Olof Johansson <olof@lixom.net

    Stephen Warren
     
  • The pinctrl driver is now active and used by all boards. Remove the
    old pinmux driver.

    Signed-off-by: Stephen Warren
    Acked-by: Linus Walleij
    Acked-by: Olof Johansson

    Stephen Warren
     
  • * Rename old pinmux and new pinctrl platform driver and DT match table
    entries, so the new driver gets instantiated.
    * Re-write board-pinmux.c, so that it uses pinctrl APIs to configura the
    pinmux.
    * Re-write board-*-pinmux.c so that the pinmux configuration tables are
    in pinctrl format.

    Ventana's pin mux table needed some edits on top of the basic format
    conversion, since some mux options that were previously marked as
    reserved are now valid in the new pinctrl driver. Attempting to use the
    old reserved names will result in a failure. Specifically, groups lpw0,
    lpw2, lsc1, lsck, and lsda were changed from function rsvd4 to displaya,
    and group pta was changed from function rsvd2 to hdmi.

    All boards' pin mux tables needed some edits on top of the based format
    conversion, since function i2c was split into i2c1 (first general I2C
    controller) and i2cp (power I2C controller) to better align function
    definitions with HW blocks.

    Due to the split of mux tables into pure mux and pull/tristate tables,
    many entries in the separate Seaboard/Ventana tables could be merged
    into the common table, since the entries differed only in the portion
    in one of the tables, not both.

    Most pin groups allow configuration of mux, tri-state, and pull. However,
    some don't allow pull configuration, which is instead configured by new
    groups that only allow pull configuration. This is a reflection of the
    true HW capabilities, which weren't fully represented by the old pinmux
    driver. This required adding new pull table entries for those new groups,
    and setting many other entries' pull configuration to
    TEGRA_PINCONFIG_DONT_SET.

    Signed-off-by: Stephen Warren
    Acked-by: Linus Walleij
    Acked-by: Olof Johansson

    Stephen Warren
     
  • Recent pinctrl discussions concluded that gpiolib APIs should in fact do
    whatever is required to mux a GPIO onto pins, by calling pinctrl APIs if
    required. This change implements this for the Tegra GPIO driver, and removes
    calls to the Tegra-specific APIs from drivers and board files.

    Cc: Chris Ball
    Cc: linux-mmc@vger.kernel.org
    Signed-off-by: Stephen Warren
    Acked-by: Chris Ball # for sdhci-tegra.c
    Acked-by: Linus Walleij
    Acked-by: Olof Johansson

    Stephen Warren
     
  • Don't call gpio_request() or gpio_direction_input() for ISL29018_IRQ.
    This pin is only used as an IRQ, and hence no GPIO configuration should
    be necessary; the GPIO/IRQ driver should (and does) perform any required
    setup when the IRQ is requested.

    Signed-off-by: Stephen Warren
    Acked-by: Olof Johansson

    Stephen Warren
     
  • When a Tegra GPIO is used as an IRQ, it should be enabled as a GPIO (so
    the pinmux module isn't driving it as an output) and configured as a GPIO
    input (so the GPIO module isn't driving it as an output). Set this up
    automatically whenever an IRQ is requested, so that users of IRQs don't
    need to do this.

    Signed-off-by: Stephen Warren
    Acked-by: Olof Johansson

    Stephen Warren
     
  • Instead of having board files manually request and initialize USB VBUS
    GPIOs, fill in the USB driver's platform data and have it do it.

    Signed-off-by: Stephen Warren
    Acked-by: Olof Johansson

    Stephen Warren
     
  • Add a vbus_gpio field to platform data. This mirrors the device tree
    property nvidia,vbus-gpio. This makes the VBUS GPIO handling identical
    between booting with board files and device tree; the driver always does
    it.

    This removes the need for board files to request and initialize the GPIO
    early during their boot process, perhaps even before the GPIO driver is
    ready to process the request.

    Cc: Greg Kroah-Hartman
    Cc: Alan Stern
    Cc: linux-usb@vger.kernel.org
    Signed-off-by: Stephen Warren
    Acked-by: Olof Johansson

    Stephen Warren
     

18 Apr, 2012

24 commits

  • Pin name is more useful to users.

    After change, when cat pingroups in sysfs, it becomes:
    root@freescale /sys/kernel/debug/pinctrl/20e0000.iomuxc$ cat pingroups
    registered pin groups:
    group: uart4grp-1
    pin 219 (MX6Q_PAD_KEY_ROW0)
    pin 218 (MX6Q_PAD_KEY_COL0)

    group: usdhc4grp-1
    pin 305 (MX6Q_PAD_SD4_CMD)
    pin 306 (MX6Q_PAD_SD4_CLK)
    pin 315 (MX6Q_PAD_SD4_DAT0)
    pin 316 (MX6Q_PAD_SD4_DAT1)
    pin 317 (MX6Q_PAD_SD4_DAT2)
    pin 318 (MX6Q_PAD_SD4_DAT3)
    pin 319 (MX6Q_PAD_SD4_DAT4)
    pin 320 (MX6Q_PAD_SD4_DAT5)
    pin 321 (MX6Q_PAD_SD4_DAT6)
    pin 322 (MX6Q_PAD_SD4_DAT7)

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • Pin name is more useful to users.

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • These functions allow the driver core to automatically clean up any
    allocations made by drivers, thus leading to simplified drivers.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • When we compile pinctrl layer for platforms without CONFIG_PINCONF, we get
    following compilation errors:

    drivers/built-in.o: In function `pinctrl_show':
    linux-2.6/drivers/pinctrl/core.c:1116: undefined
    reference to `pinconf_show_setting'
    drivers/built-in.o: In function `pinctrl_maps_show':
    linux-2.6/drivers/pinctrl/core.c:1071: undefined
    reference to `pinconf_show_map'
    drivers/built-in.o: In function `pinctrl_init_device_debugfs':
    linux-2.6/drivers/pinctrl/core.c:1224: undefined
    reference to `pinconf_init_device_debugfs'
    make[1]: *** [.tmp_vmlinux1] Error 1

    This patch fixes this.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • Add a pinconf op so that pin controller drivers can decode their pin
    config settings for debugfs.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Only provide prototypes for pin{mux,conf}.c debugfs-related functions
    when both CONFIG_PIN* /and/ CONFIG_DEBUG_FS are enabled, otherwise
    provide static inlines.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • With the finalization of the external driver API and the device
    tree support, this subsystem is now mature and can be promoted to
    non-experimental status.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Implement pinctrl_ops dt_node_to_map() and dt_free_map(). These allow
    complete specification of the desired pinmux configuration using device
    tree.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Define a new binding for the Tegra pin controller, which is capable of
    defining all aspects of desired pin multiplexing and pin configuration.
    This is all based on the new common pinctrl bindings.

    Add Tegra30 binding based on Tegra20 binding.

    Add some basic stuff that was missing before:
    * How many and what reg property entries must be provided.
    * An example.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This places the file in the new location for all pin controller bindings.

    Also, rename the file using the full compatible value for easier
    avoidance of conflicts between multiple bindings.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The core pin controller bindings define:
    * The fact that pin controllers expose pin configurations as nodes in
    device tree.
    * That the bindings for those pin configuration nodes is defined by the
    individual pin controller drivers.
    * A standardized set of properties for client devices to define numbered
    or named pin configuration states, each referring to some number of the
    afore-mentioned pin configuration nodes.
    * That the bindings for the client devices determines the set of numbered
    or named states that must exist.

    Signed-off-by: Stephen Warren
    Acked-by: Shawn Guo
    Acked-by: Tony Lindgren
    Acked-by: Linus Walleij
    Acked-by: Simon Glass
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This patch adds macros of_property_for_each_u32() and
    of_property_for_each_string(), which iterate over an array of values
    within a device-tree property. Usage is for example:

    struct property *prop;
    const __be32 *p;
    u32 u;
    of_property_for_each_u32(np, "propname", prop, p, u)
    printk("U32 value: %x\n", u);

    struct property *prop;
    const char *s;
    of_property_for_each_string(np, "propname", prop, s)
    printk("String value: %s\n", s);

    Based on work by Rob Herring

    Cc: Grant Likely
    Signed-off-by: Stephen Warren
    Acked-by: Rob Herring
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • If drivers try to obtain pinctrl handles for a pin controller that
    has not yet registered to the subsystem, we need to be able to
    back out and retry with deferred probing. So let's return
    -EPROBE_DEFER whenever this location fails. Also downgrade the
    errors to info, maybe we will even set them to debug once the
    deferred probing is commonplace.

    Cc: Arnd Bergmann
    Reviewed-by: Mark Brown
    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This patch can avoid kernel oops in case the mux or config
    function is not supported by driver.

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • Do not use get_functions_count before checking.

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     
  • Most of the SoC drivers implement list_groups() and list_functions()
    routines for pinctrl and pinmux. These routines continue returning
    zero until the selector argument is greater than total count of
    available groups or functions.

    This patch replaces these list_*() routines with get_*_count()
    routines, which returns the number of available selection for SoC
    driver. pinctrl layer will use this value to check the range it can
    choose.

    This patch fixes all user drivers for this change. There are other
    routines in user drivers, which have checks to check validity of
    selector passed to them. It is also no more required and hence
    removed.

    Documentation updated as well.

    Acked-by: Stephen Warren
    Signed-off-by: Viresh Kumar
    [Folded in fix and fixed a minor merge artifact manually]
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • As long as there is no other non-const variable marked __initdata in the
    same compilation unit it doesn't hurt. If there were one however
    compilation would fail with

    error: $variablename causes a section type conflict

    because a section containing const variables is marked read only and so
    cannot contain non-const variables.

    Signed-off-by: Uwe Kleine-König
    Cc: Randy Dunlap
    Signed-off-by: Linus Walleij

    Uwe Kleine-König
     
  • Missed one group from the documentation when proofreading.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Linus Walleij

    Viresh Kumar
     
  • pinctrl/devicetree.c won't compile when !CONFIG_PINCTRL, since the
    pinctrl headers don't declare some types when !PINCTRL. Make sure
    pinctrl/Makefile only attempts to compile devicetree.c when OF &&
    PINCTRL.

    Acked-by: Dong Aisheng
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • During pinctrl_get(), if the client device has a device tree node, look
    for the common pinctrl properties there. If found, parse the referenced
    device tree nodes, with the help of the pinctrl drivers, and generate
    mapping table entries from them.

    During pinctrl_put(), free any results of device tree parsing.

    Acked-by: Dong Aisheng
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Most code assumes that the pinctrl ops are present. Validate this when
    registering a pinctrl driver. Remove the one place in the code that
    was checking whether one of these non-optional ops was present.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Macros in call ARRAY_SIZE(), the definition of
    which eventually calls BUILD_BUG_ON_ZERO(), which is defined in
    . Include that so that every .c file using the pinctrl macros
    doesn't have to do that itself.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The pinctrl_register_mappings is defined in core.c, so change the dependent
    macro from CONFIG_MUX to CONFIG_PINCTRL.

    The compile error message is:
    drivers/pinctrl/core.c:886: error: redefinition of 'pinctrl_register_mappings'
    include/linux/pinctrl/machine.h:160: note: previous definition of 'pinctrl_register_mappings' was here
    make[2]: *** [drivers/pinctrl/core.o] Error 1
    make[1]: *** [drivers/pinctrl] Error 2
    make: *** [drivers] Error 2

    Acked-by: Stephen Warren
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     

16 Apr, 2012

4 commits

  • Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "Nothing too disasterous, the biggest thing being the removal of the
    regulator support for vcore in the AMBA driver; only one SoC was using
    this and it got broken during the last merge window, which then
    started causing problems for other people. Mutual agreement was
    reached for it to be removed."

    * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
    ARM: 7386/1: jump_label: fixup for rename to static_key
    ARM: 7384/1: ThumbEE: Disable userspace TEEHBR access for !CONFIG_ARM_THUMBEE
    ARM: 7382/1: mm: truncate memory banks to fit in 4GB space for classic MMU
    ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpus
    ARM: 7383/1: nommu: populate vectors page from paging_init
    ARM: 7381/1: nommu: fix typo in mm/Kconfig
    ARM: 7380/1: DT: do not add a zero-sized memory property
    ARM: 7379/1: DT: fix atags_to_fdt() second call site
    ARM: 7366/3: amba: Remove AMBA level regulator support
    ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler
    ARM: 7368/1: fault.c: correct how the tsk->[maj|min]_flt gets incremented

    Linus Torvalds
     
  • The 'max' range needs to be unsigned, since the size of the user address
    space is bigger than 2GB.

    We know that 'count' is positive in 'long' (that is checked in the
    caller), so we will truncate 'max' down to something that fits in a
    signed long, but before we actually do that, that comparison needs to be
    done in unsigned.

    Bug introduced in commit 92ae03f2ef99 ("x86: merge 32/64-bit versions of
    'strncpy_from_user()' and speed it up"). On x86-64 you can't trigger
    this, since the user address space is much smaller than 63 bits, and on
    x86-32 it works in practice, since you would seldom hit the strncpy
    limits anyway.

    I had actually tested the corner-cases, I had only tested them on
    x86-64. Besides, I had only worried about the case of a pointer *close*
    to the end of the address space, rather than really far away from it ;)

    This also changes the "we hit the user-specified maximum" to return
    'res', for the trivial reason that gcc seems to generate better code
    that way. 'res' and 'count' are the same in that case, so it really
    doesn't matter which one we return.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • c5905afb0 ("static keys: Introduce 'struct static_key'...") renamed
    struct jump_label_key to struct static_key. Fixup ARM for this to
    eliminate these build warnings:

    include/linux/jump_label.h:113:2:
    warning: passing argument 1 of 'arch_static_branch' from incompatible pointer type
    include/asm/jump_label.h:17:82:
    note: expected 'struct jump_label_key *' but argument is of type 'struct static_key *'

    Signed-off-by: Rabin Vincent
    Signed-off-by: Russell King

    Rabin Vincent