Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7204988ybi; Wed, 5 Jun 2019 13:07:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGukSx7g/qmyTvab8vFVlxzlkkWR0VmxDMZiFmKIlc+rxgqxh8ZMHdaKtfFTU5Dqi8w8uP X-Received: by 2002:a62:7552:: with SMTP id q79mr28818856pfc.71.1559765251435; Wed, 05 Jun 2019 13:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559765251; cv=none; d=google.com; s=arc-20160816; b=AkF18zKxiD6PMa6AglhTtj/qrxDgE5tLGWeGlDnJlYmeUmiSTf3MA4ZCSgrSavSnTH 12SscjdBCkCr0mLKw6Nc62dWhiZBWkjB/mrYC+MQUtPK4Wfy1WK1SqJJsnEHIu7Nw1MS KCLfG+pkfja7w697da+A4GYgPrghWHOVZKLKZw6MOFNwNf6ZxQrf9fqqYTlUbaVCThdn rPvEaEIpLyGD8PLomu3IWgahqBh+6zt6DVGne8ySNTtA3pWE0mBxnTqq2e6j/6S13OnB qnL/i9nCJj0Ska5vEW2kKtndEGjoyfzMsKb6/vXbg9+kdXdeOl3HMcA8FRWBFhr5P4ME YOmw== 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; bh=N2hS31fi62mBMdFdIvtzL+1mhBsnMmUc2KwhgQT/eRI=; b=xT2JXkpFxgjibgnaztVB4n1+FevnhdbjUKJyQswrCsg2hy9yKFnOtFegruUC3kbJEx EGiRgR3xVvYTX3JxFgFlPykTJ2fJW0Jc4qFSzOfC/WZbG5L22q92w7yHzN5/rSs9BKPC WrJ4qXUIb8oZffTPJ8r+PDY0TWofok9KY0RnYWIhNtPoaZhs/cy+7emzVTPrHUhCEhEc xGNYXUYUXTDfSCIjupgkSw20udEZVCl76mu8dKDldjvL+yF2ZN5J+YNfzRKom2p/Z+rL VLzBKSCaPoqfnO1JkG4Cv5YAmFNoXgIkySgIzmwYsAYZb22vs/6tKbcxZUlPncIOCR6g 9Cpw== 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 f11si27460925pgs.335.2019.06.05.13.07.14; Wed, 05 Jun 2019 13:07:31 -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 S1726572AbfFEUAc (ORCPT + 99 others); Wed, 5 Jun 2019 16:00:32 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38191 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbfFEUAb (ORCPT ); Wed, 5 Jun 2019 16:00:31 -0400 X-Originating-IP: 90.89.68.76 Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) (Authenticated sender: maxime.ripard@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id EA63FC0006; Wed, 5 Jun 2019 20:00:21 +0000 (UTC) Date: Wed, 5 Jun 2019 22:00:20 +0200 From: Maxime Ripard To: =?utf-8?B?Q2zDqW1lbnQgUMOpcm9u?= Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, devicetree , linux-arm-kernel , linux-kernel , linux-sunxi Subject: Re: [PATCH v4 04/13] media: rc: sunxi: Add RXSTA bits definition Message-ID: <20190605200020.tmyom3lg3inu6vvf@flea> References: <20190604162959.29199-1-peron.clem@gmail.com> <20190604162959.29199-5-peron.clem@gmail.com> <20190605095141.psrq6mhk63zto77s@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 05, 2019 at 02:44:06PM +0200, Cl?ment P?ron wrote: > Hi Maxime, > > On Wed, 5 Jun 2019 at 11:51, Maxime Ripard wrote: > > > > On Tue, Jun 04, 2019 at 06:29:50PM +0200, Cl?ment P?ron wrote: > > > We are using RXINT bits definition when looking at RXSTA register. > > > > > > These bits are equal but it's not really proper. > > > > > > Introduce the RXSTA bits and use them to have coherency. > > > > > > Signed-off-by: Cl?ment P?ron > > > --- > > > drivers/media/rc/sunxi-cir.c | 18 ++++++++++++------ > > > 1 file changed, 12 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c > > > index 0504ebfc831f..572bd2257d35 100644 > > > --- a/drivers/media/rc/sunxi-cir.c > > > +++ b/drivers/media/rc/sunxi-cir.c > > > @@ -48,11 +48,11 @@ > > > > > > /* Rx Interrupt Enable */ > > > #define SUNXI_IR_RXINT_REG 0x2C > > > -/* Rx FIFO Overflow */ > > > +/* Rx FIFO Overflow Interrupt Enable */ > > > #define REG_RXINT_ROI_EN BIT(0) > > > -/* Rx Packet End */ > > > +/* Rx Packet End Interrupt Enable */ > > > #define REG_RXINT_RPEI_EN BIT(1) > > > -/* Rx FIFO Data Available */ > > > +/* Rx FIFO Data Available Interrupt Enable */ > > > #define REG_RXINT_RAI_EN BIT(4) > > > > > > /* Rx FIFO available byte level */ > > > @@ -60,6 +60,12 @@ > > > > > > /* Rx Interrupt Status */ > > > #define SUNXI_IR_RXSTA_REG 0x30 > > > +/* Rx FIFO Overflow */ > > > +#define REG_RXSTA_ROI BIT(0) > > > +/* Rx Packet End */ > > > +#define REG_RXSTA_RPE BIT(1) > > > +/* Rx FIFO Data Available */ > > > +#define REG_RXSTA_RA BIT(4) > > > > I'm fine with it on principle, but if the consistency needs to be > > maintained then we could just reuse the above defines > > There is no comment why we can reuse them, they can also be some wrong > case for example the RXINT_DRQ_EN bit is not present in RXSTA and same > for STAT bit present in RXSTA and not present in RXINT. > > I have discover and read this code a month ago and this logic is > really not obvious nor explain. > > Maybe this hack could be done when we will introduce a quirks, but for > the moment I really think that it's more proper and readable to > introduce them properly. I don't think we understood each other :) I was talking about having something like #define REG_RXSTA_ROI REG_RXINT_ROI_EN Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com