lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Jan 2012 03:40:43 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	linux-main <linux-kernel@...r.kernel.org>
Cc:	linux-omap <linux-omap@...r.kernel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Aliaksei Katovich <aliaksei.katovich@...ia.com>,
	Vladimir Zapolskiy <vz@...ia.com>,
	Felipe Contreras <felipe.contreras@...il.com>,
	Anton Vorontsov <cbouatmailru@...il.com>,
	Joerg Reisenweber <joerg@...nmoko.org>,
	Sebastian Reichel <sre@...ian.org>,
	Ивайло Димитров 
	<freemangordon@....bg>
Subject: RFC 2: bq2415x_charger driver

Hello,

I'm sending second RFC kernel driver which can charge battery in Nokia N900. 
Now all code for bq2415x chip is in one kernel driver bq2415x_charger. This 
version working fine on Nokia N900 with kernel 2.6.28 (but should work with 
new versions too). I tested only charging (but boost mode is implemented too).

Driver has power_supply interface (without new charger interface - due to 
compatibility with n900 kernel 2.6.28) and additional sysfs entires for 
configuring bq chip.

I created this sysfs files integrated into power_supply subdir:

(rw) battery_regulation_voltage (int)
(r)  boost_status (int)
(rw) current_limit (int)
(r)  fault_status (int)
(rw) high_impedance_enable (int)
(rw) charge_current_sense_voltage (int)
(rw) charge_current_termination_enable (int)
(r)  charge_status (int)
(rw) mode (string)
(rw) otg_pin_enable (int)
(r)  otg_status (int)
(r)  regdump (string)
(rw) stat_pin_enable (int)
(rw) termination_current_sense_voltage (int)
(rw) timer (string)
(rw) weak_battery_voltage (int)

most important sysfs entry is mode:
it will configure mode (charge or boost) and current_limit. possible values:
* auto
* none (100mA)
* host (USB Host/HUB charger - 500mA)
* dedicated (USB Dedicated charger - unlimited mA)
* boost (boost mode for usb host mode - charging disabled)

auto mode depends on external platform data (now not working) - in future can 
be configured with isp1704_charger driver, which support autodetection of 
connected charger.

how to use this module on n900 to charge battery:
1. Turn off BME
2. load module
3. connect charger and set correct charger type:
 $ echo host > /sys/class/power_supply/bq24150-0/mode
 or
 $ echo dedicated > /sys/class/power_supply/bq24150-0/mode

This RFC driver has not implemented sysfs entries for configuring charge 
current sense voltage and termination current sense voltage.

-- 
Pali Rohár
pali.rohar@...il.com
View attachment "bq2415x_charger.patch" of type "text/x-patch" (41871 bytes)

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ