[Galaxy S II Q&A, Help & Troubleshooting] LyonSK:
Guys, I'm fighting with the compass/orientation sensor issue in ICS + JB for i9100G

I don't have any experience with the kernel dev but I tried to check the source codes. That sensor seems to be AK8975 chip.

When I flash GB 2.3.6. I see the device /dev/akm8975, this is not the case for ICS and JB, even not for the offcial ICS...

When I check source of CM for i9100g there is some other device driver for magnetic sensor:

https://github.com/teamhacksung/GT-I9100G_ClockworkMod-Recovery/tree/gingerbread/kernel/drivers/sensors/compass

CM for i9100 has it:

https://github.com/dorimanx/Dorimanx-SG2-I9100-Kernel/tree/master-3.0.y/drivers/sensor

This is what I see in the logcat for CM10:

I/dalvikvm( 143): System server process 307 has been created

I/Zygote ( 143): Accepting command socket connections

D/dalvikvm( 307): WAIT_FOR_CONCURRENT_GC blocked 0ms

E/BatteryService( 307): batteryPresentPath not found

I/sysproc ( 307): Entered system_init()

I/sysproc ( 307): ServiceManager: 0x51109a40

D/SensorService( 307): nuSensorService starting...

I/MPL-mlsl( 307): MLSLSerialOpen: /dev/mpu

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 03ff

E/AKMD2 ( 307): couldn't find 'event1' input device

E/AKMD2 ( 307): libakm : Magnetometer Initialization Failed.

E/Sensors ( 307): couldn't find 'compass_sensor' input device

E/AKMD2 ( 307): akm_disable_sensor(7)

D/MPLSensor( 307): handle : 0 en: 0

D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0

D/MPLSensor( 307): MLSetMPUSensors: 0

D/MPLSensor( 307): set_power_states > MLDmpStart()

I/ ( 307): mpu3050_resume: Resuming to 0000

D/MPLSensor( 307): set_power_states > MLDmpStop()

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 0000

D/MPLSensor( 307): set_power_states > MLStoreCalibration()

D/MPLSensor( 307): handle : 1 en: 0

D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0

D/MPLSensor( 307): set_power_states > MLDmpStart()

I/ ( 307): mpu3050_resume: Resuming to 0000

D/MPLSensor( 307): set_power_states > MLDmpStop()

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 0000

D/MPLSensor( 307): set_power_states > MLStoreCalibration()

D/MPLSensor( 307): handle : 2 en: 0

D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0

D/MPLSensor( 307): set_power_states > MLDmpStart()

I/ ( 307): mpu3050_resume: Resuming to 0000

D/MPLSensor( 307): set_power_states > MLDmpStop()

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 0000

D/MPLSensor( 307): set_power_states > MLStoreCalibration()

D/MPLSensor( 307): handle : 3 en: 0

D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0

D/MPLSensor( 307): set_power_states > MLDmpStart()

I/ ( 307): mpu3050_resume: Resuming to 0000

D/MPLSensor( 307): set_power_states > MLDmpStop()

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 0000

D/MPLSensor( 307): set_power_states > MLStoreCalibration()

D/MPLSensor( 307): handle : 4 en: 0

D/MPLSensor( 307): enabled_sensors: 0 dmp_started: 0

D/MPLSensor( 307): set_power_states > MLDmpStart()

I/ ( 307): mpu3050_resume: Resuming to 0000

D/MPLSensor( 307): set_power_states > MLDmpStop()

I/ ( 307): mpu3050_suspend: suspending sensors to 0000

I/ ( 307): mpu3050_suspend: Will resume next to 0000

D/MPLSensor( 307): set_power_states > MLStoreCalibration()

I/SensorService( 307): MPL rotation vector

I/SensorService( 307): MPL linear accel

I/SensorService( 307): MPL gravity

I/SensorService( 307): MPU3050 Gyroscope sensor

I/SensorService( 307): KXTF9 3-axis Accelerometer

I/SensorService( 307): AK8975 Magnetic field Sensor

I/SensorService( 307): AK8975 Orientation Sensor

I/SensorService( 307): CM3663 Light sensor

I/SensorService( 307): CM3663 Proximity sensor

Strange thing is, that even I don't see any reference in the source codes for the AK8975 I can see this in here:

cm-10-20120731-EXPERIMENTAL-i9100g-CODEWORKX.zip\system\lib\hw\sensors.omap4.so

this:

AK8975 Magnetic field Sensor Asahi Kasei Microdevices AK8975 Orientation Sensor CM3663 Light sensor CAPELLA CM3663 Proximity sensor /dev/input couldn't find '%s' input device Couldn't open %s (%s) AkmSensor: unknown event (type=%d, code=%d) libakm.so AkmSensor: unable to load AKM Library, %s akm_is_sensor_enabled akm_enable_sensor akm_disable_sensor akm_set_delay poll_delay %lld enable Could not change sensor state (%s) compass_sensor

Any ideas? :)