From patchwork Wed Feb 4 14:16:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 5776821 Return-Path: X-Original-To: patchwork-linux-media@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 6B1DD9F302 for ; Wed, 4 Feb 2015 14:16:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F84D20295 for ; Wed, 4 Feb 2015 14:16:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 741CA20259 for ; Wed, 4 Feb 2015 14:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755227AbbBDOQM (ORCPT ); Wed, 4 Feb 2015 09:16:12 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:52619 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753296AbbBDOQL (ORCPT ); Wed, 4 Feb 2015 09:16:11 -0500 Received: by mail-wg0-f54.google.com with SMTP id b13so1910913wgh.13 for ; Wed, 04 Feb 2015 06:16:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XMwQERa+gcl35JcEw8b8tr6WRy6AQvAVcB27D5BG2fc=; b=X/B7DSlfNu6gDfhkl+9ZXFr90ol/el7tXKgDtqszw35grE/MxBXAnksK5m+u78V+gy eSI9CiLG62Hg8MgVx9rNMFUqKgmwJQWrKWJZrYuRBmRjjLF57hdmVqyMnJcj2GCYBjra 8tBcm1rSmr3Inh1IpXDWtQuxvjQh+IA/Kq2s8dTuh04KQH7o2zZAK2766GoWZ54XuaMs qOa/k2vCNhOUt5efLgbqqfqlwVX8suJ39HbzJR8dmtlLVT27UbgqmC4/7n+R+reHRpD7 fRxqab+VlYdmtGtlg8s5CqYdzQ6YzUkDWcxyRHm2j5zl849YAbP93FF2aophXB9GPlUe xhFw== X-Gm-Message-State: ALoCoQlg7DOk4DySp8VKuiXN9DZDYTw/XZ+9YI8K9b9X8cJyZ8WSnSjG4K8zK8duuf0WaM2of8R4 X-Received: by 10.180.89.210 with SMTP id bq18mr4921292wib.45.1423059369808; Wed, 04 Feb 2015 06:16:09 -0800 (PST) Received: from tatooine.vodalys.lan (LDijon-156-64-30-180.w80-15.abo.wanadoo.fr. [80.15.95.180]) by mx.google.com with ESMTPSA id cy8sm3444684wib.9.2015.02.04.06.16.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:16:08 -0800 (PST) From: Jean-Michel Hautbois To: linux-media@vger.kernel.org Cc: hans.verkuil@cisco.com, linux-kernel@vger.kernel.org, m.chehab@samsung.com, Jean-Michel Hautbois Subject: [PATCH v2] media: adv7604: CP CSC uses a different register on adv7604 and adv7611 Date: Wed, 4 Feb 2015 15:16:00 +0100 Message-Id: <1423059360-26922-1-git-send-email-jean-michel.hautbois@vodalys.com> X-Mailer: git-send-email 2.2.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The bits are the same, but register is 0xf4 on ADV7611 instead of 0xfc. When reading back the value in log_status, differentiate both. Signed-off-by: Jean-Michel Hautbois --- v2: Use adv7604_chip_info to get register instead of testing the chip ID drivers/media/i2c/adv7604.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index e43dd2e..0ee1255 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -109,6 +109,7 @@ struct adv7604_chip_info { unsigned int cable_det_mask; unsigned int tdms_lock_mask; unsigned int fmt_change_digital_mask; + unsigned int cp_csc; const struct adv7604_format_info *formats; unsigned int nformats; @@ -2311,7 +2312,7 @@ static int adv7604_log_status(struct v4l2_subdev *sd) ((reg_io_0x02 & 0x04) ^ (reg_io_0x02 & 0x01)) ? "enabled" : "disabled"); v4l2_info(sd, "Color space conversion: %s\n", - csc_coeff_sel_rb[cp_read(sd, 0xfc) >> 4]); + csc_coeff_sel_rb[cp_read(sd, info->cp_csc) >> 4]); if (!is_digital_input(sd)) return 0; @@ -2615,6 +2616,7 @@ static const struct adv7604_chip_info adv7604_chip_info[] = { .tdms_lock_mask = 0xe0, .cable_det_mask = 0x1e, .fmt_change_digital_mask = 0xc1, + .cp_csc = 0xfc, .formats = adv7604_formats, .nformats = ARRAY_SIZE(adv7604_formats), .set_termination = adv7604_set_termination, @@ -2648,6 +2650,7 @@ static const struct adv7604_chip_info adv7604_chip_info[] = { .tdms_lock_mask = 0x43, .cable_det_mask = 0x01, .fmt_change_digital_mask = 0x03, + .cp_csc = 0xf4, .formats = adv7611_formats, .nformats = ARRAY_SIZE(adv7611_formats), .set_termination = adv7611_set_termination,