From patchwork Wed Mar 23 04:23:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 8647081 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 5FB5C9F36E for ; Wed, 23 Mar 2016 04:23:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86D662037C for ; Wed, 23 Mar 2016 04:23:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AEDB2035E for ; Wed, 23 Mar 2016 04:23:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750761AbcCWEXo (ORCPT ); Wed, 23 Mar 2016 00:23:44 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:32798 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbcCWEXn (ORCPT ); Wed, 23 Mar 2016 00:23:43 -0400 Received: by mail-qg0-f50.google.com with SMTP id j35so3304322qge.0 for ; Tue, 22 Mar 2016 21:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=nN/s8VtezfPw6egeVb7tKvCw+87Z9LBGFJ/GcSsr958=; b=Wn73OxrTmUPIt31PqmSY4nQbpKf8F8673u3EcIHjyuVTCNYlhD+Nrc/C0xFw15a/Fj NfkRduYEEtaI2LwcPeS0XpCO7CxO8mK+H1DB8rLIOclh7Y6Cci2ueE/hza2O5ixNIe0u pq2zXuKIYn1ycJWk/DWBgCLAXHPjMYgMZfkn02zLmZNDmcSdgkughCCPtFANKbEYyFAt ZWaLETAOLuBImuFaUHocnz99y4jGT9Be24bku16yjfW2+B4mT4uewaORvr/FggVaaXLk iI5ZSmQvhwTx5UAxBvsI0OZgLwgZj34fw7lODCv+fN/7L05NnSQDbLI/YjKkcSoj0H8s fOYw== 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=nN/s8VtezfPw6egeVb7tKvCw+87Z9LBGFJ/GcSsr958=; b=YOXQuvngIA7imrOOOrs8AirbGbwc6JLK6Nv0+vfzpQB8QkkCz4uprgSYoITFl3ZpCQ o4slS8oQvkdpSOga+tSYE1zkvb+sq1Ul0kzu4EAfd3CkNGXBXAIo328ALDwgSzBpCgx3 iGOygXboTt7pcUCOXH8uv5/9JjKjVDOMnLvrW2PeFp1/ekj1KYxBL8me6DBsp3e17Q0M wrhnEOeJq4NR5wAm3PUCI90/NtnJZxwRjA+TY3cpPYKbmjBYpcLvPksfYLYkIkv2tFTq NPag3azYmJURAML3VkVTYtzll2zraTWYL2QXPRn87Eqz6haGBP7zkLOKpb/rGe5Mprjy a/AA== X-Gm-Message-State: AD7BkJJqd/CSKl5/Us7V9PQEG0owCw1fg/owC9Ke+5VXl/R+ynEmhOkrdArZlIfEYEvPQQ== X-Received: by 10.140.28.98 with SMTP id 89mr731315qgy.36.1458707022841; Tue, 22 Mar 2016 21:23:42 -0700 (PDT) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id d64sm318458qgd.9.2016.03.22.21.23.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 21:23:41 -0700 (PDT) From: Ezequiel Garcia To: Cc: Hans Verkuil , Kevin Fitch , Ezequiel Garcia Subject: [PATCH] i2c: saa7115: Support CJC7113 detection Date: Wed, 23 Mar 2016 01:23:32 -0300 Message-Id: <1458707012-5063-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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: Kevin Fitch It's been reported that CJC7113 devices are returning all 1s when reading register 0: "1111111111111111" found @ 0x4a (stk1160) This new device is apparently compatible with SA7113, so let's add a quirk to allow its autodetection. Given there isn't any known differences with SAA7113, this commit does not introduces a new saa711x_model value. Reported-by: Philippe Desrochers Signed-off-by: Kevin Fitch Signed-off-by: Ezequiel Garcia --- drivers/media/i2c/saa7115.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index 24d2b76dbe97..04f266d0a1ef 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c @@ -1794,6 +1794,21 @@ static int saa711x_detect_chip(struct i2c_client *client, return GM7113C; } + /* Check if it is a CJC7113 */ + if (!memcmp(name, "1111111111111111", CHIP_VER_SIZE)) { + strlcpy(name, "cjc7113", CHIP_VER_SIZE); + + if (!autodetect && strcmp(name, id->name)) + return -EINVAL; + + v4l_dbg(1, debug, client, + "It seems to be a %s chip (%*ph) @ 0x%x.\n", + name, 16, chip_ver, client->addr << 1); + + /* CJC7113 seems to be SAA7113-compatible */ + return SAA7113; + } + /* Chip was not discovered. Return its ID and don't bind */ v4l_dbg(1, debug, client, "chip %*ph @ 0x%x is unknown.\n", 16, chip_ver, client->addr << 1);