linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: cbou@mai.ru, dwmw2@infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-embedded@vger.kernel.org
Subject: Re: [POWER] battery calibration parameters from sysfs
Date: Sun, 6 Dec 2009 12:52:27 -0800	[thread overview]
Message-ID: <20091206205227.GA21681@kroah.com> (raw)
In-Reply-To: <A6D19A13FE030A409EC4362C172E091F0E0495F6@eseldmw101.eemea.ericsson.se>

On Fri, Dec 04, 2009 at 11:42:22AM +0100, Linus Walleij wrote:
> However we want to override the default table with one fed in
> though e.g. sysfs, so calibration data for the battery can reside
> in the file system. NOTE: this table is NOT of fixed length, i.e.
> we don't know how many (x,y) pairs will be passed in.
> 
> Whereas the rule for sysfs is one value per file, creating an arbitrary
> large hirarchy like this:
> 
> /sys/.../v_vs_cap/x0
> /sys/.../v_vs_cap/y0
> /sys/.../v_vs_cap/x1
> /sys/.../v_vs_cap/y2
> ...
> /sys/.../v_vs_cap/xN
> /sys/.../v_vs_cap/yN
> 
> Is probably not very elegant. (Or is it?) Would it be permissible to
> pass in a table like:
> 
> cat >/sys/.../v_vs_cap <<EOF
> x0,y0
> x1,y1
> x2,y2
> EOF
> 
> And have the kernel parse x,y pairs up to EOF?

No, please don't do this through sysfs, it is not set up to handle this
(hint, what happens if you put more than one PAGE_SIZE of data to the
file?)

Use configfs instead, that is what it is there for.

Or use userspace to handle the mapping table, that would be preferable
than to parse anything within the kernel.

thanks,

greg k-h

      parent reply	other threads:[~2009-12-06 20:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 10:42 [POWER] battery calibration parameters from sysfs Linus Walleij
2009-12-04 10:49 ` Mark Brown
2009-12-04 14:17   ` Mark Brown
2009-12-05 13:08   ` Linus Walleij
2009-12-05 17:45     ` Mark Brown
2009-12-07 11:48     ` Mark Brown
2009-12-07 14:07       ` Linus Walleij
2009-12-07 16:56         ` Mark Brown
2009-12-08  5:27           ` Brian Swetland
2009-12-08 10:28             ` Mark Brown
2009-12-13 13:24           ` Pavel Machek
2009-12-14 12:12             ` Mark Brown
2009-12-14 21:22               ` Pavel Machek
2009-12-14 23:43                 ` Aras Vaichas
2009-12-15  3:02                   ` Bill Gatliff
2009-12-15 22:58                     ` Aras Vaichas
2009-12-15 23:32                       ` Stanislav Brabec
2009-12-16  9:40                         ` Andy Green
     [not found]                           ` <4B28AAFC.5010108-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org>
2009-12-18  8:48                             ` Pavel Machek
     [not found]               ` <20091214121247.GB22388-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>
2009-12-16 22:53                 ` Pavel Machek
2009-12-13 13:19         ` Pavel Machek
2009-12-14 11:50           ` Mark Brown
2009-12-14 11:58             ` Pavel Machek
2009-12-14 12:14               ` Mark Brown
2009-12-04 11:34 ` Alexander Clouter
2009-12-06 20:52 ` Greg KH [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=20091206205227.GA21681@kroah.com \
    --to=greg@kroah.com \
    --cc=cbou@mai.ru \
    --cc=dwmw2@infradead.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).