Proximity sensor not coming back after killing all sensors with HKS
While on a call I just noticed that the display would not be blanking (and my cheek started wildly generating touch inputs), so I checked with monitor-sensor
and it told me === No proximity sensor
.
On a fresh boot the proximity sensor is there and working fine.
If I then engage all killswitches all sensors (accelerometer, ALS and proximity) are still being shown with the sensor readings frozen to what they last reported:
> $ monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== Has ambient light sensor (value: 0.000000, unit: lux)
=== Has proximity sensor (near: 0)
Light changed: 5.640000 (lux)
Light changed: 4.080000 (lux)
Light changed: 0.360000 (lux)
Proximity value changed: 1
Light changed: 3.000000 (lux)
Proximity value changed: 0
Light changed: 4.440000 (lux)
Light changed: 4.320000 (lux)
<snip>
Light changed: 4.440000 (lux)
Light changed: 4.320000 (lux)
;;; ALL HKS ENGAGED: I expected that I get a message, that the sensors disappeared
^C
> $ monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== Has ambient light sensor (value: 4.320000, unit: lux)
=== Has proximity sensor (near: 0)
This is lsmod
(hope it's relevant?) with with all HKS engaged:
I'm not sure which modules I'd expect to show up here,
st_lsm6d
(for gyro/accelerometer/etc right?) was the only thing I could somewhat identify
> $ lsmod
Module Size Used by
aes_ce_ccm 16384 1
exfat 86016 1
algif_hash 20480 0
algif_skcipher 20480 0
af_alg 32768 2 algif_hash,algif_skcipher
rfcomm 86016 0
bnep 28672 2
qmi_wwan 36864 0
cdc_wdm 28672 1 qmi_wwan
usbnet 53248 1 qmi_wwan
mii 20480 1 usbnet
option 61440 0
usb_wwan 24576 1 option
usbserial 57344 2 usb_wwan,option
caam_jr 159744 0
caamhash_desc 16384 1 caam_jr
caamalg_desc 36864 1 caam_jr
crypto_engine 20480 1 caam_jr
mousedev 24576 0
usb_f_acm 20480 2
u_serial 32768 3 usb_f_acm
uas 28672 0
usb_f_ecm 24576 2
u_ether 32768 1 usb_f_ecm
usb_storage 81920 2 uas
redpine_sdio 36864 0
redpine_91x 131072 1 redpine_sdio
bluetooth 749568 11 bnep,redpine_91x,rfcomm
snd_soc_simple_card 24576 6
snd_soc_simple_card_utils 28672 1 snd_soc_simple_card
pwm_vibra 16384 0
snd_soc_gtm601 16384 1
mac80211 958464 2 redpine_sdio,redpine_91x
hantro_vpu 143360 0
v4l2_vp9 24576 1 hantro_vpu
st_lsm6dsx_spi 20480 0
v4l2_h264 16384 1 hantro_vpu
cfg80211 913408 2 mac80211,redpine_91x
imx_media_common 49152 0
v4l2_mem2mem 40960 1 hantro_vpu
videobuf2_dma_contig 24576 2 imx_media_common,hantro_vpu
videobuf2_memops 20480 1 videobuf2_dma_contig
videobuf2_v4l2 32768 3 imx_media_common,hantro_vpu,v4l2_mem2mem
dw9714 20480 0
videobuf2_common 65536 6 imx_media_common,videobuf2_dma_contig,videobuf2_v4l2,hantro_vpu,v4l2_mem2mem,videobuf2_memops
leds_lm3560 16384 0
st_lsm6dsx_i2c 20480 0
gnss_mtk 16384 0
snd_soc_wm8962 98304 1
snd_soc_fsl_sai 32768 4
vcnl4000 24576 0
gnss_serial 20480 1 gnss_mtk
imx_pcm_dma 16384 1 snd_soc_fsl_sai
industrialio_triggered_buffer 16384 1 vcnl4000
v4l2_flash_led_class 16384 1 leds_lm3560
v4l2_fwnode 28672 0
st_lsm6dsx 45056 2 st_lsm6dsx_i2c,st_lsm6dsx_spi
v4l2_async 28672 4 imx_media_common,v4l2_fwnode,v4l2_flash_led_class,dw9714
kfifo_buf 16384 2 industrialio_triggered_buffer,st_lsm6dsx
snd_soc_core 266240 6 imx_pcm_dma,snd_soc_simple_card_utils,snd_soc_gtm601,snd_soc_simple_card,snd_soc_wm8962,snd_soc_fsl_sai
edt_ft5x06 32768 0
snd_pcm_dmaengine 20480 1 snd_soc_core
gnss 16384 1 gnss_serial
videodev 266240 8 v4l2_async,imx_media_common,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hantro_vpu,videobuf2_common,v4l2_mem2mem
caam 20480 1 caam_jr
mc 61440 8 videodev,imx_media_common,v4l2_flash_led_class,videobuf2_v4l2,dw9714,hantro_vpu,videobuf2_common,v4l2_mem2mem
snd_pcm 135168 5 snd_soc_simple_card_utils,snd_soc_core,snd_soc_wm8962,snd_soc_fsl_sai,snd_pcm_dmaengine
error 24576 4 caamalg_desc,caamhash_desc,caam,caam_jr
snd_timer 40960 1 snd_pcm
snd 94208 15 snd_timer,snd_soc_core,snd_pcm
soundcore 16384 1 snd
imx2_wdt 20480 0
watchdog 32768 1 imx2_wdt
rfkill_hks 20480 0
rfkill 36864 9 rfkill_hks,bluetooth,redpine_91x,cfg80211
libcomposite 77824 12 usb_f_ecm,usb_f_acm
ledtrig_timer 16384 0
ledtrig_pattern 16384 0
fuse 139264 5
zram 40960 2
ip_tables 32768 0
x_tables 49152 1 ip_tables
ipv6 532480 46
ofpart 20480 0
xhci_plat_hcd 20480 0
xhci_hcd 290816 1 xhci_plat_hcd
spi_nor 102400 0
aes_ce_blk 36864 0
usbcore 315392 10 usbserial,xhci_hcd,usbnet,usb_storage,cdc_wdm,usb_wwan,qmi_wwan,uas,xhci_plat_hcd,option
mtd 86016 4 spi_nor,ofpart
crct10dif_ce 20480 1
ghash_ce 24576 0
sha2_ce 20480 0
bq25890_charger 32768 0
phy_fsl_imx8mq_usb 20480 6
sha1_ce 20480 0
dwc3 155648 1
cdns_mhdp_imx 28672 0
ulpi 20480 1 dwc3
udc_core 73728 6 u_ether,u_serial,usb_f_ecm,libcomposite,usb_f_acm,dwc3
cdns_mhdp_drmcore 49152 1 cdns_mhdp_imx
imx_dcss 40960 3
usb_common 20480 6 xhci_hcd,usbcore,libcomposite,xhci_plat_hcd,dwc3,udc_core
drm_dp_helper 147456 1 cdns_mhdp_drmcore
tps6598x 77824 0
typec 65536 1 tps6598x
roles 20480 2 tps6598x,dwc3
clk_bd718x7 20480 0
snvs_pwrkey 16384 0
imx_sdma 32768 6
virt_dma 20480 1 imx_sdma
dmesg
didn't show any indication that the sensors were gone (modem and wifi show up)
Now I ran monitor-sensor
again and enabled the camera HKS (afaik sensors are only killed if all 3 HKS are engaged, right?)
> $ monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== Has ambient light sensor (value: 4.320000, unit: lux)
=== Has proximity sensor (near: 0)
;;; NOW ENABLE CAMERA HKS
--- Light sensor disappeared
--- Proximity sensor disappeared
+++ Light sensor appeared
This is from dmesg
when I enabled the camera HKS:
[ 1923.414007] imx7_media_csi: module is from the staging directory, the quality is unknown, you have been warned.
[ 1923.416549] imx7-csi 30a90000.csi: Registered csi capture as /dev/video0
[ 1923.417557] imx7-csi 30b80000.csi: Registered csi capture as /dev/video2
[ 1923.428577] imx8mq_mipi_csi2: module is from the staging directory, the quality is unknown, you have been warned.
[ 1923.447829] s5k3l6xx 3-002d: using default 24000000 Hz clock frequency
[ 1923.447870] of_get_named_gpiod_flags: parsed 'rstn-gpios' property of node '/soc@0/bus@30800000/i2c@30a50000/camera@2d[0]' - status (0)
[ 1923.447905] s5k3l6xx 3-002d: probe i2c ffff0000035bec00
[ 1923.451213] s5k3l6xx 3-002d: model low: 0x30
[ 1923.451598] s5k3l6xx 3-002d: model high: 0xC6
[ 1923.451969] s5k3l6xx 3-002d: revision number: 0xB0
[ 1923.464666] debugfs: Directory 's5k3l6' with parent '/' already present!
[ 1923.483033] hi846 2-0020: GPIO lookup for consumer reset
[ 1923.483055] hi846 2-0020: using device tree for GPIO lookup
[ 1923.483075] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/soc@0/bus@30800000/i2c@30a40000/camera@20[0]' - status (0)
[ 1923.483110] gpio gpiochip0: Persistence not supported for GPIO 25
[ 1923.483122] hi846 2-0020: GPIO lookup for consumer shutdown
[ 1923.483126] hi846 2-0020: using device tree for GPIO lookup
[ 1923.483142] of_get_named_gpiod_flags: parsed 'shutdown-gpios' property of node '/soc@0/bus@30800000/i2c@30a40000/camera@20[0]' - status (0)
[ 1923.483162] gpio gpiochip4: Persistence not supported for GPIO 4
[ 1923.485975] hi846 2-0020: chip id 08 46 using 2 mipi lanes
[ 1923.490673] debugfs: Directory 'hi846' with parent '/' already present!
[ 1923.497418] hi846 2-0020: debugfs create dir error
Now if I restart monitor-sensor
:
> $ monitor-sensor
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: right-up)
=== Has ambient light sensor (value: 4.200000, unit: lux)
=== No proximity sensor