linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 2/4] watchdog: max63xx: cleanup
Date: Fri, 30 Jan 2015 10:28:07 -0500 (EST)	[thread overview]
Message-ID: <1529155290.150136.1422631687228.JavaMail.root@mail> (raw)
In-Reply-To: <54CB9994.1020503@roeck-us.net>

Hi Guenter,

> > -#define MAX6369_WDSET	(7 << 0)
> > -#define MAX6369_WDI	(1 << 3)
> 
> Not really sure I understand why you remove those constants.
> that is personal preference, not cleanup. Someone else might
> submit another cleanup later on and re-introduce them.

Indeed, I should have explained this. My primary intention with this patchset
is to bring GPIO support to this driver. MAX6369_WDSET, which is a mask, is
specific to the memory mapped support. I first intented to rename it to
MAX6369_MMAP_WDSET to explicitly mention the connection, but I ended up
thinking that a clear comment in the related functions would be much clearer
that a generic named macro.

These masks are explained below in this patch:

In max63xx_mmap_ping():
+       /* WDI is the 4th bit of the memory mapped byte */
+       __raw_writeb(val | BIT(3), data->base);
+       __raw_writeb(val & ~BIT(3), data->base);

and max63xx_mmap_set():
+       /* SET0, SET1, SET2 are the 3 lower bits of the memory mapped byte */
+       val = __raw_readb(data->base);
+       val &= ~7;
+       val |= set & 7;
+       __raw_writeb(val, data->base);

Also, if it is possible for a platform to map these bits in a different way,
some platform settings would have to be added and thus these macros won't be
relevant.

Thanks,
-v

  reply	other threads:[~2015-01-30 15:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 17:15 [PATCH 0/4] watchdog: MAX63xx cleanup and platform settings Vivien Didelot
2015-01-29 17:15 ` [PATCH 1/4] watchdog: MAX63XX_WATCHDOG does not depend on ARM Vivien Didelot
2015-05-01  4:56   ` [1/4] " Guenter Roeck
2015-01-29 17:15 ` [PATCH 2/4] watchdog: max63xx: cleanup Vivien Didelot
2015-01-30 14:47   ` Guenter Roeck
2015-01-30 15:28     ` Vivien Didelot [this message]
2015-01-29 17:15 ` [PATCH 3/4] watchdog: max63xx: add GPIO support Vivien Didelot
2015-01-29 17:15 ` [PATCH 4/4] watchdog: max63xx: add heartbeat to platform data Vivien Didelot
2015-04-16 16:37 ` [PATCH 0/4] watchdog: MAX63xx cleanup and platform settings Vivien Didelot

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=1529155290.150136.1422631687228.JavaMail.root@mail \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@iguana.be \
    /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).