Skip to content

Commit 0b7a41e

Browse files
dilingergregkh
authored andcommitted
staging: olpc_dcon: replace remaining calls to i2c_smbus_read/write
Use dcon_read and dcon_write; shorter, and understands the dcon_priv struct. This transition was started long ago. This converts the last few i2c_smbus_* callers. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 1b995ac commit 0b7a41e

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎drivers/staging/olpc_dcon/olpc_dcon.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ static s32 dcon_read(struct dcon_priv *dcon, u8 reg)
6565

6666
static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
6767
{
68-
struct i2c_client *client = dcon->client;
6968
uint16_t ver;
7069
int rc = 0;
7170

72-
ver = i2c_smbus_read_word_data(client, DCON_REG_ID);
71+
ver = dcon_read(dcon, DCON_REG_ID);
7372
if ((ver >> 8) != 0xDC) {
7473
printk(KERN_ERR "olpc-dcon: DCON ID not 0xDCxx: 0x%04x "
7574
"instead.\n", ver);
@@ -95,10 +94,10 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
9594
}
9695

9796
/* SDRAM setup/hold time */
98-
i2c_smbus_write_word_data(client, 0x3a, 0xc040);
99-
i2c_smbus_write_word_data(client, 0x41, 0x0000);
100-
i2c_smbus_write_word_data(client, 0x41, 0x0101);
101-
i2c_smbus_write_word_data(client, 0x42, 0x0101);
97+
dcon_write(dcon, 0x3a, 0xc040);
98+
dcon_write(dcon, 0x41, 0x0000);
99+
dcon_write(dcon, 0x41, 0x0101);
100+
dcon_write(dcon, 0x42, 0x0101);
102101

103102
/* Colour swizzle, AA, no passthrough, backlight */
104103
if (is_init) {
@@ -107,11 +106,11 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
107106
if (useaa)
108107
dcon->disp_mode |= MODE_COL_AA;
109108
}
110-
i2c_smbus_write_word_data(client, DCON_REG_MODE, dcon->disp_mode);
109+
dcon_write(dcon, DCON_REG_MODE, dcon->disp_mode);
111110

112111

113112
/* Set the scanline to interrupt on during resume */
114-
i2c_smbus_write_word_data(client, DCON_REG_SCAN_INT, resumeline);
113+
dcon_write(dcon, DCON_REG_SCAN_INT, resumeline);
115114

116115
err:
117116
return rc;

0 commit comments

Comments
 (0)