From: Steffen Trumtrar <s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Alessandro Zummo
<a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>,
devicetree-discuss
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH 6/9] rtc: stmp3xxx: add sysfs entries for persistent regs
Date: Wed, 6 Mar 2013 14:27:44 +0100 [thread overview]
Message-ID: <20130306132744.GC13810@pengutronix.de> (raw)
In-Reply-To: <20130305080252.GA7042-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
On Tue, Mar 05, 2013 at 09:02:52AM +0100, Steffen Trumtrar wrote:
> Hi Grant!
>
> On Mon, Mar 04, 2013 at 11:14:54PM +0800, Grant Likely wrote:
> > On Mon, Mar 4, 2013 at 10:05 PM, Steffen Trumtrar
> > <s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> > > The persistent registers 1-5 are completely software defined. To have access
> > > from userspace, export them via sysfs.
> > >
> > > Signed-off-by: Steffen Trumtrar <s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >
> > Hi Steffen,
> >
> > A few comments on this. First and foremost, any additions to the
> > kernel sysfs interface must be accompanied with documentation in
> > Documentation/ABI/. Second, adding attributes to an existing device
>
> Okay. I forgot that and will add it in the next version.
>
> > that has already been registered is almost guaranteed to be wrong. The
> > attributes need to be added all at the same time so they are available
> > immediately when the new device uevent is issued by the kernel.
> >
> > Instead, the correct thing to do is add an attribute_group to the
> > child device before the device gets registered. See the 'attributes'
> > section of Documentation/driver-model/device.txt to see how to do
> > this.
> >
> > (I also see that the rtc core code is doing the wrong thing here also.
> > rtc_sysfs_add_device(), rtc_sysfs_add_device() should also be replaced
> > with an attribute group so that the sysfs files get added
> > automatically; but that is outside the scope of this patch)
> >
>
> Hm, I modeled it after other rtcs and the rtc_sysfs. Seems that I have to
> rework this.
Okay. Wait. I looked at it again. What I want to do is adding the persistent
registers as a binary-attribute. Basically having nvram like other rtcs.
Is that even possible with attribute group? Would I add the attr inside the
bin_attribute to the group then?
Or is it wrong to add these regs as binary?
Thanks,
Steffen
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2013-03-06 13:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 14:05 [PATCH 0/9] rtc: stmp3xxx: DT bindings and wakealarm Steffen Trumtrar
[not found] ` <1362405948-12992-1-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-04 14:05 ` [PATCH 1/9] MXS/i.MX28: add the possibility to define the used crystals via device tree Steffen Trumtrar
[not found] ` <1362405948-12992-2-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-07 6:17 ` Shawn Guo
2013-03-04 14:05 ` [PATCH 2/9] MXS/i.MX28: add the possibility to define the external RTC crystal Steffen Trumtrar
[not found] ` <1362405948-12992-3-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-07 6:33 ` Shawn Guo
2013-03-04 14:05 ` [PATCH 3/9] MXS/i.MX28: prepare different clocking of the built-in RTC Steffen Trumtrar
[not found] ` <1362405948-12992-4-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-07 6:40 ` Shawn Guo
2013-03-04 14:05 ` [PATCH 4/9] MXS/i.MX28: there is more than one way to clock the RTC Steffen Trumtrar
[not found] ` <1362405948-12992-5-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-07 6:48 ` Shawn Guo
[not found] ` <20130307064824.GD5372-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-03-07 8:19 ` Steffen Trumtrar
2013-03-04 14:05 ` [PATCH 5/9] MXS/i.MX28: enable RTC to wakeup the system Steffen Trumtrar
2013-03-04 14:05 ` [PATCH 6/9] rtc: stmp3xxx: add sysfs entries for persistent regs Steffen Trumtrar
[not found] ` <1362405948-12992-7-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-04 15:14 ` Grant Likely
[not found] ` <CACxGe6swW-UDH1cUw1D8P+gyhDC8nDZur-A_m_NBfeRUxcg9Jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-05 8:02 ` Steffen Trumtrar
[not found] ` <20130305080252.GA7042-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-03-06 13:27 ` Steffen Trumtrar [this message]
2013-03-04 14:05 ` [PATCH 7/9] rtc: stmp3xxx: Re-enable active alarm Steffen Trumtrar
2013-03-04 14:05 ` [PATCH 8/9] rtc: stmp3xxx: Check copy controller state Steffen Trumtrar
2013-03-04 14:05 ` [PATCH 9/9] rtc: stmp3xxx: Replace wait_time function Steffen Trumtrar
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=20130306132744.GC13810@pengutronix.de \
--to=s.trumtrar-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).