Project

General

Profile

AKM8976A » History » Version 7

Paul Kocialkowski, 07/02/2011 10:15 AM

1 1 Paul Kocialkowski
=  AKM8976A =
2
3
The goal here is to add support for AKM8976A to akmd-free (a free rewrite of akmd, the daemon that deals with the accelerometer/magnetometer data for a few chips, including AKM ones). 
4
This page is to coordinate the work around this goal.
5
6
== Current status ==
7
8 2 Paul Kocialkowski
=== Global tasks achievement ===
9 1 Paul Kocialkowski
10 2 Paul Kocialkowski
|| Task || Achievement ||
11
|| Modifying the kernel driver to print the requests akmd makes (ioctl, etc) || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] ||
12
|| Get an idea of how it works (what akmd does after what) || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] ||
13
|| Define the exact steps that akmd follows || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] ||
14
|| Implement AKM8976A in akmd-free without any data treatment yet || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] ||
15
|| Understand how the data is treated (algorithms, etc) || [[span(Work in progress , style=background: orange; color: white; display: inline-block; width: 100%;)]] ||
16
|| Reproduce the data treatment with standard C code || [[span(Work in progress , style=background: orange; color: white; display: inline-block; width: 100%;)]] ||
17 5 Paul Kocialkowski
|| Include the data treatment code in akmd-free || [[span(ToDo , style=background: red; color: white; display: inline-block; width: 100%;)]] ||
18
|| Check that everything is OK on different devices || [[span(ToDo , style=background: red; color: white; display: inline-block; width: 100%;)]] ||
19 1 Paul Kocialkowski
20 3 Paul Kocialkowski
=== Specific tasks achievement ===
21
22 5 Paul Kocialkowski
==== Initialization/calibration sequence ====
23 3 Paul Kocialkowski
24
|| Task || Global achievement || Understood || Reproduced || Implemented ||
25 5 Paul Kocialkowski
|| Before the first ECS_IOCTL_GETDATA || [[span(Mostly done , style=background: orange; color: white; display: inline-block; width: 100%;)]] || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] || [[span(Done , style=background: green; color: white; display: inline-block; width: 100%;)]] || [[span(ToDo , style=background: red; color: white; display: inline-block; width: 100%;)]]
26 1 Paul Kocialkowski
27
== Getting started ==
28
29 5 Paul Kocialkowski
Note that before everything, coming on our IRC channel [https://www.jappix.com/?r=replicant%25irc.freenode.net@irc.jappix.com #replicant on irc.freenode.net] and introducing yourself is essential: you'll be able to get help there and, of course, if you want to join the effort, communication is fundamental. 
30
31
If you plan to join the effort to achieve this goal, here are the steps: 
32
33 6 Paul Kocialkowski
 * Downloading and setting up the akm8976a-dev branch for kernel-msm (which contains a modified version of ''drivers/misc/akm8976.c'')
34
 * Downloading some scripts that are useful to debug fast
35
 * Download and build the re_set_data tool (to inject some data to the kernel)
36 7 Paul Kocialkowski
 * Generate the file containing the "phone" button pressed sequence. 
37
 * Get the non-free akmd. 
38 5 Paul Kocialkowski
39
== Using the scripts/tools ==
40 1 Paul Kocialkowski
41
First of all, you need to know that the kernel-side driver that is used for AKM8976A is located at ''drivers/misc/akm8976.c''.
42
This file has been modified in order to:
43 6 Paul Kocialkowski
 * make it trace (print) all the ioctl
44
 * make it possible to inject data 
45
46
Note that before you run any of the scripts, you need to start adb server as root:
47
{{{ # adb start-server }}}
48
49
Here is a list of the scripts, what they do and how to use them:
50
 * '''replicant_kern_debug.sh''': this one is to get the debug messages from the kernel. It requires no special parameter, nor any specific location to be lunched in. 
51 7 Paul Kocialkowski
 * '''replicant_calib_kern.sh''': this script should be used while working on the calibration part. The 2 remaining initialisation sequences we miss start with { 4, 235 } and { 4, 241 } and this script is to print the calibration values for these sequences (when the kernel printk the values, so when akmd sends them). To use it, pass 235 or 241 as first argument to the script, for the first or 2nd initialisation sequence we miss. 
52
 * '''replicant_calib_adb.sh''':