Lines Matching refs:client

32 static void start_fw_load(struct i2c_client *client)
35 cx25840_write(client, 0x800, 0x00);
36 cx25840_write(client, 0x801, 0x00);
38 cx25840_write(client, 0x803, 0x0b);
40 cx25840_write(client, 0x000, 0x20);
43 static void end_fw_load(struct i2c_client *client)
46 cx25840_write(client, 0x000, 0x00);
48 cx25840_write(client, 0x803, 0x03);
55 static const char *get_fw_name(struct i2c_client *client)
57 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
68 static int check_fw_load(struct i2c_client *client, int size)
71 int s = cx25840_read(client, 0x801) << 8;
72 s |= cx25840_read(client, 0x800);
75 v4l_err(client, "firmware %s load failed\n",
76 get_fw_name(client));
80 v4l_info(client, "loaded %s firmware (%d bytes)\n",
81 get_fw_name(client), size);
85 static int fw_write(struct i2c_client *client, const u8 *data, int size)
87 if (i2c_master_send(client, data, size) < size) {
88 v4l_err(client, "firmware load i2c failure\n");
95 int cx25840_loadfw(struct i2c_client *client)
97 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
101 const char *fwname = get_fw_name(client);
108 gpio_oe = cx25840_read(client, 0x160);
109 gpio_da = cx25840_read(client, 0x164);
116 if (request_firmware(&fw, fwname, FWDEV(client)) != 0) {
117 v4l_err(client, "unable to open firmware %s\n", fwname);
121 start_fw_load(client);
133 retval = fw_write(client, buffer, len + 2);
144 end_fw_load(client);
151 cx25840_write(client, 0x160, gpio_oe);
152 cx25840_write(client, 0x164, gpio_da);
155 return check_fw_load(client, size);