From patchwork Wed Jul 2 09:33:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jackson X-Patchwork-Id: 4464441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36F44BEEAA for ; Wed, 2 Jul 2014 09:38:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F8AE202AE for ; Wed, 2 Jul 2014 09:38:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E0B720212 for ; Wed, 2 Jul 2014 09:38:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Gxu-0000NE-N3; Wed, 02 Jul 2014 09:36:34 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Gxs-0000Kl-Hm for linux-arm-kernel@lists.infradead.org; Wed, 02 Jul 2014 09:36:33 +0000 Received: from emea-cam-gw2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) (Using TLS) by service88.mimecast.com; Wed, 02 Jul 2014 10:33:46 +0100 Received: from [10.1.193.37] (10.1.2.79) by emea-cam-gw2.Emea.Arm.com (10.1.105.150) with Microsoft SMTP Server id 8.3.298.1; Wed, 2 Jul 2014 10:33:45 +0100 Message-ID: <53B3D1F8.7080106@arm.com> Date: Wed, 2 Jul 2014 10:33:44 +0100 From: Andrew Jackson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: linux-arm-kernel@lists.infradead.org Subject: drm/i2c: tda998x: Set CEC I2C address from TDA I2C address X-MC-Unique: 114070210334604002 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140702_023632_880389_78F41F90 X-CRM114-Status: GOOD ( 11.87 ) X-Spam-Score: -0.7 (/) Cc: moinejf@free.fr, Liviu.Dudau@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 The two LSBs of the TDA998x's I2C address are set by pins on the chip. The associated CEC peripheral's I2C address is set in the same way, so base the CEC address on that of the TDA998x. Signed-off-by: Andrew Jackson --- drivers/gpu/drm/i2c/tda998x_drv.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) -- 1.7.1 -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782 diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index c2a690d..08a2a26 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1260,6 +1260,7 @@ tda998x_encoder_init(struct i2c_client *client, struct device_node *np = client->dev.of_node; u32 video; int rev_lo, rev_hi, ret; + unsigned short cec_addr; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) @@ -1274,9 +1275,9 @@ tda998x_encoder_init(struct i2c_client *client, priv->current_page = 0xff; priv->hdmi = client; - priv->cec = i2c_new_dummy(client->adapter, 0x34); - if (!priv->cec) - priv->cec = i2c_new_dummy(client->adapter, 0x35); + /* CEC I2C address bound to TDA998x I2C addr by configuration pins */ + cec_addr = 0x34 + (client->addr & 3); + priv->cec = i2c_new_dummy(client->adapter, cec_addr); if (!priv->cec) { kfree(priv); return -ENODEV;