linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Afzal Mohammed <afzal@ti.com>, <linux-fbdev@vger.kernel.org>,
	<linux-omap@vger.kernel.org>,
	<devicetree-discuss@lists.ozlabs.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>
Subject: Re: [PATCH v4 12/12] video: da8xx-fb: CCF clock divider handling
Date: Wed, 23 Jan 2013 12:22:04 -0800	[thread overview]
Message-ID: <20130123202204.9205.66575@quantum> (raw)
In-Reply-To: <fa8dab522507e087d5a94bac13dda71544911707.1358937685.git.afzal@ti.com>

Quoting Afzal Mohammed (2013-01-23 03:48:56)
<snip>
> +static inline void da8xx_fb_clkc_enable(void)
> +{
>         if (lcd_revision == LCD_VERSION_2)
>                 lcdc_write(LCD_V2_DMA_CLK_EN | LCD_V2_LIDD_CLK_EN |
>                                 LCD_V2_CORE_CLK_EN, LCD_CLK_ENABLE_REG);
>  }
>  
> -static inline void da8xx_fb_calc_config_clk_divider(struct da8xx_fb_par *par,
> +#ifdef CONFIG_COMMON_CLK
> +static inline int da8xx_fb_calc_config_clk_divider(struct da8xx_fb_par *par,
> +                                                   struct fb_videomode *mode)
> +{
> +       int ret;
> +
> +       ret = clk_set_rate(par->child_clk, PICOS2KHZ(mode->pixclock) * 1000);
> +       if (IS_ERR_VALUE(ret)) {
> +               dev_err(par->dev, "unable to setup pixel clock of %u ps",
> +                       mode->pixclock);
> +               return ret;
> +       }
> +       da8xx_fb_clkc_enable();

It looks like you are using the legacy method to enable/disable the
clock and using the CCF basic divider to set the rate.  This feels a bit
hacky to me.  If you want to model your clock in CCF then you should
probably model the whole clock, not just the rate-change aspects of it.

Have you looked at the composite clock patches from Prashant?  Those
might give you the divider+gate properties that you are looking for:
http://article.gmane.org/gmane.linux.kernel/1416697

Regards,
Mike

  reply	other threads:[~2013-01-23 20:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 11:47 [PATCH v4 00/12] video: da8xx-fb: am335x DT support Afzal Mohammed
2013-01-23 11:47 ` [PATCH v4 01/12] video: da8xx-fb: make io operations safe Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 02/12] video: da8xx-fb: fix 24bpp raster configuration Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 03/12] video: da8xx-fb: enable sync lost intr for v2 ip Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 04/12] video: da8xx-fb: use devres Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 05/12] video: da8xx-fb: ensure non-null cfg in pdata Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 06/12] video: da8xx-fb: reorganize panel detection Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 07/12] video: da8xx-fb: minimal dt support Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 08/12] video: da8xx-fb: invoke platform callback safely Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 09/12] video: da8xx-fb: obtain fb_videomode info from dt Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 10/12] video: da8xx-fb: ensure pdata only for non-dt Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 11/12] video: da8xx-fb: setup struct lcd_ctrl_config for dt Afzal Mohammed
2013-01-23 11:48 ` [PATCH v4 12/12] video: da8xx-fb: CCF clock divider handling Afzal Mohammed
2013-01-23 20:22   ` Mike Turquette [this message]
2013-01-24 11:36     ` Mohammed, Afzal
2013-01-24 17:00       ` Mike Turquette
2013-01-25 12:05         ` Mohammed, Afzal
2013-01-25 22:44           ` Mike Turquette
2013-01-28  9:17             ` Mohammed, Afzal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130123202204.9205.66575@quantum \
    --to=mturquette@linaro.org \
    --cc=FlorianSchandinat@gmx.de \
    --cc=afzal@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).