1. 18 7月, 2015 2 次提交
  2. 16 7月, 2015 1 次提交
  3. 10 6月, 2015 1 次提交
  4. 04 6月, 2015 1 次提交
  5. 19 5月, 2015 1 次提交
    • W
      pinctrl: sirf: add sirf atlas7 pinctrl and gpio support · f9367793
      Wei Chen 提交于
      The Pinctrl module (ioc) controls the Pad's function select
      (each pad can have 8 functions), Pad's Drive Strength, Pad's
      Pull Select and Pad's Input Disable status.
      
      The ioc has two modules, ioc_top & ioc_rtc. Both of these two
      modules have function select/clear, Pull select and Drive
      Strength registers. But only ioc_rtc has input-disable
      registers. The Pads on ioc_top have to access ioc_rtc to set
      their input-disable status and intpu-disable-value.
      
      So have to use one ioc driver instance to drive these two
      ioc modules at the same time, and each ioc module will be
      treat as one bank on the "IOC Device".
      
      The GPIO Controller controls the GPIO status if the Pad has
      been config as GPIO by Pinctrl already. Includes the GPIO
      Input/output, Interrupt type, Interrupt Status, and Set/Get
      Values.
      The GPIO pull up/down are controlled by Pinctrl.
      
      There are 7 GPIO Groups and splited into 3 MACROs in atlas7.
      The GPIO Groups in one MACRO share one GPIO controllers, each
      GPIO Group are treated as one GPIO bank.
      
      For example:
      In VDIFM macro, there is one GPIO Controller, it has 3 banks
      to control 3 gpio groups. Its gpio name space is from 0 to 95.
      
      The Device Tree can be written as following:
      
      gpio-ranges = <&pinctrl 0 0 0>,
      <&pinctrl 32 0 0>,
      <&pinctrl 64 0 0>;
      
      gpio-ranges-group-names = "gnss_gpio_grp",
      "lcd_vip_gpio_grp",
      "sdio_i2s_gpio_grp";
      
      bank#0 is from 0~31, the pins are from pinctrl's "gnss_gpio_grp".
      bank#2 is from 32~63, the pins are from pinctrl's "lcd_vip_gpio_grp".
      bank#3 is from 64~95, the pins are from pinctrl's "sdio_i2s_gpio_grp".
      Signed-off-by: NWei Chen <Wei.Chen@csr.com>
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f9367793
  6. 09 4月, 2015 1 次提交
  7. 10 3月, 2015 1 次提交
  8. 14 1月, 2015 1 次提交
  9. 20 10月, 2014 1 次提交
  10. 23 9月, 2014 1 次提交
  11. 05 9月, 2014 2 次提交
  12. 04 9月, 2014 1 次提交
  13. 29 8月, 2014 4 次提交
  14. 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
  15. 30 5月, 2014 1 次提交
  16. 28 5月, 2014 1 次提交
  17. 27 5月, 2014 1 次提交
  18. 24 4月, 2014 3 次提交
  19. 18 3月, 2014 1 次提交
    • L
      gpio: switch drivers to use new callback · 57ef0428
      Linus Walleij 提交于
      This switches all GPIO and pin control drivers with irqchips
      that were using .startup() and .shutdown() callbacks to lock
      GPIO lines for IRQ usage over to using the .request_resources()
      and .release_resources() callbacks just introduced into the
      irqchip vtable.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      57ef0428
  20. 05 3月, 2014 1 次提交
    • B
      pinctrl: sirf: fix kernel panic in gpio_lock_as_irq · e291fd20
      Barry Song 提交于
      commit 655dada6 causes kernel panic, this patch fixes it.
      
          [    1.197816] [ffffffee] *pgd=0d7fd821, *pte=00000000, *ppte=00000000
          [    1.204070] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
          [    1.209447] Modules linked in:
          [    1.212490] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.0-rc1 #3
          [    1.218737] task: cd03c000 ti: cd040000 task.ti: cd040000
          [    1.224127] PC is at gpiod_lock_as_irq+0xc/0x64
          [    1.228634] LR is at sirfsoc_gpio_irq_startup+0x18/0x44
          [    1.233842] pc : [<c01d3990>]    lr : [<c01d1c38>]    psr: a0000193
          [    1.233842] sp : cd041d30  ip : 00000000  fp : 00000000
          [    1.245296] r10: 00000000  r9 : cd023db4  r8 : 60000113
          [    1.250505] r7 : 0000003e  r6 : cd023dd4  r5 : c06bfa54  r4 : cd023d80
          [    1.257014] r3 : 00000020  r2 : 00000000  r1 : ffffffea  r0 : ffffffea
          [    1.263526] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
          [    1.270903] Control: 10c53c7d  Table: 00004059  DAC: 00000015
          [    1.276631] Process swapper/0 (pid: 1, stack limit = 0xcd040240)
          [    1.282620] Stack: (0xcd041d30 to 0xcd042000)
          [    1.286963] 1d20:                                     cd023d80 c01d1c38 c01d1c20 cd023d80
          [    1.295124] 1d40: 00000001 c0068438 cd023d80 ccb6d880 cd023dd4 c0067044 0000718e c006719c
          [    1.286963] 1d20:                                     cd023d80 c01d1c38 c01d1c20 cd023d80
          [    1.295124] 1d40: 00000001 c0068438 cd023d80 ccb6d880 cd023dd4 c0067044 0000718e c006719c
          [    1.295124] 1d40: 00000001 c0068438 cd023d80 ccb6d880 cd023dd4 c0067044 0000718e c006719c
          [    1.303283] 1d60: 00000800 00000083 ccb6d880 cd023d80 c02b41d8 00000083 0000003e ccb7c410
          [    1.311442] 1d80: 00000000 c00671dc 00000083 0000003e c02b41d8 cd3dd5c0 0000003e ccb7c634
          [    1.319601] 1da0: cd040030 c00672a8 cd3dd5c0 ccb7c410 ccb6d340 ccb7c410 ccb6d340 cd3dd400
          [    1.327760] 1dc0: cd3dd410 c02b4434 ccb7c410 c01265a8 00000001 cd3dd410 c0687108 00000000
          [    1.335919] 1de0: c0687108 00000000 00000000 c0240170 c0240158 cd3dd410 c06c30d0 c023e8bc
          [    1.344079] 1e00: c023e9d4 00000000 cd3dd410 c023e9d4 c0682150 c023cf88 cd003e98 cd2d50c4
          [    1.352238] 1e20: cd3dd410 cd3dd444 c06822f0 c023e768 cd3dd418 cd3dd410 c06822f0 c023de14
          [    1.360397] 1e40: cd3dd418 00000000 cd3dd410 c023c398 cd041e78 cd041ea8 cd3dd400 cd3dd410
          [    1.368556] 1e60: 00000083 00000000 cd3dd400 cd3dd410 00000083 000000c8 c04e00c8 c023fee8
          [    1.376715] 1e80: 00000000 cd041ea8 cd3dd400 00000001 00000083 c024048c c0435ef8 c0434dec
          [    1.384874] 1ea0: c068da58 c04c6d04 c0682150 c0435ef8 ffffffff 00000000 00000000 c068da58
          [    1.393033] 1ec0: 00000020 00000000 00000000 00000000 c05dabb8 00000007 c068d640 c068d640
          [    1.401193] 1ee0: c04c247c c04c249c 00000000 c00088e8 cd004c00 c043bbb8 cd029180 c03812a0
          [    1.409352] 1f00: 00000000 00000000 60000113 c0673728 60000113 c0673728 00000000 00000000
          [    1.417511] 1f20: cd7fce01 c0390a54 00000065 c003a81c c049e8bc 00000007 cd7fce0e 00000007
          [    1.425670] 1f40: 00000000 c05dabb8 00000007 c068d640 c068d640 c04c050c c04e00c8 00000065
          [    1.433829] 1f60: c04e00c0 c04c0c54 00000007 00000007 c04c050c c037d8fc cd03c000 c004322c
          [    1.441988] 1f80: c0662b40 0000d640 c03737c0 00000000 00000000 00000000 00000000 00000000
          [    1.450147] 1fa0: 00000000 c03737cc 00000000 c000e478 00000000 00000000 00000000 00000000
          [    1.458307] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          [    1.466467] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 0002d481 05014092
          [    1.474640] [<c01d3990>] (gpiod_lock_as_irq) from [<c01d1c38>] (sirfsoc_gpio_irq_startup+0x18/0x44)
          [    1.483661] [<c01d1c38>] (sirfsoc_gpio_irq_startup) from [<c0068438>] (irq_startup+0x34/0x6c)
          [    1.492163] [<c0068438>] (irq_startup) from [<c0067044>] (__setup_irq+0x450/0x4b8)
          [    1.499714] [<c0067044>] (__setup_irq) from [<c00671dc>] (request_threaded_irq+0xa8/0x128)
          [    1.507960] [<c00671dc>] (request_threaded_irq) from [<c00672a8>] (request_any_context_irq+0x4c/0x7c)
          [    1.517164] [<c00672a8>] (request_any_context_irq) from [<c02b4434>] (gpio_extcon_probe+0x144/0x1d4)
          [    1.526279] [<c02b4434>] (gpio_extcon_probe) from [<c0240170>] (platform_drv_probe+0x18/0x48)
          [    1.534783] [<c0240170>] (platform_drv_probe) from [<c023e8bc>] (driver_probe_device+0x120/0x238)
          [    1.543641] [<c023e8bc>] (driver_probe_device) from [<c023cf88>] (bus_for_each_drv+0x58/0x8c)
          [    1.552143] [<c023cf88>] (bus_for_each_drv) from [<c023e768>] (device_attach+0x74/0x88)
          [    1.560126] [<c023e768>] (device_attach) from [<c023de14>] (bus_probe_device+0x84/0xa8)
          [    1.568113] [<c023de14>] (bus_probe_device) from [<c023c398>] (device_add+0x440/0x520)
          [    1.576012] [<c023c398>] (device_add) from [<c023fee8>] (platform_device_add+0xb4/0x214)
          [    1.584084] [<c023fee8>] (platform_device_add) from [<c024048c>] (platform_device_register_full+0xb8/0xdc)
          [    1.593719] [<c024048c>] (platform_device_register_full) from [<c04c6d04>] (sirfsoc_init_late+0xec/0xf4)
          [    1.603185] [<c04c6d04>] (sirfsoc_init_late) from [<c04c249c>] (init_machine_late+0x20/0x28)
          [    1.611603] [<c04c249c>] (init_machine_late) from [<c00088e8>] (do_one_initcall+0xf8/0x144)
          [    1.619934] [<c00088e8>] (do_one_initcall) from [<c04c0c54>] (kernel_init_freeable+0x13c/0x1dc)
          [    1.628620] [<c04c0c54>] (kernel_init_freeable) from [<c03737cc>] (kernel_init+0xc/0x118)
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      e291fd20
  21. 25 2月, 2014 1 次提交
  22. 10 2月, 2014 1 次提交
  23. 03 2月, 2014 1 次提交
  24. 15 1月, 2014 3 次提交
    • L
      pinctrl: sirf: lock IRQs when starting them · 655dada6
      Linus Walleij 提交于
      This uses the new API for tagging GPIO lines as in use by
      IRQs. This enforces a few semantic checks on how the underlying
      GPIO line is used.
      
      Also assign the gpio_chip.dev pointer to be used for error
      messages.
      
      Cc: Barry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      655dada6
    • B
      pinctrl: sirf: put gpio interrupt pin into input status automatically · b07ddcdc
      Barry Song 提交于
      busses like i2c, spi and so on can parse the virq of their subnode automatically by
      irq_of_parse_and_map(). for example, i2c will do that in of_i2c_register_devices().
      people can put hwirq number attached to a gpio controller in dts, and drivers can
      directly request the parsed virq.
      
      for example, for an i2c client as below,
      tangoc-ts@5c{
      	compatible = "pixcir,tangoc-ts";
      	interrupt-parent = <&gpio>;
      	interrupts = <3 0>;
      	reg = <0x5c>;
      };
      in i2c client probe(), it will request_irq(client->irq, ...) without
      calling gpio_direction_input().
      so here when we set irq type, we also put the pin to input direction.
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      b07ddcdc
    • B
      pinctrl: sirf: use only one irq_domain for the whole device node · 8daeffb0
      Barry Song 提交于
      in sirfsoc gpio probe(), we create 5 irq_domains for 5 gpio banks. but
      in irq_create_of_mapping() of irqchip core level, irq_find_host() can
      only return the 1st irq_domain attached the pinctrl dt device node as
      we can see from the codes:
      
      unsigned int irq_create_of_mapping(struct device_node *controller,
      				   const u32 *intspec, unsigned int intsize)
      {
      	struct irq_domain *domain;
      	...
      	domain = controller ? irq_find_host(controller) : irq_default_domain;
      }
      
      struct irq_domain *irq_find_host(struct device_node *node)
      {
      	struct irq_domain *h, *found = NULL;
      	int rc;
      
      	/* We might want to match the legacy controller last since
      	 * it might potentially be set to match all interrupts in
      	 * the absence of a device node. This isn't a problem so far
      	 * yet though...
      	 */
      	mutex_lock(&irq_domain_mutex);
      	list_for_each_entry(h, &irq_domain_list, link) {
      		if (h->ops->match)
      			rc = h->ops->match(h, node);
      		else
      			rc = (h->of_node != NULL) && (h->of_node == node);
      
      		if (rc) {
      			found = h;
      			break;
      		}
      	}
      	mutex_unlock(&irq_domain_mutex);
      	return found;
      }
      
      for sirfsoc, the 1st irq_domain attached to the device_node(controller) only
      can do linear for the 1st 32 gpios. so for devices who use gpio hwirq above
      32 and put the information in dt like:
                                      tangoc-ts@5c{
                                              compatible = "pixcir,tangoc-ts";
      +                                       interrupt-parent = <&gpio>;
      +                                       interrupts = <34 0>;
                                      };
      
      we will fail to get the virq for these devices as hwirq will be bigger than
      domain->revmap_data.linear.size in:
      unsigned int irq_linear_revmap(struct irq_domain *domain,
      			       irq_hw_number_t hwirq)
      {
      
      	/* Check revmap bounds; complain if exceeded */
      	if (WARN_ON(hwirq >= domain->revmap_data.linear.size))
      		return 0;
      
      	return domain->revmap_data.linear.revmap[hwirq];
      }
      
      this patch drops redundant irq_domain and keep only one to fix the problem.
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      8daeffb0
  25. 08 1月, 2014 3 次提交
  26. 08 10月, 2013 3 次提交
  27. 23 8月, 2013 1 次提交