1. 03 1月, 2012 19 次提交
    • S
      arm/u300: don't use PINMUX_MAP_PRIMARY* · 528b7830
      Stephen Warren 提交于
      The next patch will remove these macros.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      528b7830
    • S
      pinctrl: implement PINMUX_MAP_SYS_HOG · 1ddb6ff0
      Stephen Warren 提交于
      This is the same as PINMUX_MAP_PRIMARY_SYS_HOG, except that it allows
      you to specify a particular control device.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1ddb6ff0
    • 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: u300-pinmux: register proper GPIO ranges · f812f0f5
      Linus Walleij 提交于
      This register the actual GPIO ranges used by the COH901XXX GPIO
      driver.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f812f0f5
    • 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
    • L
      ARM: u300: localize GPIO assignments · dd68acc7
      Linus Walleij 提交于
      Move the GPIO assignments for the U300 variants down to a local
      header file in the mach-u300 directory. There is no point in
      broadcasting this across the entire kernel.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      dd68acc7
    • L
      pinctrl: make it possible to add multiple maps · 59b099b0
      Linus Walleij 提交于
      Since we now anyway make a copy of the platform-supplied pinmux
      map, we can just as well make it possible to call the function
      adding maps several times, so as to simplify cases (as PXA) where
      several sets of disparate mappings need to be added depending on
      target platform.
      Acked-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Acked-by: NArnd Bergmann <arnd@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      59b099b0
    • L
      pinctrl: make a copy of pinmux map · 97607d15
      Linus Walleij 提交于
      This makes a deep copy of the pinmux function map instead of
      keeping the copy supplied from the platform around. This makes
      it possible to tag the platforms map with __initdata as is also
      done as part of this patch.
      
      Rationale: a certain target platform (PXA) has numerous
      pinmux maps, many of which will be lying around unused after
      boot in a multi-platform binary. Instead, deep-copy the one
      we're going to use and tag them all __initdata so they go away
      after boot.
      
      ChangeLog v1->v2:
      - Fixup the deep copy, missed a few items on the struct,
        plus mark bool member non-const since we're making runtime
        copies if this stuff now.
      ChangeLog v2->v3:
      - Make a shallow copy (just copy the array of map structs)
        as Arnd noticed, string constants never get discarded by the
        kernel anyway, so these pointers may be safely copied over.
      Reviewed-by: NArnd Bergmann <arnd.bergmann@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      97607d15
    • L
      pinctrl: GPIO direction support for muxing · 542e704f
      Linus Walleij 提交于
      When requesting a single GPIO pin to be muxed in, some controllers
      will need to poke a different value into the control register
      depending on whether the pin will be used for GPIO output or GPIO
      input. So create pinmux counterparts to gpio_direction_[input|output]
      in the pinctrl framework.
      
      ChangeLog v1->v2:
      - This also amends the documentation to make it clear the this
        function and associated machinery is *ONLY* intended as a backend
        to gpiolib machinery, not for everyone and his dog to start playing
        around with pins.
      ChangeLog v2->v3:
      - Don't pass an argument to the common request function, instead
        provide pinmux_* counterparts to the gpio_direction_[input|output]
        calls, simpler and anyone can understand it.
      ChangeLog v3->v4:
      - Fix numerous spelling mistakes and dangling text in documentation.
        Add Ack and Rewewed-by.
      
      Cc: Igor Grinberg <grinberg@compulab.co.il>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Reviewed-by: NThomas Abraham <thomas.abraham@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      542e704f
    • L
      pinctrl: print pin range in GPIO range debugs · 75d6642a
      Linus Walleij 提交于
      Show the mapped pin range corresponding to the GPIO range in
      debugfs for pin controllers.
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      75d6642a
    • C
      pinctrl: add a pin_base for sparse gpio-ranges · 3c739ad0
      Chanho Park 提交于
      This patch enables mapping a base offset of gpio ranges with
      a pin offset even if does'nt matched. A base of pinctrl_gpio_range
      means a base offset of gpio. However, we cannot convert gpio to pin
      number for sparse gpio ranges just only using a gpio base offset.
      We can convert a gpio to real pin number(even if not matched) using
      a new pin_base which means a base pin offset of requested gpio range.
      Now, the pin control subsystem passes the pin base offset to the
      pinmux driver.
      
      For example, let's assume below two gpio ranges in the system.
      
      static struct pinctrl_gpio_range gpio_range_a = {
          .name = "chip a",
          .id = 0,
          .base = 32,
          .pin_base = 32,
          .npins = 16,
          .gc = &chip_a;
      };
      
      static struct pinctrl_gpio_range gpio_range_b = {
          .name = "chip b",
          .id = 0,
          .base = 48,
          .pin_base = 64,
          .npins = 8,
          .gc = &chip_b;
      };
      
      We can calucalate a exact pin ranges even if doesn't matched with gpio ranges.
      
      chip a:
          gpio-range : [32 .. 47]
          pin-range  : [32 .. 47]
      chip b:
          gpio-range : [48 .. 55]
          pin-range  : [64 .. 71]
      Signed-off-by: NChanho Park <chanho61.park@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3c739ad0
    • M
      pinctrl: unify pin type from signed to unsigned · 33d58949
      Marek Belisko 提交于
      We want singned pins to mean "invalid" only on the outside
      of the subsystem.
      Signed-off-by: NMarek Belisko <marek.belisko@open-nandra.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      33d58949
    • L
      pinctrl: documentation update · 336cdba0
      Linus Walleij 提交于
      Update the docs removing an obsolete __refdata tag and document
      the mysterious return value of pin_free(). And fixes up some various
      confusions in the pinctrl documentation.
      Reported-by: NRajendra Nayak <rnayak@ti.com>
      Reported-by: NRandy Dunlap <rdunlap@xenotime.net>
      Reported-by: NThomas Abraham <thomas.abraham@linaro.org>
      Reported-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      336cdba0
    • S
      pinctrl: add explicit gpio_disable_free pinmux_op · 3712a3c4
      Stephen Warren 提交于
      Some pinctrl drivers (Tegra at least) program a pin to be a GPIO in a
      completely different manner than they select which function to mux out of
      that pin. In order to support a single "free" pinmux_op, the driver would
      need to maintain a per-pin state of requested-for-gpio vs. requested-for-
      function. However, that's a lot of work when the core already has explicit
      separate paths for gpio request/free and function request/free.
      
      So, add a gpio_disable_free op to struct pinmux_ops, and make pin_free()
      call it when appropriate.
      
      When doing this, I noticed that when calling pin_request():
      
          !!gpio == (gpio_range != NULL)
      
      ... and so I collapsed those two parameters in both pin_request(), and
      when adding writing the new code in pin_free().
      
      Also, for pin_free():
      
          !!free_func == (gpio_range != NULL)
      
      However, I didn't want pin_free() to know about the GPIO function naming
      special case, so instead, I reworked pin_free() to always return the pin's
      previously requested function, and now pinmux_free_gpio() calls
      kfree(function). This is much more balanced with the allocation having
      been performed in pinmux_request_gpio().
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3712a3c4
    • M
      pinctrl: remove double pin validity check. · d2f6a1c6
      Marek Belisko 提交于
      Function pin_is_valid just call pin_desc_get which is in pin_request
      call some line below. Remove pin_is_valid() check.
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMarek Belisko <marek.belisko@open-nandra.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      d2f6a1c6
    • L
      pinctrl: move group lookup to core · 7afde8ba
      Linus Walleij 提交于
      Now also the core needs to look up pin groups so move the lookup
      function there and expose it in the internal header.
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7afde8ba
    • R
      pinctrl: iterate over u300_pmx_mask's in u300_pmx_endisable · b84e673f
      Rajendra Nayak 提交于
      Fix u300_pmx_endisable() to iterate over the list of 'bits' and
      'mask' populated as part of u300_pmx_functions.mask[]
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b84e673f
    • S
      07f29ba6
  2. 08 12月, 2011 2 次提交
  3. 02 12月, 2011 1 次提交
  4. 24 11月, 2011 15 次提交
  5. 23 11月, 2011 3 次提交