Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v12 2/6] mfd: pf1550: add core driver
From: Samuel Kayode via B4 Relay @ 2025-10-01 15:42 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Liam Girdwood, Mark Brown, Dmitry Torokhov, Sebastian Reichel,
	Frank Li
  Cc: imx, devicetree, linux-kernel, linux-input, linux-pm, Abel Vesa,
	Abel Vesa, Robin Gong, Robin Gong, Enric Balletbo i Serra,
	Sean Nyekjaer, Christophe JAILLET, Samuel Kayode, Abel Vesa,
	Frank Li
In-Reply-To: <20251001-pf1550-v12-0-a3302aa41687@savoirfairelinux.com>

From: Samuel Kayode <samuel.kayode@savoirfairelinux.com>

Add the core driver for pf1550 PMIC. There are 3 subdevices for which the
drivers will be added in subsequent patches.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Samuel Kayode <samuel.kayode@savoirfairelinux.com>
---
v11:
  - Add Tested-by tag from Sean
v10:
  - Address Lee's feedback:
    - Change dvsX_enb to dvsX_enable
    - Add new line where necessary
    - Can use 100 chars in a line
    - Begin comments with uppercase
    - Rearrange members of struct pf1550_ddata
  - Add support for disabling onkey shutting down system
v9:
 - Requested by Sean:
   - Add support for SW1 DVS enable/disable
 - Use consistent whitespace
 - Adjust commenting and log messages of the read_otp function
v8:
 - Address Lee's feedback:
   - Drop `mfd` from driver description and comments
   - Add module name in Kconfig
   - Fix license commenting
   - Drop filenames from comments
   - Drop unnecessary tabbing
   - Alphabetical ordering of includes
   - Remove magic numbers
   - Add comments for pf1550_read_otp function
   - Fix log error message in pf1550_read_otp
   - Drop pf1550_add_child_device function
   - Start comments with upper case
   - Rename pf1550_dev to pf1550_ddata
   - Drop i2c member in struct pf1550_ddata/pf1550_dev
   - Use more helpful log message when device id not recognized
   - Fix dvs_enb: when bit is set the DVS is disabled and when bit is clear the
     DVS is enabled
  - Verified the PM_OPS suspend and resume do act as expected
v7:
 - Address Frank's feedback:
   - Ensure reverse christmas tree order for local variable definitions
   - Drop unnecessary driver data definition in id table
v6:
 - Address Frank's feedback:
   - Ensure lowercase when defining register addresses
   - Use GENMASK macro for masking
   - Hardcode IRQ flags in pf1550_add_child_device
   - Add dvs_enb variable for SW2 regulator
   - Drop chip type variable
v5:
 - Use top level interrupt to manage interrupts for the sub-drivers as
   recommended by Mark Brown. The regmap_irq_sub_irq_map would have been used
   if not for the irregular charger irq address. For all children, the mask
   register is directly after the irq register (i.e., 0x08, 0x09) except
   for the charger: 0x80, 0x82. Meaning .mask_base would be applicable
   for all but the charger
 - Fix bad offset for temperature interrupts of regulator
v4:
 - Use struct resource to define irq so platform_get_irq can be used in
   children as suggested by Dmitry
 - Let mfd_add_devices create the mappings for the interrupts
 - ack_base and init_ack_masked defined for charger and regulator irq
   chips
 - No need to define driver_data in table id
v3:
 - Address Dmitry's feedback:
   - Place Table IDs next to each other
   - Drop of_match_ptr
   - Replace dev_err with dev_err_probe in probe method
   - Drop useless log in probe
 - Map all irqs instead of doing it in the sub-devices as recommended by
   Dmitry.
v2:
 - Address feedback from Enric Balletbo Serra
---
 drivers/mfd/Kconfig        |  16 ++
 drivers/mfd/Makefile       |   2 +
 drivers/mfd/pf1550.c       | 367 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/pf1550.h | 273 +++++++++++++++++++++++++++++++++
 4 files changed, 658 insertions(+)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 425c5fba6cb1e7848dcea05bd77c729a71d48e2c..e48c471f572cf4fbfe4de82eae6eeae5fa3bfbfc 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -604,6 +604,22 @@ config MFD_MX25_TSADC
 	  i.MX25 processors. They consist of a conversion queue for general
 	  purpose ADC and a queue for Touchscreens.
 
+config MFD_PF1550
+	tristate "NXP PF1550 PMIC Support"
+	depends on I2C=y && OF
+	select MFD_CORE
+	select REGMAP_I2C
+	select REGMAP_IRQ
+	help
+	  Say yes here to add support for NXP PF1550. This is a companion Power
+	  Management IC with regulators, onkey, and charger control on chip.
+	  This driver provides common support for accessing the device;
+	  additional drivers must be enabled in order to use the functionality
+	  of the device.
+
+	  This driver can also be built as a module and if so will be called
+	  pf1550.
+
 config MFD_HI6421_PMIC
 	tristate "HiSilicon Hi6421 PMU/Codec IC"
 	depends on OF
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f7bdedd5a66d16bf8ccee0da1236a441e6f085b0..987e8c2ba5bf7b449ea636f62f103c933f0ac3d0 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -121,6 +121,8 @@ obj-$(CONFIG_MFD_MC13XXX)	+= mc13xxx-core.o
 obj-$(CONFIG_MFD_MC13XXX_SPI)	+= mc13xxx-spi.o
 obj-$(CONFIG_MFD_MC13XXX_I2C)	+= mc13xxx-i2c.o
 
+obj-$(CONFIG_MFD_PF1550)	+= pf1550.o
+
 obj-$(CONFIG_MFD_CORE)		+= mfd-core.o
 
 ocelot-soc-objs			:= ocelot-core.o ocelot-spi.o
diff --git a/drivers/mfd/pf1550.c b/drivers/mfd/pf1550.c
new file mode 100644
index 0000000000000000000000000000000000000000..c4f567c055640662cc2db742917cc87cf9cabb5f
--- /dev/null
+++ b/drivers/mfd/pf1550.c
@@ -0,0 +1,367 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Core driver for the PF1550
+ *
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ * Robin Gong <yibin.gong@freescale.com>
+ *
+ * Portions Copyright (c) 2025 Savoir-faire Linux Inc.
+ * Samuel Kayode <samuel.kayode@savoirfairelinux.com>
+ */
+
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/core.h>
+#include <linux/mfd/pf1550.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+
+static const struct regmap_config pf1550_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.max_register = PF1550_PMIC_REG_END,
+};
+
+static const struct regmap_irq pf1550_irqs[] = {
+	REGMAP_IRQ_REG(PF1550_IRQ_CHG, 0, IRQ_CHG),
+	REGMAP_IRQ_REG(PF1550_IRQ_REGULATOR, 0, IRQ_REGULATOR),
+	REGMAP_IRQ_REG(PF1550_IRQ_ONKEY, 0, IRQ_ONKEY),
+};
+
+static const struct regmap_irq_chip pf1550_irq_chip = {
+	.name = "pf1550",
+	.status_base = PF1550_PMIC_REG_INT_CATEGORY,
+	.init_ack_masked = 1,
+	.num_regs = 1,
+	.irqs = pf1550_irqs,
+	.num_irqs = ARRAY_SIZE(pf1550_irqs),
+};
+
+static const struct regmap_irq pf1550_regulator_irqs[] = {
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW1_LS, 0, PMIC_IRQ_SW1_LS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW2_LS, 0, PMIC_IRQ_SW2_LS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW3_LS, 0, PMIC_IRQ_SW3_LS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW1_HS, 3, PMIC_IRQ_SW1_HS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW2_HS, 3, PMIC_IRQ_SW2_HS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_SW3_HS, 3, PMIC_IRQ_SW3_HS),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_LDO1_FAULT, 16, PMIC_IRQ_LDO1_FAULT),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_LDO2_FAULT, 16, PMIC_IRQ_LDO2_FAULT),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_LDO3_FAULT, 16, PMIC_IRQ_LDO3_FAULT),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_TEMP_110, 24, PMIC_IRQ_TEMP_110),
+	REGMAP_IRQ_REG(PF1550_PMIC_IRQ_TEMP_125, 24, PMIC_IRQ_TEMP_125),
+};
+
+static const struct regmap_irq_chip pf1550_regulator_irq_chip = {
+	.name = "pf1550-regulator",
+	.status_base = PF1550_PMIC_REG_SW_INT_STAT0,
+	.ack_base = PF1550_PMIC_REG_SW_INT_STAT0,
+	.mask_base = PF1550_PMIC_REG_SW_INT_MASK0,
+	.use_ack = 1,
+	.init_ack_masked = 1,
+	.num_regs = 25,
+	.irqs = pf1550_regulator_irqs,
+	.num_irqs = ARRAY_SIZE(pf1550_regulator_irqs),
+};
+
+static const struct resource regulator_resources[] = {
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW1_LS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW2_LS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW3_LS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW1_HS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW2_HS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_SW3_HS),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_LDO1_FAULT),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_LDO2_FAULT),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_LDO3_FAULT),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_TEMP_110),
+	DEFINE_RES_IRQ(PF1550_PMIC_IRQ_TEMP_125),
+};
+
+static const struct regmap_irq pf1550_onkey_irqs[] = {
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_PUSHI, 0, ONKEY_IRQ_PUSHI),
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_1SI, 0, ONKEY_IRQ_1SI),
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_2SI, 0, ONKEY_IRQ_2SI),
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_3SI, 0, ONKEY_IRQ_3SI),
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_4SI, 0, ONKEY_IRQ_4SI),
+	REGMAP_IRQ_REG(PF1550_ONKEY_IRQ_8SI, 0, ONKEY_IRQ_8SI),
+};
+
+static const struct regmap_irq_chip pf1550_onkey_irq_chip = {
+	.name = "pf1550-onkey",
+	.status_base = PF1550_PMIC_REG_ONKEY_INT_STAT0,
+	.ack_base = PF1550_PMIC_REG_ONKEY_INT_STAT0,
+	.mask_base = PF1550_PMIC_REG_ONKEY_INT_MASK0,
+	.use_ack = 1,
+	.init_ack_masked = 1,
+	.num_regs = 1,
+	.irqs = pf1550_onkey_irqs,
+	.num_irqs = ARRAY_SIZE(pf1550_onkey_irqs),
+};
+
+static const struct resource onkey_resources[] = {
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_PUSHI),
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_1SI),
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_2SI),
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_3SI),
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_4SI),
+	DEFINE_RES_IRQ(PF1550_ONKEY_IRQ_8SI),
+};
+
+static const struct regmap_irq pf1550_charger_irqs[] = {
+	REGMAP_IRQ_REG(PF1550_CHARG_IRQ_BAT2SOCI, 0, CHARG_IRQ_BAT2SOCI),
+	REGMAP_IRQ_REG(PF1550_CHARG_IRQ_BATI, 0, CHARG_IRQ_BATI),
+	REGMAP_IRQ_REG(PF1550_CHARG_IRQ_CHGI, 0, CHARG_IRQ_CHGI),
+	REGMAP_IRQ_REG(PF1550_CHARG_IRQ_VBUSI, 0, CHARG_IRQ_VBUSI),
+	REGMAP_IRQ_REG(PF1550_CHARG_IRQ_THMI, 0, CHARG_IRQ_THMI),
+};
+
+static const struct regmap_irq_chip pf1550_charger_irq_chip = {
+	.name = "pf1550-charger",
+	.status_base = PF1550_CHARG_REG_CHG_INT,
+	.ack_base = PF1550_CHARG_REG_CHG_INT,
+	.mask_base = PF1550_CHARG_REG_CHG_INT_MASK,
+	.use_ack = 1,
+	.init_ack_masked = 1,
+	.num_regs = 1,
+	.irqs = pf1550_charger_irqs,
+	.num_irqs = ARRAY_SIZE(pf1550_charger_irqs),
+};
+
+static const struct resource charger_resources[] = {
+	DEFINE_RES_IRQ(PF1550_CHARG_IRQ_BAT2SOCI),
+	DEFINE_RES_IRQ(PF1550_CHARG_IRQ_BATI),
+	DEFINE_RES_IRQ(PF1550_CHARG_IRQ_CHGI),
+	DEFINE_RES_IRQ(PF1550_CHARG_IRQ_VBUSI),
+	DEFINE_RES_IRQ(PF1550_CHARG_IRQ_THMI),
+};
+
+static const struct mfd_cell pf1550_regulator_cell = {
+	.name = "pf1550-regulator",
+	.num_resources = ARRAY_SIZE(regulator_resources),
+	.resources = regulator_resources,
+};
+
+static const struct mfd_cell pf1550_onkey_cell = {
+	.name = "pf1550-onkey",
+	.num_resources = ARRAY_SIZE(onkey_resources),
+	.resources = onkey_resources,
+};
+
+static const struct mfd_cell pf1550_charger_cell = {
+	.name = "pf1550-charger",
+	.num_resources = ARRAY_SIZE(charger_resources),
+	.resources = charger_resources,
+};
+
+/*
+ * The PF1550 is shipped in variants of A0, A1,...A9. Each variant defines a
+ * configuration of the PMIC in a One-Time Programmable (OTP) memory.
+ * This memory is accessed indirectly by writing valid keys to specific
+ * registers of the PMIC. To read the OTP memory after writing the valid keys,
+ * the OTP register address to be read is written to pf1550 register 0xc4 and
+ * its value read from pf1550 register 0xc5.
+ */
+static int pf1550_read_otp(const struct pf1550_ddata *pf1550, unsigned int index,
+			   unsigned int *val)
+{
+	int ret = 0;
+
+	ret = regmap_write(pf1550->regmap, PF1550_PMIC_REG_KEY, PF1550_OTP_PMIC_KEY);
+	if (ret)
+		goto read_err;
+
+	ret = regmap_write(pf1550->regmap, PF1550_CHARG_REG_CHGR_KEY2, PF1550_OTP_CHGR_KEY);
+	if (ret)
+		goto read_err;
+
+	ret = regmap_write(pf1550->regmap, PF1550_TEST_REG_KEY3, PF1550_OTP_TEST_KEY);
+	if (ret)
+		goto read_err;
+
+	ret = regmap_write(pf1550->regmap, PF1550_TEST_REG_FMRADDR, index);
+	if (ret)
+		goto read_err;
+
+	ret = regmap_read(pf1550->regmap, PF1550_TEST_REG_FMRDATA, val);
+	if (ret)
+		goto read_err;
+
+	return 0;
+
+read_err:
+	return dev_err_probe(pf1550->dev, ret, "OTP reg %x not found!\n", index);
+}
+
+static int pf1550_i2c_probe(struct i2c_client *i2c)
+{
+	const struct mfd_cell *regulator = &pf1550_regulator_cell;
+	const struct mfd_cell *charger = &pf1550_charger_cell;
+	const struct mfd_cell *onkey = &pf1550_onkey_cell;
+	unsigned int reg_data = 0, otp_data = 0;
+	struct pf1550_ddata *pf1550;
+	struct irq_domain *domain;
+	int irq, ret = 0;
+
+	pf1550 = devm_kzalloc(&i2c->dev, sizeof(*pf1550), GFP_KERNEL);
+	if (!pf1550)
+		return -ENOMEM;
+
+	i2c_set_clientdata(i2c, pf1550);
+	pf1550->dev = &i2c->dev;
+	pf1550->irq = i2c->irq;
+
+	pf1550->regmap = devm_regmap_init_i2c(i2c, &pf1550_regmap_config);
+	if (IS_ERR(pf1550->regmap))
+		return dev_err_probe(pf1550->dev, PTR_ERR(pf1550->regmap),
+				     "failed to allocate register map\n");
+
+	ret = regmap_read(pf1550->regmap, PF1550_PMIC_REG_DEVICE_ID, &reg_data);
+	if (ret < 0)
+		return dev_err_probe(pf1550->dev, ret, "cannot read chip ID\n");
+	if (reg_data != PF1550_DEVICE_ID)
+		return dev_err_probe(pf1550->dev, -ENODEV, "invalid device ID: 0x%02x\n", reg_data);
+
+	/* Regulator DVS for SW2 */
+	ret = pf1550_read_otp(pf1550, PF1550_OTP_SW2_SW3, &otp_data);
+	if (ret)
+		return ret;
+
+	/* When clear, DVS should be enabled */
+	if (!(otp_data & OTP_SW2_DVS_ENB))
+		pf1550->dvs2_enable = true;
+
+	/* Regulator DVS for SW1 */
+	ret = pf1550_read_otp(pf1550, PF1550_OTP_SW1_SW2, &otp_data);
+	if (ret)
+		return ret;
+
+	if (!(otp_data & OTP_SW1_DVS_ENB))
+		pf1550->dvs1_enable = true;
+
+	/* Add top level interrupts */
+	ret = devm_regmap_add_irq_chip(pf1550->dev, pf1550->regmap, pf1550->irq,
+				       IRQF_ONESHOT | IRQF_SHARED |
+				       IRQF_TRIGGER_FALLING,
+				       0, &pf1550_irq_chip,
+				       &pf1550->irq_data);
+	if (ret)
+		return ret;
+
+	/* Add regulator */
+	irq = regmap_irq_get_virq(pf1550->irq_data, PF1550_IRQ_REGULATOR);
+	if (irq < 0)
+		return dev_err_probe(pf1550->dev, irq,
+				     "Failed to get parent vIRQ(%d) for chip %s\n",
+				     PF1550_IRQ_REGULATOR, pf1550_irq_chip.name);
+
+	ret = devm_regmap_add_irq_chip(pf1550->dev, pf1550->regmap, irq,
+				       IRQF_ONESHOT | IRQF_SHARED |
+				       IRQF_TRIGGER_FALLING, 0,
+				       &pf1550_regulator_irq_chip,
+				       &pf1550->irq_data_regulator);
+	if (ret)
+		return dev_err_probe(pf1550->dev, ret, "Failed to add %s IRQ chip\n",
+				     pf1550_regulator_irq_chip.name);
+
+	domain = regmap_irq_get_domain(pf1550->irq_data_regulator);
+
+	ret = devm_mfd_add_devices(pf1550->dev, PLATFORM_DEVID_NONE, regulator, 1, NULL, 0, domain);
+	if (ret)
+		return ret;
+
+	/* Add onkey */
+	irq = regmap_irq_get_virq(pf1550->irq_data, PF1550_IRQ_ONKEY);
+	if (irq < 0)
+		return dev_err_probe(pf1550->dev, irq,
+				     "Failed to get parent vIRQ(%d) for chip %s\n",
+				     PF1550_IRQ_ONKEY, pf1550_irq_chip.name);
+
+	ret = devm_regmap_add_irq_chip(pf1550->dev, pf1550->regmap, irq,
+				       IRQF_ONESHOT | IRQF_SHARED |
+				       IRQF_TRIGGER_FALLING, 0,
+				       &pf1550_onkey_irq_chip,
+				       &pf1550->irq_data_onkey);
+	if (ret)
+		return dev_err_probe(pf1550->dev, ret, "Failed to add %s IRQ chip\n",
+				     pf1550_onkey_irq_chip.name);
+
+	domain = regmap_irq_get_domain(pf1550->irq_data_onkey);
+
+	ret = devm_mfd_add_devices(pf1550->dev, PLATFORM_DEVID_NONE, onkey, 1, NULL, 0, domain);
+	if (ret)
+		return ret;
+
+	/* Add battery charger */
+	irq = regmap_irq_get_virq(pf1550->irq_data, PF1550_IRQ_CHG);
+	if (irq < 0)
+		return dev_err_probe(pf1550->dev, irq,
+				     "Failed to get parent vIRQ(%d) for chip %s\n",
+				     PF1550_IRQ_CHG, pf1550_irq_chip.name);
+
+	ret = devm_regmap_add_irq_chip(pf1550->dev, pf1550->regmap, irq,
+				       IRQF_ONESHOT | IRQF_SHARED |
+				       IRQF_TRIGGER_FALLING, 0,
+				       &pf1550_charger_irq_chip,
+				       &pf1550->irq_data_charger);
+	if (ret)
+		return dev_err_probe(pf1550->dev, ret, "Failed to add %s IRQ chip\n",
+				     pf1550_charger_irq_chip.name);
+
+	domain = regmap_irq_get_domain(pf1550->irq_data_charger);
+
+	return devm_mfd_add_devices(pf1550->dev, PLATFORM_DEVID_NONE, charger, 1, NULL, 0, domain);
+}
+
+static int pf1550_suspend(struct device *dev)
+{
+	struct pf1550_ddata *pf1550 = dev_get_drvdata(dev);
+
+	if (device_may_wakeup(dev)) {
+		enable_irq_wake(pf1550->irq);
+		disable_irq(pf1550->irq);
+	}
+
+	return 0;
+}
+
+static int pf1550_resume(struct device *dev)
+{
+	struct pf1550_ddata *pf1550 = dev_get_drvdata(dev);
+
+	if (device_may_wakeup(dev)) {
+		disable_irq_wake(pf1550->irq);
+		enable_irq(pf1550->irq);
+	}
+
+	return 0;
+}
+static DEFINE_SIMPLE_DEV_PM_OPS(pf1550_pm, pf1550_suspend, pf1550_resume);
+
+static const struct i2c_device_id pf1550_i2c_id[] = {
+	{ "pf1550" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(i2c, pf1550_i2c_id);
+
+static const struct of_device_id pf1550_dt_match[] = {
+	{ .compatible = "nxp,pf1550" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, pf1550_dt_match);
+
+static struct i2c_driver pf1550_i2c_driver = {
+	.driver = {
+		   .name = "pf1550",
+		   .pm = pm_sleep_ptr(&pf1550_pm),
+		   .of_match_table = pf1550_dt_match,
+	},
+	.probe = pf1550_i2c_probe,
+	.id_table = pf1550_i2c_id,
+};
+module_i2c_driver(pf1550_i2c_driver);
+
+MODULE_DESCRIPTION("NXP PF1550 core driver");
+MODULE_AUTHOR("Robin Gong <yibin.gong@freescale.com>");
+MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/pf1550.h b/include/linux/mfd/pf1550.h
new file mode 100644
index 0000000000000000000000000000000000000000..7cb2340ff2bd92883a709806da58601daaf98a88
--- /dev/null
+++ b/include/linux/mfd/pf1550.h
@@ -0,0 +1,273 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Declarations for the PF1550 PMIC
+ *
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ * Robin Gong <yibin.gong@freescale.com>
+ *
+ * Portions Copyright (c) 2025 Savoir-faire Linux Inc.
+ * Samuel Kayode <samuel.kayode@savoirfairelinux.com>
+ */
+
+#ifndef __LINUX_MFD_PF1550_H
+#define __LINUX_MFD_PF1550_H
+
+#include <linux/i2c.h>
+#include <linux/regmap.h>
+
+enum pf1550_pmic_reg {
+	/* PMIC regulator part */
+	PF1550_PMIC_REG_DEVICE_ID		= 0x00,
+	PF1550_PMIC_REG_OTP_FLAVOR		= 0x01,
+	PF1550_PMIC_REG_SILICON_REV		= 0x02,
+
+	PF1550_PMIC_REG_INT_CATEGORY		= 0x06,
+	PF1550_PMIC_REG_SW_INT_STAT0		= 0x08,
+	PF1550_PMIC_REG_SW_INT_MASK0		= 0x09,
+	PF1550_PMIC_REG_SW_INT_SENSE0		= 0x0a,
+	PF1550_PMIC_REG_SW_INT_STAT1		= 0x0b,
+	PF1550_PMIC_REG_SW_INT_MASK1		= 0x0c,
+	PF1550_PMIC_REG_SW_INT_SENSE1		= 0x0d,
+	PF1550_PMIC_REG_SW_INT_STAT2		= 0x0e,
+	PF1550_PMIC_REG_SW_INT_MASK2		= 0x0f,
+	PF1550_PMIC_REG_SW_INT_SENSE2		= 0x10,
+	PF1550_PMIC_REG_LDO_INT_STAT0		= 0x18,
+	PF1550_PMIC_REG_LDO_INT_MASK0		= 0x19,
+	PF1550_PMIC_REG_LDO_INT_SENSE0		= 0x1a,
+	PF1550_PMIC_REG_TEMP_INT_STAT0		= 0x20,
+	PF1550_PMIC_REG_TEMP_INT_MASK0		= 0x21,
+	PF1550_PMIC_REG_TEMP_INT_SENSE0		= 0x22,
+	PF1550_PMIC_REG_ONKEY_INT_STAT0		= 0x24,
+	PF1550_PMIC_REG_ONKEY_INT_MASK0		= 0x25,
+	PF1550_PMIC_REG_ONKEY_INT_SENSE0	= 0x26,
+	PF1550_PMIC_REG_MISC_INT_STAT0		= 0x28,
+	PF1550_PMIC_REG_MISC_INT_MASK0		= 0x29,
+	PF1550_PMIC_REG_MISC_INT_SENSE0		= 0x2a,
+
+	PF1550_PMIC_REG_COINCELL_CONTROL	= 0x30,
+
+	PF1550_PMIC_REG_SW1_VOLT		= 0x32,
+	PF1550_PMIC_REG_SW1_STBY_VOLT		= 0x33,
+	PF1550_PMIC_REG_SW1_SLP_VOLT		= 0x34,
+	PF1550_PMIC_REG_SW1_CTRL		= 0x35,
+	PF1550_PMIC_REG_SW1_CTRL1		= 0x36,
+	PF1550_PMIC_REG_SW2_VOLT		= 0x38,
+	PF1550_PMIC_REG_SW2_STBY_VOLT		= 0x39,
+	PF1550_PMIC_REG_SW2_SLP_VOLT		= 0x3a,
+	PF1550_PMIC_REG_SW2_CTRL		= 0x3b,
+	PF1550_PMIC_REG_SW2_CTRL1		= 0x3c,
+	PF1550_PMIC_REG_SW3_VOLT		= 0x3e,
+	PF1550_PMIC_REG_SW3_STBY_VOLT		= 0x3f,
+	PF1550_PMIC_REG_SW3_SLP_VOLT		= 0x40,
+	PF1550_PMIC_REG_SW3_CTRL		= 0x41,
+	PF1550_PMIC_REG_SW3_CTRL1		= 0x42,
+	PF1550_PMIC_REG_VSNVS_CTRL		= 0x48,
+	PF1550_PMIC_REG_VREFDDR_CTRL		= 0x4a,
+	PF1550_PMIC_REG_LDO1_VOLT		= 0x4c,
+	PF1550_PMIC_REG_LDO1_CTRL		= 0x4d,
+	PF1550_PMIC_REG_LDO2_VOLT		= 0x4f,
+	PF1550_PMIC_REG_LDO2_CTRL		= 0x50,
+	PF1550_PMIC_REG_LDO3_VOLT		= 0x52,
+	PF1550_PMIC_REG_LDO3_CTRL		= 0x53,
+	PF1550_PMIC_REG_PWRCTRL0		= 0x58,
+	PF1550_PMIC_REG_PWRCTRL1		= 0x59,
+	PF1550_PMIC_REG_PWRCTRL2		= 0x5a,
+	PF1550_PMIC_REG_PWRCTRL3		= 0x5b,
+	PF1550_PMIC_REG_SW1_PWRDN_SEQ		= 0x5f,
+	PF1550_PMIC_REG_SW2_PWRDN_SEQ		= 0x60,
+	PF1550_PMIC_REG_SW3_PWRDN_SEQ		= 0x61,
+	PF1550_PMIC_REG_LDO1_PWRDN_SEQ		= 0x62,
+	PF1550_PMIC_REG_LDO2_PWRDN_SEQ		= 0x63,
+	PF1550_PMIC_REG_LDO3_PWRDN_SEQ		= 0x64,
+	PF1550_PMIC_REG_VREFDDR_PWRDN_SEQ	= 0x65,
+
+	PF1550_PMIC_REG_STATE_INFO		= 0x67,
+	PF1550_PMIC_REG_I2C_ADDR		= 0x68,
+	PF1550_PMIC_REG_IO_DRV0			= 0x69,
+	PF1550_PMIC_REG_IO_DRV1			= 0x6a,
+	PF1550_PMIC_REG_RC_16MHZ		= 0x6b,
+	PF1550_PMIC_REG_KEY			= 0x6f,
+
+	/* Charger part */
+	PF1550_CHARG_REG_CHG_INT		= 0x80,
+	PF1550_CHARG_REG_CHG_INT_MASK		= 0x82,
+	PF1550_CHARG_REG_CHG_INT_OK		= 0x84,
+	PF1550_CHARG_REG_VBUS_SNS		= 0x86,
+	PF1550_CHARG_REG_CHG_SNS		= 0x87,
+	PF1550_CHARG_REG_BATT_SNS		= 0x88,
+	PF1550_CHARG_REG_CHG_OPER		= 0x89,
+	PF1550_CHARG_REG_CHG_TMR		= 0x8a,
+	PF1550_CHARG_REG_CHG_EOC_CNFG		= 0x8d,
+	PF1550_CHARG_REG_CHG_CURR_CNFG		= 0x8e,
+	PF1550_CHARG_REG_BATT_REG		= 0x8f,
+	PF1550_CHARG_REG_BATFET_CNFG		= 0x91,
+	PF1550_CHARG_REG_THM_REG_CNFG		= 0x92,
+	PF1550_CHARG_REG_VBUS_INLIM_CNFG	= 0x94,
+	PF1550_CHARG_REG_VBUS_LIN_DPM		= 0x95,
+	PF1550_CHARG_REG_USB_PHY_LDO_CNFG	= 0x96,
+	PF1550_CHARG_REG_DBNC_DELAY_TIME	= 0x98,
+	PF1550_CHARG_REG_CHG_INT_CNFG		= 0x99,
+	PF1550_CHARG_REG_THM_ADJ_SETTING	= 0x9a,
+	PF1550_CHARG_REG_VBUS2SYS_CNFG		= 0x9b,
+	PF1550_CHARG_REG_LED_PWM		= 0x9c,
+	PF1550_CHARG_REG_FAULT_BATFET_CNFG	= 0x9d,
+	PF1550_CHARG_REG_LED_CNFG		= 0x9e,
+	PF1550_CHARG_REG_CHGR_KEY2		= 0x9f,
+
+	PF1550_TEST_REG_FMRADDR			= 0xc4,
+	PF1550_TEST_REG_FMRDATA			= 0xc5,
+	PF1550_TEST_REG_KEY3			= 0xdf,
+
+	PF1550_PMIC_REG_END			= 0xff,
+};
+
+/* One-Time Programmable(OTP) memory */
+enum pf1550_otp_reg {
+	PF1550_OTP_SW1_SW2			= 0x1e,
+	PF1550_OTP_SW2_SW3			= 0x1f,
+};
+
+#define PF1550_DEVICE_ID		0x7c
+
+/* Keys for reading OTP */
+#define PF1550_OTP_PMIC_KEY		0x15
+#define PF1550_OTP_CHGR_KEY		0x50
+#define PF1550_OTP_TEST_KEY		0xab
+
+/* Supported charger modes */
+#define PF1550_CHG_BAT_OFF		1
+#define PF1550_CHG_BAT_ON		2
+
+#define PF1550_CHG_PRECHARGE		0
+#define PF1550_CHG_CONSTANT_CURRENT	1
+#define PF1550_CHG_CONSTANT_VOL		2
+#define PF1550_CHG_EOC			3
+#define PF1550_CHG_DONE			4
+#define PF1550_CHG_TIMER_FAULT		6
+#define PF1550_CHG_SUSPEND		7
+#define PF1550_CHG_OFF_INV		8
+#define PF1550_CHG_BAT_OVER		9
+#define PF1550_CHG_OFF_TEMP		10
+#define PF1550_CHG_LINEAR_ONLY		12
+#define PF1550_CHG_SNS_MASK		0xf
+#define PF1550_CHG_INT_MASK		0x51
+
+#define PF1550_BAT_NO_VBUS		0
+#define PF1550_BAT_LOW_THAN_PRECHARG	1
+#define PF1550_BAT_CHARG_FAIL		2
+#define PF1550_BAT_HIGH_THAN_PRECHARG	4
+#define PF1550_BAT_OVER_VOL		5
+#define PF1550_BAT_NO_DETECT		6
+#define PF1550_BAT_SNS_MASK		0x7
+
+#define PF1550_VBUS_UVLO		BIT(2)
+#define PF1550_VBUS_IN2SYS		BIT(3)
+#define PF1550_VBUS_OVLO		BIT(4)
+#define PF1550_VBUS_VALID		BIT(5)
+
+#define PF1550_CHARG_REG_BATT_REG_CHGCV_MASK		0x3f
+#define PF1550_CHARG_REG_BATT_REG_VMINSYS_SHIFT		6
+#define PF1550_CHARG_REG_BATT_REG_VMINSYS_MASK		GENMASK(7, 6)
+#define PF1550_CHARG_REG_THM_REG_CNFG_REGTEMP_SHIFT	2
+#define PF1550_CHARG_REG_THM_REG_CNFG_REGTEMP_MASK	GENMASK(3, 2)
+
+#define PF1550_ONKEY_RST_EN		BIT(7)
+
+/* DVS enable masks */
+#define OTP_SW1_DVS_ENB		BIT(1)
+#define OTP_SW2_DVS_ENB		BIT(3)
+
+/* Top level interrupt masks */
+#define IRQ_REGULATOR		(BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(6))
+#define IRQ_ONKEY		BIT(5)
+#define IRQ_CHG			BIT(0)
+
+/* Regulator interrupt masks */
+#define PMIC_IRQ_SW1_LS		BIT(0)
+#define PMIC_IRQ_SW2_LS		BIT(1)
+#define PMIC_IRQ_SW3_LS		BIT(2)
+#define PMIC_IRQ_SW1_HS		BIT(0)
+#define PMIC_IRQ_SW2_HS		BIT(1)
+#define PMIC_IRQ_SW3_HS		BIT(2)
+#define PMIC_IRQ_LDO1_FAULT	BIT(0)
+#define PMIC_IRQ_LDO2_FAULT	BIT(1)
+#define PMIC_IRQ_LDO3_FAULT	BIT(2)
+#define PMIC_IRQ_TEMP_110	BIT(0)
+#define PMIC_IRQ_TEMP_125	BIT(1)
+
+/* Onkey interrupt masks */
+#define ONKEY_IRQ_PUSHI		BIT(0)
+#define ONKEY_IRQ_1SI		BIT(1)
+#define ONKEY_IRQ_2SI		BIT(2)
+#define ONKEY_IRQ_3SI		BIT(3)
+#define ONKEY_IRQ_4SI		BIT(4)
+#define ONKEY_IRQ_8SI		BIT(5)
+
+/* Charger interrupt masks */
+#define CHARG_IRQ_BAT2SOCI	BIT(1)
+#define CHARG_IRQ_BATI		BIT(2)
+#define CHARG_IRQ_CHGI		BIT(3)
+#define CHARG_IRQ_VBUSI		BIT(5)
+#define CHARG_IRQ_DPMI		BIT(6)
+#define CHARG_IRQ_THMI		BIT(7)
+
+enum pf1550_irq {
+	PF1550_IRQ_CHG,
+	PF1550_IRQ_REGULATOR,
+	PF1550_IRQ_ONKEY,
+};
+
+enum pf1550_pmic_irq {
+	PF1550_PMIC_IRQ_SW1_LS,
+	PF1550_PMIC_IRQ_SW2_LS,
+	PF1550_PMIC_IRQ_SW3_LS,
+	PF1550_PMIC_IRQ_SW1_HS,
+	PF1550_PMIC_IRQ_SW2_HS,
+	PF1550_PMIC_IRQ_SW3_HS,
+	PF1550_PMIC_IRQ_LDO1_FAULT,
+	PF1550_PMIC_IRQ_LDO2_FAULT,
+	PF1550_PMIC_IRQ_LDO3_FAULT,
+	PF1550_PMIC_IRQ_TEMP_110,
+	PF1550_PMIC_IRQ_TEMP_125,
+};
+
+enum pf1550_onkey_irq {
+	PF1550_ONKEY_IRQ_PUSHI,
+	PF1550_ONKEY_IRQ_1SI,
+	PF1550_ONKEY_IRQ_2SI,
+	PF1550_ONKEY_IRQ_3SI,
+	PF1550_ONKEY_IRQ_4SI,
+	PF1550_ONKEY_IRQ_8SI,
+};
+
+enum pf1550_charg_irq {
+	PF1550_CHARG_IRQ_BAT2SOCI,
+	PF1550_CHARG_IRQ_BATI,
+	PF1550_CHARG_IRQ_CHGI,
+	PF1550_CHARG_IRQ_VBUSI,
+	PF1550_CHARG_IRQ_THMI,
+};
+
+enum pf1550_regulators {
+	PF1550_SW1,
+	PF1550_SW2,
+	PF1550_SW3,
+	PF1550_VREFDDR,
+	PF1550_LDO1,
+	PF1550_LDO2,
+	PF1550_LDO3,
+};
+
+struct pf1550_ddata {
+	struct regmap_irq_chip_data *irq_data_regulator;
+	struct regmap_irq_chip_data *irq_data_charger;
+	struct regmap_irq_chip_data *irq_data_onkey;
+	struct regmap_irq_chip_data *irq_data;
+	struct regmap *regmap;
+	struct device *dev;
+	bool dvs1_enable;
+	bool dvs2_enable;
+	int irq;
+};
+
+#endif /* __LINUX_MFD_PF1550_H */

-- 
2.50.1



^ permalink raw reply related

* [PATCH v12 0/6] add support for pf1550 PMIC MFD-based drivers
From: Samuel Kayode via B4 Relay @ 2025-10-01 15:42 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Liam Girdwood, Mark Brown, Dmitry Torokhov, Sebastian Reichel,
	Frank Li
  Cc: imx, devicetree, linux-kernel, linux-input, linux-pm, Abel Vesa,
	Abel Vesa, Robin Gong, Robin Gong, Enric Balletbo i Serra,
	Sean Nyekjaer, Christophe JAILLET, Samuel Kayode, Abel Vesa,
	Krzysztof Kozlowski, Frank Li, Sebastian Reichel

This series adds support for pf1550 PMIC. It provides the core driver and
sub-drivers for the regulator, power supply and input subsystems.

Patch 1 adds the DT binding document for the PMIC. Patches 2-5 adds the
pertinent drivers. Last patch adds a MAINTAINERS entry for the drivers.

The patches 3-5 depend on the core driver provided in patch 2.

Changes since v1:
   - DT bindings for all devices included
   - Add onkey driver
   - Add driver for the regulators
   - Ensure charger is activated as some variants have it off by default
   - Update mfd and charger driver per feedback from eballetbo@gmail.com
   - Add myself as maintainer for these drivers
   - Link to v1: https://lore.kernel.org/1523974819-8711-1-git-send-email-abel.vesa@nxp.com/

Changes since v2:
   - Rebase on recent mainline kernel v6.15
   - Single yaml file containing dt bindings for all pf1550 devices
   - irq mapping done in MFD driver as suggested by Dmitry Torokhov
   - Drop unnecessary includes in drivers
   - Replace dev_err with dev_err_probe in probe method of drivers
   - Drop compatible string from drivers of the sub-devices
   - Remove dependency on OF from drivers of the sub-devices
   - onkey: move driver from input/keyboard into input/misc
   - onkey: remove dependency on OF
   - onkey: use onkey virqs instead of central irq
   - onkey: fix integer overflow for regmap_write when unmasking
     interrupts during pf1550_onkey_resume
   - charger: add support for monitored-battery which is used in setting
     a constant voltage for the charger.
   - Address other feedback from Dmitry Torokhov and Krzysztof Kozlowski
   - Link to v2: https://lore.kernel.org/cover.1747409892.git.samuel.kayode@savoirfairelinux.com/

Changes since v3:
   - Update manufacturer from Freescale to NXP in compatible,
     dt-binding and Kconfigs
   - Use C++ style comments for SPDX license in .c code
   - Add portions copyright to source code
   - irqs are defined as struct resource in mfd cell such that
     platform_get_irq is used in the sub-devices
   - Make struct pf1550_dev of type const in sub-device driver
   - irq variable dropped from sub-device driver struct
   - EXPORT_SYMBOL of global pf1550_read_otp function for use in
     regulator driver
   - Drop unneeded info in driver_data when defining device table id
   - regulator: validate ramp_delay
   - regulator: report overcurrent and over temperature events
   - onkey: drop unnecessary keycode variable
   - onkey: change wakeup variable to type bool
   - onkey: replace (error < 0) with error in if statement when possible
   - onkey: use pm_sleep_ptr when defining driver.pm
   - charger: finish handling of some interrupts in threaded irq handler
   - Link to v3: https://lore.kernel.org/20250527-pf1550-v3-0-45f69453cd51@savoirfairelinux.com/

Changes since v4:
   - Use top level interrupt to minimize number of registers checked on
     each interrupt
   - Fix bad offset for temperature interrupts of regulator irq chip
   - Address Krzysztof's comments for dt-binding
   - regulator: add comments to clarify difference in its interrupts
   - regulator: issue warn event for _LS interrupt and error event for
     _HS interrupt
   - regulator: validate maximum and minimum ramp_delay
   - charger: drop lock in battery and charger delayed_work
   - charger: more conservative locking for vbus delayed_work
   - charger: apply lock when setting power_supply type during register
     intialization
   - Link to v4: https://lore.kernel.org/r/20250603-pf1550-v4-0-bfdf51ee59cc@savoirfairelinux.com

Changes since v5:
   - Ensure lowercase when assigning hex values
   - Add imx@lists.linux.dev to relevant mailing list in MAINTAINERS file
   - Use GENMASK macro
   - Drop unused chips variable
   - Read the OTP in the mfd driver probe for new dvs_enb variable
   - Hardcode IRQ flags in pf1550_add_child function
   - charger: drop the mutex entirely
   - charger: reverse christmas tree style local variable definition in
     probe
   - Link to v5: https://lore.kernel.org/r/20250610-pf1550-v5-0-ed0d9e3aaac7@savoirfairelinux.com

Changes since v6:
   - Use reverse christmas tree order
   - Drop 0 in table id's driver data
   - charger: store virq to avoid reinvoking platform_get_irq in ISR
   - Link to v6: https://lore.kernel.org/r/20250611-pf1550-v6-0-34f2ddfe045e@savoirfairelinux.com

Changes since v7:
  - Thanks everyone for the reviews
  - Use C++ comment only for SPDX license header in core, charger and
    onkey drivers
  - Drop filenames from comments
  - Rename pf1550_dev to pf1550_ddata
  - Define OTP register for accessing status of DVS
  - core: rename from `mfd driver` to `core driver`
  - core: add child devices in a cleaner manner
  - charger: define two power supplies: battery and external power
  - charger: use devm_delayed_work_autocancel
  - Link to v7: https://lore.kernel.org/r/20250612-pf1550-v7-0-0e393b0f45d7@savoirfairelinux.com

Changes since v8:
  - Collect Frank's `Reviewed-by` tags
  - core: use consistent whitespace
  - regulator: add standby support for regulators requested by Sean Nyekjaer
  - regulator: add support for SW1 DVS enable/disable
  - regulator: fix improper DVS activation
  - regulator: add map_voltage for regulators
  - regulator: add enable/disable for regulators
  - charger: use datasheet thermal regulation temperature ranges
  - charger: select charger operation mode based on the application
  - onkey: add support for disabling system power down via onkey
  - dt-bindings: changed temperature ranges
  - dt-bindings: added `disable-key-power`
  - Link to v8: https://lore.kernel.org/r/20250707-pf1550-v8-0-6b6eb67c03a0@savoirfairelinux.com

Changes since v9:
  - add Sean's Tested-by tag
  - core: style changes
  - dt-bindings: add regulator-state-mem to examples
  - onkey: use regmap_clear_bits to avoid overwriting all bits of the
    PWRCTRL register
  - Link to v9: https://lore.kernel.org/r/20250716-pf1550-v9-0-502a647f04ef@savoirfairelinux.com

Changes since v10:
  - add Sean's Tested-by tag on mfd patch
  - charger: separate battery properties from charger properties
  - Link to v10: https://lore.kernel.org/r/20250820-pf1550-v10-0-4c0b6e4445e3@savoirfairelinux.com

Changes since v11:
  - rebase on v6.17
  - charger: add Sebastian's `Acked-by` tag
  - Link to v11: https://lore.kernel.org/r/20250917-pf1550-v11-0-e0649822fcc9@savoirfairelinux.com

Signed-off-by: Samuel Kayode <samuel.kayode@savoirfairelinux.com>
---
Samuel Kayode (6):
      dt-bindings: mfd: add pf1550
      mfd: pf1550: add core driver
      regulator: pf1550: add support for regulator
      input: pf1550: add onkey support
      power: supply: pf1550: add battery charger support
      MAINTAINERS: add an entry for pf1550 mfd driver

 .../devicetree/bindings/mfd/nxp,pf1550.yaml        | 161 ++++++
 MAINTAINERS                                        |  11 +
 drivers/input/misc/Kconfig                         |  11 +
 drivers/input/misc/Makefile                        |   1 +
 drivers/input/misc/pf1550-onkey.c                  | 197 +++++++
 drivers/mfd/Kconfig                                |  16 +
 drivers/mfd/Makefile                               |   2 +
 drivers/mfd/pf1550.c                               | 367 ++++++++++++
 drivers/power/supply/Kconfig                       |  11 +
 drivers/power/supply/Makefile                      |   1 +
 drivers/power/supply/pf1550-charger.c              | 641 +++++++++++++++++++++
 drivers/regulator/Kconfig                          |   9 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/pf1550-regulator.c               | 429 ++++++++++++++
 include/linux/mfd/pf1550.h                         | 273 +++++++++
 15 files changed, 2131 insertions(+)
---
base-commit: 6063257da111c7639d020c5f15bfb37fb839d8b6
change-id: 20250527-pf1550-d401f0d07b80

Best regards,
-- 
Samuel Kayode <samuel.kayode@savoirfairelinux.com>



^ permalink raw reply

* [PATCH v12 1/6] dt-bindings: mfd: add pf1550
From: Samuel Kayode via B4 Relay @ 2025-10-01 15:42 UTC (permalink / raw)
  To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Liam Girdwood, Mark Brown, Dmitry Torokhov, Sebastian Reichel,
	Frank Li
  Cc: imx, devicetree, linux-kernel, linux-input, linux-pm, Abel Vesa,
	Abel Vesa, Robin Gong, Robin Gong, Enric Balletbo i Serra,
	Sean Nyekjaer, Christophe JAILLET, Samuel Kayode, Abel Vesa,
	Krzysztof Kozlowski
In-Reply-To: <20251001-pf1550-v12-0-a3302aa41687@savoirfairelinux.com>

From: Samuel Kayode <samuel.kayode@savoirfairelinux.com>

Add a DT binding document for pf1550 PMIC. This describes the core mfd
device along with its children: regulators, charger and onkey.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Samuel Kayode <samuel.kayode@savoirfairelinux.com>
---
v10:
 - Add regulator-state-mem to examples
v9:
 - Add regulator suspend bindings in example
 - Add binding for disabling onkey power down
 - Fix thermal regulation temperature range
v5:
 - Address Krzystof's feedback:
   - Drop monitored battery ref already included in power supply schema
   - Move `additionalProperties` close to `type` for regulator
   - Drop unneccessary |
   - Change `additionalProperties` to `unevaluatedProperties` for the
     PMIC
v4:
 - Address Krzystof's feedback:
   - Filename changed to nxp,pf1550.yaml
   - Replace Freescale with NXP
   - Define include before battery-cell
   - Drop operating-range-celsius in example since
     nxp,thermal-regulation-celsisus already exists
 - Not sure if there is similar binding to thermal-regulation...
   for regulating temperature on thermal-zones? @Sebastian and @Krzysztof
v3:
 - Address Krzysztof's feedback:
   - Fold charger and onkey objects
   - Drop compatible for sub-devices: onkey, charger and regulator.
   - Drop constant voltage property already included in
     monitored-battery
   - Fix whitespace warnings
   - Fix license
v2:
 - Add yamls for the PMIC and the sub-devices
---
 .../devicetree/bindings/mfd/nxp,pf1550.yaml        | 161 +++++++++++++++++++++
 1 file changed, 161 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/nxp,pf1550.yaml b/Documentation/devicetree/bindings/mfd/nxp,pf1550.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e50dc44252c60063463295c5ec3e3c90d1592ec2
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/nxp,pf1550.yaml
@@ -0,0 +1,161 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/nxp,pf1550.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PF1550 Power Management IC
+
+maintainers:
+  - Samuel Kayode <samuel.kayode@savoirfairelinux.com>
+
+description:
+  PF1550 PMIC provides battery charging and power supply for low power IoT and
+  wearable applications. This device consists of an i2c controlled MFD that
+  includes regulators, battery charging and an onkey/power button.
+
+$ref: /schemas/power/supply/power-supply.yaml
+
+properties:
+  compatible:
+    const: nxp,pf1550
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  wakeup-source: true
+
+  regulators:
+    type: object
+    additionalProperties: false
+
+    patternProperties:
+      "^(ldo[1-3]|sw[1-3]|vrefddr)$":
+        type: object
+        $ref: /schemas/regulator/regulator.yaml
+        description:
+          regulator configuration for ldo1-3, buck converters(sw1-3)
+          and DDR termination reference voltage (vrefddr)
+        unevaluatedProperties: false
+
+  monitored-battery:
+    description: |
+      A phandle to a monitored battery node that contains a valid value
+      for:
+      constant-charge-voltage-max-microvolt.
+
+  nxp,thermal-regulation-celsius:
+    description:
+      Temperature threshold for thermal regulation of charger in celsius.
+    enum: [ 80, 95, 110, 125 ]
+
+  nxp,min-system-microvolt:
+    description:
+      System specific lower limit voltage.
+    enum: [ 3500000, 3700000, 4300000 ]
+
+  nxp,disable-key-power:
+    type: boolean
+    description:
+      Disable power-down using a long key-press. The onkey driver will remove
+      support for the KEY_POWER key press when triggered using a long press of
+      the onkey.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/input/linux-event-codes.h>
+
+    battery: battery-cell {
+        compatible = "simple-battery";
+        constant-charge-voltage-max-microvolt = <4400000>;
+    };
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pmic@8 {
+            compatible = "nxp,pf1550";
+            reg = <0x8>;
+
+            interrupt-parent = <&gpio1>;
+            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+            wakeup-source;
+            monitored-battery = <&battery>;
+            nxp,min-system-microvolt = <4300000>;
+            nxp,thermal-regulation-celsius = <80>;
+
+            regulators {
+                sw1_reg: sw1 {
+                    regulator-name = "sw1";
+                    regulator-min-microvolt = <600000>;
+                    regulator-max-microvolt = <1387500>;
+                    regulator-always-on;
+                    regulator-ramp-delay = <6250>;
+
+                    regulator-state-mem {
+                        regulator-on-in-suspend;
+                        regulator-suspend-min-microvolt = <1270000>;
+                    };
+                };
+
+                sw2_reg: sw2 {
+                    regulator-name = "sw2";
+                    regulator-min-microvolt = <600000>;
+                    regulator-max-microvolt = <1387500>;
+                    regulator-always-on;
+
+                    regulator-state-mem {
+                        regulator-on-in-suspend;
+                    };
+                };
+
+                sw3_reg: sw3 {
+                    regulator-name = "sw3";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-always-on;
+
+                    regulator-state-mem {
+                        regulator-on-in-suspend;
+                    };
+                };
+
+                vldo1_reg: ldo1 {
+                    regulator-name = "ldo1";
+                    regulator-min-microvolt = <750000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-always-on;
+
+                    regulator-state-mem {
+                        regulator-off-in-suspend;
+                    };
+                };
+
+                vldo2_reg: ldo2 {
+                    regulator-name = "ldo2";
+                    regulator-min-microvolt = <1800000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-always-on;
+                };
+
+                vldo3_reg: ldo3 {
+                    regulator-name = "ldo3";
+                    regulator-min-microvolt = <750000>;
+                    regulator-max-microvolt = <3300000>;
+                    regulator-always-on;
+                };
+            };
+        };
+    };

-- 
2.50.1



^ permalink raw reply related

* Re: [PATCH v2 0/2] Fix CONFIG_HYPERV and vmbus related anamoly
From: Wei Liu @ 2025-10-01  0:01 UTC (permalink / raw)
  To: Mukesh Rathor
  Cc: dri-devel, linux-kernel, linux-input, linux-hyperv, netdev,
	linux-pci, linux-scsi, linux-fbdev, linux-arch, virtualization,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona, jikos,
	bentiss, kys, haiyangz, wei.liu, decui, dmitry.torokhov,
	andrew+netdev, davem, edumazet, kuba, pabeni, bhelgaas,
	James.Bottomley, martin.petersen, gregkh, deller, arnd, sgarzare,
	horms
In-Reply-To: <20250915234604.3256611-1-mrathor@linux.microsoft.com>

On Mon, Sep 15, 2025 at 04:46:02PM -0700, Mukesh Rathor wrote:
> At present, drivers/Makefile will subst =m to =y for CONFIG_HYPERV
> for hv subdir. Also, drivers/hv/Makefile replaces =m to =y to build in
> hv_common.c that is needed for the drivers. Moreover, vmbus driver is
> built if CONFIG_HYPER is set, either loadable or builtin.
> 
> This is not a good approach. CONFIG_HYPERV is really an umbrella
> config that encompasses builtin code and various other things and not
> a dedicated config option for VMBus. VMBus should really have a config
> option just like CONFIG_HYPERV_BALLOON etc. This small series introduces
> CONFIG_HYPERV_VMBUS to build VMBus driver and make that distinction
> explicit. With that CONFIG_HYPERV could be changed to bool.
> 
> For now, hv_common.c is left as is to reduce conflicts for upcoming
> patches, but once merges are mostly done, that and some others should
> be moved to virt/hyperv directory.
> 
> V2:
>  o rebased on hyper-next: commit 553d825fb2f0 
>         ("x86/hyperv: Switch to msi_create_parent_irq_domain()")
> 
> V1:
>  o Change subject from hyper-v to "Drivers: hv:"
>  o Rewrite commit messages paying attention to VMBus and not vmbus
>  o Change some wordings in Kconfig
>  o Make new VMBUS config option default to HYPERV option for a smoother
>    transition
> 
> Mukesh Rathor (2):
>   Driver: hv: Add CONFIG_HYPERV_VMBUS option

I changed Driver to Drivers and applied both patches. Thanks.

^ permalink raw reply

* Re: [PATCH v1 0/2] Fix CONFIG_HYPERV and vmbus related anamoly
From: Wei Liu @ 2025-09-30 23:59 UTC (permalink / raw)
  To: Mukesh Rathor
  Cc: dri-devel, linux-kernel, linux-input, linux-hyperv, netdev,
	linux-pci, linux-scsi, linux-fbdev, linux-arch, virtualization,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona, jikos,
	bentiss, kys, haiyangz, wei.liu, decui, dmitry.torokhov,
	andrew+netdev, davem, edumazet, kuba, pabeni, bhelgaas,
	James.Bottomley, martin.petersen, gregkh, deller, arnd, sgarzare,
	horms
In-Reply-To: <aNxuU6VI3dQVPYF7@liuwe-devbox-ubuntu-v2.lamzopl0uupeniq2etz1fddiyg.xx.internal.cloudapp.net>

On Tue, Sep 30, 2025 at 11:57:07PM +0000, Wei Liu wrote:
> On Fri, Sep 05, 2025 at 06:09:50PM -0700, Mukesh Rathor wrote:
> > At present, drivers/Makefile will subst =m to =y for CONFIG_HYPERV
> > for hv subdir. Also, drivers/hv/Makefile replaces =m to =y to build in
> > hv_common.c that is needed for the drivers. Moreover, vmbus driver is
> > built if CONFIG_HYPER is set, either loadable or builtin.
> > 
> > This is not a good approach. CONFIG_HYPERV is really an umbrella
> > config that encompasses builtin code and various other things and not
> > a dedicated config option for VMBus. VMBus should really have a config
> > option just like CONFIG_HYPERV_BALLOON etc. This small series introduces
> > CONFIG_HYPERV_VMBUS to build VMBus driver and make that distinction
> > explicit. With that CONFIG_HYPERV could be changed to bool.
> > 
> > For now, hv_common.c is left as is to reduce conflicts for upcoming
> > patches, but once merges are mostly done, that and some others should
> > be moved to virt/hyperv directory.
> > 
> > V1:
> >  o Change subject from hyper-v to "Drivers: hv:"
> >  o Rewrite commit messages paying attention to VMBus and not vmbus
> >  o Change some wordings in Kconfig
> >  o Make new VMBUS config option default to HYPERV option for a smoother
> >    transition
> > 
> > Mukesh Rathor (2):
> >   Driver: hv: Add CONFIG_HYPERV_VMBUS option
> >   Drivers: hv: Make CONFIG_HYPERV bool
> > 
> 
> Applied. Thanks.

I meant to apply v2 of this series. This is sent to the wrong version.
Please ignore.

^ permalink raw reply

* Re: [PATCH v1 0/2] Fix CONFIG_HYPERV and vmbus related anamoly
From: Wei Liu @ 2025-09-30 23:57 UTC (permalink / raw)
  To: Mukesh Rathor
  Cc: dri-devel, linux-kernel, linux-input, linux-hyperv, netdev,
	linux-pci, linux-scsi, linux-fbdev, linux-arch, virtualization,
	maarten.lankhorst, mripard, tzimmermann, airlied, simona, jikos,
	bentiss, kys, haiyangz, wei.liu, decui, dmitry.torokhov,
	andrew+netdev, davem, edumazet, kuba, pabeni, bhelgaas,
	James.Bottomley, martin.petersen, gregkh, deller, arnd, sgarzare,
	horms
In-Reply-To: <20250906010952.2145389-1-mrathor@linux.microsoft.com>

On Fri, Sep 05, 2025 at 06:09:50PM -0700, Mukesh Rathor wrote:
> At present, drivers/Makefile will subst =m to =y for CONFIG_HYPERV
> for hv subdir. Also, drivers/hv/Makefile replaces =m to =y to build in
> hv_common.c that is needed for the drivers. Moreover, vmbus driver is
> built if CONFIG_HYPER is set, either loadable or builtin.
> 
> This is not a good approach. CONFIG_HYPERV is really an umbrella
> config that encompasses builtin code and various other things and not
> a dedicated config option for VMBus. VMBus should really have a config
> option just like CONFIG_HYPERV_BALLOON etc. This small series introduces
> CONFIG_HYPERV_VMBUS to build VMBus driver and make that distinction
> explicit. With that CONFIG_HYPERV could be changed to bool.
> 
> For now, hv_common.c is left as is to reduce conflicts for upcoming
> patches, but once merges are mostly done, that and some others should
> be moved to virt/hyperv directory.
> 
> V1:
>  o Change subject from hyper-v to "Drivers: hv:"
>  o Rewrite commit messages paying attention to VMBus and not vmbus
>  o Change some wordings in Kconfig
>  o Make new VMBUS config option default to HYPERV option for a smoother
>    transition
> 
> Mukesh Rathor (2):
>   Driver: hv: Add CONFIG_HYPERV_VMBUS option
>   Drivers: hv: Make CONFIG_HYPERV bool
> 

Applied. Thanks.

^ permalink raw reply

* Re: [PATCH v1 2/2] Drivers: hv: Make CONFIG_HYPERV bool
From: Wei Liu @ 2025-09-30 22:05 UTC (permalink / raw)
  To: Mukesh R
  Cc: Greg KH, dri-devel, linux-kernel, linux-input, linux-hyperv,
	netdev, linux-pci, linux-scsi, linux-fbdev, linux-arch,
	virtualization, maarten.lankhorst, mripard, tzimmermann, airlied,
	simona, jikos, bentiss, kys, haiyangz, wei.liu, decui,
	dmitry.torokhov, andrew+netdev, davem, edumazet, kuba, pabeni,
	bhelgaas, James.Bottomley, martin.petersen, deller, arnd,
	sgarzare, horms
In-Reply-To: <a8c8305c-b518-c840-fc64-50bcba302725@linux.microsoft.com>

On Fri, Sep 12, 2025 at 11:10:00AM -0700, Mukesh R wrote:
[...]
> > What was it made against?
> > 
> 
> Sorry to hear that. It was built against hyper-next, but perhaps I 
> accidentally used our internal mirror. Let me rebase and send V2
> right away.

Sorry for the late reply -- I was away for two weeks. I can pick this
series up.

Greg, feel free to ignore this series.

Wei

> 
> Thanks,
> -Mukesh
> 
> 
> 

^ permalink raw reply

* Re: [PATCH next] Input: aw86927 - Fix error code in probe()
From: Dmitry Torokhov @ 2025-09-30 20:47 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Griffin Kroah-Hartman, linux-input, linux-kernel, kernel-janitors
In-Reply-To: <aNvMPTnOovdBitdP@stanley.mountain>

On Tue, Sep 30, 2025 at 03:25:33PM +0300, Dan Carpenter wrote:
> Fix this copy and paste bug.  Return "err" instead of
> PTR_ERR(haptics->regmap).
> 
> Fixes: 52e06d564ce6 ("Input: aw86927 - add driver for Awinic AW86927")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH v2 2/2] dt-bindings: touchscreen: move ar1021.txt to trivial-touch.yaml
From: Conor Dooley @ 2025-09-30 19:05 UTC (permalink / raw)
  To: Frank Li
  Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list, imx
In-Reply-To: <20250926184720.391335-2-Frank.Li@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]

On Fri, Sep 26, 2025 at 02:47:12PM -0400, Frank Li wrote:
> ar1021 have only reg and interrupts property beside touch common
> properties. So move context of ar1021.txt into trivial-touch.yaml.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> change in v2
>  move to trivial-touch.yaml
> 
> previous discussion
>     https://lore.kernel.org/imx/20250925-swimming-overspend-ddf7ab4a252c@spud/T/#t

You mentioned there were a load of other devices using just these 3
properties. Do you intend moving those too?

> ---
>  .../bindings/input/touchscreen/ar1021.txt         | 15 ---------------
>  .../bindings/input/touchscreen/trivial-touch.yaml |  2 ++
>  2 files changed, 2 insertions(+), 15 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt b/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
> deleted file mode 100644
> index 82019bd6094ee..0000000000000
> --- a/Documentation/devicetree/bindings/input/touchscreen/ar1021.txt
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -* Microchip AR1020 and AR1021 touchscreen interface (I2C)
> -
> -Required properties:
> -- compatible		: "microchip,ar1021-i2c"
> -- reg			: I2C slave address
> -- interrupts		: touch controller interrupt
> -
> -Example:
> -
> -	touchscreen@4d {
> -		compatible = "microchip,ar1021-i2c";
> -		reg = <0x4d>;
> -		interrupt-parent = <&gpio3>;
> -		interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml
> index c393cce273c5b..d6aed3afd4acb 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml
> @@ -14,6 +14,8 @@ properties:
>      enum:
>        # MAXI MAX11801 Resistive touch screen controller with i2c interface
>        - maxim,max11801
> +      # Microchip AR1020 and AR1021 touchscreen interface (I2C)
> +      - microchip,ar1021-i2c
>  
>    reg:
>      maxItems: 1
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* [PATCH next] Input: aw86927 - Fix error code in probe()
From: Dan Carpenter @ 2025-09-30 12:25 UTC (permalink / raw)
  To: Griffin Kroah-Hartman
  Cc: Dmitry Torokhov, linux-input, linux-kernel, kernel-janitors

Fix this copy and paste bug.  Return "err" instead of
PTR_ERR(haptics->regmap).

Fixes: 52e06d564ce6 ("Input: aw86927 - add driver for Awinic AW86927")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/input/misc/aw86927.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/misc/aw86927.c b/drivers/input/misc/aw86927.c
index a0c88a7e1e1c..8ad361239cfe 100644
--- a/drivers/input/misc/aw86927.c
+++ b/drivers/input/misc/aw86927.c
@@ -759,8 +759,7 @@ static int aw86927_probe(struct i2c_client *client)
 	/* Software reset */
 	err = regmap_write(haptics->regmap, AW86927_RSTCFG_REG, AW86927_RSTCFG_SOFTRST);
 	if (err)
-		return dev_err_probe(haptics->dev, PTR_ERR(haptics->regmap),
-					"Failed Software reset\n");
+		return dev_err_probe(haptics->dev, err,	"Failed Software reset\n");
 
 	/* Wait ~3ms until I2C is accessible */
 	usleep_range(3000, 3500);
-- 
2.51.0


^ permalink raw reply related

* Re: [PATCH v2 0/2] Add tc3408 bindings and timing
From: Langyan Ye @ 2025-09-30  8:21 UTC (permalink / raw)
  To: dmitry.torokhov, robh, krzk+dt, conor+dt, jikos, bentiss
  Cc: dianders, linux-input, devicetree, linux-kernel
In-Reply-To: <CA++9cvojHApEr0b5ZbRNVjYtWvCS8WmZ-mrGMDh5O9mp1fkT0w@mail.gmail.com>

Hi,

Just a gentle ping on this 2-patch series:

  [1/2] https://patchwork.kernel.org/project/linux-input/patch/20250821031514.49497-2-yelangyan@huaqin.corp-partner.google.com/
    Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

  [2/2] https://patchwork.kernel.org/project/linux-input/patch/20250821031514.49497-3-yelangyan@huaqin.corp-partner.google.com/
    Reviewed-by: Douglas Anderson <dianders@chromium.org>

Both patches have been reviewed.
Is there anything else I should do to help get this series landed?

Thanks a lot!

Best regards,
Langyan

^ permalink raw reply

* [PATCH AUTOSEL 6.16-6.6] HID: asus: add support for missing PX series fn keys
From: Sasha Levin @ 2025-09-30  2:18 UTC (permalink / raw)
  To: patches, stable
  Cc: Amit Chaudhari, Jiri Kosina, Sasha Levin, jikos, bentiss,
	linux-input
In-Reply-To: <20250930021831.688479-1-sashal@kernel.org>

From: Amit Chaudhari <amitchaudhari@mac.com>

[ Upstream commit 831f70a5b93bd2d9e858ced2c12fab5766ede5e7 ]

Add support for missing hotkey keycodes affecting Asus PX13 and PX16 families
so userspace can use them.

Signed-off-by: Amit Chaudhari <amitchaudhari@mac.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Backport Analysis

**Backport Status: YES**

### Comprehensive Analysis

After extensive investigation of this commit, the code changes, git
history, and related patterns, this commit is an excellent candidate for
backporting to stable kernel trees.

#### What the Commit Does

The commit adds three new HID usage code mappings for Asus keyboard
function keys in `drivers/hid/hid-asus.c:964-997`:

1. **`case 0x4e: KEY_FN_ESC`** - Maps Fn+Esc key functionality
2. **`case 0x7e: KEY_EMOJI_PICKER`** - Maps emoji picker key
3. **`case 0x8b: KEY_PROG1`** - Maps ProArt Creator Hub key (with
   explicit comment)

These mappings are added to the existing switch statement that handles
`HID_UP_ASUSVENDOR` usage codes, enabling previously non-functional
hardware keys on Asus PX13 and PX16 laptop families.

#### Why This Should Be Backported

**1. Fixes User-Visible Bug**
- Without this patch, hardware function keys on PX13/PX16 laptops don't
  work
- This is a clear hardware support regression affecting real users
- Users cannot access important laptop functionality (Fn keys, Creator
  Hub)

**2. Minimal and Contained Change**
- Only 3 lines added to a single switch statement
- No architectural changes or complex logic
- Changes are confined to `drivers/hid/hid-asus.c`
- Pattern: Simple addition of case labels with direct key mappings

**3. Very Low Regression Risk**
- Adding new key mappings cannot break existing functionality
- Keys were previously ignored (returned -1 by default case)
- No existing code paths are modified
- Driver-specific change only affects Asus keyboard users

**4. No Problematic Dependencies**
- `KEY_FN_ESC`: Present since Linux 2.6.11 (ancient, available
  everywhere)
- `KEY_EMOJI_PICKER`: Added in v5.12 (April 2021, commit 7b229b13d78d,
  already backported to stable)
- `KEY_PROG1`: Standard key code, very old
- All dependencies satisfied in stable kernel trees v5.12+

**5. Follows Established Patterns**
- Similar commit `5ec4596a0ba9a` ("HID: asus: add ROG Ally N-Key ID and
  keycodes") was successfully backported to stable (signed by Sasha
  Levin)
- Multiple historical commits adding Asus keycodes have been backported
  (e.g., `73920f615159`, `74e47b2c52ed`)
- This driver has a strong track record of accepting simple keycode
  additions in stable

**6. Meets Stable Kernel Rules**
- Important bugfix (missing hardware support)
- Obviously correct (just mapping hardware codes to standard keycodes)
- Tested in mainline (in v6.17 since August 2025)
- No known issues or reverts

#### Code Change Analysis

The changes are in `drivers/hid/hid-asus.c` at the
`asus_input_mapping()` function. The function checks if the HID usage
page matches `HID_UP_ASUSVENDOR`, then maps vendor-specific usage codes
to standard Linux input key codes using a switch statement.

The three new cases are inserted logically:
- `0x4e` and `0x7e` are placed together near other standard function
  keys
- `0x8b` is placed with a comment identifying it as ProArt-specific,
  positioned before the other special function keys (ROG key, touchpad
  toggle, etc.)

The macro `asus_map_key_clear()` is used consistently with all other
mappings in the driver, ensuring proper registration and clearing of the
key mapping.

#### Target Stable Kernels

This commit should be backported to:
- **All stable kernels v5.12+** (where KEY_EMOJI_PICKER is available)
- Primary focus: v6.1.x (LTS), v6.6.x (LTS), v6.12.x, v6.15.x stable
  trees

Users of Asus PX13/PX16 laptops on these kernel versions will
immediately benefit from functional hardware keys.

 drivers/hid/hid-asus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index d27dcfb2b9e4e..8db9d4e7c3b0b 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -974,7 +974,10 @@ static int asus_input_mapping(struct hid_device *hdev,
 		case 0xc4: asus_map_key_clear(KEY_KBDILLUMUP);		break;
 		case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN);		break;
 		case 0xc7: asus_map_key_clear(KEY_KBDILLUMTOGGLE);	break;
+		case 0x4e: asus_map_key_clear(KEY_FN_ESC);		break;
+		case 0x7e: asus_map_key_clear(KEY_EMOJI_PICKER);	break;
 
+		case 0x8b: asus_map_key_clear(KEY_PROG1);	break; /* ProArt Creator Hub key */
 		case 0x6b: asus_map_key_clear(KEY_F21);		break; /* ASUS touchpad toggle */
 		case 0x38: asus_map_key_clear(KEY_PROG1);	break; /* ROG key */
 		case 0xba: asus_map_key_clear(KEY_PROG2);	break; /* Fn+C ASUS Splendid */
-- 
2.51.0


^ permalink raw reply related

* RE: [PATCH 07/19 v6.1.y] minmax: make generic MIN() and MAX() macros available everywhere
From: Farber, Eliav @ 2025-09-29 18:39 UTC (permalink / raw)
  To: Greg KH
  Cc: linux@armlinux.org.uk, richard@nod.at,
	anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
	dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com, tony.luck@intel.com,
	qiuxu.zhuo@intel.com, mchehab@kernel.org, james.morse@arm.com,
	rric@kernel.org, harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
	daniel@ffwll.ch, evan.quan@amd.com, james.qian.wang@arm.com,
	liviu.dudau@arm.com, mihail.atanassov@arm.com,
	brian.starkey@arm.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, robdclark@gmail.com,
	quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org,
	sean@poorly.run, jdelvare@suse.com, linux@roeck-us.net,
	linus.walleij@linaro.org, dmitry.torokhov@gmail.com,
	maz@kernel.org, wens@csie.org, jernej.skrabec@gmail.com,
	samuel@sholland.org, agk@redhat.com, snitzer@kernel.org,
	dm-devel@redhat.com, rajur@chelsio.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	peppe.cavallaro@st.com, alexandre.torgue@foss.st.com,
	joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
	krzysztof.kozlowski@linaro.org, malattia@linux.it,
	hdegoede@redhat.com, markgross@kernel.org,
	artur.paszkiewicz@intel.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, sakari.ailus@linux.intel.com,
	fei1.li@intel.com, clm@fb.com, josef@toxicpanda.com,
	dsterba@suse.com, jack@suse.com, tytso@mit.edu,
	adilger.kernel@dilger.ca, dushistov@mail.ru,
	luc.vanoostenryck@gmail.com, rostedt@goodmis.org,
	mhiramat@kernel.org, pmladek@suse.com, senozhatsky@chromium.org,
	andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
	minchan@kernel.org, ngupta@vflare.org, akpm@linux-foundation.org,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de, jmaloy@redhat.com,
	ying.xue@windriver.com, andrii@kernel.org, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, shuah@kernel.org, keescook@chromium.org,
	wad@chromium.org, willy@infradead.org, sashal@kernel.org,
	ruanjinjie@huawei.com, quic_akhilpo@quicinc.com,
	David.Laight@aculab.com, herve.codina@bootlin.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-um@lists.infradead.org,
	linux-edac@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, linux-hwmon@vger.kernel.org,
	linux-input@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-media@vger.kernel.org, netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org,
	linux-mm@kvack.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, tipc-discussion@lists.sourceforge.net,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	stable@vger.kernel.org, Linus Torvalds, Lorenzo Stoakes
In-Reply-To: <2025092923-stove-rule-a00f@gregkh>

On Wed, Sep 24, 2025 at 08:23:08PM +0000, Eliav Farber wrote:
> From: Linus Torvalds <torvalds@linux-foundation.org>
>
> [ Upstream commit 1a251f52cfdc417c84411a056bc142cbd77baef4 ]

<snip>

As this didn't go into 6.6.y yet, I'll stop here on this series for now.
Please fix up for newer kernels first and then resend these.

The fix for 6.6.y was applied also on 6.1.y:
https://lore.kernel.org/stable/20250929183358.18982-1-farbere@amazon.com/

---
Regards, Eliav

^ permalink raw reply

* RE: [PATCH 07/19 v6.1.y] minmax: make generic MIN() and MAX() macros available everywhere
From: Farber, Eliav @ 2025-09-29 17:21 UTC (permalink / raw)
  To: Greg KH
  Cc: linux@armlinux.org.uk, richard@nod.at,
	anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
	dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com, tony.luck@intel.com,
	qiuxu.zhuo@intel.com, mchehab@kernel.org, james.morse@arm.com,
	rric@kernel.org, harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
	daniel@ffwll.ch, evan.quan@amd.com, james.qian.wang@arm.com,
	liviu.dudau@arm.com, mihail.atanassov@arm.com,
	brian.starkey@arm.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, robdclark@gmail.com,
	quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org,
	sean@poorly.run, jdelvare@suse.com, linux@roeck-us.net,
	linus.walleij@linaro.org, dmitry.torokhov@gmail.com,
	maz@kernel.org, wens@csie.org, jernej.skrabec@gmail.com,
	samuel@sholland.org, agk@redhat.com, snitzer@kernel.org,
	dm-devel@redhat.com, rajur@chelsio.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	peppe.cavallaro@st.com, alexandre.torgue@foss.st.com,
	joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
	krzysztof.kozlowski@linaro.org, malattia@linux.it,
	hdegoede@redhat.com, markgross@kernel.org,
	artur.paszkiewicz@intel.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, sakari.ailus@linux.intel.com,
	fei1.li@intel.com, clm@fb.com, josef@toxicpanda.com,
	dsterba@suse.com, jack@suse.com, tytso@mit.edu,
	adilger.kernel@dilger.ca, dushistov@mail.ru,
	luc.vanoostenryck@gmail.com, rostedt@goodmis.org,
	mhiramat@kernel.org, pmladek@suse.com, senozhatsky@chromium.org,
	andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
	minchan@kernel.org, ngupta@vflare.org, akpm@linux-foundation.org,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de, jmaloy@redhat.com,
	ying.xue@windriver.com, andrii@kernel.org, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, shuah@kernel.org, keescook@chromium.org,
	wad@chromium.org, willy@infradead.org, sashal@kernel.org,
	ruanjinjie@huawei.com, quic_akhilpo@quicinc.com,
	David.Laight@aculab.com, herve.codina@bootlin.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-um@lists.infradead.org,
	linux-edac@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, linux-hwmon@vger.kernel.org,
	linux-input@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-media@vger.kernel.org, netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org,
	linux-mm@kvack.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, tipc-discussion@lists.sourceforge.net,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	stable@vger.kernel.org, Linus Torvalds, Lorenzo Stoakes
In-Reply-To: <2025092955-module-landfall-ed45@gregkh>

> On Mon, Sep 29, 2025 at 02:39:26PM +0000, Farber, Eliav wrote:
> > > On Wed, Sep 24, 2025 at 08:23:08PM +0000, Eliav Farber wrote:
> > > > From: Linus Torvalds <torvalds@linux-foundation.org>
> > > >
> > > > [ Upstream commit 1a251f52cfdc417c84411a056bc142cbd77baef4 ]
> > >
> > > <snip>
> > >
> > > As this didn't go into 6.6.y yet, I'll stop here on this series for now.
> > > Please fix up for newer kernels first and then resend these.
> >
> > For 6.6.y I backported 15 commits:
> > https://lore.kernel.org/stable/20250922103241.16213-1-farbere@amazon.com/T/#t
> >
> > Why weren't all of them picked?
>
> Because one of them broke the build, as I wrote a week ago here:
>         https://lore.kernel.org/all/2025092209-owl-whisking-03e3@gregkh/

Fixed:
https://lore.kernel.org/stable/20250929171733.20671-1-farbere@amazon.com/T/#t

---
Thanks, Eliav

^ permalink raw reply

* [dtor-input:master] BUILD SUCCESS db74430a4218f282d16e58a38337275ad3f9f517
From: kernel test robot @ 2025-09-29 17:12 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git master
branch HEAD: db74430a4218f282d16e58a38337275ad3f9f517  Input: psxpad-spi - add a check for the return value of spi_setup()

elapsed time: 722m

configs tested: 138
configs skipped: 7

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                             allnoconfig    gcc-15.1.0
alpha                            allyesconfig    gcc-15.1.0
alpha                               defconfig    gcc-15.1.0
arc                              allmodconfig    gcc-15.1.0
arc                               allnoconfig    gcc-15.1.0
arc                              allyesconfig    gcc-15.1.0
arc                                 defconfig    gcc-15.1.0
arc                   randconfig-001-20250929    gcc-8.5.0
arc                   randconfig-002-20250929    gcc-8.5.0
arc                           tb10x_defconfig    gcc-15.1.0
arm                              allmodconfig    gcc-15.1.0
arm                               allnoconfig    clang-22
arm                              allyesconfig    gcc-15.1.0
arm                                 defconfig    clang-22
arm                          exynos_defconfig    clang-22
arm                           imxrt_defconfig    clang-22
arm                        keystone_defconfig    gcc-15.1.0
arm                   randconfig-001-20250929    gcc-8.5.0
arm                   randconfig-002-20250929    gcc-14.3.0
arm                   randconfig-003-20250929    clang-22
arm                   randconfig-004-20250929    gcc-10.5.0
arm64                            allmodconfig    clang-19
arm64                             allnoconfig    gcc-15.1.0
arm64                               defconfig    gcc-15.1.0
arm64                 randconfig-001-20250929    gcc-8.5.0
arm64                 randconfig-002-20250929    gcc-13.4.0
arm64                 randconfig-003-20250929    clang-22
arm64                 randconfig-004-20250929    clang-22
csky                              allnoconfig    gcc-15.1.0
csky                                defconfig    gcc-15.1.0
csky                  randconfig-001-20250929    gcc-9.5.0
csky                  randconfig-002-20250929    gcc-15.1.0
hexagon                          allmodconfig    clang-17
hexagon                           allnoconfig    clang-22
hexagon                          allyesconfig    clang-22
hexagon                             defconfig    clang-22
hexagon               randconfig-001-20250929    clang-22
hexagon               randconfig-002-20250929    clang-22
i386                             allmodconfig    gcc-14
i386                              allnoconfig    gcc-14
i386                             allyesconfig    gcc-14
i386        buildonly-randconfig-001-20250929    gcc-14
i386        buildonly-randconfig-002-20250929    clang-20
i386        buildonly-randconfig-003-20250929    gcc-14
i386        buildonly-randconfig-004-20250929    gcc-14
i386        buildonly-randconfig-005-20250929    gcc-14
i386        buildonly-randconfig-006-20250929    gcc-14
i386                                defconfig    clang-20
loongarch                        allmodconfig    clang-19
loongarch                         allnoconfig    clang-22
loongarch                           defconfig    clang-19
loongarch             randconfig-001-20250929    gcc-12.5.0
loongarch             randconfig-002-20250929    gcc-15.1.0
m68k                             allmodconfig    gcc-15.1.0
m68k                              allnoconfig    gcc-15.1.0
m68k                             allyesconfig    gcc-15.1.0
m68k                                defconfig    gcc-15.1.0
microblaze                       allmodconfig    gcc-15.1.0
microblaze                        allnoconfig    gcc-15.1.0
microblaze                       allyesconfig    gcc-15.1.0
microblaze                          defconfig    gcc-15.1.0
mips                              allnoconfig    gcc-15.1.0
mips                            gpr_defconfig    clang-18
nios2                             allnoconfig    gcc-11.5.0
nios2                               defconfig    gcc-11.5.0
nios2                 randconfig-001-20250929    gcc-11.5.0
nios2                 randconfig-002-20250929    gcc-9.5.0
openrisc                          allnoconfig    gcc-15.1.0
openrisc                         allyesconfig    gcc-15.1.0
openrisc                            defconfig    gcc-15.1.0
parisc                           allmodconfig    gcc-15.1.0
parisc                            allnoconfig    gcc-15.1.0
parisc                           allyesconfig    gcc-15.1.0
parisc                              defconfig    gcc-15.1.0
parisc                randconfig-001-20250929    gcc-14.3.0
parisc                randconfig-002-20250929    gcc-14.3.0
parisc64                         alldefconfig    gcc-15.1.0
parisc64                            defconfig    gcc-15.1.0
powerpc                          allmodconfig    gcc-15.1.0
powerpc                           allnoconfig    gcc-15.1.0
powerpc                          allyesconfig    clang-22
powerpc                 canyonlands_defconfig    clang-22
powerpc                      ppc44x_defconfig    clang-22
powerpc               randconfig-001-20250929    gcc-15.1.0
powerpc               randconfig-002-20250929    gcc-8.5.0
powerpc               randconfig-003-20250929    gcc-13.4.0
powerpc                    socrates_defconfig    gcc-15.1.0
powerpc                      tqm8xx_defconfig    clang-19
powerpc64             randconfig-001-20250929    clang-18
powerpc64             randconfig-002-20250929    clang-22
powerpc64             randconfig-003-20250929    clang-22
riscv                            allmodconfig    clang-22
riscv                             allnoconfig    gcc-15.1.0
riscv                            allyesconfig    clang-16
riscv                               defconfig    clang-22
riscv                 randconfig-001-20250929    gcc-9.5.0
riscv                 randconfig-002-20250929    gcc-11.5.0
s390                             allmodconfig    clang-18
s390                              allnoconfig    clang-22
s390                             allyesconfig    gcc-15.1.0
s390                                defconfig    clang-22
s390                  randconfig-001-20250929    gcc-11.5.0
s390                  randconfig-002-20250929    gcc-13.4.0
sh                               allmodconfig    gcc-15.1.0
sh                                allnoconfig    gcc-15.1.0
sh                               allyesconfig    gcc-15.1.0
sh                                  defconfig    gcc-15.1.0
sh                    randconfig-001-20250929    gcc-15.1.0
sh                    randconfig-002-20250929    gcc-15.1.0
sparc                            allmodconfig    gcc-15.1.0
sparc                             allnoconfig    gcc-15.1.0
sparc                               defconfig    gcc-15.1.0
sparc                 randconfig-001-20250929    gcc-8.5.0
sparc                 randconfig-002-20250929    gcc-8.5.0
sparc64                             defconfig    clang-20
sparc64               randconfig-001-20250929    clang-22
sparc64               randconfig-002-20250929    clang-22
um                               allmodconfig    clang-19
um                                allnoconfig    clang-22
um                               allyesconfig    gcc-14
um                                  defconfig    clang-22
um                             i386_defconfig    gcc-14
um                    randconfig-001-20250929    gcc-14
um                    randconfig-002-20250929    gcc-14
um                           x86_64_defconfig    clang-22
x86_64                            allnoconfig    clang-20
x86_64                           allyesconfig    clang-20
x86_64      buildonly-randconfig-001-20250929    gcc-14
x86_64      buildonly-randconfig-002-20250929    gcc-14
x86_64      buildonly-randconfig-003-20250929    clang-20
x86_64      buildonly-randconfig-004-20250929    gcc-14
x86_64      buildonly-randconfig-005-20250929    gcc-14
x86_64      buildonly-randconfig-006-20250929    gcc-14
x86_64                              defconfig    gcc-14
x86_64                          rhel-9.4-rust    clang-20
xtensa                            allnoconfig    gcc-15.1.0
xtensa                randconfig-001-20250929    gcc-8.5.0
xtensa                randconfig-002-20250929    gcc-13.4.0

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* [PATCH] HID: quirks: Add ALWAYS_POLL quirk for VRS R295 steering wheel
From: Oleg Makarenko @ 2025-09-29 15:46 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel; +Cc: Oleg Makarenko

This patch adds ALWAYS_POLL quirk for the VRS R295 steering wheel joystick.
This device reboots itself every 8-10 seconds if it is not polled.

Signed-off-by: Oleg Makarenko <oleg@makarenk.ooo>
---
 drivers/hid/hid-ids.h    | 1 +
 drivers/hid/hid-quirks.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 149798754570..2e56b6740fcf 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1430,6 +1430,7 @@
 
 #define USB_VENDOR_ID_VRS	0x0483
 #define USB_DEVICE_ID_VRS_DFP	0xa355
+#define USB_DEVICE_ID_VRS_R295	0xa44c
 
 #define USB_VENDOR_ID_VTL		0x0306
 #define USB_DEVICE_ID_VTL_MULTITOUCH_FF3F	0xff3f
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index f619ed10535d..b451157d6e6e 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -206,6 +206,7 @@ static const struct hid_device_id hid_quirks[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_WP5540), HID_QUIRK_MULTI_INPUT },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_VRS, USB_DEVICE_ID_VRS_R295), HID_QUIRK_ALWAYS_POLL },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH), HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
-- 
2.51.0


^ permalink raw reply related

* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property
From: Luca Weiss @ 2025-09-29 15:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah,
	~postmarketos/upstreaming, phone-devel, linux-arm-msm,
	linux-input, devicetree, linux-kernel
In-Reply-To: <3kww5et2q2mqddpvtqzuj3jqzvfds66qrufawcmumamrqoaugk@tiq6zoe5psom>

On 25-09-25 7:45 atm, Dmitry Torokhov wrote:
> On Tue, Sep 09, 2025 at 07:54:33AM -0700, Dmitry Torokhov wrote:
>> On Tue, Sep 09, 2025 at 04:41:26PM +0200, Luca Weiss wrote:
>>> On 2025-09-09 16:33, Krzysztof Kozlowski wrote:
>>>> On 09/09/2025 16:08, Dmitry Torokhov wrote:
>>>>>>>     compatible:
>>>>>>>       enum:
>>>>>>> @@ -36,6 +33,11 @@ properties:
>>>>>>>              pin should be configured for pull up.
>>>>>>>       $ref: /schemas/types.yaml#/definitions/flag
>>>>>>>
>>>>>>> +  wakeup-source:
>>>>>>> +    description: |
>>>>>>> +           Button can wake-up the system. Only applicable
>>>>>>> for 'resin',
>>>>>>> +           'pwrkey' always wakes the system by default.
>>>>>>
>>>>>>
>>>>>> I'll fix existing code, so don't repeat that style.
>>>>>
>>>>> If you ack I can reformat on my side to match the patch you just sent.
>>>>
>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>
>>> Thanks for fixing that up Krzysztof! I noticed but didn't want to deviate
>>> from the style just for this description. Of course better to fix the
>>> formatting in the first place.
>>>
>>> @Dmitry: Maybe give this patch some time (1-2 weeks?) to gather more
>>> feedback,
>>> given the reasons outlined in the cover letter. Also on the driver patch.
>>
>> OK, I'll hold on to this for a couple of weeks.
> 
> Nobody voiced any objections so far, so applied both.

Thanks Dmitry!

^ permalink raw reply

* Re: [PATCH 07/19 v6.1.y] minmax: make generic MIN() and MAX() macros available everywhere
From: Greg KH @ 2025-09-29 14:47 UTC (permalink / raw)
  To: Farber, Eliav
  Cc: linux@armlinux.org.uk, richard@nod.at,
	anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
	dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com, tony.luck@intel.com,
	qiuxu.zhuo@intel.com, mchehab@kernel.org, james.morse@arm.com,
	rric@kernel.org, harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
	daniel@ffwll.ch, evan.quan@amd.com, james.qian.wang@arm.com,
	liviu.dudau@arm.com, mihail.atanassov@arm.com,
	brian.starkey@arm.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, robdclark@gmail.com,
	quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org,
	sean@poorly.run, jdelvare@suse.com, linux@roeck-us.net,
	linus.walleij@linaro.org, dmitry.torokhov@gmail.com,
	maz@kernel.org, wens@csie.org, jernej.skrabec@gmail.com,
	samuel@sholland.org, agk@redhat.com, snitzer@kernel.org,
	dm-devel@redhat.com, rajur@chelsio.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	peppe.cavallaro@st.com, alexandre.torgue@foss.st.com,
	joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
	krzysztof.kozlowski@linaro.org, malattia@linux.it,
	hdegoede@redhat.com, markgross@kernel.org,
	artur.paszkiewicz@intel.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, sakari.ailus@linux.intel.com,
	fei1.li@intel.com, clm@fb.com, josef@toxicpanda.com,
	dsterba@suse.com, jack@suse.com, tytso@mit.edu,
	adilger.kernel@dilger.ca, dushistov@mail.ru,
	luc.vanoostenryck@gmail.com, rostedt@goodmis.org,
	mhiramat@kernel.org, pmladek@suse.com, senozhatsky@chromium.org,
	andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
	minchan@kernel.org, ngupta@vflare.org, akpm@linux-foundation.org,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de, jmaloy@redhat.com,
	ying.xue@windriver.com, andrii@kernel.org, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, shuah@kernel.org, keescook@chromium.org,
	wad@chromium.org, willy@infradead.org, sashal@kernel.org,
	ruanjinjie@huawei.com, quic_akhilpo@quicinc.com,
	David.Laight@aculab.com, herve.codina@bootlin.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-um@lists.infradead.org,
	linux-edac@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, linux-hwmon@vger.kernel.org,
	linux-input@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-media@vger.kernel.org, netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org,
	linux-mm@kvack.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, tipc-discussion@lists.sourceforge.net,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	stable@vger.kernel.org, Linus Torvalds, Lorenzo Stoakes
In-Reply-To: <85a995bb59474300aa3d5f973d279a13@amazon.com>

On Mon, Sep 29, 2025 at 02:39:26PM +0000, Farber, Eliav wrote:
> > On Wed, Sep 24, 2025 at 08:23:08PM +0000, Eliav Farber wrote:
> > > From: Linus Torvalds <torvalds@linux-foundation.org>
> > >
> > > [ Upstream commit 1a251f52cfdc417c84411a056bc142cbd77baef4 ]
> >
> > <snip>
> >
> > As this didn't go into 6.6.y yet, I'll stop here on this series for now.
> > Please fix up for newer kernels first and then resend these.
> 
> For 6.6.y I backported 15 commits:
> https://lore.kernel.org/stable/20250922103241.16213-1-farbere@amazon.com/T/#t
> 
> Why weren't all of them picked?

Because one of them broke the build, as I wrote a week ago here:
	https://lore.kernel.org/all/2025092209-owl-whisking-03e3@gregkh/

thanks,

greg k-h

^ permalink raw reply

* RE: [PATCH 07/19 v6.1.y] minmax: make generic MIN() and MAX() macros available everywhere
From: Farber, Eliav @ 2025-09-29 14:39 UTC (permalink / raw)
  To: Greg KH
  Cc: linux@armlinux.org.uk, richard@nod.at,
	anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
	dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com, tony.luck@intel.com,
	qiuxu.zhuo@intel.com, mchehab@kernel.org, james.morse@arm.com,
	rric@kernel.org, harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
	daniel@ffwll.ch, evan.quan@amd.com, james.qian.wang@arm.com,
	liviu.dudau@arm.com, mihail.atanassov@arm.com,
	brian.starkey@arm.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, tzimmermann@suse.de, robdclark@gmail.com,
	quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org,
	sean@poorly.run, jdelvare@suse.com, linux@roeck-us.net,
	linus.walleij@linaro.org, dmitry.torokhov@gmail.com,
	maz@kernel.org, wens@csie.org, jernej.skrabec@gmail.com,
	samuel@sholland.org, agk@redhat.com, snitzer@kernel.org,
	dm-devel@redhat.com, rajur@chelsio.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	peppe.cavallaro@st.com, alexandre.torgue@foss.st.com,
	joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
	krzysztof.kozlowski@linaro.org, malattia@linux.it,
	hdegoede@redhat.com, markgross@kernel.org,
	artur.paszkiewicz@intel.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, sakari.ailus@linux.intel.com,
	fei1.li@intel.com, clm@fb.com, josef@toxicpanda.com,
	dsterba@suse.com, jack@suse.com, tytso@mit.edu,
	adilger.kernel@dilger.ca, dushistov@mail.ru,
	luc.vanoostenryck@gmail.com, rostedt@goodmis.org,
	mhiramat@kernel.org, pmladek@suse.com, senozhatsky@chromium.org,
	andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
	minchan@kernel.org, ngupta@vflare.org, akpm@linux-foundation.org,
	yoshfuji@linux-ipv6.org, dsahern@kernel.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de, jmaloy@redhat.com,
	ying.xue@windriver.com, andrii@kernel.org, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
	jolsa@kernel.org, shuah@kernel.org, keescook@chromium.org,
	wad@chromium.org, willy@infradead.org, sashal@kernel.org,
	ruanjinjie@huawei.com, quic_akhilpo@quicinc.com,
	David.Laight@aculab.com, herve.codina@bootlin.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-um@lists.infradead.org,
	linux-edac@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org, linux-hwmon@vger.kernel.org,
	linux-input@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-media@vger.kernel.org, netdev@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	platform-driver-x86@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org,
	linux-mm@kvack.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, tipc-discussion@lists.sourceforge.net,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	stable@vger.kernel.org, Linus Torvalds, Lorenzo Stoakes
In-Reply-To: <2025092923-stove-rule-a00f@gregkh>

> On Wed, Sep 24, 2025 at 08:23:08PM +0000, Eliav Farber wrote:
> > From: Linus Torvalds <torvalds@linux-foundation.org>
> >
> > [ Upstream commit 1a251f52cfdc417c84411a056bc142cbd77baef4 ]
>
> <snip>
>
> As this didn't go into 6.6.y yet, I'll stop here on this series for now.
> Please fix up for newer kernels first and then resend these.

For 6.6.y I backported 15 commits:
https://lore.kernel.org/stable/20250922103241.16213-1-farbere@amazon.com/T/#t

Why weren't all of them picked?
What is missing?

---
Thanks, Eliav

^ permalink raw reply

* Re: [PATCH 07/19 v6.1.y] minmax: make generic MIN() and MAX() macros available everywhere
From: Greg KH @ 2025-09-29 13:49 UTC (permalink / raw)
  To: Eliav Farber
  Cc: linux, richard, anton.ivanov, johannes, dave.hansen, luto, peterz,
	tglx, mingo, bp, x86, hpa, tony.luck, qiuxu.zhuo, mchehab,
	james.morse, rric, harry.wentland, sunpeng.li, Rodrigo.Siqueira,
	alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	evan.quan, james.qian.wang, liviu.dudau, mihail.atanassov,
	brian.starkey, maarten.lankhorst, mripard, tzimmermann, robdclark,
	quic_abhinavk, dmitry.baryshkov, sean, jdelvare, linux,
	linus.walleij, dmitry.torokhov, maz, wens, jernej.skrabec, samuel,
	agk, snitzer, dm-devel, rajur, davem, edumazet, kuba, pabeni,
	peppe.cavallaro, alexandre.torgue, joabreu, mcoquelin.stm32,
	krzysztof.kozlowski, malattia, hdegoede, markgross,
	artur.paszkiewicz, jejb, martin.petersen, sakari.ailus, fei1.li,
	clm, josef, dsterba, jack, tytso, adilger.kernel, dushistov,
	luc.vanoostenryck, rostedt, mhiramat, pmladek, senozhatsky,
	andriy.shevchenko, linux, minchan, ngupta, akpm, yoshfuji,
	dsahern, pablo, kadlec, fw, jmaloy, ying.xue, andrii, mykolal,
	ast, daniel, martin.lau, song, yhs, john.fastabend, kpsingh, sdf,
	haoluo, jolsa, shuah, keescook, wad, willy, sashal, ruanjinjie,
	quic_akhilpo, David.Laight, herve.codina, linux-arm-kernel,
	linux-kernel, linux-um, linux-edac, amd-gfx, dri-devel,
	linux-arm-msm, freedreno, linux-hwmon, linux-input, linux-sunxi,
	linux-media, netdev, linux-stm32, platform-driver-x86, linux-scsi,
	linux-staging, linux-btrfs, linux-ext4, linux-sparse, linux-mm,
	netfilter-devel, coreteam, tipc-discussion, bpf, linux-kselftest,
	stable, Linus Torvalds, Lorenzo Stoakes
In-Reply-To: <20250924202320.32333-8-farbere@amazon.com>

On Wed, Sep 24, 2025 at 08:23:08PM +0000, Eliav Farber wrote:
> From: Linus Torvalds <torvalds@linux-foundation.org>
> 
> [ Upstream commit 1a251f52cfdc417c84411a056bc142cbd77baef4 ]

<snip>

As this didn't go into 6.6.y yet, I'll stop here on this series for now.
Please fix up for newer kernels first and then resend these.

thanks,

greg k-h

^ permalink raw reply

* 答复: 答复: [External Mail]Re: The zero power level of the HID device in kernel 6.12 is not reported from the kernel to the upper layer.
From: 卢国宏 @ 2025-09-29 12:10 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: José Expósito, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, jikos@kernel.org,
	bentiss@kernel.org, 李鹏, Fei1 Jiang 蒋飞,
	宋密密, 卢国宏
In-Reply-To: <aada0917f31641c19ba7c48e3c6d3c53@xiaomi.com>

Hi Dmitry,
Any updates on merging your code for reporting a zero battery level in HID devices? I look forward to hearing from you.
Thank you!
________________________________________
发件人: 卢国宏
发送时间: 2025年9月26日 20:03
收件人: Dmitry Torokhov
抄送: José Expósito; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; jikos@kernel.org; bentiss@kernel.org; 李鹏; Fei1 Jiang 蒋飞; 宋密密; 卢国宏
主题: 答复: 答复: [External Mail]Re: The zero power level of the HID device in kernel 6.12 is not reported from the kernel to the upper layer.

Hi Dmitry,
After testing, we found that your proposed method can solve our problem. Please help merge this method into the Linux kernel as soon as possible! Please remember to send us the relevant information of the merged git so that we can contact Google and merge their Android GKI as well. Our project is looking forward to using this feature. Thank you very much!

________________________________________
发件人: Dmitry Torokhov <dmitry.torokhov@gmail.com>
发送时间: 2025年9月25日 12:26
收件人: 卢国宏
抄送: José Expósito; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org; jikos@kernel.org; bentiss@kernel.org; 李鹏; Fei1 Jiang 蒋飞; 宋密密
主题: Re: 答复: [External Mail]Re: The zero power level of the HID device in kernel 6.12 is not reported from the kernel to the upper layer.

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给misec@xiaomi.com进行反馈

On Mon, Sep 22, 2025 at 09:29:20AM +0000, 卢国宏 wrote:
>
> What kind of action are we talking about? Section 31 of the HID
> specification defines events for "Smart Battery" ("To comply with the
> Smart Battery Specification, the Battery System must support the
> functions defined in the Battery and Charger usage tables. For details,
> see Section 4.2, “Battery System Page (x85).”) and is typically used for
> "battery pack for cellular phones (principal source), the battery
> pack(s) for notebook computers (auxiliary source), and the sealed
> batteries in uninterruptible power supplies (auxiliary source)."
>
> Is your use case main battery or battery in a stylus or some other
> peripheral?
>
>
> --->>>
> What we are discussing is the code implementation of Section 31 of the
> HID protocol: 31 Battery System Page (0x85). Our scenario is: an
> Android phone is connected to a handle via USB. The handle is a HID
> device with a battery. The power of the battery in the handle is sent
> to the bottom layer (kernel) of the phone via USB. The bottom layer of
> the phone then reports this power to the upper layer of Android
> through the HID driver.

I see. I guess we can try only filtering out 0 reports for the
digitizers, leaving other devices with batteries alone. Something like
this:


diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ff1784b5c2a4..ba3f6655af9e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -595,14 +595,18 @@ static void hidinput_cleanup_battery(struct hid_device *dev)
        dev->battery = NULL;
 }

-static void hidinput_update_battery(struct hid_device *dev, int value)
+static void hidinput_update_battery(struct hid_device *dev,
+                                   unsigned int usage, int value)
 {
        int capacity;

        if (!dev->battery)
                return;

-       if (value == 0 || value < dev->battery_min || value > dev->battery_max)
+       if ((usage & HID_USAGE_PAGE) == HID_UP_DIGITIZER && value == 0)
+               return;
+
+       if (value < dev->battery_min || value > dev->battery_max)
                return;

        capacity = hidinput_scale_battery_capacity(dev, value);
@@ -1518,7 +1522,7 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
                bool handled = hidinput_set_battery_charge_status(hid, usage->hid, value);

                if (!handled)
-                       hidinput_update_battery(hid, value);
+                       hidinput_update_battery(hid, usage->hid, value);

                return;
        }


Thanks.

--
Dmitry
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#

^ permalink raw reply related

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
From: Jonathan Cameron @ 2025-09-29  9:54 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar
In-Reply-To: <20250924074602.266292-17-sakari.ailus@linux.intel.com>

On Wed, 24 Sep 2025 10:46:02 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> Don't check the availability of child device nodes explicitly as this is
> now embedded in device_for_each_child_node().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> ---
>  drivers/spi/spi-cadence-xspi.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
> index 6dcba0e0ddaa..23e426ef9b9c 100644
> --- a/drivers/spi/spi-cadence-xspi.c
> +++ b/drivers/spi/spi-cadence-xspi.c
> @@ -908,9 +908,6 @@ static int cdns_xspi_of_get_plat_data(struct platform_device *pdev)
>  	unsigned int cs;
>  
>  	device_for_each_child_node(&pdev->dev, fwnode_child) {
> -		if (!fwnode_device_is_available(fwnode_child))
> -			continue;
> -
>  		if (fwnode_property_read_u32(fwnode_child, "reg", &cs)) {
>  			dev_err(&pdev->dev, "Couldn't get memory chip select\n");
>  			fwnode_handle_put(fwnode_child);


^ permalink raw reply

* Re: [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
From: Jonathan Cameron @ 2025-09-29  9:53 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sakari Ailus, linux-acpi, linux-kernel, linux-input, linux-leds,
	linux-media, netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar
In-Reply-To: <20250924100429.GM28073@pendragon.ideasonboard.com>


> > -/**
> > - * device_get_next_child_node - Return the next available child node handle for a device
> > + * device_get_next_child_node - Return the next available child node handle  
> 
> This last line is an unrelated change. With that fixed,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

I'll assume you'll tidy that up.

Very pleased to see this go, simply for the saving in time explaining the odd difference
to people in driver reviews!

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


^ permalink raw reply

* Re: [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
From: Jonathan Cameron @ 2025-09-29  9:51 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar
In-Reply-To: <20250924074602.266292-15-sakari.ailus@linux.intel.com>

On Wed, 24 Sep 2025 10:46:00 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_get_next_child_node() is now the same as
> fwnode_get_next_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants (device_get_next_child_node() in this case).
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>



^ permalink raw reply

* Re: [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
From: Jonathan Cameron @ 2025-09-29  9:51 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar
In-Reply-To: <20250924074602.266292-14-sakari.ailus@linux.intel.com>

On Wed, 24 Sep 2025 10:45:59 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox