From patchwork Wed May 11 07:11:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9065541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 137FF9F1C3 for ; Wed, 11 May 2016 07:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36FE5201C7 for ; Wed, 11 May 2016 07:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6E50820145 for ; Wed, 11 May 2016 07:11:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38FA06E6EF; Wed, 11 May 2016 07:11:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb2-smtp-cloud6.xs4all.net (lb2-smtp-cloud6.xs4all.net [194.109.24.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 851286E6EF for ; Wed, 11 May 2016 07:11:40 +0000 (UTC) Received: from tschai.lan ([90.149.38.145]) by smtp-cloud6.xs4all.net with ESMTP id svBZ1s00T37uBN201vBelh; Wed, 11 May 2016 09:11:38 +0200 Received: from tschai.fritz.box (localhost [127.0.0.1]) by tschai.lan (Postfix) with ESMTPSA id D5F84180D21; Wed, 11 May 2016 09:11:28 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCH 1/3] adv7511: always update CEC irq mask Date: Wed, 11 May 2016 09:11:26 +0200 Message-Id: <1462950688-23290-2-git-send-email-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1462950688-23290-1-git-send-email-hverkuil@xs4all.nl> References: <1462950688-23290-1-git-send-email-hverkuil@xs4all.nl> Cc: Hans Verkuil , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Hans Verkuil Instead of doing: if (state->cec_enabled_adap) adv7511_wr_and_or(sd, 0x95, 0xc0, enable ? 0x39 : 0x00); do: adv7511_wr_and_or(sd, 0x95, 0xc0, (state->cec_enabled_adap && enable) ? 0x39 : 0x00); This ensures that the cec irq mask is always updated correctly according to both conditions. Signed-off-by: Hans Verkuil --- drivers/media/i2c/adv7511.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 002117b..ddcde2d 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c @@ -937,8 +937,8 @@ static void adv7511_set_isr(struct v4l2_subdev *sd, bool enable) else if (adv7511_have_hotplug(sd)) irqs |= MASK_ADV7511_EDID_RDY_INT; - if (state->cec_enabled_adap) - adv7511_wr_and_or(sd, 0x95, 0xc0, enable ? 0x39 : 0x00); + adv7511_wr_and_or(sd, 0x95, 0xc0, + (state->cec_enabled_adap && enable) ? 0x39 : 0x00); /* * This i2c write can fail (approx. 1 in 1000 writes). But it