From: Mauro Carvalho Chehab Date: Wed, 10 Apr 2013 10:08:17 +0000 (-0300) Subject: [media] r820t: Invert bits for read ops X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=103fe2fb2314f09d9b923c5919e70cbe66830d6d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] r820t: Invert bits for read ops On read, the bit order is inverted. Signed-off-by: Mauro Carvalho Chehab Tested-by: Antti Palosaari --- 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 @@ #include #include #include -#include "tuner-i2c.h" +#include #include + +#include "tuner-i2c.h" #include "r820t.h" /* @@ -414,7 +416,7 @@ static int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val, static int r820_read(struct r820t_priv *priv, u8 reg, u8 *val, int len) { - int rc; + int rc, i; u8 *p = &priv->buf[1]; priv->buf[0] = reg; @@ -431,7 +433,8 @@ static int r820_read(struct r820t_priv *priv, u8 reg, u8 *val, int len) __func__, reg, len, len, p); /* Copy data to the output buffer */ - memcpy(val, p, len); + for (i = 0; i < len; i++) + val[i] = bitrev8(p[i]); return 0; }