Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7143269imm; Tue, 24 Jul 2018 09:03:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpes8aVyPiBS8fNCI+/GxCyMmqdwl+LzXQNOWA1Ls2XSkf6ZuTQTE5sjHPFfWF5AhNBw5tn+ X-Received: by 2002:a62:b40c:: with SMTP id h12-v6mr18483379pfn.18.1532448227567; Tue, 24 Jul 2018 09:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532448227; cv=none; d=google.com; s=arc-20160816; b=tz5uJ0zWMa7UBghBpTtwfNIl1JNoYaYy5/bO9yfMD2PODVnYbYc8HOcjtTsvN8LL7f gzUma903/FL7+5pNh61MMJsRw4boFk5S2aJ+HTy26y5VPBwVZ/5S7RKXUvAbpLPC8ERe DkdmtU/Xxa9Ewdp5qIvzSpKnM942P9IoevunsXVxOCL1mufN9huZZS4istTN5oR/xxzL JYJ4RV9sCZlTHn8YA4C1kZ0GLI+AJ2/Zo0PSF43Z45+lanuECruOPp9XpPnTBFUvg3pU k/ysa8LvRB2xiRc6DbpvwLw0QX/qQ0CGZJLgGMLiJzjS/jDI1qjzdjorR3bQAcfGCqVH okIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=/siGCe5n7M/rxbzmYpu28Q4Wocj6/qr9vl4FIyoA/3s=; b=nC3gtKtMb1i2vReMufSu1CDvw+kDeArAscXU0e87RuVnAgWQ0th00p7QzIvmejIIOn gnPmMMP2Z0LNJjTbdoPFAKLV8df08K9aXNfpUWqQXDWs5rF2xy5jsPqbI5uW8ygT2UPq jYnsEtKWpZyD/K92VgRZIqQQpr0M/osGc4/yfTSJpOHfWZhSExy42CfOvKkddacsHDcg k1T5uw4CHRmTXtQ6aHQ0DlnsEOYdqBJ3R7htcCWay52s2w9Z1yWnXHfTwDB/aOCvFX81 kWpxOuA2iYq38e20xd3qT8Se15n7S/zJi1thILCp4ibdHcZQndwCdU64WZtwXVa8Dw9j /fSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j8bxJLlB; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10-v6si11956937pgb.510.2018.07.24.09.03.32; Tue, 24 Jul 2018 09:03:47 -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=@kernel.org header.s=default header.b=j8bxJLlB; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388593AbeGXRI7 (ORCPT + 99 others); Tue, 24 Jul 2018 13:08:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:49210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388464AbeGXRI7 (ORCPT ); Tue, 24 Jul 2018 13:08:59 -0400 Received: from localhost (unknown [171.61.90.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE8432088E; Tue, 24 Jul 2018 16:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532448110; bh=lRaTDOaAEEOMshC7cwZp7kz+U0prMg2/7vx7+guroUY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j8bxJLlBU9OyebRBaGm45N44spzwLlV/uNeSmksk72ZXG6+ViGfEM+f3K/ZAtwcpT 09Eo2mZDsMavLmCrKdCH9EiKSYWWCi0RtbFv7aRXo10tFZVt0nt54x3Jwzkb+9zN8s 6tBG2cYmcKj95QsedrIjnTnNu5sxHti2CeZej4e0= Date: Tue, 24 Jul 2018 21:31:40 +0530 From: Vinod To: Paul Cercueil Cc: Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel , Mathieu Malaterre , Daniel Silsby , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH v3 07/18] dmaengine: dma-jz4780: Add support for the JZ4770 SoC Message-ID: <20180724160140.GI3661@vkoul-mobl> References: <20180721110643.19624-1-paul@crapouillou.net> <20180721110643.19624-8-paul@crapouillou.net> <20180724133229.GG3661@vkoul-mobl> <1532444695.2610.1@smtp.crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1532444695.2610.1@smtp.crapouillou.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24-07-18, 17:04, Paul Cercueil wrote: > Hi Vinod, > > Le mar. 24 juil. 2018 ? 15:32, Vinod a ?crit : > > On 21-07-18, 13:06, Paul Cercueil wrote: > > > +static inline void jz4780_dma_chan_enable(struct jz4780_dma_dev > > > *jzdma, > > > + unsigned int chn) > > > > right justified and aligned with preceding please. While adding new > > code to a existing driver it is a good idea to conform to existing style > > OK. > > > > +{ > > > + if (jzdma->version == ID_JZ4770) > > > + jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKES, BIT(chn)); > > > +} > > > + > > > +static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev > > > *jzdma, > > > + unsigned int chn) > > > +{ > > > + if (jzdma->version == ID_JZ4770) > > > + jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKEC, BIT(chn)); > > > > so if another version has this feature we would do: > > if (jzdma->version == ID_JZ4770) || > > if (jzdma->version == ID_JZXXXX)) > > > > and so on.. why not add a value, clk_enable in the description and use > > that. For each controller it is set to true or false > > I agree with what you said in your other answers. > However here I still need to check the "version", because on JZ4725B and > JZ4770+ > the way to start/stop each DMA channel's clock is different, so I can't use > a boolean sure describe the behavior and use that. Versions is not a very scalable way.. -- ~Vinod