04 Sep, 2014

1 commit

  • commit 2243a87d90b42eb38bc281957df3e57c712b5e56
    "pinctrl: avoid duplicated calling enable_pinmux_setting for a pin"
    removed the .disable callback from the struct pinmux_ops,
    making the .enable() callback the only remaining callback.

    However .enable() is a bad name as it seems to imply that a
    muxing can also be disabled. Rename the callback to .set_mux()
    and also take this opportunity to clean out any remaining
    mentions of .disable() from the documentation.

    Acked-by: Stephen Warren
    Acked-by: Bjorn Andersson
    Acked-by: Fan Wu
    Signed-off-by: Linus Walleij

    Linus Walleij
     

11 Jul, 2014

1 commit

  • 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 = ;
    pinctrl-1 = ;
    }

    The "c_grp_setting" config node is totally identical, maybe like
    following one:

    c_grp_setting: c_grp_setting {
    pinctrl-single,pins = ;
    }

    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: Fan Wu
    Acked-by: Stephen Warren
    Acked-by: Patrice Chotard
    Acked-by: Heiko Stuebner
    Acked-by: Maxime Coquelin
    Signed-off-by: Linus Walleij

    Fan Wu
     

04 Dec, 2013

1 commit

  • 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: Linus Walleij

    Linus Walleij
     

28 Aug, 2013

1 commit

  • When setting pin configuration in the pinctrl framework, pin_config_set() or
    pin_config_group_set() is called in a loop to set one configuration at a time
    for the specified pin or group.

    This patch 1) removes the loop and 2) changes the API to pass the whole pin
    config array to the driver. It is now up to the driver to loop through the
    configs. This allows the driver to potentially combine configs and reduce the
    number of writes to pin config registers.

    All c files changed have been build-tested to verify the change compiles and
    that the corresponding .o is successfully generated.

    Signed-off-by: Sherman Yin
    Reviewed-by: Christian Daudt
    Reviewed-by: Matt Porter
    Tested-by: Stephen Warren
    Acked-by: Laurent Pinchart
    Signed-off-by: Linus Walleij

    Sherman Yin
     

18 Jun, 2013

1 commit


05 May, 2013

1 commit

  • Pull ARM SoC driver changes from Olof Johansson:
    "This is a rather large set of patches for device drivers that for one
    reason or another the subsystem maintainer preferred to get merged
    through the arm-soc tree. There are both new drivers as well as
    existing drivers that are getting converted from platform-specific
    code into standalone drivers using the appropriate subsystem specific
    interfaces.

    In particular, we can now have pinctrl, clk, clksource and irqchip
    drivers in one file per driver, without the need to call into platform
    specific interface, or to get called from platform specific code, as
    long as all information about the hardware is provided through a
    device tree.

    Most of the drivers we touch this time are for clocksource. Since now
    most of them are part of drivers/clocksource, I expect that we won't
    have to touch these again from arm-soc and can let the clocksource
    maintainers take care of these in the future.

    Another larger part of this series is specific to the exynos platform,
    which is seeing some significant effort in upstreaming and
    modernization of its device drivers this time around, which
    unfortunately is also the cause for the churn and a lot of the merge
    conflicts.

    There is one new subsystem that gets merged as part of this series:
    the reset controller interface, which is a very simple interface for
    taking devices on the SoC out of reset or back into reset. Patches to
    use this interface on i.MX follow later in this merge window, and we
    are going to have other platforms (at least tegra and sirf) get
    converted in 3.11. This will let us get rid of platform specific
    callbacks in a number of platform independent device drivers."

    * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (256 commits)
    irqchip: s3c24xx: add missing __init annotations
    ARM: dts: Disable the RTC by default on exynos5
    clk: exynos5250: Fix parent clock for sclk_mmc{0,1,2,3}
    ARM: exynos: restore mach/regs-clock.h for exynos5
    clocksource: exynos_mct: fix build error on non-DT
    pinctrl: vt8500: wmt: Fix checking return value of pinctrl_register()
    irqchip: vt8500: Convert arch-vt8500 to new irqchip infrastructure
    reset: NULL deref on allocation failure
    reset: Add reset controller API
    dt: describe base reset signal binding
    ARM: EXYNOS: Add arm-pmu DT binding for exynos421x
    ARM: EXYNOS: Add arm-pmu DT binding for exynos5250
    ARM: EXYNOS: Enable PMUs for exynos4
    irqchip: exynos-combiner: Correct combined IRQs for exynos4
    irqchip: exynos-combiner: Add set_irq_affinity function for combiner_irq
    ARM: EXYNOS: fix compilation error introduced due to common clock migration
    clk: exynos5250: Fix divider values for sclk_mmc{0,1,2,3}
    clk: exynos4: export clocks required for fimc-is
    clk: samsung: Fix compilation error
    clk: tegra: fix enum tegra114_clk to match binding
    ...

    Linus Torvalds
     

04 Apr, 2013

1 commit


07 Mar, 2013

1 commit


23 Jan, 2013

1 commit

  • Convert all uses of devm_request_and_ioremap() to the newly introduced
    devm_ioremap_resource() which provides more consistent error handling.

    devm_ioremap_resource() provides its own error messages so all explicit
    error messages can be removed from the failure code paths.

    Signed-off-by: Thierry Reding
    Cc: Linus Walleij
    Acked-by: Viresh Kumar
    Signed-off-by: Greg Kroah-Hartman

    Thierry Reding
     

04 Jan, 2013

1 commit

  • 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
    Cc: Linus Walleij
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Stephen Warren
    Cc: Srinidhi Kasagar
    Cc: Barry Song
    Cc: Viresh Kumar
    Cc: Thomas Petazzoni
    Cc: Jason Cooper
    Cc: Sebastian Hesselbarth
    Cc: Andrew Lunn
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

12 Dec, 2012

1 commit

  • Pull driver core updates from Greg Kroah-Hartman:
    "Here's the large driver core updates for 3.8-rc1.

    The biggest thing here is the various __dev* marking removals. This
    is going to be a pain for the merge with different subsystem trees, I
    know, but all of the patches included here have been ACKed by their
    various subsystem maintainers, as they wanted them to go through here.

    If this is too much of a pain, I can pull all of them out of this tree
    and just send you one with the other fixes/updates and then, after
    3.8-rc1 is out, do the rest of the removals to ensure we catch them
    all, it's up to you. The merges should all be trivial, and Stephen
    has been doing them all in linux-next for a few weeks now quite
    easily.

    Other than the __dev* marking removals, there's nothing major here,
    some firmware loading updates and other minor things in the driver
    core.

    All of these have (much to Stephen's annoyance), been in linux-next
    for a while.

    Signed-off-by: Greg Kroah-Hartman "

    Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio
    update.

    * tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits)
    modpost.c: Stop checking __dev* section mismatches
    init.h: Remove __dev* sections from the kernel
    acpi: remove use of __devinit
    PCI: Remove __dev* markings
    PCI: Always build setup-bus when PCI is enabled
    PCI: Move pci_uevent into pci-driver.c
    PCI: Remove CONFIG_HOTPLUG ifdefs
    unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs
    sh/PCI: Remove CONFIG_HOTPLUG ifdefs
    powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs
    mips/PCI: Remove CONFIG_HOTPLUG ifdefs
    microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs
    dma: remove use of __devinit
    dma: remove use of __devexit_p
    firewire: remove use of __devinitdata
    firewire: remove use of __devinit
    leds: remove use of __devexit
    leds: remove use of __devinit
    leds: remove use of __devexit_p
    mmc: remove use of __devexit
    ...

    Linus Torvalds
     

29 Nov, 2012

2 commits


12 Nov, 2012

1 commit

  • They are not referenced outside respective driver.

    Signed-off-by: Axel Lin
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Simon Arlott
    Cc: John Crispin
    Cc: Shawn Guo
    Cc: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Axel Lin
     

15 Oct, 2012

3 commits


01 Oct, 2012

1 commit

  • 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: Simon Arlott
    Signed-off-by: Chris Boot
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Simon Arlott