Lines Matching refs:cmd
14 static void cmd_init(struct si2168_cmd *cmd, const u8 *buf, int wlen, int rlen) in cmd_init() argument
16 memcpy(cmd->args, buf, wlen); in cmd_init()
17 cmd->wlen = wlen; in cmd_init()
18 cmd->rlen = rlen; in cmd_init()
22 static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd) in si2168_cmd_execute() argument
30 if (cmd->wlen) { in si2168_cmd_execute()
32 ret = i2c_master_send(client, cmd->args, cmd->wlen); in si2168_cmd_execute()
35 } else if (ret != cmd->wlen) { in si2168_cmd_execute()
41 if (cmd->rlen) { in si2168_cmd_execute()
46 ret = i2c_master_recv(client, cmd->args, cmd->rlen); in si2168_cmd_execute()
49 } else if (ret != cmd->rlen) { in si2168_cmd_execute()
55 if ((cmd->args[0] >> 7) & 0x01) in si2168_cmd_execute()
64 if ((cmd->args[0] >> 6) & 0x01) { in si2168_cmd_execute()
69 if (!((cmd->args[0] >> 7) & 0x01)) { in si2168_cmd_execute()
87 struct si2168_cmd cmd; in si2168_ts_bus_ctrl() local
94 cmd_init(&cmd, "\x14\x00\x0d\x10\xe8\x03", 6, 4); in si2168_ts_bus_ctrl()
95 ret = si2168_cmd_execute(client, &cmd); in si2168_ts_bus_ctrl()
100 cmd_init(&cmd, "\x14\x00\x01\x10\x10\x00", 6, 4); in si2168_ts_bus_ctrl()
102 cmd.args[4] = SI2168_TS_CLK_MANUAL; in si2168_ts_bus_ctrl()
104 cmd.args[4] |= dev->ts_mode; in si2168_ts_bus_ctrl()
106 cmd.args[4] |= SI2168_TS_TRISTATE; in si2168_ts_bus_ctrl()
108 cmd.args[4] |= 0x40; in si2168_ts_bus_ctrl()
109 ret = si2168_cmd_execute(client, &cmd); in si2168_ts_bus_ctrl()
121 struct si2168_cmd cmd; in si2168_read_status() local
132 cmd_init(&cmd, "\xa0\x01", 2, 13); in si2168_read_status()
135 cmd_init(&cmd, "\x90\x01", 2, 9); in si2168_read_status()
138 cmd_init(&cmd, "\x50\x01", 2, 14); in si2168_read_status()
145 ret = si2168_cmd_execute(client, &cmd); in si2168_read_status()
149 switch ((cmd.args[2] >> 1) & 0x03) { in si2168_read_status()
164 c->cnr.stat[0].svalue = cmd.args[3] * 1000 / 4; in si2168_read_status()
171 *status, cmd.rlen, cmd.args); in si2168_read_status()
175 cmd_init(&cmd, "\x82\x00", 2, 3); in si2168_read_status()
176 ret = si2168_cmd_execute(client, &cmd); in si2168_read_status()
184 utmp = clamp(8 - cmd.args[1], 0, 8); in si2168_read_status()
188 utmp1 = cmd.args[2] * utmp1; in si2168_read_status()
193 utmp1, utmp2, cmd.args[2], cmd.args[1]); in si2168_read_status()
206 cmd_init(&cmd, "\x84\x01", 2, 3); in si2168_read_status()
207 ret = si2168_cmd_execute(client, &cmd); in si2168_read_status()
211 utmp1 = cmd.args[2] << 8 | cmd.args[1] << 0; in si2168_read_status()
236 struct si2168_cmd cmd; in si2168_set_frontend() local
292 cmd_init(&cmd, "\x88\x02\x02\x02\x02", 5, 5); in si2168_set_frontend()
293 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
299 cmd_init(&cmd, "\x89\x21\x06\x11\xff\x98", 6, 3); in si2168_set_frontend()
301 cmd_init(&cmd, "\x89\x21\x06\x11\x89\xf0", 6, 3); in si2168_set_frontend()
303 cmd_init(&cmd, "\x89\x21\x06\x11\x89\x20", 6, 3); in si2168_set_frontend()
304 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
310 cmd.args[0] = 0x52; in si2168_set_frontend()
311 cmd.args[1] = c->stream_id & 0xff; in si2168_set_frontend()
312 cmd.args[2] = c->stream_id == NO_STREAM_ID_FILTER ? 0 : 1; in si2168_set_frontend()
313 cmd.wlen = 3; in si2168_set_frontend()
314 cmd.rlen = 1; in si2168_set_frontend()
315 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
320 cmd_init(&cmd, "\x51\x03", 2, 12); in si2168_set_frontend()
321 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
325 cmd_init(&cmd, "\x12\x08\x04", 3, 3); in si2168_set_frontend()
326 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
330 cmd_init(&cmd, "\x14\x00\x0c\x10\x12\x00", 6, 4); in si2168_set_frontend()
331 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
335 cmd_init(&cmd, "\x14\x00\x06\x10\x24\x00", 6, 4); in si2168_set_frontend()
336 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
340 cmd_init(&cmd, "\x14\x00\x07\x10\x00\x24", 6, 4); in si2168_set_frontend()
341 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
345 cmd_init(&cmd, "\x14\x00\x0a\x10\x00\x00", 6, 4); in si2168_set_frontend()
346 cmd.args[4] = delivery_system | bandwidth; in si2168_set_frontend()
348 cmd.args[5] |= 1; in si2168_set_frontend()
349 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
355 cmd_init(&cmd, "\x14\x00\x02\x11\x00\x00", 6, 4); in si2168_set_frontend()
356 cmd.args[4] = ((c->symbol_rate / 1000) >> 0) & 0xff; in si2168_set_frontend()
357 cmd.args[5] = ((c->symbol_rate / 1000) >> 8) & 0xff; in si2168_set_frontend()
358 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
363 cmd_init(&cmd, "\x14\x00\x0f\x10\x10\x00", 6, 4); in si2168_set_frontend()
364 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
368 cmd_init(&cmd, "\x14\x00\x09\x10\xe3\x08", 6, 4); in si2168_set_frontend()
369 cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10; in si2168_set_frontend()
370 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
374 cmd_init(&cmd, "\x14\x00\x08\x10\xd7\x05", 6, 4); in si2168_set_frontend()
375 cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10; in si2168_set_frontend()
376 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
380 cmd_init(&cmd, "\x14\x00\x01\x12\x00\x00", 6, 4); in si2168_set_frontend()
381 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
385 cmd_init(&cmd, "\x14\x00\x01\x03\x0c\x00", 6, 4); in si2168_set_frontend()
386 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
390 cmd_init(&cmd, "\x85", 1, 1); in si2168_set_frontend()
391 ret = si2168_cmd_execute(client, &cmd); in si2168_set_frontend()
415 struct si2168_cmd cmd; in si2168_init() local
420 cmd_init(&cmd, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", in si2168_init()
422 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
428 cmd_init(&cmd, "\xc0\x06\x08\x0f\x00\x20\x21\x01", 8, 1); in si2168_init()
429 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
434 cmd_init(&cmd, "\x85", 1, 1); in si2168_init()
435 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
443 cmd_init(&cmd, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8, 1); in si2168_init()
444 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
468 cmd_init(&cmd, &fw->data[(fw->size - remaining) + 1], in si2168_init()
470 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
477 cmd_init(&cmd, &fw->data[fw->size - remaining], 8, 1); in si2168_init()
478 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
494 cmd_init(&cmd, "\x01\x01", 2, 1); in si2168_init()
495 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
500 cmd_init(&cmd, "\x11", 1, 10); in si2168_init()
501 ret = si2168_cmd_execute(client, &cmd); in si2168_init()
505 dev->version = (cmd.args[9] + '@') << 24 | (cmd.args[6] - '0') << 16 | in si2168_init()
506 (cmd.args[7] - '0') << 8 | (cmd.args[8]) << 0; in si2168_init()
564 struct si2168_cmd cmd; in si2168_sleep() local
579 cmd_init(&cmd, "\x13", 1, 0); in si2168_sleep()
580 ret = si2168_cmd_execute(client, &cmd); in si2168_sleep()
602 struct si2168_cmd cmd; in si2168_select() local
605 cmd_init(&cmd, "\xc0\x0d\x01", 3, 0); in si2168_select()
606 ret = si2168_cmd_execute(client, &cmd); in si2168_select()
620 struct si2168_cmd cmd; in si2168_deselect() local
623 cmd_init(&cmd, "\xc0\x0d\x00", 3, 0); in si2168_deselect()
624 ret = si2168_cmd_execute(client, &cmd); in si2168_deselect()
680 struct si2168_cmd cmd; in si2168_probe() local
694 cmd_init(&cmd, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", in si2168_probe()
696 ret = si2168_cmd_execute(client, &cmd); in si2168_probe()
701 cmd_init(&cmd, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8, 1); in si2168_probe()
702 ret = si2168_cmd_execute(client, &cmd); in si2168_probe()
707 cmd_init(&cmd, "\x02", 1, 13); in si2168_probe()
708 ret = si2168_cmd_execute(client, &cmd); in si2168_probe()
712 dev->chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | in si2168_probe()
713 cmd.args[3] << 8 | cmd.args[4] << 0; in si2168_probe()
730 cmd.args[2], cmd.args[1], cmd.args[3], cmd.args[4]); in si2168_probe()
735 dev->version = (cmd.args[1]) << 24 | (cmd.args[3] - '0') << 16 | in si2168_probe()
736 (cmd.args[4] - '0') << 8 | (cmd.args[5]) << 0; in si2168_probe()