11 Apr, 2013

1 commit

  • Notifiers may return NOTIFY_(OK|DONE|STOP|BAD). The CCF uses an
    inconsistent mix of checking against NOTIFY_STOP or NOTIFY_BAD.
    This inconsistency leaves errors undetected in some cases:
    clk_set_parent() calls __clk_speculate_rates(), which stops when it
    hits a NOTIFIER_BAD (STOP is ignored), and passes this value back to the
    caller.
    clk_set_parent() compares this return value against NOTIFY_STOP only,
    ignoring NOTIFY_BAD returns.

    Use NOTIFY_STOP_MASK to detect a negative notifier return value and
    document all four return value options.

    Signed-off-by: Soren Brinkmann
    Signed-off-by: Mike Turquette

    Soren Brinkmann
     

31 Jul, 2012

1 commit

  • Many drivers are shared between architectures that may or may not have
    HAVE_CLK selected for them. To remove compilation errors for them we
    enclose clk_*() calls in these drivers within #ifdef CONFIG_HAVE_CLK,
    #endif.

    This patch removes the need of these CONFIG_HAVE_CLK statements, by
    introducing dummy routines when HAVE_CLK is not selected by platforms.
    So, definition of these routines will always be available. These calls
    will return error for platforms that don't select HAVE_CLK.

    Signed-off-by: Viresh Kumar
    Cc: Wolfram Sang
    Cc: Greg Kroah-Hartman
    Cc: Jeff Garzik
    Cc: Andrew Lunn
    Cc: Bhupesh Sharma
    Cc: Giuseppe Cavallaro
    Cc: Russell King
    Cc: Mike Turquette
    Cc: Sergei Shtylyov
    Cc: viresh kumar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Viresh Kumar
     

25 Jul, 2012

1 commit

  • Pull common clk framework changes from Michael Turquette:
    "This includes a small number of core framework improvments, platform
    ports and new DT bindings."

    Fix up trivial conflicts in drivers/clk/Makefile

    * tag 'clk-for-linus' of git://git.linaro.org/people/mturquette/linux: (21 commits)
    clk: fix compile for OF && !COMMON_CLK
    clk: fix clk_get on of_clk_get_by_name return check
    clk: mxs: clk_register_clkdev mx28 usb clocks
    clk: add highbank clock support
    dt: add clock binding doc to primecell bindings
    clk: add DT fixed-clock binding support
    clk: add DT clock binding support
    ARM: integrator: convert to common clock
    clk: add versatile ICST307 driver
    ARM: integrator: put symbolic bus names on devices
    ARM: u300: convert to common clock
    clk: cache parent clocks only for muxes
    clk: wm831x: Add initial WM831x clock driver
    clk: Constify struct clk_init_data
    clk: Add CLK_IS_BASIC flag to identify basic clocks
    clk: Add support for rate table based dividers
    clk: Add support for power of two type dividers
    clk: mxs: imx28: decrease the frequency of ref_io1 for SSP2 and SSP3
    clk: mxs: add clkdev lookup for pwm
    clk: mxs: Fix the GPMI clock name
    ...

    Linus Torvalds
     

24 Jul, 2012

1 commit


20 Jul, 2012

2 commits

  • With commit 766e6a4ec602d0c107 (clk: add DT clock binding support),
    compiling with OF && !COMMON_CLK is broken.

    Reported-by: Alexandre Pereira da Silva
    Reported-by: Prashant Gaikwad
    Signed-off-by: Rob Herring
    Signed-off-by: Mike Turquette

    Rob Herring
     
  • The commit 766e6a4 (clk: add DT clock binding support) plugs device
    tree clk lookup of_clk_get_by_name into clk_get, and fall on non-DT
    lookup clk_get_sys if DT lookup fails.

    The return check on of_clk_get_by_name takes (clk != NULL) as a
    successful DT lookup. But it's not the case. For any system that
    does not define clk lookup in device tree, ERR_PTR(-ENOENT) will be
    returned, and consequently, all the client drivers calling clk_get
    in their probe functions will fail to probe with error code -ENOENT
    returned.

    Fix the issue by checking of_clk_get_by_name return with !IS_ERR(clk),
    and update of_clk_get and of_clk_get_by_name for !CONFIG_OF build
    correspondingly.

    Signed-off-by: Shawn Guo
    Acked-by: Rob Herring
    Tested-by: Marek Vasut
    Tested-by: Lauri Hintsala
    Signed-off-by: Mike Turquette

    Shawn Guo
     

12 Jul, 2012

1 commit

  • Based on work 1st by Ben Herrenschmidt and Jeremy Kerr, then by Grant
    Likely, this patch adds support to clk_get to allow drivers to retrieve
    clock data from the device tree.

    Platforms scan for clocks in DT with of_clk_init and a match table, and
    the register a provider through of_clk_add_provider. The provider's
    clk_src_get function will be called when a device references the
    provider's OF node for a clock reference.

    v6 (Rob Herring):
    - Return error values instead of NULL to match clock framework
    expectations

    v5 (Rob Herring):
    - Move from drivers/of into common clock subsystem
    - Squashed "dt/clock: add a simple provider get function" and
    "dt/clock: add function to get parent clock name"
    - Rebase to 3.4-rc1
    - Drop CONFIG_OF_CLOCK and just use CONFIG_OF
    - Add missing EXPORT_SYMBOL to various functions
    - s/clock-output-name/clock-output-names/
    - Define that fixed-clock binding is a single output

    v4 (Rob Herring):
    - Rework for common clk subsystem
    - Add of_clk_get_parent_name function

    v3: - Clarified documentation

    v2: - fixed errant ';' causing compile error
    - Editorial fixes from Shawn Guo
    - merged in adding lookup to clkdev
    - changed property names to match established convention. After
    working with the binding a bit it really made more sense to follow the
    lead of 'reg', 'gpios' and 'interrupts' by making the input simply
    'clocks' & 'clock-names' instead of 'clock-input-*', and to only use
    clock-output* for the producer nodes. (Sorry Shawn, this will mean
    you need to change some code, but it should be trivial)
    - Add ability to inherit clocks from parent nodes by using an empty
    'clock-ranges' property. Useful for busses. I could use some feedback
    on the new property name, 'clock-ranges' doesn't feel right to me.

    Signed-off-by: Grant Likely
    Signed-off-by: Rob Herring
    Reviewed-by: Shawn Guo
    Cc: Sascha Hauer
    Signed-off-by: Mike Turquette

    Grant Likely
     

11 May, 2012

1 commit


25 Apr, 2012

2 commits


20 Apr, 2012

1 commit


17 Mar, 2012

1 commit

  • 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: Mike Turquette
    Signed-off-by: Mike Turquette
    Reviewed-by: Thomas Gleixner
    Tested-by: Andrew Lunn
    Reviewed-by: Rob Herring calxeda.com>
    Cc: Russell King
    Cc: Jeremy Kerr
    Cc: Arnd Bergman
    Cc: Paul Walmsley
    Cc: Shawn Guo
    Cc: Sascha Hauer
    Cc: Richard Zhao
    Cc: Saravana Kannan
    Cc: Magnus Damm
    Cc: Mark Brown
    Cc: Linus Walleij
    Cc: Stephen Boyd
    Cc: Amit Kucheria
    Cc: Deepak Saxena
    Cc: Grant Likely
    Signed-off-by: Arnd Bergmann

    Mike Turquette
     

28 Dec, 2011

1 commit


27 Sep, 2011

1 commit

  • As discussed previously, there's the need on some platforms to run some
    parts of clk_enable() in contexts which can schedule. The solution
    which was agreed upon was to provide clk_prepare() and clk_unprepare()
    to contain this parts, while clk_enable() and clk_disable() perform
    the atomic part.

    This patch provides a common definition for clk_prepare() and
    clk_unprepare() in linux/clk.h, and provides an upgrade path for
    existing implementation and drivers: drivers can start using
    clk_prepare() and clk_unprepare() once this patch is merged without
    having to wait for platform support. Platforms can then start to
    provide these additional functions.

    Eventually, HAVE_CLK_PREPARE will be removed from the kernel, and
    everyone will have to provide these new APIs.

    Acked-by: Saravana Kannan
    Signed-off-by: Russell King

    Russell King
     

05 Jun, 2009

1 commit


27 Mar, 2009

1 commit


17 Oct, 2008

1 commit

  • clk_get and clk_put may not be used from within interrupt context. Change
    comment to this function.

    Signed-off-by: Alex Raimondi
    Signed-off-by: Haavard Skinnemoen
    Acked-by: Russell King
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Raimondi
     

26 Mar, 2006

1 commit


08 Jan, 2006

1 commit