1. 05 2月, 2013 2 次提交
  2. 31 1月, 2013 2 次提交
  3. 30 1月, 2013 1 次提交
  4. 23 1月, 2013 1 次提交
    • L
      drivers/pinctrl: grab default handles from device core · ab78029e
      Linus Walleij 提交于
      This makes the device core auto-grab the pinctrl handle and set
      the "default" (PINCTRL_STATE_DEFAULT) state for every device
      that is present in the device model right before probe. This will
      account for the lion's share of embedded silicon devcies.
      
      A modification of the semantics for pinctrl_get() is also done:
      previously if the pinctrl handle for a certain device was already
      taken, the pinctrl core would return an error. Now, since the
      core may have already default-grabbed the handle and set its
      state to "default", if the handle was already taken, this will
      be disregarded and the located, previously instanitated handle
      will be returned to the caller.
      
      This way all code in drivers explicitly requesting their pinctrl
      handlers will still be functional, and drivers that want to
      explicitly retrieve and switch their handles can still do that.
      But if the desired functionality is just boilerplate of this
      type in the probe() function:
      
      struct pinctrl  *p;
      
      p = devm_pinctrl_get_select_default(&dev);
      if (IS_ERR(p)) {
         if (PTR_ERR(p) == -EPROBE_DEFER)
              return -EPROBE_DEFER;
              dev_warn(&dev, "no pinctrl handle\n");
      }
      
      The discussion began with the addition of such boilerplate
      to the omap4 keypad driver:
      http://marc.info/?l=linux-input&m=135091157719300&w=2
      
      A previous approach using notifiers was discussed:
      http://marc.info/?l=linux-kernel&m=135263661110528&w=2
      This failed because it could not handle deferred probes.
      
      This patch alone does not solve the entire dilemma faced:
      whether code should be distributed into the drivers or
      if it should be centralized to e.g. a PM domain. But it
      solves the immediate issue of the addition of boilerplate
      to a lot of drivers that just want to grab the default
      state. As mentioned, they can later explicitly retrieve
      the handle and set different states, and this could as
      well be done by e.g. PM domains as it is only related
      to a certain struct device * pointer.
      
      ChangeLog v4->v5 (Stephen):
      - Simplified the devicecore grab code.
      - Deleted a piece of documentation recommending that pins
        be mapped to a device rather than hogged.
      ChangeLog v3->v4 (Linus):
      - Drop overzealous NULL checks.
      - Move kref initialization to pinctrl_create().
      - Seeking Tested-by from Stephen Warren so we do not disturb
        the Tegra platform.
      - Seeking ACK on this from Greg (and others who like it) so I
        can merge it through the pinctrl subsystem.
      ChangeLog v2->v3 (Linus):
      - Abstain from using IS_ERR_OR_NULL() in the driver core,
        Russell recently sent a patch to remove it. Handle the
        NULL case explicitly even though it's a bogus case.
      - Make sure we handle probe deferral correctly in the device
        core file. devm_kfree() the container on error so we don't
        waste memory for devices without pinctrl handles.
      - Introduce reference counting into the pinctrl core using
        <linux/kref.h> so that we don't release pinctrl handles
        that have been obtained for two or more places.
      ChangeLog v1->v2 (Linus):
      - Only store a pointer in the device struct, and only allocate
        this if it's really used by the device.
      
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Mitch Bradley <wmb@firmworks.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Cc: Rickard Andersson <rickard.andersson@stericsson.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      [swarren: fixed and simplified error-handling in pinctrl_bind_pins(), to
      correctly handle deferred probe. Removed admonition from docs not to use
      pinctrl hogs for devices]
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ab78029e
  5. 21 1月, 2013 2 次提交
  6. 19 1月, 2013 2 次提交
    • L
      pinctrl: nomadik: Allow prcm_base to be extracted from Device Tree · 32e67eee
      Lee Jones 提交于
      The Nomadik Pinctrl driver requires access to some PRCMU registers
      in order to run with full functionality. When Device Tree is
      disabled the required PRCMU base address is passed in via platform
      data, so in order for Device Tree booting to be as functional, we
      need a similar mechanism to fetch it from Device Tree.
      
      The new semantics goes like this: Parse the Device Tree and look
      for the PRCMU node using a provided Phandle. Obtain the ioremaped
      address from that node. If one was supplied via platform data
      over-write it with anything found in Device Tree. Fail if either
      the prcm_base can't be found if we're running on anything other
      than an STN8815 ASIC.
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      32e67eee
    • K
      pinctrl: exynos: change PINCTRL_EXYNOS option · 7452b64d
      Kukjin Kim 提交于
      Since pinctrl-exynos can support exynos4 and exynos5 so changed
      the option name to PINCTRL_EXYNOS for more clarity.
      
      Cc: Thomas Abraham <Thomas.abraham@linaro.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7452b64d
  7. 18 1月, 2013 2 次提交
  8. 12 1月, 2013 8 次提交
  9. 08 1月, 2013 1 次提交
  10. 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
  11. 26 12月, 2012 5 次提交
    • F
      pinctrl: nomadik: return if prcm_base is NULL · 4ca075de
      Fabio Baltieri 提交于
      This patch adds a check for npct->prcm_base to make sure that the
      address is not NULL before using it, as the driver was made capable of
      loading even without a proper memory resource in:
      
      f1671bf5 pinctrl/nomadik: make independent of prcmu driver
      
      Also, refuses to probe without prcm_base on anything else than nomadik.
      
      This solves the following crash, introduced during the merge window when
      booting on U8500 with device tree:
      
      pinctrl-nomadik pinctrl-db8500: No PRCM base, assume no ALT-Cx control is available
      Unable to handle kernel NULL pointer dereference at virtual address 00000138
      pgd = c0004000
      [00000138] *pgd=00000000
      Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0    Not tainted  (3.7.0-02892-g1ebaf4f4 #631)
      PC is at nmk_pmx_enable+0x1bc/0x4d0
      LR is at clk_disable+0x40/0x44
      [snip]
      [<c01d5e50>] (nmk_pmx_enable+0x1bc/0x4d0) from [<c01d3ba8>] (pinmux_enable_setting+0x12c/0x1ec)
      [<c01d3ba8>] (pinmux_enable_setting+0x12c/0x1ec) from [<c01d1dc8>] (pinctrl_select_state_locked+0xfc/0x134)
      [<c01d1dc8>] (pinctrl_select_state_locked+0xfc/0x134) from [<c01d2814>] (pinctrl_register+0x26c/0x43c)
      [<c01d2814>] (pinctrl_register+0x26c/0x43c) from [<c01d668c>] (nmk_pinctrl_probe+0x114/0x238)
      [<c01d668c>] (nmk_pinctrl_probe+0x114/0x238) from [<c0211cc4>] (platform_drv_probe+0x28/0x2c)
      [<c0211cc4>] (platform_drv_probe+0x28/0x2c) from [<c0210738>] (driver_probe_device+0x84/0x21c)
      [<c0210738>] (driver_probe_device+0x84/0x21c) from [<c02109c0>] (__device_attach+0x50/0x54)
      [<c02109c0>] (__device_attach+0x50/0x54) from [<c020eb1c>] (bus_for_each_drv+0x54/0x9c)
      [<c020eb1c>] (bus_for_each_drv+0x54/0x9c) from [<c0210668>] (device_attach+0x84/0x9c)
      [<c0210668>] (device_attach+0x84/0x9c) from [<c020fbac>] (bus_probe_device+0x94/0xb8)
      [<c020fbac>] (bus_probe_device+0x94/0xb8) from [<c020e084>] (device_add+0x4f0/0x5bc)
      [<c020e084>] (device_add+0x4f0/0x5bc) from [<c0276400>] (of_device_add+0x40/0x48)
      [<c0276400>] (of_device_add+0x40/0x48) from [<c0276a98>] (of_platform_device_create_pdata+0x68/0x98)
      [<c0276a98>] (of_platform_device_create_pdata+0x68/0x98) from [<c0276bac>] (of_platform_bus_create+0xe4/0x260)
      [<c0276bac>] (of_platform_bus_create+0xe4/0x260) from [<c0276bf8>] (of_platform_bus_create+0x130/0x260)
      [<c0276bf8>] (of_platform_bus_create+0x130/0x260) from [<c0276d94>] (of_platform_populate+0x6c/0xac)
      [<c0276d94>] (of_platform_populate+0x6c/0xac) from [<c04a8224>] (u8500_init_machine+0x78/0x140)
      [<c04a8224>] (u8500_init_machine+0x78/0x140) from [<c04a3560>] (customize_machine+0x24/0x30)
      [<c04a3560>] (customize_machine+0x24/0x30) from [<c00087b0>] (do_one_initcall+0x130/0x1b0)
      [<c00087b0>] (do_one_initcall+0x130/0x1b0) from [<c033ff9c>] (kernel_init+0x138/0x2e8)
      [<c033ff9c>] (kernel_init+0x138/0x2e8) from [<c000eb18>] (ret_from_fork+0x14/0x20)
      Code: 0a00001b e19400b2 e59a200c e0822000 (e592c000)
      ---[ end trace 1b75b31a2719ed1c ]---
      note: swapper/0[1] exited with preempt_count 1
      Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
      Signed-off-by: NFabio Baltieri <fabio.baltieri@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4ca075de
    • B
      pinctrl: sirf: enable GPIO pullup/down configuration from dts · fc2b04e7
      Barry Song 提交于
      commit 7bec2074 remove sirfsoc_gpio_set_pull function,
      this patches takes the feature back by adding sirf,pullups and
      sirf,pulldowns prop in dts, and the driver will set the GPIO
      pull according to the dts.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      fc2b04e7
    • L
      pinctrl: fix comment mistake · b0666ba4
      Linus Walleij 提交于
      This variable pertains to pinctrl handles not muxes
      specifically.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b0666ba4
    • J
      drivers/pinctrl/pinctrl-at91.c: convert kfree to devm_kfree · c62b2b34
      Julia Lawall 提交于
      The function at91_dt_node_to_map is ultimately called by the function
      pinctrl_get, which is an exported function.  Since it is possible that this
      function is not called from within a probe function, for safety, the kfree
      is converted to a devm_kfree, to both free the data and remove it from the
      device in a failure situation.
      Acked-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c62b2b34
    • P
      pinctrl: imx5: fix GPIO_8 pad CAN1_RXCAN configuration · b9cfddd9
      Philipp Zabel 提交于
      3 is an invalid value for the CAN1_IPP_IND_CANRX_SELECT_INPUT
      register. Set it to 2, which correctly selects the GPIO_8 pad.
      Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b9cfddd9
  12. 19 12月, 2012 2 次提交
  13. 02 12月, 2012 1 次提交
  14. 29 11月, 2012 4 次提交
  15. 24 11月, 2012 4 次提交
  16. 23 11月, 2012 2 次提交