diff options
author | Shubhrajyoti D <shubhrajyoti@ti.com> | 2012-09-18 07:22:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-27 06:39:31 -0400 |
commit | 1215af48366ff1e2401a0afcedfd3dcdff5f13fd (patch) | |
tree | c20e198c84e02b48711622fe6659789b6a860b11 | |
parent | 66ba9590c97abd69ea1340b90946363a6b1d33c3 (diff) |
[media] msp3400: convert struct i2c_msg initialization to C99 format
Convert the struct i2c_msg initialization to C99 format. This makes
maintaining and editing the code simpler. Also helps once other fields
like transferred are added in future.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/i2c/msp3400-driver.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index aeb22be7dcbd..766305f69a28 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c | |||
@@ -119,12 +119,31 @@ int msp_reset(struct i2c_client *client) | |||
119 | static u8 write[3] = { I2C_MSP_DSP + 1, 0x00, 0x1e }; | 119 | static u8 write[3] = { I2C_MSP_DSP + 1, 0x00, 0x1e }; |
120 | u8 read[2]; | 120 | u8 read[2]; |
121 | struct i2c_msg reset[2] = { | 121 | struct i2c_msg reset[2] = { |
122 | { client->addr, I2C_M_IGNORE_NAK, 3, reset_off }, | 122 | { |
123 | { client->addr, I2C_M_IGNORE_NAK, 3, reset_on }, | 123 | .addr = client->addr, |
124 | .flags = I2C_M_IGNORE_NAK, | ||
125 | .len = 3, | ||
126 | .buf = reset_off | ||
127 | }, | ||
128 | { | ||
129 | .addr = client->addr, | ||
130 | .flags = I2C_M_IGNORE_NAK, | ||
131 | .len = 3, | ||
132 | .buf = reset_on | ||
133 | }, | ||
124 | }; | 134 | }; |
125 | struct i2c_msg test[2] = { | 135 | struct i2c_msg test[2] = { |
126 | { client->addr, 0, 3, write }, | 136 | { |
127 | { client->addr, I2C_M_RD, 2, read }, | 137 | .addr = client->addr, |
138 | .len = 3, | ||
139 | .buf = write | ||
140 | }, | ||
141 | { | ||
142 | .addr = client->addr, | ||
143 | .flags = I2C_M_RD, | ||
144 | .len = 2, | ||
145 | .buf = read | ||
146 | }, | ||
128 | }; | 147 | }; |
129 | 148 | ||
130 | v4l_dbg(3, msp_debug, client, "msp_reset\n"); | 149 | v4l_dbg(3, msp_debug, client, "msp_reset\n"); |
@@ -143,8 +162,17 @@ static int msp_read(struct i2c_client *client, int dev, int addr) | |||
143 | u8 write[3]; | 162 | u8 write[3]; |
144 | u8 read[2]; | 163 | u8 read[2]; |
145 | struct i2c_msg msgs[2] = { | 164 | struct i2c_msg msgs[2] = { |
146 | { client->addr, 0, 3, write }, | 165 | { |
147 | { client->addr, I2C_M_RD, 2, read } | 166 | .addr = client->addr, |
167 | .len = 3, | ||
168 | .buf = write | ||
169 | }, | ||
170 | { | ||
171 | .addr = client->addr, | ||
172 | .flags = I2C_M_RD, | ||
173 | .len = 2, | ||
174 | .buf = read | ||
175 | } | ||
148 | }; | 176 | }; |
149 | 177 | ||
150 | write[0] = dev + 1; | 178 | write[0] = dev + 1; |