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. 04 12月, 2013 1 次提交
    • L
      gpio/pinctrl: make gpio_chip members typed boolean · 9fb1f39e
      Linus Walleij 提交于
      This switches the two members of struct gpio_chip that were
      defined as unsigned foo:1 to bool, because that is indeed what
      they are. Switch all users in the gpio and pinctrl subsystems
      to assign these values with true/false instead of 0/1. The
      users outside these subsystems will survive since true/false
      is 1/0, atleast we set some kind of more strict typing example.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9fb1f39e
  3. 28 8月, 2013 1 次提交
  4. 18 6月, 2013 1 次提交
  5. 04 4月, 2013 1 次提交
  6. 07 3月, 2013 1 次提交
  7. 23 1月, 2013 1 次提交
  8. 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
  9. 29 11月, 2012 2 次提交
  10. 12 11月, 2012 1 次提交
  11. 15 10月, 2012 3 次提交
  12. 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