1. 13 11月, 2012 1 次提交
  2. 12 11月, 2012 3 次提交
    • B
      pinctrl: sirf: enable the driver support new SiRFmarco SoC · d3e26f2f
      Barry Song 提交于
      The driver supports old up SiRFprimaII SoCs, this patch makes it support
      the new SiRFmarco as well.
      SiRFmarco, as a SMP SoC, adds new SIRFSOC_GPIO_PAD_EN_CLR registers, to
      disable GPIO pad, we should write 1 to the corresponding bit in the new
      CLEAR register instead of writing 0 to SIRFSOC_GPIO_PAD_EN.
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d3e26f2f
    • T
      pinctrl: mvebu: move to its own directory · 06763c74
      Thomas Petazzoni 提交于
      Like the spear platform, the mvebu platform has multiple files: one
      core file, and then one file per SoC family. More files will be added
      later, as support for mach-orion5x and mach-mv78xx0 SoCs is added to
      pinctrl-mvebu. For those reasons, having a separate subdirectory,
      drivers/pinctrl/mvebu/ makes sense, and it had already been suggested
      by Linus Wallej when the driver was originally submitted.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      06763c74
    • T
      pinctrl: mvebu: allow plat-orion architectures to use pinctrl-mvebu · 55d2e40d
      Thomas Petazzoni 提交于
      The mach-kirkwood and mach-dove architectures have not yet been
      integrated into the mach-mvebu directory, which should ultimately
      contain the support for all Marvell SoCs from the Engineering Business
      Unit.
      
      However, before this can happen, we need to let mach-kirkwood and
      mach-dove use the pinctrl-mvebu driver, which supports the kirkwood
      and dove SoC families. In order to do that, we make this driver
      available as soon as PLAT_ORION is selected, instead of using
      ARCH_MVEBU as a condition. In the long term, PLAT_ORION should
      disappear and be fully replaced by ARCH_MVEBU, but the plan is to make
      the migration step by step, by first having the existing mach-*
      directories for Marvell SoCs converge on several infrastructures,
      including the pinctrl one.
      
      Also, like the spear pinctrl driver, we put all pinctrl-mvebu Kconfig
      options under a if, in order to avoid having certain options
      (PINCTRL_DOVE, PINCTRL_KIRKWOOD, etc.) selecting an option
      (PINCTLR_MVEBU) which itself has a dependency (on ARCH_MVEBU). In this
      a construct, the dependency is in fact ignored due to the selects.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      55d2e40d
  3. 06 11月, 2012 1 次提交
    • A
      pinctrl: samsung and exynos need to depend on OF && GPIOLIB · 924da314
      Axel Lin 提交于
      This patch fixes below build error when !CONFIG_OF_GPIO.
      
        CC      drivers/pinctrl/pinctrl-samsung.o
      drivers/pinctrl/pinctrl-samsung.c: In function 'samsung_pinctrl_parse_dt_pins':
      drivers/pinctrl/pinctrl-samsung.c:557:19: warning: unused variable 'prop' [-Wunused-variable]
      drivers/pinctrl/pinctrl-samsung.c: In function 'samsung_gpiolib_register':
      drivers/pinctrl/pinctrl-samsung.c:797:5: error: 'struct gpio_chip' has no member named 'of_node'
      make[2]: *** [drivers/pinctrl/pinctrl-samsung.o] Error 1
      make[1]: *** [drivers/pinctrl] Error 2
      make: *** [drivers] Error 2
      
      The samsung pinctrl driver supports only device tree enabled
      platforms. Thus make PINCTRL_SAMSUNG depend on OF && GPIOLIB.
      
      The reason to depend on GPIOLIB is CONFIG_OF_GPIO only available
      when GPIOLIB is selected.
      
      Since PINCTRL_EXYNOS4 select PINCTRL_SAMSUNG, thus also make
      PINCTRL_EXYNOS4 depend on OF && GPIOLIB.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      924da314
  4. 13 10月, 2012 1 次提交
  5. 01 10月, 2012 1 次提交
    • S
      pinctrl: add bcm2835 driver · e1b2dc70
      Simon Arlott 提交于
      The BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
      controller, and pinmux/control device.
      
      Original driver by Simon Arlott.
      Rewrite including GPIO chip device by Chris Boot.
      
      Upstreaming changes by Stephen Warren:
      * Wrote DT binding documentation.
      * Changed brcm,function to an integer to more directly match the
        datasheet, and to match brcm,pins being an integer.
      * Implemented pull-up/down pin config.
      * Removed read-only DT property and related code. The restriction this
        implemented are driven by the board, not the GPIO HW block, so don't
        really make sense of a HW block binding, were in general incomplete
        (since they could only know about the few pins hard-coded into the
        Raspberry Pi B board design and not the uncommitted GPIOS), and are
        better represented simply by not writing incorrect data into pin
        configuration nodes.
      * Don't set GPIO_IN function select in gpio_request_enable() to avoid
        glitches; defer this to gpio_set_direction(). Consequently, removed
        empty bcm2835_pmx_gpio_request_enable().
      * Simplified enabled_irq_map[]; make it explicitly 1 entry per bank.
      * Lifted use of enabled_irq_map[] outside the per-interrupt loop in
        IRQ handler, thus fixing an issue where the code was indexing into
        enabled_irq_map[] by intra-bank GPIO ID, not global GPIO ID.
      * Removed locking in IRQ handler, since all other code uses
        spin_lock_irqsave() and so guarantees it doesn't run concurrently
        with the handler.
      * Moved duplicated BUILD_BUG_ON()s into probe(). Also check size of
        bcm2835_gpio_pins[].
      * Remove range-checking from bcm2835_pctl_get_groups_count() since we've
        decided to trust the pinctrl core.
      * Made bcm2835_pmx_gpio_disable_free() call bcm2835_pinctrl_fsel_set()
        directly for simplicity.
      * Fixed body of dt_free_map() to match latest dt_node_to_map().
      * Removed GPIO ownership check from bcm2835_pmx_enable() since the pinctrl
        core owns doing this.
      * Made irq_chip and pinctrl_gpio_range .name == MODULE_NAME so it's more
        descriptive.
      * Simplified remove(); removed call to non-existent
        pinctrl_remove_gpio_range(), remove early return on error.
      * Don't force gpiochip's base to 0. Set gpio_range.base to gpiochip's
        base GPIO number.
      * Error-handling cleanups in probe().
      * Switched to module_platform_driver() rather than open-coding.
      * Made pin, group, and function names lower-case.
      * s/broadcom/brcm/ in DT property names.
      * s/2708/2835/.
      * Fixed a couple minor checkpatch warnings, and other minor cleanup.
      Signed-off-by: NSimon Arlott <simon@fire.lp0.eu>
      Signed-off-by: NChris Boot <bootc@bootc.net>
      Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e1b2dc70
  6. 22 9月, 2012 5 次提交
  7. 13 9月, 2012 2 次提交
  8. 07 9月, 2012 2 次提交
  9. 03 9月, 2012 3 次提交
  10. 15 7月, 2012 1 次提交
  11. 04 7月, 2012 1 次提交
  12. 21 5月, 2012 2 次提交
  13. 15 5月, 2012 1 次提交
  14. 11 5月, 2012 3 次提交
    • L
      pinctrl/nomadik: implement pin configuration · d41af627
      Linus Walleij 提交于
      This implements the pin configuration interface for the
      Nomadik pin controller.
      
      As part of the exercise we add a bit in the pin_cfg_t for
      the Nomadik pinctrl driver that indicates if the pin should
      be forced into GPIO mode. This is not done to go behind the
      back of the GPIO subsystem, but to ensure that default modes
      can be set by hogs on boot and system suspend/resume states.
      It was used implicitly by the old code defining all config
      settings and modes in a single config word but we now have
      a split between pinmux and pinconf leading to the need to
      have this.
      
      We also add a bit for explicitly setting sleepmode of the
      pin. This was previously handled by custom calls with the
      _sleep() suffix, but we now have one single interface into
      the configuration so we replace this with a bit indicating
      that the pin shall be configured into sleep mode.
      
      Some of the configuration can be refactored later to use
      less custom fields on the pin_cfg_t but we are currently
      leaving the old function calls in place so we stay
      compatible.
      
      ChangeLog v1->v2:
      - Drop a hunk changing pinmuxing for GPIO and move it
        over to the preceding pinmux patch.
      Acked-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d41af627
    • L
      pinctrl/nomadik: implement pin multiplexing · dbfe8ca2
      Linus Walleij 提交于
      Implements basic pinmux for the Nomadik pin controller.
      
      The plan is to split the existing singular pin config interface
      nmk_config_pin(), nmk_config_pins(), that will configure muxing
      and other settings at the same time, into two interfaces
      by splitting the code in pinmux and pinctrl and eventually
      deleting the old interface and its helper functions when all
      users are gone.
      
      nmk_gpio_set_mode() and nmk_gpio_get_mode() are two older
      interfaces for just configuring muxing/altfunctions that
      will also be replaced in the end.
      
      We take some extra care to handle the glitch-avoidance here,
      but it is simpler now since there is only one altsetting per
      pingroup so we know immediately if we need to avoid altfunc
      C glitches for a certain group.
      
      As part of the makeover implement the .request() and .free()
      calls on the GPIO chips and have them call back into the
      pinctrl layer to reserve GPIOs.
      
      ChangeLog v1->v2:
      - Rebased on pinctrl-mergebase-20120418 so we get the latest
        driver infrastructure where function count is done by a fixed
        value and we can drop a few range checks since this is now
        handled by the core.
      - Include a GPIO muxing hunk erroneously part of the pin config
        patch.
      Acked-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      dbfe8ca2
    • L
      pinctrl/nomadik: basic Nomadik pinctrl interface · e98ea774
      Linus Walleij 提交于
      This adds a scratch pin control interface to the Nomadik pinctrl
      driver, and defines the pins and groups in the DB8500 ASIC. We
      define GPIO ranges to cover the pins exposed. The DB8500 has
      more pins than this but we restrict the driver to the pins that
      can be controlled from the combined GPIO and pin control hardware
      to begin with.
      
      ChangeLog v1->v2:
      - Base on the latest pinctrl development from
        pinctrl-mergebase-20120418 so we can get rid of legacy
        group count mechanism. Also drop the range checks for group
        index, this is handled by the core now.
      Acked-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e98ea774
  15. 02 5月, 2012 3 次提交
  16. 23 4月, 2012 1 次提交
  17. 18 4月, 2012 1 次提交
  18. 13 3月, 2012 2 次提交
    • L
      pinctrl: support pinconfig on the U300 · dc0b1aa3
      Linus Walleij 提交于
      This adds pin configuration support for the U300 driver pair,
      we can now read out the biasing and drive mode in debugfs and
      configure it using the new configuration API.
      
      ChangeLog v1->v2:
      - Migrate to pin config and generic pin config changes.
      ChangeLog v2->v3:
      - Adjust to generic pin config changes in v7 patch set.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      dc0b1aa3
    • L
      pinctrl: introduce generic pin config · 394349f7
      Linus Walleij 提交于
      This is a split-off from the earlier patch set which adds generic
      pin configuration for the pin controllers that want it. Since
      we may have a system with mixed generic and custom pin controllers,
      we pass a boolean in the pin controller ops vtable to indicate
      if it is generic.
      
      ChangeLog v1->v5:
      - Follow parent patch versioning number system.
      - Document the semantic meaning of return values from pin config
        get functions, so we can iterate over pins and check their
        properties from debugfs as part of the generic config code.
      - Use proper cast functions in the generic debugfs pin config
        file.
      - Expand generic config to optionally cover groups too.
      ChangeLog v5->v6:
      - Update to match underlying changes.
      ChangeLog v6->v7:
      - Drop DRIVE_OFF parameter, use bias high impedance for this
      - Delete argument for drive modes push-pull, od and os. These
        are now just state transitions.
      - Delete slew rate rising/falling due to discussions on on
        proper semantics
      - Drop config wakeup, struct irq_chip does this for now, add
        back if need be.
      - Set PIN_CONFIG_END to 0x7fff making room for custom config
        parameters from 0x8000 and up.
      - Prefix accessor functions with pinconf_
      394349f7
  19. 06 3月, 2012 1 次提交
  20. 02 2月, 2012 1 次提交
  21. 03 1月, 2012 4 次提交
    • L
      pinctrl: rename U300 and SIRF pin controllers · 3bece55a
      Linus Walleij 提交于
      For stringent order, rename the pinmux-* pin controllers to
      pinctrl-* and also rename the Kconfig symbols and in-kernel
      users.
      
      Cc: Rongjun Ying <Rongjun.Ying@csr.com>
      Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3bece55a
    • L
      pinctrl: add a pin config interface · ae6b4d85
      Linus Walleij 提交于
      This add per-pin and per-group pin config interfaces for biasing,
      driving and other such electronic properties. The details of passed
      configurations are passed in an opaque unsigned long which may be
      dereferences to integer types, structs or lists on either side
      of the configuration interface.
      
      ChangeLog v1->v2:
      - Clear split of terminology: we now have pin controllers, and
        those may support two interfaces using vtables: pin
        multiplexing and pin configuration.
      - Break out pin configuration to its own C file, controllers may
        implement only config without mux, and vice versa, so keep each
        sub-functionality of pin controllers separate. Introduce
        CONFIG_PINCONF in Kconfig.
      - Implement some core logic around pin configuration in the
        pinconf.c file.
      - Remove UNKNOWN config states, these were just surplus baggage.
      - Remove FLOAT config state - HIGH_IMPEDANCE should be enough for
        everyone.
      - PIN_CONFIG_POWER_SOURCE added to handle switching the power
        supply for the pin logic between different sources
      - Explicit DISABLE config enums to turn schmitt-trigger,
        wakeup etc OFF.
      - Update documentation to reflect all the recent reasoning.
      ChangeLog v2->v3:
      - Twist API around to pass around arrays of config tuples instead
        of (param, value) pairs everywhere.
      - Explicit drive strength semantics for push/pull and similar
        drive modes, this shall be the number of drive stages vs
        nominal load impedance, which should match the actual
        electronics used in push/pull CMOS or TTY totempoles.
      - Drop load capacitance configuration - I probably don't know
        what I'm doing here so leave it out.
      - Drop PIN_CONFIG_INPUT_SCHMITT_OFF, instead the argument zero to
        PIN_CONFIG_INPUT_SCHMITT turns schmitt trigger off.
      - Drop PIN_CONFIG_NORMAL_POWER_MODE and have a well defined
        argument to PIN_CONFIG_LOW_POWER_MODE to get out of it instead.
      - Drop PIN_CONFIG_WAKEUP_ENABLE/DISABLE and just use
        PIN_CONFIG_WAKEUP with defined value zero to turn wakeup off.
      - Add PIN_CONFIG_INPUT_DEBOUNCE for configuring debounce time
        on input lines.
      - Fix a bug when we tried to configure pins for pin controllers
        without pinconf support.
      - Initialized debugfs properly so it works.
      - Initialize the mutex properly and lock around config tampering
        sections.
      - Check the return value from get_initial_config() properly.
      ChangeLog v3->v4:
      - Export the pin_config_get(), pin_config_set() and
        pin_config_group() functions.
      - Drop the entire concept of just getting initial config and
        keeping track of pin states internally, instead ask the pins
        what state they are in. Previous idea was plain wrong, if the
        device cannot keep track of its state, the driver should do
        it.
      - Drop the generic configuration layout, it seems this impose
        too much restriction on some pin controllers, so let them do
        things the way they want and split off support for generic
        config as an optional add-on.
      ChangeLog v4->v5:
      - Introduce two symmetric driver calls for group configuration,
        .pin_config_group_[get|set] and corresponding external calls.
      - Remove generic semantic meanings of return values from config
        calls, these belong in the generic config patch. Just pass the
        return value through instead.
      - Add a debugfs entry "pinconf-groups" to read status from group
        configuration only, also slam in a per-group debug callback in
        the pinconf_ops so custom drivers can display something
        meaningful for their pins.
      - Fix some dangling newline.
      - Drop dangling #else clause.
      - Update documentation to match the above.
      ChangeLog v5->v6:
      - Change to using a pin name as parameter for the
        [get|set]_config() functions, as suggested by Stephen Warren.
        This is more natural as names will be what a developer has
        access to in written documentation etc.
      ChangeLog v6->v7:
      - Refactor out by-pin and by-name get/set functions, only expose
        the by-name functions externally, expose the by-pin functions
        internally.
      - Show supported pin control functionality in the debugfs
        pinctrl-devices file.
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ae6b4d85
    • L
      pinctrl/coh901: driver to request its pins · b4e3ac74
      Linus Walleij 提交于
      This makes the COH 901 driver request muxing of its GPIO pins
      from the pinmux-u300 driver using the standard API calls.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b4e3ac74
    • L
      pinctrl: move the U300 GPIO driver to pinctrl · ca402d37
      Linus Walleij 提交于
      This driver will be converted to a dual GPIO + pinctrl driver
      since it supports biasing and driving control options. Hopefully
      it can serve as an example.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ca402d37