lkml.org 
[lkml]   [2015]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] watchdog: max63xx: cleanup
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


\
 
 \ /
  Last update: 2015-01-30 16:41    [W:0.065 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site