From: Alistair Francis <hidden> Date: 2021-08-03 08:45:53
Initial support for the Silergy SY7636A Power Management chip
and regulator.
Signed-off-by: Alistair Francis <redacted>
---
.../bindings/mfd/silergy,sy7636a.yaml | 80 +++++++++++++++++++
1 file changed, 80 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:09
From: Lars Ivar Miljeteig <redacted>
Add thermal driver to enable kernel based polling
and shutdown of device for temperatures out of spec
Signed-off-by: Alistair Francis <redacted>
---
drivers/thermal/Kconfig | 7 +++
drivers/thermal/Makefile | 1 +
drivers/thermal/sy7636a_thermal.c | 91 +++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 drivers/thermal/sy7636a_thermal.c
@@ -0,0 +1,91 @@+// SPDX-License-Identifier: GPL-2.0++//+// Functions to access SY3686A power management chip temperature+//+// Copyright (C) 2019 reMarkable AS - http://www.remarkable.com/+//+// Authors: Lars Ivar Miljeteig <lars.ivar.miljeteig@remarkable.com>+// Alistair Francis <alistair@alistair23.me>++#include<linux/module.h>+#include<linux/platform_device.h>+#include<linux/thermal.h>++#include<linux/mfd/sy7636a.h>++staticintsy7636a_get_temp(void*arg,int*res)+{+unsignedintreg_val,mode_ctr;+intret;+structsy7636a*data=arg;+boolisVoltageActive;++ret=regmap_read(data->regmap,+SY7636A_REG_OPERATION_MODE_CRL,&mode_ctr);+if(ret)+returnret;++isVoltageActive=mode_ctr&SY7636A_OPERATION_MODE_CRL_ONOFF;++if(!isVoltageActive){+ret=regmap_write(data->regmap,+SY7636A_REG_OPERATION_MODE_CRL,+mode_ctr|SY7636A_OPERATION_MODE_CRL_ONOFF);+if(ret)+returnret;+}++ret=regmap_read(data->regmap,+SY7636A_REG_TERMISTOR_READOUT,®_val);+if(ret)+returnret;++if(!isVoltageActive){+ret=regmap_write(data->regmap,+SY7636A_REG_OPERATION_MODE_CRL,+mode_ctr);+if(ret)+returnret;+}++*res=reg_val*1000;++returnret;+}++staticconststructthermal_zone_of_device_opsops={+.get_temp=sy7636a_get_temp,+};++staticintsy7636a_thermal_probe(structplatform_device*pdev)+{+structsy7636a*sy7636a=dev_get_drvdata(pdev->dev.parent);+structthermal_zone_device*thermal_zone_dev;++thermal_zone_dev=devm_thermal_zone_of_sensor_register(+pdev->dev.parent,+0,+sy7636a,+&ops);++returnPTR_ERR_OR_ZERO(thermal_zone_dev);+}++staticconststructplatform_device_idsy7636a_thermal_id_table[]={+{"sy7636a-thermal",},+{}+};+MODULE_DEVICE_TABLE(platform,sy7636a_thermal_id_table);++staticstructplatform_driversy7636a_thermal_driver={+.driver={+.name="sy7636a-thermal",+},+.probe=sy7636a_thermal_probe,+.id_table=sy7636a_thermal_id_table,+};+module_platform_driver(sy7636a_thermal_driver);++MODULE_AUTHOR("Lars Ivar Miljeteig <lars.ivar.miljeteig@remarkable.com>");+MODULE_DESCRIPTION("SY7636A thermal driver");+MODULE_LICENSE("GPL v2");
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:12
From testing on hardware the poll_enable_time isn't required and
sometimes causes the driver probe to fail so let's remove it.
Signed-off-by: Alistair Francis <redacted>
---
drivers/regulator/sy7636a-regulator.c | 3 ---
1 file changed, 3 deletions(-)
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:19
Use the parent's MFD data instead of our data.
Signed-off-by: Alistair Francis <redacted>
---
drivers/regulator/sy7636a-regulator.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
@@ -33,7 +33,7 @@ static int sy7636a_get_vcom_voltage_op(struct regulator_dev *rdev)staticintsy7636a_get_status(structregulator_dev*rdev){-structsy7636a*sy7636a=rdev_get_drvdata(rdev);+structsy7636a*sy7636a=dev_get_drvdata(rdev->dev.parent);intret=0;ret=gpiod_get_value_cansleep(sy7636a->pgood_gpio);
@@ -76,9 +76,9 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)platform_set_drvdata(pdev,sy7636a);-gdp=devm_gpiod_get(sy7636a->dev,"epd-pwr-good",GPIOD_IN);+gdp=devm_gpiod_get(pdev->dev.parent,"epd-pwr-good",GPIOD_IN);if(IS_ERR(gdp)){-dev_err(sy7636a->dev,"Power good GPIO fault %ld\n",PTR_ERR(gdp));+dev_err(pdev->dev.parent,"Power good GPIO fault %ld\n",PTR_ERR(gdp));returnPTR_ERR(gdp);}
@@ -86,18 +86,18 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)ret=regmap_write(sy7636a->regmap,SY7636A_REG_POWER_ON_DELAY_TIME,0x0);if(ret){-dev_err(sy7636a->dev,"Failed to initialize regulator: %d\n",ret);+dev_err(pdev->dev.parent,"Failed to initialize regulator: %d\n",ret);returnret;}config.dev=&pdev->dev;-config.dev->of_node=sy7636a->dev->of_node;+config.dev->of_node=pdev->dev.parent->of_node;config.driver_data=sy7636a;config.regmap=sy7636a->regmap;rdev=devm_regulator_register(&pdev->dev,&desc,&config);if(IS_ERR(rdev)){-dev_err(sy7636a->dev,"Failed to register %s regulator\n",+dev_err(pdev->dev.parent,"Failed to register %s regulator\n",pdev->name);returnPTR_ERR(rdev);}
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:21
Instead of storing the GPIO state in the mfd (where it isn't used) store
it in the regulator.
Signed-off-by: Alistair Francis <redacted>
---
drivers/regulator/sy7636a-regulator.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:24
Enable the silergy,sy7636a and silergy,sy7636a-regulator for the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/configs/imx_v6_v7_defconfig | 3 +++
1 file changed, 3 insertions(+)
From: Alistair Francis <hidden> Date: 2021-08-03 08:46:34
Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
From: Mark Brown <broonie@kernel.org> Date: 2021-08-03 22:36:09
On Tue, 3 Aug 2021 18:44:48 +1000, Alistair Francis wrote:
Initial support for the Silergy SY7636A Power Management chip
and regulator.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[05/11] regulator: sy7636a: Remove the poll_enable_time
commit: e5dad32d90e0e9b006f5c330e92fa0ec9042ae79
[06/11] regulator: sy7636a: Use the parent driver data
commit: 4cafe1aeb5fb4eb1778d5e1b91d50a078369dbe1
[07/11] regulator: sy7636a: Store the epd-pwr-good GPIO locally
commit: d38d49b140043bba3ea27b89cca5fefaf08e2034
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
Both I guess:
"SY7636A is a single-chip power management IC (PMIC) designed for
electronic paper display (EPD) applications. The device supports panel
sizes up to 9.7 inches and larger. The device integrates two
high-efficiency DC-DC boost converters, which are boosted to 25V and
-20V by two charge pumps to provide gate driver power for the panel.
Two tracking LDOs create a ±15V source driver power supply that
supports output currents up to 200mA. SY7636A also provides I2C
interface control for specific panel requirements"
Alistair
Both I guess:
"SY7636A is a single-chip power management IC (PMIC) designed for
electronic paper display (EPD) applications. The device supports panel
sizes up to 9.7 inches and larger. The device integrates two
high-efficiency DC-DC boost converters, which are boosted to 25V and
-20V by two charge pumps to provide gate driver power for the panel.
Two tracking LDOs create a ±15V source driver power supply that
supports output currents up to 200mA. SY7636A also provides I2C
interface control for specific panel requirements"
Is there a datasheet I could look at?
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Both I guess:
"SY7636A is a single-chip power management IC (PMIC) designed for
electronic paper display (EPD) applications. The device supports panel
sizes up to 9.7 inches and larger. The device integrates two
high-efficiency DC-DC boost converters, which are boosted to 25V and
-20V by two charge pumps to provide gate driver power for the panel.
Two tracking LDOs create a ±15V source driver power supply that
supports output currents up to 200mA. SY7636A also provides I2C
interface control for specific panel requirements"
Both I guess:
"SY7636A is a single-chip power management IC (PMIC) designed for
electronic paper display (EPD) applications. The device supports panel
sizes up to 9.7 inches and larger. The device integrates two
high-efficiency DC-DC boost converters, which are boosted to 25V and
-20V by two charge pumps to provide gate driver power for the panel.
Two tracking LDOs create a ±15V source driver power supply that
supports output currents up to 200mA. SY7636A also provides I2C
interface control for specific panel requirements"
Where did the snippet above come from then?
What documentation are you working to?
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Both I guess:
"SY7636A is a single-chip power management IC (PMIC) designed for
electronic paper display (EPD) applications. The device supports panel
sizes up to 9.7 inches and larger. The device integrates two
high-efficiency DC-DC boost converters, which are boosted to 25V and
-20V by two charge pumps to provide gate driver power for the panel.
Two tracking LDOs create a ±15V source driver power supply that
supports output currents up to 200mA. SY7636A also provides I2C
interface control for specific panel requirements"
From: Lee Jones <hidden> Date: 2021-08-04 12:44:01
On Tue, 03 Aug 2021, Alistair Francis wrote:
Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
I don't see the DT documentation for this device.
Has it been accepted/merged already?
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
From: Alistair Francis <hidden> Date: 2021-08-05 08:05:41
On Wed, Aug 4, 2021 at 10:43 PM Lee Jones [off-list ref] wrote:
On Tue, 03 Aug 2021, Alistair Francis wrote:
quoted
Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
I don't see the DT documentation for this device.
Which device?
The imx7d-remarkable2 is in current master and there is a single line
at `Documentation/devicetree/bindings/arm/fsl.yaml`
The silergy,sy7636a-regulator is also already in master, but it isn't
exposed to device tree and the compatible string shouldn't be included
in this patch. I'll fix that.
Alistair
Has it been accepted/merged already?
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
From: Lee Jones <hidden> Date: 2021-08-05 08:26:26
On Thu, 05 Aug 2021, Alistair Francis wrote:
On Wed, Aug 4, 2021 at 10:43 PM Lee Jones [off-list ref] wrote:
quoted
On Tue, 03 Aug 2021, Alistair Francis wrote:
quoted
Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
I don't see the DT documentation for this device.
Which device?
The imx7d-remarkable2 is in current master and there is a single line
at `Documentation/devicetree/bindings/arm/fsl.yaml`
The silergy,sy7636a-regulator is also already in master, but it isn't
I think this is currently in -next.
It won't land in Mainline (what I believe you're calling "master")
until the next merge window, which is about a month.
exposed to device tree and the compatible string shouldn't be included
in this patch. I'll fix that.
Okay, this is essentially what I was getting at.
The node should really be documented and Acked by the DT guys.
..
Anyway, I have a new toy for you to play with.
I'll Cc you on the patch.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
From: Alistair Francis <hidden> Date: 2021-08-05 08:37:41
On Thu, Aug 5, 2021 at 6:26 PM Lee Jones [off-list ref] wrote:
On Thu, 05 Aug 2021, Alistair Francis wrote:
quoted
On Wed, Aug 4, 2021 at 10:43 PM Lee Jones [off-list ref] wrote:
quoted
On Tue, 03 Aug 2021, Alistair Francis wrote:
quoted
Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.
Signed-off-by: Alistair Francis <redacted>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
I don't see the DT documentation for this device.
Which device?
The imx7d-remarkable2 is in current master and there is a single line
at `Documentation/devicetree/bindings/arm/fsl.yaml`
The silergy,sy7636a-regulator is also already in master, but it isn't
I think this is currently in -next.
Sorry, I thought it was in mainline at this point.
It won't land in Mainline (what I believe you're calling "master")
until the next merge window, which is about a month.
Ah, yep. I meant to say mainline. Every project has different terminology.
quoted
exposed to device tree and the compatible string shouldn't be included
in this patch. I'll fix that.
Okay, this is essentially what I was getting at.
The node should really be documented and Acked by the DT guys.
Should the regulator have it's own DT binding documentation? From what
I could tell just including it in mfd bindings was enough.
..
Anyway, I have a new toy for you to play with.
I'll Cc you on the patch.
I'll keep a look out!
Alistair
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog