Skip to content

Comments

Add sdm632-motorola-river (Moto G7), PMI632 fuel gauge and charger, s5k4h7yx and s5k5e9 cameras#239

Open
valpackett wants to merge 18 commits intomsm8953-mainline:barni2000/6.19/developfrom
valpackett:river
Open

Add sdm632-motorola-river (Moto G7), PMI632 fuel gauge and charger, s5k4h7yx and s5k5e9 cameras#239
valpackett wants to merge 18 commits intomsm8953-mainline:barni2000/6.19/developfrom
valpackett:river

Conversation

@valpackett
Copy link

Works:

Missing:

  • audio (bonkers setup essentially outsourcing all DSP to an external Cirrus chip; I can get both cs47l35 and cs35l41 to attach but then there's all the routing and configuration…)
  • haptics (my variant has the AW8691, I've added it to the AW8695 driver but it tries to read the f0 thingy which is apparently absent on this model? // DRV2624 is possibly used on other variants)
  • main camera (couldn't find a ready-made driver for ov12a10, shouldn't be hard but I haven't had the time to make/port one)
  • focus vcm (apparently the wide camera might also have one? hm)
  • sx933x prox sensor (not part of the sensor hub)
  • NFC (apparently should be present on the European variant? absent on mine soooo..)

@barni2000
Copy link
Member

Please remove the panel drivers from your PR and add the configuration here https://github.com/msm8953-mainline/linux-panel-drivers.

On some devices dmesg get spamemd ~10 times per second with:

  novatek-nvt-ts 0-0001: slot 14 out of range, ignoring

Demote this print to dev_dbg. This might indicate that
perhaps firmware update is needed to report correct number of
touches and cause inconsistencies with ones reported in IRQ?

At the same time report max_touches reported by firmware as
dev_info so it can be seen in dmesg once.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Val Packett <val@packett.cool>
Sometimes Novatek touchscreen is paired together with Novatek panel,
and they both need to be powered together in sync.

Add support for nvt-ts driver to operate in panel follower mode, in
which touchscreen isn't in full control of its lifecycle.
This is managed using callbacks from panel, to get informed when the
panel is powered on and off. From there we can match the nvt-ts
device's power state to that of the panel.

Without this probing touchscreen before panel sometimes randomly fails
with I2C read errors.

 * split some code from probe function to separate initial_power_on
   function, which is called once from panel_prepared callback, or
   from probe function, depending on mode;
 * update Kconfig to depend on DRM.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Val Packett <val@packett.cool>
valpackett and others added 16 commits February 21, 2026 23:01
…nput is initialized

[  110.763493] novatek-nvt-ts 0-0001: on_novatek_panel_unpreparing
[  110.763601] Unable to handle kernel NULL pointer dereference at virtual address 00000000000001f8

Signed-off-by: Val Packett <val@packett.cool>
The Motorola Moto G7 is a smartphone based on the SDM632 SoC.
Add an initial device tree for it.

Signed-off-by: Val Packett <val@packett.cool>
This is battery fuel gauge driver for pmic5 (PMI632/PM6150/PM7250B)
and pmic-lite (PM2250).

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Val Packett <val@packett.cool>
power: supply: qcom_qg: sort includes

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

power: supply: qcom_qg: use chip->dev in probe instead of pdev->dev

It's equivalent but this makes it a bit more unified instead of
mix-and-match.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

power: supply: qcom_qg: add error handling to sysfs property

And invert the condition for PROP_CHARGE_FULL

power: supply: qcom_qg: fix temp unit

It's 1/10th degree celsius (see sysfs docs) and not 1/1000th degree
celsius (see vadc driver)

power: supply: qcom_qg: set technology to Li-ion

While PM7250B appears to also support Li-polymer batteries, it's
primarily for Li-ion batteries.

power: supply: qcom_qg: use nvmem framework for reading sdam

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

power: supply: qcom_qg: 6.17 compile fix

---

Signed-off-by: Val Packett <val@packett.cool>
battery current should be negative for charging batteries, inevrt it so
it's correct. Fixes upower charging status reporting.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Val Packett <val@packett.cool>
FROMLIST v1 power: supply: qcom_smbx: allow disabling charging

Hook up USBIN_CMD_IL so that writing "0" to the status register will
disable charging, this is useful to let users limit charging
automatically.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>

FROMLIST v1 power: supply: qcom_smbx: respect battery charge-term-current-microamp

Respect the max current limit set on the battery node, one some devices
this is set conservatively to avoid overheating since they only have a
single charger IC (instead of two in parallel).

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>

FROMLIST v1 power: supply: qcom_smbx: bump up the max current

I set a super conservative current limit since we lack many of the
safety features (thermal monitoring, etc) that these drivers really
need. However now we have a better understanding of the hardware, it's
fine to bump this limit up a bit, devices can additionally set the max
current via devicetree instead.

Since this is common to smb2 and smb5, move this write out of the init
sequence and into probe proper.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>

FROMLIST v1 power: supply: qcom_smbx: remove unused registers

Remove registers and bits that aren't used to make things a bit more
readable.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>

FROMLIST v1 power: supply: qcom_smbx: add smb5 support

Introduce support for the SMB5 charger found on pm8150b and other more
modern Qualcomm SoCs.

SMB5 is largely similar to SMB2, with a few register differences. The
main difference is the new Type-C hardware block which some registers
are moved to.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>

FROMLIST v1 power: supply: qcom_smbx: program aicl rerun time

We don't know what the bootloader programmed here, but we want to have a
consistent value. Program the automatic input current limit detection to
re-run every 3 seconds. This seems to be necessary at least for smb5.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
SQUASHME power: supply: qcom_smbx: fixups for smb5 introduction

SQUASHME2 power: supply: qcom_smbx: fixups for smb5 introduction

Some Type-C bits maybe shouldn't be here but queried from tcpm driver?
Not sure how this would work cleanly. Or just ignore it, and return 0
when it's in sink mode. Could also work and it much less effort for now.

WIP smb5 for pmi632

---
Signed-off-by: Val Packett <val@packett.cool>
Required for the upcoming fuel gauge node.

Signed-off-by: Val Packett <val@packett.cool>
Add a node for the "qgauge" battery fuel gauge.

Signed-off-by: Val Packett <val@packett.cool>
Add a node for the SMB5 battery charger.

Signed-off-by: Val Packett <val@packett.cool>
…el gauge

This device has a 3000 mAh battery, and uses PMI632 fuel gauge and charger.

Signed-off-by: Val Packett <val@packett.cool>
SMBCHG is for the MSM8953, qgauge and SMBX are for SDM632.

Signed-off-by: Val Packett <val@packett.cool>
Add a v4l2 sub-device driver for the Samsung S5K5E9 image sensor.
This is a camera sensor using the i2c bus for control and the
csi-2 bus for data.

Signed-off-by: Vitalii Skorkin <nikroksm@mail.ru>
Signed-off-by: Val Packett <val@packett.cool>
@valpackett
Copy link
Author

Added a "bonus" fix for the novatek touchscreen panel follower patch, it was dereferencing NULL due to the unprepare callback being called (why o.0) before the input device was even created, on some boots.

status = "okay";
};

&hsusb_phy {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move under the gpu_zap_shader

status = "okay";
};

&i2c_3 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move above the mdss node

};
};

&lpass {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move with i2c node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants