[HTC One S] Aduck79:
Thanks for your recommendation.

Tried this script: http://xdaforums.com/showthread.php?t=2121584

And then flashed Bubba Kernel. The same, no rotation or tilting :(

Maybe I should look at some logs. If there's hardware malfunctioning, then maybe I can se it in the syslogs.

EDIT: 90% of dmesg.log is filled with:

<6>[ 566.813245] [GYRO][PANASONIC] ewtzmu2daemon_ioctl: EWDAE_IOCTL_GET_AKM_READY,akm_ready= 0x0

Doesn't sound dangerous, but it's still alot of log entries.

In lastk_msg.log this is written about compas/gyro/G-sensor:

[ 1.453380] [COMP][AKM8975] AKM8975 compass driver for pana gyro: init
[ 1.453410] [COMP][AKM8975] akm8975_probe_pana:
[ 1.453471] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.453502] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.463573] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.463604] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.473706] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.473737] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.483839] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.483869] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.493941] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.493972] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.504074] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.504104] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.514176] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.514207] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.524309] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.524339] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.534411] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.534442] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.544544] qup_i2c qup_i2c.12: QUP: I2C status flags :0x1300c8, irq:228
[ 1.544575] qup_i2c qup_i2c.12: I2C slave addr:0xd not connected
[ 1.554585] [COMP][AKM8975 ERROR] AKI2C_TxData retry over 10
[ 1.554616] [COMP][AKM8975 ERROR] akm8975_probe_pana: set power down mode error
[ 1.554616] akm8975: probe of 12-000d failed with error -5
[ 1.554646] i2c-core: driver [akm8975] using legacy suspend method
[ 1.554646] i2c-core: driver [akm8975] using legacy resume method
[ 1.554677] [GYRO][PANASONIC] Panasonic Gyroscope sensor driver: init
[ 1.554677] [GYRO][PANASONIC] ewtzmu2: driver version:1.0.0.2
[ 1.554707] [GYRO][PANASONIC]
[ 1.554707] Enter ewtzmu_i2c_probe!!
[ 1.555501] [GYRO][PANASONIC] init chipset: ret value=2
[ 1.555501] [GYRO][PANASONIC] Register input device!
[ 1.555623] input: compass as /devices/virtual/input/input6
[ 1.555775] input: ewtzmu2_gyroscope as /devices/virtual/input/input7
[ 1.555837] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [0]=6
[ 1.555837] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [1]=7
[ 1.555837] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [2]=18
[ 1.555837] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [3]=5
[ 1.555867] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [4]=6
[ 1.555867] [GYRO][PANASONIC] $$$ewtzmu2_dir_polarity [5]=7
[ 1.556081] config_VILLE_gyro_diag_gpios 58 pull down
[ 1.571219] [GYRO][PANASONIC] EWTZMU2_Power_Off
[ 1.571219] [GYRO][PANASONIC] PANA:GYRO:probe success
[ 1.571249] i2c-core: driver [ewtzmu2] using legacy suspend method
[ 1.571249] i2c-core: driver [ewtzmu2] using legacy resume method
[ 1.571249] BMA250 G-sensor driver: init
[ 1.571280] BMA250 G-sensor I2C driver: gs_kvalue = 0x670B0BE8
[ 1.571463] [GSNR][BMA250] bma250_probe: CHIP ID = 0x03
[ 1.571646] [GSNR][BMA250] BMA_Init: bma250_RANGE_SEL_REG++: range = 0x03, bw = 0x1f
[ 1.572073] [GSNR][BMA250] BMA_Init: bma250_RANGE_SEL_REG:use single write--: range = 0x03, bw = 0x0a
[ 1.572195] [GSNR][BMA250] bma250_probe: I2C retry 10 times version. OK
[ 1.572226] i2c-core: driver [bma250] using legacy suspend method
[ 1.572226] i2c-core: driver [bma250] using legacy resume method

I'm not sure if it's ok.

Anyone?