Skip to contentSkip to conversation

IR patches for 2.6.37-rc1

GIT PULL New Jarod Wilson 3 participants 5 messages Oct 8, 2010 – Oct 15, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hey Mauro,

I've queued up some lirc fixes and a couple of patches that add a new ir-core driver for the Nuvoton w836x7hg Super I/O integrated CIR functionality. All but the Kconfig re-sorting patch have been posted to linux-media for review, but I'm hoping they can all get merged in time for the 2.6.37-rc1 window, and any additional review feedback can be taken care of with follow-up patches.

The following changes since commit b9a1211dff08aa73fc26db66980ec0710a6c7134:

V4L/DVB: Staging: cx25821: fix braces and space coding style issues (2010-10-07 15:37:27 -0300)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jarod/linux-2.6-lirc.git staging

Jarod Wilson (5):
IR: add driver for Nuvoton w836x7hg integrated CIR
nuvoton-cir: add proper rx fifo overrun handling IR/Kconfig: sort hardware entries alphabetically IR/lirc: further ioctl portability fixups staging/lirc: ioctl portability fixups

 drivers/media/IR/Kconfig             |   27 +-
 drivers/media/IR/Makefile            |    1 +
 drivers/media/IR/ir-lirc-codec.c     |   10 +-
 drivers/media/IR/lirc_dev.c          |   14 +-
 drivers/media/IR/nuvoton-cir.c       | 1237 ++++++++++++++++++++++++++++++++++
 drivers/media/IR/nuvoton-cir.h       |  408 +++++++++++
 drivers/staging/lirc/lirc_it87.c     |   17 +-
 drivers/staging/lirc/lirc_ite8709.c  |    6 +-
 drivers/staging/lirc/lirc_parallel.c |   32 +-
 drivers/staging/lirc/lirc_serial.c   |   21 +-
 drivers/staging/lirc/lirc_sir.c      |   21 +-
 include/media/lirc_dev.h             |    4 +-
 12 files changed, 1727 insertions(+), 71 deletions(-)
 create mode 100644 drivers/media/IR/nuvoton-cir.c
 create mode 100644 drivers/media/IR/nuvoton-cir.h
Signature · 2 lines
Jarod Wilson
[email protected]
#1 lore raw
Quoted 9 lines · Jarod Wilson

Hey Mauro,

I've queued up some lirc fixes and a couple of patches that add a new ir-core driver for the Nuvoton w836x7hg Super I/O integrated CIR functionality. All but the Kconfig re-sorting patch have been posted to linux-media for review, but I'm hoping they can all get merged in time for the 2.6.37-rc1 window, and any additional review feedback can be taken care of with follow-up patches.

Quoted 3 lines

The following changes since commit b9a1211dff08aa73fc26db66980ec0710a6c7134:

 V4L/DVB: Staging: cx25821: fix braces and space coding style issues (2010-10-07 15:37:27 -0300)

Minor update to the pull req to fully wire up compat ioctls and fixup some error messages in lirc_dev:

The following changes since commit 81d64d12e11a3cca995e6c752e4bd2898959ed0a:

V4L/DVB: cx231xx: remove some unused functions (2010-10-07 21:05:52 -0300)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jarod/linux-2.6-lirc.git staging

Jarod Wilson (7):
IR: add driver for Nuvoton w836x7hg integrated CIR
nuvoton-cir: add proper rx fifo overrun handling IR/Kconfig: sort hardware entries alphabetically IR/lirc: further ioctl portability fixups staging/lirc: ioctl portability fixups
lirc: wire up .compat_ioctl to main ioctl handler
lirc_dev: fixup error messages w/missing newlines

 drivers/media/IR/Kconfig             |   27 +-
 drivers/media/IR/Makefile            |    1 +
 drivers/media/IR/ir-lirc-codec.c     |   13 +-
 drivers/media/IR/lirc_dev.c          |   35 +-
 drivers/media/IR/nuvoton-cir.c       | 1237 ++++++++++++++++++++++++++++++++++
 drivers/media/IR/nuvoton-cir.h       |  408 +++++++++++
 drivers/staging/lirc/lirc_it87.c     |   20 +-
 drivers/staging/lirc/lirc_ite8709.c  |    6 +-
 drivers/staging/lirc/lirc_parallel.c |   35 +-
 drivers/staging/lirc/lirc_serial.c   |   24 +-
 drivers/staging/lirc/lirc_sir.c      |   24 +-
 drivers/staging/lirc/lirc_zilog.c    |    3 +
 include/media/lirc_dev.h             |    4 +-
 13 files changed, 1759 insertions(+), 78 deletions(-)
 create mode 100644 drivers/media/IR/nuvoton-cir.c
 create mode 100644 drivers/media/IR/nuvoton-cir.h
Signature · 2 lines
Jarod Wilson
[email protected]
#2 lore raw
Quoted 17 lines · Jarod Wilson
Quoted 9 lines · Jarod Wilson

Hey Mauro,

I've queued up some lirc fixes and a couple of patches that add a new ir-core driver for the Nuvoton w836x7hg Super I/O integrated CIR functionality. All but the Kconfig re-sorting patch have been posted to linux-media for review, but I'm hoping they can all get merged in time for the 2.6.37-rc1 window, and any additional review feedback can be taken care of with follow-up patches.

Quoted 3 lines

The following changes since commit b9a1211dff08aa73fc26db66980ec0710a6c7134:

 V4L/DVB: Staging: cx25821: fix braces and space coding style issues (2010-10-07 15:37:27 -0300)

Minor update to the pull req to fully wire up compat ioctls and fixup some error messages in lirc_dev:

Quoted 6 lines

The following changes since commit 81d64d12e11a3cca995e6c752e4bd2898959ed0a:

V4L/DVB: cx231xx: remove some unused functions (2010-10-07 21:05:52 -0300)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jarod/linux-2.6-lirc.git staging

Just tacked on two minor streamzap patches, including the one from Dan Carpenter that fixes an overflow with timeout values. The other streamzap patch just makes Dan's patch not create a line > 80 chars, more or less (renames STREAMZAP_FOO defines to SZ_FOO).

Dan Carpenter (1):
[patch -next] V4L/DVB: IR/streamzap: fix usec to nsec conversion

Jarod Wilson (8):
IR: add driver for Nuvoton w836x7hg integrated CIR
nuvoton-cir: add proper rx fifo overrun handling IR/Kconfig: sort hardware entries alphabetically IR/lirc: further ioctl portability fixups staging/lirc: ioctl portability fixups
lirc: wire up .compat_ioctl to main ioctl handler
lirc_dev: fixup error messages w/missing newlines IR/streamzap: shorten up some define names for readability

Signature · 2 lines
Jarod Wilson
[email protected]
#3 lore raw

Em 12-10-2010 10:50, Jarod Wilson escreveu:

Quoted 30 lines · Jarod Wilson
Quoted 17 lines · Jarod Wilson
Quoted 9 lines

Hey Mauro,

I've queued up some lirc fixes and a couple of patches that add a new ir-core driver for the Nuvoton w836x7hg Super I/O integrated CIR functionality. All but the Kconfig re-sorting patch have been posted to linux-media for review, but I'm hoping they can all get merged in time for the 2.6.37-rc1 window, and any additional review feedback can be taken care of with follow-up patches.

Quoted 3 lines

The following changes since commit b9a1211dff08aa73fc26db66980ec0710a6c7134:

V4L/DVB: Staging: cx25821: fix braces and space coding style issues (2010-10-07 15:37:27 -0300)

Minor update to the pull req to fully wire up compat ioctls and fixup some error messages in lirc_dev:

Quoted 6 lines

The following changes since commit 81d64d12e11a3cca995e6c752e4bd2898959ed0a:

V4L/DVB: cx231xx: remove some unused functions (2010-10-07 21:05:52 -0300)

are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jarod/linux-2.6-lirc.git staging

Just tacked on two minor streamzap patches, including the one from Dan Carpenter that fixes an overflow with timeout values. The other streamzap patch just makes Dan's patch not create a line > 80 chars, more or less (renames STREAMZAP_FOO defines to SZ_FOO).

Quoted 5 lines

Dan Carpenter (1):
[patch -next] V4L/DVB: IR/streamzap: fix usec to nsec conversion

Jarod Wilson (8):
IR: add driver for Nuvoton w836x7hg integrated CIR

There's a number of checkpatch issues on this patch. Please send me later a patch addressing them. The 80-cols warnings seem bogus to me.
You should notice that a few printk's have the \n missing. Not sure if you forgot, or if you should be using KERN_CONT for some printk's.

WARNING: printk() should include KERN_ facility level #229: FILE: drivers/media/IR/nuvoton-cir.c:135:
+ printk("%s: Dump CIR logical device registers:\n", NVT_DRIVER_NAME);

WARNING: printk() should include KERN_ facility level #230: FILE: drivers/media/IR/nuvoton-cir.c:136:
+ printk(" * CR CIR ACTIVE : 0x%x\n",

WARNING: printk() should include KERN_ facility level #232: FILE: drivers/media/IR/nuvoton-cir.c:138:
+ printk(" * CR CIR BASE ADDR: 0x%x\n",

WARNING: printk() should include KERN_ facility level #235: FILE: drivers/media/IR/nuvoton-cir.c:141:
+ printk(" * CR CIR IRQ NUM: 0x%x\n",

WARNING: printk() should include KERN_ facility level #240: FILE: drivers/media/IR/nuvoton-cir.c:146:
+ printk("%s: Dump CIR registers:\n", NVT_DRIVER_NAME);

WARNING: printk() should include KERN_ facility level #241: FILE: drivers/media/IR/nuvoton-cir.c:147:
+ printk(" * IRCON: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRCON));

WARNING: printk() should include KERN_ facility level #242: FILE: drivers/media/IR/nuvoton-cir.c:148:
+ printk(" * IRSTS: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRSTS));

WARNING: printk() should include KERN_ facility level #243: FILE: drivers/media/IR/nuvoton-cir.c:149:
+ printk(" * IREN: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IREN));

WARNING: printk() should include KERN_ facility level #244: FILE: drivers/media/IR/nuvoton-cir.c:150:
+ printk(" * RXFCONT: 0x%x\n", nvt_cir_reg_read(nvt, CIR_RXFCONT));

WARNING: printk() should include KERN_ facility level #245: FILE: drivers/media/IR/nuvoton-cir.c:151:
+ printk(" * CP: 0x%x\n", nvt_cir_reg_read(nvt, CIR_CP));

WARNING: printk() should include KERN_ facility level #246: FILE: drivers/media/IR/nuvoton-cir.c:152:
+ printk(" * CC: 0x%x\n", nvt_cir_reg_read(nvt, CIR_CC));

WARNING: printk() should include KERN_ facility level #247: FILE: drivers/media/IR/nuvoton-cir.c:153:
+ printk(" * SLCH: 0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCH));

WARNING: printk() should include KERN_ facility level #248: FILE: drivers/media/IR/nuvoton-cir.c:154:
+ printk(" * SLCL: 0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCL));

WARNING: printk() should include KERN_ facility level #249: FILE: drivers/media/IR/nuvoton-cir.c:155:
+ printk(" * FIFOCON: 0x%x\n", nvt_cir_reg_read(nvt, CIR_FIFOCON));

WARNING: printk() should include KERN_ facility level #250: FILE: drivers/media/IR/nuvoton-cir.c:156:
+ printk(" * IRFIFOSTS: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFIFOSTS));

WARNING: printk() should include KERN_ facility level #251: FILE: drivers/media/IR/nuvoton-cir.c:157:
+ printk(" * SRXFIFO: 0x%x\n", nvt_cir_reg_read(nvt, CIR_SRXFIFO));

WARNING: printk() should include KERN_ facility level #252: FILE: drivers/media/IR/nuvoton-cir.c:158:
+ printk(" * TXFCONT: 0x%x\n", nvt_cir_reg_read(nvt, CIR_TXFCONT));

WARNING: printk() should include KERN_ facility level #253: FILE: drivers/media/IR/nuvoton-cir.c:159:
+ printk(" * STXFIFO: 0x%x\n", nvt_cir_reg_read(nvt, CIR_STXFIFO));

WARNING: printk() should include KERN_ facility level #254: FILE: drivers/media/IR/nuvoton-cir.c:160:
+ printk(" * FCCH: 0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCH));

WARNING: printk() should include KERN_ facility level #255: FILE: drivers/media/IR/nuvoton-cir.c:161:
+ printk(" * FCCL: 0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCL));

WARNING: printk() should include KERN_ facility level #256: FILE: drivers/media/IR/nuvoton-cir.c:162:
+ printk(" * IRFSM: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFSM));

WARNING: printk() should include KERN_ facility level #267: FILE: drivers/media/IR/nuvoton-cir.c:173:
+ printk("%s: Dump CIR WAKE logical device registers:\n",

WARNING: printk() should include KERN_ facility level #269: FILE: drivers/media/IR/nuvoton-cir.c:175:
+ printk(" * CR CIR WAKE ACTIVE : 0x%x\n",

WARNING: printk() should include KERN_ facility level #271: FILE: drivers/media/IR/nuvoton-cir.c:177:
+ printk(" * CR CIR WAKE BASE ADDR: 0x%x\n",

ERROR: code indent should use tabs where possible
#273: FILE: drivers/media/IR/nuvoton-cir.c:179:
+^I nvt_cr_read(nvt, CR_CIR_BASE_ADDR_LO));$

WARNING: printk() should include KERN_ facility level #274: FILE: drivers/media/IR/nuvoton-cir.c:180:
+ printk(" * CR CIR WAKE IRQ NUM: 0x%x\n",

WARNING: printk() should include KERN_ facility level #279: FILE: drivers/media/IR/nuvoton-cir.c:185:
+ printk("%s: Dump CIR WAKE registers\n", NVT_DRIVER_NAME);

WARNING: printk() should include KERN_ facility level #280: FILE: drivers/media/IR/nuvoton-cir.c:186:
+ printk(" * IRCON: 0x%x\n",

WARNING: printk() should include KERN_ facility level #282: FILE: drivers/media/IR/nuvoton-cir.c:188:
+ printk(" * IRSTS: 0x%x\n",

WARNING: printk() should include KERN_ facility level #284: FILE: drivers/media/IR/nuvoton-cir.c:190:
+ printk(" * IREN: 0x%x\n",

WARNING: printk() should include KERN_ facility level #286: FILE: drivers/media/IR/nuvoton-cir.c:192:
+ printk(" * FIFO CMP DEEP: 0x%x\n",

WARNING: printk() should include KERN_ facility level #288: FILE: drivers/media/IR/nuvoton-cir.c:194:
+ printk(" * FIFO CMP TOL: 0x%x\n",

WARNING: printk() should include KERN_ facility level #290: FILE: drivers/media/IR/nuvoton-cir.c:196:
+ printk(" * FIFO COUNT: 0x%x\n",

WARNING: printk() should include KERN_ facility level #292: FILE: drivers/media/IR/nuvoton-cir.c:198:
+ printk(" * SLCH: 0x%x\n",

WARNING: printk() should include KERN_ facility level #294: FILE: drivers/media/IR/nuvoton-cir.c:200:
+ printk(" * SLCL: 0x%x\n",

WARNING: printk() should include KERN_ facility level #296: FILE: drivers/media/IR/nuvoton-cir.c:202:
+ printk(" * FIFOCON: 0x%x\n",

WARNING: printk() should include KERN_ facility level #298: FILE: drivers/media/IR/nuvoton-cir.c:204:
+ printk(" * SRXFSTS: 0x%x\n",

WARNING: printk() should include KERN_ facility level #300: FILE: drivers/media/IR/nuvoton-cir.c:206:
+ printk(" * SAMPLE RX FIFO: 0x%x\n",

WARNING: printk() should include KERN_ facility level #302: FILE: drivers/media/IR/nuvoton-cir.c:208:
+ printk(" * WR FIFO DATA: 0x%x\n",

WARNING: printk() should include KERN_ facility level #304: FILE: drivers/media/IR/nuvoton-cir.c:210:
+ printk(" * RD FIFO ONLY: 0x%x\n",

WARNING: printk() should include KERN_ facility level #306: FILE: drivers/media/IR/nuvoton-cir.c:212:
+ printk(" * RD FIFO ONLY IDX: 0x%x\n",

WARNING: printk() should include KERN_ facility level #308: FILE: drivers/media/IR/nuvoton-cir.c:214:
+ printk(" * FIFO IGNORE: 0x%x\n",

WARNING: printk() should include KERN_ facility level #310: FILE: drivers/media/IR/nuvoton-cir.c:216:
+ printk(" * IRFSM: 0x%x\n",

WARNING: printk() should include KERN_ facility level #314: FILE: drivers/media/IR/nuvoton-cir.c:220:
+ printk("%s: Dump CIR WAKE FIFO (len %d)\n", NVT_DRIVER_NAME, fifo_len);

WARNING: printk() should include KERN_ facility level #315: FILE: drivers/media/IR/nuvoton-cir.c:221:
+ printk("* Contents = ");

WARNING: line over 80 characters
#450: FILE: drivers/media/IR/nuvoton-cir.c:356:
+ nvt_cir_reg_write(nvt, CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV |

WARNING: line over 80 characters
#460: FILE: drivers/media/IR/nuvoton-cir.c:366:
+ /* and finally, enable RX Trigger Level Read and Packet End interrupts */

WARNING: line over 80 characters
#513: FILE: drivers/media/IR/nuvoton-cir.c:419:
+ CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON);

WARNING: printk() should include KERN_ facility level #648: FILE: drivers/media/IR/nuvoton-cir.c:554:
+ printk("%s (len %d): ", __func__, nvt->pkts);

WARNING: Use #include <linux/ioctl.h> instead of <asm/ioctl.h> #1345: FILE: drivers/media/IR/nuvoton-cir.h:29:
+#include <asm/ioctl.h>

total: 1 errors, 49 warnings, 1649 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Quoted 9 lines

nuvoton-cir: add proper rx fifo overrun handling IR/Kconfig: sort hardware entries alphabetically IR/lirc: further ioctl portability fixups staging/lirc: ioctl portability fixups
lirc: wire up .compat_ioctl to main ioctl handler
lirc_dev: fixup error messages w/missing newlines IR/streamzap: shorten up some define names for readability

#4 lore raw

PATCH 1/1 IR/nuvoton: address all checkpatch.pl issues

Quoted 8 lines · Mauro Carvalho Chehab

Em 12-10-2010 10:50, Jarod Wilson escreveu:

Quoted 2 lines

Jarod Wilson (8):
IR: add driver for Nuvoton w836x7hg integrated CIR

There's a number of checkpatch issues on this patch. Please send me later a patch addressing them. The 80-cols warnings seem bogus to me.
You should notice that a few printk's have the \n missing. Not sure if you forgot, or if you should be using KERN_CONT for some printk's.

D'oh. I forgot to checkpatch it entirely. The following should take care of it all.

Quoted 1 line

From cb24961b294a6fd13f4297fd2da634e379a8a9a8 Mon Sep 17 00:00:00 2001

From: Jarod Wilson <[email protected]>
Date: Fri, 15 Oct 2010 10:07:37 -0400
Subject: [PATCH] IR/nuvoton: address all checkpatch.pl issues

The driver was missing KERN_ facilities on a number of printks. The register dump functions have been updated to use KERN_INFO, so that the register dump gets logged in syslog (they only run on driver load, and only when debug is enabled). The buffer dump routine now uses KERN_DEBUG, as that spew will happen quite frequently (several times every IR signal), and shouldn't need to be logged.

Also split up the small handful of lines that were just over 80 characaters, and fixed the ioctl.h include.

---
 drivers/media/IR/nuvoton-cir.c |  112 +++++++++++++++++++++-------------------
 drivers/media/IR/nuvoton-cir.h |    2 +-
 2 files changed, 60 insertions(+), 54 deletions(-)
drivers/media/IR/nuvoton-cir.c +59 -53
index fdb280e..2f0f780 100644
@@ -126,40 +126,43 @@ static u8 nvt_cir_wake_reg_read(struct nvt_dev *nvt, u8 offset)
 	return val;
 }
 
+#define pr_reg(text, ...) \
+	printk(KERN_INFO KBUILD_MODNAME ": " text, ## __VA_ARGS__)
+
 /* dump current cir register contents */
 static void cir_dump_regs(struct nvt_dev *nvt)
 {
 	nvt_efm_enable(nvt);
 	nvt_select_logical_dev(nvt, LOGICAL_DEV_CIR);
 
-	printk("%s: Dump CIR logical device registers:\n", NVT_DRIVER_NAME);
-	printk(" * CR CIR ACTIVE :   0x%x\n",
+	pr_reg("%s: Dump CIR logical device registers:\n", NVT_DRIVER_NAME);
+	pr_reg(" * CR CIR ACTIVE :   0x%x\n",
 	       nvt_cr_read(nvt, CR_LOGICAL_DEV_EN));
-	printk(" * CR CIR BASE ADDR: 0x%x\n",
+	pr_reg(" * CR CIR BASE ADDR: 0x%x\n",
 	       (nvt_cr_read(nvt, CR_CIR_BASE_ADDR_HI) << 8) |
 		nvt_cr_read(nvt, CR_CIR_BASE_ADDR_LO));
-	printk(" * CR CIR IRQ NUM:   0x%x\n",
+	pr_reg(" * CR CIR IRQ NUM:   0x%x\n",
 	       nvt_cr_read(nvt, CR_CIR_IRQ_RSRC));
 
 	nvt_efm_disable(nvt);
 
-	printk("%s: Dump CIR registers:\n", NVT_DRIVER_NAME);
-	printk(" * IRCON:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRCON));
-	printk(" * IRSTS:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRSTS));
-	printk(" * IREN:      0x%x\n", nvt_cir_reg_read(nvt, CIR_IREN));
-	printk(" * RXFCONT:   0x%x\n", nvt_cir_reg_read(nvt, CIR_RXFCONT));
-	printk(" * CP:        0x%x\n", nvt_cir_reg_read(nvt, CIR_CP));
-	printk(" * CC:        0x%x\n", nvt_cir_reg_read(nvt, CIR_CC));
-	printk(" * SLCH:      0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCH));
-	printk(" * SLCL:      0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCL));
-	printk(" * FIFOCON:   0x%x\n", nvt_cir_reg_read(nvt, CIR_FIFOCON));
-	printk(" * IRFIFOSTS: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFIFOSTS));
-	printk(" * SRXFIFO:   0x%x\n", nvt_cir_reg_read(nvt, CIR_SRXFIFO));
-	printk(" * TXFCONT:   0x%x\n", nvt_cir_reg_read(nvt, CIR_TXFCONT));
-	printk(" * STXFIFO:   0x%x\n", nvt_cir_reg_read(nvt, CIR_STXFIFO));
-	printk(" * FCCH:      0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCH));
-	printk(" * FCCL:      0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCL));
-	printk(" * IRFSM:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFSM));
+	pr_reg("%s: Dump CIR registers:\n", NVT_DRIVER_NAME);
+	pr_reg(" * IRCON:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRCON));
+	pr_reg(" * IRSTS:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRSTS));
+	pr_reg(" * IREN:      0x%x\n", nvt_cir_reg_read(nvt, CIR_IREN));
+	pr_reg(" * RXFCONT:   0x%x\n", nvt_cir_reg_read(nvt, CIR_RXFCONT));
+	pr_reg(" * CP:        0x%x\n", nvt_cir_reg_read(nvt, CIR_CP));
+	pr_reg(" * CC:        0x%x\n", nvt_cir_reg_read(nvt, CIR_CC));
+	pr_reg(" * SLCH:      0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCH));
+	pr_reg(" * SLCL:      0x%x\n", nvt_cir_reg_read(nvt, CIR_SLCL));
+	pr_reg(" * FIFOCON:   0x%x\n", nvt_cir_reg_read(nvt, CIR_FIFOCON));
+	pr_reg(" * IRFIFOSTS: 0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFIFOSTS));
+	pr_reg(" * SRXFIFO:   0x%x\n", nvt_cir_reg_read(nvt, CIR_SRXFIFO));
+	pr_reg(" * TXFCONT:   0x%x\n", nvt_cir_reg_read(nvt, CIR_TXFCONT));
+	pr_reg(" * STXFIFO:   0x%x\n", nvt_cir_reg_read(nvt, CIR_STXFIFO));
+	pr_reg(" * FCCH:      0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCH));
+	pr_reg(" * FCCL:      0x%x\n", nvt_cir_reg_read(nvt, CIR_FCCL));
+	pr_reg(" * IRFSM:     0x%x\n", nvt_cir_reg_read(nvt, CIR_IRFSM));
 }
 
 /* dump current cir wake register contents */
@@ -170,59 +173,59 @@ static void cir_wake_dump_regs(struct nvt_dev *nvt)
 	nvt_efm_enable(nvt);
 	nvt_select_logical_dev(nvt, LOGICAL_DEV_CIR_WAKE);
 
-	printk("%s: Dump CIR WAKE logical device registers:\n",
+	pr_reg("%s: Dump CIR WAKE logical device registers:\n",
 	       NVT_DRIVER_NAME);
-	printk(" * CR CIR WAKE ACTIVE :   0x%x\n",
+	pr_reg(" * CR CIR WAKE ACTIVE :   0x%x\n",
 	       nvt_cr_read(nvt, CR_LOGICAL_DEV_EN));
-	printk(" * CR CIR WAKE BASE ADDR: 0x%x\n",
+	pr_reg(" * CR CIR WAKE BASE ADDR: 0x%x\n",
 	       (nvt_cr_read(nvt, CR_CIR_BASE_ADDR_HI) << 8) |
-	        nvt_cr_read(nvt, CR_CIR_BASE_ADDR_LO));
-	printk(" * CR CIR WAKE IRQ NUM:   0x%x\n",
+		nvt_cr_read(nvt, CR_CIR_BASE_ADDR_LO));
+	pr_reg(" * CR CIR WAKE IRQ NUM:   0x%x\n",
 	       nvt_cr_read(nvt, CR_CIR_IRQ_RSRC));
 
 	nvt_efm_disable(nvt);
 
-	printk("%s: Dump CIR WAKE registers\n", NVT_DRIVER_NAME);
-	printk(" * IRCON:          0x%x\n",
+	pr_reg("%s: Dump CIR WAKE registers\n", NVT_DRIVER_NAME);
+	pr_reg(" * IRCON:          0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRCON));
-	printk(" * IRSTS:          0x%x\n",
+	pr_reg(" * IRSTS:          0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRSTS));
-	printk(" * IREN:           0x%x\n",
+	pr_reg(" * IREN:           0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_IREN));
-	printk(" * FIFO CMP DEEP:  0x%x\n",
+	pr_reg(" * FIFO CMP DEEP:  0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_CMP_DEEP));
-	printk(" * FIFO CMP TOL:   0x%x\n",
+	pr_reg(" * FIFO CMP TOL:   0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_CMP_TOL));
-	printk(" * FIFO COUNT:     0x%x\n",
+	pr_reg(" * FIFO COUNT:     0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_COUNT));
-	printk(" * SLCH:           0x%x\n",
+	pr_reg(" * SLCH:           0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_SLCH));
-	printk(" * SLCL:           0x%x\n",
+	pr_reg(" * SLCL:           0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_SLCL));
-	printk(" * FIFOCON:        0x%x\n",
+	pr_reg(" * FIFOCON:        0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFOCON));
-	printk(" * SRXFSTS:        0x%x\n",
+	pr_reg(" * SRXFSTS:        0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_SRXFSTS));
-	printk(" * SAMPLE RX FIFO: 0x%x\n",
+	pr_reg(" * SAMPLE RX FIFO: 0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_SAMPLE_RX_FIFO));
-	printk(" * WR FIFO DATA:   0x%x\n",
+	pr_reg(" * WR FIFO DATA:   0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_WR_FIFO_DATA));
-	printk(" * RD FIFO ONLY:   0x%x\n",
+	pr_reg(" * RD FIFO ONLY:   0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_RD_FIFO_ONLY));
-	printk(" * RD FIFO ONLY IDX: 0x%x\n",
+	pr_reg(" * RD FIFO ONLY IDX: 0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_RD_FIFO_ONLY_IDX));
-	printk(" * FIFO IGNORE:    0x%x\n",
+	pr_reg(" * FIFO IGNORE:    0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_IGNORE));
-	printk(" * IRFSM:          0x%x\n",
+	pr_reg(" * IRFSM:          0x%x\n",
 	       nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRFSM));
 
 	fifo_len = nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_COUNT);
-	printk("%s: Dump CIR WAKE FIFO (len %d)\n", NVT_DRIVER_NAME, fifo_len);
-	printk("* Contents = ");
+	pr_reg("%s: Dump CIR WAKE FIFO (len %d)\n", NVT_DRIVER_NAME, fifo_len);
+	pr_reg("* Contents = ");
 	for (i = 0; i < fifo_len; i++)
-		printk("%02x ",
+		printk(KERN_CONT "%02x ",
 		       nvt_cir_wake_reg_read(nvt, CIR_WAKE_RD_FIFO_ONLY));
-	printk("\n");
+	printk(KERN_CONT "\n");
 }
 
 /* detect hardware features */
@@ -362,8 +365,10 @@ static void nvt_cir_regs_init(struct nvt_dev *nvt)
 	 * Enable TX and RX, specify carrier on = low, off = high, and set
 	 * sample period (currently 50us)
 	 */
-	nvt_cir_reg_write(nvt, CIR_IRCON_TXEN | CIR_IRCON_RXEN | CIR_IRCON_RXINV |
-			  CIR_IRCON_SAMPLE_PERIOD_SEL, CIR_IRCON);
+	nvt_cir_reg_write(nvt,
+			  CIR_IRCON_TXEN | CIR_IRCON_RXEN |
+			  CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL,
+			  CIR_IRCON);
 
 	/* clear hardware rx and tx fifos */
 	nvt_clear_cir_fifo(nvt);
@@ -425,7 +430,8 @@ static void nvt_enable_wake(struct nvt_dev *nvt)
 
 	nvt_cir_wake_reg_write(nvt, CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN |
 			       CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV |
-			       CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL, CIR_WAKE_IRCON);
+			       CIR_WAKE_IRCON_SAMPLE_PERIOD_SEL,
+			       CIR_WAKE_IRCON);
 	nvt_cir_wake_reg_write(nvt, 0xff, CIR_WAKE_IRSTS);
 	nvt_cir_wake_reg_write(nvt, 0, CIR_WAKE_IREN);
 }
@@ -560,10 +566,10 @@ static void nvt_dump_rx_buf(struct nvt_dev *nvt)
 {
 	int i;
 
-	printk("%s (len %d): ", __func__, nvt->pkts);
+	printk(KERN_DEBUG "%s (len %d): ", __func__, nvt->pkts);
 	for (i = 0; (i < nvt->pkts) && (i < RX_BUF_LEN); i++)
-		printk("0x%02x ", nvt->buf[i]);
-	printk("\n");
+		printk(KERN_CONT "0x%02x ", nvt->buf[i]);
+	printk(KERN_CONT "\n");
 }
 
 /*
drivers/media/IR/nuvoton-cir.h +1 -1
index 12bfe89..62dc530 100644
@@ -26,7 +26,7 @@
  */
 
 #include <linux/spinlock.h>
-#include <asm/ioctl.h>
+#include <linux/ioctl.h>
 
 /* platform driver name to register */
 #define NVT_DRIVER_NAME "nuvoton-cir"
Signature · 6 lines
1.7.1


-- 
Jarod Wilson
[email protected]