From: Ladislav Michl <ladis@linux-mips.org>
To: James Chapman <jchapman@katalix.com>
Cc: Jean Delvare <khali@linux-fr.org>,
LKML <linux-kernel@vger.kernel.org>,
LM Sensors <sensors@Stimpy.netroedge.com>,
Greg KH <greg@kroah.com>
Subject: Re: [PATCH] ds1337 4/4
Date: Sun, 10 Apr 2005 20:51:20 +0100 [thread overview]
Message-ID: <20050410195120.GA5422@linux-mips.org> (raw)
In-Reply-To: <4256C315.3000902@katalix.com>
On Fri, Apr 08, 2005 at 06:44:53PM +0100, James Chapman wrote:
> > The only reason I can think
> >about is when suspending device, so it is likely pm job. /sys entry
> >might help as well, but I do not see any point making driver more
> >complicated and bigger just to make someone else happy.
>
> Why not add a new /sys entry for it? Is there a generic battery charge
> control /sys API?
I do not know about any and I do not think it would be usefull here. How
would you convert value passed by API into register value? Driver has no
chance to know about hardware design.
> >Golden rule is: implement features as needed :)
>
> But when adding code, try to cover all reasonable cases, otherwise we'll
> see patches from people trying to add platform specific ifdefs in here.
I'd like to, but simply do not have enough informations to do it. In other
worlds I still do not know what is reasonable here.
> >>Also, arbitrarily picking one of the 6 possible charging modes just
> >>because it matches your board is a bad idea. It looks like a value which
> >>should be set on a per-board basis, rather than picked randomly by the
> >>user, so as to avoid accidental hardware breakage.
> >
> >
> >Well free to provide that way, so far I'm the only user so I did what is
> >usefull for me [*]. Everyone is welcome to change it to more generic
> >way.
>
> I agree with Jean. You should provide an API for this. Don't take
> shortcuts just because you were the first to support the chip. It'll be
> more useful to others if you provide a way to set a value per platform.
That's not about taking any shortcuts, that's about finding sane API. When
time shows it wrong and it will need change people will complain about
compatibility. See my questions about API bellow [*].
Based on your and Jean's input, following so far sounds reasonable:
Create "charge" sysfs entry for ds1339 when it is detected. Do not write
any value to Trickle Charge register, until its value is written to this
entry.
> >I was running test overnight and didn't meet any single case when this
> >happen. Perhaps device also needs to see start condition?
>
> Just because it runs overnight doesn't mean there's no bug.
Agree, but with probability near the certainty I can tell that device works
a bit differently than described in datasheet. Anyway, new 100% reliable
test is done, so it could be eventually used if ds1339 support finds its
way into driver.
> >>Also, 0x00 is a possible value for both the seconds count and the battery
> >>register, so you could miss a DS1339 at times.
> >>
> >>One possible check to start with would be on the value of the additional
> >>register itself. It has only 7 possible values. (...)
> >
> >
> >Eh? Register is 8bit, that's 256 combinations.
>
> Reserved bits have fixed values that you can test for.
Think about this register as about NVRAM address. It can have any value,
but only certain values will enable charge.
[*] Now lets forget ds1339, there are few things I'd like to know about
this driver.
How are you using this driver? There is non-static function
ds1337_do_command which expects id. How do you know which id belongs
to which chip? Do you actually have machine with more than one ds1337?
Chip has fixed address, so only one can hang on one bus (am I right?)
Also it is unlikely that machine will have more that one RTC. The only
exception which comes on mind are NUMA systems which have one RTC per
node. Anything else? Why date format returned/expected by this driver
differs from other drivers?
Thanks in advance,
ladis
PS. I'm sorry about some formulations I used in earlier mails. I was
overworked and tired and that affected my otherwise (hopefully) good
decorum :)
next prev parent reply other threads:[~2005-04-10 19:51 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-31 23:22 [BK PATCH] I2C patches for 2.6.12-rc1 Greg KH
2005-03-31 23:23 ` [PATCH] i2c/i2c-ite: remove interruptible_sleep_on_timeout() usage Greg KH
2005-03-31 23:23 ` [PATCH] i2c/i2c-elektor: " Greg KH
2005-03-31 23:23 ` [PATCH] I2C: New lm92 chip driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Cleanup adm1021 unused defines Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix adm1021 alarms mask Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Kill unused struct members in w83627hf driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Make master_xfer debug messages more useful Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Skip broken detection step in it87 Greg KH
2005-03-31 23:23 ` [PATCH] I2C: group Intel on I2C Hardware Bus support Greg KH
2005-03-31 23:23 ` [PATCH] i2c: new driver for ds1337 RTC Greg KH
2005-03-31 23:23 ` [PATCH] i2c: add adt7461 chip support to lm90 driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Clean up of i2c-elektor.c build Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix breakage in m41t00 i2c rtc driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix some i2c algorithm initialization Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Kill outdated defines in i2c.h Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Avoid repeated resets of i2c-viapro Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Recognize new revision of the ADT7463 chip Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix Vaio EEPROM detection Greg KH
2005-03-31 23:23 ` [PATCH] I2C: busses documentation update 1 of 2 Greg KH
2005-03-31 23:23 ` [PATCH] I2C: busses documentation update 2 " Greg KH
2005-03-31 23:23 ` [PATCH] I2C: lost arbitration detection for PCF8584 Greg KH
2005-03-31 23:23 ` [PATCH] I2C: lsb in emc6d102 and adm1027 Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Delete useless instruction in it87 Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix race condition in it87 driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: i2c-s3c2410 functionality and fixes Greg KH
2005-03-31 23:23 ` [PATCH] i2c: add adt7461 chip support to lm90 driver's Kconfig entry Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix broken force parameter handling Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix indentation of lm87 driver Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Drop useless w83781d RT feature Greg KH
2005-03-31 23:23 ` [PATCH] i2c: i2c-mv64xxx - set adapter owner and class fields Greg KH
2005-04-07 9:45 ` [PATCH] i2c: new driver for ds1337 RTC Ladislav Michl
2005-04-07 9:59 ` Jean Delvare
2005-04-07 11:16 ` Ladislav Michl
2005-04-07 13:07 ` Jean Delvare
2005-04-07 14:28 ` Ladislav Michl
2005-04-07 21:18 ` Greg KH
2005-04-07 23:17 ` [PATCH] ds1337 1/4 Ladislav Michl
2005-04-07 23:36 ` Greg KH
2005-04-08 13:00 ` Ladislav Michl
2005-04-08 16:31 ` James Chapman
2005-05-02 20:41 ` Greg KH
2005-04-08 8:49 ` Jean Delvare
2005-04-07 23:18 ` [PATCH] ds1337 2/4 Ladislav Michl
2005-04-08 8:51 ` Jean Delvare
2005-04-08 13:02 ` Ladislav Michl
2005-05-02 20:41 ` Greg KH
2005-04-07 23:18 ` [PATCH] ds1337 3/4 Ladislav Michl
2005-04-08 10:08 ` Jean Delvare
2005-04-08 13:06 ` Ladislav Michl
2005-05-02 20:41 ` Greg KH
2005-05-04 6:13 ` [PATCH] ds1337 1/3 Ladislav Michl
2005-05-04 8:41 ` Jean Delvare
2005-05-04 6:13 ` [PATCH] ds1337 2/3 Ladislav Michl
2005-05-04 9:44 ` Jean Delvare
2005-05-04 6:14 ` [PATCH] ds1337 3/3 Ladislav Michl
2005-05-04 10:07 ` Jean Delvare
2005-05-10 12:08 ` [PATCH] ds1337 driver works also with ds1339 chip Ladislav Michl
2005-05-10 12:40 ` Jean Delvare
2005-05-10 12:48 ` Russell King
[not found] ` <1DTwF8-18P-00@press.kroah.org>
[not found] ` <20050508204021.627f9cd1.khali@linux-fr.org>
[not found] ` <427E6E21.60001@katalix.com>
[not found] ` <20050508222351.08bfe2e1.khali@linux-fr.org>
2005-05-10 12:18 ` [PATCH] ds1337: export ds1337_do_command Ladislav Michl
2005-05-10 12:51 ` Jean Delvare
2005-05-10 17:55 ` Greg KH
2005-05-10 18:36 ` Ladislav Michl
2005-05-10 20:30 ` Greg KH
2005-05-11 8:32 ` Ladislav Michl
2005-04-07 23:19 ` [PATCH] ds1337 4/4 Ladislav Michl
2005-04-08 11:08 ` Jean Delvare
2005-04-08 12:35 ` Ladislav Michl
2005-04-08 16:21 ` Jean Delvare
2005-04-08 17:44 ` James Chapman
2005-04-10 19:51 ` Ladislav Michl [this message]
2005-04-10 21:10 ` Jean Delvare
2005-04-12 18:10 ` James Chapman
2005-04-13 11:04 ` Ladislav Michl
2005-04-13 19:02 ` James Chapman
2005-04-13 19:48 ` Ladislav Michl
2005-04-07 21:29 ` [PATCH] i2c: new driver for ds1337 RTC Jean Delvare
2005-04-07 23:16 ` Ladislav Michl
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=20050410195120.GA5422@linux-mips.org \
--to=ladis@linux-mips.org \
--cc=greg@kroah.com \
--cc=jchapman@katalix.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@Stimpy.netroedge.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