LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: wim@iguana.be, linux-kernel@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH] watchdog: Add support for the WM8350 watchdog
Date: Thu, 30 Oct 2008 15:18:04 -0700	[thread overview]
Message-ID: <20081030151804.bc8bd02a.akpm@linux-foundation.org> (raw)
In-Reply-To: <1225121516-23667-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On Mon, 27 Oct 2008 15:31:56 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> This driver implements support for the watchdog functionality provided
> by the Wolfson Microelectronics WM8350, a multi-function audio and
> power management subsystem intended for use in embedded systems. It is
> based on a driver originally written by Graeme Gregory, though it has
> been extensively modified since then.
> 
> Use of a GPIO to kick the watchdog is not yet supported.
> 
> ...
>
> +
> +static int wm8350_wdt_set_timeout(struct wm8350 *wm8350, u16 value)
> +{
> +	int ret;
> +	u16 reg;
> +
> +	mutex_lock(&wdt_mutex);
> +	wm8350_reg_unlock(wm8350);
> +
> +	reg = wm8350_reg_read(wm8350, WM8350_SYSTEM_CONTROL_2);
> +	reg &= ~WM8350_WDOG_TO_MASK;
> +	reg |= value;
> +	ret = wm8350_reg_write(wm8350, WM8350_SYSTEM_CONTROL_2, reg);
> +
> +	wm8350_reg_lock(wm8350);

I was curious about this wm8350_reg_lock/wm8350_reg_unlock thing, so I
went to have a look at it.  Nothing.  Obviously its authors felt there
was no benefit in having anyone else understand what it does.

> +	mutex_unlock(&wdt_mutex);
> +
> +	return ret;
> +}
>
> ...
>
> +static int wm8350_wdt_open(struct inode *inode, struct file *file)
> +{
> +	struct wm8350 *wm8350 = get_wm8350();
> +	int ret;
> +
> +	if (!wm8350)
> +		return -ENODEV;
> +
> +	if (test_and_set_bit(1, &wm8350_wdt_users))

It's odd that the driver uses bit 1 rather than bit 0.


  reply	other threads:[~2008-10-30 22:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 15:31 Mark Brown
2008-10-30 22:18 ` Andrew Morton [this message]
2008-10-31 11:34   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2008-11-06 10:56 Mark Brown
2008-10-20 19:12 Mark Brown
2008-10-20 21:00 ` Wim Van Sebroeck
2008-10-21  9:57 ` Mark Brown
2008-10-24 12:37 ` Wim Van Sebroeck
2008-10-10 13:55 Mark Brown

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=20081030151804.bc8bd02a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wim@iguana.be \
    --subject='Re: [PATCH] watchdog: Add support for the WM8350 watchdog' \
    /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

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).