• Home
  • Raw
  • Download

Lines Matching refs:client

92 				  struct s3c_adc_client *client)  in s3c_adc_select()  argument
97 client->select_cb(client, 1); in s3c_adc_select()
104 if (!client->is_ts) { in s3c_adc_select()
106 writel(client->channel & 0xf, adc->regs + S5P_ADCMUX); in s3c_adc_select()
108 writel(client->channel & 0xf, in s3c_adc_select()
111 con |= S3C2410_ADCCON_SELMUX(client->channel); in s3c_adc_select()
145 int s3c_adc_start(struct s3c_adc_client *client, in s3c_adc_start() argument
158 if (client->is_ts && adc->ts_pend) { in s3c_adc_start()
163 client->channel = channel; in s3c_adc_start()
164 client->nr_samples = nr_samples; in s3c_adc_start()
166 if (client->is_ts) in s3c_adc_start()
167 adc->ts_pend = client; in s3c_adc_start()
169 list_add_tail(&client->pend, &adc_pending); in s3c_adc_start()
180 static void s3c_convert_done(struct s3c_adc_client *client, in s3c_convert_done() argument
183 client->result = v; in s3c_convert_done()
184 wake_up(client->wait); in s3c_convert_done()
187 int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch) in s3c_adc_read() argument
192 client->convert_cb = s3c_convert_done; in s3c_adc_read()
193 client->wait = &wake; in s3c_adc_read()
194 client->result = -1; in s3c_adc_read()
196 ret = s3c_adc_start(client, ch, 1); in s3c_adc_read()
200 ret = wait_event_timeout(wake, client->result >= 0, HZ / 2); in s3c_adc_read()
201 if (client->result < 0) { in s3c_adc_read()
206 client->convert_cb = NULL; in s3c_adc_read()
207 return client->result; in s3c_adc_read()
214 static void s3c_adc_default_select(struct s3c_adc_client *client, in s3c_adc_default_select() argument
220 void (*select)(struct s3c_adc_client *client, in s3c_adc_register() argument
222 void (*conv)(struct s3c_adc_client *client, in s3c_adc_register() argument
227 struct s3c_adc_client *client; in s3c_adc_register() local
237 client = kzalloc(sizeof(*client), GFP_KERNEL); in s3c_adc_register()
238 if (!client) in s3c_adc_register()
241 client->pdev = pdev; in s3c_adc_register()
242 client->is_ts = is_ts; in s3c_adc_register()
243 client->select_cb = select; in s3c_adc_register()
244 client->convert_cb = conv; in s3c_adc_register()
246 return client; in s3c_adc_register()
250 void s3c_adc_release(struct s3c_adc_client *client) in s3c_adc_release() argument
257 if (adc_dev->cur == client) in s3c_adc_release()
259 if (adc_dev->ts_pend == client) in s3c_adc_release()
267 if (tmp == client) in s3c_adc_release()
276 kfree(client); in s3c_adc_release()
283 struct s3c_adc_client *client = adc->cur; in s3c_adc_irq() local
287 if (!client) { in s3c_adc_irq()
294 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); in s3c_adc_irq()
296 client->nr_samples--; in s3c_adc_irq()
307 if (client->convert_cb) in s3c_adc_irq()
308 (client->convert_cb)(client, data0, data1, &client->nr_samples); in s3c_adc_irq()
310 if (client->nr_samples > 0) { in s3c_adc_irq()
313 client->select_cb(client, 1); in s3c_adc_irq()
317 (client->select_cb)(client, 0); in s3c_adc_irq()