public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Abylay Ospan <aospan@netup.ru>
To: mchehab@infradead.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/5 v2] cx23885: Altera FPGA CI interface reworked.
Date: Sun, 02 Jan 2011 16:16:10 +0000	[thread overview]
Message-ID: <4D20A4CA.4020601@netup.ru> (raw)

It decreases I2C traffic.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
---
  drivers/media/video/cx23885/cx23885-dvb.c |   18 +++++++++---------
  1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-dvb.c 
b/drivers/media/video/cx23885/cx23885-dvb.c
index 6c144f7..53c2b6d 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -620,29 +620,29 @@ int netup_altera_fpga_rw(void *device, int flag, 
int data, int read)
  {
  	struct cx23885_dev *dev = (struct cx23885_dev *)device;
  	unsigned long timeout = jiffies + msecs_to_jiffies(1);
-	int mem = 0;
+	uint32_t mem = 0;
  -	cx_set(MC417_RWD, ALT_RD | ALT_WR | ALT_CS);
+	mem = cx_read(MC417_RWD);
  	if (read)
  		cx_set(MC417_OEN, ALT_DATA);
  	else {
  		cx_clear(MC417_OEN, ALT_DATA);/* D0-D7 out */
-		mem = cx_read(MC417_RWD);
  		mem &= ~ALT_DATA;
  		mem |= (data & ALT_DATA);
-		cx_write(MC417_RWD, mem);
  	}
   	if (flag)
-		cx_set(MC417_RWD, ALT_AD_RG);/* ADDR */
+		mem |= ALT_AD_RG;
  	else
-		cx_clear(MC417_RWD, ALT_AD_RG);/* VAL */
+		mem &= ~ALT_AD_RG;
  -	cx_clear(MC417_RWD, ALT_CS);/* ~CS */
+	mem &= ~ALT_CS;
  	if (read)
-		cx_clear(MC417_RWD, ALT_RD);
+		mem = (mem & ~ALT_RD) | ALT_WR;
  	else
-		cx_clear(MC417_RWD, ALT_WR);
+		mem = (mem & ~ALT_WR) | ALT_RD;
+
+	cx_write(MC417_RWD, mem);  /* start RW cycle */
   	for (;;) {
  		mem = cx_read(MC417_RWD);
-- 
1.7.1


                 reply	other threads:[~2011-01-02 16:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D20A4CA.4020601@netup.ru \
    --to=aospan@netup.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox