Re: [PATCH v10] mfd: mt6360: add pmic mt6360 driver

2020-06-02 Thread Lee Jones
On Tue, 02 Jun 2020, Matthias Brugger wrote:

> 
> 
> On 02/06/2020 10:28, Lee Jones wrote:
> > On Tue, 02 Jun 2020, Gene Chen wrote:
> > 
> >> From: Gene Chen 
> >>
> >> Add MFD driver for mt6360 pmic chip include Battery Charger/
> >> USB_PD/Flash, LED/RGB and LED/LDO/Buck
> >>
> >> Signed-off-by: Gene Chen 
> >> Signed-off-by: Lee Jones 
> > 
> > I did not sign this off.
> > 
> 
> You are right, you provided your Acked-for-MFD-by and took an earlier version 
> of
> the patch [1]. But as this didn't show up in linux-next I suppose you dropped 
> it
> afterwards because of kbuild test errors (deducing from the changes log).

If the builders can see it, -next can pull from it.

It was never dropped.

> I suppose if this errors are fixed now, we should be fine :)

Indeed.  No more build errors. :)

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


Re: [PATCH v10] mfd: mt6360: add pmic mt6360 driver

2020-06-02 Thread Matthias Brugger



On 02/06/2020 10:28, Lee Jones wrote:
> On Tue, 02 Jun 2020, Gene Chen wrote:
> 
>> From: Gene Chen 
>>
>> Add MFD driver for mt6360 pmic chip include Battery Charger/
>> USB_PD/Flash, LED/RGB and LED/LDO/Buck
>>
>> Signed-off-by: Gene Chen 
>> Signed-off-by: Lee Jones 
> 
> I did not sign this off.
> 

You are right, you provided your Acked-for-MFD-by and took an earlier version of
the patch [1]. But as this didn't show up in linux-next I suppose you dropped it
afterwards because of kbuild test errors (deducing from the changes log).

I suppose if this errors are fixed now, we should be fine :)

Regards,
Matthias

[1]
https://lkml.kernel.org/lkml/1587641093-25441-1-git-send-email-gene.chen.rich...@gmail.com/T/#m75e8ee81950ee34e155eccd2dc5ad9b1d2cef40a

>> ---
>>  drivers/mfd/Kconfig|  12 ++
>>  drivers/mfd/Makefile   |   1 +
>>  drivers/mfd/mt6360-core.c  | 424 
>> +
>>  include/linux/mfd/mt6360.h | 240 +
>>  4 files changed, 677 insertions(+)
>>  create mode 100644 drivers/mfd/mt6360-core.c
>>  create mode 100644 include/linux/mfd/mt6360.h
>>
>> changelogs between v1 & v2
>> - include missing header file
>>
>> changelogs between v2 & v3
>> - add changelogs
>>
>> changelogs between v3 & v4
>> - fix Kconfig description
>> - replace mt6360_pmu_info with mt6360_pmu_data
>> - replace probe with probe_new
>> - remove unnecessary irq_chip variable
>> - remove annotation
>> - replace MT6360_MFD_CELL with OF_MFD_CELL
>>
>> changelogs between v4 & v5
>> - remove unnecessary parse dt function
>> - use devm_i2c_new_dummy_device
>> - add base-commit message
>>
>> changelogs between v5 & v6
>> - review return value
>> - remove i2c id_table
>> - use GPL license v2
>>
>> changelogs between v6 & v7
>> - add author description
>> - replace MT6360_REGMAP_IRQ_REG by REGMAP_IRQ_REG_LINE
>> - remove mt6360-private.h
>>
>> changelogs between v7 & v8
>> - fix kbuild auto reboot by include interrupt header
>>
>> changelogs between v8 & v9
>> - fix GPL license out of date
>> - add commit message about Acked-for-MFD-by
>>
>> changelogs between v9 & v10
> 
> v9 of this patch is already applied.
> 
> You cannot send a v10.
> 
>> - fix duplicate define of kbuild test reboot initializer-overrides
> 
> I fixed this already.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/commit/?h=for-mfd-next=098c4adf249c198519a4abebe482b1e6b8c50e47
> 
>> - sync commit message format
> 


Re: [PATCH v10] mfd: mt6360: add pmic mt6360 driver

2020-06-02 Thread Lee Jones
On Tue, 02 Jun 2020, Gene Chen wrote:

> From: Gene Chen 
> 
> Add MFD driver for mt6360 pmic chip include Battery Charger/
> USB_PD/Flash, LED/RGB and LED/LDO/Buck
> 
> Signed-off-by: Gene Chen 
> Signed-off-by: Lee Jones 

I did not sign this off.

> ---
>  drivers/mfd/Kconfig|  12 ++
>  drivers/mfd/Makefile   |   1 +
>  drivers/mfd/mt6360-core.c  | 424 
> +
>  include/linux/mfd/mt6360.h | 240 +
>  4 files changed, 677 insertions(+)
>  create mode 100644 drivers/mfd/mt6360-core.c
>  create mode 100644 include/linux/mfd/mt6360.h
> 
> changelogs between v1 & v2
> - include missing header file
> 
> changelogs between v2 & v3
> - add changelogs
> 
> changelogs between v3 & v4
> - fix Kconfig description
> - replace mt6360_pmu_info with mt6360_pmu_data
> - replace probe with probe_new
> - remove unnecessary irq_chip variable
> - remove annotation
> - replace MT6360_MFD_CELL with OF_MFD_CELL
> 
> changelogs between v4 & v5
> - remove unnecessary parse dt function
> - use devm_i2c_new_dummy_device
> - add base-commit message
> 
> changelogs between v5 & v6
> - review return value
> - remove i2c id_table
> - use GPL license v2
> 
> changelogs between v6 & v7
> - add author description
> - replace MT6360_REGMAP_IRQ_REG by REGMAP_IRQ_REG_LINE
> - remove mt6360-private.h
> 
> changelogs between v7 & v8
> - fix kbuild auto reboot by include interrupt header
> 
> changelogs between v8 & v9
> - fix GPL license out of date
> - add commit message about Acked-for-MFD-by
> 
> changelogs between v9 & v10

v9 of this patch is already applied.

You cannot send a v10.

> - fix duplicate define of kbuild test reboot initializer-overrides

I fixed this already.

https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/commit/?h=for-mfd-next=098c4adf249c198519a4abebe482b1e6b8c50e47

> - sync commit message format

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


[PATCH v10] mfd: mt6360: add pmic mt6360 driver

2020-06-01 Thread Gene Chen
From: Gene Chen 

Add MFD driver for mt6360 pmic chip include Battery Charger/
USB_PD/Flash, LED/RGB and LED/LDO/Buck

Signed-off-by: Gene Chen 
Signed-off-by: Lee Jones 
---
 drivers/mfd/Kconfig|  12 ++
 drivers/mfd/Makefile   |   1 +
 drivers/mfd/mt6360-core.c  | 424 +
 include/linux/mfd/mt6360.h | 240 +
 4 files changed, 677 insertions(+)
 create mode 100644 drivers/mfd/mt6360-core.c
 create mode 100644 include/linux/mfd/mt6360.h

changelogs between v1 & v2
- include missing header file

changelogs between v2 & v3
- add changelogs

changelogs between v3 & v4
- fix Kconfig description
- replace mt6360_pmu_info with mt6360_pmu_data
- replace probe with probe_new
- remove unnecessary irq_chip variable
- remove annotation
- replace MT6360_MFD_CELL with OF_MFD_CELL

changelogs between v4 & v5
- remove unnecessary parse dt function
- use devm_i2c_new_dummy_device
- add base-commit message

changelogs between v5 & v6
- review return value
- remove i2c id_table
- use GPL license v2

changelogs between v6 & v7
- add author description
- replace MT6360_REGMAP_IRQ_REG by REGMAP_IRQ_REG_LINE
- remove mt6360-private.h

changelogs between v7 & v8
- fix kbuild auto reboot by include interrupt header

changelogs between v8 & v9
- fix GPL license out of date
- add commit message about Acked-for-MFD-by

changelogs between v9 & v10
- fix duplicate define of kbuild test reboot initializer-overrides
- sync commit message format

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 0a59249..3f8a0a0 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -870,6 +870,18 @@ config MFD_MAX8998
  additional drivers must be enabled in order to use the functionality
  of the device.
 
+config MFD_MT6360
+   tristate "Mediatek MT6360 SubPMIC"
+   select MFD_CORE
+   select REGMAP_I2C
+   select REGMAP_IRQ
+   depends on I2C
+   help
+ Say Y here to enable MT6360 PMU/PMIC/LDO functional support.
+ PMU part includes Charger, Flashlight, RGB LED
+ PMIC part includes 2-channel BUCKs and 2-channel LDOs
+ LDO part includes 4-channel LDOs
+
 config MFD_MT6397
tristate "MediaTek MT6397 PMIC Support"
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f935d10..01fa149 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -239,6 +239,7 @@ obj-$(CONFIG_INTEL_SOC_PMIC)+= intel-soc-pmic.o
 obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o
 obj-$(CONFIG_INTEL_SOC_PMIC_CHTWC) += intel_soc_pmic_chtwc.o
 obj-$(CONFIG_INTEL_SOC_PMIC_CHTDC_TI)  += intel_soc_pmic_chtdc_ti.o
+obj-$(CONFIG_MFD_MT6360)   += mt6360-core.o
 mt6397-objs:= mt6397-core.o mt6397-irq.o
 obj-$(CONFIG_MFD_MT6397)   += mt6397.o
 obj-$(CONFIG_INTEL_SOC_PMIC_MRFLD) += intel_soc_pmic_mrfld.o
diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c
new file mode 100644
index 000..db8cdf5
--- /dev/null
+++ b/drivers/mfd/mt6360-core.c
@@ -0,0 +1,424 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020 MediaTek Inc.
+ *
+ * Author: Gene Chen 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* reg 0 -> 0 ~ 7 */
+#define MT6360_CHG_TREG_EVT(4)
+#define MT6360_CHG_AICR_EVT(5)
+#define MT6360_CHG_MIVR_EVT(6)
+#define MT6360_PWR_RDY_EVT (7)
+/* REG 1 -> 8 ~ 15 */
+#define MT6360_CHG_BATSYSUV_EVT(9)
+#define MT6360_FLED_CHG_VINOVP_EVT (11)
+#define MT6360_CHG_VSYSUV_EVT  (12)
+#define MT6360_CHG_VSYSOV_EVT  (13)
+#define MT6360_CHG_VBATOV_EVT  (14)
+#define MT6360_CHG_VBUSOV_EVT  (15)
+/* REG 2 -> 16 ~ 23 */
+/* REG 3 -> 24 ~ 31 */
+#define MT6360_WD_PMU_DET  (25)
+#define MT6360_WD_PMU_DONE (26)
+#define MT6360_CHG_TMRI(27)
+#define MT6360_CHG_ADPBADI (29)
+#define MT6360_CHG_RVPI(30)
+#define MT6360_OTPI(31)
+/* REG 4 -> 32 ~ 39 */
+#define MT6360_CHG_AICCMEASL   (32)
+#define MT6360_CHGDET_DONEI(34)
+#define MT6360_WDTMRI  (35)
+#define MT6360_SSFINISHI   (36)
+#define MT6360_CHG_RECHGI  (37)
+#define MT6360_CHG_TERMI   (38)
+#define MT6360_CHG_IEOCI   (39)
+/* REG 5 -> 40 ~ 47 */
+#define MT6360_PUMPX_DONEI (40)
+#define MT6360_BAT_OVP_ADC_EVT (41)
+#define MT6360_TYPEC_OTP_EVT   (42)
+#define MT6360_ADC_WAKEUP_EVT  (43)
+#define MT6360_ADC_DONEI   (44)
+#define MT6360_BST_BATUVI  (45)
+#define MT6360_BST_VBUSOVI (46)
+#define MT6360_BST_OLPI(47)
+/* REG 6 -> 48 ~ 55 */
+#define MT6360_ATTACH_I(48)
+#define MT6360_DETACH_I