Lines Matching refs:client

150 		printf("%s: ", bktr_name(client));			\
164 static int msp3400c_reset(bktr_ptr_t client)
167 msp_dpl_reset(client, client->msp_addr);
173 msp3400c_read(bktr_ptr_t client, int dev, int addr)
176 return(msp_dpl_read(client, client->msp_addr, dev, addr));
180 msp3400c_write(bktr_ptr_t client, int dev, int addr, int val)
183 msp_dpl_write(client, client->msp_addr, dev, addr, val);
310 msp3400c_set_scart(bktr_ptr_t client, int in, int out)
312 struct msp3400c *msp = client->msp3400c_info;
320 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0013, msp->acb);
325 static void msp3400c_setcarrier(bktr_ptr_t client, int cdo1, int cdo2)
327 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0093, cdo1 & 0xfff);
328 msp3400c_write(client,I2C_MSP3400C_DEM, 0x009b, cdo1 >> 12);
329 msp3400c_write(client,I2C_MSP3400C_DEM, 0x00a3, cdo2 & 0xfff);
330 msp3400c_write(client,I2C_MSP3400C_DEM, 0x00ab, cdo2 >> 12);
331 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0056, 0); /*LOAD_REG_1/2*/
334 static void msp3400c_setvolume(bktr_ptr_t client,
349 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0000, val); /* loudspeaker */
350 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0006, val); /* headphones */
352 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0007, val ? 0x4000 : 0);
353 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0001, balance << 8);
356 static void msp3400c_setbass(bktr_ptr_t client, int bass)
361 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0002, val); /* loudspeaker */
364 static void msp3400c_settreble(bktr_ptr_t client, int treble)
369 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0003, val); /* loudspeaker */
372 static void msp3400c_setmode(bktr_ptr_t client, int type)
374 struct msp3400c *msp = client->msp3400c_info;
381 msp3400c_write(client,I2C_MSP3400C_DEM, 0x00bb, /* ad_cv */
385 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0001,
388 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0004); /* fir 2 */
389 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0040);
390 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0000);
392 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005,
395 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0083, /* MODE_REG */
398 msp3400c_setcarrier(client, msp_init_data[type].cdo1,
401 msp3400c_write(client,I2C_MSP3400C_DEM, 0x0056, 0); /*LOAD_REG_1/2*/
403 if (client->dolby) {
404 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,
406 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,
408 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,
411 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,
413 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,
415 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,
418 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,
420 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e,
425 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0010, 0x5a00); /* was: 0x3000 */
430 static void msp3400c_setstereo(bktr_ptr_t client, int mode)
434 struct msp3400c *msp = client->msp3400c_info;
442 msp3400c_setcarrier(client,msp->second,msp->main);
445 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3001);
450 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3000);
458 msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
461 msp3400c_setcarrier(client, MSP_CARRIER(7.2), MSP_CARRIER(7.02));
464 msp3400c_setcarrier(client, MSP_CARRIER(7.38), MSP_CARRIER(7.02));
467 msp3400c_setcarrier(client, MSP_CARRIER(7.38), MSP_CARRIER(7.02));
475 msp3400c_setcarrier(client,msp->second,msp->main);
501 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0005,0x4000);
509 msp3400c_set_scart(client,SCART_MONO,0);
522 if (client->dolby) {
523 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,0x0520);
524 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,0x0620);
525 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,src);
526 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,src);
528 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,src);
529 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,src);
530 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,src);
531 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,src);
560 msp3400c_restore_dfp(bktr_ptr_t client)
562 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
568 msp3400c_write(client,I2C_MSP3400C_DFP, i, msp->dfp_regs[i]);
588 autodetect_stereo(bktr_ptr_t client)
590 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
598 val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x18);
615 val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x23);
647 val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x200);
681 static void watch_stereo(bktr_ptr_t client)
683 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
685 if (autodetect_stereo(client)) {
687 msp3400c_setstereo(client,VIDEO_SOUND_STEREO);
689 msp3400c_setstereo(client,VIDEO_SOUND_LANG1);
691 msp3400c_setstereo(client,VIDEO_SOUND_MONO);
693 if (client->stereo_once)
700 bktr_ptr_t client = data;
701 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
728 watch_stereo(client);
741 msp3400c_setvolume(client, msp->muted, 0, 0);
742 msp3400c_setmode(client, MSP_MODE_AM_DETECT /* +1 */ );
750 if (client->amsound && (msp->norm == VIDEO_MODE_SECAM)) {
758 msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
765 val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1b);
788 if (client->amsound && (msp->norm == VIDEO_MODE_SECAM)) {
793 msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
799 val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1b);
814 msp3400c_setmode(client, MSP_MODE_FM_TERRA);
817 msp3400c_setstereo(client, VIDEO_SOUND_MONO);
822 msp3400c_setmode(client, MSP_MODE_FM_NICAM1);
824 msp3400c_setcarrier(client, msp->second, msp->main);
833 msp3400c_setmode(client, MSP_MODE_FM_NICAM2);
835 msp3400c_setcarrier(client, msp->second, msp->main);
842 msp3400c_setmode(client, MSP_MODE_FM_TERRA);
844 msp3400c_setstereo(client, VIDEO_SOUND_MONO);
850 msp3400c_setmode(client, MSP_MODE_AM_NICAM);
852 msp3400c_setstereo(client, VIDEO_SOUND_MONO);
853 msp3400c_setcarrier(client, msp->second, msp->main);
855 msp3400c_write(client,I2C_MSP3400C_DFP, 0x000d, 0x1900);
860 msp3400c_setmode(client, MSP_MODE_FM_NICAM1);
862 msp3400c_setcarrier(client, msp->second, msp->main);
872 msp3400c_setmode(client, MSP_MODE_FM_TERRA);
874 msp3400c_setcarrier(client, msp->second, msp->main);
876 msp3400c_setstereo(client, VIDEO_SOUND_MONO);
881 watch_stereo(client);
884 msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
885 msp3400c_restore_dfp(client);
937 bktr_ptr_t client = data;
938 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
968 watch_stereo(client);
983 msp3400c_reset(client);
1008 msp3400c_write(client, I2C_MSP3400C_DEM, 0x30, mode);
1009 msp3400c_write(client, I2C_MSP3400C_DEM, 0x20, std);
1031 val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x7e);
1046 if (client->amsound && (msp->norm == VIDEO_MODE_SECAM) && (val != 0x0009)) {
1051 msp3400c_write(client, I2C_MSP3400C_DEM, 0x20, val);
1055 msp3400c_write(client, I2C_MSP3400C_DFP, 0x0d, 0x1900); /* scart */
1056 msp3400c_write(client, I2C_MSP3400C_DFP, 0x0e, 0x2403); /* FM */
1057 msp3400c_write(client, I2C_MSP3400C_DFP, 0x10, 0x5a00); /* nicam */
1071 msp3400c_setstereo(client,VIDEO_SOUND_STEREO);
1077 msp3400c_setstereo(client,VIDEO_SOUND_MONO);
1086 msp3400c_setstereo(client,VIDEO_SOUND_STEREO);
1094 msp3400c_set_scart(client,SCART_IN2,0);
1095 msp3400c_write(client,I2C_MSP3400C_DFP, 0x08, 0x0220);
1096 msp3400c_write(client,I2C_MSP3400C_DFP, 0x09, 0x0220);
1097 msp3400c_write(client,I2C_MSP3400C_DFP, 0x0b, 0x0220);
1104 msp3400c_setstereo(client,VIDEO_SOUND_STEREO);
1109 watch_stereo(client);
1112 msp3400c_setbass(client, msp->bass);
1113 msp3400c_settreble(client, msp->treble);
1114 msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
1115 msp3400c_restore_dfp(client);
1207 int msp_detach(bktr_ptr_t client)
1209 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
1225 if (client->msp3400c_info != NULL) {
1226 free(client->msp3400c_info, M_DEVBUF);
1227 client->msp3400c_info = NULL;
1230 msp3400c_reset(client);
1235 void msp_wake_thread(bktr_ptr_t client)
1237 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
1239 msp3400c_setvolume(client,msp->muted,0,0);
1246 void msp_halt_thread(bktr_ptr_t client)
1248 struct msp3400c *msp = (struct msp3400c*)client->msp3400c_info;
1250 msp3400c_setvolume(client,msp->muted,0,0);