From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: rtc-linux@googlegroups.com, Samuel Ortiz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org,
Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [rtc-linux] [PATCH 4/5] RTC: Add support for RTCs on Wolfson WM831x devices
Date: Mon, 10 Aug 2009 21:57:13 +0100 [thread overview]
Message-ID: <20090810205712.GA4528@sirena.org.uk> (raw)
In-Reply-To: <20090810205535.4fb160af@i1501.lan.towertech.it>
On Mon, Aug 10, 2009 at 08:55:35PM +0200, Alessandro Zummo wrote:
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> given you have your own include directory undef mfd/
> you might want to move those #defines there
Unlike the others these registers can't really be used outside of this
driver - for the other drivers there's potential for at least platform
specific code if not multiple drivers to use some or all of the register
definitions.
> > +struct wm831x_rtc {
> > + struct wm831x *wm831x;
> > + struct rtc_device *rtc;
> > + int alarm_enabled;
> > + int per_irq;
> are those tows int or unsigned int?
I've just dropped per_irq, it's not needed anyway.
> or maybe alarm_enabled could be :1 ?
Done, but it doesn't really buy us much given that there's nothing
else to pack it with.
> > +/*
> > + * Set current time and date in RTC
> > + */
> > +static int wm831x_rtc_settime(struct device *dev, struct rtc_time *tm)
> isn't rtc_set_mmss more appropriate?
Hrm, I think so so I've made the change. It's not a particularly
discoverable API - the fact that there's no readback equivalent hides
the fact that it's supposed to be an equivalent for settime. Some
documentation would really help here.
> > + ret = wm831x_set_bits(wm831x_rtc->wm831x, WM831X_RTC_CONTROL,
> > + WM831X_RTC_ALM_ENA, enable);
> > + if (ret != 0)
> > + dev_err(&pdev->dev, "Failed to update RTC alarm: %d\n", ret);
> > +
> > + return 0;
> always 0 ? (also below..)
Failing suspend and resume due to failure to disable the RTC alarm
would be excessive - indeed, I'd expect the overwhelming majority of
systems to function perfectly well with no suspend/resume support in the
driver at all. RTC alarms are infrequent relative to other
suspend/resume events in typical systems but suspend is normally used
fairly heavily to preserve battery (typical applications include things
like MP3 players or phones). Typically the error handling would at best
cause more serious consequences than the original error and there's
little chance the user will be able to even report the error.
> > +static int __init wm831x_rtc_init(void)
> > +{
> > + return platform_driver_register(&wm831x_rtc_driver);
> can you use platform_driver_probe() ?
No, this is a MFD accessed over slow buses and we can't guarantee that
the device will be registered.
Fixed everything else, will repost tomorrow.
next prev parent reply other threads:[~2009-08-10 20:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-10 16:43 [PATCH 1/5] backlight: Add WM831x backlight driver Mark Brown
2009-08-10 16:43 ` [PATCH 2/5] leds: Add WM831x status LED driver Mark Brown
2009-08-10 16:43 ` [PATCH 3/5] power_supply: Add driver for the PMU on WM831x PMICs Mark Brown
2009-08-14 2:00 ` Anton Vorontsov
2009-08-14 16:49 ` Mark Brown
2009-08-14 16:53 ` Anton Vorontsov
2009-08-10 16:43 ` [PATCH 4/5] RTC: Add support for RTCs on Wolfson WM831x devices Mark Brown
2009-08-10 18:55 ` [rtc-linux] " Alessandro Zummo
2009-08-10 20:57 ` Mark Brown [this message]
2009-08-10 21:08 ` [rtc-linux] " Alessandro Zummo
2009-08-16 22:35 ` Samuel Ortiz
2009-08-10 16:43 ` [PATCH 5/5] [WATCHDOG] Add support for WM831x watchdog Mark Brown
2009-08-11 12:40 ` Wim Van Sebroeck
2009-08-16 13:28 ` Wim Van Sebroeck
2009-08-16 16:27 ` Mark Brown
2009-08-17 12:13 ` Wim Van Sebroeck
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=20090810205712.GA4528@sirena.org.uk \
--to=broonie@opensource.wolfsonmicro.com \
--cc=a.zummo@towertech.it \
--cc=alessandro.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
--cc=sameo@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
all inboxes | Powered by JetHome®