Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
}
/* Function is not endian safe, use the RD16 wrapper below */
}
/* Function is not endian safe, use the RD16 wrapper below */
-static int _read16(struct drx397xD_state *s, u32 i2c_adr)
+static int _read16(struct drx397xD_state *s, __le32 i2c_adr)
struct i2c_msg msg[2] = {
{
.addr = s->config.demod_address,
struct i2c_msg msg[2] = {
{
.addr = s->config.demod_address,
}, {
.addr = s->config.demod_address,
.flags = I2C_M_RD,
}, {
.addr = s->config.demod_address,
.flags = I2C_M_RD,
+ *(__le32 *) a = i2c_adr;
rc = i2c_transfer(s->i2c, msg, 2);
if (rc != 2)
rc = i2c_transfer(s->i2c, msg, 2);
if (rc != 2)
}
/* Function is not endian safe, use the WR16.. wrappers below */
}
/* Function is not endian safe, use the WR16.. wrappers below */
-static int _write16(struct drx397xD_state *s, u32 i2c_adr, u16 val)
+static int _write16(struct drx397xD_state *s, __le32 i2c_adr, __le16 val)
- *(u32 *) a = i2c_adr;
- *(u16 *) &a[4] = val;
+ *(__le32 *)a = i2c_adr;
+ *(__le16 *)&a[4] = val;
rc = i2c_transfer(s->i2c, &msg, 1);
if (rc != 1)
rc = i2c_transfer(s->i2c, &msg, 1);
if (rc != 1)
#define DRX_F_OFFSET 36000000
#define I2C_ADR_C0(x) \
#define DRX_F_OFFSET 36000000
#define I2C_ADR_C0(x) \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
)
#define I2C_ADR_E0(x) \
)
#define I2C_ADR_E0(x) \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \