Skip to content

arm64: dts: qcom: msm8916-asus-z010d: hardware support and panel fix - #450

Open
FoxWind-coder wants to merge 4 commits into
msm8916-mainline:wip/msm8916/7.0from
FoxWind-coder:asus-z010d-improvements
Open

arm64: dts: qcom: msm8916-asus-z010d: hardware support and panel fix#450
FoxWind-coder wants to merge 4 commits into
msm8916-mainline:wip/msm8916/7.0from
FoxWind-coder:asus-z010d-improvements

Conversation

@FoxWind-coder

@FoxWind-coder FoxWind-coder commented Aug 12, 2026

Copy link
Copy Markdown

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 (previously 0x0001 resulted 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:

  • Added the SMB1360 charger node.
  • Added the AP3426 ALS and proximity sensor node.
  • Fixed mount matrix for accelerometers

pmos.config:

  • Added CONFIG_AP3216C=m as specified in the APKBUILD
pinned device photo with working sensors and battery state -2147483648_-212695

Signed-off-by: Alderpaw foxy9855@gmail.com

Copilot AI lite review requested due to automatic review settings August 12, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread drivers/gpu/drm/panel/msm8916-generated/panel-asus-z010d-r69339.c
Comment thread arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts
Comment thread arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts Outdated
Comment thread drivers/iio/light/ap3216c.c Outdated
Comment thread drivers/iio/light/ap3216c.c Outdated
Comment thread arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts Outdated
Comment thread drivers/iio/light/ap3216c.c
@FoxWind-coder
FoxWind-coder force-pushed the asus-z010d-improvements branch from 96d3335 to ac7ee55 Compare August 12, 2026 16:41
Alderpaw added 4 commits August 12, 2026 16:53
Configure the SMB1360 charger on I2C4, the AP3426 light/proximity
sensor on I2C2, and their respective pinctrl states. Update
the mount matrix for the KXTJ21009 accelerometer and define
node for the alternative BMA253 accelerometer on the same bus.

Signed-off-by: Alderpaw <foxy9855@gmail.com>
Add support for Dynaimage AP3216C and AP3426 ambient light, proximity,
and IR sensors via I2C.

Signed-off-by: Alderpaw <foxy9855@gmail.com>
…on sequence

Fix an issue where the display remains dark upon power-on due to
an initial brightness value of 0x0001. Update default boot brightness
to 0x00fe and insert a 20ms delay prior to exiting sleep mode to
properly satisfy the Renesas R69339 panel power-on sequence.

Signed-off-by: Alderpaw <foxy9855@gmail.com>
Enable the Dynaimage AP3216C/AP3426 ambient light and proximity sensor
driver as a module under the IIO subsystem section.

Signed-off-by: Alderpaw <foxy9855@gmail.com>
@FoxWind-coder
FoxWind-coder force-pushed the asus-z010d-improvements branch from ac7ee55 to c64a9e8 Compare August 12, 2026 17:00
@FoxWind-coder
FoxWind-coder requested a balanced review from Copilot August 12, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

"0", "0", "1";
};

/* 2nd variant of accelerometer, can't test it */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

then why is it added?


light-sensor@1e {
compatible = "dynaimage,ap3426", "dynaimage,ap3216c";
reg = <0x1e>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

formatting is broken, everywhere

reg = <0x1e>;

interrupt-parent = <&tlmm>;
interrupts = <113 IRQ_TYPE_EDGE_FALLING>; /* vendor-specific */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

how can it be not vendor specific?

Comment on lines +183 to +184
pinctrl-names = "default";
pinctrl-0 = <&smb1360_default>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

names always last

char *buf)
{
/* Default threshold level. Anything above 300 is considered "near" */
return sprintf(buf, "300\n");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://elixir.bootlin.com/linux/v7.0.12/source/Documentation/devicetree/bindings/iio/common.yaml#L23

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.

Comment on lines +78 to +91
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;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO dev_err_probe is always better to use

{ .compatible = "dynaimage,ap3216c" },
{ }
};
MODULE_DEVICE_TABLE(of, ap3216c_of_match);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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>");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should go into msm8916_defconfig

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants