Re: [POWER] battery calibration parameters from sysfs

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

 



Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> wrote:
> 
> [snipped]
> 
> 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?
> 
> Or would it be preferable to do this thing by creating some
> misc device node like /dev/battery0 and a custom ioctl()?
> 
> Or is there some other way I haven't thought of?
> 
Although I'm a 'nobody' I would probably go for:
----
echo x0,y0:x1,y1:....
----

Pairs are seperated by ':' whilst values with ','.  I guess you could 
just use comma's all the way but I personally say that reduces 
readability...also means that maybe one day you want to pass only one or 
three values...the format could still work.

Easy to parse, a one liner, no fixed length, fits in with the existing 
use, etc etc.

Cheers

-- 
Alexander Clouter
.sigmonster says: You'll be sorry...

--
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