Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176849
b: refs/heads/master
c: 2079708
h: refs/heads/master
i:
  176847: ad3dd40
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent f866fff commit 5c5655d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 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: 607e5ad8d596495341fa0a13e0a23121ee6053b6
refs/heads/master: 207970838186b2606896b03f590b89b13570a727
37 changes: 16 additions & 21 deletions trunk/drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,19 @@ static struct tw9910_priv *to_tw9910(const struct i2c_client *client)
subdev);
}

static int tw9910_mask_set(struct i2c_client *client, u8 command,
u8 mask, u8 set)
{
s32 val = i2c_smbus_read_byte_data(client, command);
if (val < 0)
return val;

val &= ~mask;
val |= set & mask;

return i2c_smbus_write_byte_data(client, command, val);
}

static int tw9910_set_scale(struct i2c_client *client,
const struct tw9910_scale_ctrl *scale)
{
Expand Down Expand Up @@ -445,14 +458,9 @@ static int tw9910_set_hsync(struct i2c_client *client,
return ret;

/* bit 2 - 0 */
ret = i2c_smbus_read_byte_data(client, HSLOWCTL);
if (ret < 0)
return ret;

ret = i2c_smbus_write_byte_data(client, HSLOWCTL,
(ret & 0x88) |
(hsync->start & 0x0007) << 4 |
(hsync->end & 0x0007));
ret = tw9910_mask_set(client, HSLOWCTL, 0x77,
(hsync->start & 0x0007) << 4 |
(hsync->end & 0x0007));

return ret;
}
Expand All @@ -471,19 +479,6 @@ static int tw9910_write_array(struct i2c_client *client,
return 0;
}

static int tw9910_mask_set(struct i2c_client *client, u8 command,
u8 mask, u8 set)
{
s32 val = i2c_smbus_read_byte_data(client, command);
if (val < 0)
return val;

val &= ~mask;
val |= set & mask;

return i2c_smbus_write_byte_data(client, command, val);
}

static void tw9910_reset(struct i2c_client *client)
{
tw9910_mask_set(client, ACNTL1, SRESET, SRESET);
Expand Down

0 comments on commit 5c5655d

Please sign in to comment.