From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756611AbcBWBtf (ORCPT ); Mon, 22 Feb 2016 20:49:35 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:16348 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbcBWBtd (ORCPT ); Mon, 22 Feb 2016 20:49:33 -0500 Subject: Re: [PATCH 1/2] reset: hisilicon: Add hi6220 media part of reset To: Philipp Zabel References: <1456109114-93675-1-git-send-email-puck.chen@hisilicon.com> <1456136612.5148.22.camel@pengutronix.de> CC: , , , , From: Chen Feng Message-ID: <56CBB9C4.9070900@hisilicon.com> Date: Tue, 23 Feb 2016 09:45:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1456136612.5148.22.camel@pengutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.193.64] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.56CBB9CF.00D8,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4946129c40d4705b4a9db430f6ad179a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for review. On 2016/2/22 18:23, Philipp Zabel wrote: > Hi Chen, > > Am Montag, den 22.02.2016, 10:45 +0800 schrieb Chen Feng: >> Signed-off-by: Chen Feng >> Signed-off-by: Xinliang Liu >> --- >> drivers/reset/hisilicon/hi6220_reset.c | 122 ++++++++++++++++++++++++--------- >> 1 file changed, 90 insertions(+), 32 deletions(-) >> +/* peritheral ctrl regs > > I assume this is supposed to mean "peripheral" ... > >> + */ >> +#define PERITH_ASSERT_OFFSET 0x300 > > ... and this PERIPH_ASSERT_OFFSET, and so on. > Yes... >> +#define PERITH_DEASSERT_OFFSET 0x304 >> +#define PERITH_MAX_INDEX 0x509 >> +} > > If you make these take the struct reset_controller_dev *rc_dev as first > parameter, you can drop the two functions below an just add a second set > of const struct reset_control_ops for the media resets. > okay. >> static int hi6220_reset_assert(struct reset_controller_dev *rc_dev, >> unsigned long idx) >> { >> struct hi6220_reset_data *data = to_reset_data(rc_dev); >> + struct regmap *regmap = data->regmap; >> >> data->rc_dev.ops = &hi6220_reset_ops; > > With media and periph resets in separate ops structures, you could chose > here already: > > if (type == MEDIA) > data->rc_dev.ops = &hi6220_media_reset_ops; > else > data->rc_dev.ops = &hi6220_peripheral_reset_ops; > I will add two ops next version. >> - data->rc_dev.of_node = pdev->dev.of_node; >> + data->rc_dev.of_node = np; >> + if (type == MEDIA) >> + data->rc_dev.nr_resets = MEDIA_MAX_INDEX; >> + else >> + data->rc_dev.nr_resets = PERITH_MAX_INDEX; >> >> reset_controller_register(&data->rc_dev); >> >> @@ -89,9 +139,17 @@ static int hi6220_reset_probe(struct platform_device *pdev) >> } >> >> static const struct of_device_id hi6220_reset_match[] = { >> - { .compatible = "hisilicon,hi6220-sysctrl" }, >> - { }, >> + { >> + .compatible = "hisilicon,hi6220-sysctrl", >> + .data = (void *)PERITHERAL, >> + }, >> + { >> + .compatible = "hisilicon,hi6220-mediactrl", >> + .data = (void *)MEDIA, >> + }, >> + { /* sentinel */ }, >> }; >> +MODULE_DEVICE_TABLE(of, hi6220_reset_match); >> >> static struct platform_driver hi6220_reset_driver = { >> .probe = hi6220_reset_probe, > > regards > Philipp > > > . >