* [PATCH v6 0/2] sy7636a: power the panel only during updates
@ 2026-11-29 23:42 Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 1/2] hwmon: sy7636a: read the temperature only while the rails are on Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 2/2] ARM: imx_v6_v7_defconfig: drop the SY7636A MFD option Pablo Mazzini
0 siblings, 2 replies; 3+ messages in thread
From: Pablo Mazzini @ 2026-11-29 23:42 UTC (permalink / raw)
To: Guenter Roeck, Mark Brown, Frank Li, Sascha Hauer
Cc: Pablo Mazzini, Alistair Francis, Andreas Kemnade,
Pengutronix Kernel Team, Fabio Estevam, linux-hwmon, imx,
linux-arm-kernel, linux-kernel
The SY7636A hwmon driver keeps VCOM on from probe, so a display driver
can not power the panel only during updates.
Read the temperature only while the rails are on instead, and drop the
MFD option from imx_v6_v7_defconfig.
Both patches depend on 5f828ac25ef9 ("regulator: sy7636a: bind to the
I2C device directly") in regulator for-7.5, so I would like both to go
through the regulator tree.
Tested on a PocketBook Verse (B288).
v6:
- resend v5 and v4 2/2 together, based on regulator for-7.5
v5:
- patch 1 only, rebased on regulator for-7.5
- add Guenter's ack
v4:
- drop the patches applied by Mark and Guenter
- patch 1: keep the hwmon name (Guenter)
Pablo Mazzini (2):
hwmon: sy7636a: read the temperature only while the rails are on
ARM: imx_v6_v7_defconfig: drop the SY7636A MFD option
arch/arm/configs/imx_v6_v7_defconfig | 1 -
drivers/hwmon/sy7636a-hwmon.c | 35 +++++++++++++++++++---------
2 files changed, 24 insertions(+), 12 deletions(-)
base-commit: d23ba232a8fefe909aeb9366e3905a95a429ebfc
--
2.52.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v6 1/2] hwmon: sy7636a: read the temperature only while the rails are on
2026-11-29 23:42 [PATCH v6 0/2] sy7636a: power the panel only during updates Pablo Mazzini
@ 2026-11-29 23:42 ` Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 2/2] ARM: imx_v6_v7_defconfig: drop the SY7636A MFD option Pablo Mazzini
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Mazzini @ 2026-11-29 23:42 UTC (permalink / raw)
To: Mark Brown, Guenter Roeck
Cc: Pablo Mazzini, Alistair Francis, Andreas Kemnade, linux-hwmon,
linux-kernel
The driver enables VCOM at probe, which keeps the panel's high voltage
rails on for good. Read the temperature only while the rails are on, when
the chip samples it, and return -ENODATA otherwise. Read power good with
it in one transfer, so the value can not be from before the first sample
or after the rails went off.
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
---
drivers/hwmon/sy7636a-hwmon.c | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
index a6b47452e29e..a8bfbf1716a1 100644
--- a/drivers/hwmon/sy7636a-hwmon.c
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -9,26 +9,43 @@
*/
#include <linux/auxiliary_bus.h>
+#include <linux/bits.h>
#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/module.h>
#include <linux/regmap.h>
-#include <linux/regulator/machine.h>
-#define SY7636A_REG_TERMISTOR_READOUT 0x08
+#define SY7636A_REG_FAULT_FLAG 0x07
+#define SY7636A_FAULT_FLAG_PG BIT(0)
static int sy7636a_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *temp)
{
struct regmap *regmap = dev_get_drvdata(dev);
- int ret, reg_val;
-
- ret = regmap_read(regmap,
- SY7636A_REG_TERMISTOR_READOUT, ®_val);
+ u8 buf[2];
+ int ret;
+
+ /*
+ * The thermistor is sampled while ON_OFF is set, but the first sample
+ * is only ready after the ADC sampling and conversion time (ADC_SPL +
+ * ADC_DEL in the datasheet); until then it holds its reset value, 0.
+ * PG is only set once all rails are up, after the first sample, so
+ * read it in the same transfer and report the temperature only while
+ * it is set.
+ *
+ * With ON_OFF set but PG low (rails still ramping up, or a fault), no
+ * temperature is reported even if one may be available. That is
+ * accepted: the display driver reads the temperature only while it
+ * holds the rails on, after power good.
+ */
+ ret = regmap_bulk_read(regmap, SY7636A_REG_FAULT_FLAG, buf, sizeof(buf));
if (ret)
return ret;
- *temp = (s8)reg_val * 1000;
+ if (!(buf[0] & SY7636A_FAULT_FLAG_PG))
+ return -ENODATA;
+
+ *temp = (s8)buf[1] * 1000;
return 0;
}
@@ -72,10 +89,6 @@ static int sy7636a_sensor_probe(struct auxiliary_device *adev,
if (!regmap)
return -ENODEV;
- err = devm_regulator_get_enable(&adev->dev, "vcom");
- if (err)
- return err;
-
hwmon_dev = devm_hwmon_device_register_with_info(&adev->dev,
"sy7636a_temperature", regmap,
&sy7636a_chip_info, NULL);
--
2.52.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v6 2/2] ARM: imx_v6_v7_defconfig: drop the SY7636A MFD option
2026-11-29 23:42 [PATCH v6 0/2] sy7636a: power the panel only during updates Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 1/2] hwmon: sy7636a: read the temperature only while the rails are on Pablo Mazzini
@ 2026-11-29 23:42 ` Pablo Mazzini
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Mazzini @ 2026-11-29 23:42 UTC (permalink / raw)
To: Mark Brown, Frank Li, Sascha Hauer
Cc: Pablo Mazzini, Alistair Francis, Andreas Kemnade,
Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel,
linux-kernel
The SY7636A is no longer bound through an MFD.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
---
arch/arm/configs/imx_v6_v7_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index ed588add8d31..f02b5605e533 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -239,7 +239,6 @@ CONFIG_MFD_DA9062=y
CONFIG_MFD_DA9063=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
-CONFIG_MFD_SY7636A=y
CONFIG_MFD_RN5T618=y
CONFIG_MFD_STMPE=y
CONFIG_MFD_ROHM_BD71828=y
--
2.52.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-29 23:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 23:42 [PATCH v6 0/2] sy7636a: power the panel only during updates Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 1/2] hwmon: sy7636a: read the temperature only while the rails are on Pablo Mazzini
2026-11-29 23:42 ` [PATCH v6 2/2] ARM: imx_v6_v7_defconfig: drop the SY7636A MFD option Pablo Mazzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®