linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Mike Turquette <mturquette@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Jin Yao <yao.jin@linux.intel.com>,
	Li Aubrey <aubrey.li@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] clk: new basic clk type for fractional divider
Date: Wed, 14 May 2014 16:55:49 +0300	[thread overview]
Message-ID: <20140514135548.GC12238@xps8300> (raw)
In-Reply-To: <1399983233-18037-4-git-send-email-heikki.krogerus@linux.intel.com>

On Tue, May 13, 2014 at 03:13:52PM +0300, Heikki Krogerus wrote:
> +static unsigned long clk_fd_recalc_rate(struct clk_hw *hw,
> +					unsigned long parent_rate)
> +{
> +	struct clk_fractional_divider *fd = to_clk_fd(hw);
> +	unsigned long flags = 0;
> +	u64 n, m;
> +	u32 val;
> +
> +	if (fd->lock)
> +		spin_lock_irqsave(fd->lock, flags);
> +
> +	val = clk_readl(fd->reg);
> +
> +	if (fd->lock)
> +		spin_unlock_irqrestore(fd->lock, flags);
> +
> +	m = (val & fd->mmask) >> fd->mshift;
> +	n = (val & fd->nmask) >> fd->nshift;
> +
> +	return parent_rate * m / n;
> +}

Andy noticed an issue here but he commented it outside the list. I
need to use do_div() here. He had also some nitpicks for the other
patches, so I'll prepare a new version for all of these tomorrow.


-- 
heikki

  reply	other threads:[~2014-05-14 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 12:13 [PATCH 0/4] ACPI / LPSS: Solution for two issues seen on Asus T100 Heikki Krogerus
2014-05-13 12:13 ` [PATCH 1/4] ACPI / PM: Export rest of the subsys functions Heikki Krogerus
2014-05-13 12:13 ` [PATCH 2/4] ACPI / LPSS: custom power domain for LPSS Heikki Krogerus
2014-05-13 12:13 ` [PATCH 3/4] clk: new basic clk type for fractional divider Heikki Krogerus
2014-05-14 13:55   ` Heikki Krogerus [this message]
2014-05-13 12:13 ` [PATCH 4/4] ACPI / LPSS: support for fractional divider clock Heikki Krogerus

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=20140514135548.GC12238@xps8300 \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mturquette@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=yao.jin@linux.intel.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).