diff options
author | Kevin Fitch <kfitch42@gmail.com> | 2016-03-23 05:23:32 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-05-06 20:52:51 +0200 |
commit | 7e31223ff0196dc5c5e8124b3c05ab4a25847c59 (patch) | |
tree | caef876466d70ed3d7621c7bbd0ebd128132eaf6 /drivers/media | |
parent | [media] v4l2-ioctl.c: improve cropcap compatibility code (diff) | |
download | linux-7e31223ff0196dc5c5e8124b3c05ab4a25847c59.tar.xz linux-7e31223ff0196dc5c5e8124b3c05ab4a25847c59.zip |
[media] i2c: saa7115: Support CJC7113 detection
It's been reported that CJC7113 devices are returning
all 1s when reading register 0:
"1111111111111111" found @ 0x4a (stk1160)
This new device is apparently compatible with SA7113, so let's
add a quirk to allow its autodetection. Given there isn't
any known differences with SAA7113, this commit does not
introduces a new saa711x_model value.
Reported-by: Philippe Desrochers <desrochers.philippe@gmail.com>
Signed-off-by: Kevin Fitch <kfitch42@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/saa7115.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index d2a1ce2bc7f5..bd3526bdd539 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1798,6 +1798,21 @@ static int saa711x_detect_chip(struct i2c_client *client, return GM7113C; } + /* Check if it is a CJC7113 */ + if (!memcmp(name, "1111111111111111", CHIP_VER_SIZE)) { + strlcpy(name, "cjc7113", CHIP_VER_SIZE); + + if (!autodetect && strcmp(name, id->name)) + return -EINVAL; + + v4l_dbg(1, debug, client, + "It seems to be a %s chip (%*ph) @ 0x%x.\n", + name, 16, chip_ver, client->addr << 1); + + /* CJC7113 seems to be SAA7113-compatible */ + return SAA7113; + } + /* Chip was not discovered. Return its ID and don't bind */ v4l_dbg(1, debug, client, "chip %*ph @ 0x%x is unknown.\n", 16, chip_ver, client->addr << 1); |