Lines Matching refs:dev
49 static int lnb_command(struct ddb *dev, u32 link, u32 lnb, u32 cmd) in lnb_command() argument
53 v = LNB_TONE & (dev->link[link].lnb.tone << (15 - lnb)); in lnb_command()
54 ddbwritel(dev, cmd | v, tag | LNB_CONTROL(lnb)); in lnb_command()
56 v = ddbreadl(dev, tag | LNB_CONTROL(lnb)); in lnb_command()
62 dev_info(dev->dev, "%s lnb = %08x cmd = %08x\n", in lnb_command()
72 struct ddb *dev = port->dev; in max_send_master_cmd() local
76 u32 fmode = dev->link[port->lnr].lnb.fmode; in max_send_master_cmd()
83 mutex_lock(&dev->link[port->lnr].lnb.lock); in max_send_master_cmd()
84 ddbwritel(dev, 0, tag | LNB_BUF_LEVEL(dvb->input)); in max_send_master_cmd()
86 ddbwritel(dev, cmd->msg[i], tag | LNB_BUF_WRITE(dvb->input)); in max_send_master_cmd()
87 lnb_command(dev, port->lnr, dvb->input, LNB_CMD_DISEQC); in max_send_master_cmd()
88 mutex_unlock(&dev->link[port->lnr].lnb.lock); in max_send_master_cmd()
92 static int lnb_send_diseqc(struct ddb *dev, u32 link, u32 input, in lnb_send_diseqc() argument
98 ddbwritel(dev, 0, tag | LNB_BUF_LEVEL(input)); in lnb_send_diseqc()
100 ddbwritel(dev, cmd->msg[i], tag | LNB_BUF_WRITE(input)); in lnb_send_diseqc()
101 lnb_command(dev, link, input, LNB_CMD_DISEQC); in lnb_send_diseqc()
105 static int lnb_set_sat(struct ddb *dev, u32 link, u32 input, u32 sat, u32 band, in lnb_set_sat() argument
114 return lnb_send_diseqc(dev, link, input, &cmd); in lnb_set_sat()
117 static int lnb_set_tone(struct ddb *dev, u32 link, u32 input, in lnb_set_tone() argument
125 if (!(dev->link[link].lnb.tone & mask)) in lnb_set_tone()
127 dev->link[link].lnb.tone &= ~(1ULL << input); in lnb_set_tone()
130 if (dev->link[link].lnb.tone & mask) in lnb_set_tone()
132 dev->link[link].lnb.tone |= (1ULL << input); in lnb_set_tone()
139 s = lnb_command(dev, link, input, LNB_CMD_NOP); in lnb_set_tone()
143 static int lnb_set_voltage(struct ddb *dev, u32 link, u32 input, in lnb_set_voltage() argument
148 if (dev->link[link].lnb.oldvoltage[input] == voltage) in lnb_set_voltage()
152 if (dev->link[link].lnb.voltage[input]) in lnb_set_voltage()
154 lnb_command(dev, link, input, LNB_CMD_OFF); in lnb_set_voltage()
157 lnb_command(dev, link, input, LNB_CMD_LOW); in lnb_set_voltage()
160 lnb_command(dev, link, input, LNB_CMD_HIGH); in lnb_set_voltage()
166 dev->link[link].lnb.oldvoltage[input] = voltage; in lnb_set_voltage()
174 struct ddb *dev = port->dev; in max_set_input_unlocked() local
183 dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit; in max_set_input_unlocked()
185 dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit; in max_set_input_unlocked()
187 dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit; in max_set_input_unlocked()
197 struct ddb *dev = port->dev; in max_set_tone() local
201 u32 fmode = dev->link[port->lnr].lnb.fmode; in max_set_tone()
203 mutex_lock(&dev->link[port->lnr].lnb.lock); in max_set_tone()
209 res = lnb_set_tone(dev, port->lnr, dvb->input, tone); in max_set_tone()
227 mutex_unlock(&dev->link[port->lnr].lnb.lock); in max_set_tone()
235 struct ddb *dev = port->dev; in max_set_voltage() local
238 u32 nv, ov = dev->link[port->lnr].lnb.voltages; in max_set_voltage()
240 u32 fmode = dev->link[port->lnr].lnb.fmode; in max_set_voltage()
242 mutex_lock(&dev->link[port->lnr].lnb.lock); in max_set_voltage()
252 dev->link[port->lnr].lnb.voltage[dvb->input] &= in max_set_voltage()
255 dev->link[port->lnr].lnb.voltage[dvb->input] |= in max_set_voltage()
258 res = lnb_set_voltage(dev, port->lnr, dvb->input, voltage); in max_set_voltage()
263 dev->link[port->lnr].lnb.voltages &= in max_set_voltage()
266 dev->link[port->lnr].lnb.voltages |= in max_set_voltage()
269 nv = dev->link[port->lnr].lnb.voltages; in max_set_voltage()
287 dev, port->lnr, in max_set_voltage()
291 dev, port->lnr, in max_set_voltage()
295 dev, port->lnr, in max_set_voltage()
298 dev, port->lnr, in max_set_voltage()
302 dev, port->lnr, in max_set_voltage()
305 dev, port->lnr, in max_set_voltage()
309 dev, port->lnr, in max_set_voltage()
314 dev, port->lnr, in max_set_voltage()
318 dev, port->lnr, in max_set_voltage()
321 dev, port->lnr, in max_set_voltage()
324 dev, port->lnr, in max_set_voltage()
331 mutex_unlock(&dev->link[port->lnr].lnb.lock); in max_set_voltage()
348 struct ddb *dev = link->dev; in mxl_fw_read() local
350 dev_info(dev->dev, "Read mxl_fw from link %u\n", link->nr); in mxl_fw_read()
352 return ddbridge_flashread(dev, link->nr, buf, 0xc0000, len); in mxl_fw_read()
355 int ddb_lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fm) in ddb_lnb_init_fmode() argument
361 dev_info(dev->dev, "Set fmode link %u = %u\n", l, fm); in ddb_lnb_init_fmode()
365 lnb_set_sat(dev, l, 0, fmode_sat, 0, 0); in ddb_lnb_init_fmode()
367 lnb_set_sat(dev, l, 1, fmode_sat, 0, 1); in ddb_lnb_init_fmode()
368 lnb_set_sat(dev, l, 2, fmode_sat, 1, 0); in ddb_lnb_init_fmode()
370 lnb_set_sat(dev, l, 1, fmode_sat, 1, 0); in ddb_lnb_init_fmode()
371 lnb_set_sat(dev, l, 2, fmode_sat, 0, 1); in ddb_lnb_init_fmode()
373 lnb_set_sat(dev, l, 3, fmode_sat, 1, 1); in ddb_lnb_init_fmode()
375 lnb_set_tone(dev, l, 0, SEC_TONE_OFF); in ddb_lnb_init_fmode()
377 lnb_set_tone(dev, l, 1, SEC_TONE_OFF); in ddb_lnb_init_fmode()
378 lnb_set_tone(dev, l, 2, SEC_TONE_ON); in ddb_lnb_init_fmode()
380 lnb_set_tone(dev, l, 1, SEC_TONE_ON); in ddb_lnb_init_fmode()
381 lnb_set_tone(dev, l, 2, SEC_TONE_OFF); in ddb_lnb_init_fmode()
383 lnb_set_tone(dev, l, 3, SEC_TONE_ON); in ddb_lnb_init_fmode()
401 struct ddb *dev = input->port->dev; in ddb_fe_attach_mxl5xx() local
405 struct ddb_link *link = &dev->link[port->lnr]; in ddb_fe_attach_mxl5xx()
422 dev_err(dev->dev, "No MXL5XX found!\n"); in ddb_fe_attach_mxl5xx()
427 dev_err(dev->dev, "No mxl5xx_set_input function pointer!\n"); in ddb_fe_attach_mxl5xx()
432 lnb_command(dev, port->lnr, input->nr, LNB_CMD_INIT); in ddb_fe_attach_mxl5xx()
433 lnb_set_voltage(dev, port->lnr, input->nr, SEC_VOLTAGE_OFF); in ddb_fe_attach_mxl5xx()
435 ddb_lnb_init_fmode(dev, link, fmode); in ddb_fe_attach_mxl5xx()
453 struct ddb *dev = input->port->dev; in ddb_fe_attach_mci() local
456 struct ddb_link *link = &dev->link[port->lnr]; in ddb_fe_attach_mci()
473 dev_err(dev->dev, "No MCI card found!\n"); in ddb_fe_attach_mci()
477 dev_err(dev->dev, "No MCI set_input function pointer!\n"); in ddb_fe_attach_mci()
481 lnb_command(dev, port->lnr, input->nr, LNB_CMD_INIT); in ddb_fe_attach_mci()
482 lnb_set_voltage(dev, port->lnr, input->nr, SEC_VOLTAGE_OFF); in ddb_fe_attach_mci()
484 ddb_lnb_init_fmode(dev, link, fmode); in ddb_fe_attach_mci()