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