Re: [POWER] battery calibration parameters from sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux