Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113837
b: refs/heads/master
c: 95908ec
h: refs/heads/master
i:
  113835: 1dcaa0a
v: v3
  • Loading branch information
Harvey Harrison authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 090c2f5 commit 29c680b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06a3f58496462f25cc031d1cb6d49cb78af1f636
refs/heads/master: 95908ece60443ceb188fccf021d62823de8e6f0c
14 changes: 7 additions & 7 deletions trunk/drivers/media/dvb/frontends/drx397xD.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ static int write_fw(struct drx397xD_state *s, enum blob_ix ix)
}

/* 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)
{
int rc;
u8 a[4];
u16 v;
__le16 v;
struct i2c_msg msg[2] = {
{
.addr = s->config.demod_address,
Expand All @@ -249,12 +249,12 @@ static int _read16(struct drx397xD_state *s, u32 i2c_adr)
}, {
.addr = s->config.demod_address,
.flags = I2C_M_RD,
.buf = (u8 *) &v,
.buf = (u8 *)&v,
.len = sizeof(v)
}
};

*(u32 *) a = i2c_adr;
*(__le32 *) a = i2c_adr;

rc = i2c_transfer(s->i2c, msg, 2);
if (rc != 2)
Expand All @@ -264,7 +264,7 @@ static int _read16(struct drx397xD_state *s, u32 i2c_adr)
}

/* 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)
{
u8 a[6];
int rc;
Expand All @@ -275,8 +275,8 @@ static int _write16(struct drx397xD_state *s, u32 i2c_adr, u16 val)
.len = sizeof(a)
};

*(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)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/frontends/drx397xD.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define DRX_F_OFFSET 36000000

#define I2C_ADR_C0(x) \
( (u32)cpu_to_le32( \
( cpu_to_le32( \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
Expand All @@ -38,7 +38,7 @@
)

#define I2C_ADR_E0(x) \
( (u32)cpu_to_le32( \
( cpu_to_le32( \
(u32)( \
(((u32)(x) & (u32)0x000000ffUL) ) | \
(((u32)(x) & (u32)0x0000ff00UL) << 16) | \
Expand Down

0 comments on commit 29c680b

Please sign in to comment.