Skip to contentSkip to conversation

clk: Combine MAX77686 and MAX77802 driver and extend for MAX77620

PATCH Superseded Laxman Dewangan 3 participants 14 messages Jun 16, 2016 – Jun 17, 2016

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover clk: Combine MAX77686 and MAX77802 driver and extend for MAX77620

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Part of common code utilisation, there is 3 files for these chips clock driver, one for common and two files for driver registration.

Combine both drivers into single file and move common code into same common file reduces the 2 files and make max77686 and max77802 clock driver in single fine. This driver does not depends on the parent driver structure. The regmap handle is acquired through regmap APIs for the register access.

After comining the driver and DT files, extend the support to MAX77620.

This series is based on discussion from the series

	clk: max77620: Add clock driver for MAX77620/MAX20024

On this series, it is proposed to combine all files together.

Changes form V1:
- Incorporated all review comment.
- Collected Testedby/reviewed by.

Laxman Dewangan (4):
clk: max77686: Combine Maxim max77686 and max77802 driver
clk: Combine DT binding doc for max77686 and max77802
clk: max77686: Add DT binding details for PMIC MAX77620
clk: max77686: Add support for MAX77620 clocks

 .../devicetree/bindings/clock/maxim,max77686.txt   | 118 ++++++++--
 .../devicetree/bindings/clock/maxim,max77802.txt   |  44 ----
 drivers/clk/Kconfig                                |  18 +-
 drivers/clk/Makefile                               |   2 -
 drivers/clk/clk-max-gen.c                          | 194 ---------------
 drivers/clk/clk-max-gen.h                          |  32 ---
 drivers/clk/clk-max77686.c                         | 262 ++++++++++++++++++++-
 drivers/clk/clk-max77802.c                         |  96 --------
 include/dt-bindings/clock/maxim,max77620.h         |  21 ++
 9 files changed, 368 insertions(+), 419 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/maxim,max77802.txt
 delete mode 100644 drivers/clk/clk-max-gen.c
 delete mode 100644 drivers/clk/clk-max-gen.h
 delete mode 100644 drivers/clk/clk-max77802.c
 create mode 100644 include/dt-bindings/clock/maxim,max77620.h
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/4 clk: max77686: Combine Maxim max77686 and max77802 driver

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Part of common code utilisation, there is 3 files for these chips clock driver, one for common and two files for driver registration.

Combine both drivers into single file and move common code into same common file reduces the 2 files and make max77686 and max77802 clock driver in single fine. This driver does not depends on the parent driver structure. The regmap handle is acquired through regmap APIs for the register access.

This combination of driver helps on adding clock driver for different Maxim PMICs which has similar clock IP like MAX77620 and MAX20024.

---
Changes from V1:
- Collected RB and TB from Javier.
- Change the max_gen to max77686.
- Rename structure and avoid duplication for reg and mask.
- Taken care of comment from Krzysztof on coding.

---
 drivers/clk/Kconfig        |  15 +--
 drivers/clk/Makefile       |   2 -
 drivers/clk/clk-max-gen.c  | 194 -----------------------------------
 drivers/clk/clk-max-gen.h  |  32 ------
 drivers/clk/clk-max77686.c | 244 ++++++++++++++++++++++++++++++++++++++++++---
 drivers/clk/clk-max77802.c |  96 ------------------
 6 files changed, 234 insertions(+), 349 deletions(-)
 delete mode 100644 drivers/clk/clk-max-gen.c
 delete mode 100644 drivers/clk/clk-max-gen.h
 delete mode 100644 drivers/clk/clk-max77802.c
drivers/clk/Kconfig +2 -13
index 98efbfc..6afad74 100644
@@ -31,22 +31,11 @@ config COMMON_CLK_WM831X
 
 source "drivers/clk/versatile/Kconfig"
 
-config COMMON_CLK_MAX_GEN
-        bool
-
 config COMMON_CLK_MAX77686
-	tristate "Clock driver for Maxim 77686 MFD"
-	depends on MFD_MAX77686
-	select COMMON_CLK_MAX_GEN
-	---help---
-	  This driver supports Maxim 77686 crystal oscillator clock. 
-
-config COMMON_CLK_MAX77802
-	tristate "Clock driver for Maxim 77802 PMIC"
+	tristate "Clock driver for Maxim 77686/77802 MFD"
 	depends on MFD_MAX77686
-	select COMMON_CLK_MAX_GEN
 	---help---
-	  This driver supports Maxim 77802 crystal oscillator clock.
+	  This driver supports Maxim 77686/77802 crystal oscillator clock.
 
 config COMMON_CLK_RK808
 	tristate "Clock driver for RK808"
drivers/clk/Makefile +0 -2
index dcc5e69..0a3a91b 100644
@@ -26,9 +26,7 @@ obj-$(CONFIG_ARCH_CLPS711X)		+= clk-clps711x.o
 obj-$(CONFIG_ARCH_EFM32)		+= clk-efm32gg.o
 obj-$(CONFIG_ARCH_HIGHBANK)		+= clk-highbank.o
 obj-$(CONFIG_MACH_LOONGSON32)		+= clk-ls1x.o
-obj-$(CONFIG_COMMON_CLK_MAX_GEN)	+= clk-max-gen.o
 obj-$(CONFIG_COMMON_CLK_MAX77686)	+= clk-max77686.o
-obj-$(CONFIG_COMMON_CLK_MAX77802)	+= clk-max77802.o
 obj-$(CONFIG_ARCH_MB86S7X)		+= clk-mb86s7x.o
 obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
 obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
drivers/clk/clk-max-gen.c deleted +0 -194

194 lines not on this page · raw message

drivers/clk/clk-max-gen.h deleted +0 -32
deleted file mode 100644
index 997e86f..0000000
@@ -1,32 +0,0 @@
-/*
- * clk-max-gen.h - Generic clock driver for Maxim PMICs clocks
- *
- * Copyright (C) 2014 Google, Inc
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef __CLK_MAX_GEN_H__
-#define __CLK_MAX_GEN_H__
-
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/clkdev.h>
-#include <linux/regmap.h>
-#include <linux/platform_device.h>
-
-int max_gen_clk_probe(struct platform_device *pdev, struct regmap *regmap,
-		      u32 reg, struct clk_init_data *clks_init, int num_init);
-int max_gen_clk_remove(struct platform_device *pdev, int num_init);
-extern struct clk_ops max_gen_clk_ops;
-
-#endif /* __CLK_MAX_GEN_H__ */
drivers/clk/clk-max77686.c +232 -12

278 lines not on this page · raw message

drivers/clk/clk-max77802.c deleted +0 -96

96 lines not on this page · raw message

Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 2/4 clk: Combine DT binding doc for max77686 and max77802

In reply to Laxman Dewangan

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Define the common DT binding file for the clocks of Maxim PMICs MAX77686 and MAX77802. For this, remove the separate DT binding document file for maxim,max77802 and move all information to maxim,max77686 DT binding document.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

---
Changes from V1:
- Rewrite description to remvoe ref to driver.
- Taken care of comment from Krzysztof on the supported clocks and DT bindings.

---
 .../devicetree/bindings/clock/maxim,max77686.txt   | 82 ++++++++++++++++------
 .../devicetree/bindings/clock/maxim,max77802.txt   | 44 ------------
 2 files changed, 59 insertions(+), 67 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/maxim,max77802.txt
Documentation/devicetree/bindings/clock/maxim,max77686.txt +59 -23
index 9c40739..4d973b5 100644
@@ -1,11 +1,15 @@
-Binding for Maxim MAX77686 32k clock generator block
+Binding for Maxim MAX77686/MAX77802 32k clock generator block
 
-This is a part of device tree bindings of MAX77686 multi-function device.
-More information can be found in bindings/mfd/max77686.txt file.
+This is a part of device tree bindings of MAX77686/MAX77802 multi-function
+device. More information can be found in bindings/mfd/max77686.txt file for
+MAX77686 and bindings/mfd/max77802.txt for MAX77802.
 
 The MAX77686 contains three 32.768khz clock outputs that can be controlled
 (gated/ungated) over I2C.
 
+The MAX77802 contains two 32.768khz clock outputs that can be controlled
+(gated/ungated) over I2C.
+
 Following properties should be presend in main device node of the MFD chip.
 
 Required properties:
@@ -17,30 +21,62 @@ Optional properties:
 
 Each clock is assigned an identifier and client nodes can use this identifier
 to specify the clock which they consume. Following indices are allowed:
-    - 0: 32khz_ap clock,
-    - 1: 32khz_cp clock,
-    - 2: 32khz_pmic clock.
+    - 0: 32khz_ap clock (max77686, max77802),
+    - 1: 32khz_cp clock (max77686, max77802),
+    - 2: 32khz_pmic clock (max77686).
 
 Clocks are defined as preprocessor macros in dt-bindings/clock/maxim,max77686.h
-header and can be used in device tree sources.
+header for MAX77686 and dt-bindings/clock/maxim,max77802.h for MAX77802 and can
+be used in device tree sources.
+
+Example:
+
+1. With MAX77686:
+
+#include <dt-bindings/clock/maxim,max77686.h>
+/* ... */
+
+	Node of the MFD chip
+		max77686: max77686 at 09 {
+			compatible = "maxim,max77686";
+			interrupt-parent = <&wakeup_eint>;
+			interrupts = <26 0>;
+			reg = <0x09>;
+			#clock-cells = <1>;
+
+			/* ... */
+		};
+
+	Clock consumer node
+
+		foo at 0 {
+			compatible = "bar,foo";
+			/* ... */
+			clock-names = "my-clock";
+			clocks = <&max77686 MAX77686_CLK_PMIC>;
+		};
+
+2. With MAX77802:
 
-Example: Node of the MFD chip
+#include <dt-bindings/clock/maxim,max77802.h>
+/* ... */
 
-	max77686: max77686 at 09 {
-		compatible = "maxim,max77686";
-		interrupt-parent = <&wakeup_eint>;
-		interrupts = <26 0>;
-		reg = <0x09>;
-		#clock-cells = <1>;
+	Node of the MFD chip
+		max77802: max77802 at 09 {
+			compatible = "maxim,max77802";
+			interrupt-parent = <&wakeup_eint>;
+			interrupts = <26 0>;
+			reg = <0x09>;
+			#clock-cells = <1>;
 
-		/* ... */
-	};
+			/* ... */
+		};
 
-Example: Clock consumer node
+	Clock consumer node
 
-	foo at 0 {
-		compatible = "bar,foo";
-		/* ... */
-		clock-names = "my-clock";
-		clocks = <&max77686 MAX77686_CLK_PMIC>;
-	};
+		foo at 0 {
+			compatible = "bar,foo";
+			/* ... */
+			clock-names = "my-clock";
+			clocks = <&max77802 MAX77802_CLK_32K_AP>;
+		};
Documentation/devicetree/bindings/clock/maxim,max77802.txt deleted +0 -44

44 lines not on this page · raw message

Signature · 1 line
2.1.4
#6 lore raw

PATCH v2 3/4 clk: max77686: Add DT binding details for PMIC MAX77620

In reply to Laxman Dewangan

Maxim has used the same clock IP on multiple PMICs like MAX77686, MAX77802, MAX77620. Only differences are the number of clocks from these PMICs like MAX77686 has 3 clocks output, MAX776802 have two clock output and MAX77620 has one clock output.

Add clock binding details and DT example for the MAX77620.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

---
Changes from V1:
- Use proper comment for the ::::
- Added dt binding preprocessor file as maxim,max77620.h for max77620 inline with the other chip.
- Refer the dt binding header for the supported clock index.

---
 .../devicetree/bindings/clock/maxim,max77686.txt   | 52 +++++++++++++++++-----
 include/dt-bindings/clock/maxim,max77620.h         | 21 +++++++++
 2 files changed, 63 insertions(+), 10 deletions(-)
 create mode 100644 include/dt-bindings/clock/maxim,max77620.h
Documentation/devicetree/bindings/clock/maxim,max77686.txt +42 -10
index 4d973b5..8398a3a 100644
@@ -1,14 +1,24 @@
-Binding for Maxim MAX77686/MAX77802 32k clock generator block
+Binding for Maxim MAX77686/MAX77802/MAX77620 32k clock generator block
 
-This is a part of device tree bindings of MAX77686/MAX77802 multi-function
-device. More information can be found in bindings/mfd/max77686.txt file for
-MAX77686 and bindings/mfd/max77802.txt for MAX77802.
+This is a part of device tree bindings of MAX77686/MAX77802/MAX77620
+multi-function device. More information can be found in MFD DT binding
+doc as follows:
+	bindings/mfd/max77686.txt for MAX77686 and
+	bindings/mfd/max77802.txt for MAX77802 and
+	bindings/mfd/max77620.txt for MAX77620.
 
 The MAX77686 contains three 32.768khz clock outputs that can be controlled
-(gated/ungated) over I2C.
+(gated/ungated) over I2C. Clocks are defined as preprocessor macros in
+dt-bindings/clock/maxim,max77686.h.
+
 
 The MAX77802 contains two 32.768khz clock outputs that can be controlled
-(gated/ungated) over I2C.
+(gated/ungated) over I2C. Clocks are defined as preprocessor macros in
+dt-bindings/clock/maxim,max77802.h.
+
+The MAX77686 contains one 32.768khz clock outputs that can be controlled
+(gated/ungated) over I2C. Clocks are defined as preprocessor macros in
+dt-bindings/clock/maxim,max77620.h.
 
 Following properties should be presend in main device node of the MFD chip.
 
@@ -21,13 +31,12 @@ Optional properties:
 
 Each clock is assigned an identifier and client nodes can use this identifier
 to specify the clock which they consume. Following indices are allowed:
-    - 0: 32khz_ap clock (max77686, max77802),
+    - 0: 32khz_ap clock (max77686, max77802), 32khz_out0 (max77620)
     - 1: 32khz_cp clock (max77686, max77802),
     - 2: 32khz_pmic clock (max77686).
 
-Clocks are defined as preprocessor macros in dt-bindings/clock/maxim,max77686.h
-header for MAX77686 and dt-bindings/clock/maxim,max77802.h for MAX77802 and can
-be used in device tree sources.
+Clocks are defined as preprocessor macros in above dt-binding header for
+respective chips.
 
 Example:
 
@@ -80,3 +89,26 @@ Example:
 			clock-names = "my-clock";
 			clocks = <&max77802 MAX77802_CLK_32K_AP>;
 		};
+
+
+3. With MAX77620:
+
+#include <dt-bindings/clock/maxim,max77620.h>
+/* ... */
+
+	Node of the MFD chip
+		max77620: max77620 at 3c {
+			compatible = "maxim,max77620";
+			reg = <0x3c>;
+			#clock-cells = <1>;
+			/* ... */
+		};
+
+	Clock consumer node
+
+		foo at 0 {
+			compatible = "bar,foo";
+			/* ... */
+			clock-names = "my-clock";
+			clocks = <&max77620 MAX77620_CLK_32K_OUT0>;
+		};
include/dt-bindings/clock/maxim,max77620.h new file +21 -0
new file mode 100644
index 0000000..82aba28
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Device Tree binding constants clocks for the Maxim 77620 PMIC.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_MAXIM_MAX77620_CLOCK_H
+#define _DT_BINDINGS_CLOCK_MAXIM_MAX77620_CLOCK_H
+
+/* Fixed rate clocks. */
+
+#define MAX77620_CLK_32K_OUT0		0
+
+/* Total number of clocks. */
+#define MAX77620_CLKS_NUM		(MAX77620_CLK_32K_OUT0 + 1)
+
+#endif /* _DT_BINDINGS_CLOCK_MAXIM_MAX77620_CLOCK_H */
Signature · 1 line
2.1.4
#9 lore raw

PATCH v2 4/4 clk: max77686: Add support for MAX77620 clocks

In reply to Laxman Dewangan

Maxim Max77620 has one 32KHz clock output and the clock HW IP used on this PMIC is same as what it is there in the MAX77686.

Add clock driver support for MAX77620 on the MAX77686 driver.

---
Changes from V1:
- Updated based on changes done in first patch.

---
 drivers/clk/Kconfig        |  7 ++++---
 drivers/clk/clk-max77686.c | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)
drivers/clk/Kconfig +4 -3
index 6afad74..d75f4c5 100644
@@ -32,10 +32,11 @@ config COMMON_CLK_WM831X
 source "drivers/clk/versatile/Kconfig"
 
 config COMMON_CLK_MAX77686
-	tristate "Clock driver for Maxim 77686/77802 MFD"
-	depends on MFD_MAX77686
+	tristate "Clock driver for Maxim 77686/77802/MAX77620 MFD"
+	depends on MFD_MAX77686 || MFD_MAX77620
 	---help---
-	  This driver supports Maxim 77686/77802 crystal oscillator clock.
+	  This driver supports Maxim 77686/77802/MAX77620 crystal oscillator
+	  clock.
 
 config COMMON_CLK_RK808
 	tristate "Clock driver for RK808"
drivers/clk/clk-max77686.c +18 -0
index 9aba3a8..19f6208 100644
@@ -25,6 +25,7 @@
 #include <linux/err.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/mfd/max77620.h>
 #include <linux/mfd/max77686.h>
 #include <linux/mfd/max77686-private.h>
 #include <linux/clk-provider.h>
@@ -35,12 +36,14 @@
 
 #include <dt-bindings/clock/maxim,max77686.h>
 #include <dt-bindings/clock/maxim,max77802.h>
+#include <dt-bindings/clock/maxim,max77620.h>
 
 #define MAX77802_CLOCK_LOW_JITTER_SHIFT 0x3
 
 enum max77686_chip_name {
 	CHIP_MAX77686,
 	CHIP_MAX77802,
+	CHIP_MAX77620,
 };
 
 struct max77686_hw_clk_info {
@@ -97,6 +100,15 @@ max77686_hw_clk_info max77802_hw_clks_info[MAX77802_CLKS_NUM] = {
 	},
 };
 
+static const struct
+max77686_hw_clk_info max77620_hw_clks_info[MAX77620_CLKS_NUM] = {
+	[MAX77620_CLK_32K_OUT0] = {
+		.name = "32khz_out0",
+		.clk_reg = MAX77620_REG_CNFG1_32K,
+		.clk_enable_mask = MAX77620_CNFG1_32K_OUT0_EN,
+	},
+};
+
 static struct max77686_clk_init_data *to_max77686_clk_init_data(
 				struct clk_hw *hw)
 {
@@ -181,6 +193,11 @@ static int max77686_clk_probe(struct platform_device *pdev)
 		hw_clks = max77802_hw_clks_info;
 		break;
 
+	case CHIP_MAX77620:
+		num_clks = MAX77620_CLKS_NUM;
+		hw_clks = max77620_hw_clks_info;
+		break;
+
 	default:
 		dev_err(dev, "Unknown Chip ID\n");
 		return -EINVAL;
@@ -284,6 +301,7 @@ static int max77686_clk_remove(struct platform_device *pdev)
 static const struct platform_device_id max77686_clk_id[] = {
 	{ "max77686-clk", .driver_data = CHIP_MAX77686, },
 	{ "max77802-clk", .driver_data = CHIP_MAX77802, },
+	{ "max77620-clock", .driver_data = CHIP_MAX77620, },
 	{},
 };
 MODULE_DEVICE_TABLE(platform, max77686_clk_id);
Signature · 1 line
2.1.4
Reviewed-by on v2 2/4
#4 lore raw

Re: [PATCH V2 2/4] clk: Combine DT binding doc for max77686 and max77802

In reply to Laxman Dewangan

Hello Laxman,

Quoted 4 lines · Laxman Dewangan

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Quoted 9 lines

Define the common DT binding file for the clocks of Maxim PMICs MAX77686 and MAX77802. For this, remove the separate DT binding document file for maxim,max77802 and move all information to maxim,max77686 DT binding document.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

Looks good to me.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
Reviewed-by on v2 3/4
#7 lore raw

Re: [PATCH V2 3/4] clk: max77686: Add DT binding details for PMIC MAX77620

In reply to Laxman Dewangan

Hello Laxman,

Quoted 5 lines · Laxman Dewangan

Maxim has used the same clock IP on multiple PMICs like MAX77686, MAX77802, MAX77620. Only differences are the number of clocks from these PMICs like MAX77686 has 3 clocks output, MAX776802 have two clock output and MAX77620 has one clock output.

Quoted 7 lines

Add clock binding details and DT example for the MAX77620.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

---

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
Reviewed-by on v2 4/4
#10 lore raw

Re: [PATCH V2 4/4] clk: max77686: Add support for MAX77620 clocks

In reply to Laxman Dewangan

Hello Laxman,

Quoted 11 lines · Laxman Dewangan

Maxim Max77620 has one 32KHz clock output and the clock HW IP used on this PMIC is same as what it is there in the MAX77686.

Add clock driver support for MAX77620 on the MAX77686 driver.

I already gave you my Reviewed-by for v1 but it seems you missed:

Quoted 13 lines

---
Changes from V1:
- Updated based on changes done in first patch.

---
 drivers/clk/Kconfig        |  7 ++++---
 drivers/clk/clk-max77686.c | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)
drivers/clk/Kconfig +0 -0
index 6afad74..d75f4c5 100644

drivers/clk/Kconfig config COMMON_CLK_WM831X · line 38

Quoted 10 lines
drivers/clk/Kconfig +3 -3
@@ -32,10 +32,11 @@ config COMMON_CLK_WM831X
 source "drivers/clk/versatile/Kconfig"
 
 config COMMON_CLK_MAX77686
-	tristate "Clock driver for Maxim 77686/77802 MFD"
-	depends on MFD_MAX77686
+	tristate "Clock driver for Maxim 77686/77802/MAX77620 MFD"
+	depends on MFD_MAX77686 || MFD_MAX77620
 	---help---
-	  This driver supports Maxim 77686/77802 crystal oscillator clock.
+	  This driver supports Maxim 77686/77802/MAX77620 crystal oscillator

And it seems you also missed the minor nit I mentioned in v1 about using 77620 instead of MAX77620 here for naming consistency with the other IP.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America
#12 lore raw

Re: [PATCH V2 4/4] clk: max77686: Add support for MAX77620 clocks

In reply to Krzysztof Kozlowski
Quoted 7 lines · Krzysztof Kozlowski

drivers/clk/Kconfig config COMMON_CLK_WM831X · line 35

Quoted 4 lines · Laxman Dewangan

config COMMON_CLK_MAX77686

drivers/clk/Kconfig +1 -2
-	tristate "Clock driver for Maxim 77686/77802 MFD"
-	depends on MFD_MAX77686
+	tristate "Clock driver for Maxim 77686/77802/MAX77620 MFD"

You missed Javier's comment here. Just
"Maxim 77686/77802/77620"

Sigh.. did not see this comment when going one by one.. really missed.. I will collect all Reviewed/ack/tested and will post V3 with fixing this.

Reviewed-by on v2 2/4
#5 lore raw

Re: [PATCH V2 2/4] clk: Combine DT binding doc for max77686 and max77802

In reply to Laxman Dewangan
Quoted 18 lines · Laxman Dewangan

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Define the common DT binding file for the clocks of Maxim PMICs MAX77686 and MAX77802. For this, remove the separate DT binding document file for maxim,max77802 and move all information to maxim,max77686 DT binding document.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

---
Changes from V1:
- Rewrite description to remvoe ref to driver.
- Taken care of comment from Krzysztof on the supported clocks and DT bindings.

Quoted 5 lines
---
 .../devicetree/bindings/clock/maxim,max77686.txt   | 82 ++++++++++++++++------
 .../devicetree/bindings/clock/maxim,max77802.txt   | 44 ------------
 2 files changed, 59 insertions(+), 67 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/maxim,max77802.txt

Best regards,
Krzysztof

Reviewed-by on v2 3/4
#8 lore raw

Re: [PATCH V2 3/4] clk: max77686: Add DT binding details for PMIC MAX77620

In reply to Laxman Dewangan
Quoted 17 lines · Laxman Dewangan

Maxim has used the same clock IP on multiple PMICs like MAX77686, MAX77802, MAX77620. Only differences are the number of clocks from these PMICs like MAX77686 has 3 clocks output, MAX776802 have two clock output and MAX77620 has one clock output.

Add clock binding details and DT example for the MAX77620.

CC Krzysztof Kozlowski <[email protected]>
CC Javier Martinez Canillas <[email protected]>

---
Changes from V1:
- Use proper comment for the ::::
- Added dt binding preprocessor file as maxim,max77620.h for max77620 inline with the other chip.
- Refer the dt binding header for the supported clock index.

Quoted 5 lines
---
 .../devicetree/bindings/clock/maxim,max77686.txt   | 52 +++++++++++++++++-----
 include/dt-bindings/clock/maxim,max77620.h         | 21 +++++++++
 2 files changed, 63 insertions(+), 10 deletions(-)
 create mode 100644 include/dt-bindings/clock/maxim,max77620.h

Best regards,
Krzysztof

Reviewed-by on v2 1/4
#2 lore raw

Re: [PATCH V2 1/4] clk: max77686: Combine Maxim max77686 and max77802 driver

In reply to Laxman Dewangan
Quoted 29 lines · Laxman Dewangan

The clock IP used on the Maxim PMICs max77686 and max77802 are same. The configuration of clock register is also same except the number of clocks.

Part of common code utilisation, there is 3 files for these chips clock driver, one for common and two files for driver registration.

Combine both drivers into single file and move common code into same common file reduces the 2 files and make max77686 and max77802 clock driver in single fine. This driver does not depends on the parent driver structure. The regmap handle is acquired through regmap APIs for the register access.

This combination of driver helps on adding clock driver for different Maxim PMICs which has similar clock IP like MAX77620 and MAX20024.

---
Changes from V1:
- Collected RB and TB from Javier.
- Change the max_gen to max77686.
- Rename structure and avoid duplication for reg and mask.
- Taken care of comment from Krzysztof on coding.

Quoted 11 lines
---
 drivers/clk/Kconfig        |  15 +--
 drivers/clk/Makefile       |   2 -
 drivers/clk/clk-max-gen.c  | 194 -----------------------------------
 drivers/clk/clk-max-gen.h  |  32 ------
 drivers/clk/clk-max77686.c | 244 ++++++++++++++++++++++++++++++++++++++++++---
 drivers/clk/clk-max77802.c |  96 ------------------
 6 files changed, 234 insertions(+), 349 deletions(-)
 delete mode 100644 drivers/clk/clk-max-gen.c
 delete mode 100644 drivers/clk/clk-max-gen.h
 delete mode 100644 drivers/clk/clk-max77802.c

Best regards,
Krzysztof

Reviewed-by on v2 4/4
#11 lore raw

Re: [PATCH V2 4/4] clk: max77686: Add support for MAX77620 clocks

In reply to Laxman Dewangan
Quoted 24 lines · Laxman Dewangan

Maxim Max77620 has one 32KHz clock output and the clock HW IP used on this PMIC is same as what it is there in the MAX77686.

Add clock driver support for MAX77620 on the MAX77686 driver.

---
Changes from V1:
- Updated based on changes done in first patch.

---
 drivers/clk/Kconfig        |  7 ++++---
 drivers/clk/clk-max77686.c | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)
drivers/clk/Kconfig +0 -0
index 6afad74..d75f4c5 100644

drivers/clk/Kconfig config COMMON_CLK_WM831X · line 35

Quoted 6 lines
drivers/clk/Kconfig +1 -2
@@ -32,10 +32,11 @@ config COMMON_CLK_WM831X
 source "drivers/clk/versatile/Kconfig"
 
 config COMMON_CLK_MAX77686
-	tristate "Clock driver for Maxim 77686/77802 MFD"
-	depends on MFD_MAX77686
+	tristate "Clock driver for Maxim 77686/77802/MAX77620 MFD"

You missed Javier's comment here. Just
"Maxim 77686/77802/77620"

drivers/clk/Kconfig config COMMON_CLK_WM831X · line 38

Quoted 4 lines
drivers/clk/Kconfig +2 -1
+	depends on MFD_MAX77686 || MFD_MAX77620
 	---help---
-	  This driver supports Maxim 77686/77802 crystal oscillator clock.
+	  This driver supports Maxim 77686/77802/MAX77620 crystal oscillator

Ditto

Beside that:

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH V2 4/4] clk: max77686: Add support for MAX77620 clocks

In reply to Laxman Dewangan
Quoted 7 lines · Laxman Dewangan
Quoted 5 lines · Krzysztof Kozlowski
Quoted 4 lines · Laxman Dewangan

config COMMON_CLK_MAX77686

drivers/clk/Kconfig +1 -2
-    tristate "Clock driver for Maxim 77686/77802 MFD"
-    depends on MFD_MAX77686
+    tristate "Clock driver for Maxim 77686/77802/MAX77620 MFD"
Quoted 5 lines
Quoted 2 lines

You missed Javier's comment here. Just
"Maxim 77686/77802/77620"

Sigh.. did not see this comment when going one by one.. really missed.. I will collect all Reviewed/ack/tested and will post V3 with fixing this.

No problem.

I think the device names could be in numerical order, so:
Maxim 77620/77686/77802

Best regards,
Krzysztof