All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: Alexey Kopytko <alexey@kopytko.ru>
Cc: Alessandro Zummo <a.zummo@towertech.it>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RTC: Add platform data structure to Ricoh RS5C372 driver
Date: Wed, 24 Sep 2008 14:08:09 +0900	[thread overview]
Message-ID: <20080924050809.GA6722@linux-sh.org> (raw)
In-Reply-To: <a700c9740809231945j643b226fv30d87521045078b1@mail.gmail.com>

On Wed, Sep 24, 2008 at 11:45:49AM +0900, Alexey Kopytko wrote:
> From: Alexey Kopytko <alexey@kopytko.ru>
> 
> This patch enables a platform developer to choose which alarm register to use.
> It adds and properly initializes platform data structure.
> 
> ---
> RS5C_REG_ALARM_B_MIN is used to store power state in
> Buffalo Linkstation Mini and some other Linkstations.
> Tested with and without platform data.
> 
> Signed-off-by: Alexey Kopytko <alexey@kopytko.ru>
> 
[snip]

> +#ifndef _LINUX_RTC_RS5C372_H_
> +#define _LINUX_RTC_RS5C372_H_
> +
> +#define RS5C_REG_ALARM_A_MIN	8			/* or ALARM_W */
> +#define RS5C_REG_ALARM_A_HOURS	9
> +#define RS5C_REG_ALARM_A_WDAY	10
> +
> +#define RS5C_REG_ALARM_B_MIN	11			/* or ALARM_D */
> +#define RS5C_REG_ALARM_B_HOURS	12
> +#define RS5C_REG_ALARM_B_WDAY	13			/* (ALARM_B only) */
> +
> +struct rs5c_plat_data {
> +	/* What alarm regs to use */
> +	int alarm_min;
> +	int alarm_hours;
> +};

I don't think this is a meaningful abstraction. Pushing this sort of
knowledge in to the platform code is pretty ugly, especially when the
only distinction you need is whether to use the A set or the B set.

Given that, you could simply have a flags field in the platform data and
use one bit to test in the driver for using the B set of registers (A is
always the default otherwise).

  reply	other threads:[~2008-09-24  5:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24  2:45 [PATCH] RTC: Add platform data structure to Ricoh RS5C372 driver Alexey Kopytko
2008-09-24  5:08 ` Paul Mundt [this message]
     [not found] <bfsC3-6J9-5@gated-at.bofh.it>
2008-09-24 10:32 ` Bodo Eggert

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=20080924050809.GA6722@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=a.zummo@towertech.it \
    --cc=alexey@kopytko.ru \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.