From: Pavel Machek <pavel@ucw.cz>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: lenz@cs.wisc.edu, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [rfc] Collie battery status sensing code
Date: Fri, 10 Mar 2006 09:55:30 +0100 [thread overview]
Message-ID: <20060310085530.GA4903@elf.ucw.cz> (raw)
In-Reply-To: <1141910391.10107.49.camel@localhost.localdomain>
Hi!
> > This is collie battery sensing code. It differs from sharpsl code a
> > bit -- because it is dependend on ucb1x00, not on platform bus.
> >
> > I guess I should reorganize #include's and remove #if 0-ed
> > code. Anything else
>
> Basically looks good. Could probably use a
> s/printk/dev_dbg(sharpsl_pm.dev, /. I've made a few other comments
> below.
Ok, comments below.
> > +#include <asm/arch/collie.h>
> > +#include "../mach-pxa/sharpsl.h"
>
> Do you need anything in the above header? If so, it should probably be
> in asm/hardware/sharpsl_pm.h
Thanks, fixed.
> > +#ifdef I_AM_SURE
> > +#define CF_BUF_CTRL_BASE 0xF0800000
> > +#define SCOOP_REG(adr) (*(volatile unsigned short*)(CF_BUF_CTRL_BASE+(adr)))
> > +#define SCOOP_REG_GPWR SCOOP_REG(SCOOP_GPWR)
> > +
> > + if (on) {
> > + SCOOP_REG_GPWR |= COLLIE_SCP_CHARGE_ON;
> > + } else {
> > + SCOOP_REG_GPWR &= ~COLLIE_SCP_CHARGE_ON;
>
> Ick. Use arch/arm/common/scoop.c to do this. Something like:
Thanks, fixed.
> > +extern struct sharpsl_pm_status sharpsl_pm;
> > +
> > +static int __init collie_pm_add(struct ucb1x00_dev *pdev)
> > +{
> > + sharpsl_pm.dev = NULL;
> > + sharpsl_pm.machinfo = &collie_pm_machinfo;
> > + ucb = pdev->ucb;
> > + return sharpsl_pm_init();
> > +}
>
> I don't understand how this is supposed to work at all. For a start,
> sharpsl_pm.c says "static int __devinit sharpsl_pm_init(void)" so that
> function isn't available. I've just noticed your further patches
> although I still don't like this.
>
> The correct approach is to register a platform device called
> "sharpsl-pm" in collie_pm_add() which the driver will then see and
> attach to. I'd also not register the platform device if ucb is NULL for
> whatever reason.
>
> By setting sharpsl_pm.dev = NULL you're also going to miss out on
> suspend/resume calls and risk breaking things like
> dev_dbg(sharpsl_pm.dev, xxx).
Ok, I'll try to switch it to two-device config.
Pavel
--
28:class DeDRMS
prev parent reply other threads:[~2006-03-10 8:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-09 12:38 [rfc] Collie battery status sensing code Pavel Machek
2006-03-09 13:11 ` Pavel Machek
2006-03-09 13:19 ` Richard Purdie
2006-03-05 0:12 ` Pavel Machek
2006-03-09 17:12 ` Richard Purdie
2006-03-10 17:50 ` Pavel Machek
2006-03-10 8:55 ` Pavel Machek [this message]
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=20060310085530.GA4903@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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.