Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6738182ybi; Wed, 5 Jun 2019 05:45:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiAFbZZmKTv4yPK7epZ+Cldgo/ArGj++Dh6P1QbSrK9Oio2mlN4LMk2wRY68Xi+x6tIG2O X-Received: by 2002:a63:135d:: with SMTP id 29mr4053328pgt.38.1559738745905; Wed, 05 Jun 2019 05:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559738745; cv=none; d=google.com; s=arc-20160816; b=nr04QolPCFQx5A2qDouK9s74RWeP6XJ6HEAPQJ7tlL1JWaPRFHKOo/+61I6RXOK+mu WnE5ugz/fA+SkaP8zWCyZuPXb1U3VNBtrept/+kS5Sl3yn561PMJK+x59Hbxr48LTtwQ 9fvCsO0eP6/wCy1XEcRfjq+TeZedbhSNkyVTzlD+mxHjNTynkAyMMttEpX9aR/v9Yrwi Vzid+5+k9moJzGF/+S2llNvTYNkjc8BbYkIxjvWmXzvDwKkXS7NCzzlquKlQ6DLKnA+r sBWrRH/kiAfdTSe+jJVzGQUq7KDCtd/ngY/0Fj1+Oerv6mAqtyNly8zz9NTkZX3TbGyi 54Cg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xi2EvDvX1o5a9FG2uTIFVqZhlEAgWZPRI+I6e9eKWDA=; b=A9maHAlWngf4ywL75Vki4zs5BpQO4u7Rug40HcvjA+Wza7O1AU7q54HMi+xBCaSlyf Jrd16tfd4aFmP30rbeyUk2JMt3sEDLyvJ3tvxHgx8QDUrXu/f9VxooWTcyeh/HdLhlQ9 RvP2kDTeUOYB4FU5fATON51FpcLhjgclTFR9l8nNZwLnSAXupLkHLI1F6gACVTfvcLrx rONnwl8ZeS3A6Ga0nKSiGjb842WshVo4b6f94yei4Dsuxr+eSlw1C5EQIMuNImDrknwg GJC+2nI7EzqHOL5WZb86gpyHdfOwvHLuww59slBtjcqS0KI6t+i8SLr4T7nJd44tSCJw KnEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Fv7/k7a9"; 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 p20si22899563plr.179.2019.06.05.05.45.28; Wed, 05 Jun 2019 05:45:45 -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="Fv7/k7a9"; 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 S1727769AbfFEMoT (ORCPT + 99 others); Wed, 5 Jun 2019 08:44:19 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:43116 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbfFEMoS (ORCPT ); Wed, 5 Jun 2019 08:44:18 -0400 Received: by mail-yb1-f195.google.com with SMTP id n145so9240140ybg.10; Wed, 05 Jun 2019 05:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xi2EvDvX1o5a9FG2uTIFVqZhlEAgWZPRI+I6e9eKWDA=; b=Fv7/k7a9r4amkCrKI+VwwbKV67Pg6mruQZNeLTqihnSgQaggIJUtMx2rmAl7PlxGml 2oi+ybtMM6nhyiSI/NAC2ikNhDm3JyvTAE0bdi1xoAraGXyIOKAeCWEw0kx9plShaYRu 73rVdnZAwsTNw0ZRvAxgqjUnXIZlCozkOXdibujrNjp+Gp3G2WadNfhkTXtXKd/uJRRJ n6pM5OFFQ5CxiUlQA1nKorGAvXCzdE2ZD/bdQ4VzyST4XyV2Av0wV2g8rCKI1KYP4/hx kSTvIi37vF429N2y3Y9rNWMwKfj1MA2RhMoOaSexaLVUKGjvAv46Sx+HHcT1HHu19vnB UhwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=xi2EvDvX1o5a9FG2uTIFVqZhlEAgWZPRI+I6e9eKWDA=; b=su3MDhQ356W+7gmQhfK6zB5yTGxWffb7FGABado5hQpecfZCZDi5CHMr40/LRmGj4i ibJNiA4jTAVZv3j1FexHW7a51K8KwQ8sGVCzYeVQrvokcfap7VN8lbt0VoP0PRIG0/H7 j3G0jDzeyBQb0L/cCT6VJy4QcpY207EUFjB1LFCDre2LI+inqHTicJOgnRZ9tAezE6AX e5/OoUNhEBNnRE1yMRZs2BrECnu5yyV+pPbP6kWwpqgzrguxIb6BRhQMDAEMGHjswFOm nVGFB1iBoS+PDJPXDEngVvWmqBJafXRFDGiNTcMfmBIcNCPzb3PTXHkIaKJvdYiWi+A1 /e8w== X-Gm-Message-State: APjAAAVBqDKAO25hTVR8cPd1CDbOZR/OFCH6qibVRceFtXTLFYkbVTz0 OIqCtZamU6o/YLthfZT/b08pSIxoCr9iLp/L4uo= X-Received: by 2002:a25:9b47:: with SMTP id u7mr18656221ybo.396.1559738657457; Wed, 05 Jun 2019 05:44:17 -0700 (PDT) MIME-Version: 1.0 References: <20190604162959.29199-1-peron.clem@gmail.com> <20190604162959.29199-5-peron.clem@gmail.com> <20190605095141.psrq6mhk63zto77s@flea> In-Reply-To: <20190605095141.psrq6mhk63zto77s@flea> From: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Date: Wed, 5 Jun 2019 14:44:06 +0200 Message-ID: Subject: Re: [PATCH v4 04/13] media: rc: sunxi: Add RXSTA bits definition To: Maxime Ripard Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media@vger.kernel.org, devicetree , linux-arm-kernel , linux-kernel , linux-sunxi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Wed, 5 Jun 2019 at 11:51, Maxime Ripard wrot= e: > > On Tue, Jun 04, 2019 at 06:29:50PM +0200, Cl=C3=A9ment P=C3=A9ron 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=C3=A9ment P=C3=A9ron > > --- > > 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. Regards, Cl=C3=A9ment > > Maxime > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com