From: Rudraksha Gupta via B4 Relay <devnull+guptarud.gmail.com@kernel.org>
To: "Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
Rudraksha Gupta <guptarud@gmail.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: [PATCH v4 0/6] ARM: dts: qcom: msm8960: expressatt: Add more peripherals
Date: Mon, 24 Nov 2025 15:35:21 -0800 [thread overview]
Message-ID: <20251124-expressatt_nfc_accel_magn_light-v4-0-9c5686ad67e2@gmail.com> (raw)
Intro:
=================
The following is now working on the Samsung Galaxy Express SGH-I437, an
old 2012 Android phone:
- Light Sensor
- Proximity is currently floating, even though it matches downstream
GPIO pin
- Magnetometer
- Regardless of orientation:
- X axis seems to always be negative
- Y and Z axis seems to always be positive
- NFC
- Accelerometer
Tests:
=================
Light Sensor
=================
// no external light on sensor
samsung-expressatt:~$ doas monitor-sensor --light
doas (user@samsung-expressatt) password:
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has ambient light sensor (value: 0.000000, unit: lux)
Light changed: 7.000000 (lux)
// external light shining on sensor
samsung-expressatt:~$ doas monitor-sensor --light
doas (user@samsung-expressatt) password:
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has ambient light sensor (value: 0.000000, unit: lux)
Light changed: 318.000000 (lux)
Light changed: 390.000000 (lux)
Light changed: 421.000000 (lux)
=================
NFC
=================
samsung-expressatt:~$ sudo nfctool -d nfc0 -1 -p
doas (user@samsung-expressatt) password:
nfc0:
Tags: [ ]
Devices: [ ]
Protocols: [ Felica MIFARE Jewel ISO-DEP NFC-DEP ]
Powered: Yes
RF Mode: None
lto: 150
rw: 15
miux: 2047
Start polling on nfc0 as initiator
Targets found for nfc0
Tags: [ tag0 ]
Devices: [ ]
=================
Magnetometer
=================
// no matter the orientation x is always negative and y and z are always
// positive. The values seem to be changing during rotation, but for some
// reason the magnitude is extremely large
/sys/bus/iio/devices/iio:device1 # cat in_magn_x_raw && cat \
in_magn_y_raw && cat in_magn_z_raw
-441672
1223706
3275580
=================
Accelerometer
=================
// Rotating the device with `monitor-sensor --accel` running yields the
// correct output:
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy
More Information:
=================
- Device page:
https://wiki.postmarketos.org/wiki/Samsung_Galaxy_Express_SGH-I437_(samsung-expressatt)
- Downstream kernel (uses board files):
https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm-12.0-YNG4N/arch/arm/mach-msm/board-express.c
Note: These patches were assisted with AI (specifically Claude) as it
was easily able to translate the old board file into a DTS format that
mainline understands.
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
Changes in v4:
- corrected accelerometer's mount matrix
- fix a nullptr issue in the accelerometer's driver code
- Link to v3: https://lore.kernel.org/r/20251122-expressatt_nfc_accel_magn_light-v3-0-78d198632360@gmail.com
Changes in v3:
- More formatting changes
- Remove output-low on nfc_enable
- Resolved TODO mount matrix for accelerometer. My tests are above.
- Will try to eventually solve the following problems:
- Couldn't figure out the mount matrix for magnetometer
- Proximity is a floating value even though the downstream kernel
matches the GPIO pin
- Link to v2: https://lore.kernel.org/r/20251121-expressatt_nfc_accel_magn_light-v2-0-54ce493cc6cf@gmail.com
Changes in v2:
- Fixed formatting issues
- Use GSBI instead of i2c-gpio
- Remove regulator-always-on
- Link to v1: https://lore.kernel.org/r/20251119-expressatt_nfc_accel_magn_light-v1-0-636f16f05cf4@gmail.com
---
Rudraksha Gupta (6):
ARM: dts: qcom: msm8960: Add GSBI2 & GSBI7
ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor
ARM: dts: qcom: msm8960: expressatt: Add NFC
ARM: dts: qcom: msm8960: expressatt: Add Magnetometer
iio: accel: Prevent NULL pointer dereference in interrupt setup
ARM: dts: qcom: msm8960: expressatt: Add Accelerometer
.../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 109 +++++++++++++++++++++
arch/arm/boot/dts/qcom/qcom-msm8960.dtsi | 96 ++++++++++++++++++
drivers/iio/accel/bmc150-accel-core.c | 3 +
3 files changed, 208 insertions(+)
---
base-commit: a771210bab42017434c91411e16694ac4fd7afc2
change-id: 20251119-expressatt_nfc_accel_magn_light-f78e02897186
prerequisite-message-id: <176210698639.937813.643585209118839199.b4-ty@kernel.org>
prerequisite-patch-id: befdfe1948c2fbfb867597a6de917c8067fd57be
prerequisite-patch-id: 70a2b0837b9846d8a775f464295da73ca8ff26b4
prerequisite-patch-id: 20e005aa4312c3525e1b90f33a398189b9e2b3b7
prerequisite-patch-id: 970e0eb8af1736e4565fc37830576a67bf7b3227
prerequisite-patch-id: babd3b55d9ff28f19dbc3f7978742c58ef436aee
Best regards,
--
Rudraksha Gupta <guptarud@gmail.com>
next reply other threads:[~2025-11-24 23:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 23:35 Rudraksha Gupta via B4 Relay [this message]
2025-11-24 23:35 ` [PATCH v4 1/6] ARM: dts: qcom: msm8960: Add GSBI2 & GSBI7 Rudraksha Gupta via B4 Relay
2025-11-24 23:35 ` [PATCH v4 2/6] ARM: dts: qcom: msm8960: expressatt: Add Light/Proximity Sensor Rudraksha Gupta via B4 Relay
2025-11-24 23:35 ` [PATCH v4 3/6] ARM: dts: qcom: msm8960: expressatt: Add NFC Rudraksha Gupta via B4 Relay
2025-11-24 23:35 ` [PATCH v4 4/6] ARM: dts: qcom: msm8960: expressatt: Add Magnetometer Rudraksha Gupta via B4 Relay
2025-11-24 23:35 ` [PATCH v4 5/6] iio: accel: Prevent NULL pointer dereference in interrupt setup Rudraksha Gupta via B4 Relay
2025-11-25 10:45 ` Konrad Dybcio
2025-11-25 11:14 ` Andy Shevchenko
2025-11-25 21:23 ` Rudraksha Gupta
2025-11-27 18:38 ` Konrad Dybcio
2025-11-27 18:55 ` Andy Shevchenko
2025-12-01 0:44 ` Rudraksha Gupta
2025-11-24 23:35 ` [PATCH v4 6/6] ARM: dts: qcom: msm8960: expressatt: Add Accelerometer Rudraksha Gupta via B4 Relay
2025-11-25 10:48 ` [PATCH v4 0/6] ARM: dts: qcom: msm8960: expressatt: Add more peripherals Konrad Dybcio
2026-01-21 2:35 ` (subset) " Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251124-expressatt_nfc_accel_magn_light-v4-0-9c5686ad67e2@gmail.com \
--to=devnull+guptarud.gmail.com@kernel.org \
--cc=andersson@kernel.org \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=guptarud@gmail.com \
--cc=jic23@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®