1. 17 Jul, 2017 8 commits
    • Vladimir Barinov's avatar
      clk: vc5: Add support for IDT VersaClock 5P49V5925 · b1911555
      Vladimir Barinov authored
      Update IDT VersaClock 5 driver to support 5P49V5925. This chip has only
      external clock input, four fractional dividers (FODs) and five clock
      outputs (four universal clock outputs and one reference clock output at
      OUT0_SELB_I2C).
      Signed-off-by: default avatarVladimir Barinov <vladimir.barinov+renesas@cogentembedded.com>
      Reviewed-by: default avatarMarek Vasut <marek.vasut@gmail.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      b1911555
    • Marek Vasut's avatar
      clk: vc5: Add support for IDT VersaClock 5P49V6901 · dbf6b16f
      Marek Vasut authored
      Update IDT VersaClock 5 driver to support IDT VersaClock 6 5P49V6901.
      This chip has two clock inputs (external XTAL or external CLKIN), four
      fractional dividers (FODs) and five clock outputs (four universal clock
      outputs and one reference clock output at OUT0_SELB_I2C).
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart's avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      on Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      dbf6b16f
    • Marek Vasut's avatar
      clk: vc5: Add support for the input frequency doubler · 8c1ebe97
      Marek Vasut authored
      The VersaClock 6 has an input frequency doubler between the input
      clock mux and the predivider. Add new capability flag and support
      for this frequency doubler block into the driver.
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart's avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      on Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      8c1ebe97
    • Marek Vasut's avatar
      clk: vc5: Split clock input mux and predivider · 55997db5
      Marek Vasut authored
      Split the VC5 clock input mux and the predivider to more accurately
      model the hardware and fix the previously incorrect assumption that
      both the OUT_SEL_I2CB and the PLL are fed from the predivider.
      
      It is in fact the clock input mux output which is directly feeding
      the clock into the OUT_SEL_I2CB output, while the clock input mux
      output first passes through the predivider before it is fed into
      the PLL.
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart's avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      on Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      55997db5
    • Marek Vasut's avatar
      clk: vc5: Configure the output buffer input mux on prepare · 718f4694
      Marek Vasut authored
      The output buffer input mux can be configured in either of three
      states -- disabled, input from FOD, input from previous output.
      Once the .prepare() callback of the output buffer is called, the
      output buffer input mux must be set to either input from FOD or
      input from previous output, it cannot be set to Disabled anymore
      or the output won't work.
      
      Default to the input from FOD if the output buffer input mux was
      Disabled and the .prepare() was called on it.
      
      Note that we do not set the output buffer input mux back to Disabled
      in the .unprepare() callback as there is no obvious benefit of doing
      so. We disable the entire output buffer in the .unprepare() callback
      already.
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      718f4694
    • Marek Vasut's avatar
      clk: vc5: Do not warn about disabled output buffer input muxes · 325b7b90
      Marek Vasut authored
      The output buffer input mux can be configured in either of three
      states -- disabled, input from FOD, input from previous output.
      If the output buffer input mux is set to disabled, the code in
      vc5_clk_out_get_parent() would consider this an invalid setting
      and warn about it, which is not necessarily the case.
      
      In case the output buffer input mux is disabled, default to input
      from FOD to have some parent and don't print the warning.
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      325b7b90
    • Marek Vasut's avatar
      clk: vc5: Fix trivial typo · a4decf58
      Marek Vasut authored
      Fix trivial typo in vc5_clk_out_unprepare() , s/Enable/Disable/ .
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      a4decf58
    • Marek Vasut's avatar
      clk: vc5: Prevent division by zero on unconfigured outputs · 3bded569
      Marek Vasut authored
      In case the initial values of the FOD registers are not configured in
      the OTP or by the bootloader, it is possible that the FOD registers
      will contain zeroes. The code in vc5_fod_recalc_rate() immediately
      feeds the FOD divider value obtained from the FOD registers into the
      div64_u64() and if the FOD divider value is zero, triggers division
      by zero exception.
      
      Check if the FOD divider value is zero and return the frequency of
      the FOD output as 0 Hz if it is so. This prevents the division by
      zero exception.
      Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Alexey Firago <alexey_firago@mentor.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: linux-renesas-soc@vger.kernel.org
      Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # Salvator-XS with the display LVDS output.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      3bded569
  2. 19 Apr, 2017 2 commits
  3. 21 Jan, 2017 1 commit