Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3709371imm; Mon, 18 Jun 2018 02:44:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfT3/mNS1+vIRDl9MRccKQCXj6TH0Tn8Rf8F9/ndjH/WIoViWQ5rl/9FfgVGtvF7U9rVgo X-Received: by 2002:a65:5ac9:: with SMTP id d9-v6mr10368690pgt.238.1529315075580; Mon, 18 Jun 2018 02:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529315075; cv=none; d=google.com; s=arc-20160816; b=H/SPdj3KXkaUgLTlDOgV3aXIextFzogJVQEOgqmosKbhTDOLqhFz7+2/1hepnkjW2S Ty76/eFUs8PZy9W5Ggq7TgdP4D8tnNKyehPXseu/kghR4Xig8u2r2/fy+WORm0DVt+Jp 71HaGE3XjehtsDloS+GDHqxjVPTz6c3fRSm+dkYZNzy/xRvyrJj4i6Jwt4EVmySSL44W cn13vRE3cMIvM6WxX1o4ijGKDHc5gxlmP6W0VNBgFBIiWjpKcjWU2//CGwuKi+CV7atE 3pD57FOiKheyuV79+k/wyDI1vu2C9a285oU0BodoAsMx4yThXlxnJXpxt0F4jsznQRHO 9wsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2d94dbU2lOSzXFtTQh0IX2o7sxmfKEz4mdm94cqpQ/I=; b=D2wSyTnqYxcm2NK3poDM9b/27os+9DRbXvwv5WGxntiJf7bWr4pp5PPRlBgizg+cjn VV32G1oXN17+7e3nkuLnvuR1Z/IVS9PiMt2OGjRXSj1nvHiVMIVJw5V5ADrLeOscWYLj WykuMsTK9x3ckjw/uxR+u7liGQ+POmQPTRdpm7a2xdYVn71wjtmdtnNx6nAub5HEQtKc 57YQWPh7nLW2OzYhNQwyACx2MMh16h31AQgMSugSZ0rivEaL24KmWO6IFLtp6T1CER7S K9tA/u2rr88VQAUUGNvQhZUE7eS8LP8zdqfY3n2waD6PSTuwtAbqNgJl+Fxj6QFiJVh7 Q/Nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e192-v6si11790840pgc.233.2018.06.18.02.44.21; Mon, 18 Jun 2018 02:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965428AbeFRIWR (ORCPT + 99 others); Mon, 18 Jun 2018 04:22:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55486 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964950AbeFRIWP (ORCPT ); Mon, 18 Jun 2018 04:22:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6E15ABAD; Mon, 18 Jun 2018 08:22:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Lechner , Sekhar Nori , Sasha Levin Subject: [PATCH 4.16 152/279] ARM: davinci: fix GPIO lookup for I2C Date: Mon, 18 Jun 2018 10:12:17 +0200 Message-Id: <20180618080615.129091092@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sekhar Nori [ Upstream commit 9411ac07cd764be34bbd7ff09125a6b7b9175d4c ] The GPIO chip is called davinci_gpio.0 in legacy mode. Fix it, so that I2C can correctly lookup the recovery gpios. Note that it is the gpio-davinci driver that sets the gpiochip label to davinci_gpio.0. Also, the I2C device uses an id of 1 on DM644x and DM355. While at it, convert to using GPIO_TO_PIN() for referring to GPIO pin numbers, like it is done in rest of the board support files. Fixes: e53537653791 ("i2c/ARM: davinci: Deep refactoring of I2C recovery") Reviewed-by: David Lechner Signed-off-by: Sekhar Nori Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-davinci/board-dm355-evm.c | 9 ++++++--- arch/arm/mach-davinci/board-dm644x-evm.c | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -110,12 +110,15 @@ static struct platform_device davinci_na }, }; +#define DM355_I2C_SDA_PIN GPIO_TO_PIN(0, 15) +#define DM355_I2C_SCL_PIN GPIO_TO_PIN(0, 14) + static struct gpiod_lookup_table i2c_recovery_gpiod_table = { - .dev_id = "i2c_davinci", + .dev_id = "i2c_davinci.1", .table = { - GPIO_LOOKUP("davinci_gpio", 15, "sda", + GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SDA_PIN, "sda", GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP("davinci_gpio", 14, "scl", + GPIO_LOOKUP("davinci_gpio.0", DM355_I2C_SCL_PIN, "scl", GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), }, }; --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -596,12 +597,15 @@ static struct i2c_board_info __initdata }, }; +#define DM644X_I2C_SDA_PIN GPIO_TO_PIN(2, 12) +#define DM644X_I2C_SCL_PIN GPIO_TO_PIN(2, 11) + static struct gpiod_lookup_table i2c_recovery_gpiod_table = { - .dev_id = "i2c_davinci", + .dev_id = "i2c_davinci.1", .table = { - GPIO_LOOKUP("davinci_gpio", 44, "sda", + GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SDA_PIN, "sda", GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), - GPIO_LOOKUP("davinci_gpio", 43, "scl", + GPIO_LOOKUP("davinci_gpio.0", DM644X_I2C_SCL_PIN, "scl", GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), }, };