From: jchapman@katalix.com (James Chapman)
To: Ladislav Michl <ladis@linux-mips.org>
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: [PATCH] ds1337 4/4
Date: Thu, 19 May 2005 06:25:51 +0000 [thread overview]
Message-ID: <425D6CDD.3000004@katalix.com> (raw)
In-Reply-To: <20050413110413.GA30618@orphique>
Ladislav Michl wrote:
> On Tue, Apr 12, 2005 at 07:10:55PM +0100, James Chapman wrote:
> [snip]
>
>>It is used by the Radstone ppc7d platform, arch/ppc/radstone_ppc7d.c
>>but wasn't added until very recently (2.6.12-rc2 I think).
>>
>>To be honest, I meant to remove the 'id' thing before submitting the
>>driver. There's no need to support more than one of these devices.
>
> Patch bellow remove ds1337_do_command function and things needed by it.
> I think device should be identified by bus and address as Jean said.
> Please let me know if that fits your needs.
I think you misunderstood what I meant by "remove the 'id' thing"
(probably my fault). ds1337_do_command() is needed by ppc7d so don't
remove it. I meant remove the id parameter from the call and change the
ds1337 driver to support only one instance of the device.
> I'm assuming that you want to use drivers/char/genrtc.c to access ds1337
> from userspace, but in arch/ppc/platforms/radstone_ppc7d.c
> ppc_md.get_rtc_time used by genrtc via get_rtc_time in asm-ppc/rtc.h
> is set to NULL (same for set_rtc_time) and I didn't find where (if)
> ds1337 registers to ppc_md.get_rtc_time.
For ppc at least, it's the platform code that hooks up get_rtc_time().
Last time I looked in -mm, get_rtc_time() and set_rtc_time() were being
set up in ppc7d to use this driver. I won't be able to check until the
end of the week so please bear with me.
> Functions in asm-ppc/rtc.h also do magic with tm_mon and tm_year
> so this driver doesn't need to handle epoch separately and doesn't need
> to be aware that tm_mon starts from zero...
I don't understand. What code in ds1337 is unneeded?
> m68k, mips and parisc does the same in asm/rtc.h unlike arm, so I this
> driver probably won't work for me without some tweaks to arm code.
>
> [snip]
>
>>>Back to the issue, some random thoughts summarizing my opinion:
>>>
[snip]
>>>3* Having the driver write an arbitrary non-0 value to the register
>>>should not be done unless the system has been identified. I have no idea
>>>how your system can be identified (DMI?), but if it can't, then I'd
>>>better see the register ignored altogether.
>
> My board is OMAP (ARM core) based and there are ARM specific functions
> (if (machine_is_xxx()) do_something(); ), but it is not what you want to
> see in generic driver. It may be possible to use platform_data to pass
> information to driver, but I do not like this idea.
>
> So, if we use entry in sysfs, then only root can write it and root is
> allowed to do weird things. Device itself refuses any action until high
> four bits are 0xa. If that is still not enough I just found this patch
> http://groups-beta.google.com/group/fa.linux.kernel/msg/06e0368f86c8f824
> so you can use configfs to explicitly create "charge" entry. (
> * I'm considering that an overkill
> * I'm not sure if it can be easily done with configfs)
>
> I'd add config option (disabled by default) for "charge" entry, if you
> feel it is too dangerous. However I think that people should be a bit
> responsible for their actions and not writing any randoms values to any
> random files in /sys :)
>
>>>4* Remember that you can always write a simple C tool relying on the
>>>i2c-dev interface to do the job. The advantage of this approach is that
>>>you can put big fat warnings and request user confirmation before any
>>>action.
>>
>>This makes sense. Ladislav, would this work for you? I guess we'd still
>>add code to the ds1337 driver to detect ds1339 in order to ensure that
>>this tool could not modify register 0 of a ds1337 by accident?
>
>
> Yes, that would definitely work for me and I'm fine with that in case
> proposal above would be rejected.
Ok. Jean, what do you think? Do we really want a "charge" sysfs entry? I
don't have a strong opinion on this.
> Remove nowhere referenced ds1337_do_command function. Apply after ds1337
> patches 1-3.
Please don't apply this patch. I will modify the ds1337_do_command() API
to remove the "id" parameter and fixup ppc7d platform accordingly.
/james
WARNING: multiple messages have this Message-ID (diff)
From: James Chapman <jchapman@katalix.com>
To: Ladislav Michl <ladis@linux-mips.org>
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: Wed, 13 Apr 2005 20:02:53 +0100 [thread overview]
Message-ID: <425D6CDD.3000004@katalix.com> (raw)
In-Reply-To: <20050413110413.GA30618@orphique>
Ladislav Michl wrote:
> On Tue, Apr 12, 2005 at 07:10:55PM +0100, James Chapman wrote:
> [snip]
>
>>It is used by the Radstone ppc7d platform, arch/ppc/radstone_ppc7d.c
>>but wasn't added until very recently (2.6.12-rc2 I think).
>>
>>To be honest, I meant to remove the 'id' thing before submitting the
>>driver. There's no need to support more than one of these devices.
>
> Patch bellow remove ds1337_do_command function and things needed by it.
> I think device should be identified by bus and address as Jean said.
> Please let me know if that fits your needs.
I think you misunderstood what I meant by "remove the 'id' thing"
(probably my fault). ds1337_do_command() is needed by ppc7d so don't
remove it. I meant remove the id parameter from the call and change the
ds1337 driver to support only one instance of the device.
> I'm assuming that you want to use drivers/char/genrtc.c to access ds1337
> from userspace, but in arch/ppc/platforms/radstone_ppc7d.c
> ppc_md.get_rtc_time used by genrtc via get_rtc_time in asm-ppc/rtc.h
> is set to NULL (same for set_rtc_time) and I didn't find where (if)
> ds1337 registers to ppc_md.get_rtc_time.
For ppc at least, it's the platform code that hooks up get_rtc_time().
Last time I looked in -mm, get_rtc_time() and set_rtc_time() were being
set up in ppc7d to use this driver. I won't be able to check until the
end of the week so please bear with me.
> Functions in asm-ppc/rtc.h also do magic with tm_mon and tm_year
> so this driver doesn't need to handle epoch separately and doesn't need
> to be aware that tm_mon starts from zero...
I don't understand. What code in ds1337 is unneeded?
> m68k, mips and parisc does the same in asm/rtc.h unlike arm, so I this
> driver probably won't work for me without some tweaks to arm code.
>
> [snip]
>
>>>Back to the issue, some random thoughts summarizing my opinion:
>>>
[snip]
>>>3* Having the driver write an arbitrary non-0 value to the register
>>>should not be done unless the system has been identified. I have no idea
>>>how your system can be identified (DMI?), but if it can't, then I'd
>>>better see the register ignored altogether.
>
> My board is OMAP (ARM core) based and there are ARM specific functions
> (if (machine_is_xxx()) do_something(); ), but it is not what you want to
> see in generic driver. It may be possible to use platform_data to pass
> information to driver, but I do not like this idea.
>
> So, if we use entry in sysfs, then only root can write it and root is
> allowed to do weird things. Device itself refuses any action until high
> four bits are 0xa. If that is still not enough I just found this patch
> http://groups-beta.google.com/group/fa.linux.kernel/msg/06e0368f86c8f824
> so you can use configfs to explicitly create "charge" entry. (
> * I'm considering that an overkill
> * I'm not sure if it can be easily done with configfs)
>
> I'd add config option (disabled by default) for "charge" entry, if you
> feel it is too dangerous. However I think that people should be a bit
> responsible for their actions and not writing any randoms values to any
> random files in /sys :)
>
>>>4* Remember that you can always write a simple C tool relying on the
>>>i2c-dev interface to do the job. The advantage of this approach is that
>>>you can put big fat warnings and request user confirmation before any
>>>action.
>>
>>This makes sense. Ladislav, would this work for you? I guess we'd still
>>add code to the ds1337 driver to detect ds1339 in order to ensure that
>>this tool could not modify register 0 of a ds1337 by accident?
>
>
> Yes, that would definitely work for me and I'm fine with that in case
> proposal above would be rejected.
Ok. Jean, what do you think? Do we really want a "charge" sysfs entry? I
don't have a strong opinion on this.
> Remove nowhere referenced ds1337_do_command function. Apply after ds1337
> patches 1-3.
Please don't apply this patch. I will modify the ds1337_do_command() API
to remove the "id" parameter and fixup ppc7d platform accordingly.
/james
next prev parent reply other threads:[~2005-05-19 6:25 UTC|newest]
Thread overview: 158+ 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-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] i2c/i2c-elektor: " Greg KH
2005-05-19 6:25 ` [PATCH] i2c/i2c-elektor: remove interruptible_sleep_on_timeout() Greg KH
2005-03-31 23:23 ` [PATCH] I2C: New lm92 chip driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Cleanup adm1021 unused defines Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix adm1021 alarms mask Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Kill unused struct members in w83627hf driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Make master_xfer debug messages more useful Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Skip broken detection step in it87 Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: group Intel on I2C Hardware Bus support Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] i2c: new driver for ds1337 RTC Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] i2c: add adt7461 chip support to lm90 driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Clean up of i2c-elektor.c build Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix breakage in m41t00 i2c rtc driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix some i2c algorithm initialization Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Kill outdated defines in i2c.h Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Avoid repeated resets of i2c-viapro Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Recognize new revision of the ADT7463 chip Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix Vaio EEPROM detection Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: busses documentation update 1 of 2 Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: busses documentation update 2 " Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: lost arbitration detection for PCF8584 Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: lsb in emc6d102 and adm1027 Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Delete useless instruction in it87 Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix race condition in it87 driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: i2c-s3c2410 functionality and fixes Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] i2c: add adt7461 chip support to lm90 driver's Kconfig entry Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix broken force parameter handling Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Fix indentation of lm87 driver Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] I2C: Drop useless w83781d RT feature Greg KH
2005-05-19 6:25 ` Greg KH
2005-03-31 23:23 ` [PATCH] i2c: i2c-mv64xxx - set adapter owner and class fields Greg KH
2005-05-19 6:25 ` Greg KH
2005-04-07 9:45 ` [PATCH] i2c: new driver for ds1337 RTC Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-07 9:59 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-07 11:16 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-07 13:07 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-07 14:28 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-07 21:18 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-04-07 23:17 ` [PATCH] ds1337 1/4 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-07 23:36 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-04-08 13:00 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-08 16:31 ` James Chapman
2005-05-19 6:25 ` James Chapman
2005-05-02 20:41 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-04-08 8:49 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-07 23:18 ` [PATCH] ds1337 2/4 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-08 8:51 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-08 13:02 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-02 20:41 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-04-07 23:18 ` [PATCH] ds1337 3/4 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-08 10:08 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-08 13:06 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-02 20:41 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-05-04 6:13 ` [PATCH] ds1337 1/3 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-04 8:41 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-04 6:13 ` [PATCH] ds1337 2/3 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-04 9:44 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-04 6:14 ` [PATCH] ds1337 3/3 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-04 10:07 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-10 12:08 ` [PATCH] ds1337 driver works also with ds1339 chip Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-10 12:40 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-10 12:48 ` Russell King
2005-05-19 6:25 ` 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-19 6:25 ` Ladislav Michl
2005-05-10 12:51 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-10 17:55 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-05-10 18:36 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-10 20:30 ` Greg KH
2005-05-19 6:25 ` Greg KH
2005-05-11 8:32 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-07 23:19 ` [PATCH] ds1337 4/4 Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-08 11:08 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-08 12:35 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-08 16:21 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-08 17:44 ` James Chapman
2005-05-19 6:25 ` James Chapman
2005-04-10 19:51 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-10 21:10 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-12 18:10 ` James Chapman
2005-05-19 6:25 ` James Chapman
2005-04-13 11:04 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-04-13 19:02 ` James Chapman [this message]
2005-05-19 6:25 ` James Chapman
2005-04-13 19:48 ` Ladislav Michl
2005-05-19 6:25 ` Ladislav Michl
2005-05-19 6:25 ` Jean Delvare
2005-04-07 21:29 ` [PATCH] i2c: new driver for ds1337 RTC Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-04-07 23:16 ` Ladislav Michl
2005-05-19 6:25 ` 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=425D6CDD.3000004@katalix.com \
--to=jchapman@katalix.com \
--cc=greg@kroah.com \
--cc=khali@linux-fr.org \
--cc=ladis@linux-mips.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 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.