From patchwork Mon Sep 9 15:40:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19838 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB09D25A57 for ; Mon, 9 Sep 2013 15:40:29 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id bv4sf488041qab.3 for ; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Klh8A+AOZkye+v6QOzNhPKksiXi6KTEs/hs9lGGXX9c=; b=Al7Ob1osdsSg6BKza4Z4keGoX8mp/vp+t1pa0ZtZuei9cVyRsMDeyPcYZYA1eTkRGB UKtCpL+Qb2g+oVgKu2O7InDUNo7DPlN+XjlfueAM0xy5IRm0d3CxQktLUvFdy93l9Klk vnDF3faak6hx5DVLgEypuyzyesqn4oChzNHzIr0RjYYEDBuP5dO3Qz0Z6Q+RbevrphiK huaXr27nzqxXy+wzRvOfkvY6O5tV5iQd8eb0ZZpR4A3GIxcMnwUVXlTRiz4MldJi+3Sn nfV5Hwp/2ukGBAcM6fdw0IIvf7drEX0mvcZaezvwG0Z0YNMyAShyjQhDPQAuCRg3KK4o SOsg== X-Received: by 10.236.32.74 with SMTP id n50mr6493857yha.13.1378741229749; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.226 with SMTP id hv2ls1947609qeb.22.gmail; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) X-Received: by 10.58.235.193 with SMTP id uo1mr17657432vec.6.1378741229648; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id v6si3298845vet.38.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x14so4248304vbb.9 for ; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) X-Gm-Message-State: ALoCoQkiwb3sfFf0mO/NtTdchu5/2aM4qmX6zGM8BsrGvOkqVp0dOhVzSiH65ZbIQ8aPSqLyjWCh X-Received: by 10.58.97.238 with SMTP id ed14mr589435veb.34.1378741229548; Mon, 09 Sep 2013 08:40:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp94126vcz; Mon, 9 Sep 2013 08:40:28 -0700 (PDT) X-Received: by 10.112.51.101 with SMTP id j5mr16709712lbo.17.1378741228131; Mon, 09 Sep 2013 08:40:28 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx.google.com with ESMTPS id i8si5720372lam.87.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.170 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so5141756lbi.15 for ; Mon, 09 Sep 2013 08:40:27 -0700 (PDT) X-Received: by 10.152.3.42 with SMTP id 10mr7370015laz.22.1378741227475; Mon, 09 Sep 2013 08:40:27 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id vx8sm6247781lbb.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:26 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Lennert Buytenhek , Dan Williams , Mikael Pettersson Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 2/8] ARM: iop32x: request and issue reset using gpio Date: Mon, 9 Sep 2013 17:40:23 +0200 Message-Id: <1378741223-12921-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As the IOP GPIO driver supports gpiolib we can use the standard GPIO calls to issue a reset of the machine instead of using the custom gpio_line_set/config calls. Also request the GPIO when initializing the machine. Cc: Lennert Buytenhek Cc: Dan Williams Cc: Mikael Pettersson Signed-off-by: Linus Walleij --- arch/arm/mach-iop32x/n2100.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index 0691443..cd199c1 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -288,8 +289,14 @@ static void n2100_power_off(void) static void n2100_restart(enum reboot_mode mode, const char *cmd) { - gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW); - gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT); + int ret; + + ret = gpio_direction_output(N2100_HARDWARE_RESET, 0); + if (ret) { + pr_crit("could not drive reset GPIO low\n"); + return; + } + /* Wait for reset to happen */ while (1) ; } @@ -311,6 +318,8 @@ static void power_button_poll(unsigned long dummy) static void __init n2100_init_machine(void) { + int ret; + platform_device_register(&iop3xx_i2c0_device); platform_device_register(&n2100_flash_device); platform_device_register(&n2100_serial_device); @@ -326,6 +335,10 @@ static void __init n2100_init_machine(void) power_button_poll_timer.function = power_button_poll; power_button_poll_timer.expires = jiffies + (HZ / 10); add_timer(&power_button_poll_timer); + + ret = gpio_request(N2100_HARDWARE_RESET, "reset"); + if (ret) + pr_err("could not request reset GPIO\n"); } MACHINE_START(N2100, "Thecus N2100")