Lines Matching +full:ext +full:- +full:active +full:- +full:high
1 // SPDX-License-Identifier: GPL-2.0-or-later
8 * DVB-S2 CI card (cimax2) with following copyrights:
20 struct i2c_client *client = s->client; in sp2_read_i2c()
21 struct i2c_adapter *adap = client->adapter; in sp2_read_i2c()
24 .addr = client->addr, in sp2_read_i2c()
29 .addr = client->addr, in sp2_read_i2c()
39 dev_err(&client->dev, "i2c read error, reg = 0x%02x, status = %d\n", in sp2_read_i2c()
44 return -EIO; in sp2_read_i2c()
47 dev_dbg(&s->client->dev, "addr=0x%04x, reg = 0x%02x, data = %02x\n", in sp2_read_i2c()
48 client->addr, reg, buf[0]); in sp2_read_i2c()
57 struct i2c_client *client = s->client; in sp2_write_i2c()
58 struct i2c_adapter *adap = client->adapter; in sp2_write_i2c()
60 .addr = client->addr, in sp2_write_i2c()
67 dev_err(&client->dev, "i2c wr reg=%02x: len=%d is too big!\n", in sp2_write_i2c()
69 return -EINVAL; in sp2_write_i2c()
78 dev_err(&client->dev, "i2c write error, reg = 0x%02x, status = %d\n", in sp2_write_i2c()
83 return -EIO; in sp2_write_i2c()
86 dev_dbg(&s->client->dev, "addr=0x%04x, reg = 0x%02x, data = %*ph\n", in sp2_write_i2c()
87 client->addr, reg, len, buf); in sp2_write_i2c()
95 struct sp2 *s = en50221->data; in sp2_ci_op_cam()
98 int (*ci_op_cam)(void*, u8, int, u8, int*) = s->ci_control; in sp2_ci_op_cam()
101 return -EINVAL; in sp2_ci_op_cam()
107 if (s->module_access_type != acs) { in sp2_ci_op_cam()
121 s->module_access_type = acs; in sp2_ci_op_cam()
125 ret = ci_op_cam(s->priv, read, addr, data, &mem); in sp2_ci_op_cam()
127 dev_err(&s->client->dev, "callback not defined"); in sp2_ci_op_cam()
128 return -EINVAL; in sp2_ci_op_cam()
134 dev_dbg(&s->client->dev, "%s: slot=%d, addr=0x%04x, %s, data=%x", in sp2_ci_op_cam()
176 struct sp2 *s = en50221->data; in sp2_ci_slot_reset()
180 dev_dbg(&s->client->dev, "slot: %d\n", slot); in sp2_ci_slot_reset()
183 return -EINVAL; in sp2_ci_slot_reset()
208 struct sp2 *s = en50221->data; in sp2_ci_slot_shutdown()
210 dev_dbg(&s->client->dev, "slot:%d\n", slot); in sp2_ci_slot_shutdown()
218 struct sp2 *s = en50221->data; in sp2_ci_slot_ts_enable()
221 dev_dbg(&s->client->dev, "slot:%d\n", slot); in sp2_ci_slot_ts_enable()
224 return -EINVAL; in sp2_ci_slot_ts_enable()
236 struct sp2 *s = en50221->data; in sp2_ci_poll_slot_status()
240 dev_dbg(&s->client->dev, "slot:%d open:%d\n", slot, open); in sp2_ci_poll_slot_status()
246 if (time_after(jiffies, s->next_status_checked_time)) { in sp2_ci_poll_slot_status()
248 s->next_status_checked_time = jiffies + msecs_to_jiffies(1000); in sp2_ci_poll_slot_status()
254 s->status = DVB_CA_EN50221_POLL_CAM_PRESENT | in sp2_ci_poll_slot_status()
257 s->status = 0; in sp2_ci_poll_slot_status()
260 return s->status; in sp2_ci_poll_slot_status()
269 0x00, /* auto select mask high A */ in sp2_init()
271 0x00, /* auto select pattern high A */ in sp2_init()
278 0x00, /* auto select mask high B */ in sp2_init()
280 0x00, /* auto select pattern high B */ in sp2_init()
286 0x00, /* auto select mask high Ext */ in sp2_init()
287 0x00, /* auto select mask low Ext */ in sp2_init()
288 0x00, /* auto select pattern high Ext */ in sp2_init()
289 0x00, /* auto select pattern low Ext */ in sp2_init()
291 0x02, /* destination - module A */ in sp2_init()
296 0x05, /* EXTINT=active-high, INT=push-pull */ in sp2_init()
298 0x04, /* ack active low */ in sp2_init()
304 dev_dbg(&s->client->dev, "\n"); in sp2_init()
306 s->ca.owner = THIS_MODULE; in sp2_init()
307 s->ca.read_attribute_mem = sp2_ci_read_attribute_mem; in sp2_init()
308 s->ca.write_attribute_mem = sp2_ci_write_attribute_mem; in sp2_init()
309 s->ca.read_cam_control = sp2_ci_read_cam_control; in sp2_init()
310 s->ca.write_cam_control = sp2_ci_write_cam_control; in sp2_init()
311 s->ca.slot_reset = sp2_ci_slot_reset; in sp2_init()
312 s->ca.slot_shutdown = sp2_ci_slot_shutdown; in sp2_init()
313 s->ca.slot_ts_enable = sp2_ci_slot_ts_enable; in sp2_init()
314 s->ca.poll_slot_status = sp2_ci_poll_slot_status; in sp2_init()
315 s->ca.data = s; in sp2_init()
316 s->module_access_type = 0; in sp2_init()
334 ret = dvb_ca_en50221_init(s->dvb_adap, &s->ca, 0, 1); in sp2_init()
341 dev_dbg(&s->client->dev, "init failed=%d\n", ret); in sp2_init()
349 dev_dbg(&client->dev, "\n"); in sp2_exit()
358 if (!s->ca.data) in sp2_exit()
361 dvb_ca_en50221_release(&s->ca); in sp2_exit()
368 struct sp2_config *cfg = client->dev.platform_data; in sp2_probe()
372 dev_dbg(&client->dev, "\n"); in sp2_probe()
376 ret = -ENOMEM; in sp2_probe()
380 s->client = client; in sp2_probe()
381 s->dvb_adap = cfg->dvb_adap; in sp2_probe()
382 s->priv = cfg->priv; in sp2_probe()
383 s->ci_control = cfg->ci_control; in sp2_probe()
391 dev_info(&s->client->dev, "CIMaX SP2 successfully attached\n"); in sp2_probe()
394 dev_dbg(&client->dev, "init failed=%d\n", ret); in sp2_probe()
404 dev_dbg(&client->dev, "\n"); in sp2_remove()