From patchwork Tue Sep 3 14:38:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1157048 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46N8nd3Fhzz9s7T for ; Wed, 4 Sep 2019 00:43:01 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0A771C21E1B; Tue, 3 Sep 2019 14:40:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A20C2C21DB3; Tue, 3 Sep 2019 14:39:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9FA0CC21D8E; Tue, 3 Sep 2019 14:39:31 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id 7166BC21E02 for ; Tue, 3 Sep 2019 14:39:29 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46N8jY23wDz1rWTJ; Tue, 3 Sep 2019 16:39:29 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46N8jY1rltz1qqkP; Tue, 3 Sep 2019 16:39:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id A7Kb9linSQBO; Tue, 3 Sep 2019 16:39:28 +0200 (CEST) X-Auth-Info: oXc6ELsgqYioF+/ImmyZ8MM93ArWHO75KJ76Ht/sLwM= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 3 Sep 2019 16:39:28 +0200 (CEST) From: Lukasz Majewski To: u-boot@lists.denx.de, Stefano Babic Date: Tue, 3 Sep 2019 16:38:49 +0200 Message-Id: <20190903143850.9824-14-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190903143850.9824-1-lukma@denx.de> References: <20190903143850.9824-1-lukma@denx.de> Subject: [U-Boot] [PATCH v2 13/14] imx: Convert emergency pad of display5 to use dm_gpio* functions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" After this change the display5's emergency gpio use dm_gpio* functions instead of legacy ones (gpio*) to read its state. Signed-off-by: Lukasz Majewski --- Changes in v2: None board/liebherr/display5/display5.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c index 5713401ed954..b8dcd03fd9b6 100644 --- a/board/liebherr/display5/display5.c +++ b/board/liebherr/display5/display5.c @@ -36,7 +36,6 @@ static bool sw_ids_valid; static u32 cpu_id; static u32 unit_id; -#define EM_PAD IMX_GPIO_NR(3, 29) #define SW0 IMX_GPIO_NR(2, 4) #define SW1 IMX_GPIO_NR(2, 5) #define SW2 IMX_GPIO_NR(2, 6) @@ -236,21 +235,24 @@ static inline void setup_boot_modes(void) {} int misc_init_r(void) { + struct gpio_desc em_pad; int ret; setup_boot_modes(); - ret = gpio_request(EM_PAD, "Emergency_PAD"); + ret = dm_gpio_lookup_name("GPIO3_29", &em_pad); if (ret) { - printf("Can't request emergency PAD gpio\n"); + printf("Can't find emergency PAD gpio\n"); return ret; } - ret = gpio_direction_input(EM_PAD); + ret = dm_gpio_request(&em_pad, "Emergency_PAD"); if (ret) { - printf("Can't set emergency PAD direction\n"); + printf("Can't request emergency PAD gpio\n"); return ret; } + dm_gpio_set_dir_flags(&em_pad, GPIOD_IS_IN); + return 0; }