From patchwork Thu Feb 1 22:04:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Love X-Patchwork-Id: 10196081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7CE4C605F5 for ; Thu, 1 Feb 2018 22:10:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69DAF286CB for ; Thu, 1 Feb 2018 22:10:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 677B1288CD; Thu, 1 Feb 2018 22:10:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE13A287C6 for ; Thu, 1 Feb 2018 22:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbeBAWEn (ORCPT ); Thu, 1 Feb 2018 17:04:43 -0500 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:60318 "EHLO homiemail-a58.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeBAWEn (ORCPT ); Thu, 1 Feb 2018 17:04:43 -0500 Received: from homiemail-a58.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a58.g.dreamhost.com (Postfix) with ESMTP id C00FA6004137; Thu, 1 Feb 2018 14:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nextdimension.cc; h=from :to:cc:subject:date:message-id:in-reply-to:references; s= nextdimension.cc; bh=M64h2V4heiy8yhAPK9WLy+6f69g=; b=lNf4QLUcfRt gLCpN9sdIO+kzTA6L6yAPNXEChY6TichifEt+PUJ40b97TIsK7VUTpJHHBCGiEyz Ni6oBFdbNe15ko7gYoSgv9X15b7xfSFBE8Iilt8w2jF6FVzFidI1ylZxGXAlyxVd rpI27qqiOPAvcvWqIIhdn/mIBCyOMdQU= Received: from localhost.localdomain (66-90-189-166.dyn.grandenetworks.net [66.90.189.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad@nextdimension.ws) by homiemail-a58.g.dreamhost.com (Postfix) with ESMTPSA id 80A79600412A; Thu, 1 Feb 2018 14:04:42 -0800 (PST) From: Brad Love To: linux-media@vger.kernel.org Cc: Brad Love Subject: [PATCH v2 2/9] em28xx: Bulk transfer implementation fix Date: Thu, 1 Feb 2018 16:04:37 -0600 Message-Id: <1517522677-21211-1-git-send-email-brad@nextdimension.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515110659-20145-3-git-send-email-brad@nextdimension.cc> References: <1515110659-20145-3-git-send-email-brad@nextdimension.cc> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set appropriate bulk/ISOC transfer multiplier on capture start. This sets ISOC transfer to USB endpoint configuration This sets bulk transfer to 48128 bytes (188 * 256) The bulk multiplier is maximum allowed according to Empia. Signed-off-by: Brad Love --- Changes since v1 - use ISOC endpoint configuration instead of constant - removed TS2 from comment drivers/media/usb/em28xx/em28xx-core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index ef38e56..6727d14 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -638,6 +638,19 @@ int em28xx_capture_start(struct em28xx *dev, int start) dev->chip_id == CHIP_ID_EM28174 || dev->chip_id == CHIP_ID_EM28178) { /* The Transport Stream Enable Register moved in em2874 */ + if (dev->dvb_xfer_bulk) { + /* Max Tx Size = 188 * 256 = 48128 - LCM(188,512) * 2 */ + em28xx_write_reg(dev, (dev->ts == PRIMARY_TS) ? + EM2874_R5D_TS1_PKT_SIZE : + EM2874_R5E_TS2_PKT_SIZE, + 0xFF); + } else { + /* ISOC Maximum Transfer Size = 188 * 5 */ + em28xx_write_reg(dev, (dev->ts == PRIMARY_TS) ? + EM2874_R5D_TS1_PKT_SIZE : + EM2874_R5E_TS2_PKT_SIZE, + dev->dvb_max_pkt_size_isoc / 188); + } if (dev->ts == PRIMARY_TS) rc = em28xx_write_reg_bits(dev, EM2874_R5F_TS_ENABLE,