1. 11 7月, 2014 1 次提交
    • F
      pinctrl: avoid duplicated calling enable_pinmux_setting for a pin · 2243a87d
      Fan Wu 提交于
      What the patch does:
      1. Call pinmux_disable_setting ahead of pinmux_enable_setting
        each time pinctrl_select_state is called
      2. Remove the HW disable operation in pinmux_disable_setting function.
      3. Remove the disable ops in struct pinmux_ops
      4. Remove all the disable ops users in current code base.
      
      Notes:
      1. Great thanks for the suggestion from Linus, Tony Lindgren and
         Stephen Warren and Everyone that shared comments on this patch.
      2. The patch also includes comment fixes from Stephen Warren.
      
      The reason why we do this:
      1. To avoid duplicated calling of the enable_setting operation
         without disabling operation inbetween which will let the pin
         descriptor desc->mux_usecount increase monotonously.
      2. The HW pin disable operation is not useful for any of the
         existing platforms.
         And this can be used to avoid the HW glitch after using the
         item #1 modification.
      
      In the following case, the issue can be reproduced:
      1. There is a driver that need to switch pin state dynamically,
         e.g. between "sleep" and "default" state
      2. The pin setting configuration in a DTS node may be like this:
      
        component a {
      	pinctrl-names = "default", "sleep";
      	pinctrl-0 = <&a_grp_setting &c_grp_setting>;
      	pinctrl-1 = <&b_grp_setting &c_grp_setting>;
        }
      
        The "c_grp_setting" config node is totally identical, maybe like
        following one:
      
        c_grp_setting: c_grp_setting {
      	pinctrl-single,pins = <GPIO48 AF6>;
        }
      
      3. When switching the pin state in the following official pinctrl
         sequence:
      	pin = pinctrl_get();
      	state = pinctrl_lookup_state(wanted_state);
      	pinctrl_select_state(state);
      	pinctrl_put();
      
      Test Result:
      1. The switch is completed as expected, that is: the device's
         pin configuration is changed according to the description in the
         "wanted_state" group setting
      2. The "desc->mux_usecount" of the corresponding pins in "c_group"
         is increased without being decreased, because the "desc" is for
         each physical pin while the setting is for each setting node
         in the DTS.
         Thus, if the "c_grp_setting" in pinctrl-0 is not disabled ahead
         of enabling "c_grp_setting" in pinctrl-1, the desc->mux_usecount
         will keep increasing without any chance to be decreased.
      
      According to the comments in the original code, only the setting,
      in old state but not in new state, will be "disabled" (calling
      pinmux_disable_setting), which is correct logic but not intact. We
      still need consider case that the setting is in both old state
      and new state. We can do this in the following two ways:
      
      1. Avoid to "enable"(calling pinmux_enable_setting) the "same pin
         setting" repeatedly
      2. "Disable"(calling pinmux_disable_setting) the "same pin setting",
         actually two setting instances, ahead of enabling them.
      
      Analysis:
      1. The solution #2 is better because it can avoid too much
         iteration.
      2. If we disable all of the settings in the old state and one of
         the setting(s) exist in the new state, the pins mux function
         change may happen when some SoC vendors defined the
         "pinctrl-single,function-off"
         in their DTS file.
         old_setting => disabled_setting => new_setting.
      3. In the pinmux framework, when a pin state is switched, the
         setting in the old state should be marked as "disabled".
      
      Conclusion:
      1. To Remove the HW disabling operation to above the glitch mentioned
         above.
      2. Handle the issue mentioned above by disabling all of the settings
         in old state and then enable the all of the settings in new state.
      Signed-off-by: NFan Wu <fwu@marvell.com>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NPatrice Chotard <patrice.chotard@st.com>
      Acked-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NMaxime Coquelin <maxime.coquelin@st.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2243a87d
  2. 22 4月, 2014 3 次提交
    • S
      pinctrl: tegra: print better error messages · 36e80dca
      Stephen Warren 提交于
      When an attempt is made to configure an unsupported option on a pin,
      print the DT property name of that option, so it's easier to debug
      what the problem is.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      36e80dca
    • S
      pinctrl: tegra: remove fsafe from data tables · 6240d691
      Stephen Warren 提交于
      The fsafe value in the pingroup data tables is only used to implement
      tegra_pinctrl_disable(). The only reason this function is called is when
      dynamically switching between pinmux states, i.e. when disabling the old
      state before programming the new state. It's simpler to have the new
      target state define the expected value of each pin (and all current DTs
      do that). This also gives more flexibility, since it allows individual
      boards explicit control over the "inactive" mux function for each pin,
      rather than requiring it to be an SoC-specific value. Assuming this, we
      can get rid of the fsafe value from the driver completely, thus saving
      some more space in the driver tables.
      
      While re-writing the content of tegra124_pingroups[], fix the indentation
      to use a TAB instead of spaces.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6240d691
    • S
      pinctrl: tegra: remove redundant data table fields · e53b7974
      Stephen Warren 提交于
      Any SoC which supports the einput, odrain, lock, ioreset, or rcv_sel
      options has the relevant HW register fields in the same register as the
      mux function selection. Similarly, the drvtype option is always in the
      drive register, if it is supported at all. Hence, we don't need to have
      struct *_reg fields in the pin group table to define which register and
      bank to use for those options. Delete this to save space in the driver's
      data tables.
      
      However, many of those options are not supported on all SoCs, or not
      supported on some pingroups. We need a way to detect when they are
      supported. Previously, this was indicated by setting the struct *_reg
      field to -1. With the struct *_reg fields removed, we use the struct
      *_bit fields for this purpose instead. The struct *_bit fields need to
      be expanded from 5 to 6 bits in order to store a value outside the valid
      HW bit range of 0..31.
      
      Even without removing the struct *_reg fields, we still need to add code
      to validate the struct *_bit fields, since some struct *_bit fields were
      already being set to -1, without an option-specific struct *_reg field to
      "guard" them. In other words, before this change, the pinmux driver might
      allow some unsupported options to be written to HW.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e53b7974
  3. 12 3月, 2014 1 次提交
    • S
      pinctrl: tegra: dynamically calculate function list of groups · ce436254
      Stephen Warren 提交于
      The per-SoC data structures for Tegra pinctrl stored some information
      in a redundant way. Specifically, the list of groups that each function
      could be muxed onto was stored once explicitly, and also as part of the
      definition of each group. Eliminate this redundancy, and calculate each
      function's list of valid groups at pinctrl probe time. This removes
      thousands of lines of code from the pinctrl driver and ~16K from the
      vmlinux binary size, and adds only about 500uS to the boot process (on
      Tegra30; newer SoCs will likely be faster still).
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ce436254
  4. 06 2月, 2014 1 次提交
  5. 28 8月, 2013 2 次提交
  6. 23 8月, 2013 1 次提交
  7. 07 3月, 2013 1 次提交
  8. 18 1月, 2013 1 次提交
  9. 04 1月, 2013 1 次提交
    • G
      Drivers: pinctrl: remove __dev* attributes. · 150632b0
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
      Cc: Barry Song <baohua.song@csr.com>
      Cc: Viresh Kumar <viresh.linux@gmail.com>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      150632b0
  10. 29 11月, 2012 1 次提交
  11. 15 11月, 2012 1 次提交
  12. 12 11月, 2012 1 次提交
  13. 18 10月, 2012 1 次提交
  14. 15 9月, 2012 1 次提交
  15. 04 7月, 2012 2 次提交
  16. 26 4月, 2012 1 次提交
  17. 19 4月, 2012 3 次提交
    • S
      pinctrl: tegra: debugfs enhancements · b5badbaa
      Stephen Warren 提交于
      * 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: NStephen Warren <swarren@nvidia.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      b5badbaa
    • S
      pinctrl: tegra: refactor probe handling · 52f48fe0
      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: NStephen Warren <swarren@nvidia.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      52f48fe0
    • S
      ARM: tegra: Switch to new pinctrl driver · f30d12b3
      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: NStephen Warren <swarren@nvidia.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NOlof Johansson <olof@lixom.net>
      f30d12b3
  18. 18 4月, 2012 2 次提交
  19. 06 3月, 2012 1 次提交