Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Rudolph
lede-mikrotik
Commits
970b4c6a
Commit
970b4c6a
authored
14 years ago
by
Michael Büsch
Browse files
Options
Downloads
Patches
Plain Diff
n810bm: Set minimum voltage threshold to 3200
SVN-Revision: 25433
parent
2d3ed6dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch
+13
-14
13 additions, 14 deletions
...omap24xx/patches-2.6.37/900-n810-battery-management.patch
with
13 additions
and
14 deletions
target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch
+
13
−
14
View file @
970b4c6a
...
...
@@ -41,8 +41,8 @@ Index: linux-2.6.37/drivers/cbus/Makefile
Index: linux-2.6.37/drivers/cbus/n810bm_main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.37/drivers/cbus/n810bm_main.c 2011-02-09 1
3:47:23.831144291
+0100
@@ -0,0 +1,116
9
@@
+++ linux-2.6.37/drivers/cbus/n810bm_main.c 2011-02-09 1
9:05:18.435536304
+0100
@@ -0,0 +1,116
8
@@
+/*
+ * Nokia n810 battery management
+ *
...
...
@@ -86,7 +86,7 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+#define N810BM_PMM_BLOCK_SIZE 0x600
+
+#define N810BM_CHECK_INTERVAL (HZ * 2)
+#define N810BM_MIN_VOLTAGE_THRES 3
3
00 /* Absolute minimum voltage threshold */
+#define N810BM_MIN_VOLTAGE_THRES 3
2
00 /* Absolute minimum voltage threshold */
+
+
+/* RETU_ADC_BSI
...
...
@@ -612,7 +612,6 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+ struct n810bm, periodic_check_work);
+ u16 status;
+ bool battery_was_present, charger_was_present;
+ bool force_charge = 0;
+ int mv;
+
+ mutex_lock(&bm->mutex);
...
...
@@ -646,23 +645,23 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+ bm->charger_present ? "plugged in" : "removed");
+ }
+
+ if (bm->battery_present && !lipocharge_is_charging(&bm->charger)) {
+ if ((bm->battery_present && !bm->charger_present) ||
+ !n810bm_known_battery_present(bm)){
+ /* We're draining the battery */
+ mv = n810bm_measure_batt_voltage(bm);
+ if (mv < 0)
+ n810bm_emergency(bm, "check timer: Failed to measure");
+ if (!bm->charger_present) {
+ if (mv < N810BM_MIN_VOLTAGE_THRES) {
+ n810bm_emergency(bm, "check timer: "
+ "Minimum voltage threshold reached");
+ }
+ force_charge = 1;
+ if (mv < 0) {
+ n810bm_emergency(bm,
+ "check: Failed to measure voltage");
+ }
+ if (mv < N810BM_MIN_VOLTAGE_THRES) {
+ n810bm_emergency(bm,
+ "check: Minimum voltage threshold reached");
+ }
+ }
+
+ if (bm->charger_present && n810bm_known_battery_present(bm)) {
+ /* Known battery and charger are connected */
+ if (bm->charger_enabled
|| force_charge
) {
+ if (bm->charger_enabled) {
+ /* Charger is enabled */
+ if (!lipocharge_is_charging(&bm->charger)) {
+ //TODO start charging, if battery is below some threshold
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment