Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1588964ybv; Thu, 20 Feb 2020 23:50:44 -0800 (PST) X-Google-Smtp-Source: APXvYqw5pcJVFVCTlY+zJQFM/augSOqH4ctOimberNEIHcD+NQDijTtN2EHkPpM6BrH9rNfruFnx X-Received: by 2002:a9d:1c96:: with SMTP id l22mr27529554ota.322.1582271443896; Thu, 20 Feb 2020 23:50:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271443; cv=none; d=google.com; s=arc-20160816; b=tIVEQ00NFK950v/7J/rMh9babcix6de8pDBYV8z+wku6wXZOvtdu9OZBV8ci0Hu+YE K9c0SlhVPh4rIw/i5XQpcFy/qcXCu/3PrrJENarYS3og3PqwzvMa1Og3tuQuQA4vOBWt brEJJURbVJTvR3NStf1LxmzlkPcFu/3KeyKRQcBY62Igh8z7rAvAtaX6vSTimkxPrTtm MOmQtFBmcD4ijnj53MlxiIIf93yAXRxa3gMK3AAybZoH9jOvHqgRznvEytP6gM3cayql aEXEo9IuBDTRarb5CatondbSJDKDt6HBQWt4DpZ0ynnb3pHxHz/yWuKeSiF2Vy4KHH3r JHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FXxasaCdIIfk6TLLDWFBSjgggww1OHJ+GXlpnLqDx8o=; b=w+KLtQm4fqgoXfSRiQuDqi1+7ErPvIxAu9TAD8098Z5HkDINDQxnHVecD4sMu6FpKM 3r67DXblPor+YdjoZIjMeFcoWdnJy818LNK43HIaf4e3u0U7RIZmLhjqztV7Ij3r6pv3 2vDJUSIF9L7DolAfkijIdjInlNexuffiJmSWXK9BCBAQ0dQ6MuGr090jAHa/sNDvmLPs Uk3Af5x6ebLGddJbkXmhYP1SdWTz+sPmV6W6mHckR57qUqJWHB6JF70mLDIQKo0a0rju 9yiljREkYgZvdqrWm/geie+M8hMQm7WF+Yi6nTOCBPXmbV9qhWVyPpW/k/3egQojT3UW TkDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0O7l+owI; 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 v18si399189oic.188.2020.02.20.23.50.31; Thu, 20 Feb 2020 23:50:43 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=0O7l+owI; 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 S1729326AbgBUHt3 (ORCPT + 99 others); Fri, 21 Feb 2020 02:49:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:45710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728359AbgBUHtS (ORCPT ); Fri, 21 Feb 2020 02:49:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 50CE3208C4; Fri, 21 Feb 2020 07:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271357; bh=pisCp0L8OYluLdVr5lRE1PQQni0pQHeVSXt5Ghx26zE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0O7l+owIid4Qzte1YQ1gmPbeL+MLWKDjygw/oukblxeaqIwc41pxOQxU0f51evA/w EKm/mPyszso5lxIBizrZ61jOeMjhxsxQ2Zo7++msPtEuIvG7piB95TV9lHD1SxTOZa 8JtK+Klgw8/3ThnypbaoiT2tDj+5uCAAnAFKVRdY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Forest Crossman , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.5 135/399] media: cx23885: Add support for AVerMedia CE310B Date: Fri, 21 Feb 2020 08:37:40 +0100 Message-Id: <20200221072415.585833854@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Forest Crossman [ Upstream commit dc4cac67e13515835ed8081d510aa507aacb013b ] The AVerMedia CE310B is a simple composite + S-Video + stereo audio capture card, and uses only the CX23888 to perform all of these functions. I've tested both video inputs and the audio interface and confirmed that they're all working. However, there are some issues: * Sometimes when I switch inputs the video signal turns black and can't be recovered until the system is rebooted. I haven't been able to determine the cause of this behavior, nor have I found a solution to fix it or any workarounds other than rebooting. * The card sometimes seems to have trouble syncing to the video signal, and some of the VBI data appears as noise at the top of the frame, but I assume that to be a result of my very noisy RF environment and the card's unshielded input traces rather than a configuration issue. Signed-off-by: Forest Crossman Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/pci/cx23885/cx23885-cards.c | 24 +++++++++++++++++++++++ drivers/media/pci/cx23885/cx23885-video.c | 3 ++- drivers/media/pci/cx23885/cx23885.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index 8644205d3cd33..8e5a2c580821e 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c @@ -801,6 +801,25 @@ struct cx23885_board cx23885_boards[] = { .name = "Hauppauge WinTV-Starburst2", .portb = CX23885_MPEG_DVB, }, + [CX23885_BOARD_AVERMEDIA_CE310B] = { + .name = "AVerMedia CE310B", + .porta = CX23885_ANALOG_VIDEO, + .force_bff = 1, + .input = {{ + .type = CX23885_VMUX_COMPOSITE1, + .vmux = CX25840_VIN1_CH1 | + CX25840_NONE_CH2 | + CX25840_NONE0_CH3, + .amux = CX25840_AUDIO7, + }, { + .type = CX23885_VMUX_SVIDEO, + .vmux = CX25840_VIN8_CH1 | + CX25840_NONE_CH2 | + CX25840_VIN7_CH3 | + CX25840_SVIDEO_ON, + .amux = CX25840_AUDIO7, + } }, + }, }; const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); @@ -1124,6 +1143,10 @@ struct cx23885_subid cx23885_subids[] = { .subvendor = 0x0070, .subdevice = 0xf02a, .card = CX23885_BOARD_HAUPPAUGE_STARBURST2, + }, { + .subvendor = 0x1461, + .subdevice = 0x3100, + .card = CX23885_BOARD_AVERMEDIA_CE310B, }, }; const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); @@ -2348,6 +2371,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) case CX23885_BOARD_DVBSKY_T982: case CX23885_BOARD_VIEWCAST_260E: case CX23885_BOARD_VIEWCAST_460E: + case CX23885_BOARD_AVERMEDIA_CE310B: dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_bus[2].i2c_adap, "cx25840", 0x88 >> 1, NULL); diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 8098b15493de9..7fc408ee4934f 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -257,7 +257,8 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) (dev->board == CX23885_BOARD_MYGICA_X8507) || (dev->board == CX23885_BOARD_AVERMEDIA_HC81R) || (dev->board == CX23885_BOARD_VIEWCAST_260E) || - (dev->board == CX23885_BOARD_VIEWCAST_460E)) { + (dev->board == CX23885_BOARD_VIEWCAST_460E) || + (dev->board == CX23885_BOARD_AVERMEDIA_CE310B)) { /* Configure audio routing */ v4l2_subdev_call(dev->sd_cx25840, audio, s_routing, INPUT(input)->amux, 0, 0); diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index a95a2e4c6a0d3..c472498e57c4e 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h @@ -101,6 +101,7 @@ #define CX23885_BOARD_HAUPPAUGE_STARBURST2 59 #define CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885 60 #define CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885 61 +#define CX23885_BOARD_AVERMEDIA_CE310B 62 #define GPIO_0 0x00000001 #define GPIO_1 0x00000002 -- 2.20.1