Lines Matching full:taos

3  * Driver for the TAOS evaluation modules
41 /* TAOS TSL2550 EVM */
49 if (!strncmp(adapter->name, "TAOS TSL2550 EVM", 16)) { in taos_instantiate_device()
63 struct taos_data *taos = serio_get_drvdata(serio); in taos_smbus_xfer() local
68 p = taos->buffer; in taos_smbus_xfer()
72 if (addr != taos->addr) in taos_smbus_xfer()
93 /* Send the transaction to the TAOS EVM */ in taos_smbus_xfer()
94 dev_dbg(&adapter->dev, "Command buffer: %s\n", taos->buffer); in taos_smbus_xfer()
95 for (p = taos->buffer; *p; p++) in taos_smbus_xfer()
98 taos->addr = addr; in taos_smbus_xfer()
101 taos->pos = 0; in taos_smbus_xfer()
102 taos->state = TAOS_STATE_RECV; in taos_smbus_xfer()
104 wait_event_interruptible_timeout(wq, taos->state == TAOS_STATE_IDLE, in taos_smbus_xfer()
106 if (taos->state != TAOS_STATE_IDLE in taos_smbus_xfer()
107 || taos->pos != 5) { in taos_smbus_xfer()
109 taos->pos); in taos_smbus_xfer()
112 dev_dbg(&adapter->dev, "Answer buffer: %s\n", taos->buffer); in taos_smbus_xfer()
115 p = taos->buffer + 1; in taos_smbus_xfer()
152 struct taos_data *taos = serio_get_drvdata(serio); in taos_interrupt() local
154 switch (taos->state) { in taos_interrupt()
156 taos->buffer[taos->pos++] = data; in taos_interrupt()
158 || taos->pos == TAOS_BUFFER_SIZE - 1) { in taos_interrupt()
159 taos->buffer[taos->pos] = '\0'; in taos_interrupt()
160 taos->state = TAOS_STATE_IDLE; in taos_interrupt()
165 taos->state = TAOS_STATE_IDLE; in taos_interrupt()
169 taos->buffer[taos->pos++] = data; in taos_interrupt()
171 taos->buffer[taos->pos] = '\0'; in taos_interrupt()
172 taos->state = TAOS_STATE_IDLE; in taos_interrupt()
187 start = strstr(buffer, "TAOS "); in taos_adapter_name()
201 struct taos_data *taos; in taos_connect() local
206 taos = kzalloc(sizeof(struct taos_data), GFP_KERNEL); in taos_connect()
207 if (!taos) { in taos_connect()
211 taos->state = TAOS_STATE_INIT; in taos_connect()
212 serio_set_drvdata(serio, taos); in taos_connect()
218 adapter = &taos->adapter; in taos_connect()
224 /* Reset the TAOS evaluation module to identify it */ in taos_connect()
226 wait_event_interruptible_timeout(wq, taos->state == TAOS_STATE_IDLE, in taos_connect()
229 if (taos->state != TAOS_STATE_IDLE) { in taos_connect()
231 dev_err(&serio->dev, "TAOS EVM reset failed (state=%d, " in taos_connect()
232 "pos=%d)\n", taos->state, taos->pos); in taos_connect()
236 name = taos_adapter_name(taos->buffer); in taos_connect()
239 dev_err(&serio->dev, "TAOS EVM identification failed\n"); in taos_connect()
245 taos->state = TAOS_STATE_EOFF; in taos_connect()
248 wait_event_interruptible_timeout(wq, taos->state == TAOS_STATE_IDLE, in taos_connect()
250 if (taos->state != TAOS_STATE_IDLE) { in taos_connect()
252 dev_err(&serio->dev, "TAOS EVM echo off failed " in taos_connect()
253 "(state=%d)\n", taos->state); in taos_connect()
260 dev_info(&serio->dev, "Connected to TAOS EVM\n"); in taos_connect()
262 taos->client = taos_instantiate_device(adapter); in taos_connect()
268 kfree(taos); in taos_connect()
275 struct taos_data *taos = serio_get_drvdata(serio); in taos_disconnect() local
277 i2c_unregister_device(taos->client); in taos_disconnect()
278 i2c_del_adapter(&taos->adapter); in taos_disconnect()
280 kfree(taos); in taos_disconnect()
282 dev_info(&serio->dev, "Disconnected from TAOS EVM\n"); in taos_disconnect()
298 .name = "taos-evm",
300 .description = "TAOS evaluation module driver",
310 MODULE_DESCRIPTION("TAOS evaluation module driver");