1. 05 12月, 2013 1 次提交
  2. 20 8月, 2013 1 次提交
    • J
      clk: add support for clock reparent on set_rate · 71472c0c
      James Hogan 提交于
      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
      notifications.
      
      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: NJames Hogan <james.hogan@imgtec.com>
      Reviewed-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Mike Turquette <mturquette@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      71472c0c
  3. 23 3月, 2013 1 次提交
  4. 12 7月, 2012 2 次提交
    • R
      clk: Add CLK_IS_BASIC flag to identify basic clocks · f7d8caad
      Rajendra Nayak 提交于
      Most platforms end up using a mix of basic clock types and
      some which use clk_hw_foo struct for filling in custom platform
      information when the clocks don't fit into basic types supported.
      
      In platform code, its useful to know if a clock is using a basic
      type or clk_hw_foo, which helps platforms know if they can
      safely use to_clk_hw_foo to derive the clk_hw_foo pointer from
      clk_hw.
      
      Mark all basic clocks with a CLK_IS_BASIC flag.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      f7d8caad
    • R
      clk: Add support for rate table based dividers · 357c3f0a
      Rajendra Nayak 提交于
      Some divider clks do not have any obvious relationship
      between the divider and the value programmed in the
      register. For instance, say a value of 1 could signify divide
      by 6 and a value of 2 could signify divide by 4 etc.
      Also there are dividers where not all values possible
      based on the bitfield width are valid. For instance
      a 3 bit wide bitfield can be used to program a value
      from 0 to 7. However its possible that only 0 to 4
      are valid values.
      
      All these cases need the platform code to pass a simple
      table of divider/value tuple, so the framework knows
      the exact value to be written based on the divider
      calculation and can also do better error checking.
      
      This patch adds support for such rate table based
      dividers and as part of the support adds a new
      registration function 'clk_register_divider_table()'
      and a new macro for static definition
      'DEFINE_CLK_DIVIDER_TABLE'.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      357c3f0a
  5. 09 5月, 2012 1 次提交
  6. 02 5月, 2012 2 次提交
    • S
      clk: Use a separate struct for holding init data. · 0197b3ea
      Saravana Kannan 提交于
      Create a struct clk_init_data to hold all data that needs to be passed from
      the platfrom specific driver to the common clock framework during clock
      registration. Add a pointer to this struct inside clk_hw.
      
      This has several advantages:
      * Completely hides struct clk from many clock platform drivers and static
        clock initialization code that don't care for static initialization of
        the struct clks.
      * For platforms that want to do complete static initialization, it removed
        the need to directly mess with the struct clk's fields while still
        allowing to statically allocate struct clk. This keeps the code more
        future proof even if they include clk-private.h.
      * Simplifies the generic clk_register() function and allows adding optional
        fields in the future without modifying the function signature.
      * Simplifies the static initialization of clocks on all platforms by
        removing the need for forward delcarations or convoluted macros.
      Signed-off-by: NSaravana Kannan <skannan@codeaurora.org>
      [mturquette@linaro.org: kept DEFINE_CLK_* macros and __clk_init]
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Rob Herring <rob.herring@calxeda.com>
      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: Jamie Iles <jamie@jamieiles.com>
      Cc: Richard Zhao <richard.zhao@linaro.org>
      Cc: Saravana Kannan <skannan@codeaurora.org>
      Cc: Magnus Damm <magnus.damm@gmail.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>
      0197b3ea
    • R
      clk: constify parent name arrays in macros · e447c50e
      Rajendra Nayak 提交于
      parent name array is now expected to be const char *, make
      the relevent changes in the clk macros which define
      default clock types.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      e447c50e
  7. 25 4月, 2012 5 次提交
  8. 17 3月, 2012 2 次提交
    • M
      clk: basic clock hardware types · 9d9f78ed
      Mike Turquette 提交于
      Many platforms support simple gateable clocks, fixed-rate clocks,
      adjustable divider clocks and multi-parent multiplexer clocks.
      
      This patch introduces basic clock types for the above-mentioned hardware
      which share some common characteristics.
      
      Based on original work by Jeremy Kerr and contribution by Jamie Iles.
      Dividers and multiplexor clocks originally contributed by Richard Zhao &
      Sascha Hauer.
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      Signed-off-by: NMike Turquette <mturquette@ti.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NRob Herring <rob.herring@calxeda.com>
      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: Jamie Iles <jamie@jamieiles.com>
      Cc: Richard Zhao <richard.zhao@linaro.org>
      Cc: Saravana Kannan <skannan@codeaurora.org>
      Cc: Magnus Damm <magnus.damm@gmail.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: NArnd Bergmann <arnd@arndb.de>
      9d9f78ed
    • M
      clk: introduce the common clock framework · b2476490
      Mike Turquette 提交于
      The common clock framework defines a common struct clk useful across
      most platforms as well as an implementation of the clk api that drivers
      can use safely for managing clocks.
      
      The net result is consolidation of many different struct clk definitions
      and platform-specific clock framework implementations.
      
      This patch introduces the common struct clk, struct clk_ops and an
      implementation of the well-known clock api in include/clk/clk.h.
      Platforms may define their own hardware-specific clock structure and
      their own clock operation callbacks, so long as it wraps an instance of
      struct clk_hw.
      
      See Documentation/clk.txt for more details.
      
      This patch is based on the work of Jeremy Kerr, which in turn was based
      on the work of Ben Herrenschmidt.
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      Signed-off-by: NMike Turquette <mturquette@ti.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: Rob Herring <rob.herring <at> calxeda.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      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: 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: NArnd Bergmann <arnd@arndb.de>
      b2476490