[lkml]   [2011]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 8/9] bq27x00: Add miscdevice for each battery with ioctl for reading registers
On 11/01/2011 01:43 AM, Pali Rohár wrote:
> * When bq27x00_battery module is loaded it take control of bq27200 i2c battery chip and then it is not possible to use i2cget program from user space (returns -EBUSY)
> * This patch adds new miscdevice for each battery which has ioctl BQ27X00_READ_REG for reading battery registers from user space
> * ioctl cmd:
> #define BQ27X00_READ_REG _IO(MISC_MAJOR, 0)
> * ioctl arg:
> struct bq27x00_reg_parms {
> int reg; /* battery register (in) */
> int single; /* 1 - 8bit register, 0 - 16bit register (in) */
> int ret; /* register status, negative indicate error (out) */
> };
> Signed-off-by: Pali Rohár <>

I'm not sure if this is such a good idea. Why do you need to read the registers
from userspace? Shouldn't all relevant information be available in a
standardized format through the power_supply userspace API? If you want to use
it for debugging it might be a better idea to provide a debugfs file.

- Lars
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2011-11-01 13:13    [W:0.102 / U:6.924 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site