Received: by 10.192.165.148 with SMTP id m20csp1380480imm; Wed, 2 May 2018 20:55:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoVcf4EaPZrdvw1ndiEh4LQYYhki57TqluOughsTItJHRAPoVEdKiFUz9Bo9tgRPRQsQ3Hs X-Received: by 2002:a63:2c13:: with SMTP id s19-v6mr3789584pgs.427.1525319700133; Wed, 02 May 2018 20:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525319700; cv=none; d=google.com; s=arc-20160816; b=yzb61yjB3krCZUxsdC2fU+keYXTYH8Wc1Fx6oT60yMgnlwbYTGAI2Ammm6LXGw+gt5 JEzBQqh15CztH5LTn2aICg1F5J5a3eTBsE3HiKqzYPuS7YGiUqf3ZlDzlRkFweLDyS6y SMjTuDeqZ9qsZTfv/7vgFemt65sPonCiDcuYSKy6CeONwRIayf8JONa8handOxIirMkA 0T7IT5RtMipoYb6OnmYcXZrGBk6XTp7imfXglZEnSkm0jNNex4kDtNguXMJxBKs4O9Kz 57KbP56hGsoH7/4mRuhr6VHZNlcw2KBdK2kq/RgKPyPp5F/B7SwRngROSjnB1qRPmTsT u6Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=SBNR0YUo9NjliWCtkx6C9FcDU55s0Ot3KpmwLQOC4uk=; b=ucwZ7daDKDBFIfBJHrD4x1yZSIV64nLKA/KsZC9JEERHUpcz1uThvcy36MFLaXtYE7 SvjFWKyz2s2li6pUcNsyGHsNHK9wfusjVBFdfPGPfXy00PlKY45DPSOiLoPs3vWiBXFU Ua/tNm3LF13BbLAhfjmV79PJcYkiy+urWN5iYk2jxsoR+AR2UpAC6e0AKq5QFSxjYQ0a XK/ARGdfOREexSvSWqrAg9kCv+VdFV86T5yDh03Z4D8x5K4jFhQIHA82aKY0Xp/QP8R+ FUKETtHTaS1xSJDnZtpDf4sq2yZTvOjt3yMDc/F14BZhaJY0YpTUOKabd0nCWsL9jy8s QZqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8-v6si13038445plb.244.2018.05.02.20.54.46; Wed, 02 May 2018 20:55:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156AbeECDx7 (ORCPT + 99 others); Wed, 2 May 2018 23:53:59 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:37120 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751872AbeECDxz (ORCPT ); Wed, 2 May 2018 23:53:55 -0400 X-UUID: b33b96efee7f4ae190b89e7d56616a22-20180503 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2083420776; Thu, 03 May 2018 11:53:52 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 3 May 2018 11:53:50 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 3 May 2018 11:53:49 +0800 Message-ID: <1525319630.14792.91.camel@mtkswgap22> Subject: Re: [PATCH V4 7/8] soc: mediatek: pwrap: add mt6351 for mt6797 SoCs From: Sean Wang To: CC: Rob Herring , Mark Rutland , Matthias Brugger , Catalin Marinas , Will Deacon , Chenglin Xu , , , , Chen Zhong , Christophe Jaillet , "shailendra . v" , , , , Date: Thu, 3 May 2018 11:53:50 +0800 In-Reply-To: <20180502092112.3991-8-argus.lin@mediatek.com> References: <20180502092112.3991-1-argus.lin@mediatek.com> <20180502092112.3991-8-argus.lin@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Argus On Wed, 2018-05-02 at 17:21 +0800, argus.lin@mediatek.com wrote: > From: Argus Lin > > mt6351 is a new power management IC and it is > used for mt6797 SoCs. We need to add mt6351_regs for > pmic register mapping and pmic_mt6351 for > register accessing by regmap. > suggest line wrapping closely at 75 columns > Signed-off-by: Argus Lin > --- > drivers/soc/mediatek/mtk-pmic-wrap.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c > index 285bfa76249f..26076900eee0 100644 > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c > @@ -152,6 +152,21 @@ static const u32 mt6397_regs[] = { > [PWRAP_DEW_CIPHER_SWRST] = 0xbc24, > }; > > +static const u32 mt6351_regs[] = { > + [PWRAP_DEW_DIO_EN] = 0x02F2, > + [PWRAP_DEW_READ_TEST] = 0x02F4, > + [PWRAP_DEW_WRITE_TEST] = 0x02F6, > + [PWRAP_DEW_CRC_EN] = 0x02FA, > + [PWRAP_DEW_CRC_VAL] = 0x02FC, > + [PWRAP_DEW_CIPHER_KEY_SEL] = 0x0300, > + [PWRAP_DEW_CIPHER_IV_SEL] = 0x0302, > + [PWRAP_DEW_CIPHER_EN] = 0x0304, > + [PWRAP_DEW_CIPHER_RDY] = 0x0306, > + [PWRAP_DEW_CIPHER_MODE] = 0x0308, > + [PWRAP_DEW_CIPHER_SWRST] = 0x030A, > + [PWRAP_DEW_RDDMY_NO] = 0x030C, > +}; > + trim the unused registers if any > enum pwrap_regs { > PWRAP_MUX_SEL, > PWRAP_WRAP_EN, > @@ -684,6 +699,7 @@ static int mt8135_regs[] = { > > enum pmic_type { > PMIC_MT6323, > + PMIC_MT6351, > PMIC_MT6380, > PMIC_MT6397, > }; > @@ -1150,6 +1166,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) > 0x1); > break; > case PMIC_MT6323: > + case PMIC_MT6351: > pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_EN], > 0x1); > break; > @@ -1435,6 +1452,15 @@ static const struct pwrap_slv_type pmic_mt6397 = { > .pwrap_write = pwrap_write16, > }; > > +static const struct pwrap_slv_type pmic_mt6351 = { > + .dew_regs = mt6351_regs, > + .type = PMIC_MT6351, > + .regmap = &pwrap_regmap_config16, > + .caps = 0, the caps should be PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO | PWRAP_SLV_CAP_SECURITY, otherwise, the registers you defined here cannot be accessed by its function. > + .pwrap_read = pwrap_read16, > + .pwrap_write = pwrap_write16, > +}; > + > static const struct of_device_id of_slave_match_tbl[] = { > { > .compatible = "mediatek,mt6323", > @@ -1449,6 +1475,9 @@ static const struct of_device_id of_slave_match_tbl[] = { > .compatible = "mediatek,mt6397", > .data = &pmic_mt6397, > }, { > + .compatible = "mediatek,mt6351", > + .data = &pmic_mt6351, > + }, { need to be sorted din alphabetical order > /* sentinel */ > } > };