diff options
Diffstat (limited to 'drivers/input/joystick/as5011.c')
-rw-r--r-- | drivers/input/joystick/as5011.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c index c96653b58867..121cd63d3334 100644 --- a/drivers/input/joystick/as5011.c +++ b/drivers/input/joystick/as5011.c | |||
@@ -85,7 +85,10 @@ static int as5011_i2c_write(struct i2c_client *client, | |||
85 | { | 85 | { |
86 | uint8_t data[2] = { aregaddr, avalue }; | 86 | uint8_t data[2] = { aregaddr, avalue }; |
87 | struct i2c_msg msg = { | 87 | struct i2c_msg msg = { |
88 | client->addr, I2C_M_IGNORE_NAK, 2, (uint8_t *)data | 88 | .addr = client->addr, |
89 | .flags = I2C_M_IGNORE_NAK, | ||
90 | .len = 2, | ||
91 | .buf = (uint8_t *)data | ||
89 | }; | 92 | }; |
90 | int error; | 93 | int error; |
91 | 94 | ||
@@ -98,8 +101,18 @@ static int as5011_i2c_read(struct i2c_client *client, | |||
98 | { | 101 | { |
99 | uint8_t data[2] = { aregaddr }; | 102 | uint8_t data[2] = { aregaddr }; |
100 | struct i2c_msg msg_set[2] = { | 103 | struct i2c_msg msg_set[2] = { |
101 | { client->addr, I2C_M_REV_DIR_ADDR, 1, (uint8_t *)data }, | 104 | { |
102 | { client->addr, I2C_M_RD | I2C_M_NOSTART, 1, (uint8_t *)data } | 105 | .addr = client->addr, |
106 | .flags = I2C_M_REV_DIR_ADDR, | ||
107 | .len = 1, | ||
108 | .buf = (uint8_t *)data | ||
109 | }, | ||
110 | { | ||
111 | .addr = client->addr, | ||
112 | .flags = I2C_M_RD | I2C_M_NOSTART, | ||
113 | .len = 1, | ||
114 | .buf = (uint8_t *)data | ||
115 | } | ||
103 | }; | 116 | }; |
104 | int error; | 117 | int error; |
105 | 118 | ||
@@ -144,7 +157,7 @@ out: | |||
144 | return IRQ_HANDLED; | 157 | return IRQ_HANDLED; |
145 | } | 158 | } |
146 | 159 | ||
147 | static int __devinit as5011_configure_chip(struct as5011_device *as5011, | 160 | static int as5011_configure_chip(struct as5011_device *as5011, |
148 | const struct as5011_platform_data *plat_dat) | 161 | const struct as5011_platform_data *plat_dat) |
149 | { | 162 | { |
150 | struct i2c_client *client = as5011->i2c_client; | 163 | struct i2c_client *client = as5011->i2c_client; |
@@ -212,8 +225,8 @@ static int __devinit as5011_configure_chip(struct as5011_device *as5011, | |||
212 | return 0; | 225 | return 0; |
213 | } | 226 | } |
214 | 227 | ||
215 | static int __devinit as5011_probe(struct i2c_client *client, | 228 | static int as5011_probe(struct i2c_client *client, |
216 | const struct i2c_device_id *id) | 229 | const struct i2c_device_id *id) |
217 | { | 230 | { |
218 | const struct as5011_platform_data *plat_data; | 231 | const struct as5011_platform_data *plat_data; |
219 | struct as5011_device *as5011; | 232 | struct as5011_device *as5011; |
@@ -328,7 +341,7 @@ err_free_mem: | |||
328 | return error; | 341 | return error; |
329 | } | 342 | } |
330 | 343 | ||
331 | static int __devexit as5011_remove(struct i2c_client *client) | 344 | static int as5011_remove(struct i2c_client *client) |
332 | { | 345 | { |
333 | struct as5011_device *as5011 = i2c_get_clientdata(client); | 346 | struct as5011_device *as5011 = i2c_get_clientdata(client); |
334 | 347 | ||
@@ -353,7 +366,7 @@ static struct i2c_driver as5011_driver = { | |||
353 | .name = "as5011", | 366 | .name = "as5011", |
354 | }, | 367 | }, |
355 | .probe = as5011_probe, | 368 | .probe = as5011_probe, |
356 | .remove = __devexit_p(as5011_remove), | 369 | .remove = as5011_remove, |
357 | .id_table = as5011_id, | 370 | .id_table = as5011_id, |
358 | }; | 371 | }; |
359 | 372 | ||