Repository navigation
arm64: dts: qcom: msm8916-asus-z010d: hardware support and panel fix - #450
FoxWind-coder wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves hardware support for the Qualcomm MSM8916-based Asus Z010D device by adding support for an AP3216C/AP3426 ambient light/proximity sensor, updating the device tree for additional peripherals (charger, sensors, mount matrices), and adjusting the panel bring-up sequence/brightness.
Changes:
- Add a new IIO light driver for Dynaimage AP3216C/AP3426 and wire it into Kconfig/Makefile.
- Update the msm8916-asus-z010d device tree with SMB1360 charger and AP3426 sensor nodes, plus accelerometer mount-matrix adjustments.
- Adjust panel initialization for the Asus Z010D R69339 panel (brightness and sleep/wake sequencing).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| kernel/configs/pmos.config | Enables the new AP3216C driver as a module in the downstream config fragment. |
| drivers/iio/light/Makefile | Adds ap3216c.o to the IIO light drivers build. |
| drivers/iio/light/Kconfig | Introduces CONFIG_AP3216C option for AP3216C/AP3426. |
| drivers/iio/light/ap3216c.c | New AP3216C/AP3426 I2C IIO driver implementation. |
| drivers/gpu/drm/panel/msm8916-generated/panel-asus-z010d-r69339.c | Updates panel on-sequence and initial brightness setting. |
| arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts | Adds charger/sensor nodes and pinctrl updates for the Asus Z010D device tree. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ac7ee55 to
c64a9e8
Compare
|
|
||
| light-sensor@1e { | ||
| compatible = "dynaimage,ap3426", "dynaimage,ap3216c"; | ||
| reg = <0x1e>; |
There was a problem hiding this comment.
formatting is broken, everywhere
| pinctrl-names = "default"; | ||
| pinctrl-0 = <&smb1360_default>; |
| char *buf) | ||
| { | ||
| /* Default threshold level. Anything above 300 is considered "near" */ | ||
| return sprintf(buf, "300\n"); |
There was a problem hiding this comment.
Unless there's a good reason to hardcode, this should be a device property. The device front glass may be different for different devices for example.
| static int ap3216c_read_raw_data(struct i2c_client *client, u8 reg_low) | ||
| { | ||
| int ret_low, ret_high; | ||
|
|
||
| ret_low = i2c_smbus_read_byte_data(client, reg_low); | ||
| if (ret_low < 0) | ||
| return ret_low; | ||
|
|
||
| ret_high = i2c_smbus_read_byte_data(client, reg_low + 1); | ||
| if (ret_high < 0) | ||
| return ret_high; | ||
|
|
||
| return (ret_high << 8) | ret_low; | ||
| } |
There was a problem hiding this comment.
Is this different from either of i2c_smbus_read_word_{data,swapped}?
|
|
||
| ret = ap3216c_chip_init(client); | ||
| if (ret < 0) { | ||
| dev_err(&client->dev, "Failed to reset chip via I2C\n"); |
There was a problem hiding this comment.
IMO dev_err_probe is always better to use
| { .compatible = "dynaimage,ap3216c" }, | ||
| { } | ||
| }; | ||
| MODULE_DEVICE_TABLE(of, ap3216c_of_match); |
There was a problem hiding this comment.
new dt binding file needs to be added to document those, as a separate commit preceding the implementation.
| }; | ||
| module_i2c_driver(ap3216c_driver); | ||
|
|
||
| MODULE_AUTHOR("Alderpaw <foxy9855@gmail.com>"); |
There was a problem hiding this comment.
upstream maintainers may ask you to use ""real"" name instead of an alias
| CONFIG_RTC_DRV_HID_SENSOR_TIME=m | ||
|
|
||
| # IIO | ||
| CONFIG_AP3216C=m No newline at end of file |
There was a problem hiding this comment.
this should go into msm8916_defconfig
f314d88 to
ef39211
Compare
Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
ef39211 to
1edd42c
Compare
Add support for Dynaimage AP3216C and AP3426 ambient light, proximity and IR sensors connected over I2C. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
Enable the Dynaimage AP3216C/AP3426 ambient light and proximity sensor driver as a module. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
Configure the SMB1360 charger on I2C4 and the AP3426 light/proximity sensor on I2C2. Update the mount matrix for the KXTJ21009 accelerometer. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
…uence Fix an issue where the display remains dark during boot due to an initial brightness value of 0x0001. Set the default boot brightness to 0xffff and add a 20 ms delay before exiting sleep mode to satisfy the Renesas R69339 panel power-on sequence. Signed-off-by: Vladislav Dubrovin <foxy9855@gmail.com>
1edd42c to
dc13bb8
Compare
|
A clarifying question has also come up: I am running kernel 7.0 on msm8916, whereas the official pmaports package linux-postmarketos-qcom-msm8916 uses the LTS kernel 6.12.1. |
| CONFIG_MAGIC_SYSRQ=y | ||
| CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0 | ||
| CONFIG_DEBUG_FS=y | ||
| CONFIG_AP3216C=m |
There was a problem hiding this comment.
please generate the config from this defconfig, enable the option and then savedefconfig over it to get the new autogenerated defconfig, and make it a git commit --squash commit over the one that adds this defconfig with a note that you added the sensor (see a bunch of vXX: lines on that commit description, we'd add yours there when squashing this pr)
|
|
||
| gpio-keys { | ||
| compatible = "gpio-keys"; | ||
| label = "GPIO Buttons"; |
There was a problem hiding this comment.
a lot of churn happening in this file, is this intentional?
| status = "okay"; | ||
|
|
||
| charger@14 { | ||
| compatible = "qcom,smb1360"; |
There was a problem hiding this comment.
I'm in general confused by this commit trying to do many things at once, but specifically this change with adding the charger should be separate since the driver is not upstream, rest could be --squash into the file that introduces the file (and your either Co-developed-by or [Vladislav: changed blah blah]+ sob.
Are you by chance planning to pick up this dts for upstreaming?
| { | ||
| return i2c_smbus_read_word_data(client, reg_low); | ||
| } | ||
|
|
There was a problem hiding this comment.
is there any reason for this function now? it seems to be called only once and could as well jus call i2c one there...?
|
|
||
| data = iio_priv(indio_dev); | ||
| data->client = client; | ||
| mutex_init(&data->lock); |
There was a problem hiding this comment.
probably doesn't matter but devm_mutex_init for perfect deinit symmetry?
| vddio-supply: | ||
| description: Regulator powering the sensor VDDIO pin. |
There was a problem hiding this comment.
which pin in the datasheet is this?
Otherwise, required reading:
| vdd-supply: | ||
| description: Regulator powering the sensor VDD pin. | ||
|
|
||
| vddio-supply: | ||
| description: Regulator powering the sensor VDDIO pin. | ||
|
|
There was a problem hiding this comment.
intentionally not implemented in the driver?
|
|
||
| interrupts: | ||
| maxItems: 1 | ||
|
|
There was a problem hiding this comment.
intentionally not implemented? not sure if there's some event stuff to allow userspace be more efficient with not polling the sensor all the time...
the package will have to be updated in pmOS, which generally should include QA for included devices |
This PR brings hardware support improvements for the asus-z010d and fixes display brightness and polarisation bug.
drm/panel: asus-z010d-r69339:
Fixed the initialization sequence. The initial brightness is now set to
0xffff(previously0x0001resulted in a dark screen until backlight takeover). Inserted a necessary 20ms delay prior to exiting sleep mode to meet hardware constraints.iio: light:
Added new driver for the Dynaimage AP3216C/AP3426 ambient light and proximity sensor.
arm64: dts: qcom: msm8916-asus-z010d:
pmos.config:
pinned device photo with working sensors and battery state
Signed-off-by: Alderpaw foxy9855@gmail.com