Lines Matching refs:client
45 static void start_fw_load(struct i2c_client *client) in start_fw_load() argument
48 cx25840_write(client, 0x800, 0x00); in start_fw_load()
49 cx25840_write(client, 0x801, 0x00); in start_fw_load()
51 cx25840_write(client, 0x803, 0x0b); in start_fw_load()
53 cx25840_write(client, 0x000, 0x20); in start_fw_load()
56 static void end_fw_load(struct i2c_client *client) in end_fw_load() argument
59 cx25840_write(client, 0x000, 0x00); in end_fw_load()
61 cx25840_write(client, 0x803, 0x03); in end_fw_load()
68 static const char *get_fw_name(struct i2c_client *client) in get_fw_name() argument
70 struct cx25840_state *state = to_state(i2c_get_clientdata(client)); in get_fw_name()
81 static int check_fw_load(struct i2c_client *client, int size) in check_fw_load() argument
84 int s = cx25840_read(client, 0x801) << 8; in check_fw_load()
85 s |= cx25840_read(client, 0x800); in check_fw_load()
88 v4l_err(client, "firmware %s load failed\n", in check_fw_load()
89 get_fw_name(client)); in check_fw_load()
93 v4l_info(client, "loaded %s firmware (%d bytes)\n", in check_fw_load()
94 get_fw_name(client), size); in check_fw_load()
98 static int fw_write(struct i2c_client *client, const u8 *data, int size) in fw_write() argument
100 if (i2c_master_send(client, data, size) < size) { in fw_write()
101 v4l_err(client, "firmware load i2c failure\n"); in fw_write()
108 int cx25840_loadfw(struct i2c_client *client) in cx25840_loadfw() argument
110 struct cx25840_state *state = to_state(i2c_get_clientdata(client)); in cx25840_loadfw()
114 const char *fwname = get_fw_name(client); in cx25840_loadfw()
121 gpio_oe = cx25840_read(client, 0x160); in cx25840_loadfw()
122 gpio_da = cx25840_read(client, 0x164); in cx25840_loadfw()
129 if (request_firmware(&fw, fwname, FWDEV(client)) != 0) { in cx25840_loadfw()
130 v4l_err(client, "unable to open firmware %s\n", fwname); in cx25840_loadfw()
134 start_fw_load(client); in cx25840_loadfw()
146 retval = fw_write(client, buffer, len + 2); in cx25840_loadfw()
157 end_fw_load(client); in cx25840_loadfw()
164 cx25840_write(client, 0x160, gpio_oe); in cx25840_loadfw()
165 cx25840_write(client, 0x164, gpio_da); in cx25840_loadfw()
168 return check_fw_load(client, size); in cx25840_loadfw()