From patchwork Thu Sep 1 20:43:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 9310285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6C3E960760 for ; Fri, 2 Sep 2016 01:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E2372960B for ; Fri, 2 Sep 2016 01:59:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5337A2962A; Fri, 2 Sep 2016 01:59:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D15D32960B for ; Fri, 2 Sep 2016 01:59:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FE4D6E9E1; Fri, 2 Sep 2016 01:59:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 382D06E083 for ; Thu, 1 Sep 2016 20:43:35 +0000 (UTC) Received: by mail-lf0-x22a.google.com with SMTP id p41so51041883lfi.1 for ; Thu, 01 Sep 2016 13:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :mime-version:content-transfer-encoding; bh=k0BoIVDpnorJMXfzGfXAaD7KK0LLby8IdUc5Nge1vgY=; b=sbTNBr7oXGRzPFz9m1SlrpcyWgyU46G3RiR4h6Qdda5+MRHMmHzMivAipthrA5oO/Z vi7cFIPVF45N7eW6IbuoaKPwss+QQlfAfTpjRx025v6XIjq5sSUn5hiRZb+sdRFGcOST 9kpCQieCdCKApmOoGFzWcJpZxkuYj3NdgINBTjY/QBmcOcMaRKTR7FCQOzgAD8A2dO5r hTJGdEnA7d2iEXiO+TDQUFQOFp1boqil6jOvoBsfYgWQaUjiOxF0QP+s7U7KVf9pwSpr Aa+KxS8gPAVB1NCn6zhdtzDJnOZJEdH46g8OVN7bmA4PcknwWTESAl2TFFYKXvPzCB6I 9Qug== 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:organization :user-agent:mime-version:content-transfer-encoding; bh=k0BoIVDpnorJMXfzGfXAaD7KK0LLby8IdUc5Nge1vgY=; b=A7MjyiNMLZTlHhh9hhYmFMk4OEj3rzVa7+cTcXjjsNG0k+q+8iiUj4XhLjn8Ru//Qe F+n6Er2ZdFJ6sb+rPmJdQBbTLZEly3nutlMra/z2iq68zFjG/Dmo0KLHhQCuUQP23teH imIVVhQ67YsOJFDdRo0zTNbulLoNMl9/aZVQbOzVI/U8CewDc7v5eOIXGcbGs51Rh9O/ nh8RSTM91CDfuayKPP1xkaVGLr+Z15FFXU5fWevF7x5O2GX3S0g8vMBkhnrrSIAvOFCn srhrPWKvSM3yqOcRrovuguu2QyTzBYGyUqGrWEFK1Ydpq8KJMQSxcOcNfHtdoiqeqwvX 97sw== X-Gm-Message-State: AE9vXwOR3/4nx5mvqY8vRepEilDiKVNNCKs7AREhHeCEZunJt7eSUQwSYEMhtt7qElFu2g== X-Received: by 10.25.196.21 with SMTP id u21mr4439918lff.77.1472762613359; Thu, 01 Sep 2016 13:43:33 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.84.57]) by smtp.gmail.com with ESMTPSA id r196sm1274845lfd.41.2016.09.01.13.43.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 13:43:32 -0700 (PDT) From: Sergei Shtylyov To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/bridge: adv7511: add support for the 2nd chip Date: Thu, 01 Sep 2016 23:43:30 +0300 Message-ID: <4933961.PFafUbE9pV@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.10 (Linux/4.6.7-200.fc23.x86_64; KDE/4.14.20; x86_64; ; ) MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 02 Sep 2016 01:59:29 +0000 Cc: linux-renesas-soc@vger.kernel.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The Renesas Wheat board has 2 ADV7513 chips on the same I2C bus, however the ADV751x driver only supports 1 chip as it tries to assign the packet/ EDID/CEC memory I2C devices to the fixed I2C addresses. Assign these I2C addresses at the fixed offsets (derived from the programming guide) from the main register map address instead... Signed-off-by: Sergei Shtylyov --- The patch is against David Airlie's 'linux.git' repo's 'drm-next' branch. drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Index: linux/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c =================================================================== --- linux.orig/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ linux/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -922,15 +922,13 @@ static int adv7511_parse_dt(struct devic return 0; } -static const int edid_i2c_addr = 0x7e; -static const int packet_i2c_addr = 0x70; -static const int cec_i2c_addr = 0x78; - static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct adv7511_link_config link_config; struct adv7511 *adv7511; struct device *dev = &i2c->dev; + unsigned int main_i2c_addr = i2c->addr << 1; + unsigned int edid_i2c_addr = main_i2c_addr + 4; unsigned int val; int ret; @@ -991,8 +989,10 @@ static int adv7511_probe(struct i2c_clie regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR, edid_i2c_addr); regmap_write(adv7511->regmap, ADV7511_REG_PACKET_I2C_ADDR, - packet_i2c_addr); - regmap_write(adv7511->regmap, ADV7511_REG_CEC_I2C_ADDR, cec_i2c_addr); + main_i2c_addr - 0xa); + regmap_write(adv7511->regmap, ADV7511_REG_CEC_I2C_ADDR, + main_i2c_addr - 2); + adv7511_packet_disable(adv7511, 0xffff); adv7511->i2c_main = i2c;