• Home
  • Raw
  • Download

Lines Matching refs:s

26 static int sp2_read_i2c(struct sp2 *s, u8 reg, u8 *buf, int len)  in sp2_read_i2c()  argument
29 struct i2c_client *client = s->client; in sp2_read_i2c()
56 dev_dbg(&s->client->dev, "addr=0x%04x, reg = 0x%02x, data = %02x\n", in sp2_read_i2c()
62 static int sp2_write_i2c(struct sp2 *s, u8 reg, u8 *buf, int len) in sp2_write_i2c() argument
66 struct i2c_client *client = s->client; in sp2_write_i2c()
95 dev_dbg(&s->client->dev, "addr=0x%04x, reg = 0x%02x, data = %*ph\n", in sp2_write_i2c()
104 struct sp2 *s = en50221->data; in sp2_ci_op_cam() local
107 int (*ci_op_cam)(void*, u8, int, u8, int*) = s->ci_control; in sp2_ci_op_cam()
116 if (s->module_access_type != acs) { in sp2_ci_op_cam()
117 ret = sp2_read_i2c(s, 0x00, &store, 1); in sp2_ci_op_cam()
125 ret = sp2_write_i2c(s, 0x00, &store, 1); in sp2_ci_op_cam()
130 s->module_access_type = acs; in sp2_ci_op_cam()
134 ret = ci_op_cam(s->priv, read, addr, data, &mem); in sp2_ci_op_cam()
136 dev_err(&s->client->dev, "callback not defined"); in sp2_ci_op_cam()
143 dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", in sp2_ci_op_cam()
185 struct sp2 *s = en50221->data; in sp2_ci_slot_reset() local
189 dev_dbg(&s->client->dev, "slot: %d\n", slot); in sp2_ci_slot_reset()
196 ret = sp2_write_i2c(s, 0x00, &buf, 1); in sp2_ci_slot_reset()
205 ret = sp2_write_i2c(s, 0x00, &buf, 1); in sp2_ci_slot_reset()
217 struct sp2 *s = en50221->data; in sp2_ci_slot_shutdown() local
219 dev_dbg(&s->client->dev, "slot:%d\n", slot); in sp2_ci_slot_shutdown()
227 struct sp2 *s = en50221->data; in sp2_ci_slot_ts_enable() local
230 dev_dbg(&s->client->dev, "slot:%d\n", slot); in sp2_ci_slot_ts_enable()
235 sp2_read_i2c(s, 0x00, &buf, 1); in sp2_ci_slot_ts_enable()
239 return sp2_write_i2c(s, 0, &buf, 1); in sp2_ci_slot_ts_enable()
245 struct sp2 *s = en50221->data; in sp2_ci_poll_slot_status() local
249 dev_dbg(&s->client->dev, "slot:%d open:%d\n", slot, open); in sp2_ci_poll_slot_status()
255 if (time_after(jiffies, s->next_status_checked_time)) { in sp2_ci_poll_slot_status()
256 ret = sp2_read_i2c(s, 0x00, buf, 1); in sp2_ci_poll_slot_status()
257 s->next_status_checked_time = jiffies + msecs_to_jiffies(1000); in sp2_ci_poll_slot_status()
263 s->status = DVB_CA_EN50221_POLL_CAM_PRESENT | in sp2_ci_poll_slot_status()
266 s->status = 0; in sp2_ci_poll_slot_status()
269 return s->status; in sp2_ci_poll_slot_status()
272 static int sp2_init(struct sp2 *s) in sp2_init() argument
313 dev_dbg(&s->client->dev, "\n"); in sp2_init()
315 s->ca.owner = THIS_MODULE; in sp2_init()
316 s->ca.read_attribute_mem = sp2_ci_read_attribute_mem; in sp2_init()
317 s->ca.write_attribute_mem = sp2_ci_write_attribute_mem; in sp2_init()
318 s->ca.read_cam_control = sp2_ci_read_cam_control; in sp2_init()
319 s->ca.write_cam_control = sp2_ci_write_cam_control; in sp2_init()
320 s->ca.slot_reset = sp2_ci_slot_reset; in sp2_init()
321 s->ca.slot_shutdown = sp2_ci_slot_shutdown; in sp2_init()
322 s->ca.slot_ts_enable = sp2_ci_slot_ts_enable; in sp2_init()
323 s->ca.poll_slot_status = sp2_ci_poll_slot_status; in sp2_init()
324 s->ca.data = s; in sp2_init()
325 s->module_access_type = 0; in sp2_init()
328 ret = sp2_write_i2c(s, 0x00, &cimax_init[0], 34); in sp2_init()
334 ret = sp2_write_i2c(s, 0x1f, &buf, 1); in sp2_init()
339 ret = sp2_write_i2c(s, 0x18, &buf, 1); in sp2_init()
343 ret = dvb_ca_en50221_init(s->dvb_adap, &s->ca, 0, 1); in sp2_init()
350 dev_dbg(&s->client->dev, "init failed=%d\n", ret); in sp2_init()
356 struct sp2 *s; in sp2_exit() local
363 s = i2c_get_clientdata(client); in sp2_exit()
364 if (s == NULL) in sp2_exit()
367 if (s->ca.data == NULL) in sp2_exit()
370 dvb_ca_en50221_release(&s->ca); in sp2_exit()
379 struct sp2 *s; in sp2_probe() local
384 s = kzalloc(sizeof(struct sp2), GFP_KERNEL); in sp2_probe()
385 if (!s) { in sp2_probe()
391 s->client = client; in sp2_probe()
392 s->dvb_adap = cfg->dvb_adap; in sp2_probe()
393 s->priv = cfg->priv; in sp2_probe()
394 s->ci_control = cfg->ci_control; in sp2_probe()
396 i2c_set_clientdata(client, s); in sp2_probe()
398 ret = sp2_init(s); in sp2_probe()
402 dev_info(&s->client->dev, "CIMaX SP2 successfully attached\n"); in sp2_probe()
406 kfree(s); in sp2_probe()
413 struct sp2 *s = i2c_get_clientdata(client); in sp2_remove() local
417 kfree(s); in sp2_remove()