From patchwork Tue Dec 22 14:22:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 7904891 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E577BEEE5 for ; Tue, 22 Dec 2015 14:22:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D46E204CF for ; Tue, 22 Dec 2015 14:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D842204D1 for ; Tue, 22 Dec 2015 14:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbbLVOWL (ORCPT ); Tue, 22 Dec 2015 09:22:11 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37297 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754427AbbLVOWK (ORCPT ); Tue, 22 Dec 2015 09:22:10 -0500 Received: by mail-wm0-f46.google.com with SMTP id p187so112567874wmp.0; Tue, 22 Dec 2015 06:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZptGwC4RAHFnPlnjCFHkZevTITpNyG4LnEJyW1UjDok=; b=ccXqGI6DtJzIghUIJsFioucGDLhqpNc+NcLns3CS9N3FthCFkbWi1yI01MxdRp06g2 Xc4zjxZOuaD2gw8K1LRrVMNIa/XEdX57pZ+dSmYrE9ciCR50bInDKeL0yDacYyTB7uxO xKtmIxOOGiLc+EqwnT7Mxf036Y5oU/XxVmBDcpQCh4i4CA2C/QgJybS6lr4PFFGLuv+6 2epV8TTwFwewIE0TNo1DYKz2Nlfs6KBHyF3A86xOQKuAXj4AAraxnOQm5T+eqWGqecep QisEsGg0udmarGfgAytmaOcZm1yZeuEra76Ydt2Ek98y2ujXKvkWhx4jZ5cA4jPKUO4K MWJw== X-Received: by 10.194.88.73 with SMTP id be9mr27292413wjb.44.1450794129088; Tue, 22 Dec 2015 06:22:09 -0800 (PST) Received: from groucho.site (ip9234e209.dynamic.kabel-deutschland.de. [146.52.226.9]) by smtp.gmail.com with ESMTPSA id qm9sm33231850wjc.39.2015.12.22.06.22.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Dec 2015 06:22:07 -0800 (PST) From: Ulrich Hecht To: linux-media@vger.kernel.org, linux-sh@vger.kernel.org Cc: magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, hans.verkuil@cisco.com, ian.molton@codethink.co.uk, lars@metafoo.de, william.towle@codethink.co.uk, Ulrich Hecht Subject: [PATCH v2 2/2] media: adv7604: update timings on change of input signal Date: Tue, 22 Dec 2015 15:22:02 +0100 Message-Id: <1450794122-31293-3-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1450794122-31293-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1450794122-31293-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Without this, .get_selection will always return the boot-time state. Signed-off-by: Ulrich Hecht --- drivers/media/i2c/adv7604.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 8ad5c28..dcd659b 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1945,6 +1945,7 @@ static int adv76xx_isr(struct v4l2_subdev *sd, u32 status, bool *handled) u8 fmt_change_digital; u8 fmt_change; u8 tx_5v; + int ret; if (irq_reg_0x43) io_write(sd, 0x44, irq_reg_0x43); @@ -1968,6 +1969,14 @@ static int adv76xx_isr(struct v4l2_subdev *sd, u32 status, bool *handled) v4l2_subdev_notify_event(sd, &adv76xx_ev_fmt); + /* update timings */ + ret = adv76xx_query_dv_timings(sd, &state->timings); + if (ret == -ENOLINK) { + /* no signal, fall back to default timings */ + state->timings = (struct v4l2_dv_timings) + V4L2_DV_BT_CEA_640X480P59_94; + } + if (handled) *handled = true; }