Lines Matching +full:memcpy +full:- +full:bus +full:- +full:width

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (c) 2010-2015 Steven Toth <stoth@kernellabs.com>
22 i->deviceinst = 0; in saa7164_api_get_load_info()
23 i->devicespec = 0; in saa7164_api_get_load_info()
24 i->mode = 0; in saa7164_api_get_load_info()
25 i->status = 0; in saa7164_api_get_load_info()
32 printk(KERN_INFO "saa7164[%d]-CPU: %d percent", dev->nr, i->CPULoad); in saa7164_api_get_load_info()
45 while (more--) { in saa7164_api_collect_debug()
58 printk(KERN_INFO "saa7164[%d]-FWMSG: %s", dev->nr, in saa7164_api_collect_debug()
93 struct saa7164_dev *dev = port->dev; in saa7164_api_set_vbi_format()
98 port->nr, port->hwcfg.unitid); in saa7164_api_set_vbi_format()
105 ret = saa7164_cmd_send(port->dev, port->hwcfg.unitid, in saa7164_api_set_vbi_format()
111 ret = saa7164_cmd_send(port->dev, port->hwcfg.unitid, in saa7164_api_set_vbi_format()
121 ret = saa7164_cmd_send(port->dev, port->hwcfg.unitid, in saa7164_api_set_vbi_format()
127 ret = saa7164_cmd_send(port->dev, port->hwcfg.unitid, in saa7164_api_set_vbi_format()
149 dprintk(DBGLVL_API, "%s(nr=%d) Success\n", __func__, port->nr); in saa7164_api_set_vbi_format()
156 struct saa7164_dev *dev = port->dev; in saa7164_api_set_gop_size()
162 gs.ucRefFrameDist = port->encoder_params.refdist; in saa7164_api_set_gop_size()
163 gs.ucGOPSize = port->encoder_params.gop_size; in saa7164_api_set_gop_size()
164 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_gop_size()
175 struct saa7164_dev *dev = port->dev; in saa7164_api_set_encoder()
181 port->hwcfg.sourceid); in saa7164_api_set_encoder()
183 if (port->encoder_params.stream_type == V4L2_MPEG_STREAM_TYPE_MPEG2_PS) in saa7164_api_set_encoder()
184 port->encoder_profile = EU_PROFILE_PS_DVD; in saa7164_api_set_encoder()
186 port->encoder_profile = EU_PROFILE_TS_HQ; in saa7164_api_set_encoder()
188 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_encoder()
189 EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile); in saa7164_api_set_encoder()
194 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_encoder()
195 EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile); in saa7164_api_set_encoder()
200 if (port->encoder_params.bitrate_mode == in saa7164_api_set_encoder()
205 vb.dwVideoBitRate = port->encoder_params.bitrate; in saa7164_api_set_encoder()
206 vb.dwVideoBitRatePeak = port->encoder_params.bitrate_peak; in saa7164_api_set_encoder()
207 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_encoder()
218 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_encoder()
234 struct saa7164_dev *dev = port->dev; in saa7164_api_get_encoder()
241 port->hwcfg.sourceid); in saa7164_api_get_encoder()
243 port->encoder_profile = 0; in saa7164_api_get_encoder()
244 port->video_format = 0; in saa7164_api_get_encoder()
245 port->video_resolution = 0; in saa7164_api_get_encoder()
246 port->audio_format = 0; in saa7164_api_get_encoder()
248 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
249 EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile); in saa7164_api_get_encoder()
253 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
255 &port->video_resolution); in saa7164_api_get_encoder()
259 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
260 EU_VIDEO_FORMAT_CONTROL, sizeof(u8), &port->video_format); in saa7164_api_get_encoder()
264 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
269 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
270 EU_AUDIO_FORMAT_CONTROL, sizeof(u8), &port->audio_format); in saa7164_api_get_encoder()
274 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
280 ar.width = 0; in saa7164_api_get_encoder()
282 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, in saa7164_api_get_encoder()
288 dprintk(DBGLVL_ENC, "encoder_profile = %d\n", port->encoder_profile); in saa7164_api_get_encoder()
289 dprintk(DBGLVL_ENC, "video_format = %d\n", port->video_format); in saa7164_api_get_encoder()
290 dprintk(DBGLVL_ENC, "audio_format = %d\n", port->audio_format); in saa7164_api_get_encoder()
291 dprintk(DBGLVL_ENC, "video_resolution= %d\n", port->video_resolution); in saa7164_api_get_encoder()
304 dprintk(DBGLVL_ENC, "aspect.width / height = %d:%d\n", in saa7164_api_get_encoder()
305 ar.width, ar.height); in saa7164_api_get_encoder()
312 struct saa7164_dev *dev = port->dev; in saa7164_api_set_aspect_ratio()
317 port->encoder_params.ctl_aspect); in saa7164_api_set_aspect_ratio()
319 switch (port->encoder_params.ctl_aspect) { in saa7164_api_set_aspect_ratio()
321 ar.width = 1; in saa7164_api_set_aspect_ratio()
325 ar.width = 4; in saa7164_api_set_aspect_ratio()
329 ar.width = 16; in saa7164_api_set_aspect_ratio()
333 ar.width = 221; in saa7164_api_set_aspect_ratio()
341 port->encoder_params.ctl_aspect, in saa7164_api_set_aspect_ratio()
342 ar.width, ar.height); in saa7164_api_set_aspect_ratio()
345 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR, in saa7164_api_set_aspect_ratio()
356 struct saa7164_dev *dev = port->dev; in saa7164_api_set_usercontrol()
361 val = port->ctl_brightness; in saa7164_api_set_usercontrol()
364 val = port->ctl_contrast; in saa7164_api_set_usercontrol()
367 val = port->ctl_hue; in saa7164_api_set_usercontrol()
370 val = port->ctl_saturation; in saa7164_api_set_usercontrol()
373 val = port->ctl_sharpness; in saa7164_api_set_usercontrol()
375 return -EINVAL; in saa7164_api_set_usercontrol()
378 __func__, port->encunit.vsourceid, ctl, val); in saa7164_api_set_usercontrol()
380 ret = saa7164_cmd_send(port->dev, port->encunit.vsourceid, SET_CUR, in saa7164_api_set_usercontrol()
390 struct saa7164_dev *dev = port->dev; in saa7164_api_get_usercontrol()
394 ret = saa7164_cmd_send(port->dev, port->encunit.vsourceid, GET_CUR, in saa7164_api_get_usercontrol()
405 port->ctl_brightness = val; in saa7164_api_get_usercontrol()
408 port->ctl_contrast = val; in saa7164_api_get_usercontrol()
411 port->ctl_hue = val; in saa7164_api_get_usercontrol()
414 port->ctl_saturation = val; in saa7164_api_get_usercontrol()
417 port->ctl_sharpness = val; in saa7164_api_get_usercontrol()
424 struct saa7164_dev *dev = port->dev; in saa7164_api_set_videomux()
429 __func__, port->mux_input, inputs[port->mux_input - 1]); in saa7164_api_set_videomux()
437 ret = saa7164_cmd_send(port->dev, port->vidproc.sourceid, SET_CUR, in saa7164_api_set_videomux()
438 SU_INPUT_SELECT_CONTROL, sizeof(u8), &port->mux_input); in saa7164_api_set_videomux()
443 ret = saa7164_cmd_send(port->dev, port->audfeat.sourceid, SET_CUR, in saa7164_api_set_videomux()
445 &inputs[port->mux_input - 1]); in saa7164_api_set_videomux()
459 struct saa7164_dev *dev = port->dev; in saa7164_api_audio_mute()
465 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, in saa7164_api_audio_mute()
476 struct saa7164_dev *dev = port->dev; in saa7164_api_set_audio_volume()
483 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_MIN, in saa7164_api_set_audio_volume()
488 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_MAX, in saa7164_api_set_audio_volume()
493 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR, in saa7164_api_set_audio_volume()
508 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, in saa7164_api_set_audio_volume()
514 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, in saa7164_api_set_audio_volume()
519 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, GET_CUR, in saa7164_api_set_audio_volume()
532 struct saa7164_dev *dev = port->dev; in saa7164_api_set_audio_std()
546 ret = saa7164_cmd_send(port->dev, port->audfeat.unitid, SET_CUR, in saa7164_api_set_audio_std()
553 if (port->encodernorm.id & V4L2_STD_NTSC) { in saa7164_api_set_audio_std()
561 ret = saa7164_cmd_send(port->dev, port->tunerunit.unitid, SET_CUR, in saa7164_api_set_audio_std()
571 struct saa7164_dev *dev = port->dev; in saa7164_api_set_audio_detection()
582 ret = saa7164_cmd_send(port->dev, port->tunerunit.unitid, SET_CUR, in saa7164_api_set_audio_detection()
594 struct saa7164_dev *dev = port->dev; in saa7164_api_get_videomux()
597 ret = saa7164_cmd_send(port->dev, port->vidproc.sourceid, GET_CUR, in saa7164_api_get_videomux()
598 SU_INPUT_SELECT_CONTROL, sizeof(u8), &port->mux_input); in saa7164_api_get_videomux()
603 __func__, port->mux_input); in saa7164_api_get_videomux()
610 struct saa7164_dev *dev = port->dev; in saa7164_api_set_dif()
618 port->nr, port->type, val); in saa7164_api_set_dif()
620 if (port->nr == 0) in saa7164_api_set_dif()
647 ret = saa7164_cmd_send(dev, port->ifunit.unitid, GET_LEN, in saa7164_api_set_dif()
651 return -EIO; in saa7164_api_set_dif()
654 ret = saa7164_cmd_send(dev, port->ifunit.unitid, SET_CUR, in saa7164_api_set_dif()
662 return ret == SAA_OK ? 0 : -EIO; in saa7164_api_set_dif()
668 struct saa7164_dev *dev = port->dev; in saa7164_api_configure_dif()
671 dprintk(DBGLVL_API, "%s(nr=%d, 0x%x)\n", __func__, port->nr, std); in saa7164_api_configure_dif()
678 dprintk(DBGLVL_API, " PAL-I\n"); in saa7164_api_configure_dif()
682 dprintk(DBGLVL_API, " PAL-M\n"); in saa7164_api_configure_dif()
686 dprintk(DBGLVL_API, " PAL-N\n"); in saa7164_api_configure_dif()
690 dprintk(DBGLVL_API, " PAL-Nc\n"); in saa7164_api_configure_dif()
694 dprintk(DBGLVL_API, " PAL-B\n"); in saa7164_api_configure_dif()
698 dprintk(DBGLVL_API, " PAL-DK\n"); in saa7164_api_configure_dif()
702 dprintk(DBGLVL_API, " SECAM-L\n"); in saa7164_api_configure_dif()
731 struct saa7164_dev *dev = port->dev; in saa7164_api_initialize_dif()
733 int ret = -EINVAL; in saa7164_api_initialize_dif()
737 port->nr, port->type); in saa7164_api_initialize_dif()
739 if (port->type == SAA7164_MPEG_ENCODER) { in saa7164_api_initialize_dif()
746 if (port->type == SAA7164_MPEG_DVB) { in saa7164_api_initialize_dif()
747 if (port->nr == SAA7164_PORT_TS1) in saa7164_api_initialize_dif()
748 p = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_initialize_dif()
750 p = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_initialize_dif()
752 if (port->type == SAA7164_MPEG_VBI) { in saa7164_api_initialize_dif()
754 if (port->nr == SAA7164_PORT_VBI1) in saa7164_api_initialize_dif()
755 p = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_initialize_dif()
757 p = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_initialize_dif()
769 struct saa7164_dev *dev = port->dev; in saa7164_api_transition_port()
774 __func__, port->nr, port->hwcfg.unitid, mode); in saa7164_api_transition_port()
776 ret = saa7164_cmd_send(port->dev, port->hwcfg.unitid, SET_CUR, in saa7164_api_transition_port()
780 __func__, port->nr, port->hwcfg.unitid, ret); in saa7164_api_transition_port()
802 return -ENOMEM; in saa7164_api_read_eeprom()
804 /* Assumption: Hauppauge eeprom is at 0xa0 on bus 0 */ in saa7164_api_read_eeprom()
806 return saa7164_api_i2c_read(&dev->i2c_bus[0], 0xa0 >> 1, sizeof(reg), in saa7164_api_read_eeprom()
813 struct tmComResVBIFormatDescrHeader *fmt = &port->vbi_fmt_ntsc; in saa7164_api_configure_port_vbi()
815 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", fmt->bFormatIndex); in saa7164_api_configure_port_vbi()
816 dprintk(DBGLVL_API, " VideoStandard = 0x%x\n", fmt->VideoStandard); in saa7164_api_configure_port_vbi()
817 dprintk(DBGLVL_API, " StartLine = %d\n", fmt->StartLine); in saa7164_api_configure_port_vbi()
818 dprintk(DBGLVL_API, " EndLine = %d\n", fmt->EndLine); in saa7164_api_configure_port_vbi()
819 dprintk(DBGLVL_API, " FieldRate = %d\n", fmt->FieldRate); in saa7164_api_configure_port_vbi()
820 dprintk(DBGLVL_API, " bNumLines = %d\n", fmt->bNumLines); in saa7164_api_configure_port_vbi()
824 port->bufcounter = port->hwcfg.BARLocation; in saa7164_api_configure_port_vbi()
825 port->pitch = port->hwcfg.BARLocation + (2 * sizeof(u32)); in saa7164_api_configure_port_vbi()
826 port->bufsize = port->hwcfg.BARLocation + (3 * sizeof(u32)); in saa7164_api_configure_port_vbi()
827 port->bufoffset = port->hwcfg.BARLocation + (4 * sizeof(u32)); in saa7164_api_configure_port_vbi()
828 port->bufptr32l = port->hwcfg.BARLocation + in saa7164_api_configure_port_vbi()
830 (sizeof(u32) * port->hwcfg.buffercount) + sizeof(u32); in saa7164_api_configure_port_vbi()
831 port->bufptr32h = port->hwcfg.BARLocation + in saa7164_api_configure_port_vbi()
833 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_vbi()
834 port->bufptr64 = port->hwcfg.BARLocation + in saa7164_api_configure_port_vbi()
836 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_vbi()
837 dprintk(DBGLVL_API, " = port->hwcfg.BARLocation = 0x%x\n", in saa7164_api_configure_port_vbi()
838 port->hwcfg.BARLocation); in saa7164_api_configure_port_vbi()
840 dprintk(DBGLVL_API, " = VS_FORMAT_VBI (becomes dev->en[%d])\n", in saa7164_api_configure_port_vbi()
841 port->nr); in saa7164_api_configure_port_vbi()
851 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", tsfmt->bFormatIndex); in saa7164_api_configure_port_mpeg2ts()
852 dprintk(DBGLVL_API, " bDataOffset = 0x%x\n", tsfmt->bDataOffset); in saa7164_api_configure_port_mpeg2ts()
853 dprintk(DBGLVL_API, " bPacketLength= 0x%x\n", tsfmt->bPacketLength); in saa7164_api_configure_port_mpeg2ts()
854 dprintk(DBGLVL_API, " bStrideLength= 0x%x\n", tsfmt->bStrideLength); in saa7164_api_configure_port_mpeg2ts()
859 port->bufcounter = port->hwcfg.BARLocation; in saa7164_api_configure_port_mpeg2ts()
860 port->pitch = port->hwcfg.BARLocation + (2 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ts()
861 port->bufsize = port->hwcfg.BARLocation + (3 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ts()
862 port->bufoffset = port->hwcfg.BARLocation + (4 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ts()
863 port->bufptr32l = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ts()
865 (sizeof(u32) * port->hwcfg.buffercount) + sizeof(u32); in saa7164_api_configure_port_mpeg2ts()
866 port->bufptr32h = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ts()
868 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_mpeg2ts()
869 port->bufptr64 = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ts()
871 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_mpeg2ts()
872 dprintk(DBGLVL_API, " = port->hwcfg.BARLocation = 0x%x\n", in saa7164_api_configure_port_mpeg2ts()
873 port->hwcfg.BARLocation); in saa7164_api_configure_port_mpeg2ts()
875 dprintk(DBGLVL_API, " = VS_FORMAT_MPEGTS (becomes dev->ts[%d])\n", in saa7164_api_configure_port_mpeg2ts()
876 port->nr); in saa7164_api_configure_port_mpeg2ts()
886 dprintk(DBGLVL_API, " bFormatIndex = 0x%x\n", fmt->bFormatIndex); in saa7164_api_configure_port_mpeg2ps()
887 dprintk(DBGLVL_API, " wPacketLength= 0x%x\n", fmt->wPacketLength); in saa7164_api_configure_port_mpeg2ps()
888 dprintk(DBGLVL_API, " wPackLength= 0x%x\n", fmt->wPackLength); in saa7164_api_configure_port_mpeg2ps()
889 dprintk(DBGLVL_API, " bPackDataType= 0x%x\n", fmt->bPackDataType); in saa7164_api_configure_port_mpeg2ps()
893 port->bufcounter = port->hwcfg.BARLocation; in saa7164_api_configure_port_mpeg2ps()
894 port->pitch = port->hwcfg.BARLocation + (2 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ps()
895 port->bufsize = port->hwcfg.BARLocation + (3 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ps()
896 port->bufoffset = port->hwcfg.BARLocation + (4 * sizeof(u32)); in saa7164_api_configure_port_mpeg2ps()
897 port->bufptr32l = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ps()
899 (sizeof(u32) * port->hwcfg.buffercount) + sizeof(u32); in saa7164_api_configure_port_mpeg2ps()
900 port->bufptr32h = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ps()
902 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_mpeg2ps()
903 port->bufptr64 = port->hwcfg.BARLocation + in saa7164_api_configure_port_mpeg2ps()
905 (sizeof(u32) * port->hwcfg.buffercount); in saa7164_api_configure_port_mpeg2ps()
906 dprintk(DBGLVL_API, " = port->hwcfg.BARLocation = 0x%x\n", in saa7164_api_configure_port_mpeg2ps()
907 port->hwcfg.BARLocation); in saa7164_api_configure_port_mpeg2ps()
909 dprintk(DBGLVL_API, " = VS_FORMAT_MPEGPS (becomes dev->enc[%d])\n", in saa7164_api_configure_port_mpeg2ps()
910 port->nr); in saa7164_api_configure_port_mpeg2ps()
941 for (idx = 0; idx < (len - sizeof(struct tmComResDescrHeader));) { in saa7164_api_dump_subdevs()
945 if (hdr->type != CS_INTERFACE) in saa7164_api_dump_subdevs()
949 switch (hdr->subtype) { in saa7164_api_dump_subdevs()
957 pathhdr->pathid); in saa7164_api_dump_subdevs()
958 currpath = pathhdr->pathid; in saa7164_api_dump_subdevs()
965 anttermhdr->terminalid); in saa7164_api_dump_subdevs()
967 anttermhdr->terminaltype); in saa7164_api_dump_subdevs()
968 switch (anttermhdr->terminaltype) { in saa7164_api_dump_subdevs()
994 anttermhdr->terminaltype); in saa7164_api_dump_subdevs()
997 anttermhdr->assocterminal); in saa7164_api_dump_subdevs()
999 anttermhdr->iterminal); in saa7164_api_dump_subdevs()
1001 anttermhdr->controlsize); in saa7164_api_dump_subdevs()
1008 vcoutputtermhdr->unitid); in saa7164_api_dump_subdevs()
1010 vcoutputtermhdr->terminaltype); in saa7164_api_dump_subdevs()
1011 switch (vcoutputtermhdr->terminaltype) { in saa7164_api_dump_subdevs()
1037 vcoutputtermhdr->terminaltype); in saa7164_api_dump_subdevs()
1040 vcoutputtermhdr->assocterminal); in saa7164_api_dump_subdevs()
1042 vcoutputtermhdr->sourceid); in saa7164_api_dump_subdevs()
1044 vcoutputtermhdr->iterminal); in saa7164_api_dump_subdevs()
1046 vcoutputtermhdr->BARLocation); in saa7164_api_dump_subdevs()
1048 vcoutputtermhdr->flags); in saa7164_api_dump_subdevs()
1050 vcoutputtermhdr->interruptid); in saa7164_api_dump_subdevs()
1052 vcoutputtermhdr->buffercount); in saa7164_api_dump_subdevs()
1054 vcoutputtermhdr->metadatasize); in saa7164_api_dump_subdevs()
1056 vcoutputtermhdr->controlsize); in saa7164_api_dump_subdevs()
1058 vcoutputtermhdr->numformats); in saa7164_api_dump_subdevs()
1060 next_offset = idx + (vcoutputtermhdr->len); in saa7164_api_dump_subdevs()
1061 for (i = 0; i < vcoutputtermhdr->numformats; i++) { in saa7164_api_dump_subdevs()
1064 switch (t->subtype) { in saa7164_api_dump_subdevs()
1069 tsport = &dev->ports[SAA7164_PORT_TS1]; in saa7164_api_dump_subdevs()
1071 tsport = &dev->ports[SAA7164_PORT_TS2]; in saa7164_api_dump_subdevs()
1072 memcpy(&tsport->hwcfg, vcoutputtermhdr, in saa7164_api_dump_subdevs()
1081 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1083 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1084 memcpy(&encport->hwcfg, vcoutputtermhdr, in saa7164_api_dump_subdevs()
1093 vbiport = &dev->ports[SAA7164_PORT_VBI1]; in saa7164_api_dump_subdevs()
1095 vbiport = &dev->ports[SAA7164_PORT_VBI2]; in saa7164_api_dump_subdevs()
1096 memcpy(&vbiport->hwcfg, vcoutputtermhdr, in saa7164_api_dump_subdevs()
1098 memcpy(&vbiport->vbi_fmt_ntsc, vbifmt, in saa7164_api_dump_subdevs()
1118 t->subtype); in saa7164_api_dump_subdevs()
1120 next_offset += t->len; in saa7164_api_dump_subdevs()
1129 tunerunithdr->unitid); in saa7164_api_dump_subdevs()
1131 tunerunithdr->sourceid); in saa7164_api_dump_subdevs()
1133 tunerunithdr->iunit); in saa7164_api_dump_subdevs()
1135 tunerunithdr->tuningstandards); in saa7164_api_dump_subdevs()
1137 tunerunithdr->controlsize); in saa7164_api_dump_subdevs()
1139 tunerunithdr->controls); in saa7164_api_dump_subdevs()
1141 if (tunerunithdr->unitid == tunerunithdr->iunit) { in saa7164_api_dump_subdevs()
1143 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1145 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1146 memcpy(&encport->tunerunit, tunerunithdr, in saa7164_api_dump_subdevs()
1149 " (becomes dev->enc[%d] tuner)\n", in saa7164_api_dump_subdevs()
1150 encport->nr); in saa7164_api_dump_subdevs()
1157 psel->unitid); in saa7164_api_dump_subdevs()
1159 psel->nrinpins); in saa7164_api_dump_subdevs()
1161 psel->sourceid); in saa7164_api_dump_subdevs()
1167 pdh->unitid); in saa7164_api_dump_subdevs()
1169 pdh->sourceid); in saa7164_api_dump_subdevs()
1171 pdh->controlsize); in saa7164_api_dump_subdevs()
1172 if (pdh->controlsize == 0x04) { in saa7164_api_dump_subdevs()
1174 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1176 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1177 memcpy(&encport->vidproc, pdh, in saa7164_api_dump_subdevs()
1179 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", in saa7164_api_dump_subdevs()
1180 encport->nr); in saa7164_api_dump_subdevs()
1187 afd->unitid); in saa7164_api_dump_subdevs()
1189 afd->sourceid); in saa7164_api_dump_subdevs()
1191 afd->controlsize); in saa7164_api_dump_subdevs()
1193 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1195 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1196 memcpy(&encport->audfeat, afd, in saa7164_api_dump_subdevs()
1198 dprintk(DBGLVL_API, " (becomes dev->enc[%d])\n", in saa7164_api_dump_subdevs()
1199 encport->nr); in saa7164_api_dump_subdevs()
1204 dprintk(DBGLVL_API, " subtype = 0x%x\n", edh->subtype); in saa7164_api_dump_subdevs()
1205 dprintk(DBGLVL_API, " unitid = 0x%x\n", edh->unitid); in saa7164_api_dump_subdevs()
1207 edh->vsourceid); in saa7164_api_dump_subdevs()
1209 edh->asourceid); in saa7164_api_dump_subdevs()
1210 dprintk(DBGLVL_API, " iunit = 0x%x\n", edh->iunit); in saa7164_api_dump_subdevs()
1211 if (edh->iunit == edh->unitid) { in saa7164_api_dump_subdevs()
1213 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1215 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1216 memcpy(&encport->encunit, edh, in saa7164_api_dump_subdevs()
1219 " (becomes dev->enc[%d])\n", in saa7164_api_dump_subdevs()
1220 encport->nr); in saa7164_api_dump_subdevs()
1227 exthdr->unitid); in saa7164_api_dump_subdevs()
1229 exthdr->deviceid); in saa7164_api_dump_subdevs()
1231 exthdr->devicetype); in saa7164_api_dump_subdevs()
1232 if (exthdr->devicetype & 0x1) in saa7164_api_dump_subdevs()
1234 if (exthdr->devicetype & 0x2) in saa7164_api_dump_subdevs()
1236 if (exthdr->devicetype & 0x4) in saa7164_api_dump_subdevs()
1238 if (exthdr->devicetype & 0x8) in saa7164_api_dump_subdevs()
1240 if (exthdr->devicetype & 0x20) in saa7164_api_dump_subdevs()
1242 if (exthdr->devicetype & 0x40) in saa7164_api_dump_subdevs()
1244 if (exthdr->devicetype & 0x80) in saa7164_api_dump_subdevs()
1246 if (exthdr->devicetype & 0x100) in saa7164_api_dump_subdevs()
1248 if (exthdr->devicetype & 0x200) in saa7164_api_dump_subdevs()
1250 if (exthdr->devicetype & 0x400) in saa7164_api_dump_subdevs()
1252 if (exthdr->devicetype & 0x800) in saa7164_api_dump_subdevs()
1254 if (exthdr->devicetype & 0x1000) in saa7164_api_dump_subdevs()
1256 if (exthdr->devicetype & 0x2000) in saa7164_api_dump_subdevs()
1259 if (exthdr->devicetype & 0x10000) in saa7164_api_dump_subdevs()
1262 if (exthdr->devicetype & 0x20000) in saa7164_api_dump_subdevs()
1265 if (exthdr->devicetype & 0x40000000) in saa7164_api_dump_subdevs()
1268 if (exthdr->devicetype & 0x80000000) in saa7164_api_dump_subdevs()
1272 exthdr->numgpiopins); in saa7164_api_dump_subdevs()
1274 exthdr->numgpiogroups); in saa7164_api_dump_subdevs()
1276 exthdr->controlsize); in saa7164_api_dump_subdevs()
1277 if (exthdr->devicetype & 0x80) { in saa7164_api_dump_subdevs()
1279 encport = &dev->ports[SAA7164_PORT_ENC1]; in saa7164_api_dump_subdevs()
1281 encport = &dev->ports[SAA7164_PORT_ENC2]; in saa7164_api_dump_subdevs()
1282 memcpy(&encport->ifunit, exthdr, in saa7164_api_dump_subdevs()
1285 " (becomes dev->enc[%d])\n", in saa7164_api_dump_subdevs()
1286 encport->nr); in saa7164_api_dump_subdevs()
1296 dprintk(DBGLVL_API, "default %d\n", hdr->subtype); in saa7164_api_dump_subdevs()
1299 dprintk(DBGLVL_API, " 1.%x\n", hdr->len); in saa7164_api_dump_subdevs()
1300 dprintk(DBGLVL_API, " 2.%x\n", hdr->type); in saa7164_api_dump_subdevs()
1301 dprintk(DBGLVL_API, " 3.%x\n", hdr->subtype); in saa7164_api_dump_subdevs()
1302 dprintk(DBGLVL_API, " 4.%x\n", hdr->unitid); in saa7164_api_dump_subdevs()
1304 idx += hdr->len; in saa7164_api_dump_subdevs()
1351 int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg, in saa7164_api_i2c_read() argument
1354 struct saa7164_dev *dev = bus->dev; in saa7164_api_i2c_read()
1364 return -EIO; in saa7164_api_i2c_read()
1367 /* Bytes 00-03 source register length in saa7164_api_i2c_read()
1368 * 04-07 source bytes to read in saa7164_api_i2c_read()
1372 memcpy((buf + 2 * sizeof(u32) + 0), reg, reglen); in saa7164_api_i2c_read()
1376 unitid = saa7164_i2caddr_to_unitid(bus, addr); in saa7164_api_i2c_read()
1381 return -EIO; in saa7164_api_i2c_read()
1384 ret = saa7164_cmd_send(bus->dev, unitid, GET_LEN, in saa7164_api_i2c_read()
1388 return -EIO; in saa7164_api_i2c_read()
1397 ret = saa7164_cmd_send(bus->dev, unitid, GET_CUR, in saa7164_api_i2c_read()
1405 memcpy(data, (buf + 2 * sizeof(u32) + reglen), datalen); in saa7164_api_i2c_read()
1408 return ret == SAA_OK ? 0 : -EIO; in saa7164_api_i2c_read()
1412 int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen, in saa7164_api_i2c_write() argument
1415 struct saa7164_dev *dev = bus->dev; in saa7164_api_i2c_write()
1426 return -EIO; in saa7164_api_i2c_write()
1430 unitid = saa7164_i2caddr_to_unitid(bus, addr); in saa7164_api_i2c_write()
1435 return -EIO; in saa7164_api_i2c_write()
1438 reglen = saa7164_i2caddr_to_reglen(bus, addr); in saa7164_api_i2c_write()
1443 return -EIO; in saa7164_api_i2c_write()
1446 ret = saa7164_cmd_send(bus->dev, unitid, GET_LEN, in saa7164_api_i2c_write()
1450 return -EIO; in saa7164_api_i2c_write()
1457 /* Bytes 00-03 dest register length in saa7164_api_i2c_write()
1458 * 04-07 dest bytes to write in saa7164_api_i2c_write()
1462 *((u32 *)(buf + 1 * sizeof(u32))) = datalen - reglen; in saa7164_api_i2c_write()
1463 memcpy((buf + 2 * sizeof(u32)), data, datalen); in saa7164_api_i2c_write()
1469 ret = saa7164_cmd_send(bus->dev, unitid, SET_CUR, in saa7164_api_i2c_write()
1474 return ret == SAA_OK ? 0 : -EIO; in saa7164_api_i2c_write()