1. 29 Jun, 2016 5 commits
    • Lee Jones's avatar
      reset: TRIVIAL: Add line break at same place for similar APIs · 0bcc0eab
      Lee Jones authored
      Standardise the way inline functions:
      
        devm_reset_control_get_shared_by_index
        devm_reset_control_get_exclusive_by_index
      
      ... are formatted.
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      0bcc0eab
    • Lee Jones's avatar
      reset: Supply *_shared variant calls when using *_optional APIs · c33d61a0
      Lee Jones authored
      Consumers need to be able to specify whether they are requesting an
      'exclusive' or 'shared' reset line no matter which API (of_*, devm_*,
      etc) they are using.  This change allows users of the optional_* API
      in particular to specify that their request is for a 'shared' line.
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      c33d61a0
    • Lee Jones's avatar
      reset: Supply *_shared variant calls when using of_* API · 40faee8e
      Lee Jones authored
      Consumers need to be able to specify whether they are requesting an
      'exclusive' or 'shared' reset line no matter which API (of_*, devm_*,
      etc) they are using.  This change allows users of the of_* API in
      particular to specify that their request is for a 'shared' line.
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      40faee8e
    • Lee Jones's avatar
      reset: Ensure drivers are explicit when requesting reset lines · a53e35db
      Lee Jones authored
      Phasing out generic reset line requests enables us to make some better
      decisions on when and how to (de)assert said lines.  If an 'exclusive'
      line is requested, we know a device *requires* a reset and that it's
      preferable to act upon a request right away.  However, if a 'shared'
      reset line is requested, we can reasonably assume sure that placing a
      device into reset isn't a hard requirement, but probably a measure to
      save power and is thus able to cope with not being asserted if another
      device is still in use.
      
      In order allow gentle adoption and not to forcing all consumers to
      move to the API immediately, causing administration headache between
      subsystems, this patch adds some temporary stand-in shim-calls.  This
      will ease the burden at merge time and allow subsystems to migrate over
      to the new API in a more realistic time-frame.
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      a53e35db
    • Lee Jones's avatar
      reset: Reorder inline reset_control_get*() wrappers · 3c35f6ed
      Lee Jones authored
      We're about to split the current API into two, where consumers will
      be forced to be explicit when requesting reset lines.  The choice
      will be to either the call the *_exclusive or *_shared variant
      depending on whether they can actually tolorate not being asserted
      when that request is made.
      
      The new API will look like this once reorded and complete:
      
        reset_control_get_exclusive()
        reset_control_get_shared()
        reset_control_get_optional_exclusive()
        reset_control_get_optional_shared()
        of_reset_control_get_exclusive()
        of_reset_control_get_shared()
        of_reset_control_get_exclusive_by_index()
        of_reset_control_get_shared_by_index()
        devm_reset_control_get_exclusive()
        devm_reset_control_get_shared()
        devm_reset_control_get_optional_exclusive()
        devm_reset_control_get_optional_shared()
        devm_reset_control_get_exclusive_by_index()
        devm_reset_control_get_shared_by_index()
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      3c35f6ed
  2. 01 Jun, 2016 1 commit
    • John Youn's avatar
      reset: Return -ENOTSUPP when not configured · 168d7c4e
      John Youn authored
      Prior to commit 6c96f05c ("reset: Make [of_]reset_control_get[_foo]
      functions wrappers"), the "optional" functions returned -ENOTSUPP when
      CONFIG_RESET_CONTROLLER was not set.
      
      Revert back to the old behavior by changing the new
      __devm_reset_control_get() and __of_reset_control_get() functions to
      return ERR_PTR(-ENOTSUPP) when compiled without CONFIG_RESET_CONTROLLER.
      
      Otherwise they will return -EINVAL causing users to think that an error
      occurred when CONFIG_RESET_CONTROLLER is not set.
      
      Fixes: 6c96f05c ("reset: Make [of_]reset_control_get[_foo] functions wrappers")
      Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      168d7c4e
  3. 04 Apr, 2016 1 commit
    • Daniel Lezcano's avatar
      reset: Add missing function stub for device_reset · 41136522
      Daniel Lezcano authored
      The Mediatek's thermal driver fails to compile when the RESET_CONTROLLER
      option is not set. Logically, as the driver depends on this option to compile,
      the Kconfig should select it but actually that is not correct because the
      Kconfig provides also the COMPILE_TEST to increase the compile test coverage.
      
      By providing the missing 'device_reset' stub for the driver in reset.h, that
      let the kernel to compile on different platforms with the Mediatek thermal
      driver enabled with the COMPILE_TEST option.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      41136522
  4. 30 Mar, 2016 2 commits
    • Hans de Goede's avatar
      reset: Add support for shared reset controls · 0b52297f
      Hans de Goede authored
      In some SoCs some hw-blocks share a reset control. Add support for this
      setup by adding new:
      
      reset_control_get_shared()
      devm_reset_control_get_shared()
      devm_reset_control_get_shared_by_index()
      
      methods to get a reset_control. Note that this patch omits adding of_
      variants, if these are needed later they can be easily added.
      
      This patch also changes the behavior of the existing exclusive
      reset_control_get() variants, if these are now called more then once
      for the same reset_control they will return -EBUSY. To catch existing
      drivers triggering this error (there should not be any) a WARN_ON(1)
      is added in this path.
      
      When a reset_control is shared, the behavior of reset_control_assert /
      deassert is changed, for shared reset_controls these will work like the
      clock-enable/disable and regulator-on/off functions. They will keep a
      deassert_count, and only (re-)assert the reset after reset_control_assert
      has been called as many times as reset_control_deassert was called.
      
      Calling reset_control_assert without first calling reset_control_deassert
      is not allowed on a shared reset control. Calling reset_control_reset is
      also not allowed on a shared reset control.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      0b52297f
    • Hans de Goede's avatar
      reset: Make [of_]reset_control_get[_foo] functions wrappers · 6c96f05c
      Hans de Goede authored
      With both the regular, _by_index and _optional variants we already have
      quite a few variants of [of_]reset_control_get[_foo], the upcoming
      addition of shared reset lines support makes this worse.
      
      This commit changes all the variants into wrappers around common core
      functions. For completeness sake this commit also adds a new
      devm_get_reset_control_by_index wrapper.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      6c96f05c
  5. 16 Nov, 2015 2 commits
  6. 01 Sep, 2015 1 commit
  7. 20 Oct, 2014 1 commit
  8. 14 Apr, 2014 1 commit
  9. 09 Mar, 2014 1 commit
  10. 03 Feb, 2014 1 commit
  11. 12 Apr, 2013 1 commit