1. 23 Dec, 2013 1 commit
    • Boris BREZILLON's avatar
      clk: add clk accuracy retrieval support · 5279fc40
      Boris BREZILLON authored
      The clock accuracy is expressed in ppb (parts per billion) and represents
      the possible clock drift.
      Say you have a clock (e.g. an oscillator) which provides a fixed clock of
      20MHz with an accuracy of +- 20Hz. This accuracy expressed in ppb is
      20Hz/20MHz = 1000 ppb (or 1 ppm).
      Clock users may need the clock accuracy information in order to choose
      the best clock (the one with the best accuracy) across several available
      This patch adds clk accuracy retrieval support for common clk framework by
      means of a new function called clk_get_accuracy.
      This function returns the given clock accuracy expressed in ppb.
      In order to get the clock accuracy, this implementation adds one callback
      called recalc_accuracy to the clk_ops structure.
      This callback is given the parent clock accuracy (if the clock is not a
      root clock) and should recalculate the given clock accuracy.
      This callback is optional and may be implemented if the clock is not
      a perfect clock (accuracy != 0 ppb).
      Signed-off-by: default avatarBoris BREZILLON <b.brezillon@overkiz.com>
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
  2. 19 Aug, 2013 1 commit
    • James Hogan's avatar
      clk: add support for clock reparent on set_rate · 71472c0c
      James Hogan authored
      Add core support to allow clock implementations to select the best
      parent clock when rounding a rate, e.g. the one which can provide the
      closest clock rate to that requested. This is by way of adding a new
      clock op, determine_rate(), which is like round_rate() but has an extra
      parameter to allow the clock implementation to optionally select a
      different parent clock. The core then takes care of reparenting the
      clock when setting the rate.
      The parent change takes place with the help of some new private data
      members. struct clk::new_parent specifies a clock's new parent (NULL
      indicates no change), and struct clk::new_child specifies a clock's new
      child (whose new_parent member points back to it). The purpose of these
      are to allow correct walking of the future tree for notifications prior
      to actually reparenting any clocks, specifically to skip child clocks
      who are being reparented to another clock (they will be notified via the
      new parent), and to include any new child clock. These pointers are set
      by clk_calc_subtree(), and the new_child pointer gets cleared when a
      child is actually reparented to avoid duplicate POST_RATE_CHANGE
      Each place where round_rate() is called, determine_rate() is checked
      first and called in preference. This restructures a few of the call
      sites to simplify the logic into if/else blocks.
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
  3. 10 Jun, 2013 1 commit
  4. 28 Apr, 2013 1 commit
  5. 21 Mar, 2013 1 commit
  6. 16 Mar, 2012 1 commit
    • Mike Turquette's avatar
      Documentation: common clk API · 69fe8a8e
      Mike Turquette authored
      Provide documentation for the common clk structures and APIs.  This code
      can be found in drivers/clk/ and include/linux/clk*.h.
      Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
      Signed-off-by: default avatarMike Turquette <mturquette@ti.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergman <arnd.bergmann@linaro.org>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Shawn Guo <shawn.guo@freescale.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Richard Zhao <richard.zhao@linaro.org>
      Cc: Saravana Kannan <skannan@codeaurora.org>
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Linus Walleij <linus.walleij@stericsson.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Amit Kucheria <amit.kucheria@linaro.org>
      Cc: Deepak Saxena <dsaxena@linaro.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>