diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-10 06:08:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-16 20:27:38 -0400 |
commit | 103fe2fb2314f09d9b923c5919e70cbe66830d6d (patch) | |
tree | a031f222543eeb066c56a6b77ba657e711cf7c35 /drivers/media | |
parent | 884655ad2e85ebcd84b10b82fca2ef8e431d4392 (diff) |
[media] r820t: Invert bits for read ops
On read, the bit order is inverted.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/tuners/r820t.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c index 48ff6bb75f81..79ab2b74bd52 100644 --- a/drivers/media/tuners/r820t.c +++ b/drivers/media/tuners/r820t.c | |||
@@ -35,8 +35,10 @@ | |||
35 | #include <linux/videodev2.h> | 35 | #include <linux/videodev2.h> |
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | #include "tuner-i2c.h" | 38 | #include <linux/bitrev.h> |
39 | #include <asm/div64.h> | 39 | #include <asm/div64.h> |
40 | |||
41 | #include "tuner-i2c.h" | ||
40 | #include "r820t.h" | 42 | #include "r820t.h" |
41 | 43 | ||
42 | /* | 44 | /* |
@@ -414,7 +416,7 @@ static int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val, | |||
414 | 416 | ||
415 | static int r820_read(struct r820t_priv *priv, u8 reg, u8 *val, int len) | 417 | static int r820_read(struct r820t_priv *priv, u8 reg, u8 *val, int len) |
416 | { | 418 | { |
417 | int rc; | 419 | int rc, i; |
418 | u8 *p = &priv->buf[1]; | 420 | u8 *p = &priv->buf[1]; |
419 | 421 | ||
420 | priv->buf[0] = reg; | 422 | priv->buf[0] = reg; |
@@ -431,7 +433,8 @@ static int r820_read(struct r820t_priv *priv, u8 reg, u8 *val, int len) | |||
431 | __func__, reg, len, len, p); | 433 | __func__, reg, len, len, p); |
432 | 434 | ||
433 | /* Copy data to the output buffer */ | 435 | /* Copy data to the output buffer */ |
434 | memcpy(val, p, len); | 436 | for (i = 0; i < len; i++) |
437 | val[i] = bitrev8(p[i]); | ||
435 | 438 | ||
436 | return 0; | 439 | return 0; |
437 | } | 440 | } |