Skip to contentSkip to conversation

Add Anbernic RG Vita-Pro

PATCH Superseded Chris Morgan 2 participants 11 messages Jun 1

Subsystems (6)

v3 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add Anbernic RG Vita-Pro

From: Chris Morgan <[email protected]>

Add support for the Anbernic RG Vita-Pro, based on the Rockchip RK3576 SoC.

Changes Since V1:
- Updated documentation filename to matche compatible string.
- Corrected order of allocating IRQ in charger driver and switched to using devm managed function to allocate work queue.

Changes Since V2:
- Corrected issue with naming of panel binding document and added fallback compatible string.
- Switched to devm helpers in panel driver. Note that devm_drm_panel_add() is currently only in the drm-next branch.
- Optimized setting GPIOs for panel driver.

Chris Morgan (6):
dt-bindings: power: supply: sgm41542: document sgm41542
power: supply: sgm41542: Add SG Micro sgm41542 charger
dt-bindings: display: panel: document Anbernic TD4310 panel drm/panel: anbernic-td4310: Add RG Vita Pro panel
dt-bindings: arm: rockchip: Add Anbernic RG Vita-Pro
arm64: dts: rockchip: Add Anbernic RG Vita-Pro

 .../devicetree/bindings/arm/rockchip.yaml     |    6 +
 .../display/panel/anbernic,td4310.yaml        |   66 +
 .../power/supply/sgmicro,sgm41542.yaml        |   99 ++
 arch/arm64/boot/dts/rockchip/Makefile         |    1 +
 .../rockchip/rk3576-anbernic-rg-vita-pro.dts  | 1317 +++++++++++++++++
 drivers/gpu/drm/panel/Kconfig                 |   10 +
 drivers/gpu/drm/panel/Makefile                |    1 +
 drivers/gpu/drm/panel/panel-anbernic-td4310.c |  251 ++++
 drivers/power/supply/Kconfig                  |    8 +
 drivers/power/supply/Makefile                 |    1 +
 drivers/power/supply/sgm41542_charger.c       | 1035 +++++++++++++
 11 files changed, 2795 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/anbernic,td4310.yaml
 create mode 100644 Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts
 create mode 100644 drivers/gpu/drm/panel/panel-anbernic-td4310.c
 create mode 100644 drivers/power/supply/sgm41542_charger.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/6 dt-bindings: power: supply: sgm41542: document sgm41542

From: Chris Morgan <[email protected]>

Document the SG Micro sgm41542 battery charger/boost converter. The parameters of input-current-limit-microamp and input-voltage-limit-microvolt are defined as such since they are in common use among multiple bindings currently.

---
 .../power/supply/sgmicro,sgm41542.yaml        | 99 +++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +99 -0
new file mode 100644
index 000000000000..8d37f502c1f4
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/supply/sgmicro,sgm41542.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SGM41542 Battery Charger
+
+description:
+  The SGMicro SGM41542 is a single cell battery charger/boost controller.
+
+maintainers:
+  - Chris Morgan <[email protected]>
+  - Xu Shengfei <[email protected]>
+
+properties:
+  compatible:
+    const: sgmicro,sgm41542
+
+  input-current-limit-microamp:
+    description:
+      Optional value to clamp the maximum input current limit to for
+      the device. If omitted, the default value for the hardware will
+      be used (2400000).
+    minimum: 100000
+    maximum: 3800000
+
+  input-voltage-limit-microvolt:
+    description:
+      Optional value to clamp the maximum input voltage limit to for
+      the device. If omitted, the default value for the hardware will
+      be used (4500000).
+    minimum: 3900000
+    maximum: 12000000
+
+  interrupts:
+    maxItems: 1
+
+  monitored-battery:
+    description: |
+        A phandle to a monitored battery node. Values for the following
+        are used by the driver and if not present will result in default
+        values being applied:
+        constant-charge-current-max-microamp
+        constant-charge-voltage-max-microvolt
+        charge-term-current-microamp
+        precharge-current-microamp
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+    properties:
+      otg-vbus:
+        type: object
+        description: OTG boost regulator
+        $ref: /schemas/regulator/regulator.yaml
+        unevaluatedProperties: false
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    battery: battery {
+      compatible = "simple-battery";
+      constant-charge-current-max-microamp = <10000000>;
+      constant-charge-voltage-max-microvolt = <4350000>;
+      precharge-current-microamp = <180000>;
+      charge-term-current-microamp = <300000>;
+    };
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      charger@3b {
+        compatible = "sgmicro,sgm41542";
+        reg = <0x3b>;
+        input-current-limit-microamp = <3000000>;
+        input-voltage-limit-microvolt = <4500000>;
+        interrupt-parent = <&gpio0>;
+        interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
+        monitored-battery = <&battery>;
+
+        regulators {
+          otg-vbus {
+            regulator-max-microvolt = <5000000>;
+            regulator-min-microvolt = <5000000>;
+          };
+        };
+      };
+    };
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH V3 1/6] dt-bindings: power: supply: sgm41542: document sgm41542

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] The binding defines power supply properties like 'monitored-battery' but fails to include a…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The binding defines power supply properties like 'monitored-battery' but fails to include a root-level reference to the core 'power-supply.yaml' schema, and incorrectly uses 'additionalProperties: false' instead of 'unevaluatedProperties: false'.
- [Low] C preprocessor #include directives are placed in the middle of the example DTS block, after a node definition.
--

commit afc648784a49832d73d043919a9fa8c27e4ca3ae
Author: Chris Morgan <[email protected]>

dt-bindings: power: supply: sgm41542: document sgm41542

This commit documents the SGMicro sgm41542 battery charger and boost converter. It defines the hardware bindings, including custom input current and voltage limits, interrupts, and monitored battery references.

Quoted 4 lines
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +0 -0
new file mode 100644

[ ... ]

Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml line 43

Quoted 8 lines
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +8 -0
+  interrupts:
+    maxItems: 1
+
+  monitored-battery:
+    description: |
+        A phandle to a monitored battery node. Values for the following
+        are used by the driver and if not present will result in default
+        values being applied:

[Severity: Low]
Since this device acts as a battery charger, should it include an allOf block with a $ref to power-supply.yaml? Without it, standard properties like monitored-battery lack their inherited type definitions.

[ ... ]

Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml line 66

Quoted 5 lines
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +5 -0
+required:
+  - compatible
+  - reg
+
+additionalProperties: false

[Severity: Low]
If this schema is updated to reference the core power-supply schema, does this need to be changed to unevaluatedProperties: false? Using
additionalProperties: false without inheriting the common power-supply schema causes schema validation to strictly reject any other standard power-supply properties added to the device tree node.

Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml line 78

Quoted 12 lines
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +12 -0
+
+examples:
+  - |
+    battery: battery {
+      compatible = "simple-battery";
+      constant-charge-current-max-microamp = <10000000>;
+      constant-charge-voltage-max-microvolt = <4350000>;
+      precharge-current-microamp = <180000>;
+      charge-term-current-microamp = <300000>;
+    };
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>

[Severity: Low]
Is it standard to place these include directives after the initial battery node? While technically valid C preprocessor syntax, DT binding conventions typically require all include directives to be placed at the very top of the examples block, prior to defining any nodes.

Quoted 3 lines
Documentation/devicetree/bindings/power/supply/sgmicro,sgm41542.yaml new file +3 -0
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

PATCH v3 2/6 power: supply: sgm41542: Add SG Micro sgm41542 charger

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add support for the SG Micro SGM41542 charger/boost converter. Driver was adapted from Rockchip BSP driver [1] and confirmed with vendor datasheet [2].

[1] https://github.com/rockchip-linux/kernel/blob/develop-6.6/drivers/power/supply/sgm41542_charger.c
[2] https://www.sg-micro.de/rect/assets/1e8de70b-657e-4156-be68-a64fdbe8e418/SGM41541_SGM41542.pdf

---
 drivers/power/supply/Kconfig            |    8 +
 drivers/power/supply/Makefile           |    1 +
 drivers/power/supply/sgm41542_charger.c | 1035 +++++++++++++++++++++++
 3 files changed, 1044 insertions(+)
 create mode 100644 drivers/power/supply/sgm41542_charger.c
drivers/power/supply/Kconfig +8 -0
index 83392ed6a8da..57dae0913472 100644
@@ -856,6 +856,14 @@ config CHARGER_RK817
 	help
 	  Say Y to include support for Rockchip RK817 Battery Charger.
 
+config CHARGER_SGM41542
+	tristate "SGM41542 charger driver"
+	depends on I2C
+	depends on GPIOLIB || COMPILE_TEST
+	select REGMAP_I2C
+	help
+	  Say Y to enable support for the SGM41542 battery charger.
+
 config CHARGER_SMB347
 	tristate "Summit Microelectronics SMB3XX Battery Charger"
 	depends on I2C
drivers/power/supply/Makefile +1 -0
index 7ee839dca7f3..c376889db317 100644
@@ -107,6 +107,7 @@ obj-$(CONFIG_CHARGER_BQ25890)	+= bq25890_charger.o
 obj-$(CONFIG_CHARGER_BQ25980)	+= bq25980_charger.o
 obj-$(CONFIG_CHARGER_BQ256XX)	+= bq256xx_charger.o
 obj-$(CONFIG_CHARGER_RK817)	+= rk817_charger.o
+obj-$(CONFIG_CHARGER_SGM41542)	+= sgm41542_charger.o
 obj-$(CONFIG_CHARGER_SMB347)	+= smb347-charger.o
 obj-$(CONFIG_CHARGER_TPS65090)	+= tps65090-charger.o
 obj-$(CONFIG_CHARGER_TPS65217)	+= tps65217_charger.o
drivers/power/supply/sgm41542_charger.c new file +1035 -0

1,035 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH V3 2/6] power: supply: sgm41542: Add SG Micro sgm41542 charger

Thank you for your contribution! Sashiko AI review found 10 potential issue(s) to consider: - [Critical] Uninitialized pointer dereference causes kernel panic if battery info is not found. - [High]…

Thank you for your contribution! Sashiko AI review found 10 potential issue(s) to consider:
- [Critical] Uninitialized pointer dereference causes kernel panic if battery info is not found.
- [High] Missing .remove callback and incorrect devres initialization order leads to Use-After-Free.
- [High] Missing return statement before dev_err_probe() allows probe to succeed despite hardware absence.
- [High] Race condition exposing the power supply to sysfs before workqueue allocation triggers NULL pointer dereference.
- [High] Unrepresentable voltage ranges silently truncate and apply dangerously low input voltage limits.
- [High] Requesting 4.336V charge voltage silently triggers a special register state that outputs 4.352V.
- [High] Ignoring the return value of regulator registration breaks -EPROBE_DEFER.
- [Medium] Requesting 3.8A maximum input current truncates to 600mA.
- [Medium] Negative error codes from I2C reads are exposed directly as valid userspace property values.
- [Medium] Unbalanced enable_irq_wake() call leaks the wake source configuration.
--

commit 5856e5a64dc4e00506a609cdda925513920c53e5
Author: Chris Morgan <[email protected]>

power: supply: sgm41542: Add SG Micro sgm41542 charger

Add support for the SG Micro SGM41542 charger/boost converter. Driver was adapted from Rockchip BSP driver and confirmed with vendor datasheet.

Quoted 5 lines
drivers/power/supply/sgm41542_charger.c new file +0 -0
new file mode 100644
@@ -0,0 +1,1035 @@

[ ... ]

drivers/power/supply/sgm41542_charger.c line 263

Quoted 12 lines
drivers/power/supply/sgm41542_charger.c new file +12 -0
+static int sgm4154x_set_chrg_volt(struct sgm4154x_device *sgm, int chrg_volt)
+{
+	int reg_val;
+	int ret;
+
+	/*
+	 * Note that the value of 0x01111 represents a "special value"
+	 * corresponding to 4352000uV instead of the expected 4336000uV,
+	 * per the datasheet. All other values are as expected.
+	 */
+	chrg_volt = clamp(chrg_volt, SGM4154X_VREG_V_MIN_UV, sgm->init_data.max_vreg);
+	reg_val = (chrg_volt - SGM4154X_VREG_V_MIN_UV) / SGM4154X_VREG_V_STEP_UV;

[Severity: High]
Does this code silently apply an overvoltage condition? If 4.336V is requested, the calculation generates a reg_val of 0x0F, which as noted in the comment configures the hardware to 4.352V instead of 4.336V. Is there a way to clamp or shift this value to a safe voltage to prevent applying a higher voltage than requested?

[ ... ]

Quoted 32 lines
drivers/power/supply/sgm41542_charger.c new file +32 -0
+static int sgm4154x_set_input_volt_lim(struct sgm4154x_device *sgm,
+				       unsigned int vindpm)
+{
+	enum SGM4154X_VINDPM_OS os_val;
+	unsigned int offset;
+	u8 reg_val;
+	int ret;
+
+
+	if (vindpm < SGM4154X_VINDPM_V_MIN_UV ||
+	    vindpm > SGM4154X_VINDPM_V_MAX_UV) {
+		dev_err(sgm->dev, "input voltage limit %u outside range\n", vindpm);
+		return -EINVAL;
+	}
+
+	if (vindpm < 5900000) {
+		os_val = VINDPM_OS_3900MV;
+		offset = 3900000;
+	} else if (vindpm >= 5900000 && vindpm < 7500000) {
+		os_val = VINDPM_OS_5900MV;
+		offset = 5900000;
+	} else if (vindpm >= 7500000 && vindpm < 10500000) {
+		os_val = VINDPM_OS_7500MV;
+		offset = 7500000;
+	} else {
+		os_val = VINDPM_OS_10500MV;
+		offset = 10500000;
+	}
+
+	ret = regmap_update_bits(sgm->regmap,
+				 SGM4154X_CHRG_CTRL_F,
+				 SGM4154X_VINDPM_OS_MASK,

drivers/power/supply/sgm41542_charger.c line 339

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+				 os_val);
+	if (ret) {
+		dev_err(sgm->dev, "set vin dpm error!\n");
+		return ret;
+	}
+
+	reg_val = (vindpm - offset) / SGM4154X_VINDPM_STEP_UV;
+
+	ret = regmap_update_bits(sgm->regmap, SGM4154X_CHRG_CTRL_6,
+				 SGM4154X_VINDPM_V_MASK, reg_val);

[Severity: High]
Does this calculation truncate values that fall outside the 4-bit limit of the hardware mask? For instance, assigning a voltage of 5.5V to the 3.9V bucket will yield a reg_val of 16, which will be bitwise truncated to 0 when masked by SGM4154X_VINDPM_V_MASK (max value 15), applying 3.9V instead of 5.5V.

[ ... ]

Quoted 17 lines
drivers/power/supply/sgm41542_charger.c new file +17 -0
+static int sgm4154x_set_input_curr_lim(struct sgm4154x_device *sgm, int iindpm)
+{
+	int reg_val;
+	int ret;
+
+	if (iindpm < SGM4154X_IINDPM_I_MIN_UA)
+		return -EINVAL;
+
+	/*
+	 * Per the datasheet, values between 100000uA and 3100000uA work
+	 * as expected with the register defined as having a step of
+	 * 100000 and a min/max of 100000 (0x00) through 3100000 (0x1e).
+	 * The register value of 0x1f however corresponds to 3800000uA not
+	 * 3200000uA as one would expect.
+	 */
+
+	if (iindpm > 3100000 && iindpm < SGM4154X_IINDPM_I_MAX_UA)

drivers/power/supply/sgm41542_charger.c line 372

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+		iindpm = 3100000;
+	if ((iindpm > SGM4154X_IINDPM_I_MAX_UA) || (iindpm > sgm->init_data.ilim))
+		iindpm = min(SGM4154X_IINDPM_I_MAX_UA, sgm->init_data.ilim);
+
+	reg_val = (iindpm - SGM4154X_IINDPM_I_MIN_UA) / SGM4154X_IINDPM_STEP_UA;
+
+	ret = regmap_update_bits(sgm->regmap,
+				 SGM4154X_CHRG_CTRL_0,
+				 SGM4154X_IINDPM_I_MASK,
+				 reg_val);

[Severity: Medium]
When requesting 3.8A maximum input current, does this get truncated to 600mA? Requesting 3.8A gives a reg_val of 37 (0x25), but since SGM4154X_IINDPM_I_MASK is only a 5-bit mask (0x1F), the value will be truncated during the bitwise operation (0x25 & 0x1F = 0x05), which translates to 600mA instead of the intended 3.8A.

[ ... ]

Quoted 16 lines
drivers/power/supply/sgm41542_charger.c new file +16 -0
+static int sgm4154x_charger_get_property(struct power_supply *psy,
+					 enum power_supply_property psp,
+					 union power_supply_propval *val)
+{
+	struct sgm4154x_device *sgm = power_supply_get_drvdata(psy);
+	struct sgm4154x_state state;
+	int ret;
+
+	ret = sgm4154x_get_state(sgm, &state);
+	if (ret) {
+		dev_err(sgm->dev, "get state error!\n");
+		return ret;
+	}
+	sgm->state = state;
+
+	switch (psp) {

[ ... ]

drivers/power/supply/sgm41542_charger.c line 661

Quoted 3 lines
drivers/power/supply/sgm41542_charger.c new file +3 -0
+	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
+		val->intval = sgm4154x_get_chrg_volt(sgm);
+		break;

[Severity: Medium]
Are negative error codes from I2C reads exposed directly as valid userspace property values here? If a function like sgm4154x_get_chrg_volt() fails, it returns an error code like -EIO, which is assigned to val->intval while sgm4154x_charger_get_property() returns 0 for success.

[ ... ]

Quoted 22 lines
drivers/power/supply/sgm41542_charger.c new file +22 -0
+static int sgm4154x_hw_init(struct sgm4154x_device *sgm)
+{
+	struct power_supply_battery_info *bat_info;
+	int ret;
+	u32 val;
+
+	/*
+	 * If unable to read devicetree info, use default/reset
+	 * values from hardware.
+	 */
+	sgm->init_data.iprechg = SGM4154X_PRECHRG_I_DEF_UA;
+	sgm->init_data.iterm = SGM4154X_TERMCHRG_I_DEF_UA;
+	sgm->init_data.max_ichg = SGM4154X_ICHRG_I_DEF_UA;
+	sgm->init_data.max_vreg = SGM4154X_VREG_V_DEF_UV;
+	sgm->init_data.vlim = SGM4154X_VINDPM_DEF_UV;
+	sgm->init_data.ilim = SGM4154X_IINDPM_DEF_UA;
+
+	ret = power_supply_get_battery_info(sgm->charger, &bat_info);
+	if (ret)
+		dev_warn(sgm->dev, "sgm4154x: cannot read battery info\n");
+	else {
+		if (bat_info->constant_charge_current_max_ua)

drivers/power/supply/sgm41542_charger.c line 790

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+			sgm->init_data.max_ichg = bat_info->constant_charge_current_max_ua;
+		if (bat_info->constant_charge_voltage_max_uv)
+			sgm->init_data.max_vreg = bat_info->constant_charge_voltage_max_uv;
+		if (bat_info->charge_term_current_ua)
+			sgm->init_data.iterm = bat_info->charge_term_current_ua;
+		if (bat_info->precharge_current_ua)
+			sgm->init_data.iprechg = bat_info->precharge_current_ua;
+	}
+
+	power_supply_put_battery_info(sgm->charger, bat_info);

[Severity: Critical]
Can this code crash by dereferencing an uninitialized pointer?

If power_supply_get_battery_info() fails (e.g., the devicetree node is missing), bat_info remains uninitialized on the stack. The error is logged but execution continues, and the uninitialized bat_info pointer is passed to power_supply_put_battery_info() which will try to free internal structures at random memory addresses.

[ ... ]

Quoted 16 lines
drivers/power/supply/sgm41542_charger.c new file +16 -0
+static int sgm4154x_probe(struct i2c_client *client)
+{
+	const struct i2c_device_id *id = i2c_client_get_device_id(client);
+	struct device *dev = &client->dev;
+	struct sgm4154x_device *sgm;
+	int ret;
+
+	sgm = devm_kzalloc(dev, sizeof(*sgm), GFP_KERNEL);
+	if (!sgm)
+		return -ENOMEM;
+
+	sgm->client = client;
+	sgm->dev = dev;
+
+	strscpy(sgm->model_name, id->name, I2C_NAME_SIZE);
+

drivers/power/supply/sgm41542_charger.c line 966

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+	sgm->regmap = devm_regmap_init_i2c(client, &sgm4154x_regmap_config);
+	if (IS_ERR(sgm->regmap))
+		return dev_err_probe(dev, PTR_ERR(sgm->regmap),
+				     "Failed to allocate register map\n");
+
+	i2c_set_clientdata(client, sgm);
+
+	ret = sgm4154x_hw_chipid_detect(sgm);
+	if (ret)
+		dev_err_probe(dev, ret, "Unable to read HW ID\n");

[Severity: High]
Should there be a return statement here? Execution currently falls through and registers the driver despite a hardware detection failure.

drivers/power/supply/sgm41542_charger.c line 972

Quoted 6 lines
drivers/power/supply/sgm41542_charger.c new file +6 -0
+
+	device_init_wakeup(dev, 1);
+
+	ret = sgm4154x_power_supply_init(sgm, dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to register power supply\n");

[Severity: High]
Does registering the power supply here create a race condition with the workqueue initialization?

If userspace reads or modifies the sysfs properties (like setting ONLINE=1) right after the power supply is registered but before sgm_monitor_wq is allocated below, the driver will call queue_delayed_work() with a NULL workqueue, triggering a NULL pointer dereference.

Quoted 4 lines
drivers/power/supply/sgm41542_charger.c new file +4 -0
+
+	ret = sgm4154x_hw_init(sgm);
+	if (ret)
+		return dev_err_probe(dev, ret, "Cannot initialize the chip.\n");

drivers/power/supply/sgm41542_charger.c line 986

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+
+	if (client->irq) {
+		ret = devm_request_threaded_irq(dev, client->irq, NULL,
+						sgm4154x_irq_handler_thread,
+						IRQF_TRIGGER_FALLING |
+						IRQF_ONESHOT,
+						"sgm41542-irq", sgm);
+		if (ret)
+			return ret;
+		enable_irq_wake(client->irq);

[Severity: Medium]
Will this leak the wake source configuration? The wake IRQ is enabled here, but there is no corresponding disable_irq_wake() call on probe error paths (such as a workqueue allocation failure below) or when the driver is unbound.

drivers/power/supply/sgm41542_charger.c line 996

Quoted 10 lines
drivers/power/supply/sgm41542_charger.c new file +10 -0
+	}
+
+	sgm->sgm_monitor_wq = devm_alloc_ordered_workqueue(dev, "%s",
+			WQ_MEM_RECLAIM | WQ_FREEZABLE, "sgm-monitor-wq");
+	if (!sgm->sgm_monitor_wq)
+		return -EINVAL;
+
+	INIT_DELAYED_WORK(&sgm->sgm_delay_work, sgm_charger_work);
+
+	sgm4154x_vbus_regulator_register(sgm);

[Severity: High]
Should the return value of sgm4154x_vbus_regulator_register() be checked? If the regulator subsystem returns -EPROBE_DEFER or another error code, the error is swallowed and probe succeeds, leaving the OTG regulator non-functional and breaking probe deferral.

[ ... ]

drivers/power/supply/sgm41542_charger.c line 1029

Quoted 9 lines
drivers/power/supply/sgm41542_charger.c new file +9 -0
+static struct i2c_driver sgm4154x_driver = {
+	.driver = {
+		.name = "sgm4154x-charger",
+		.of_match_table = sgm4154x_of_match,
+	},
+	.probe = sgm4154x_probe,
+	.shutdown = sgm4154x_charger_shutdown,
+	.id_table = sgm4154x_i2c_ids,
+};

[Severity: High]
Does this missing .remove callback lead to a Use-After-Free?

Because there is no .remove callback, the sgm_delay_work delayed work is never explicitly canceled when the module is unbound. Since the work re-arms itself, the timer will fire after the sgm structure is freed. Additionally, because devres destroys resources in reverse order, the workqueue will be destroyed while the power supply is still exposed to sysfs, allowing queue_delayed_work() to be called on a freed workqueue.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

PATCH v3 3/6 dt-bindings: display: panel: document Anbernic TD4310 panel

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

The panel used by Anbernic in the RG Vita-Pro is a DSI panel based on the TD4310 controller IC. It measures approximately 5.5 inches diagonally and is 1080x1920 in resolution.

---
 .../display/panel/anbernic,td4310.yaml        | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/anbernic,td4310.yaml
Documentation/devicetree/bindings/display/panel/anbernic,td4310.yaml new file +66 -0
new file mode 100644
index 000000000000..6f7f92b9c860
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/anbernic,td4310.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Anbernic TD4310 Based Panels
+
+maintainers:
+  - Chris Morgan <[email protected]>
+
+description:
+  Anbernic TD4310 Based Panels, such as the RG-Vita-Pro panel
+  (a 1080x1920 5.5 inch panel).
+
+allOf:
+  - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - anbernic,panel-vita-pro
+      - const: anbernic,td4310
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: Panel power supply
+
+required:
+  - compatible
+  - port
+  - reg
+  - reset-gpios
+  - vdd-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    dsi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        panel@0 {
+            compatible = "anbernic,panel-vita-pro", "anbernic,td4310";
+            reg = <0>;
+            backlight = <&backlight>;
+            enable-gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
+            reset-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+            rotation = <270>;
+            vdd-supply = <&vdd_lcd>;
+
+            port {
+                panel_in: endpoint {
+                    remote-endpoint = <&dsi_out>;
+                };
+            };
+        };
+    };
+
+...
Signature · 1 line
2.43.0
#6 lore raw

PATCH v3 4/6 drm/panel: anbernic-td4310: Add RG Vita Pro panel

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

The panel used by Anbernic in the RG Vita-Pro is a DSI panel based on the TD4310 controller IC. It measures approximately 5.5 inches diagonally and is 1080x1920 in resolution.

---
 drivers/gpu/drm/panel/Kconfig                 |  10 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-anbernic-td4310.c | 251 ++++++++++++++++++
 3 files changed, 262 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-anbernic-td4310.c
drivers/gpu/drm/panel/Kconfig +10 -0
index d592f4f4b939..61dd00297ecc 100644
@@ -17,6 +17,16 @@ config DRM_PANEL_ABT_Y030XX067A
 	  Y030XX067A 320x480 3.0" panel as found in the YLM RG-280M, RG-300
 	  and RG-99 handheld gaming consoles.
 
+config DRM_PANEL_ANBERNIC_TD4310
+	tristate "Anbernic TD4310 LCD panel"
+	depends on GPIOLIB && OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	help
+	  Say Y here to enable support for Anbernic designed panels with the
+	  TD4310 panel controller such as the ones used on the Anbernic RG
+	  Vita Pro.
+
 config DRM_PANEL_ARM_VERSATILE
 	tristate "ARM Versatile panel driver"
 	depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
index a4291dc3905b..9d8f70c9de3e 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ABT_Y030XX067A) += panel-abt-y030xx067a.o
+obj-$(CONFIG_DRM_PANEL_ANBERNIC_TD4310) += panel-anbernic-td4310.o
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
 obj-$(CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596) += panel-asus-z00t-tm5p5-n35596.o
 obj-$(CONFIG_DRM_PANEL_AUO_A030JTN01) += panel-auo-a030jtn01.o
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +251 -0

251 lines not on this page · raw message

Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH V3 4/6] drm/panel: anbernic-td4310: Add RG Vita Pro panel

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] The `enable` GPIO is incorrectly requested with an active state during `probe()`, violating…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] The enable GPIO is incorrectly requested with an active state during probe(), violating typical power sequencing.
- [Medium] Missing cleanup of regulator and GPIOs in prepare() when MIPI DCS commands fail.
- [Medium] Panel-specific delay configuration fields are ignored in favor of hardcoded values.
- [Low] The driver calls an undeclared function devm_drm_panel_add(), causing a build failure.
--

commit 574d8ed3e47c2bbb643d4d50b515ef3c4d8fd16e
Author: Chris Morgan <[email protected]>

drm/panel: anbernic-td4310: Add RG Vita Pro panel

This commit adds support for the TD4310 MIPI DSI panel controller used in the Anbernic RG Vita-Pro handheld gaming console.

Quoted 5 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +0 -0
new file mode 100644
index 0000000000000..d277682f63a3a

[ ... ]

Quoted 2 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +2 -0
+static int panel_anbernic_td4310_prepare(struct drm_panel *panel)
+{

[ ... ]

drivers/gpu/drm/panel/panel-anbernic-td4310.c line 87

Quoted 6 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +6 -0
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 100);
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 100);
+
+	return dsi_ctx.accum_err;

[Severity: Medium]
Does this code leave the vdd regulator and enable_gpio enabled if a DCS command fails?

If dsi_ctx.accum_err is non-zero, this returns immediately instead of jumping to the err_reset and err_enable cleanup labels.

Quoted 6 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +6 -0
+
+err_reset:
+	gpiod_set_value_cansleep(ctx->enable_gpio, 0);
+err_enable:
+	regulator_disable(ctx->vdd);
+	return ret;

drivers/gpu/drm/panel/panel-anbernic-td4310.c line 103

Quoted 10 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +10 -0
+}
+
+static int panel_anbernic_td4310_unprepare(struct drm_panel *panel)
+{
+	struct anbernic_panel_td4310 *ctx = panel_to_anbernic_panel_td4310(panel);
+	struct mipi_dsi_device *dsi = ctx->dsi;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+
+	mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 120);

[Severity: Medium]
Is it intentional to use a hardcoded 120ms delay here instead of using the panel-specific disable_delay or unprepare_delay fields defined in the panel_info struct?

[ ... ]

Quoted 3 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +3 -0
+static int panel_anbernic_td4310_probe(struct mipi_dsi_device *dsi)
+{
+	struct device *dev = &dsi->dev;

[ ... ]

drivers/gpu/drm/panel/panel-anbernic-td4310.c line 171

Quoted 6 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +6 -0
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	if (IS_ERR(ctx->reset_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+				     "Cannot get reset gpio\n");
+
+	ctx->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);

[Severity: High]
Could requesting this GPIO with GPIOD_OUT_HIGH drive the signal active before the vdd regulator is enabled in panel_anbernic_td4310_prepare()?

This might violate hardware power sequencing by driving control signals active while the main panel IC is unpowered.

Quoted 5 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +5 -0
+	if (IS_ERR(ctx->enable_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->enable_gpio),
+				     "Cannot get enable gpio\n");
+
+	ctx->vdd = devm_regulator_get(dev, "vdd");

[ ... ]

drivers/gpu/drm/panel/panel-anbernic-td4310.c line 192

Quoted 5 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +5 -0
+	ret = drm_panel_of_backlight(&ctx->panel);
+	if (ret)
+		return ret;
+
+	devm_drm_panel_add(dev, &ctx->panel);

[Severity: Low]
Is devm_drm_panel_add available in the DRM subsystem?

It looks like this might cause a build failure due to an implicit function declaration.

Quoted 4 lines
drivers/gpu/drm/panel/panel-anbernic-td4310.c new file +4 -0
+
+	ret = devm_mipi_dsi_attach(dev, dsi);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to attach to DSI host\n");

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#8 lore raw

PATCH v3 5/6 dt-bindings: arm: rockchip: Add Anbernic RG Vita-Pro

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add compatible string for the Anbernic RG Vita-Pro.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +6 -0
index 1a9dde18626d..b8babe9d3a26 100644
@@ -66,6 +66,12 @@ properties:
               - anbernic,rg-ds
           - const: rockchip,rk3568
 
+      - description: Anbernic RK3576 Handheld Gaming Console
+        items:
+          - enum:
+              - anbernic,rg-vita-pro
+          - const: rockchip,rk3576
+
       - description: Ariaboard Photonicat
         items:
           - const: ariaboard,photonicat
Signature · 1 line
2.43.0
#9 lore raw

PATCH v3 6/6 arm64: dts: rockchip: Add Anbernic RG Vita-Pro

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add device tree for the Anbernic RG Vita-Pro, based on the Rockchip RK3576. All hardware is currently working except for the accelerometer, the touchscreen, the battery monitor, and DisplayPort over USB-C. PWM is also missing currently, and as a result the LEDs and panel backlight are currently controlled via GPIO but will be changed to PWM once supported.

The Anbernic RG Vita-Pro includes the following hardware:
- A 1080x1920 DSI display with touch.
- 21 buttons.
- 2 Analog joysticks controlled via userspace.
- 3 LEDs.
- 64GB eMMC, 2 SDMMC slots.
- RTL8852BE WiFi/Bluetooth combo
- 1 USB 3.0 USB-C port in OTG mode.
- 3.5mm headphone jack with play button support.
- 5000mAH battery

The following hardware has incomplete driver support and is not yet working:
- An Invensense icm42607p accelerometer.
- A Cellwise cw221x battery monitor.
- A Synaptics i2c touchscreen.
- DisplayPort over USB-C alt-mode.
- PWM controller.

---
 arch/arm64/boot/dts/rockchip/Makefile         |    1 +
 .../rockchip/rk3576-anbernic-rg-vita-pro.dts  | 1317 +++++++++++++++++
 2 files changed, 1318 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index cb55c6b70d0e..7d86676f98e8 100644
@@ -165,6 +165,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-display-vz.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-100ask-dshanpi-a1.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-anbernic-rg-vita-pro.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5-v1.2-wifibt.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +1317 -0

1,317 lines not on this page · raw message

Signature · 1 line
2.43.0
#10 lore raw

Re: [PATCH V3 6/6] arm64: dts: rockchip: Add Anbernic RG Vita-Pro

Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider: - [High] Bluetooth `device-wake-gpios` and `enable-gpios` properties are swapped relative to their physical…

Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
- [High] Bluetooth device-wake-gpios and enable-gpios properties are swapped relative to their physical pin assignments and pinctrl definitions.
- [Medium] Contradiction between the commit message's claimed Wi-Fi/BT module and the device tree configuration.
- [Medium] Dangerously high battery charge current limit.
- [Medium] Unrealistic ADC keys press threshold (likely raw ADC value instead of microvolts).
- [Medium] Battery capacity mismatch between commit message and DT.
- [Medium] The SPI joysticks cannot be accessed via userspace because there is no child device node on the SPI bus.
- [Medium] The eMMC (&sdhci) node is missing explicit vmmc-supply and vqmmc-supply properties.
--

commit 6ca27e4d6b6c0850a8d0d4f25022dc6c12ca0c24
Author: Chris Morgan <[email protected]>
Subject: arm64: dts: rockchip: Add Anbernic RG Vita-Pro

This patch adds the device tree for the Anbernic RG Vita-Pro handheld, based on the Rockchip RK3576 SoC. It includes configurations for the display, buttons, audio, battery, and various peripherals.

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +0 -0
new file mode 100644
index 0000000000000..7f703b5c8a298

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 43

Quoted 11 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +11 -0
+	adc_keys_home: adc-keys-home {
+		compatible = "adc-keys";
+		io-channel-names = "buttons";
+		io-channels = <&saradc 1>;
+		keyup-threshold-microvolt = <1800000>;
+		poll-interval = <60>;
+
+		button-home {
+			label = "HOME";
+			linux,code = <KEY_HOME>;
+			press-threshold-microvolt = <1750>;

[Severity: Medium]
Is this threshold correct? 1750 microvolts (1.75mV) is extremely low and would be highly sensitive to minor resistance or ground bounce. Was this intended to be the raw 12-bit ADC value (where 1750 represents ~769mV) rather than microvolts?

Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +4 -0
+		};
+	};
+
+	adc_keys_play: adc-keys-play {

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 57

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +10 -0
+		compatible = "adc-keys";
+		io-channel-names = "buttons";
+		io-channels = <&saradc 3>;
+		keyup-threshold-microvolt = <1300000>;
+		poll-interval = <60>;
+
+		button-play {
+			label = "PLAY";
+			linux,code = <KEY_PLAYPAUSE>;
+			press-threshold-microvolt = <1750>;

[Severity: Medium]
Does this also use a raw ADC value instead of microvolts?

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 67

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +10 -0
+		};
+	};
+
+	/*
+	 * Values from BSP, except for internal resistance which was set
+	 * to 80 micro ohms which is more likely 80000 micro ohms.
+	 */
+	battery: battery {
+		compatible = "simple-battery";
+		charge-full-design-microamp-hours = <8000000>;

[Severity: Medium]
The capacity here is configured to 8000mAh, which contradicts the 5000mAh mentioned in the commit message. An incorrect capacity can cause battery fuel gauge drivers to miscalculate the state of charge. Which value is accurate?

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 69

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +2 -0
+		charge-term-current-microamp = <300000>;
+		constant-charge-current-max-microamp = <10000000>;

[Severity: Medium]
Is the constant charge current intended to be 10A? While the charger IC might have a hardware limit, 10 Amps is a 2C charge rate for a 5000mAh battery, which seems dangerously high. Was this intended to be 1A or 2A?

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 1198

Quoted 10 lines

+&sdhci {

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +9 -0
+	bus-width = <8>;
+	full-pwr-cycle-in-suspend;
+	no-sd;
+	no-sdio;
+	non-removable;
+	mmc-hs400-1_8v;
+	mmc-hs400-enhanced-strobe;
+	status = "okay";
+};

[Severity: Medium]
Does the eMMC node need explicit vmmc-supply and vqmmc-supply properties? Omitting these forces the MMC subsystem to fall back to dummy regulators, which triggers kernel warnings and can prevent the driver from executing necessary power cycles during error recovery.

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 1226

Quoted 7 lines

+&spi1 {

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +6 -0
+	num-cs = <1>;
+	pinctrl-0 = <&spi1m2_pins>, <&spi1m2_csn0>;
+	status = "okay";
+
+	/* SPI controlled MCU for joystick and joystick LEDs. */
+};

[Severity: Medium]
How are the analog joysticks accessed from userspace? This node configures the SPI controller but does not instantiate any child devices (such as a spidev node). Without a child node, the kernel will not register a device, and no userspace interface will be created.

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 1269

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +2 -0
+	bluetooth {
+		compatible = "realtek,rtl8822cs-bt";

[Severity: Medium]
This node defines an RTL8822CS module over UART, but the commit message indicates the hardware uses an RTL8852BE combo module (which typically uses PCIe for Wi-Fi and USB for Bluetooth). Could you confirm which module is correct?

arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts line 1271

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +2 -0
+		device-wake-gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
+		enable-gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;

[Severity: High]
Are these GPIOs mapped correctly? The pinctrl defined earlier labels RK_PB6 as bt_reset_gpio and RK_PB5 as bt_wake_gpio. Driving the wake pin with the enable/reset logic and vice versa will leave the module in reset.

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3576-anbernic-rg-vita-pro.dts new file +5 -0
+		host-wake-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&bt_reset_gpio>, <&bt_wake_gpio>, <&bt_wake_host_irq>;
+		pinctrl-names = "default";
+	};
+};
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6