2022-01-24 19:07:38

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 0/8] Add support for the silergy,sy7636a

v18:

- Rebase

v17:

- Rebase and fix build issues

v16:

- Improve vdd regulator comments

v15:

- Address comments on the patches

v14:

- Merge the thermal driver and hwmon

v13:

- Address comments on thermal driver

- Rebase on master (without other patches)

v12:

- Rebase

v11:

- Address comments on hwmon

- Improve "mfd: simple-mfd-i2c: Add a Kconfig name" commit message

v10:

- Use dev_get_regmap() instead of dev_get_drvdata()

v9:

- Convert to use the simple-mfd-i2c instead



Alistair Francis (8):

dt-bindings: mfd: Initial commit of silergy,sy7636a.yaml

mfd: simple-mfd-i2c: Add a Kconfig name

mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a

regulator: sy7636a: Remove requirement on sy7636a mfd

hwmon: sy7636a: Add temperature driver for sy7636a

ARM: imx_v6_v7_defconfig: Enable silergy,sy7636a

ARM: dts: imx7d-remarkable2: Enable silergy,sy7636a

ARM: dts: imx7d-remarkable2: Enable lcdif



.../bindings/mfd/silergy,sy7636a.yaml | 82 +++++++++++

Documentation/hwmon/index.rst | 1 +

Documentation/hwmon/sy7636a-hwmon.rst | 26 ++++

arch/arm/boot/dts/imx7d-remarkable2.dts | 136 ++++++++++++++++++

arch/arm/configs/imx_v6_v7_defconfig | 3 +

drivers/hwmon/Kconfig | 9 ++

drivers/hwmon/Makefile | 1 +

drivers/hwmon/sy7636a-hwmon.c | 106 ++++++++++++++

drivers/mfd/Kconfig | 2 +-

drivers/mfd/simple-mfd-i2c.c | 11 ++

drivers/regulator/Kconfig | 1 -

drivers/regulator/sy7636a-regulator.c | 7 +-

include/linux/mfd/sy7636a.h | 34 +++++

13 files changed, 415 insertions(+), 4 deletions(-)

create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml

create mode 100644 Documentation/hwmon/sy7636a-hwmon.rst

create mode 100644 drivers/hwmon/sy7636a-hwmon.c

create mode 100644 include/linux/mfd/sy7636a.h



--

2.31.1




2022-01-24 19:07:44

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 1/8] dt-bindings: mfd: Initial commit of silergy,sy7636a.yaml

Initial support for the Silergy SY7636A Power Management chip
and regulator.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
.../bindings/mfd/silergy,sy7636a.yaml | 82 +++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml

diff --git a/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml b/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
new file mode 100644
index 000000000000..6de74c701635
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/silergy,sy7636a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: silergy sy7636a PMIC
+
+maintainers:
+ - Alistair Francis <[email protected]>
+
+properties:
+ compatible:
+ const: silergy,sy7636a
+
+ reg:
+ description:
+ I2C device address.
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ '#thermal-sensor-cells':
+ const: 0
+
+ epd-pwr-good-gpios:
+ description:
+ Specifying the power good GPIOs.
+ maxItems: 1
+
+ regulators:
+ type: object
+
+ properties:
+ compatible:
+ const: silergy,sy7636a-regulator
+
+ vcom:
+ type: object
+ $ref: /schemas/regulator/regulator.yaml#
+ description:
+ The regulator for the compenstation voltage. Enabling/disabling this
+ enables/disables the entire device.
+ properties:
+ regulator-name:
+ const: vcom
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - reg
+ - '#thermal-sensor-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@62 {
+ compatible = "silergy,sy7636a";
+ reg = <0x62>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_epdpmic>;
+ #thermal-sensor-cells = <0>;
+
+ regulators {
+ reg_epdpmic: vcom {
+ regulator-name = "vcom";
+ regulator-boot-on;
+ };
+ };
+ };
+ };
+...
--
2.31.1

2022-01-24 19:07:45

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
device so that it can be enabled via menuconfig.

Signed-off-by: Alistair Francis <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
drivers/mfd/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index ba0b3eb131f1..e0d2fcb10a0c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
module will be called si476x-core.

config MFD_SIMPLE_MFD_I2C
- tristate
+ tristate "Simple Multi-Functional Device support (I2C)"
depends on I2C
select MFD_CORE
select REGMAP_I2C
--
2.31.1

2022-01-24 19:07:54

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 3/8] mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a

Signed-off-by: Alistair Francis <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
drivers/mfd/simple-mfd-i2c.c | 11 +++++++++++
include/linux/mfd/sy7636a.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
create mode 100644 include/linux/mfd/sy7636a.h

diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
index 51536691ad9d..f4c8fc3ee463 100644
--- a/drivers/mfd/simple-mfd-i2c.c
+++ b/drivers/mfd/simple-mfd-i2c.c
@@ -62,8 +62,19 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)
return ret;
}

+static const struct mfd_cell sy7636a_cells[] = {
+ { .name = "sy7636a-regulator", },
+ { .name = "sy7636a-temperature", },
+};
+
+static const struct simple_mfd_data silergy_sy7636a = {
+ .mfd_cell = sy7636a_cells,
+ .mfd_cell_size = ARRAY_SIZE(sy7636a_cells),
+};
+
static const struct of_device_id simple_mfd_i2c_of_match[] = {
{ .compatible = "kontron,sl28cpld" },
+ { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
{}
};
MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);
diff --git a/include/linux/mfd/sy7636a.h b/include/linux/mfd/sy7636a.h
new file mode 100644
index 000000000000..22f03b2f851e
--- /dev/null
+++ b/include/linux/mfd/sy7636a.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Functions to access SY3686A power management chip.
+ *
+ * Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/
+ */
+
+#ifndef __MFD_SY7636A_H
+#define __MFD_SY7636A_H
+
+#define SY7636A_REG_OPERATION_MODE_CRL 0x00
+/* It is set if a gpio is used to control the regulator */
+#define SY7636A_OPERATION_MODE_CRL_VCOMCTL BIT(6)
+#define SY7636A_OPERATION_MODE_CRL_ONOFF BIT(7)
+#define SY7636A_REG_VCOM_ADJUST_CTRL_L 0x01
+#define SY7636A_REG_VCOM_ADJUST_CTRL_H 0x02
+#define SY7636A_REG_VCOM_ADJUST_CTRL_MASK 0x01ff
+#define SY7636A_REG_VLDO_VOLTAGE_ADJULST_CTRL 0x03
+#define SY7636A_REG_POWER_ON_DELAY_TIME 0x06
+#define SY7636A_REG_FAULT_FLAG 0x07
+#define SY7636A_FAULT_FLAG_PG BIT(0)
+#define SY7636A_REG_TERMISTOR_READOUT 0x08
+
+#define SY7636A_REG_MAX 0x08
+
+#define VCOM_ADJUST_CTRL_MASK 0x1ff
+// Used to shift the high byte
+#define VCOM_ADJUST_CTRL_SHIFT 8
+// Used to scale from VCOM_ADJUST_CTRL to mv
+#define VCOM_ADJUST_CTRL_SCAL 10000
+
+#define FAULT_FLAG_SHIFT 1
+
+#endif /* __LINUX_MFD_SY7636A_H */
--
2.31.1

2022-01-24 19:07:55

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 5/8] hwmon: sy7636a: Add temperature driver for sy7636a

This is a multi-function device to interface with the sy7636a
EPD PMIC chip from Silergy.

Signed-off-by: Alistair Francis <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
---
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/sy7636a-hwmon.rst | 26 +++++++
drivers/hwmon/Kconfig | 9 +++
drivers/hwmon/Makefile | 1 +
drivers/hwmon/sy7636a-hwmon.c | 106 ++++++++++++++++++++++++++
5 files changed, 143 insertions(+)
create mode 100644 Documentation/hwmon/sy7636a-hwmon.rst
create mode 100644 drivers/hwmon/sy7636a-hwmon.c

diff --git a/Documentation/hwmon/index.rst b/Documentation/hwmon/index.rst
index df20022c741f..6e0906ef5d25 100644
--- a/Documentation/hwmon/index.rst
+++ b/Documentation/hwmon/index.rst
@@ -185,6 +185,7 @@ Hardware Monitoring Kernel Drivers
smsc47m1
sparx5-temp
stpddc60
+ sy7636a-hwmon
tc654
tc74
thmc50
diff --git a/Documentation/hwmon/sy7636a-hwmon.rst b/Documentation/hwmon/sy7636a-hwmon.rst
new file mode 100644
index 000000000000..5612079397d5
--- /dev/null
+++ b/Documentation/hwmon/sy7636a-hwmon.rst
@@ -0,0 +1,26 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Kernel driver sy7636a-hwmon
+=========================
+
+Supported chips:
+
+ * Silergy SY7636A PMIC
+
+
+Description
+-----------
+
+This driver adds hardware temperature reading support for
+the Silergy SY7636A PMIC.
+
+The following sensors are supported
+
+ * Temperature
+ - SoC on-die temperature in milli-degree C
+
+sysfs-Interface
+---------------
+
+temp0_input
+ - SoC on-die temperature (milli-degree C)
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 8df25f1079ba..aa5785e657a4 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1672,6 +1672,15 @@ config SENSORS_SIS5595
This driver can also be built as a module. If so, the module
will be called sis5595.

+config SENSORS_SY7636A
+ tristate "Silergy SY7636A"
+ help
+ If you say yes here you get support for the thermistor readout of
+ the Silergy SY7636A PMIC.
+
+ This driver can also be built as a module. If so, the module
+ will be called sy7636a-hwmon.
+
config SENSORS_DME1737
tristate "SMSC DME1737, SCH311x and compatibles"
depends on I2C && !PPC
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 185f946d698b..fe54a3dfdb03 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -186,6 +186,7 @@ obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
obj-$(CONFIG_SENSORS_SPARX5) += sparx5-temp.o
obj-$(CONFIG_SENSORS_STTS751) += stts751.o
+obj-$(CONFIG_SENSORS_SY7636A) += sy7636a-hwmon.o
obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o
obj-$(CONFIG_SENSORS_TC74) += tc74.o
obj-$(CONFIG_SENSORS_THMC50) += thmc50.o
diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
new file mode 100644
index 000000000000..6dd9c2a0f0e0
--- /dev/null
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -0,0 +1,106 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Functions to access SY3686A power management chip temperature
+ *
+ * Copyright (C) 2021 reMarkable AS - http://www.remarkable.com/
+ *
+ * Authors: Lars Ivar Miljeteig <[email protected]>
+ * Alistair Francis <[email protected]>
+ */
+
+#include <linux/err.h>
+#include <linux/hwmon.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/machine.h>
+
+#include <linux/mfd/sy7636a.h>
+
+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, &reg_val);
+ if (ret)
+ return ret;
+
+ *temp = reg_val * 1000;
+
+ return 0;
+}
+
+static umode_t sy7636a_is_visible(const void *data,
+ enum hwmon_sensor_types type,
+ u32 attr, int channel)
+{
+ if (type != hwmon_temp)
+ return 0;
+
+ if (attr != hwmon_temp_input)
+ return 0;
+
+ return 0444;
+}
+
+static const struct hwmon_ops sy7636a_hwmon_ops = {
+ .is_visible = sy7636a_is_visible,
+ .read = sy7636a_read,
+};
+
+static const struct hwmon_channel_info *sy7636a_info[] = {
+ HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+ HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
+ NULL
+};
+
+static const struct hwmon_chip_info sy7636a_chip_info = {
+ .ops = &sy7636a_hwmon_ops,
+ .info = sy7636a_info,
+};
+
+static int sy7636a_sensor_probe(struct platform_device *pdev)
+{
+ struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL);
+ struct regulator *regulator;
+ struct device *hwmon_dev;
+ int err;
+
+ if (!regmap)
+ return -EPROBE_DEFER;
+
+ regulator = devm_regulator_get(&pdev->dev, "vcom");
+ if (IS_ERR(regulator))
+ return PTR_ERR(regulator);
+
+ err = regulator_enable(regulator);
+ if (err)
+ return err;
+
+ hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev,
+ "sy7636a_temperature", regmap,
+ &sy7636a_chip_info, NULL);
+
+ if (IS_ERR(hwmon_dev)) {
+ err = PTR_ERR(hwmon_dev);
+ dev_err(&pdev->dev, "Unable to register hwmon device, returned %d\n", err);
+ return err;
+ }
+
+ return 0;
+}
+
+static struct platform_driver sy7636a_sensor_driver = {
+ .probe = sy7636a_sensor_probe,
+ .driver = {
+ .name = "sy7636a-temperature",
+ },
+};
+module_platform_driver(sy7636a_sensor_driver);
+
+MODULE_DESCRIPTION("SY7636A sensor driver");
+MODULE_LICENSE("GPL");
--
2.31.1

2022-01-24 19:07:59

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 7/8] ARM: dts: imx7d-remarkable2: Enable silergy,sy7636a

Enable the silergy,sy7636a and silergy,sy7636a-regulator on the
reMarkable2.

Signed-off-by: Alistair Francis <[email protected]>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 62 +++++++++++++++++++++++++
1 file changed, 62 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts
index a2a91bfdd98e..99ac0d242936 100644
--- a/arch/arm/boot/dts/imx7d-remarkable2.dts
+++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
@@ -22,6 +22,27 @@ memory@80000000 {
reg = <0x80000000 0x40000000>;
};

+ thermal-zones {
+ epd-thermal {
+ thermal-sensors = <&epd_pmic>;
+ polling-delay-passive = <30000>;
+ polling-delay = <30000>;
+ trips {
+ trip0 {
+ temperature = <49000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+
+ trip1 {
+ temperature = <50000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
+ };
+ };
+
reg_brcm: regulator-brcm {
compatible = "regulator-fixed";
regulator-name = "brcm_reg";
@@ -84,6 +105,33 @@ wacom_digitizer: digitizer@9 {
};
};

+&i2c4 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&pinctrl_i2c4>;
+ pinctrl-1 = <&pinctrl_i2c4>;
+ status = "okay";
+
+ epd_pmic: sy7636a@62 {
+ compatible = "silergy,sy7636a";
+ reg = <0x62>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_epdpmic>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #thermal-sensor-cells = <0>;
+
+ epd-pwr-good-gpios = <&gpio6 21 GPIO_ACTIVE_HIGH>;
+ regulators {
+ reg_epdpmic: vcom {
+ regulator-name = "vcom";
+ regulator-boot-on;
+ };
+ };
+ };
+};
+
&snvs_pwrkey {
status = "okay";
};
@@ -177,6 +225,13 @@ MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13 0x14
>;
};

+ pinctrl_epdpmic: epdpmicgrp {
+ fsl,pins = <
+ MX7D_PAD_SAI2_RX_DATA__GPIO6_IO21 0x00000074
+ MX7D_PAD_ENET1_RGMII_TXC__GPIO7_IO11 0x00000014
+ >;
+ };
+
pinctrl_i2c1: i2c1grp {
fsl,pins = <
MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f
@@ -184,6 +239,13 @@ MX7D_PAD_I2C1_SCL__I2C1_SCL 0x4000007f
>;
};

+ pinctrl_i2c4: i2c4grp {
+ fsl,pins = <
+ MX7D_PAD_I2C4_SDA__I2C4_SDA 0x4000007f
+ MX7D_PAD_I2C4_SCL__I2C4_SCL 0x4000007f
+ >;
+ };
+
pinctrl_uart1: uart1grp {
fsl,pins = <
MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79
--
2.31.1

2022-01-24 19:08:01

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 8/8] ARM: dts: imx7d-remarkable2: Enable lcdif

Connect the dispaly on the reMarkable2.

Signed-off-by: Alistair Francis <[email protected]>
---
arch/arm/boot/dts/imx7d-remarkable2.dts | 74 +++++++++++++++++++++++++
1 file changed, 74 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts
index 99ac0d242936..03a4029e1e57 100644
--- a/arch/arm/boot/dts/imx7d-remarkable2.dts
+++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
@@ -68,6 +68,16 @@ reg_digitizer: regulator-digitizer {
startup-delay-us = <100000>; /* 100 ms */
};

+ reg_sdoe: regulator-sdoe {
+ compatible = "regulator-fixed";
+ regulator-name = "SDOE";
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&pinctrl_sdoe_reg>;
+ pinctrl-1 = <&pinctrl_sdoe_reg>;
+ gpio = <&gpio3 27 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-simple";
pinctrl-names = "default";
@@ -76,6 +86,16 @@ wifi_pwrseq: wifi_pwrseq {
clocks = <&clks IMX7D_CLKO2_ROOT_DIV>;
clock-names = "ext_clock";
};
+
+ panel {
+ compatible = "eink,vb3300-kca";
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&display_out>;
+ };
+ };
+ };
};

&clks {
@@ -132,6 +152,20 @@ reg_epdpmic: vcom {
};
};

+&lcdif {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_lcdif>;
+ lcd-supply = <&reg_epdpmic>;
+ lcd2-supply = <&reg_sdoe>;
+ status = "okay";
+
+ port {
+ display_out: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+};
+
&snvs_pwrkey {
status = "okay";
};
@@ -246,6 +280,46 @@ MX7D_PAD_I2C4_SCL__I2C4_SCL 0x4000007f
>;
};

+ pinctrl_lcdif: lcdifgrp {
+ fsl,pins = <
+ MX7D_PAD_LCD_DATA00__LCD_DATA0 0x79
+ MX7D_PAD_LCD_DATA01__LCD_DATA1 0x79
+ MX7D_PAD_LCD_DATA02__LCD_DATA2 0x79
+ MX7D_PAD_LCD_DATA03__LCD_DATA3 0x79
+ MX7D_PAD_LCD_DATA04__LCD_DATA4 0x79
+ MX7D_PAD_LCD_DATA05__LCD_DATA5 0x79
+ MX7D_PAD_LCD_DATA06__LCD_DATA6 0x79
+ MX7D_PAD_LCD_DATA07__LCD_DATA7 0x79
+ MX7D_PAD_LCD_DATA08__LCD_DATA8 0x79
+ MX7D_PAD_LCD_DATA09__LCD_DATA9 0x79
+ MX7D_PAD_LCD_DATA10__LCD_DATA10 0x79
+ MX7D_PAD_LCD_DATA11__LCD_DATA11 0x79
+ MX7D_PAD_LCD_DATA12__LCD_DATA12 0x79
+ MX7D_PAD_LCD_DATA13__LCD_DATA13 0x79
+ MX7D_PAD_LCD_DATA14__LCD_DATA14 0x79
+ MX7D_PAD_LCD_DATA15__LCD_DATA15 0x79
+
+ MX7D_PAD_LCD_DATA17__LCD_DATA17 0x79
+ MX7D_PAD_LCD_DATA18__LCD_DATA18 0x79
+ MX7D_PAD_LCD_DATA19__LCD_DATA19 0x79
+ MX7D_PAD_LCD_DATA20__LCD_DATA20 0x79
+ MX7D_PAD_LCD_DATA21__LCD_DATA21 0x79
+
+ MX7D_PAD_LCD_DATA23__LCD_DATA23 0x79
+ MX7D_PAD_LCD_CLK__LCD_CLK 0x79
+ MX7D_PAD_LCD_ENABLE__LCD_ENABLE 0x79
+ MX7D_PAD_LCD_VSYNC__LCD_VSYNC 0x79
+ MX7D_PAD_LCD_HSYNC__LCD_HSYNC 0x79
+ MX7D_PAD_LCD_RESET__LCD_RESET 0x79
+ >;
+ };
+
+ pinctrl_sdoe_reg: sdoereggrp {
+ fsl,pins = <
+ MX7D_PAD_LCD_DATA22__GPIO3_IO27 0x74
+ >;
+ };
+
pinctrl_uart1: uart1grp {
fsl,pins = <
MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX 0x79
--
2.31.1

2022-01-24 19:08:07

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 4/8] regulator: sy7636a: Remove requirement on sy7636a mfd

Signed-off-by: Alistair Francis <[email protected]>
Acked-by: Mark Brown <[email protected]>
---
drivers/regulator/Kconfig | 1 -
drivers/regulator/sy7636a-regulator.c | 7 +++++--
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 1c35fed20d34..25ae5f087ff9 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1208,7 +1208,6 @@ config REGULATOR_STW481X_VMMC

config REGULATOR_SY7636A
tristate "Silergy SY7636A voltage regulator"
- depends on MFD_SY7636A
help
This driver supports Silergy SY3686A voltage regulator.

diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
index 22fddf868e4c..29fc27c2cda0 100644
--- a/drivers/regulator/sy7636a-regulator.c
+++ b/drivers/regulator/sy7636a-regulator.c
@@ -7,11 +7,14 @@
// Authors: Lars Ivar Miljeteig <[email protected]>
// Alistair Francis <[email protected]>

+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/mfd/sy7636a.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
#include <linux/regmap.h>
-#include <linux/gpio/consumer.h>
-#include <linux/mfd/sy7636a.h>

struct sy7636a_data {
struct regmap *regmap;
--
2.31.1

2022-01-24 19:08:57

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v18 6/8] ARM: imx_v6_v7_defconfig: Enable silergy,sy7636a

Enable the silergy,sy7636a and silergy,sy7636a-regulator for the
reMarkable2.

Signed-off-by: Alistair Francis <[email protected]>
---
arch/arm/configs/imx_v6_v7_defconfig | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index f7498df08dfe..37ec95fce3be 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -223,6 +223,7 @@ CONFIG_RN5T618_POWER=m
CONFIG_SENSORS_MC13783_ADC=y
CONFIG_SENSORS_GPIO_FAN=y
CONFIG_SENSORS_IIO_HWMON=y
+CONFIG_SENSORS_SY7636A=y
CONFIG_THERMAL_STATISTICS=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_CPU_THERMAL=y
@@ -239,6 +240,7 @@ CONFIG_MFD_DA9063=y
CONFIG_MFD_MC13XXX_SPI=y
CONFIG_MFD_MC13XXX_I2C=y
CONFIG_MFD_RN5T618=y
+CONFIG_MFD_SIMPLE_MFD_I2C=y
CONFIG_MFD_STMPE=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_ANATOP=y
@@ -251,6 +253,7 @@ CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
CONFIG_REGULATOR_PFUZE100=y
CONFIG_REGULATOR_RN5T618=y
+CONFIG_REGULATOR_SY7636A=y
CONFIG_RC_CORE=y
CONFIG_RC_DEVICES=y
CONFIG_IR_GPIO_CIR=y
--
2.31.1

2022-02-09 08:51:34

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL] Immutable branch between MFD, HWMON and Regulator due for the v5.18 merge window

Enjoy!

The following changes since commit e783362eb54cd99b2cac8b3a9aeac942e6f6ac07:

Linux 5.17-rc1 (2022-01-23 10:12:53 +0200)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-hwmon-regulator-v5.18

for you to fetch changes up to de34a4053250781404779b567b58dd97af689ce0:

hwmon: sy7636a: Add temperature driver for sy7636a (2022-02-08 09:27:33 +0000)

----------------------------------------------------------------
Immutable branch between MFD, HWMON and Regulator due for the v5.18 merge window
----------------------------------------------------------------

Alistair Francis (5):
dt-bindings: mfd: Initial commit of silergy,sy7636a.yaml
mfd: simple-mfd-i2c: Add a Kconfig name
mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a
regulator: sy7636a: Remove requirement on sy7636a mfd
hwmon: sy7636a: Add temperature driver for sy7636a
.../devicetree/bindings/mfd/silergy,sy7636a.yaml | 82 ++++++++++++++++
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/sy7636a-hwmon.rst | 26 +++++
drivers/hwmon/Kconfig | 9 ++
drivers/hwmon/Makefile | 1 +
drivers/hwmon/sy7636a-hwmon.c | 106 +++++++++++++++++++++
drivers/mfd/Kconfig | 2 +-
drivers/mfd/simple-mfd-i2c.c | 11 +++
drivers/regulator/Kconfig | 1 -
drivers/regulator/sy7636a-regulator.c | 7 +-
include/linux/mfd/sy7636a.h | 34 +++++++
11 files changed, 276 insertions(+), 4 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/silergy,sy7636a.yaml
create mode 100644 Documentation/hwmon/sy7636a-hwmon.rst
create mode 100644 drivers/hwmon/sy7636a-hwmon.c
create mode 100644 include/linux/mfd/sy7636a.h

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2022-03-08 11:28:51

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 4/8] regulator: sy7636a: Remove requirement on sy7636a mfd

Hi Alistair,

On Mon, Jan 24, 2022 at 1:25 PM Alistair Francis <[email protected]> wrote:
> Signed-off-by: Alistair Francis <[email protected]>
> Acked-by: Mark Brown <[email protected]>

Thanks for your patch, which is now commit 947d0cce70ae37b8
("regulator: sy7636a: Remove requirement on sy7636a mfd") in
mfd/for-mfd-next.

> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -1208,7 +1208,6 @@ config REGULATOR_STW481X_VMMC
>
> config REGULATOR_SY7636A
> tristate "Silergy SY7636A voltage regulator"
> - depends on MFD_SY7636A

As this is an i2c mfd device, you still need a dependency on
MFD and I2C, or some other symbol?

> help
> This driver supports Silergy SY3686A voltage regulator.
>
> diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
> index 22fddf868e4c..29fc27c2cda0 100644
> --- a/drivers/regulator/sy7636a-regulator.c
> +++ b/drivers/regulator/sy7636a-regulator.c
> @@ -7,11 +7,14 @@
> // Authors: Lars Ivar Miljeteig <[email protected]>
> // Alistair Francis <[email protected]>
>
> +#include <linux/gpio/consumer.h>
> +#include <linux/i2c.h>
> +#include <linux/mfd/sy7636a.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/regulator/driver.h>
> +#include <linux/regulator/machine.h>
> #include <linux/regmap.h>
> -#include <linux/gpio/consumer.h>
> -#include <linux/mfd/sy7636a.h>
>
> struct sy7636a_data {
> struct regmap *regmap;

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-08 14:25:26

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

Hi Alistair,

Thanks for your patch, which is now commit bae5a4acef67db88
("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.

On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
> device so that it can be enabled via menuconfig.

Which still does not explain why this would be needed...

> Signed-off-by: Alistair Francis <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>

> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
> module will be called si476x-core.
>
> config MFD_SIMPLE_MFD_I2C
> - tristate
> + tristate "Simple Multi-Functional Device support (I2C)"
> depends on I2C
> select MFD_CORE
> select REGMAP_I2C

The help text states:

| This driver creates a single register map with the intention for it
| to be shared by all sub-devices.

Yes, that's what MFD does?

| Once the register map has been successfully initialised, any
| sub-devices represented by child nodes in Device Tree will be
| subsequently registered.

OK...?

Still, no clue about what this driver really does, and why and when
it would be needed.

There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
There are no driver symbols that depend on this symbol.

If you have a driver in the pipeline that can make use of this,
can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
stay invisible?

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-08 23:26:11

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 5/8] hwmon: sy7636a: Add temperature driver for sy7636a

Hi Alistair,

On Mon, Jan 24, 2022 at 1:25 PM Alistair Francis <[email protected]> wrote:
> This is a multi-function device to interface with the sy7636a
> EPD PMIC chip from Silergy.
>
> Signed-off-by: Alistair Francis <[email protected]>
> Acked-by: Guenter Roeck <[email protected]>

Thanks for your patch, which is now commit de34a40532507814 ("hwmon:
sy7636a: Add temperature driver for sy7636a") in mfd/for-mfd-next.

> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -1672,6 +1672,15 @@ config SENSORS_SIS5595
> This driver can also be built as a module. If so, the module
> will be called sis5595.
>
> +config SENSORS_SY7636A
> + tristate "Silergy SY7636A"
> + help
> + If you say yes here you get support for the thermistor readout of
> + the Silergy SY7636A PMIC.

As this is an i2c mfd device, you do need a dependency on MFD and I2C,
or some other symbol, unless compile-testing?

> +
> + This driver can also be built as a module. If so, the module
> + will be called sy7636a-hwmon.
> +

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-21 06:38:55

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

Hi Alistair,

On Sat, Mar 19, 2022 at 3:36 AM Alistair Francis <[email protected]> wrote:
> On Tue, Mar 8, 2022 at 8:53 PM Geert Uytterhoeven <[email protected]> wrote:
> > Thanks for your patch, which is now commit bae5a4acef67db88
> > ("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.
> >
> > On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> > > Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
> > > device so that it can be enabled via menuconfig.
> >
> > Which still does not explain why this would be needed...
> >
> > > Signed-off-by: Alistair Francis <[email protected]>
> > > Acked-for-MFD-by: Lee Jones <[email protected]>
> >
> > > --- a/drivers/mfd/Kconfig
> > > +++ b/drivers/mfd/Kconfig
> > > @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
> > > module will be called si476x-core.
> > >
> > > config MFD_SIMPLE_MFD_I2C
> > > - tristate
> > > + tristate "Simple Multi-Functional Device support (I2C)"
> > > depends on I2C
> > > select MFD_CORE
> > > select REGMAP_I2C
> >
> > The help text states:
> >
> > | This driver creates a single register map with the intention for it
> > | to be shared by all sub-devices.
> >
> > Yes, that's what MFD does?
> >
> > | Once the register map has been successfully initialised, any
> > | sub-devices represented by child nodes in Device Tree will be
> > | subsequently registered.
> >
> > OK...?
> >
> > Still, no clue about what this driver really does, and why and when
> > it would be needed.
> >
> > There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
> > There are no driver symbols that depend on this symbol.
> >
> > If you have a driver in the pipeline that can make use of this,
> > can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
> > stay invisible?
>
> My patch "mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a"
> allows using this driver for the silergy,sy7636a MFD. So it's nice to
> be able to enable and disable it as required.

So after that patch, enabling MFD_SIMPLE_MFD_I2C will enable
support for an ever-growing random bunch of devices, none of which
is described in the help text?
To me, ghat doesn't look like the way to go forward...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-21 11:04:54

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 5/8] hwmon: sy7636a: Add temperature driver for sy7636a

Hi Alistair,

On Mon, Mar 21, 2022 at 8:35 AM Alistair Francis <[email protected]> wrote:
> On Tue, Mar 8, 2022 at 9:21 PM Geert Uytterhoeven <[email protected]> wrote:
> > On Mon, Jan 24, 2022 at 1:25 PM Alistair Francis <[email protected]> wrote:
> > > This is a multi-function device to interface with the sy7636a
> > > EPD PMIC chip from Silergy.
> > >
> > > Signed-off-by: Alistair Francis <[email protected]>
> > > Acked-by: Guenter Roeck <[email protected]>
> >
> > Thanks for your patch, which is now commit de34a40532507814 ("hwmon:
> > sy7636a: Add temperature driver for sy7636a") in mfd/for-mfd-next.
> >
> > > --- a/drivers/hwmon/Kconfig
> > > +++ b/drivers/hwmon/Kconfig
> > > @@ -1672,6 +1672,15 @@ config SENSORS_SIS5595
> > > This driver can also be built as a module. If so, the module
> > > will be called sis5595.
> > >
> > > +config SENSORS_SY7636A
> > > + tristate "Silergy SY7636A"
> > > + help
> > > + If you say yes here you get support for the thermistor readout of
> > > + the Silergy SY7636A PMIC.
> >
> > As this is an i2c mfd device, you do need a dependency on MFD and I2C,
> > or some other symbol, unless compile-testing?
>
> It doesn't depend on either to build though. It can be built independently.

That is true.

But do you think all users configuring their kernel should be asked
about all (thousands) of config symbols for drivers that can be built,
but won't work or are irrelevant otherwise?

Please read
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/kconfig-language.rst#n541

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-21 21:16:00

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

On Mon, 21 Mar 2022, Alistair Francis wrote:

> On Sun, Mar 20, 2022 at 12:48 AM Guenter Roeck <[email protected]> wrote:
> >
> > On 3/19/22 02:28, Geert Uytterhoeven wrote:
> > > Hi Alistair,
> > >
> > > On Sat, Mar 19, 2022 at 3:36 AM Alistair Francis <[email protected]> wrote:
> > >> On Tue, Mar 8, 2022 at 8:53 PM Geert Uytterhoeven <[email protected]> wrote:
> > >>> Thanks for your patch, which is now commit bae5a4acef67db88
> > >>> ("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.
> > >>>
> > >>> On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> > >>>> Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
> > >>>> device so that it can be enabled via menuconfig.
> > >>>
> > >>> Which still does not explain why this would be needed...
> > >>>
> > >>>> Signed-off-by: Alistair Francis <[email protected]>
> > >>>> Acked-for-MFD-by: Lee Jones <[email protected]>
> > >>>
> > >>>> --- a/drivers/mfd/Kconfig
> > >>>> +++ b/drivers/mfd/Kconfig
> > >>>> @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
> > >>>> module will be called si476x-core.
> > >>>>
> > >>>> config MFD_SIMPLE_MFD_I2C
> > >>>> - tristate
> > >>>> + tristate "Simple Multi-Functional Device support (I2C)"
> > >>>> depends on I2C
> > >>>> select MFD_CORE
> > >>>> select REGMAP_I2C
> > >>>
> > >>> The help text states:
> > >>>
> > >>> | This driver creates a single register map with the intention for it
> > >>> | to be shared by all sub-devices.
> > >>>
> > >>> Yes, that's what MFD does?
> > >>>
> > >>> | Once the register map has been successfully initialised, any
> > >>> | sub-devices represented by child nodes in Device Tree will be
> > >>> | subsequently registered.
> > >>>
> > >>> OK...?
> > >>>
> > >>> Still, no clue about what this driver really does, and why and when
> > >>> it would be needed.
> > >>>
> > >>> There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
> > >>> There are no driver symbols that depend on this symbol.
> > >>>
> > >>> If you have a driver in the pipeline that can make use of this,
> > >>> can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
> > >>> stay invisible?
> > >>
> > >> My patch "mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a"
> > >> allows using this driver for the silergy,sy7636a MFD. So it's nice to
> > >> be able to enable and disable it as required.
> > >
> > > So after that patch, enabling MFD_SIMPLE_MFD_I2C will enable
> > > support for an ever-growing random bunch of devices, none of which
> > > is described in the help text?
> > > To me, ghat doesn't look like the way to go forward...
> > >
> >
> > I am probably missing something. Why not something like the following ?
> >
> > config MFD_SY7636A
> > tristate "Silergy SY7636A voltage regulator"
> > depends on I2C
> > select MFD_SIMPLE_MFD_I2C
> > help
> > Enable support for Silergy SY7636A voltage regulator.
> >
> > To enable support for building sub-devices as modules,
> > choose M here.
> >
> >
> > This would be quite similar to MFD_SL28CPLD which essentially does
> > the same (and, unless I am missing something, doesn't have its own
> > driver either). Sub-devices would then depend on MFD_SY7636A.
>
> That's fine with me.
>
> As you said this patch is already in the mfd/for-mfd-next tree, should
> I resend the series?

Making the symbol selectable-only is fine with me also.

Please send a subsequent patch.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2022-03-21 21:17:25

by Alistair Francis

[permalink] [raw]
Subject: Re: [PATCH v18 5/8] hwmon: sy7636a: Add temperature driver for sy7636a

On Tue, Mar 8, 2022 at 9:21 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Alistair,
>
> On Mon, Jan 24, 2022 at 1:25 PM Alistair Francis <[email protected]> wrote:
> > This is a multi-function device to interface with the sy7636a
> > EPD PMIC chip from Silergy.
> >
> > Signed-off-by: Alistair Francis <[email protected]>
> > Acked-by: Guenter Roeck <[email protected]>
>
> Thanks for your patch, which is now commit de34a40532507814 ("hwmon:
> sy7636a: Add temperature driver for sy7636a") in mfd/for-mfd-next.
>
> > --- a/drivers/hwmon/Kconfig
> > +++ b/drivers/hwmon/Kconfig
> > @@ -1672,6 +1672,15 @@ config SENSORS_SIS5595
> > This driver can also be built as a module. If so, the module
> > will be called sis5595.
> >
> > +config SENSORS_SY7636A
> > + tristate "Silergy SY7636A"
> > + help
> > + If you say yes here you get support for the thermistor readout of
> > + the Silergy SY7636A PMIC.
>
> As this is an i2c mfd device, you do need a dependency on MFD and I2C,
> or some other symbol, unless compile-testing?

It doesn't depend on either to build though. It can be built independently.

Alistair

>
> > +
> > + This driver can also be built as a module. If so, the module
> > + will be called sy7636a-hwmon.
> > +
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2022-03-21 21:40:59

by Alistair Francis

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

On Sun, Mar 20, 2022 at 12:48 AM Guenter Roeck <[email protected]> wrote:
>
> On 3/19/22 02:28, Geert Uytterhoeven wrote:
> > Hi Alistair,
> >
> > On Sat, Mar 19, 2022 at 3:36 AM Alistair Francis <[email protected]> wrote:
> >> On Tue, Mar 8, 2022 at 8:53 PM Geert Uytterhoeven <[email protected]> wrote:
> >>> Thanks for your patch, which is now commit bae5a4acef67db88
> >>> ("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.
> >>>
> >>> On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> >>>> Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
> >>>> device so that it can be enabled via menuconfig.
> >>>
> >>> Which still does not explain why this would be needed...
> >>>
> >>>> Signed-off-by: Alistair Francis <[email protected]>
> >>>> Acked-for-MFD-by: Lee Jones <[email protected]>
> >>>
> >>>> --- a/drivers/mfd/Kconfig
> >>>> +++ b/drivers/mfd/Kconfig
> >>>> @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
> >>>> module will be called si476x-core.
> >>>>
> >>>> config MFD_SIMPLE_MFD_I2C
> >>>> - tristate
> >>>> + tristate "Simple Multi-Functional Device support (I2C)"
> >>>> depends on I2C
> >>>> select MFD_CORE
> >>>> select REGMAP_I2C
> >>>
> >>> The help text states:
> >>>
> >>> | This driver creates a single register map with the intention for it
> >>> | to be shared by all sub-devices.
> >>>
> >>> Yes, that's what MFD does?
> >>>
> >>> | Once the register map has been successfully initialised, any
> >>> | sub-devices represented by child nodes in Device Tree will be
> >>> | subsequently registered.
> >>>
> >>> OK...?
> >>>
> >>> Still, no clue about what this driver really does, and why and when
> >>> it would be needed.
> >>>
> >>> There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
> >>> There are no driver symbols that depend on this symbol.
> >>>
> >>> If you have a driver in the pipeline that can make use of this,
> >>> can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
> >>> stay invisible?
> >>
> >> My patch "mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a"
> >> allows using this driver for the silergy,sy7636a MFD. So it's nice to
> >> be able to enable and disable it as required.
> >
> > So after that patch, enabling MFD_SIMPLE_MFD_I2C will enable
> > support for an ever-growing random bunch of devices, none of which
> > is described in the help text?
> > To me, ghat doesn't look like the way to go forward...
> >
>
> I am probably missing something. Why not something like the following ?
>
> config MFD_SY7636A
> tristate "Silergy SY7636A voltage regulator"
> depends on I2C
> select MFD_SIMPLE_MFD_I2C
> help
> Enable support for Silergy SY7636A voltage regulator.
>
> To enable support for building sub-devices as modules,
> choose M here.
>
>
> This would be quite similar to MFD_SL28CPLD which essentially does
> the same (and, unless I am missing something, doesn't have its own
> driver either). Sub-devices would then depend on MFD_SY7636A.

That's fine with me.

As you said this patch is already in the mfd/for-mfd-next tree, should
I resend the series?

Alistair

>
> Guenter
>
> > Gr{oetje,eeting}s,
> >
> > Geert
> >
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
> >
> > In personal conversations with technical people, I call myself a hacker. But
> > when I'm talking to journalists I just say "programmer" or something like that.
> > -- Linus Torvalds
>

2022-03-21 22:30:06

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v18 3/8] mfd: simple-mfd-i2c: Enable support for the silergy, sy7636a

Hi Alistair,

On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> Signed-off-by: Alistair Francis <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>

> --- a/drivers/mfd/simple-mfd-i2c.c
> +++ b/drivers/mfd/simple-mfd-i2c.c
> @@ -62,8 +62,19 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)
> return ret;
> }
>
> +static const struct mfd_cell sy7636a_cells[] = {
> + { .name = "sy7636a-regulator", },
> + { .name = "sy7636a-temperature", },
> +};
> +
> +static const struct simple_mfd_data silergy_sy7636a = {
> + .mfd_cell = sy7636a_cells,
> + .mfd_cell_size = ARRAY_SIZE(sy7636a_cells),
> +};
> +
> static const struct of_device_id simple_mfd_i2c_of_match[] = {
> { .compatible = "kontron,sl28cpld" },
> + { .compatible = "silergy,sy7636a", .data = &silergy_sy7636a},
> {}
> };

This is slowly turning into a "board file" for an ever-growing random
bunch of devices, none of which is described in the help text?

See also my reply to patch 2/8
https://lore.kernel.org/all/CAMuHMdVy4E1pX+VLLq_05FX4pM+BPZycQgn68ArGh2s8qL24=w@mail.gmail.com/

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2022-03-21 22:34:55

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

On 3/19/22 02:28, Geert Uytterhoeven wrote:
> Hi Alistair,
>
> On Sat, Mar 19, 2022 at 3:36 AM Alistair Francis <[email protected]> wrote:
>> On Tue, Mar 8, 2022 at 8:53 PM Geert Uytterhoeven <[email protected]> wrote:
>>> Thanks for your patch, which is now commit bae5a4acef67db88
>>> ("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.
>>>
>>> On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
>>>> Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
>>>> device so that it can be enabled via menuconfig.
>>>
>>> Which still does not explain why this would be needed...
>>>
>>>> Signed-off-by: Alistair Francis <[email protected]>
>>>> Acked-for-MFD-by: Lee Jones <[email protected]>
>>>
>>>> --- a/drivers/mfd/Kconfig
>>>> +++ b/drivers/mfd/Kconfig
>>>> @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
>>>> module will be called si476x-core.
>>>>
>>>> config MFD_SIMPLE_MFD_I2C
>>>> - tristate
>>>> + tristate "Simple Multi-Functional Device support (I2C)"
>>>> depends on I2C
>>>> select MFD_CORE
>>>> select REGMAP_I2C
>>>
>>> The help text states:
>>>
>>> | This driver creates a single register map with the intention for it
>>> | to be shared by all sub-devices.
>>>
>>> Yes, that's what MFD does?
>>>
>>> | Once the register map has been successfully initialised, any
>>> | sub-devices represented by child nodes in Device Tree will be
>>> | subsequently registered.
>>>
>>> OK...?
>>>
>>> Still, no clue about what this driver really does, and why and when
>>> it would be needed.
>>>
>>> There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
>>> There are no driver symbols that depend on this symbol.
>>>
>>> If you have a driver in the pipeline that can make use of this,
>>> can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
>>> stay invisible?
>>
>> My patch "mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a"
>> allows using this driver for the silergy,sy7636a MFD. So it's nice to
>> be able to enable and disable it as required.
>
> So after that patch, enabling MFD_SIMPLE_MFD_I2C will enable
> support for an ever-growing random bunch of devices, none of which
> is described in the help text?
> To me, ghat doesn't look like the way to go forward...
>

I am probably missing something. Why not something like the following ?

config MFD_SY7636A
tristate "Silergy SY7636A voltage regulator"
depends on I2C
select MFD_SIMPLE_MFD_I2C
help
Enable support for Silergy SY7636A voltage regulator.

To enable support for building sub-devices as modules,
choose M here.


This would be quite similar to MFD_SL28CPLD which essentially does
the same (and, unless I am missing something, doesn't have its own
driver either). Sub-devices would then depend on MFD_SY7636A.

Guenter

> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds

2022-03-21 23:27:18

by Alistair Francis

[permalink] [raw]
Subject: Re: [PATCH v18 2/8] mfd: simple-mfd-i2c: Add a Kconfig name

On Tue, Mar 8, 2022 at 8:53 PM Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Alistair,
>
> Thanks for your patch, which is now commit bae5a4acef67db88
> ("mfd: simple-mfd-i2c: Add a Kconfig name") in mfd/for-mfd-next.
>
> On Mon, Jan 24, 2022 at 1:24 PM Alistair Francis <[email protected]> wrote:
> > Add a Kconfig name to the "Simple Multi-Functional Device support (I2C)"
> > device so that it can be enabled via menuconfig.
>
> Which still does not explain why this would be needed...
>
> > Signed-off-by: Alistair Francis <[email protected]>
> > Acked-for-MFD-by: Lee Jones <[email protected]>
>
> > --- a/drivers/mfd/Kconfig
> > +++ b/drivers/mfd/Kconfig
> > @@ -1188,7 +1188,7 @@ config MFD_SI476X_CORE
> > module will be called si476x-core.
> >
> > config MFD_SIMPLE_MFD_I2C
> > - tristate
> > + tristate "Simple Multi-Functional Device support (I2C)"
> > depends on I2C
> > select MFD_CORE
> > select REGMAP_I2C
>
> The help text states:
>
> | This driver creates a single register map with the intention for it
> | to be shared by all sub-devices.
>
> Yes, that's what MFD does?
>
> | Once the register map has been successfully initialised, any
> | sub-devices represented by child nodes in Device Tree will be
> | subsequently registered.
>
> OK...?
>
> Still, no clue about what this driver really does, and why and when
> it would be needed.
>
> There is one driver symbol that selects MFD_SIMPLE_MFD_I2C.
> There are no driver symbols that depend on this symbol.
>
> If you have a driver in the pipeline that can make use of this,
> can't it just select MFD_SIMPLE_MFD_I2C, so the symbol itself can
> stay invisible?

My patch "mfd: simple-mfd-i2c: Enable support for the silergy,sy7636a"
allows using this driver for the silergy,sy7636a MFD. So it's nice to
be able to enable and disable it as required.

Alistair

>
> Thanks!
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds