aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/nuvoton-cir.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-04-12 13:00:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 08:27:33 -0400
commit362d3a3a9592598cef1d3e211ad998eb844dc5f3 (patch)
tree156d41f33899e002e612974e420071e52580a790 /drivers/media/rc/nuvoton-cir.c
parent56c0893c4f66a5d249b8981101755bec5890500d (diff)
[media] rc/nuvoton-cir: only warn about unknown chips
There are additional chip IDs that report a PNP ID of NTN0530, which we were refusing to load on. Instead, lets just warn if we encounter an unknown chip, as there's a chance it will work just fine. Also, expand the list of known hardware to include both an earlier and a later generation chip that this driver should function with. Douglas has an older w83667hg variant, that with a touch more work, will be supported by this driver, and Lutz has a newer w83677hg variant that works without any further modifications to the driver. Reported-by: Douglas Clowes <dclowes1@optusnet.com.au> Reported-by: Lutz Sammer <johns98@gmx.net> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/nuvoton-cir.c')
-rw-r--r--drivers/media/rc/nuvoton-cir.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index d4d64492a057..bc5c1e267512 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -37,8 +37,6 @@
37 37
38#include "nuvoton-cir.h" 38#include "nuvoton-cir.h"
39 39
40static char *chip_id = "w836x7hg";
41
42/* write val to config reg */ 40/* write val to config reg */
43static inline void nvt_cr_write(struct nvt_dev *nvt, u8 val, u8 reg) 41static inline void nvt_cr_write(struct nvt_dev *nvt, u8 val, u8 reg)
44{ 42{
@@ -233,6 +231,8 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
233 unsigned long flags; 231 unsigned long flags;
234 u8 chip_major, chip_minor; 232 u8 chip_major, chip_minor;
235 int ret = 0; 233 int ret = 0;
234 char chip_id[12];
235 bool chip_unknown = false;
236 236
237 nvt_efm_enable(nvt); 237 nvt_efm_enable(nvt);
238 238
@@ -246,15 +246,39 @@ static int nvt_hw_detect(struct nvt_dev *nvt)
246 } 246 }
247 247
248 chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO); 248 chip_minor = nvt_cr_read(nvt, CR_CHIP_ID_LO);
249 nvt_dbg("%s: chip id: 0x%02x 0x%02x", chip_id, chip_major, chip_minor);
250 249
251 if (chip_major != CHIP_ID_HIGH || 250 /* these are the known working chip revisions... */
252 (chip_minor != CHIP_ID_LOW && chip_minor != CHIP_ID_LOW2)) { 251 switch (chip_major) {
253 nvt_pr(KERN_ERR, "%s: unsupported chip, id: 0x%02x 0x%02x", 252 case CHIP_ID_HIGH_667:
254 chip_id, chip_major, chip_minor); 253 strcpy(chip_id, "w83667hg\0");
255 ret = -ENODEV; 254 if (chip_minor != CHIP_ID_LOW_667)
255 chip_unknown = true;
256 break;
257 case CHIP_ID_HIGH_677B:
258 strcpy(chip_id, "w83677hg\0");
259 if (chip_minor != CHIP_ID_LOW_677B2 &&
260 chip_minor != CHIP_ID_LOW_677B3)
261 chip_unknown = true;
262 break;
263 case CHIP_ID_HIGH_677C:
264 strcpy(chip_id, "w83677hg-c\0");
265 if (chip_minor != CHIP_ID_LOW_677C)
266 chip_unknown = true;
267 break;
268 default:
269 strcpy(chip_id, "w836x7hg\0");
270 chip_unknown = true;
271 break;
256 } 272 }
257 273
274 /* warn, but still let the driver load, if we don't know this chip */
275 if (chip_unknown)
276 nvt_pr(KERN_WARNING, "%s: unknown chip, id: 0x%02x 0x%02x, "
277 "it may not work...", chip_id, chip_major, chip_minor);
278 else
279 nvt_dbg("%s: chip id: 0x%02x 0x%02x",
280 chip_id, chip_major, chip_minor);
281
258 nvt_efm_disable(nvt); 282 nvt_efm_disable(nvt);
259 283
260 spin_lock_irqsave(&nvt->nvt_lock, flags); 284 spin_lock_irqsave(&nvt->nvt_lock, flags);