Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp432085imm; Mon, 2 Jul 2018 14:25:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL1kRw2LNbAaU/NXAY1tmcT7IiTzNQvKNnV7rrngUuBSa1otjb9mUMBfXXhJkZCyiTh8/9W X-Received: by 2002:a17:902:650a:: with SMTP id b10-v6mr27777337plk.45.1530566701707; Mon, 02 Jul 2018 14:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530566701; cv=none; d=google.com; s=arc-20160816; b=sY7GFSsUReHuzyGwIsbAV+rggK9+VSARJLw9HeoOzHvP2KHEOOqyXaByNV2OiJDPFg 1gwkluVL0kAzg7nOMCcZWZHLOutPj0DrgA46RTAeuR8902ET4fJDHX6C0I0+hflzx0H7 XZ9+cCXjdFK1TrTRX58ou/CJWAxL43O/qqlo20ZMx17gDT9zozZhqNxr+8DEdiepH7gq 8aXg0gNbeuu4CmuFuiTobAbZ6vJ70EeFbnMqghkyF7wt/0dBb7XCjlSTWKYaaJc6xYP8 bJpDiM/nMew0/Bk1WGvqMvLbAGonFUOag5bqH57dK5jhadEGe5Vsy0qEAvISUIZ/bB9k pAEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ac9tw+fHOGGwK96xnL8lP7USWJ+g9Md+n9DoTHmPYow=; b=LYUh4u5sCyiREUmSET5v7Ee3b8cJPdKO924BOU1eCam3AymVuyZgInLwKCHdk0qLIJ O9qIH7k7guSLWcnf4XuikKT2lCQ7J6MbDxY+a1bYmtScLs+eDux3tGm/WNZ157SI7889 crlnHxNM+90Ei27N86ZDnRjuHQA2+rE6tHMde/Hce/UcjbtPZm67z4W0RY19tw7qk7Qt +UGSNpspYLORQcNYN5RvasuXwJlipMI+M4zqeFiAiOZCY4VoxXKLF8ZRQCZmJlD20Gr2 3uN0+R70vil2g8wb1IZ1HJ65XLEFYLu9+VUAhdMWBr656Gy2zNx2TN0X53xocXOywJ1q W27Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10-v6si16592369plu.160.2018.07.02.14.24.47; Mon, 02 Jul 2018 14:25:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbeGBVXg (ORCPT + 99 others); Mon, 2 Jul 2018 17:23:36 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:41382 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753191AbeGBVXb (ORCPT ); Mon, 2 Jul 2018 17:23:31 -0400 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fa6IB-00076m-0Y; Mon, 02 Jul 2018 23:23:27 +0200 From: "Maciej S. Szmigiero" To: Michael Krufky , Mauro Carvalho Chehab Cc: Andy Walls , linux-kernel , linux-media@vger.kernel.org, Hans Verkuil Subject: [PATCH v7 0/6] [media] Add analog mode support for Medion MD95700 Date: Mon, 2 Jul 2018 23:23:20 +0200 Message-Id: X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for analog part of Medion 95700 in the cxusb driver. What works: * Video capture at various sizes with sequential fields, * Input switching (TV Tuner, Composite, S-Video), * TV and radio tuning, * Video standard switching and auto detection, * Radio mode switching (stereo / mono), * Unplugging while capturing, * DVB / analog coexistence, * Raw BT.656 stream support. What does not work yet: * Audio, * VBI, * Picture controls. This series (as a one patch) was submitted for inclusion few years ago, then waited few months in a patch queue. Unfortunately, by the time it was supposed to be merged there were enough changes in media that it was no longer mergeable. I thought at that time that I will be able to rebase and retest it soon but unfortunately up till now I was never able to find enough time to do so. Also, with the passing of time the implementation diverged more and more from the current kernel code, necessitating even more reworking. That last iteration can be found here: https://patchwork.linuxtv.org/patch/8048/ Since that version there had been the following changes: * Adaptation to changes in V4L2 / DVB core, * Radio device was added, with a possibility to tune to a FM radio station and switch between stereo and mono modes (tested by taping audio signal directly at tuner output pin), * DVB / analog coexistence was improved - resolved a few cases where DVB core would switch off power or reset the tuner when the device was still being used but in the analog mode, * Fixed issues reported by v4l2-compliance, * Switching to raw BT.656 mode is now done by a custom streaming parameter set via VIDIOC_S_PARM ioctl instead of using a V4L2_BUF_TYPE_PRIVATE buffer (which was removed from V4L2), * General small code cleanups (like using BIT() or ARRAY_SIZE() macros instead of open coding them, code formatting improvements, etc.). Changes from v1: * Only support configuration of cx25840 pins that the cxusb driver is actually using so there is no need for an ugly CX25840_PIN() macro, * Split cxusb changes into two patches: first one implementing digital / analog coexistence in this driver, second one adding the actual implementation of the analog mode, * Fix a warning reported by kbuild test robot. Changes from v2: * Split out ivtv cx25840 platform data zero-initialization to a separate commit, * Add kernel-doc description of struct cx25840_state, * Make sure that all variables used in CX25840_VCONFIG_OPTION() and CX25840_VCONFIG_SET_BIT() macros are their explicit parameters, * Split out some code from cxusb_medion_copy_field() and cxusb_medion_v_complete_work() functions to separate ones to increase their readability, * Generate masks using GENMASK() and BIT() macros in cx25840.h and cxusb.h. Changes from v3: Add SPDX tag to a newly added "cxusb-analog.c" file. Changes from v4: * Make analog support conditional on a new DVB_USB_CXUSB_ANALOG Kconfig option, * Use '//' comments in the header of a newly added "cxusb-analog.c" file, * Don't print errors on memory allocation failures, * Get rid of the driver MODULE_VERSION(), * Small formating fix of a one line. Changes from v5: Rebase onto current media_tree/master. Changes from v6: Adapt to commit 4eb2f55728abbe changing V4L2_SUBDEV_IO_PIN_* from bit masks to bit numbers. Thanks to Dan Carpenter's kbuild bot for catching this. drivers/media/i2c/cx25840/cx25840-core.c | 396 ++++- drivers/media/i2c/cx25840/cx25840-core.h | 46 +- drivers/media/i2c/cx25840/cx25840-vbi.c | 3 + drivers/media/pci/ivtv/ivtv-i2c.c | 1 + drivers/media/tuners/tuner-simple.c | 5 +- drivers/media/usb/dvb-usb/Kconfig | 16 +- drivers/media/usb/dvb-usb/Makefile | 3 + drivers/media/usb/dvb-usb/cxusb-analog.c | 1914 ++++++++++++++++++++++ drivers/media/usb/dvb-usb/cxusb.c | 452 ++++- drivers/media/usb/dvb-usb/cxusb.h | 154 ++ drivers/media/usb/dvb-usb/dvb-usb-dvb.c | 20 +- drivers/media/usb/dvb-usb/dvb-usb-init.c | 13 + drivers/media/usb/dvb-usb/dvb-usb.h | 8 + include/media/drv-intf/cx25840.h | 74 +- 14 files changed, 3042 insertions(+), 63 deletions(-) create mode 100644 drivers/media/usb/dvb-usb/cxusb-analog.c