From patchwork Fri Sep 29 22:15:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Anderson X-Patchwork-Id: 9978795 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 7512B60311 for ; Fri, 29 Sep 2017 22:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 661C3298C9 for ; Fri, 29 Sep 2017 22:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AEDB298CD; Fri, 29 Sep 2017 22:36:35 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 CD245298C9 for ; Fri, 29 Sep 2017 22:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbdI2Wgd (ORCPT ); Fri, 29 Sep 2017 18:36:33 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.1]:16945 "EHLO gateway32.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbdI2Wgc (ORCPT ); Fri, 29 Sep 2017 18:36:32 -0400 X-Greylist: delayed 1267 seconds by postgrey-1.27 at vger.kernel.org; Fri, 29 Sep 2017 18:36:32 EDT Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 9706467564 for ; Fri, 29 Sep 2017 17:15:24 -0500 (CDT) Received: from gator3086.hostgator.com ([50.87.144.121]) by cmsmtp with SMTP id y3YsdaegxRtUXy3YsdsZEX; Fri, 29 Sep 2017 17:15:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sensoray.com; s=default; h=Message-ID:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WMfilgxKZv3DZxsGwl2BPkNeRGT9dJSgnMED3+9RwGw=; b=xXLIvjC/7y1lrT20daOU7O+5L J0cIkZCKQw8t8JZqqaxR4wQioIdpTTU2TPATPyVO+T2HU06+G6z8hLJcIbtlwoUXxnU5Z3NElTZ1q tktG6NPWJyqOzL+G0n/3LPP9CysRZsr5dxwIMznxX84p7OuQQ60+SQopLPagce5r5O7wQ=; Received: from [127.0.0.1] (port=57201 helo=www.sensoray.com) by gator3086.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dy3Z4-003fez-JR; Fri, 29 Sep 2017 17:15:22 -0500 MIME-Version: 1.0 Date: Fri, 29 Sep 2017 17:15:21 -0500 From: dean@sensoray.com To: linux-media@vger.kernel.org Cc: linux-dev@sensoray.com Subject: [PATCH] media: usb: s2255drv: update to firmware loading Message-ID: <505a133e73cbe64e723d9c55a3b03991@sensoray.com> X-Sender: dean@sensoray.com User-Agent: Roundcube Webmail/1.1.7 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3086.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sensoray.com X-BWhitelist: no X-Source-IP: 127.0.0.1 X-Exim-ID: 1dy3Z4-003fez-JR X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (www.sensoray.com) [127.0.0.1]:57201 X-Source-Auth: dean@sensoray.com X-Email-Count: 1 X-Source-Cap: c2Vuc29yYXk7c2Vuc29yYXk7Z2F0b3IzMDg2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes 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 fixes intermittent soft reboot issue with firmware load increases wait time of reset, as required by HW Signed-off-by: Dean Anderson --- drivers/media/usb/s2255/s2255drv.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) static long s2255_vendor_req(struct s2255_dev *dev, unsigned char req, u16 index, u16 value, void *buf, @@ -476,7 +476,7 @@ static void planar422p_to_yuv_packed(const unsigned char *in, static void s2255_reset_dsppower(struct s2255_dev *dev) { s2255_vendor_req(dev, 0x40, 0x0000, 0x0001, NULL, 0, 1); - msleep(20); + msleep(50); s2255_vendor_req(dev, 0x50, 0x0000, 0x0000, NULL, 0, 1); msleep(600); s2255_vendor_req(dev, 0x10, 0x0000, 0x0000, NULL, 0, 1); @@ -1449,7 +1449,7 @@ static int s2255_open(struct file *file) case S2255_FW_FAILED: s2255_dev_err(&dev->udev->dev, "firmware load failed. retrying.\n"); - s2255_fwload_start(dev, 1); + s2255_fwload_start(dev); wait_event_timeout(dev->fw_data->wait_fw, ((atomic_read(&dev->fw_data->fw_state) == S2255_FW_SUCCESS) || @@ -2208,10 +2208,9 @@ static void s2255_stop_readpipe(struct s2255_dev *dev) return; } -static void s2255_fwload_start(struct s2255_dev *dev, int reset) +static void s2255_fwload_start(struct s2255_dev *dev) { - if (reset) - s2255_reset_dsppower(dev); + s2255_reset_dsppower(dev); dev->fw_data->fw_size = dev->fw_data->fw->size; atomic_set(&dev->fw_data->fw_state, S2255_FW_NOTLOADED); memcpy(dev->fw_data->pfw_data, @@ -2336,7 +2335,7 @@ static int s2255_probe(struct usb_interface *interface, retval = s2255_board_init(dev); if (retval) goto errorBOARDINIT; - s2255_fwload_start(dev, 0); + s2255_fwload_start(dev); /* loads v4l specific */ retval = s2255_probe_v4l(dev); if (retval) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index b2f239c..8a8e314 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -350,7 +350,7 @@ static void s2255_fillbuff(struct s2255_vc *vc, struct s2255_buffer *buf, int jpgsize); static int s2255_set_mode(struct s2255_vc *vc, struct s2255_mode *mode); static int s2255_board_shutdown(struct s2255_dev *dev); -static void s2255_fwload_start(struct s2255_dev *dev, int reset); +static void s2255_fwload_start(struct s2255_dev *dev); static void s2255_destroy(struct s2255_dev *dev);