Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1964016ybe; Thu, 12 Sep 2019 02:17:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyleroVe/IQeMXM0vtZZJYddFUIwYegDUNTzEdbZ4RNZm6qqbfbBGeFo+NHOaoqa0tFLCzR X-Received: by 2002:a17:906:308d:: with SMTP id 13mr14581964ejv.207.1568279876413; Thu, 12 Sep 2019 02:17:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568279876; cv=none; d=google.com; s=arc-20160816; b=fNRhvcuOom0+3Gw2Y4NwxrgAoElac9deu/IrHrDX/44xLCZ0oFPE7KFLyVSzyyODzz yUXTq2sxDljWk3//H6mBkcCtUbe8zmtA2ZNRwzUhYcc8LLGxsFC2Clgxkx8KXSqlSSt6 CDKT3UOdLvI5XwbIEbVlvXs9IOF7JLFwh1ltUIBdjiZ/RCKN1/Or1LMZn9Hjh5eEkb/D y9UCFCRva9pEXd3EFjCZOtrR6H7IEsupcC1G3Q20YpAyEOWaILJg0x7Gos9+lCcnYMsa 80fKN4511j7oMmyG/tlnPEHLfdSsry9fi6JXfQ+RuKKN5OKefjXF3CnORCuvijxi/Jwf iy2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=V7uM9fzlegp47TmhP3p8DAj2IeNP7sVXm68zda4cRyc=; b=QgyKyqf8+YwczP1HRDxrnqcyilQblqOtU7QFUNhMuqCfgy359LjXt6QH1mBk6I9Pin QZP/ZuS2iBeiWhTMNIjiW4EyFB1r/RmdQjZZL5obciHiZR9cwBQDrkJUSGXt0drfFnAW moada+oVDOlU85CLl8PER7ghVc4cLJy4qsJZEOEP6ql2r8gtnPeshIqCgckdWg0Ip6SS J+h63N+xD53TJAPSUwElEqbwyxI0rjFuxUm8hPnDqhftBJDV6wc8C2v+i8wBf94mq3a0 lYqPaUE9yySpWtxXNV3ZG12cImgK73NhHBr8Wdz71CItH29e2jHJa3e8FpJZa6UTSeBl M3lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qkfdRy4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si12725938ejl.225.2019.09.12.02.17.31; Thu, 12 Sep 2019 02:17:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qkfdRy4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730558AbfILJNd (ORCPT + 99 others); Thu, 12 Sep 2019 05:13:33 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:42811 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730185AbfILJNc (ORCPT ); Thu, 12 Sep 2019 05:13:32 -0400 Received: by mail-ed1-f68.google.com with SMTP id y91so23266446ede.9 for ; Thu, 12 Sep 2019 02:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=V7uM9fzlegp47TmhP3p8DAj2IeNP7sVXm68zda4cRyc=; b=qkfdRy4iBMhx3G3vR58+QDnJrA8TheGKTbhXrZr95qjpXP0dxFsNkVl4cjFIlhfF4S /CknzC2VNzeVRxeSsDBu8qDYKZdh9IQaFJQJeocKMMqmfsv5U/kEYW8jirVYnO6d46iI 2pjKIHetreYB/Q1R5KprT+urxRc6B43sFPq2Ui+QmQ0fX9e5Iktig0JaOWRXuS7MPpuE /i4p/QbHuEpoxLjj7tB5iJKiwKAzun9iRsevlijboqCWBHTPv5xa7jOdLVskpFp9ywRl 5uOryYEE9anEfk0HqK4w1VImJpJr25ECqBUDy2CtpEy/+2sz1JPN9N8u6xPt+KLruIPs gjEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=V7uM9fzlegp47TmhP3p8DAj2IeNP7sVXm68zda4cRyc=; b=SysAkojhHe1gWRYrrN1PSiHQDjOCk0ndUc+2vcXro4nw34ywDH81TXsOJ/DbnwGqN5 xAz9M275Llr44Gbc+i33y8r+iG056tK0IQsV+nGB0776Z5y9IjYH/IZBZsPO/L4OiJIS kh0C+htvuXXiTsMF1qUx7tTiuAyzxgUQS6+TqNRuB7cKEzIjBjGM/Rd1qNI5vsFKKavY SnRvLB9FZatYHwnOfq61oCzmlmcGWEihkGxMolicP89UOLb/FWHZtGVuijLZ4E1Rps+l Net8hWngx53tmx/ESBpWAdatGWew8FfGYM3Vm+aisnweZqEPU/jGOD+sAb5fJM15SeGl Dbkw== X-Gm-Message-State: APjAAAVmP79/TJLsJFYWe7BO3TRTR33+KAo+MVAqeunp1Qlc4qgovxOE XYtWDJV/NE4BhXPDnZFjjF4= X-Received: by 2002:a50:d089:: with SMTP id v9mr41974802edd.54.1568279609009; Thu, 12 Sep 2019 02:13:29 -0700 (PDT) Received: from ziggy.stardust ([37.223.145.190]) by smtp.gmail.com with ESMTPSA id l1sm4655235edc.11.2019.09.12.02.13.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Sep 2019 02:13:28 -0700 (PDT) Subject: Re: [PATCH] mfd: mt6360: add pmic mt6360 driver To: Gene Chen , gene_chen@richtek.com, Wilma.Wu@mediatek.com, Lee Jones Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Gene Chen References: <1568275837-3560-1-git-send-email-gene.chen.richtek@gmail.com> From: Matthias Brugger Openpgp: preference=signencrypt Autocrypt: addr=matthias.bgg@gmail.com; prefer-encrypt=mutual; keydata= mQINBFP1zgUBEAC21D6hk7//0kOmsUrE3eZ55kjc9DmFPKIz6l4NggqwQjBNRHIMh04BbCMY fL3eT7ZsYV5nur7zctmJ+vbszoOASXUpfq8M+S5hU2w7sBaVk5rpH9yW8CUWz2+ZpQXPJcFa OhLZuSKB1F5JcvLbETRjNzNU7B3TdS2+zkgQQdEyt7Ij2HXGLJ2w+yG2GuR9/iyCJRf10Okq gTh//XESJZ8S6KlOWbLXRE+yfkKDXQx2Jr1XuVvM3zPqH5FMg8reRVFsQ+vI0b+OlyekT/Xe 0Hwvqkev95GG6x7yseJwI+2ydDH6M5O7fPKFW5mzAdDE2g/K9B4e2tYK6/rA7Fq4cqiAw1+u EgO44+eFgv082xtBez5WNkGn18vtw0LW3ESmKh19u6kEGoi0WZwslCNaGFrS4M7OH+aOJeqK fx5dIv2CEbxc6xnHY7dwkcHikTA4QdbdFeUSuj4YhIZ+0QlDVtS1QEXyvZbZky7ur9rHkZvP ZqlUsLJ2nOqsmahMTIQ8Mgx9SLEShWqD4kOF4zNfPJsgEMB49KbS2o9jxbGB+JKupjNddfxZ HlH1KF8QwCMZEYaTNogrVazuEJzx6JdRpR3sFda/0x5qjTadwIW6Cl9tkqe2h391dOGX1eOA 1ntn9O/39KqSrWNGvm+1raHK+Ev1yPtn0Wxn+0oy1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BkDfBXlTWl46T/8291lEspDWe5YW1ZAH/HdCR1rQNZWjNCpB2 Cic58CYMD1rSonCnbfUeyZYNNhNHZosl4dl7f+am87Q2x3pK0DLSoJRxWb7vZB0uo9CzCSm3 I++aYozF25xQoT+7zCx2cQi33jwvnJAK1o4VlNx36RfrxzBqc1uZGzJBCQu48UjmUSsTwWC3 HpE/D9sM+xACs803lFUIZC5H62G059cCPAXKgsFpNMKmBAWweBkVJAisoQeX50OP+/11ArV0 cv+fOTfJj0/KwFXJaaYh3LUQNILLBNxkSrhCLl8dUg53IbHx4NfIAgqxLWGfXM8DY1aFdU79 pac005PuhxCWkKTJz3gCmznnoat4GCnL5gy/m0Qk45l4PFqwWXVLo9AQg2Kp3mlIFZ6fsEKI AN5hxlbNvNb9V2Zo5bFZjPWPFTxOteM0omUAS+QopwU0yPLLGJVf2iCmItHcUXI+r2JwH1CJ jrHWeQEI2ucSKsNa8FllDmG/fQ== Message-ID: Date: Thu, 12 Sep 2019 11:13:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1568275837-3560-1-git-send-email-gene.chen.richtek@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gene Chen, Please use ./scripts/get_maintainer.pl to find out which are the maintainer(s) for a specific series/patch. I added Lee Jones, who is the maintainer of the MTD subsystem. Right now I have no time to review the patches, sorry. Regards, Matthias On 12/09/2019 10:10, Gene Chen wrote: > From: Gene Chen > > --- > drivers/mfd/Kconfig | 12 ++ > drivers/mfd/Makefile | 1 + > drivers/mfd/mt6360-core.c | 463 ++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 476 insertions(+) > create mode 100644 drivers/mfd/mt6360-core.c > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index f129f96..a422c76 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -862,6 +862,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 include charger, flashlight, rgb led > + PMIC part include 2-channel BUCKs and 2-channel LDOs > + LDO part include 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 f026ada..77a8f0b 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile > @@ -241,6 +241,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 > obj-$(CONFIG_MFD_MT6397) += mt6397-core.o > > obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o > diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c > new file mode 100644 > index 0000000..d3580618 > --- /dev/null > +++ b/drivers/mfd/mt6360-core.c > @@ -0,0 +1,463 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019 MediaTek Inc. > + */ > + > +#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 (49) > +#define MT6360_QC30_STPDONE (51) > +#define MT6360_QC_VBUSDET_DONE (52) > +#define MT6360_HVDCP_DET (53) > +#define MT6360_CHGDETI (54) > +#define MT6360_DCDTI (55) > +/* REG 7 -> 56 ~ 63 */ > +#define MT6360_FOD_DONE_EVT (56) > +#define MT6360_FOD_OV_EVT (57) > +#define MT6360_CHRDET_UVP_EVT (58) > +#define MT6360_CHRDET_OVP_EVT (59) > +#define MT6360_CHRDET_EXT_EVT (60) > +#define MT6360_FOD_LR_EVT (61) > +#define MT6360_FOD_HR_EVT (62) > +#define MT6360_FOD_DISCHG_FAIL_EVT (63) > +/* REG 8 -> 64 ~ 71 */ > +#define MT6360_USBID_EVT (64) > +#define MT6360_APWDTRST_EVT (65) > +#define MT6360_EN_EVT (66) > +#define MT6360_QONB_RST_EVT (67) > +#define MT6360_MRSTB_EVT (68) > +#define MT6360_OTP_EVT (69) > +#define MT6360_VDDAOV_EVT (70) > +#define MT6360_SYSUV_EVT (71) > +/* REG 9 -> 72 ~ 79 */ > +#define MT6360_FLED_STRBPIN_EVT (72) > +#define MT6360_FLED_TORPIN_EVT (73) > +#define MT6360_FLED_TX_EVT (74) > +#define MT6360_FLED_LVF_EVT (75) > +#define MT6360_FLED2_SHORT_EVT (78) > +#define MT6360_FLED1_SHORT_EVT (79) > +/* REG 10 -> 80 ~ 87 */ > +#define MT6360_FLED2_STRB_EVT (80) > +#define MT6360_FLED1_STRB_EVT (81) > +#define MT6360_FLED2_STRB_TO_EVT (82) > +#define MT6360_FLED1_STRB_TO_EVT (83) > +#define MT6360_FLED2_TOR_EVT (84) > +#define MT6360_FLED1_TOR_EVT (85) > +/* REG 11 -> 88 ~ 95 */ > +/* REG 12 -> 96 ~ 103 */ > +#define MT6360_BUCK1_PGB_EVT (96) > +#define MT6360_BUCK1_OC_EVT (100) > +#define MT6360_BUCK1_OV_EVT (101) > +#define MT6360_BUCK1_UV_EVT (102) > +/* REG 13 -> 104 ~ 111 */ > +#define MT6360_BUCK2_PGB_EVT (104) > +#define MT6360_BUCK2_OC_EVT (108) > +#define MT6360_BUCK2_OV_EVT (109) > +#define MT6360_BUCK2_UV_EVT (110) > +/* REG 14 -> 112 ~ 119 */ > +#define MT6360_LDO1_OC_EVT (113) > +#define MT6360_LDO2_OC_EVT (114) > +#define MT6360_LDO3_OC_EVT (115) > +#define MT6360_LDO5_OC_EVT (117) > +#define MT6360_LDO6_OC_EVT (118) > +#define MT6360_LDO7_OC_EVT (119) > +/* REG 15 -> 120 ~ 127 */ > +#define MT6360_LDO1_PGB_EVT (121) > +#define MT6360_LDO2_PGB_EVT (122) > +#define MT6360_LDO3_PGB_EVT (123) > +#define MT6360_LDO5_PGB_EVT (125) > +#define MT6360_LDO6_PGB_EVT (126) > +#define MT6360_LDO7_PGB_EVT (127) > + > +#define MT6360_REGMAP_IRQ_REG(_irq_evt) \ > + REGMAP_IRQ_REG(_irq_evt, (_irq_evt) / 8, BIT((_irq_evt) % 8)) > + > +#define MT6360_MFD_CELL(_name) \ > + { \ > + .name = #_name, \ > + .of_compatible = "mediatek," #_name, \ > + .num_resources = ARRAY_SIZE(_name##_resources), \ > + .resources = _name##_resources, \ > + } > + > +static const struct regmap_irq mt6360_pmu_irqs[] = { > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_TREG_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_AICR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_MIVR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_PWR_RDY_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_BATSYSUV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED_CHG_VINOVP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_VSYSUV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_VSYSOV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_VBATOV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_VBUSOV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_WD_PMU_DET), > + MT6360_REGMAP_IRQ_REG(MT6360_WD_PMU_DONE), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_TMRI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_ADPBADI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_RVPI), > + MT6360_REGMAP_IRQ_REG(MT6360_OTPI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_AICCMEASL), > + MT6360_REGMAP_IRQ_REG(MT6360_CHGDET_DONEI), > + MT6360_REGMAP_IRQ_REG(MT6360_WDTMRI), > + MT6360_REGMAP_IRQ_REG(MT6360_SSFINISHI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_RECHGI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_TERMI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_IEOCI), > + MT6360_REGMAP_IRQ_REG(MT6360_PUMPX_DONEI), > + MT6360_REGMAP_IRQ_REG(MT6360_CHG_TREG_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BAT_OVP_ADC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_TYPEC_OTP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_ADC_WAKEUP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_ADC_DONEI), > + MT6360_REGMAP_IRQ_REG(MT6360_BST_BATUVI), > + MT6360_REGMAP_IRQ_REG(MT6360_BST_VBUSOVI), > + MT6360_REGMAP_IRQ_REG(MT6360_BST_OLPI), > + MT6360_REGMAP_IRQ_REG(MT6360_ATTACH_I), > + MT6360_REGMAP_IRQ_REG(MT6360_DETACH_I), > + MT6360_REGMAP_IRQ_REG(MT6360_QC30_STPDONE), > + MT6360_REGMAP_IRQ_REG(MT6360_QC_VBUSDET_DONE), > + MT6360_REGMAP_IRQ_REG(MT6360_HVDCP_DET), > + MT6360_REGMAP_IRQ_REG(MT6360_CHGDETI), > + MT6360_REGMAP_IRQ_REG(MT6360_DCDTI), > + MT6360_REGMAP_IRQ_REG(MT6360_FOD_DONE_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FOD_OV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHRDET_UVP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHRDET_OVP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_CHRDET_EXT_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FOD_LR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FOD_HR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FOD_DISCHG_FAIL_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_USBID_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_APWDTRST_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_EN_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_QONB_RST_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_MRSTB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_OTP_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_VDDAOV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_SYSUV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED_STRBPIN_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED_TORPIN_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED_TX_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED_LVF_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED2_SHORT_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED1_SHORT_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED2_STRB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED1_STRB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED2_STRB_TO_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED1_STRB_TO_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED2_TOR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_FLED1_TOR_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK1_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK1_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK1_OV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK1_UV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK2_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK2_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK2_OV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_BUCK2_UV_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO1_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO2_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO3_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO5_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO6_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO7_OC_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO1_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO2_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO3_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO5_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO6_PGB_EVT), > + MT6360_REGMAP_IRQ_REG(MT6360_LDO7_PGB_EVT), > +}; > + > +static int mt6360_pmu_handle_post_irq(void *irq_drv_data) > +{ > + struct mt6360_pmu_info *mpi = irq_drv_data; > + > + return regmap_update_bits(mpi->regmap, > + MT6360_PMU_IRQ_SET, MT6360_IRQ_RETRIG, MT6360_IRQ_RETRIG); > +} > + > +static const struct regmap_irq_chip mt6360_pmu_irq_chip = { > + .irqs = mt6360_pmu_irqs, > + .num_irqs = ARRAY_SIZE(mt6360_pmu_irqs), > + .num_regs = MT6360_PMU_IRQ_REGNUM, > + .mask_base = MT6360_PMU_CHG_MASK1, > + .status_base = MT6360_PMU_CHG_IRQ1, > + .ack_base = MT6360_PMU_CHG_IRQ1, > + .init_ack_masked = true, > + .use_ack = true, > + .handle_post_irq = mt6360_pmu_handle_post_irq, > +}; > + > +static const struct regmap_config mt6360_pmu_regmap_config = { > + .reg_bits = 8, > + .val_bits = 8, > + .max_register = MT6360_PMU_MAXREG, > +}; > + > +static const struct resource mt6360_adc_resources[] = { > + DEFINE_RES_IRQ_NAMED(MT6360_ADC_DONEI, "adc_donei"), > +}; > + > +static const struct resource mt6360_chg_resources[] = { > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_TREG_EVT, "chg_treg_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_PWR_RDY_EVT, "pwr_rdy_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_BATSYSUV_EVT, "chg_batsysuv_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_VSYSUV_EVT, "chg_vsysuv_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_VSYSOV_EVT, "chg_vsysov_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_VBATOV_EVT, "chg_vbatov_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_VBUSOV_EVT, "chg_vbusov_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_AICCMEASL, "chg_aiccmeasl"), > + DEFINE_RES_IRQ_NAMED(MT6360_WDTMRI, "wdtmri"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_RECHGI, "chg_rechgi"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_TERMI, "chg_termi"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHG_IEOCI, "chg_ieoci"), > + DEFINE_RES_IRQ_NAMED(MT6360_PUMPX_DONEI, "pumpx_donei"), > + DEFINE_RES_IRQ_NAMED(MT6360_ATTACH_I, "attach_i"), > + DEFINE_RES_IRQ_NAMED(MT6360_CHRDET_EXT_EVT, "chrdet_ext_evt"), > +}; > + > +static const struct resource mt6360_led_resources[] = { > + DEFINE_RES_IRQ_NAMED(MT6360_FLED_CHG_VINOVP_EVT, "fled_chg_vinovp_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_FLED_LVF_EVT, "fled_lvf_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_FLED2_SHORT_EVT, "fled2_short_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_FLED1_SHORT_EVT, "fled1_short_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_FLED2_STRB_TO_EVT, "fled2_strb_to_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_FLED1_STRB_TO_EVT, "fled1_strb_to_evt"), > +}; > + > +static const struct resource mt6360_pmic_resources[] = { > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_PGB_EVT, "buck1_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_OC_EVT, "buck1_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_OV_EVT, "buck1_ov_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK1_UV_EVT, "buck1_uv_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_PGB_EVT, "buck2_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_OC_EVT, "buck2_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_OV_EVT, "buck2_ov_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_BUCK2_UV_EVT, "buck2_uv_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO6_OC_EVT, "ldo6_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO7_OC_EVT, "ldo7_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO6_PGB_EVT, "ldo6_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO7_PGB_EVT, "ldo7_pgb_evt"), > +}; > + > +static const struct resource mt6360_ldo_resources[] = { > + DEFINE_RES_IRQ_NAMED(MT6360_LDO1_OC_EVT, "ldo1_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO2_OC_EVT, "ldo2_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO3_OC_EVT, "ldo3_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO5_OC_EVT, "ldo5_oc_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO1_PGB_EVT, "ldo1_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO2_PGB_EVT, "ldo2_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO3_PGB_EVT, "ldo3_pgb_evt"), > + DEFINE_RES_IRQ_NAMED(MT6360_LDO5_PGB_EVT, "ldo5_pgb_evt"), > +}; > + > +static const struct mfd_cell mt6360_devs[] = { > + MT6360_MFD_CELL(mt6360_adc), > + MT6360_MFD_CELL(mt6360_chg), > + MT6360_MFD_CELL(mt6360_led), > + MT6360_MFD_CELL(mt6360_pmic), > + MT6360_MFD_CELL(mt6360_ldo), > + /* tcpc dev */ > + { > + .name = "mt6360_tcpc", > + .of_compatible = "mediatek,mt6360_tcpc", > + }, > +}; > + > +static const unsigned short mt6360_slave_addr[MT6360_SLAVE_MAX] = { > + MT6360_PMU_SLAVEID, > + MT6360_PMIC_SLAVEID, > + MT6360_LDO_SLAVEID, > + MT6360_TCPC_SLAVEID, > +}; > + > +static int mt6360_pmu_probe(struct i2c_client *client, > + const struct i2c_device_id *id) > +{ > + struct mt6360_pmu_info *mpi; > + unsigned int reg_data = 0; > + int i, ret; > + > + mpi = devm_kzalloc(&client->dev, sizeof(*mpi), GFP_KERNEL); > + if (!mpi) > + return -ENOMEM; > + mpi->dev = &client->dev; > + i2c_set_clientdata(client, mpi); > + > + /* regmap regiser */ > + mpi->regmap = devm_regmap_init_i2c(client, &mt6360_pmu_regmap_config); > + if (IS_ERR(mpi->regmap)) { > + dev_err(&client->dev, "regmap register fail\n"); > + return PTR_ERR(mpi->regmap); > + } > + /* chip id check */ > + ret = regmap_read(mpi->regmap, MT6360_PMU_DEV_INFO, ®_data); > + if (ret < 0) { > + dev_err(&client->dev, "device not found\n"); > + return ret; > + } > + if ((reg_data & CHIP_VEN_MASK) != CHIP_VEN_MT6360) { > + dev_err(&client->dev, "not mt6360 chip\n"); > + return -ENODEV; > + } > + mpi->chip_rev = reg_data & CHIP_REV_MASK; > + /* irq register */ > + memcpy(&mpi->irq_chip, &mt6360_pmu_irq_chip, sizeof(mpi->irq_chip)); > + mpi->irq_chip.name = dev_name(&client->dev); > + mpi->irq_chip.irq_drv_data = mpi; > + ret = devm_regmap_add_irq_chip(&client->dev, mpi->regmap, client->irq, > + IRQF_TRIGGER_FALLING, 0, &mpi->irq_chip, > + &mpi->irq_data); > + if (ret < 0) { > + dev_err(&client->dev, "regmap irq chip add fail\n"); > + return ret; > + } > + /* new i2c slave device */ > + for (i = 0; i < MT6360_SLAVE_MAX; i++) { > + if (mt6360_slave_addr[i] == client->addr) { > + mpi->i2c[i] = client; > + continue; > + } > + mpi->i2c[i] = i2c_new_dummy(client->adapter, > + mt6360_slave_addr[i]); > + if (!mpi->i2c[i]) { > + dev_err(&client->dev, "new i2c dev [%d] fail\n", i); > + ret = -ENODEV; > + goto out; > + } > + i2c_set_clientdata(mpi->i2c[i], mpi); > + } > + /* mfd cell register */ > + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_AUTO, > + mt6360_devs, ARRAY_SIZE(mt6360_devs), NULL, > + 0, regmap_irq_get_domain(mpi->irq_data)); > + if (ret < 0) { > + dev_err(&client->dev, "mfd add cells fail\n"); > + goto out; > + } > + dev_info(&client->dev, "Successfully probed\n"); > + return 0; > +out: > + while (--i >= 0) { > + if (mpi->i2c[i]->addr == client->addr) > + continue; > + i2c_unregister_device(mpi->i2c[i]); > + } > + return ret; > +} > + > +static int mt6360_pmu_remove(struct i2c_client *client) > +{ > + struct mt6360_pmu_info *mpi = i2c_get_clientdata(client); > + int i; > + > + for (i = 0; i < MT6360_SLAVE_MAX; i++) { > + if (mpi->i2c[i]->addr == client->addr) > + continue; > + i2c_unregister_device(mpi->i2c[i]); > + } > + return 0; > +} > + > +static int __maybe_unused mt6360_pmu_suspend(struct device *dev) > +{ > + struct i2c_client *i2c = to_i2c_client(dev); > + > + if (device_may_wakeup(dev)) > + enable_irq_wake(i2c->irq); > + return 0; > +} > + > +static int __maybe_unused mt6360_pmu_resume(struct device *dev) > +{ > + > + struct i2c_client *i2c = to_i2c_client(dev); > + > + if (device_may_wakeup(dev)) > + disable_irq_wake(i2c->irq); > + return 0; > +} > + > +static SIMPLE_DEV_PM_OPS(mt6360_pmu_pm_ops, > + mt6360_pmu_suspend, mt6360_pmu_resume); > + > +static const struct of_device_id __maybe_unused mt6360_pmu_of_id[] = { > + { .compatible = "mediatek,mt6360_pmu", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, mt6360_pmu_of_id); > + > +static const struct i2c_device_id mt6360_pmu_id[] = { > + { "mt6360_pmu", 0 }, > + {}, > +}; > +MODULE_DEVICE_TABLE(i2c, mt6360_pmu_id); > + > +static struct i2c_driver mt6360_pmu_driver = { > + .driver = { > + .name = "mt6360_pmu", > + .owner = THIS_MODULE, > + .pm = &mt6360_pmu_pm_ops, > + .of_match_table = of_match_ptr(mt6360_pmu_of_id), > + }, > + .probe = mt6360_pmu_probe, > + .remove = mt6360_pmu_remove, > + .id_table = mt6360_pmu_id, > +}; > +module_i2c_driver(mt6360_pmu_driver); > + > +MODULE_AUTHOR("CY_Huang "); > +MODULE_DESCRIPTION("MT6360 PMU I2C Driver"); > +MODULE_LICENSE("GPL"); > +MODULE_VERSION("1.0.0"); >