Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5634726ybi; Tue, 4 Jun 2019 09:33:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyULPdlMDKMz8zT+/TRRzIl4S3Q2B1BRsdMgmUU8ex/MBO/M4O9TVP5K4JYcyZSgw9gEkAu X-Received: by 2002:a17:90a:7107:: with SMTP id h7mr37456647pjk.38.1559665981620; Tue, 04 Jun 2019 09:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559665981; cv=none; d=google.com; s=arc-20160816; b=TRaGw5QY6/AMg1DgzeBq80ZWEfvV7YhcH0ZIr/50wd4pJFJAgrlEoFKJf4aJRpnk+4 6/reRZkdx68lLJnnEW7uIMwty3KXxJG4L8/1AmkCRgoZu4Lrq6jcMHGyy6YpCRkXqRxp V7Bt9aZ2DpeThe625h/NP8OqtaD2NOXZKaiHH3vYrRROnoiPr3W5Zx3WWMGR4pEpJMgk bhD6ko//c8hTnifA2InMkVWe5ZtKvyK9fbh+k5PLN27o3q4LoJxBQhVK0Ol1QkfFwyCt WwQ5KQ17Cm1DmS78vtWFZTSTQ8mfHBLlEp3Wv83lJEF3O+po6VU9WfzW3kIshgNk4NBT GfnQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TrJrO+4WVaDcBJRtqTErrFHqZWoDLU/J3nYOQSosNEY=; b=C+r8D+3jD5ev1XyzfJXneOg86LfUVP1RXffJxQ6s96i3gyykEKgZry4pDmKFGHvYiO ZyW3YijNYH8DIpsBT3w9kVchD/ryAQoPKJOvHEK+kUrnFNlV95Pdos8qlGQvxf5RoCmL /zKjSW2g44vNKsU6aoV0QKt5OGCJ0rK8h72vi+kD7lYcyBM49gUVLT9KKeHfDcEn1KyP 1Mu81nC3mT5f4b+LTJttYeelTW3zsLVYF5+osTyI6TSnY2TeMmwJFP9nYW4OfIF0mln9 jffS/9V9wMXCn85m/hJqXFq7UDUY7UvUxntcDBXrgkrn88QubGNwjKMZxetCOFLMD5xv EuAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RGvzKAya; 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 c83si25319796pfc.246.2019.06.04.09.32.44; Tue, 04 Jun 2019 09:33:01 -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=RGvzKAya; 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 S1728090AbfFDQbI (ORCPT + 99 others); Tue, 4 Jun 2019 12:31:08 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44541 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727822AbfFDQaM (ORCPT ); Tue, 4 Jun 2019 12:30:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id w13so16484986wru.11; Tue, 04 Jun 2019 09:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TrJrO+4WVaDcBJRtqTErrFHqZWoDLU/J3nYOQSosNEY=; b=RGvzKAyaP8Nn+tVEfpqKFWUsv0KutBvUK6HHUt60gDfdFjLe+liHA6E3qMJj3yiaBk A18rCVtZgu60LIWyGbYuDG7sY6ybggpciaLV4xKTFNX5lbNqGIOaiYNS8UDc5HCGWcYC 8S6+OYjOjuMgYQDj74AxTq+/s8rl0Wiz4NUTvvSj7i6WHDs7h2rvdCzdnob6+QmdlfMd Y3npXQef+x5jCNbLuCnLotNeabJwrW1Xfyi9SrUNalmYjeAM5FJNyCDp8zd1SYxdl188 KB6255DdPms6iwIkIFcFFdc/F8/pC71XdXkPnCvqlyveK5E4o6/Ka0M0wvhz+U2kcmD9 2OOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TrJrO+4WVaDcBJRtqTErrFHqZWoDLU/J3nYOQSosNEY=; b=HJ3gsNWZuZpQcrIcxFa8qtNhYhEsdMuPO4a2GruDrEiKr6W+IYGWJFi63UwlOVq5Tu 4ebvRSvGdrZl4ow6mere7vjT8D925LElY8TvJFB9y97IGOFDzGfdPBgfDYhIBFj+sKqL aa3XCAyywCZrrr15DXfnYeJfIObqE7wq5Uq17aiftZYbzJBwhQuFGV+cX850i1ynN7dN 8+0ii5jR5QYC1W/XuACjWJXg5RDKMFNUxEC/IinCah5WI+KrgQhkkXxfspUt6SyXkNeu aSXMJUa6z3BX3TaCZXtPhVR9drQ4YROE6S/YlR70ULAtFLn4NZOte/x/pESA4ETQPRlh l8OQ== X-Gm-Message-State: APjAAAWBc+UNDsOy+6umUnLbKNnvyYvl+4xL6qfHf1o724Lh0pYilhG2 5M5+0iE9c8/VWAqPzjA9BIQ= X-Received: by 2002:adf:e8cb:: with SMTP id k11mr20704308wrn.244.1559665809997; Tue, 04 Jun 2019 09:30:09 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:1f1:d0f0::4e2b:d7ca]) by smtp.gmail.com with ESMTPSA id y12sm15108176wrh.40.2019.06.04.09.30.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 04 Jun 2019 09:30:08 -0700 (PDT) From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= To: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Subject: [PATCH v4 04/13] media: rc: sunxi: Add RXSTA bits definition Date: Tue, 4 Jun 2019 18:29:50 +0200 Message-Id: <20190604162959.29199-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190604162959.29199-1-peron.clem@gmail.com> References: <20190604162959.29199-1-peron.clem@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) /* RX FIFO Get Available Counter */ #define REG_RXSTA_GET_AC(val) (((val) >> 8) & (ir->fifo_size * 2 - 1)) /* Clear all interrupt status value */ @@ -119,7 +125,7 @@ static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id) /* clean all pending statuses */ writel(status | REG_RXSTA_CLEARALL, ir->base + SUNXI_IR_RXSTA_REG); - if (status & (REG_RXINT_RAI_EN | REG_RXINT_RPEI_EN)) { + if (status & (REG_RXSTA_RA | REG_RXSTA_RPE)) { /* How many messages in fifo */ rc = REG_RXSTA_GET_AC(status); /* Sanity check */ @@ -135,9 +141,9 @@ static irqreturn_t sunxi_ir_irq(int irqno, void *dev_id) } } - if (status & REG_RXINT_ROI_EN) { + if (status & REG_RXSTA_ROI) { ir_raw_event_reset(ir->rc); - } else if (status & REG_RXINT_RPEI_EN) { + } else if (status & REG_RXSTA_RPE) { ir_raw_event_set_idle(ir->rc, true); ir_raw_event_handle(ir->rc); } -- 2.20.1